diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua index 48ce08bd0..88867f555 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua @@ -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 - s:tab("geoview", translate("Geo View")) - o = s:taboption("geoview", DummyValue, "_geoview_fieldset") - o.rawhtml = true - o.template = appname .. "/rule_list/geoview" +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) diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index 906fdc665..9453b0aed 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -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)