mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-16 21:43:33 +08:00
🛸 Sync 2026-09-20 11:04:31
This commit is contained in:
1 parent
4b4d482791
commit
8df28edee1
10 files changed
+14
-69
No files matched your search
@@ -83,21 +83,6 @@ o = s:option(DynamicList, "users", translate("User"))
|
||||
for i, v in ipairs(user_list) do
|
||||
o:value(v[".name"], v.username)
|
||||
end
|
||||
o.validate = function(self, value, t)
|
||||
if type(value) == "string" then value = {value} end
|
||||
if type(value) == "table" then
|
||||
for _, u in ipairs(value) do
|
||||
local found = false
|
||||
for _, v in ipairs(user_list) do
|
||||
if u == v[".name"] then found = true; break end
|
||||
end
|
||||
if not found then
|
||||
return nil, translate("Please configure user info on the User Management page.")
|
||||
end
|
||||
end
|
||||
end
|
||||
return value
|
||||
end
|
||||
o:depends({ protocol = "mixed" })
|
||||
o:depends({ protocol = "socks" })
|
||||
o:depends({ protocol = "http" })
|
||||
|
||||
@@ -76,21 +76,6 @@ o = s:option(DynamicList, "users", translate("User"))
|
||||
for i, v in ipairs(user_list) do
|
||||
o:value(v[".name"], v.username)
|
||||
end
|
||||
o.validate = function(self, value, t)
|
||||
if type(value) == "string" then value = {value} end
|
||||
if type(value) == "table" then
|
||||
for _, u in ipairs(value) do
|
||||
local found = false
|
||||
for _, v in ipairs(user_list) do
|
||||
if u == v[".name"] then found = true; break end
|
||||
end
|
||||
if not found then
|
||||
return nil, translate("Please configure user info on the User Management page.")
|
||||
end
|
||||
end
|
||||
end
|
||||
return value
|
||||
end
|
||||
o:depends({ protocol = "http" })
|
||||
o:depends({ protocol = "socks" })
|
||||
o:depends({ protocol = "shadowsocks" })
|
||||
|
||||
@@ -50,21 +50,6 @@ for i, v in ipairs(user_list) do
|
||||
o:value(v[".name"], v.username)
|
||||
end
|
||||
o:depends({ custom = false })
|
||||
o.validate = function(self, value, t)
|
||||
if type(value) == "string" then value = {value} end
|
||||
if type(value) == "table" then
|
||||
for _, u in ipairs(value) do
|
||||
local found = false
|
||||
for _, v in ipairs(user_list) do
|
||||
if u == v[".name"] then found = true; break end
|
||||
end
|
||||
if not found then
|
||||
return nil, translate("Please configure user info on the User Management page.")
|
||||
end
|
||||
end
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
o = s:option(Flag, "realms", translate("Realms"))
|
||||
o.default = "0"
|
||||
|
||||
Reference in new issue
Block a user