update 2026-08-10 00:27:38

This commit is contained in:
action
2026-08-10 00:27:38 +08:00
parent 32070715c4
commit bd1470df6e
16 changed files with 59 additions and 71 deletions
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 640 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 550 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 547 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 659 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 650 KiB

@@ -49,24 +49,16 @@ m.uci:foreach(appname, "socks", function(s)
end
end)
local dynamicList_write = function(self, section, value)
local t = {}
local t2 = {}
local new_t = {}
if type(value) == "table" then
local x
for _, x in ipairs(value) do
if x and #x > 0 then
if not t2[x] then
t2[x] = x
t[#t+1] = x
end
end
end
new_t = api.table_remove_duplicates(value)
else
t = { value }
new_t = { value }
end
t = table.concat(t, " ")
return DynamicList.write(self, section, t)
local new_val = table.concat(new_t, " ")
return DynamicList.write(self, section, new_val)
end
-- [[ ACLs Settings ]]--
@@ -373,22 +373,13 @@ if api.is_finded("smartdns") then
return m:get(section, self.option) or {"tcp://1.1.1.1"}
end
function o.write(self, section, value)
local t = {}
local t2 = {}
local new_t = {}
if type(value) == "table" then
local x
for _, x in ipairs(value) do
if x and #x > 0 then
if not t2[x] then
t2[x] = x
t[#t+1] = x
end
end
end
new_t = api.table_remove_duplicates(value)
else
t = { value }
new_t = { value }
end
return DynamicList.write(self, section, t)
return DynamicList.write(self, section, new_t)
end
end
@@ -165,23 +165,14 @@ source.validate = function(self, value, t)
end
local dynamicList_write = function(self, section, value)
local t = {}
local t2 = {}
local new_t = {}
if type(value) == "table" then
local x
for _, x in ipairs(value) do
if x and #x > 0 then
if not t2[x] then
t2[x] = x
t[#t+1] = x
end
end
end
new_t = api.table_remove_duplicates(value)
else
t = { value }
new_t = { value }
end
t = table.concat(t, " ")
return DynamicList.write(self, section, t)
local new_val = table.concat(new_t, " ")
return DynamicList.write(self, section, new_val)
end
source.write = dynamicList_write
@@ -216,23 +216,14 @@ o:depends({ [_n("reality")] = true })
o = s:option(DynamicList, _n("reality_serverNames"), translate("serverNames"))
o:depends({ [_n("reality")] = true })
function o.write(self, section, value)
local t = {}
local t2 = {}
function o.custom_write(self, section, value)
local new_t = {}
if type(value) == "table" then
local x
for _, x in ipairs(value) do
if x and #x > 0 then
if not t2[x] then
t2[x] = x
t[#t+1] = x
end
end
end
new_t = api.table_remove_duplicates(value)
else
t = { value }
new_t = { value }
end
return DynamicList.write(self, section, t)
m:set(section, self.option:sub(1 + #option_prefix), new_t)
end
o = s:option(ListValue, _n("alpn"), translate("alpn"))
+17
View File
@@ -1874,3 +1874,20 @@ function get_network_devices()
table.sort(_devices, function(a, b) return a.sort < b.sort end)
return _devices
end
function table_remove_duplicates(t)
if not t or #t == 0 then return nil end
local t_lookup = {}
local new_t = {}
local x
for _, x in ipairs(t) do
if x and #x > 0 then
if not t_lookup[x] then
t_lookup[x] = x
new_t[#new_t+1] = x
end
end
end
return new_t
end
@@ -1,5 +1,6 @@
<%
local api = require "luci.passwall.api"
local section_tag = api.is_js_luci() and "div" or "fieldset"
-%>
<%+header%>
<script type="text/javascript">
@@ -40,8 +41,8 @@ local api = require "luci.passwall.api"
);
//]]>
</script>
<fieldset class="cbi-section" id="_log_fieldset">
<<%=section_tag%> class="cbi-section" id="_log_fieldset">
<input class="btn cbi-button cbi-button-remove" type="button" onclick="clearlog()" value="<%:Clear logs%>" />
<textarea id="log_textarea" class="cbi-input-textarea" style="width: 100%;margin-top: 10px;" data-update="change" rows="40" wrap="off" readonly="readonly"></textarea>
</fieldset>
</<%=section_tag%>>
<%+footer%>
@@ -1,6 +1,8 @@
<%
local api = require "luci.passwall.api"
local appname = api.appname
local is_js_luci = api.is_js_luci()
local section_tag = is_js_luci and "div" or "fieldset"
-%>
<script src="<%=resource%>/view/<%=appname%>/Sortable.min.js?v=1.15.7"></script>
@@ -364,7 +366,7 @@ table td, .table .td {
</style>
<script type="text/javascript">
<% if api.is_js_luci() then -%>
<% if is_js_luci then -%>
var cbi_t = [];
function cbi_t_add(section, tab) {
var t = document.getElementById('tab.' + section + '.' + tab);
@@ -1286,7 +1288,7 @@ table td, .table .td {
</div>
<script type="text/template" id="nodes-table-template">
<fieldset class="cbi-section cbi-tblsection" id="cbi-<%=appname%>-nodes-{{group}}-fieldset">
<<%=section_tag%> class="cbi-section cbi-tblsection" id="cbi-<%=appname%>-nodes-{{group}}-fieldset">
<table class="table cbi-section-table" id="cbi-<%=appname%>-nodes-{{group}}-table" style="">
<tr class="tr cbi-section-table-titles anonymous">
<th class="th cbi-section-table-cell" style="width:20px">
@@ -1304,7 +1306,7 @@ table td, .table .td {
<input class="cbi-button cbi-button-add" type="button" value="<%:Add%>" onclick="node_action('add')">
<input class="cbi-button cbi-button-apply" style="display: none" type="button" id="save_order_btn_{{group}}" value="<%:Save Order%>" onclick="save_current_page_order('{{group}}')">
</div>
</fieldset>
</<%=section_tag%>>
</script>
<script type="text/template" id="node-tr-template">
@@ -1332,8 +1334,8 @@ table td, .table .td {
</tr>
</script>
<fieldset class="cbi-section" id="node_list">
</fieldset>
<<%=section_tag%> class="cbi-section" id="node_list">
</<%=section_tag%>>
<script type="text/javascript">
//init logic
@@ -1492,7 +1494,7 @@ table td, .table .td {
function addTabDOM(li, content) {
let tab_ul_html = '<ul class="cbi-tabmenu">';
let tab_content_html = '<fieldset class="cbi-section-shunt_rule cbi-section-shunt_rule-tabbed" id="cbi-<%=appname%>-nodes">';
let tab_content_html = '<<%=section_tag%> class="cbi-section-shunt_rule cbi-section-shunt_rule-tabbed" id="cbi-<%=appname%>-nodes">';
if (li) {
tab_ul_html += li;
}
@@ -1500,7 +1502,7 @@ table td, .table .td {
tab_content_html += content;
}
tab_ul_html += '</ul>';
tab_content_html += '</fieldset>';
tab_content_html += '</<%=section_tag%>>';
return tab_ul_html + tab_content_html;
}
@@ -2,6 +2,9 @@
local api = require "luci.passwall.api"
local appname = api.appname
local uci = api.uci
local is_js_luci = api.is_js_luci()
local section_tag = is_js_luci and "div" or "fieldset"
local title_tag = is_js_luci and "h3" or "legend"
-%>
<script src="<%=resource%>/view/<%=appname%>/Sortable.min.js"></script>
@@ -326,7 +329,7 @@ table td, .table .td {
<script type="text/template" id="shunt_rules-table-template">
<fieldset class="cbi-section cbi-tblsection" id="cbi-<%=appname%>-shunt_rules-{{group}}-fieldset">
<<%=section_tag%> class="cbi-section cbi-tblsection" id="cbi-<%=appname%>-shunt_rules-{{group}}-fieldset">
<table class="table cbi-section-table" id="cbi-<%=appname%>-shunt_rules-{{group}}-table" style="">
<tr class="tr cbi-section-table-titles anonymous">
<th class="th cbi-section-table-cell" style="width:30%">ID</th>
@@ -340,7 +343,7 @@ table td, .table .td {
<input class="cbi-button cbi-button-add" type="button" value="<%:Add%>" onclick="toPage('add')">
<input class="cbi-button cbi-button-apply" style="display: none" type="button" id="save_order_btn_{{group}}" value="<%:Save Order%>" onclick="save_current_page_order('{{group}}')">
</div>
</fieldset>
</<%=section_tag%>>
</script>
<script type="text/template" id="shunt_rule-tr-template">
@@ -358,11 +361,11 @@ table td, .table .td {
</tr>
</script>
<div class="cbi-section">
<h3>Sing-Box/Xray <%:Shunt Rule%></h3>
<<%=section_tag%> class="cbi-section">
<<%=title_tag%>>Sing-Box/Xray <%:Shunt Rule%></<%=title_tag%>>
<div class="cbi-section-descr"><a style="color: red"><%:Please note attention to the priority, the higher the order, the higher the priority.%></a></div>
<div id="shunt_rule_list"></div>
</div>
</<%=section_tag%>>
<script type="text/javascript">
function loadNodeList() {
@@ -428,7 +431,7 @@ table td, .table .td {
function addTabDOM(li, content) {
let tab_ul_html = '<ul class="cbi-tabmenu">';
let tab_content_html = '<fieldset class="cbi-section-shunt_rule cbi-section-shunt_rule-tabbed" id="cbi-<%=appname%>-shunt_rules">';
let tab_content_html = '<<%=section_tag%> class="cbi-section-shunt_rule cbi-section-shunt_rule-tabbed" id="cbi-<%=appname%>-shunt_rules">';
if (li) {
tab_ul_html += li;
}
@@ -436,7 +439,7 @@ table td, .table .td {
tab_content_html += content;
}
tab_ul_html += '</ul>';
tab_content_html += '</fieldset>';
tab_content_html += '</<%=section_tag%>>';
return tab_ul_html + tab_content_html;
}