luci-app-passwall: sync upstream

last commit: 5f4057f540
This commit is contained in:
gitea-action 2024-12-21 02:00:19 +08:00
parent c08e28d155
commit 4186f2bb6a
3 changed files with 22 additions and 22 deletions

View File

@ -143,12 +143,16 @@ if (has_singbox or has_xray) and #nodes_table > 0 then
end end
local function get_write(shunt_node_id, option) local function get_write(shunt_node_id, option)
return function(self, section, value) return function(self, section, value)
m:set(shunt_node_id, option, value) if s.fields["tcp_node"]:formvalue(section) == shunt_node_id then
m:set(shunt_node_id, option, value)
end
end end
end end
local function get_remove(shunt_node_id, option) local function get_remove(shunt_node_id, option)
return function(self, section) return function(self, section)
m:del(shunt_node_id, option) if s.fields["tcp_node"]:formvalue(section) == shunt_node_id then
m:del(shunt_node_id, option)
end
end end
end end
if #normal_list > 0 then if #normal_list > 0 then

View File

@ -26,18 +26,12 @@ table td, .table .td {
} }
._now_use { ._now_use {
background: #5e72e445 !important; color: red !important;
} }
.ping a:hover{ .ping a:hover{
text-decoration : underline; text-decoration : underline;
} }
@media (prefers-color-scheme: dark) {
._now_use {
background: #4a90e2 !important;
}
}
</style> </style>
<script type="text/javascript"> <script type="text/javascript">
@ -217,13 +211,12 @@ table td, .table .td {
if (id) { if (id) {
var dom = document.getElementById("cbi-passwall-" + id); var dom = document.getElementById("cbi-passwall-" + id);
if (dom) { if (dom) {
dom.classList.add("_now_use"); dom.title = "当前使用的 TCP 节点";
dom.title = "当前TCP节点";
//var v = "<a style='color: red'>当前TCP节点</a>" + document.getElementById("cbid.passwall." + id + ".remarks").value; //var v = "<a style='color: red'>当前TCP节点</a>" + document.getElementById("cbid.passwall." + id + ".remarks").value;
//document.getElementById("cbi-passwall-" + id + "-remarks").innerHTML = v; //document.getElementById("cbi-passwall-" + id + "-remarks").innerHTML = v;
var tds = dom.getElementsByTagName("td") var dom_remarks = document.getElementById("cbi-passwall-" + id + "-remarks");
for (var j = 0; j < tds.length; j++) { if (dom_remarks) {
tds[j].classList.add("_now_use"); dom_remarks.classList.add("_now_use");
} }
} }
} }
@ -231,11 +224,14 @@ table td, .table .td {
if (id) { if (id) {
var dom = document.getElementById("cbi-passwall-" + id); var dom = document.getElementById("cbi-passwall-" + id);
if (dom) { if (dom) {
dom.classList.add("_now_use"); if (result["TCP"] == result["UDP"]) {
dom.title = "当前UDP节点"; dom.title = "当前使用的 TCP/UDP 节点";
var tds = dom.getElementsByTagName("td") } else {
for (var j = 0; j < tds.length; j++) { dom.title = "当前使用的 UDP 节点";
tds[j].classList.add("_now_use"); }
var dom_remarks = document.getElementById("cbi-passwall-" + id + "-remarks");
if (dom_remarks) {
dom_remarks.classList.add("_now_use");
} }
} }
} }

View File

@ -33,10 +33,10 @@ index 6851861..669a612 100644
if code ~= 0 then if code ~= 0 then
local use_time = luci.sys.exec("echo -n '" .. result .. "' | awk -F ':' '{print $2}'") local use_time = luci.sys.exec("echo -n '" .. result .. "' | awk -F ':' '{print $2}'")
diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
index 958ff0a..89543b9 100644 index 9b0cdb3..bf2c383 100644
--- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua --- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
+++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
@@ -474,6 +474,12 @@ o:value("9.9.9.9", "9.9.9.9 (Quad9)") @@ -478,6 +478,12 @@ o:value("9.9.9.9", "9.9.9.9 (Quad9)")
o:value("149.112.112.112", "149.112.112.112 (Quad9)") o:value("149.112.112.112", "149.112.112.112 (Quad9)")
o:value("208.67.220.220", "208.67.220.220 (OpenDNS)") o:value("208.67.220.220", "208.67.220.220 (OpenDNS)")
o:value("208.67.222.222", "208.67.222.222 (OpenDNS)") o:value("208.67.222.222", "208.67.222.222 (OpenDNS)")
@ -49,7 +49,7 @@ index 958ff0a..89543b9 100644
o:depends({dns_mode = "dns2socks"}) o:depends({dns_mode = "dns2socks"})
o:depends({dns_mode = "tcp"}) o:depends({dns_mode = "tcp"})
o:depends({dns_mode = "udp"}) o:depends({dns_mode = "udp"})
@@ -565,7 +571,7 @@ if api.is_finded("smartdns") then @@ -569,7 +575,7 @@ if api.is_finded("smartdns") then
end end
o = s:taboption("DNS", Flag, "dns_redirect", translate("DNS Redirect"), translate("Force special DNS server to need proxy devices.")) o = s:taboption("DNS", Flag, "dns_redirect", translate("DNS Redirect"), translate("Force special DNS server to need proxy devices."))