Added new application luci-ntpc to luci-full and luci-mini
This commit is contained in:
parent
43b9951481
commit
fce0b84501
8 changed files with 89 additions and 2 deletions
2
applications/luci-ntpc/Makefile
Normal file
2
applications/luci-ntpc/Makefile
Normal file
|
@ -0,0 +1,2 @@
|
|||
include ../../build/config.mk
|
||||
include ../../build/module.mk
|
32
applications/luci-ntpc/luasrc/controller/ntpc.lua
Normal file
32
applications/luci-ntpc/luasrc/controller/ntpc.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
--[[
|
||||
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$
|
||||
]]--
|
||||
module("luci.controller.ntpc", package.seeall)
|
||||
|
||||
function index()
|
||||
require("luci.i18n")
|
||||
luci.i18n.loadc("ntpc")
|
||||
if not luci.fs.isfile("/etc/config/ntpclient") then
|
||||
return
|
||||
end
|
||||
|
||||
local page = entry({"admin", "system", "ntpc"}, cbi("ntpc/ntpc"), luci.i18n.translate("ntpc"), 50)
|
||||
page.i18n = "ntpc"
|
||||
page.dependent = true
|
||||
|
||||
|
||||
local page = entry({"mini", "system", "ntpc"}, cbi("ntpc/ntpc"), luci.i18n.translate("ntpc"), 50)
|
||||
page.i18n = "ntpc"
|
||||
page.dependent = true
|
||||
end
|
5
applications/luci-ntpc/luasrc/i18n/ntpc.de.lua
Normal file
5
applications/luci-ntpc/luasrc/i18n/ntpc.de.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
ntpc = "Zeitsynchronisation"
|
||||
ntpc_desc = "Synchronisiert die Systemzeit über Internetzeitserver"
|
||||
ntpc_timeserver = "Zeitserver"
|
||||
ntpc_count = "Anzahl der Zeitmessungen"
|
||||
ntpc_count_desc = "0 = unendlich"
|
5
applications/luci-ntpc/luasrc/i18n/ntpc.en.lua
Normal file
5
applications/luci-ntpc/luasrc/i18n/ntpc.en.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
ntpc = "Time Synchronisation"
|
||||
ntpc_desc = "Synchronizes the system time using internet time servers"
|
||||
ntpc_timeserver = "Time Server"
|
||||
ntpc_count = "Count of Time Measurements"
|
||||
ntpc_count_desc = "0 = infinite"
|
26
applications/luci-ntpc/luasrc/model/cbi/ntpc/ntpc.lua
Normal file
26
applications/luci-ntpc/luasrc/model/cbi/ntpc/ntpc.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
--[[
|
||||
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$
|
||||
]]--
|
||||
m = Map("ntpclient", translate("ntpc"), translate("ntpc_desc"))
|
||||
|
||||
s = m:section(TypedSection, "ntpclient", translate("ntpc_timeserver"))
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.template = "cbi/tblsection"
|
||||
|
||||
s:option(Value, "hostname", translate("hostname"))
|
||||
s:option(Value, "port", translate("port")).rmempty = true
|
||||
s:option(Value, "count", translate("ntpc_count"), translate("ntpc_count_desc"))
|
||||
|
||||
return m
|
|
@ -411,6 +411,7 @@ define Package/luci-app-statistics/install
|
|||
$(call Package/luci/install/template,$(1),applications/luci-statistics)
|
||||
endef
|
||||
|
||||
|
||||
define Package/luci-app-upnp
|
||||
$(call Package/luci/webtemplate)
|
||||
DEPENDS+=+luci-mod-admin-core +miniupnpd
|
||||
|
@ -422,6 +423,17 @@ define Package/luci-app-upnp/install
|
|||
endef
|
||||
|
||||
|
||||
define Package/luci-app-ntpc
|
||||
$(call Package/luci/webtemplate)
|
||||
DEPENDS+=+luci-mod-admin-core +ntpclient
|
||||
TITLE:=NTP time synchronisation client configuration
|
||||
endef
|
||||
|
||||
define Package/luci-app-ntpc/install
|
||||
$(call Package/luci/install/template,$(1),applications/luci-ntpc)
|
||||
endef
|
||||
|
||||
|
||||
### Server Gateway Interfaces ###
|
||||
|
||||
define Package/luci-sgi-cgi
|
||||
|
@ -579,6 +591,9 @@ endif
|
|||
ifneq ($(CONFIG_PACKAGE_luci-app-upnp),)
|
||||
PKG_SELECTED_MODULES+=applications/luci-upnp
|
||||
endif
|
||||
ifneq ($(CONFIG_PACKAGE_luci-app-ntpc),)
|
||||
PKG_SELECTED_MODULES+=applications/luci-ntpc
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_luci-sgi-cgi),)
|
||||
PKG_SELECTED_MODULES+=libs/sgi-cgi
|
||||
|
@ -644,6 +659,7 @@ $(eval $(call BuildPackage,luci-app-qos))
|
|||
$(eval $(call BuildPackage,luci-app-splash))
|
||||
$(eval $(call BuildPackage,luci-app-statistics))
|
||||
$(eval $(call BuildPackage,luci-app-upnp))
|
||||
$(eval $(call BuildPackage,luci-app-ntpc))
|
||||
|
||||
$(eval $(call BuildPackage,luci-sgi-cgi))
|
||||
$(eval $(call BuildPackage,luci-sgi-luci))
|
||||
|
|
|
@ -32,6 +32,7 @@ config event uci_oncommit
|
|||
option luci_splash "/etc/init.d/luci_splash restart"
|
||||
option freifunk "/etc/init.d/luci_freifunk restart"
|
||||
option upnpd "/etc/init.d/miniupnpd enabled && /etc/init.d/miniupnpd restart || /etc/init.d/miniupnpd stop"
|
||||
option ntpclient "/etc/init.d/ntpclient restart"
|
||||
|
||||
config internal languages
|
||||
option de "Deutsch"
|
||||
|
|
|
@ -21,8 +21,8 @@ function index()
|
|||
|
||||
entry({"mini", "system"}, call("action_reboot"), i18n("system"))
|
||||
entry({"mini", "system", "passwd"}, call("action_passwd"), i18n("a_s_changepw"), 10)
|
||||
entry({"mini", "system", "upgrade"}, call("action_upgrade"), i18n("a_s_flash"), 20)
|
||||
entry({"mini", "system", "reboot"}, call("action_reboot"), i18n("reboot"), 30)
|
||||
entry({"mini", "system", "upgrade"}, call("action_upgrade"), i18n("a_s_flash"), 90)
|
||||
entry({"mini", "system", "reboot"}, call("action_reboot"), i18n("reboot"), 100)
|
||||
end
|
||||
|
||||
function action_reboot()
|
||||
|
|
Loading…
Reference in a new issue