1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Add backup to VPS interface and simplify IPv6 enable/disable

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-10-09 18:40:05 +02:00
parent e9556c107c
commit 88706de9b2
9 changed files with 142 additions and 116 deletions

View file

@ -0,0 +1,35 @@
<%+header%>
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
<form class="inline" method="post" action="<%=url('admin/system/openmptcprouter/backupgr')%>">
<div class="cbi-map">
<h2 name="content"><%:Backup on server%></h2>
<fieldset class="cbi-section" id="networks">
<%
uci:foreach("openmptcprouter","server", function(s)
servername = s[".name"]
%>
<h3><%=servername%></h3>
<%
if luci.model.uci.cursor():get("openmptcprouter",servername,"lastbackup") ~= "" then
%>
<div class="cbi-section-node">
<%:Last available backup on server:%> <%=os.date('%d-%b-%Y', luci.model.uci.cursor():get("openmptcprouter",servername,"lastbackup"))%>
</div>
<input type="hidden" name="token" value="<%=token%>" />
<input type="submit" class="cbi-button cbi-button-action important" name="restore" value="<%:Restore backup%>"/>
<input type="submit" class="cbi-button cbi-button-action important" name="save" value="<%:Send backup%>"/>
<% else %>
<div class="cbi-section-node">
<%:No available backup on server.%>
</div>
<input type="hidden" name="token" value="<%=token%>" />
<input type="submit" class="cbi-button cbi-button-action important" name="save" value="<%:Send backup%>"/>
<% end %>
<%
end)
%>
</fieldset>
</div>
</form>
<%+footer%>

View file

@ -1,12 +1,10 @@
<%+header%>
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
<form class="inline" method="post" action="<%=url('admin/system/openmptcprouter/update_vps')%>">
<div class="cbi-map">
<h2 name="content"><%:All router settings%></h2>
<div class="cbi-section">
<pre><%=luci.sys.exec("uci show")%></pre>
</div>
<div class="cbi-map">
<h2 name="content"><%:All router settings%></h2>
<div class="cbi-section">
<pre><%=luci.sys.exec("uci show")%></pre>
</div>
</form>
</div>
<%+footer%>