local has_ipv6 = nw:has_ipv6()
-m = Map("network", translate("m_n_lan"))
+m = Map("network", "Local Network")
nw.init(m.uci)
-s = m:section(NamedSection, "lan", "interface")
+s = m:section(NamedSection, "lan", "interface", "Network Settings")
s.addremove = false
s:tab("general", translate("General Settings"))
end
-m2 = Map("dhcp", "DHCP")
+m2 = Map("dhcp")
-s = m2:section(TypedSection, "dhcp", "DHCP-Server")
+s = m2:section(TypedSection, "dhcp", "DHCP")
s.anonymous = true
s.addremove = false
s.dynamic = false
s:depends("interface", "lan")
-enable = s:taboption("general", ListValue, "ignore", translate("enable"), "")
+enable = s:taboption("general", ListValue, "ignore", "Automatic address assignment for network devices", "")
enable:value(0, translate("enable"))
enable:value(1, translate("disable"))
s:tab("expert", translate("Expert Settings"))
start = s:taboption("expert", Value, "start", translate("First leased address"))
limit = s:taboption("expert", Value, "limit", translate("Number of leased addresses"), "")
-time = s:taboption("expert", Value, "leasetime")
+time = s:taboption("expert", Value, "leasetime", "Lease Time")
return m, m2
d:add("general1", load("niu/system/general1"))
function d.on_cancel()
- cursor:revert("system")
+ cursor:revert("luci")
end
function d.on_done()
- cursor:commit("system")
+ local pw1 = cursor:get("luci", "main", "_pw1")
+ if pw1 and pw1 ~= "**********" then
+ cursor:delete("luci", "main", "_pw1")
+ require "luci.sys".user.setpasswd("root", pw1)
+ end
+
+ local hn = cursor:get("luci", "main", "_uniquename")
+ if hn then
+ cursor:foreach("system", "system", function(s)
+ cursor:set("system", s[".name"], "hostname", hn)
+ end)
+ cursor:commit("system")
+
+ require "nixio.fs".writefile("/proc/sys/kernel/hostname", hn)
+ cursor:delete("luci", "main", "_uniquename")
+ end
+
+ cursor:commit("luci")
end
return d
\ No newline at end of file
local util = require "luci.util"
local config = require "luci.config"
-m = Map("system", translate("System"))
+m = Map("luci", "Device Settings")
-s = m:section(TypedSection, "system", "")
-s.anonymous = true
-s.addremove = false
+c = m:section(NamedSection, "main", "core", translate("Local Settings"))
-hn = s:option(Value, "hostname", translate("Hostname"))
-
-
-
-m2 = Map("luci", translate("Web <abbr title=\"User Interface\">UI</abbr>"))
-
-
-c = m2:section(NamedSection, "main", "core")
+hn = c:option(Value, "_uniquename", translate("Unique Devicename"))
+function hn:cfgvalue(self)
+ return require "nixio.fs".readfile("/proc/sys/kernel/hostname")
+end
-l = c:option(ListValue, "lang", translate("Language"))
+l = c:option(ListValue, "lang", translate("System Language"))
l:value("auto")
local i18ndir = i18n.i18ndir .. "default."
l:value(k, v)
end
end
-return m, m2
+
+pw1 = c:option(Value, "_pw1", translate("Administrator Password"))
+pw1.password = true
+pw1.default = "**********"
+
+
+return m