modules/admin-full: resolve scope issue in previous commit
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_system / system.lua
index 9f9c922..f3c5a01 100644 (file)
@@ -19,6 +19,15 @@ require("luci.fs")
 
 m = Map("system", translate("System"), translate("Here you can configure the basic aspects of your device like its hostname or the timezone."))
 
+local has_rdate = false
+
+m.uci:foreach("system", "rdate",
+       function()
+               has_rdate = true
+               return false
+       end)
+
+
 s = m:section(TypedSection, "system", "")
 s.anonymous = true
 s.addremove = false
@@ -78,15 +87,18 @@ function tz.write(self, section, value)
        luci.fs.writefile("/etc/TZ", timezone .. "\n")
 end
 
-s:option(Value, "log_size", nil, "kiB").optional = true
-s:option(Value, "log_ip").optional = true
-s:option(Value, "conloglevel").optional = true
-s:option(Value, "cronloglevel").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