mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-07 12:44:15 +08:00
update 2026-09-12 16:17:58
This commit is contained in:
1 parent
639738b05d
commit
7497dff620
13 files changed
+252
-142
No files matched your search
@@ -5,20 +5,21 @@ local appname = map.config
|
||||
local is_js_luci = api.is_js_luci()
|
||||
local section_tag = is_js_luci and "div" or "fieldset"
|
||||
|
||||
local default_node_type = ""
|
||||
local shunt_rule_list = {}
|
||||
local node = map:get("@global[0]", "node")
|
||||
if node then
|
||||
local node_type = map:get(node, "type")
|
||||
local node_protocol = map:get(node, "protocol")
|
||||
if (node_type == "Xray" or node_type == "sing-box") and node_protocol == "_shunt" then
|
||||
default_node_type = node_protocol
|
||||
if node_protocol == "_shunt" then
|
||||
local node_shunt_group = map:get(node, "shunt_group")
|
||||
map:foreach("shunt_rules", function(e)
|
||||
if e[".name"] and e.remarks and e.group == node_shunt_group then
|
||||
shunt_rule_list[#shunt_rule_list + 1] = e
|
||||
end
|
||||
end)
|
||||
shunt_rule_list[#shunt_rule_list + 1] = {
|
||||
[".name"] = "default_node",
|
||||
remarks = translate("Default")
|
||||
}
|
||||
end
|
||||
end
|
||||
-%>
|
||||
@@ -1671,14 +1672,13 @@ table td, .table .td {
|
||||
<input class="btn cbi-button" type="button" onclick="set_node_div.set('@global[0]', 'node')" value="<%:OK%>" />
|
||||
</div>
|
||||
</div>
|
||||
<% if default_node_type == "_shunt" then %>
|
||||
<% if #shunt_rule_list > 0 then %>
|
||||
<div id="set_node_shunt_div" style="margin: 0.5em 0; padding: 0.5em; background: #f7f7f7; border-radius: 4px;">
|
||||
<div class="cbi-section-descr" style="text-align: left;"><a style="color:#FF8C00"><%:Set as the routing rule node:%></a></div>
|
||||
<div>
|
||||
<% for i, v in ipairs(shunt_rule_list) do %>
|
||||
<input class="btn cbi-button" type="button" onclick="set_node_div.set('<%=node%>', '<%=v[".name"]%>')" value="<%=v.remarks%>" />
|
||||
<% end %>
|
||||
<input class="btn cbi-button" type="button" onclick="set_node_div.set('<%=node%>', 'default_node')" value="<%:Default%>" />
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Reference in new issue
Block a user