applications/luci-ntpc: Updated module to work with reworked UCI scheme

This commit is contained in:
Steven Barth 2008-08-14 13:25:49 +00:00
parent e42779fcab
commit 8c246e8174
5 changed files with 66 additions and 10 deletions

View file

@ -26,7 +26,7 @@ function index()
page.dependent = true 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.i18n = "ntpc"
page.dependent = true page.dependent = true
end end

View file

@ -1,5 +1,10 @@
ntpc = "Zeitsynchronisation" ntpc = "Zeitsynchronisation"
ntpc_desc = "Synchronisiert die Systemzeit über Internetzeitserver" ntpc_desc = "Synchronisiert die Systemzeit"
ntpc_timeserver = "Zeitserver" ntpc_timeserver = "Zeitserver"
ntpc_interval = "Aktualisierungsintervall (in s)"
ntpc_count = "Anzahl der Zeitmessungen" ntpc_count = "Anzahl der Zeitmessungen"
ntpc_count_desc = "0 = unendlich" 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."

View file

@ -1,5 +1,10 @@
ntpc = "Time Synchronisation" ntpc = "Time Synchronisation"
ntpc_desc = "Synchronizes the system time using internet time servers" ntpc_desc = "Synchronizes the system time"
ntpc_timeserver = "Time Server" ntpc_timeserver = "Time Server"
ntpc_interval = "Update Interval (in s)"
ntpc_count = "Count of Time Measurements" ntpc_count = "Count of Time Measurements"
ntpc_count_desc = "0 = infinite" 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."

View file

@ -12,15 +12,30 @@ You may obtain a copy of the License at
$Id$ $Id$
]]-- ]]--
require("luci.tools.webadmin")
m = Map("ntpclient", translate("ntpc"), translate("ntpc_desc")) 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.anonymous = true
s.addremove = true
s.template = "cbi/tblsection"
s:option(Value, "hostname", translate("hostname")) iface = s:option(ListValue, "iface", translate("ntpc_iface"), translate("ntpc_iface_desc"))
s:option(Value, "port", translate("port")).rmempty = true 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")) 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 return m

View file

@ -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