modules/admin-full: hide rdate if not present in config
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_system / system.lua
index 0577671..f304437 100644 (file)
@@ -27,11 +27,6 @@ function m.on_parse()
                        has_rdate = true
                        return false
                end)
-
-       if not has_rdate then
-               m.uci:section("system", "rdate", nil, { })
-               m.uci:save("system")
-       end
 end
 
 
@@ -94,15 +89,18 @@ function tz.write(self, section, value)
        luci.fs.writefile("/etc/TZ", timezone .. "\n")
 end
 
-s:option(Value, "log_size", translate("Log Size"), "kiB").optional = true
-s:option(Value, "log_ip", translate("Remote Syslog IP")).optional = true
-s:option(Value, "conloglevel", translate("Console Log Level")).optional = true
+s:option(Value, "log_size", translate("System log buffer size"), "kiB").optional = true
+s:option(Value, "log_ip", translate("External system log server")).optional = true
+s:option(Value, "log_port", translate("External system log server port")).optional = true
+s:option(Value, "conloglevel", translate("Log output level")).optional = true
 s:option(Value, "cronloglevel", translate("Cron Log Level")).optional = true
 
-s2 = m:section(TypedSection, "rdate", translate("Time Server (rdate)"))
-s2.anonymous = true
-s2.addremove = false
+if has_rdate then
+       s2 = m:section(TypedSection, "rdate", translate("Time Server (rdate)"))
+       s2.anonymous = true
+       s2.addremove = false
 
-s2:option(DynamicList, "server", translate("Server"))
+       s2:option(DynamicList, "server", translate("Server"))
+end
 
 return m