luci-app-xlnetacc: code alignment

This commit is contained in:
Beginner-Go 2022-06-22 17:27:43 +00:00
parent 63606e6c04
commit aeec020b33
4 changed files with 13 additions and 19 deletions

View File

@ -1,10 +1,10 @@
module("luci.controller.xlnetacc",package.seeall)
module("luci.controller.xlnetacc", package.seeall)
function index()
if not nixio.fs.access("/etc/config/xlnetacc") then
return
end
entry({"admin", "services", "xlnetacc"}, alias("admin", "services", "xlnetacc", "general"), _("XLNetAcc"), 90).dependent = true
entry({"admin", "services", "xlnetacc", "general"}, cbi("xlnetacc"), _("Settings"), 1).leaf = true
entry({"admin", "services", "xlnetacc", "log"}, template("xlnetacc/logview"), _("Log"), 2).leaf = true

View File

@ -1,11 +1,11 @@
local m,s,o
local m, s, o
local uci = luci.model.uci.cursor()
m = Map("xlnetacc")
m.title = translate("XLNetAcc - Settings")
m.description = translate("XLNetAcc is a Thunder joint broadband operators launched a commitment to help users solve the low broadband, slow Internet access, poor Internet experience of professional-grade broadband upgrade software.")
m:section(SimpleSection).template = "xlnetacc/xlnetacc_status"
m:section(SimpleSection).template = "xlnetacc/xlnetacc_status"
s = m:section(NamedSection, "general", "general")
s.title = translate("General Settings")
@ -23,7 +23,7 @@ o = s:option(Flag, "logging", translate("Enable Logging"))
o.default = 1
o = s:option(Flag, "verbose", translate("Enable verbose logging"))
o:depends("logging",1)
o:depends("logging", 1)
o = s:option(ListValue, "network", translate("Upgrade interface"))
uci:foreach("network","interface",function(section)
@ -34,7 +34,7 @@ end)
o = s:option(Value, "keepalive", translate("Keepalive interval"))
o.description = translate("5 ~ 60 minutes")
for _,v in ipairs({5,10,20,30,60}) do
for _,v in ipairs({5, 10, 20, 30, 60}) do
o:value(v,v.." "..translate("minutes"))
end
o.datatype = "range(5,60)"
@ -43,7 +43,7 @@ o.default = 10
o = s:option(Value, "relogin", translate("Account relogin"))
o.description = translate("1 ~ 48 hours")
o:value(0, translate("Not enabled"))
for _,v in ipairs({3,12,18,24,30}) do
for _,v in ipairs({3, 12, 18, 24, 30}) do
o:value(v,v.." "..translate("hours"))
end
o.datatype = "max(48)"

View File

@ -1,6 +1,11 @@
uci batch <<EOF
#!/bin/sh
uci -q batch <<-EOF >/dev/null
delete ucitrack.@xlnetacc[-1]
add ucitrack xlnetacc
set ucitrack.@xlnetacc[-1].init=xlnetacc
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
exit 0

View File

@ -1,11 +0,0 @@
{
"luci-app-xlnetacc": {
"description": "Grant UCI access for luci-app-xlnetacc",
"read": {
"uci": [ "xlnetacc" ]
},
"write": {
"uci": [ "xlnetacc" ]
}
}
}