modules/admin-full: unify style of headings accross system menus, remove orphaned template
This commit is contained in:
parent
da527d2c44
commit
0bc7760cdb
6 changed files with 51 additions and 84 deletions
|
@ -21,7 +21,7 @@ elseif luci.http.formvalue("cbid.luci.1._edit") then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
m = SimpleForm("luci", "%s - %s - %s" %{ translate("System"), translate("Flash operations"), translate("Backup file list") })
|
m = SimpleForm("luci", translate("Backup file list"))
|
||||||
m:append(Template("admin_system/backupfiles"))
|
m:append(Template("admin_system/backupfiles"))
|
||||||
|
|
||||||
if luci.http.formvalue("display") ~= "list" then
|
if luci.http.formvalue("display") ~= "list" then
|
||||||
|
|
|
@ -19,17 +19,13 @@ require("luci.tools.webadmin")
|
||||||
require("luci.fs")
|
require("luci.fs")
|
||||||
require("luci.config")
|
require("luci.config")
|
||||||
|
|
||||||
|
local m, s, o
|
||||||
|
local has_ntpd = luci.fs.access("/usr/sbin/ntpd")
|
||||||
|
|
||||||
|
|
||||||
m = Map("system", translate("System"), translate("Here you can configure the basic aspects of your device like its hostname or the timezone."))
|
m = Map("system", translate("System"), translate("Here you can configure the basic aspects of your device like its hostname or the timezone."))
|
||||||
m:chain("luci")
|
m:chain("luci")
|
||||||
|
|
||||||
local has_rdate = false
|
|
||||||
|
|
||||||
m.uci:foreach("system", "rdate",
|
|
||||||
function()
|
|
||||||
has_rdate = true
|
|
||||||
return false
|
|
||||||
end)
|
|
||||||
|
|
||||||
|
|
||||||
s = m:section(TypedSection, "system", translate("System Properties"))
|
s = m:section(TypedSection, "system", translate("System Properties"))
|
||||||
s.anonymous = true
|
s.anonymous = true
|
||||||
|
@ -44,27 +40,27 @@ s:tab("language", translate("Language and Style"))
|
||||||
-- System Properties
|
-- System Properties
|
||||||
--
|
--
|
||||||
|
|
||||||
clock = s:taboption("general", DummyValue, "_systime", translate("Local Time"))
|
o = s:taboption("general", DummyValue, "_systime", translate("Local Time"))
|
||||||
clock.template = "admin_system/clock_status"
|
o.template = "admin_system/clock_status"
|
||||||
|
|
||||||
|
|
||||||
hn = s:taboption("general", Value, "hostname", translate("Hostname"))
|
o = s:taboption("general", Value, "hostname", translate("Hostname"))
|
||||||
hn.datatype = "hostname"
|
o.datatype = "hostname"
|
||||||
|
|
||||||
function hn.write(self, section, value)
|
function o.write(self, section, value)
|
||||||
Value.write(self, section, value)
|
Value.write(self, section, value)
|
||||||
luci.sys.hostname(value)
|
luci.sys.hostname(value)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
tz = s:taboption("general", ListValue, "zonename", translate("Timezone"))
|
o = s:taboption("general", ListValue, "zonename", translate("Timezone"))
|
||||||
tz:value("UTC")
|
o:value("UTC")
|
||||||
|
|
||||||
for i, zone in ipairs(luci.sys.zoneinfo.TZ) do
|
for i, zone in ipairs(luci.sys.zoneinfo.TZ) do
|
||||||
tz:value(zone[1])
|
o:value(zone[1])
|
||||||
end
|
end
|
||||||
|
|
||||||
function tz.write(self, section, value)
|
function o.write(self, section, value)
|
||||||
local function lookup_zone(title)
|
local function lookup_zone(title)
|
||||||
for _, zone in ipairs(luci.sys.zoneinfo.TZ) do
|
for _, zone in ipairs(luci.sys.zoneinfo.TZ) do
|
||||||
if zone[1] == title then return zone[2] end
|
if zone[1] == title then return zone[2] end
|
||||||
|
@ -155,31 +151,40 @@ end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Rdate
|
-- NTP
|
||||||
--
|
--
|
||||||
|
|
||||||
if has_rdate then
|
if has_ntpd then
|
||||||
m2 = Map("timeserver", translate("Time Server (rdate)"))
|
s = m:section(TypedSection, "timeserver", translate("Time Synchronization"))
|
||||||
s = m2:section(TypedSection, "timeserver")
|
|
||||||
s.anonymous = true
|
s.anonymous = true
|
||||||
s.addremove = true
|
s.addremove = false
|
||||||
s.template = "cbi/tblsection"
|
|
||||||
|
|
||||||
h = s:option(Value, "hostname", translate("Name"))
|
o = s:option(Flag, "enable", translate("Enable builtin NTP server"))
|
||||||
h.rmempty = true
|
o.rmempty = false
|
||||||
h.datatype = host
|
|
||||||
i = s:option(ListValue, "interface", translate("Interface"))
|
function o.cfgvalue(self)
|
||||||
i.rmempty = true
|
return luci.sys.init.enabled("sysntpd")
|
||||||
i:value("", translate("Default"))
|
and self.enabled or self.disabled
|
||||||
m2.uci:foreach("network", "interface",
|
end
|
||||||
function (section)
|
|
||||||
local ifc = section[".name"]
|
function o.write(self, section, value)
|
||||||
if ifc ~= "loopback" then
|
if value == self.enabled then
|
||||||
i:value(ifc)
|
luci.sys.init.enable("sysntpd")
|
||||||
|
luci.sys.call("env -i /etc/init.d/sysntpd start >/dev/null")
|
||||||
|
else
|
||||||
|
luci.sys.call("env -i /etc/init.d/sysntpd stop >/dev/null")
|
||||||
|
luci.sys.init.disable("sysntpd")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
|
||||||
|
|
||||||
|
o = s:option(DynamicList, "server", translate("NTP server candidates"))
|
||||||
|
o.datatype = "host"
|
||||||
|
o:depends("enable", "1")
|
||||||
|
|
||||||
|
-- retain server list even if disabled
|
||||||
|
function o.remove() end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
return m, m2
|
return m
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
<%#
|
|
||||||
LuCI - Lua Configuration Interface
|
|
||||||
Copyright 2008 Steven Barth <steven@midlink.org>
|
|
||||||
Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
$Id$
|
|
||||||
|
|
||||||
-%>
|
|
||||||
<%+header%>
|
|
||||||
<h2><a id="content" name="content"><%:System%></a></h2>
|
|
||||||
<h3><%:Backup / Restore%></h3>
|
|
||||||
<p><%:Here you can backup and restore your router configuration and - if possible - reset the router to the default settings.%></p>
|
|
||||||
<br />
|
|
||||||
<div>
|
|
||||||
<ul>
|
|
||||||
<li><a href="<%=REQUEST_URI%>?backup=kthxbye"><%:Create backup%></a></li>
|
|
||||||
<% if reset_avail then -%>
|
|
||||||
<li><a href="<%=REQUEST_URI%>?reset=yarly" onclick="return confirm('<%:Proceed reverting all settings and resetting to firmware defaults?%>')"><%:Reset router to defaults%></a></li>
|
|
||||||
<% end -%>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<form method="post" action="<%=REQUEST_URI%>" enctype="multipart/form-data">
|
|
||||||
<div class="left"><%:Backup Archive%>:</div>
|
|
||||||
<div>
|
|
||||||
<input type="file" size="30" name="archive" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<input type="submit" class="cbi-button cbi-input-apply" value="<%:Restore backup%>" />
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
<%+footer%>
|
|
|
@ -15,7 +15,7 @@ $Id$
|
||||||
|
|
||||||
<%+header%>
|
<%+header%>
|
||||||
|
|
||||||
<h2><a id="content" name="content"><%:System%> - <%:Flash operations%></a></h2>
|
<h2><a id="content" name="content"><%:Flash operations%></a></h2>
|
||||||
|
|
||||||
<ul class="cbi-tabmenu">
|
<ul class="cbi-tabmenu">
|
||||||
<li class="cbi-tab"><a href="#"><%:Actions%></a></li>
|
<li class="cbi-tab"><a href="#"><%:Actions%></a></li>
|
||||||
|
|
|
@ -48,8 +48,10 @@ else
|
||||||
end
|
end
|
||||||
|
|
||||||
-%>
|
-%>
|
||||||
|
|
||||||
<%+header%>
|
<%+header%>
|
||||||
<h2><a id="content" name="content"><%:System%> - <%:Software%></a></h2>
|
|
||||||
|
<h2><a id="content" name="content"><%:Software%></a></h2>
|
||||||
|
|
||||||
<form method="post" action="<%=REQUEST_URI%>">
|
<form method="post" action="<%=REQUEST_URI%>">
|
||||||
<div class="cbi-map">
|
<div class="cbi-map">
|
||||||
|
|
|
@ -15,7 +15,7 @@ $Id$
|
||||||
|
|
||||||
<%+header%>
|
<%+header%>
|
||||||
|
|
||||||
<h2><a id="content" name="content"><%:System%> - <%:Flash Firmware%> - <%:Verify%></a></h2>
|
<h2><a id="content" name="content"><%:Flash Firmware%> - <%:Verify%></a></h2>
|
||||||
<p>
|
<p>
|
||||||
<%_ The flash image was uploaded.
|
<%_ The flash image was uploaded.
|
||||||
Below is the checksum and file size listed,
|
Below is the checksum and file size listed,
|
||||||
|
@ -54,14 +54,14 @@ $Id$
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<div class="cbi-page-actions right">
|
<div class="cbi-page-actions right">
|
||||||
|
<form style="display:inline" action="<%=REQUEST_URI%>" method="post">
|
||||||
|
<input class="cbi-button cbi-button-reset" type="submit" value="<%:Cancel%>" />
|
||||||
|
</form>
|
||||||
<form style="display:inline" action="<%=REQUEST_URI%>" method="post">
|
<form style="display:inline" action="<%=REQUEST_URI%>" method="post">
|
||||||
<input type="hidden" name="step" value="2" />
|
<input type="hidden" name="step" value="2" />
|
||||||
<input type="hidden" name="keep" value="<%=keep and "1" or ""%>" />
|
<input type="hidden" name="keep" value="<%=keep and "1" or ""%>" />
|
||||||
<input class="cbi-button cbi-button-apply" type="submit" value="<%:Proceed%>" />
|
<input class="cbi-button cbi-button-apply" type="submit" value="<%:Proceed%>" />
|
||||||
</form>
|
</form>
|
||||||
<form style="display:inline" action="<%=REQUEST_URI%>" method="post">
|
|
||||||
<input class="cbi-button cbi-button-reset" type="submit" value="<%:Cancel%>" />
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%+footer%>
|
<%+footer%>
|
||||||
|
|
Loading…
Reference in a new issue