2019-10-09 16:40:05 +00:00
|
|
|
<%+header%>
|
2019-10-29 19:09:20 +00:00
|
|
|
<%
|
|
|
|
luci.sys.call("/etc/init.d/openmptcprouter-vps backup_list >/dev/null 2>/dev/null")
|
2020-11-22 14:51:31 +00:00
|
|
|
local ucic = luci.model.uci.cursor()
|
|
|
|
menuentry = ucic:get("openmptcprouter","settings","menu") or "openmptcprouter"
|
2019-10-29 19:09:20 +00:00
|
|
|
%>
|
2019-10-09 16:40:05 +00:00
|
|
|
<% if stderr and #stderr > 0 then %><pre class="error"><%=pcdata(stderr)%></pre><% end %>
|
2020-11-22 14:51:31 +00:00
|
|
|
<form class="inline" method="post" action="<%=url('admin/system/' .. menuentry:lower() .. '/backupgr')%>">
|
2019-10-09 16:40:05 +00:00
|
|
|
<div class="cbi-map">
|
|
|
|
<h2 name="content"><%:Backup on server%></h2>
|
|
|
|
<fieldset class="cbi-section" id="networks">
|
2019-11-14 20:21:49 +00:00
|
|
|
<input type="hidden" name="token" value="<%=token%>" />
|
2019-10-09 16:40:05 +00:00
|
|
|
<%
|
|
|
|
uci:foreach("openmptcprouter","server", function(s)
|
|
|
|
servername = s[".name"]
|
|
|
|
%>
|
|
|
|
<h3><%=servername%></h3>
|
|
|
|
<%
|
2023-09-01 07:23:28 +00:00
|
|
|
if luci.model.uci.cursor():get("openmptcprouter",servername,"allbackup") ~= nil then
|
2019-10-09 16:40:05 +00:00
|
|
|
%>
|
|
|
|
<div class="cbi-section-node">
|
2023-09-01 07:23:28 +00:00
|
|
|
<div class="cbi-value">
|
|
|
|
<label class="cbi-value-title"><%:Backup availables on server%></label>
|
|
|
|
<div class="cbi-value-field">
|
|
|
|
<select class="cbi-input-select" name="<%=servername%>-backup" size="1">
|
|
|
|
<option value=""></option>
|
|
|
|
<%
|
|
|
|
lastmodif=""
|
|
|
|
allbackup=luci.model.uci.cursor():get("openmptcprouter",servername,"allbackup")
|
|
|
|
for _, backup in pairs(allbackup) do
|
2023-10-05 05:51:57 +00:00
|
|
|
filemodif=luci.util.split(backup, '|')
|
2023-09-01 07:23:28 +00:00
|
|
|
if filemodif[2] ~= lastmodif then
|
|
|
|
lastmodif=filemodif[2]
|
|
|
|
%>
|
|
|
|
<option value="<%=filemodif[1]%>"><%=os.date('%c',filemodif[2])%></option>
|
|
|
|
<%
|
|
|
|
end
|
|
|
|
end
|
|
|
|
%>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<%
|
|
|
|
elseif luci.model.uci.cursor():get("openmptcprouter",servername,"lastbackup") ~= nil then
|
|
|
|
%>
|
|
|
|
<div class="cbi-section-node">
|
|
|
|
<%:Last available backup on server:%> <%=os.date('%c', luci.model.uci.cursor():get("openmptcprouter",servername,"lastbackup"))%>
|
2019-10-09 16:40:05 +00:00
|
|
|
</div>
|
|
|
|
<% else %>
|
|
|
|
<div class="cbi-section-node">
|
|
|
|
<%:No available backup on server.%>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<%
|
|
|
|
end)
|
|
|
|
%>
|
2023-09-01 07:23:28 +00:00
|
|
|
<br/>
|
2019-11-14 20:21:49 +00:00
|
|
|
<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%>"/>
|
|
|
|
|
2019-10-09 16:40:05 +00:00
|
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
<%+footer%>
|