mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-11 09:47:52 +08:00
update 2026-08-14 04:36:07
This commit is contained in:
1 parent
e716bb6996
commit
5ce413d3a3
74 files changed
+693
-819
No files matched your search
@@ -1,12 +1,9 @@
|
||||
local api = require "luci.passwall2.api"
|
||||
local appname = api.appname
|
||||
|
||||
api.set_default_cbi()
|
||||
|
||||
m = Map("passwall2_server", translate("Server-Side"))
|
||||
api.set_apply_on_parse(m)
|
||||
m = Map(api.s_config)
|
||||
|
||||
t = m:section(NamedSection, "global", "global")
|
||||
t = m:section(NamedSection, "global", "global", translate("Server-Side"))
|
||||
t.anonymous = true
|
||||
t.addremove = false
|
||||
|
||||
@@ -88,17 +85,9 @@ e = s_server:option(Flag, "log", translate("Log"))
|
||||
e.default = "1"
|
||||
e.rmempty = false
|
||||
|
||||
local sortable = Template(appname .. "/cbi/sortable")
|
||||
sortable.api = api
|
||||
sortable.appname = m.config
|
||||
sortable.target_cfgname = s_server.sectiontype
|
||||
m:append(sortable)
|
||||
m:appendTemplate("/cbi/sortable", {sectiontype = s_server.sectiontype})
|
||||
|
||||
local server_list_status = Template(appname .. "/server/server_list_status")
|
||||
server_list_status.api = api
|
||||
server_list_status.appname = m.config
|
||||
server_list_status.sectiontype = s_server.sectiontype
|
||||
m:append(server_list_status)
|
||||
m:appendTemplate("/server/server_list_status", {sectiontype = s_server.sectiontype})
|
||||
|
||||
s_user = m:section(TypedSection, "user", translate("Users Manager"))
|
||||
s_user.anonymous = true
|
||||
@@ -114,7 +103,7 @@ end
|
||||
s_user.remove = function(self, section)
|
||||
local o = m:get(section) or {}
|
||||
if o[".type"] == self.sectiontype then
|
||||
m.uci:foreach(m.config, "server", function(o)
|
||||
m:foreach("server", function(o)
|
||||
if o.user and section == o.user then
|
||||
m:set(o[".name"], "user", "")
|
||||
end
|
||||
@@ -144,12 +133,8 @@ e.width = "25%"
|
||||
e = s_user:option(DummyValue, "uuid", "UUID")
|
||||
e.width = "25%"
|
||||
|
||||
local sortable = Template(appname .. "/cbi/sortable")
|
||||
sortable.api = api
|
||||
sortable.appname = m.config
|
||||
sortable.target_cfgname = s_user.sectiontype
|
||||
m:append(sortable)
|
||||
m:appendTemplate("/cbi/sortable", {sectiontype = s_user.sectiontype})
|
||||
|
||||
m:append(Template(appname .. "/server/log"))
|
||||
m:appendTemplate("/server/log")
|
||||
|
||||
return api.return_map(m)
|
||||
Reference in new issue
Block a user