update 2026-08-10 00:27:38
No files matched your search
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 319 KiB |
|
Before Width: | Height: | Size: 389 KiB |
|
After Width: | Height: | Size: 640 KiB |
|
After Width: | Height: | Size: 550 KiB |
|
After Width: | Height: | Size: 547 KiB |
|
After Width: | Height: | Size: 659 KiB |
|
After Width: | Height: | Size: 650 KiB |
@@ -49,24 +49,16 @@ m.uci:foreach(appname, "socks", function(s)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
||||||
local dynamicList_write = function(self, section, value)
|
local dynamicList_write = function(self, section, value)
|
||||||
local t = {}
|
local new_t = {}
|
||||||
local t2 = {}
|
|
||||||
if type(value) == "table" then
|
if type(value) == "table" then
|
||||||
local x
|
new_t = api.table_remove_duplicates(value)
|
||||||
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
|
|
||||||
else
|
else
|
||||||
t = { value }
|
new_t = { value }
|
||||||
end
|
end
|
||||||
t = table.concat(t, " ")
|
local new_val = table.concat(new_t, " ")
|
||||||
return DynamicList.write(self, section, t)
|
return DynamicList.write(self, section, new_val)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- [[ ACLs Settings ]]--
|
-- [[ ACLs Settings ]]--
|
||||||
|
|||||||
@@ -373,22 +373,13 @@ if api.is_finded("smartdns") then
|
|||||||
return m:get(section, self.option) or {"tcp://1.1.1.1"}
|
return m:get(section, self.option) or {"tcp://1.1.1.1"}
|
||||||
end
|
end
|
||||||
function o.write(self, section, value)
|
function o.write(self, section, value)
|
||||||
local t = {}
|
local new_t = {}
|
||||||
local t2 = {}
|
|
||||||
if type(value) == "table" then
|
if type(value) == "table" then
|
||||||
local x
|
new_t = api.table_remove_duplicates(value)
|
||||||
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
|
|
||||||
else
|
else
|
||||||
t = { value }
|
new_t = { value }
|
||||||
end
|
end
|
||||||
return DynamicList.write(self, section, t)
|
return DynamicList.write(self, section, new_t)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -165,23 +165,14 @@ source.validate = function(self, value, t)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local dynamicList_write = function(self, section, value)
|
local dynamicList_write = function(self, section, value)
|
||||||
local t = {}
|
local new_t = {}
|
||||||
local t2 = {}
|
|
||||||
if type(value) == "table" then
|
if type(value) == "table" then
|
||||||
local x
|
new_t = api.table_remove_duplicates(value)
|
||||||
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
|
|
||||||
else
|
else
|
||||||
t = { value }
|
new_t = { value }
|
||||||
end
|
end
|
||||||
t = table.concat(t, " ")
|
local new_val = table.concat(new_t, " ")
|
||||||
return DynamicList.write(self, section, t)
|
return DynamicList.write(self, section, new_val)
|
||||||
end
|
end
|
||||||
|
|
||||||
source.write = dynamicList_write
|
source.write = dynamicList_write
|
||||||
|
|||||||
@@ -216,23 +216,14 @@ o:depends({ [_n("reality")] = true })
|
|||||||
|
|
||||||
o = s:option(DynamicList, _n("reality_serverNames"), translate("serverNames"))
|
o = s:option(DynamicList, _n("reality_serverNames"), translate("serverNames"))
|
||||||
o:depends({ [_n("reality")] = true })
|
o:depends({ [_n("reality")] = true })
|
||||||
function o.write(self, section, value)
|
function o.custom_write(self, section, value)
|
||||||
local t = {}
|
local new_t = {}
|
||||||
local t2 = {}
|
|
||||||
if type(value) == "table" then
|
if type(value) == "table" then
|
||||||
local x
|
new_t = api.table_remove_duplicates(value)
|
||||||
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
|
|
||||||
else
|
else
|
||||||
t = { value }
|
new_t = { value }
|
||||||
end
|
end
|
||||||
return DynamicList.write(self, section, t)
|
m:set(section, self.option:sub(1 + #option_prefix), new_t)
|
||||||
end
|
end
|
||||||
|
|
||||||
o = s:option(ListValue, _n("alpn"), translate("alpn"))
|
o = s:option(ListValue, _n("alpn"), translate("alpn"))
|
||||||
|
|||||||
@@ -1874,3 +1874,20 @@ function get_network_devices()
|
|||||||
table.sort(_devices, function(a, b) return a.sort < b.sort end)
|
table.sort(_devices, function(a, b) return a.sort < b.sort end)
|
||||||
return _devices
|
return _devices
|
||||||
end
|
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 api = require "luci.passwall.api"
|
||||||
|
local section_tag = api.is_js_luci() and "div" or "fieldset"
|
||||||
-%>
|
-%>
|
||||||
<%+header%>
|
<%+header%>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@@ -40,8 +41,8 @@ local api = require "luci.passwall.api"
|
|||||||
);
|
);
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</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%>" />
|
<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>
|
<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%>
|
<%+footer%>
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
<%
|
<%
|
||||||
local api = require "luci.passwall.api"
|
local api = require "luci.passwall.api"
|
||||||
local appname = api.appname
|
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>
|
<script src="<%=resource%>/view/<%=appname%>/Sortable.min.js?v=1.15.7"></script>
|
||||||
|
|
||||||
@@ -364,7 +366,7 @@ table td, .table .td {
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
<% if api.is_js_luci() then -%>
|
<% if is_js_luci then -%>
|
||||||
var cbi_t = [];
|
var cbi_t = [];
|
||||||
function cbi_t_add(section, tab) {
|
function cbi_t_add(section, tab) {
|
||||||
var t = document.getElementById('tab.' + section + '.' + tab);
|
var t = document.getElementById('tab.' + section + '.' + tab);
|
||||||
@@ -1286,7 +1288,7 @@ table td, .table .td {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/template" id="nodes-table-template">
|
<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="">
|
<table class="table cbi-section-table" id="cbi-<%=appname%>-nodes-{{group}}-table" style="">
|
||||||
<tr class="tr cbi-section-table-titles anonymous">
|
<tr class="tr cbi-section-table-titles anonymous">
|
||||||
<th class="th cbi-section-table-cell" style="width:20px">
|
<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-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}}')">
|
<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>
|
</div>
|
||||||
</fieldset>
|
</<%=section_tag%>>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/template" id="node-tr-template">
|
<script type="text/template" id="node-tr-template">
|
||||||
@@ -1332,8 +1334,8 @@ table td, .table .td {
|
|||||||
</tr>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<fieldset class="cbi-section" id="node_list">
|
<<%=section_tag%> class="cbi-section" id="node_list">
|
||||||
</fieldset>
|
</<%=section_tag%>>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
//init logic
|
//init logic
|
||||||
@@ -1492,7 +1494,7 @@ table td, .table .td {
|
|||||||
|
|
||||||
function addTabDOM(li, content) {
|
function addTabDOM(li, content) {
|
||||||
let tab_ul_html = '<ul class="cbi-tabmenu">';
|
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) {
|
if (li) {
|
||||||
tab_ul_html += li;
|
tab_ul_html += li;
|
||||||
}
|
}
|
||||||
@@ -1500,7 +1502,7 @@ table td, .table .td {
|
|||||||
tab_content_html += content;
|
tab_content_html += content;
|
||||||
}
|
}
|
||||||
tab_ul_html += '</ul>';
|
tab_ul_html += '</ul>';
|
||||||
tab_content_html += '</fieldset>';
|
tab_content_html += '</<%=section_tag%>>';
|
||||||
return tab_ul_html + tab_content_html;
|
return tab_ul_html + tab_content_html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
local api = require "luci.passwall.api"
|
local api = require "luci.passwall.api"
|
||||||
local appname = api.appname
|
local appname = api.appname
|
||||||
local uci = api.uci
|
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>
|
<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">
|
<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="">
|
<table class="table cbi-section-table" id="cbi-<%=appname%>-shunt_rules-{{group}}-table" style="">
|
||||||
<tr class="tr cbi-section-table-titles anonymous">
|
<tr class="tr cbi-section-table-titles anonymous">
|
||||||
<th class="th cbi-section-table-cell" style="width:30%">ID</th>
|
<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-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}}')">
|
<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>
|
</div>
|
||||||
</fieldset>
|
</<%=section_tag%>>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/template" id="shunt_rule-tr-template">
|
<script type="text/template" id="shunt_rule-tr-template">
|
||||||
@@ -358,11 +361,11 @@ table td, .table .td {
|
|||||||
</tr>
|
</tr>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="cbi-section">
|
<<%=section_tag%> class="cbi-section">
|
||||||
<h3>Sing-Box/Xray <%:Shunt Rule%></h3>
|
<<%=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 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 id="shunt_rule_list"></div>
|
||||||
</div>
|
</<%=section_tag%>>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function loadNodeList() {
|
function loadNodeList() {
|
||||||
@@ -428,7 +431,7 @@ table td, .table .td {
|
|||||||
|
|
||||||
function addTabDOM(li, content) {
|
function addTabDOM(li, content) {
|
||||||
let tab_ul_html = '<ul class="cbi-tabmenu">';
|
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) {
|
if (li) {
|
||||||
tab_ul_html += li;
|
tab_ul_html += li;
|
||||||
}
|
}
|
||||||
@@ -436,7 +439,7 @@ table td, .table .td {
|
|||||||
tab_content_html += content;
|
tab_content_html += content;
|
||||||
}
|
}
|
||||||
tab_ul_html += '</ul>';
|
tab_ul_html += '</ul>';
|
||||||
tab_content_html += '</fieldset>';
|
tab_content_html += '</<%=section_tag%>>';
|
||||||
return tab_ul_html + tab_content_html;
|
return tab_ul_html + tab_content_html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||