applications/luci-ntpc: Updated module to work with reworked UCI scheme
authorSteven Barth <steven@midlink.org>
Thu, 14 Aug 2008 13:25:49 +0000 (13:25 +0000)
committerSteven Barth <steven@midlink.org>
Thu, 14 Aug 2008 13:25:49 +0000 (13:25 +0000)
applications/luci-ntpc/luasrc/controller/ntpc.lua
applications/luci-ntpc/luasrc/i18n/ntpc.de.lua
applications/luci-ntpc/luasrc/i18n/ntpc.en.lua
applications/luci-ntpc/luasrc/model/cbi/ntpc/ntpc.lua
applications/luci-ntpc/luasrc/model/cbi/ntpc/ntpcmini.lua [new file with mode: 0644]

index 2382f5297fff5c90c1c6a7500ac32557759e0c08..5866a241fd46f6e76108d0e3106d4e482d69f475 100644 (file)
@@ -26,7 +26,7 @@ function index()
        page.dependent = true
        
        
-       local page = entry({"mini", "system", "ntpc"}, cbi("ntpc/ntpc"), luci.i18n.translate("ntpc"), 50)
+       local page = entry({"mini", "system", "ntpc"}, cbi("ntpc/ntpcmini"), luci.i18n.translate("ntpc"), 50)
        page.i18n = "ntpc"
        page.dependent = true
 end
\ No newline at end of file
index 4710414adb77228b6da0345a9fdaabd7afda151e..555f0ba388078afc3afeb464edf3ec44a60d43d3 100644 (file)
@@ -1,5 +1,10 @@
 ntpc = "Zeitsynchronisation"
-ntpc_desc = "Synchronisiert die Systemzeit über Internetzeitserver"
+ntpc_desc = "Synchronisiert die Systemzeit"
 ntpc_timeserver = "Zeitserver"
+ntpc_interval = "Aktualisierungsintervall (in s)"
 ntpc_count = "Anzahl der Zeitmessungen"
-ntpc_count_desc = "0 = unendlich"
\ No newline at end of file
+ntpc_count_desc = "leer = unendlich"
+ntpc_drift = "Zeitgeberjustierung"
+ntpc_drift_freq = "Frequenzabweichung"
+ntpc_iface = "Quellschnittstelle"
+ntpc_iface_desc = "Schnittstelle, über die die Zeitserver kontaktiert werden."
\ No newline at end of file
index 1baf3405d42dd3be44820009273e1081d77bc32b..9e6120b3b7d8ef33245097c0b67121357c9bc0bc 100644 (file)
@@ -1,5 +1,10 @@
 ntpc = "Time Synchronisation"
-ntpc_desc = "Synchronizes the system time using internet time servers"
+ntpc_desc = "Synchronizes the system time"
 ntpc_timeserver = "Time Server"
+ntpc_interval = "Update Interval (in s)"
 ntpc_count = "Count of Time Measurements"
-ntpc_count_desc = "0 = infinite"
\ No newline at end of file
+ntpc_count_desc = "empty = infinite"
+ntpc_drift = "Clock Adjustment"
+ntpc_drift_freq = "Offset Frequency"
+ntpc_iface = "Source Interface"
+ntpc_iface_desc = "Interface which is used to contact the time servers."
\ No newline at end of file
index 552c9861afffcd090dc75107e9e742bba846d86d..cc46983847ab6eba2839c145f99cbe82574a89fe 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
diff --git a/applications/luci-ntpc/luasrc/model/cbi/ntpc/ntpcmini.lua b/applications/luci-ntpc/luasrc/model/cbi/ntpc/ntpcmini.lua
new file mode 100644 (file)
index 0000000..af36ca4
--- /dev/null
@@ -0,0 +1,31 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+require("luci.tools.webadmin")
+m = Map("ntpclient", translate("ntpc"), translate("ntpc_desc"))
+
+s = m:section(TypedSection, "ntpclient", translate("general"))
+s.anonymous = true
+s:option(Value, "interval", translate("ntpc_interval"))
+
+
+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