luci-0.11: merge outstanding trunk changes
[project/luci.git] / applications / luci-ntpc / luasrc / model / cbi / ntpc / ntpcmini.lua
index bd04cc6a413c03ee9545329ccf95cb2946ae6d66..2a6c415242b4dc73783bfe9ea844060e4917c768 100644 (file)
@@ -17,11 +17,13 @@ m = Map("ntpclient", translate("Time Synchronisation"), translate("Synchronizes
 
 s = m:section(TypedSection, "ntpclient", translate("General"))
 s.anonymous = true
+s.addremove = false
 
-s:option(DummyValue, "_time", translate("ntpc_current")).value = os.date("%c")
-
-s:option(Value, "interval", translate("Update Interval (in s)")).rmempty = true
+s:option(DummyValue, "_time", translate("Current system time")).value = os.date("%c")
 
+interval = s:option(Value, "interval", translate("Update interval (in seconds)"))
+interval.datatype = "and(uinteger,min(1))"
+interval.rmempty = true
 
 s3 = m:section(TypedSection, "ntpserver", translate("Time Server"))
 s3.anonymous = true
@@ -29,6 +31,8 @@ s3.addremove = true
 s3.template = "cbi/tblsection"
 
 s3:option(Value, "hostname", translate("Hostname"))
-s3:option(Value, "port", translate("Port")).rmempty = true
+port = s3:option(Value, "port", translate("Port"))
+port.datatype = "port"
+port.rmempty = true
 
-return m
\ No newline at end of file
+return m