mirror of
https://github.com/bolucat/Archive.git
synced 2025-12-24 13:28:37 +08:00
Update On Sun Dec 7 19:36:54 CET 2025
This commit is contained in:
@@ -95,18 +95,12 @@ o = s:option(MultiValue, "autoswitch_backup_node", translate("List of backup nod
|
||||
o:depends("enable_autoswitch", true)
|
||||
o.widget = "checkbox"
|
||||
o.template = appname .. "/cbi/nodes_multiselect"
|
||||
local keylist = {}
|
||||
local vallist = {}
|
||||
local grouplist = {}
|
||||
o.group = {}
|
||||
for i, v in pairs(nodes_table) do
|
||||
keylist[i] = v.id
|
||||
vallist[i] = v.remark
|
||||
grouplist[i] = v.group or ""
|
||||
o:value(v.id, v.remark)
|
||||
o.group[#o.group+1] = v.group or ""
|
||||
socks_node:value(v.id, v["remark"])
|
||||
end
|
||||
o.keylist = keylist
|
||||
o.vallist = vallist
|
||||
o.group = grouplist
|
||||
-- 读取旧 DynamicList
|
||||
function o.cfgvalue(self, section)
|
||||
local val = m.uci:get_list(appname, section, "autoswitch_backup_node")
|
||||
|
||||
@@ -103,17 +103,11 @@ o = s:option(MultiValue, _n("balancing_node"), translate("Load balancing node li
|
||||
o:depends({ [_n("protocol")] = "_balancing" })
|
||||
o.widget = "checkbox"
|
||||
o.template = appname .. "/cbi/nodes_multiselect"
|
||||
local keylist = {}
|
||||
local vallist = {}
|
||||
local grouplist = {}
|
||||
for i, v in ipairs(nodes_table) do
|
||||
keylist[i] = v.id
|
||||
vallist[i] = v.remark
|
||||
grouplist[i] = v.group or ""
|
||||
o.group = {}
|
||||
for i, v in pairs(nodes_table) do
|
||||
o:value(v.id, v.remark)
|
||||
o.group[#o.group+1] = v.group or ""
|
||||
end
|
||||
o.keylist = keylist
|
||||
o.vallist = vallist
|
||||
o.group = grouplist
|
||||
-- 读取旧 DynamicList
|
||||
function o.cfgvalue(self, section)
|
||||
local val = m.uci:get_list(appname, section, "balancing_node")
|
||||
|
||||
@@ -110,17 +110,11 @@ o = s:option(MultiValue, _n("urltest_node"), translate("URLTest node list"), tra
|
||||
o:depends({ [_n("protocol")] = "_urltest" })
|
||||
o.widget = "checkbox"
|
||||
o.template = appname .. "/cbi/nodes_multiselect"
|
||||
local keylist = {}
|
||||
local vallist = {}
|
||||
local grouplist = {}
|
||||
for i, v in ipairs(nodes_table) do
|
||||
keylist[i] = v.id
|
||||
vallist[i] = v.remark
|
||||
grouplist[i] = v.group or ""
|
||||
o.group = {}
|
||||
for i, v in pairs(nodes_table) do
|
||||
o:value(v.id, v.remark)
|
||||
o.group[#o.group+1] = v.group or ""
|
||||
end
|
||||
o.keylist = keylist
|
||||
o.vallist = vallist
|
||||
o.group = grouplist
|
||||
-- 读取旧 DynamicList
|
||||
function o.cfgvalue(self, section)
|
||||
local val = m.uci:get_list(appname, section, "urltest_node")
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<%+cbi/valueheader%>
|
||||
<%
|
||||
local api = require "luci.passwall.api"
|
||||
local cbid = "cbid." .. self.config .. "." .. section .. "." .. self.option
|
||||
|
||||
-- 读取 MultiValue
|
||||
@@ -32,7 +31,7 @@ local group_order = {}
|
||||
for _, item in ipairs(values) do
|
||||
local g = item.group
|
||||
if not g or g == "" then
|
||||
g = api.i18n.translate("default")
|
||||
g = translate("default")
|
||||
end
|
||||
if not groups[g] then
|
||||
groups[g] = {}
|
||||
@@ -42,6 +41,30 @@ for _, item in ipairs(values) do
|
||||
end
|
||||
%>
|
||||
|
||||
<style>
|
||||
/* 组标题的右箭头(折叠) */
|
||||
.lv-arrow-right {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-top: 4px solid transparent;
|
||||
border-bottom: 4px solid transparent;
|
||||
border-left: 5px solid #555;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* 组标题的下箭头(展开) */
|
||||
.lv-arrow-down-small {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 4px solid transparent;
|
||||
border-right: 4px solid transparent;
|
||||
border-top: 5px solid #555;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="<%=cbid%>" style="display: inline-block;">
|
||||
<!-- 搜索 -->
|
||||
<input type="text"
|
||||
@@ -60,8 +83,8 @@ end
|
||||
<div class="group-title"
|
||||
onclick="toggleGroup_<%=self.option%>('<%=gname%>')"
|
||||
style="cursor:pointer;padding:6px;background:#f0f0f0;border-radius:4px;margin-bottom:4px;display:flex;align-items:center;white-space:nowrap;">
|
||||
<span id="arrow-<%=self.option%>-<%=gname%>" style="width:16px;">▼</span>
|
||||
<b><%=gname%></b>
|
||||
<span id="arrow-<%=self.option%>-<%=gname%>" class="lv-arrow-down-small"></span>
|
||||
<b style="margin-left:8px;"><%=gname%></b>
|
||||
<span id="group-count-<%=self.option%>-<%=gname%>" style="margin-left:8px;color:blue;">
|
||||
(0/<%=#items%>)
|
||||
</span>
|
||||
@@ -116,10 +139,10 @@ end
|
||||
if (isSearching) {
|
||||
if (ul.style.display === "none") {
|
||||
ul.style.display = "";
|
||||
if (arrow) arrow.textContent = "▼";
|
||||
if (arrow) arrow.className = "lv-arrow-down-small";
|
||||
} else {
|
||||
ul.style.display = "none";
|
||||
if (arrow) arrow.textContent = "►";
|
||||
if (arrow) arrow.className = "lv-arrow-right";
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -131,17 +154,17 @@ end
|
||||
const garrow = document.getElementById("arrow-" + opt + "-" + gname);
|
||||
if (gname !== g) {
|
||||
if (gul) gul.style.display = "none";
|
||||
if (garrow) garrow.textContent = "►";
|
||||
if (garrow) arrow.className = "lv-arrow-right";
|
||||
}
|
||||
});
|
||||
document.getElementById(listId).parentNode.scrollTop = 0;
|
||||
// 切换当前组
|
||||
if (ul.style.display === "none") {
|
||||
ul.style.display = "";
|
||||
if (arrow) arrow.textContent = "▼";
|
||||
if (arrow) arrow.className = "lv-arrow-down-small";
|
||||
} else {
|
||||
ul.style.display = "none";
|
||||
if (arrow) arrow.textContent = "►";
|
||||
if (arrow) arrow.className = "lv-arrow-right";
|
||||
}
|
||||
};
|
||||
|
||||
@@ -175,7 +198,7 @@ end
|
||||
group.style.display = "";
|
||||
if (keyword) {
|
||||
ul.style.display = "";
|
||||
arrow.textContent = "▼";
|
||||
arrow.className = "lv-arrow-down-small";
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -190,7 +213,7 @@ end
|
||||
const ul = document.getElementById("group-" + opt + "-" + gname);
|
||||
const arrow = document.getElementById("arrow-" + opt + "-" + gname);
|
||||
if (ul) ul.style.display = "none";
|
||||
if (arrow) arrow.textContent = "►";
|
||||
if (arrow) arrow.className = "lv-arrow-right";
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -243,7 +266,7 @@ end
|
||||
const ul = document.getElementById("group-" + opt + "-" + gname);
|
||||
const arrow = document.getElementById("arrow-" + opt + "-" + gname);
|
||||
if (ul) ul.style.display = "none";
|
||||
if (arrow) arrow.textContent = "►";
|
||||
if (arrow) arrow.className = "lv-arrow-right";
|
||||
});
|
||||
|
||||
updateCount();
|
||||
|
||||
@@ -321,7 +321,7 @@ local api = require "luci.passwall.api"
|
||||
<input class="btn cbi-button cbi-button-remove" type="button" onclick="delete_select_nodes()" value="<%:Delete select nodes%>" />
|
||||
<input class="btn cbi-button cbi-button-edit" type="button" id="select_all_btn" onclick="checked_all_node(this)" value="<%:Select all%>" />
|
||||
<input class="btn cbi-button cbi-button-edit" type="button" onclick="open_reassign_group_div()" value="<%:Reassign Group%>" />
|
||||
<!--<input class="btn cbi-button cbi-button-apply" type="submit" name="cbi.apply" value="<%:Save & Apply%>" />-->
|
||||
<input class="btn cbi-button cbi-button-apply" type="submit" name="cbi.apply" value="<%:Save & Apply%>" />
|
||||
<!--<input class="btn cbi-button cbi-button-save" type="submit" name="cbi.save" value="<%:Save%>" />-->
|
||||
<!--<input class="btn cbi-button cbi-button-reset" type="button" value="<%:Reset%>" onclick="location.href='<%=REQUEST_URI%>'" />-->
|
||||
</div>
|
||||
|
||||
@@ -160,11 +160,6 @@ table td, .table .td {
|
||||
background-color: rgba(131, 191, 255, 0.7) !important;
|
||||
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
/* hide save button */
|
||||
.cbi-page-actions {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<% if api.is_js_luci() then -%>
|
||||
|
||||
Reference in New Issue
Block a user