luci-app-passwall: sync upstream

last commit: c8f77c6147
This commit is contained in:
gitea-action 2025-04-13 14:00:20 +08:00
parent 34c28ecf08
commit eeca4fa964
2 changed files with 18 additions and 7 deletions

View File

@ -317,11 +317,13 @@ m:append(Template(appname .. "/rule_list/js"))
local geo_dir = (uci:get(appname, "@global_rules[0]", "v2ray_location_asset") or "/usr/share/v2ray/"):match("^(.*)/")
local geosite_path = geo_dir .. "/geosite.dat"
local geoip_path = geo_dir .. "/geoip.dat"
if api.is_finded("geoview") and fs.access(geosite_path) and fs.access(geoip_path) then
if api.finded_com("geoview") and fs.access(geosite_path) and fs.access(geoip_path) then
if api.compare_versions(api.get_app_version("geoview"), ">=", "0.1.0") then
s:tab("geoview", translate("Geo View"))
o = s:taboption("geoview", DummyValue, "_geoview_fieldset")
o.rawhtml = true
o.template = appname .. "/rule_list/geoview"
end
end
function m.on_before_save(self)

View File

@ -15,12 +15,21 @@ local geoip_all_tag = {}
local srss_path = "/tmp/etc/" .. appname .."_tmp/srss/"
local function convert_geofile()
if api.compare_versions(local_version:match("[^v]+"), "<", "1.8.0") then
api.log("注意Sing-Box 版本低Sing-Box 分流无法启用!请在[组件更新]中更新。")
return
end
local geo_dir = (uci:get(appname, "@global_rules[0]", "v2ray_location_asset") or "/usr/share/v2ray/"):match("^(.*)/")
local geosite_path = geo_dir .. "/geosite.dat"
local geoip_path = geo_dir .. "/geoip.dat"
if not api.is_finded("geoview") then
api.log("* 注意:缺少 geoview 组件Sing-Box 分流无法启用!")
if not api.finded_com("geoview") then
api.log("!!!注意:缺少 Geoview 组件Sing-Box 分流无法启用!请在[组件更新]中更新。")
return
else
if api.compare_versions(api.get_app_version("geoview"), "<", "0.1.6") then
api.log("注意Geoview 组件版本低Sing-Box 分流无法启用!请在[组件更新]中更新。")
return
end
end
if not fs.access(srss_path) then
fs.mkdir(srss_path)