update 2026-09-02 23:49:44

This commit is contained in:
action committed 2026-09-02 23:49:44 +08:00
1 parent 86b8972e8e
commit beae9d285e
1991 files changed
+1523711 -147

No files matched your search

@@ -797,7 +797,7 @@ function geo_view()
return
end
local function get_rules(str, type)
local rules_id = {}
local rules = {}
uci_foreach("shunt_rules", function(s)
local list
if type == "geoip" then list = s.ip_list else list = s.domain_list end
@@ -806,14 +806,18 @@ function geo_view()
local prefix, main = line:match("^(.-):(.*)")
if not main then main = line end
if type == "geoip" and (api.datatypes.ipaddr(str) or api.datatypes.ip6addr(str)) then
if main:find(str, 1, true) then rules_id[#rules_id + 1] = s[".name"] end
if main:find(str, 1, true) then
table.insert(rules, {id = s[".name"], group = s.group or i18n.translate("default")})
end
else
if main == str then rules_id[#rules_id + 1] = s[".name"] end
if main == str then
table.insert(rules, {id = s[".name"], group = s.group or i18n.translate("default")})
end
end
end
end
end)
return rules_id
return rules
end
local geo_dir = (uci_get("@global_rules[0]", "v2ray_location_asset") or "/usr/share/v2ray/"):match("^(.*)/")
local geosite_path = geo_dir .. "/geosite.dat"
@@ -834,11 +838,17 @@ function geo_view()
for line in geo_string:gmatch("([^\n]+)") do
lines[#lines + 1] = geo_type .. ":" .. line
for _, r in ipairs(get_rules(line, geo_type) or {}) do
if not seen[r] then seen[r] = true; rules[#rules + 1] = r end
if not seen[r.id] then
seen[r.id] = true
rules[#rules + 1] = string.format("[%s]%s", r.group, r.id)
end
end
end
for _, r in ipairs(get_rules(value, geo_type) or {}) do
if not seen[r] then seen[r] = true; rules[#rules + 1] = r end
if not seen[r.id] then
seen[r.id] = true
rules[#rules + 1] = string.format("[%s]%s", r.group, r.id)
end
end
geo_string = table.concat(lines, "\n")
if #rules > 0 then