luci-app-passwall: sync upstream

last commit: 992017ed58
This commit is contained in:
gitea-action 2025-04-13 13:30:31 +08:00
parent c986d711f8
commit ed88ad78c0
4 changed files with 33 additions and 6 deletions

View File

@ -88,7 +88,7 @@ function index()
entry({"admin", "services", appname, "check_passwall"}, call("app_check")).leaf = true entry({"admin", "services", appname, "check_passwall"}, call("app_check")).leaf = true
local coms = require "luci.passwall.com" local coms = require "luci.passwall.com"
local com local com
for com, _ in pairs(coms) do for _, com in ipairs(coms.order) do
entry({"admin", "services", appname, "check_" .. com}, call("com_check", com)).leaf = true entry({"admin", "services", appname, "check_" .. com}, call("com_check", com)).leaf = true
entry({"admin", "services", appname, "update_" .. com}, call("com_update", com)).leaf = true entry({"admin", "services", appname, "update_" .. com}, call("com_update", com)).leaf = true
end end

View File

@ -14,10 +14,13 @@ s:append(Template(appname .. "/app_update/app_version"))
local k, v local k, v
local com = require "luci.passwall.com" local com = require "luci.passwall.com"
for k, v in pairs(com) do for _, k in ipairs(com.order) do
v = com[k]
if k ~= "geoview" then
o = s:option(Value, k:gsub("%-","_") .. "_file", translatef("%s App Path", v.name)) o = s:option(Value, k:gsub("%-","_") .. "_file", translatef("%s App Path", v.name))
o.default = v.default_path or ("/usr/bin/" .. k) o.default = v.default_path or ("/usr/bin/" .. k)
o.rmempty = false o.rmempty = false
end
end end
o = s:option(DummyValue, "tips", " ") o = s:option(DummyValue, "tips", " ")

View File

@ -8,6 +8,15 @@ local function gh_pre_release_url(self)
return "https://api.github.com/repos/" .. self.repo .. "/releases?per_page=1" return "https://api.github.com/repos/" .. self.repo .. "/releases?per_page=1"
end end
-- 排序顺序定义
_M.order = {
"geoview",
"chinadns-ng",
"xray",
"sing-box",
"hysteria"
}
_M.hysteria = { _M.hysteria = {
name = "Hysteria", name = "Hysteria",
repo = "HyNetwork/hysteria", repo = "HyNetwork/hysteria",
@ -81,4 +90,18 @@ _M["chinadns-ng"] = {
} }
} }
_M.geoview = {
name = "Geoview",
repo = "snowie2000/geoview",
get_url = gh_release_url,
cmd_version = '-version 2>/dev/null | awk \'NR==1 && $1=="Geoview" {print $2}\'',
zipped = false,
default_path = "/usr/bin/geoview",
match_fmt_str = "linux%%-%s",
file_tree = {
mipsel = "mipsle",
mips64el = "mips64le"
}
}
return _M return _M

View File

@ -189,7 +189,8 @@ local version = {}
</div> </div>
</div> </div>
<%for k, v in pairs(com) do <%for _, k in ipairs(com.order) do
local v = com[k]
version[k] = api.get_app_version(k)%> version[k] = api.get_app_version(k)%>
<div class="cbi-value"> <div class="cbi-value">
<label class="cbi-value-title"><%=v.name%> <label class="cbi-value-title"><%=v.name%>