🐤 Sync 2026-02-03 12:01:08
All checks were successful
openwrt_helloworld / Update openwrt_helloworld (openwrt-25.12) (push) Successful in 20s

This commit is contained in:
Xiaokailnol
2026-02-03 12:01:08 +00:00
parent 4d88de0366
commit f9f9927d66
2 changed files with 11 additions and 4 deletions

View File

@@ -884,7 +884,7 @@ function geo_view()
return
end
local function get_rules(str, type)
local remarks = {}
local rules_id = {}
uci:foreach(appname, "shunt_rules", function(s)
local list
if type == "geoip" then list = s.ip_list else list = s.domain_list end
@@ -893,14 +893,14 @@ 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) and s.remarks then remarks[#remarks + 1] = s.remarks end
if main:find(str, 1, true) then rules_id[#rules_id + 1] = s[".name"] end
else
if main == str and s.remarks then remarks[#remarks + 1] = s.remarks end
if main == str then rules_id[#rules_id + 1] = s[".name"] end
end
end
end
end)
return remarks
return rules_id
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"

View File

@@ -49,6 +49,13 @@ s.dynamic = false
remarks = s:option(Value, "remarks", translate("Remarks"))
remarks.default = arg[1]
remarks.rmempty = false
remarks.validate = function(self, value, section)
value = api.trim(value)
if value == "" then
return nil, translate("Remark cannot be empty.")
end
return value
end
protocol = s:option(MultiValue, "protocol", translate("Protocol"))
protocol:value("http")