diff options
author | Steven Barth <steven@midlink.org> | 2008-08-14 13:25:49 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-08-14 13:25:49 +0000 |
commit | 8c246e81746fac0fc0ff07266058d4ace5acdd55 (patch) | |
tree | 44b22acaf5268ff96067d6efefa70778613be57e /applications/luci-ntpc/luasrc | |
parent | e42779fcabec3995b87a50e233e95a2f3f7bc466 (diff) |
applications/luci-ntpc: Updated module to work with reworked UCI scheme
Diffstat (limited to 'applications/luci-ntpc/luasrc')
5 files changed, 66 insertions, 10 deletions
diff --git a/applications/luci-ntpc/luasrc/controller/ntpc.lua b/applications/luci-ntpc/luasrc/controller/ntpc.lua index 2382f5297..5866a241f 100644 --- a/applications/luci-ntpc/luasrc/controller/ntpc.lua +++ b/applications/luci-ntpc/luasrc/controller/ntpc.lua @@ -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 diff --git a/applications/luci-ntpc/luasrc/i18n/ntpc.de.lua b/applications/luci-ntpc/luasrc/i18n/ntpc.de.lua index 4710414ad..555f0ba38 100644 --- a/applications/luci-ntpc/luasrc/i18n/ntpc.de.lua +++ b/applications/luci-ntpc/luasrc/i18n/ntpc.de.lua @@ -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 diff --git a/applications/luci-ntpc/luasrc/i18n/ntpc.en.lua b/applications/luci-ntpc/luasrc/i18n/ntpc.en.lua index 1baf3405d..9e6120b3b 100644 --- a/applications/luci-ntpc/luasrc/i18n/ntpc.en.lua +++ b/applications/luci-ntpc/luasrc/i18n/ntpc.en.lua @@ -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 diff --git a/applications/luci-ntpc/luasrc/model/cbi/ntpc/ntpc.lua b/applications/luci-ntpc/luasrc/model/cbi/ntpc/ntpc.lua index 552c9861a..cc4698384 100644 --- a/applications/luci-ntpc/luasrc/model/cbi/ntpc/ntpc.lua +++ b/applications/luci-ntpc/luasrc/model/cbi/ntpc/ntpc.lua @@ -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 index 000000000..af36ca47c --- /dev/null +++ b/applications/luci-ntpc/luasrc/model/cbi/ntpc/ntpcmini.lua @@ -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 |