applications/luci-ntpc: Updated module to work with reworked UCI scheme
[project/luci.git] / applications / luci-ntpc / luasrc / model / cbi / ntpc / ntpc.lua
index 552c986..cc46983 100644 (file)
@@ -12,15 +12,30 @@ You may obtain a copy of the License at
 
 $Id$
 ]]--
+require("luci.tools.webadmin")
 m = Map("ntpclient", translate("ntpc"), translate("ntpc_desc"))
 
-s = m:section(TypedSection, "ntpclient", translate("ntpc_timeserver"))
+s = m:section(TypedSection, "ntpclient", translate("general"))
 s.anonymous = true
-s.addremove = true
-s.template = "cbi/tblsection"
 
-s:option(Value, "hostname", translate("hostname"))
-s:option(Value, "port", translate("port")).rmempty = true
+iface = s:option(ListValue, "iface", translate("ntpc_iface"), translate("ntpc_iface_desc"))
+luci.tools.webadmin.cbi_add_networks(iface)
+
+s:option(Value, "interval", translate("ntpc_interval"))
 s:option(Value, "count", translate("ntpc_count"), translate("ntpc_count_desc"))
 
+
+s2 = m:section(TypedSection, "ntpdrift", translate("ntpc_drift"))
+s2.anonymous = true
+s2:option(Value, "freq", translate("ntpc_drift_freq"))
+
+
+s3 = m:section(TypedSection, "ntpserver", translate("ntpc_timeserver"))
+s3.anonymous = true
+s3.addremove = true
+s3.template = "cbi/tblsection"
+
+s3:option(Value, "hostname", translate("hostname"))
+s3:option(Value, "port", translate("port")).rmempty = true
+
 return m
\ No newline at end of file