mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-19 14:13:30 +00:00
luci-app-accesscontrol: set time to hh:mm:ss time format
This commit is contained in:
parent
8adb90b287
commit
81251aef39
@ -11,7 +11,7 @@ LUCI_DEPENDS:=
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_NAME:=luci-app-accesscontrol
|
||||
PKG_VERSION:=1
|
||||
PKG_RELEASE:=3
|
||||
PKG_RELEASE:=5
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
|
@ -23,5 +23,5 @@ function index()
|
||||
-- end
|
||||
|
||||
|
||||
entry({"admin", "services", "access_control"}, cbi("access_control"), _("Internet Access Schedule Control"), 10).dependent = true
|
||||
entry({"admin", "services", "access_control"}, cbi("access_control"), _("Internet Access Schedule Control"), 30).dependent = true
|
||||
end
|
||||
|
@ -44,7 +44,7 @@ s = mr:section(TypedSection, "rule", translate("Client Rules"))
|
||||
s.defaults.dest = "wan"
|
||||
s.defaults.target = "REJECT"
|
||||
s.defaults.proto = "0"
|
||||
s.defaults.extra = "--kerneltz"
|
||||
-- s_rule.defaults.extra = "--kerneltz"
|
||||
|
||||
-- only AC-related rules
|
||||
s.filter = function(self, section)
|
||||
@ -92,14 +92,15 @@ s = mr:section(TypedSection, "rule", translate("Client Rules"))
|
||||
end)
|
||||
|
||||
function validate_time(self, value, section)
|
||||
local hh, mm
|
||||
hh,mm = string.match (value, "^(%d?%d):(%d%d)$")
|
||||
local hh, mm, ss
|
||||
hh, mm, ss = string.match (value, "^(%d?%d):(%d%d):(%d%d)$")
|
||||
hh = tonumber (hh)
|
||||
mm = tonumber (mm)
|
||||
if hh and mm and hh <= 23 and mm <= 59 then
|
||||
ss = tonumber (ss)
|
||||
if hh and mm and hh <= 23 and mm <= 59 and ss <= 59 then
|
||||
return value
|
||||
else
|
||||
return nil, "Time value must be HH:MM or empty"
|
||||
return nil, "Time value must be HH:MM:SS or empty"
|
||||
end
|
||||
end
|
||||
o = s:option(Value, "start_time", translate("Start time"))
|
||||
@ -111,8 +112,8 @@ s = mr:section(TypedSection, "rule", translate("Client Rules"))
|
||||
o.validate = validate_time
|
||||
o.size = 5
|
||||
|
||||
local Days = {'mon','tue','wed','thu','fri','sat','sun'}
|
||||
local Days1 = translate('MTWTFSS')
|
||||
local Days = {'Mon','Tue','Wed','Thu','Fri','Sat','Sun'}
|
||||
local Days1 = translate("MTWTFSS")
|
||||
|
||||
function make_day (nday)
|
||||
local day = Days[nday]
|
||||
|
@ -22,5 +22,6 @@ msgstr "开始时间"
|
||||
msgid "End time"
|
||||
msgstr "结束时间"
|
||||
|
||||
|
||||
msgid ""MTWTFSS"
|
||||
msgstr "一二三四五六日"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user