diff --git a/package/lienol/luci-app-passwall/Makefile b/package/lienol/luci-app-passwall/Makefile
index beafe195d8..90cc230643 100644
--- a/package/lienol/luci-app-passwall/Makefile
+++ b/package/lienol/luci-app-passwall/Makefile
@@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall
PKG_VERSION:=4
-PKG_RELEASE:=6
-PKG_DATE:=20210104
+PKG_RELEASE:=7
+PKG_DATE:=20210111
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua
index 63d823a3ab..0302032b64 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_xray.lua
@@ -174,7 +174,7 @@ if node_section then
listen = "0.0.0.0",
port = tonumber(socks_proxy_port),
protocol = "socks",
- settings = {auth = "noauth", udp = true, ip = "127.0.0.1"}
+ settings = {auth = "noauth", udp = true}
})
network = "tcp,udp"
end
diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
index 24236c0d61..458a2dda94 100644
--- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
+++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
@@ -322,6 +322,9 @@ o = s:taboption("tips", DummyValue, "")
o.template = appname .. "/global/tips"
-- [[ Socks Server ]]--
+o = s:taboption("Main", Flag, "socks_enabled", "Socks" .. translate("Main switch"))
+o.rmempty = false
+
s = m:section(TypedSection, "socks", translate("Socks Config"))
s.anonymous = true
s.addremove = true
diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/footer.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/footer.htm
index 8e033c92aa..3fdc23c66d 100644
--- a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/footer.htm
+++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/footer.htm
@@ -72,6 +72,10 @@ local auto_switch = api.uci_get_type("auto_switch", "enable", 0)
var socks = document.getElementById("cbi-passwall-socks");
if (socks) {
+ var socks_enabled_dom = document.getElementById(global_id + "-socks_enabled");
+ socks_enabled_dom.parentNode.removeChild(socks_enabled_dom);
+ var descr = socks.getElementsByClassName("cbi-section-descr")[0];
+ descr.outerHTML = socks_enabled_dom.outerHTML;
rows = socks.getElementsByClassName("cbi-section-table-row");
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm
index 8d05751bb0..611644826e 100644
--- a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm
+++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status.htm
@@ -12,7 +12,7 @@ Copyright 2013 Yahoo!
Licensed under the BSD License.
https://github.com/pure-css/pure/blob/master/LICENSE.md
*/
-.pure-g{letter-spacing:-.31em;text-rendering:optimizespeed;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){table .pure-g{display:block}}.opera-only :-o-prefocus,.pure-g{word-spacing:-.43em}.pure-u{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-g [class*=pure-u]{font-family:sans-serif}.pure-u-1,.pure-u-1-1,.pure-u-1-12,.pure-u-1-2,.pure-u-1-24,.pure-u-1-3,.pure-u-1-4,.pure-u-1-5,.pure-u-1-6,.pure-u-1-8,.pure-u-10-24,.pure-u-11-12,.pure-u-11-24,.pure-u-12-24,.pure-u-13-24,.pure-u-14-24,.pure-u-15-24,.pure-u-16-24,.pure-u-17-24,.pure-u-18-24,.pure-u-19-24,.pure-u-2-24,.pure-u-2-3,.pure-u-2-5,.pure-u-20-24,.pure-u-21-24,.pure-u-22-24,.pure-u-23-24,.pure-u-24-24,.pure-u-3-24,.pure-u-3-4,.pure-u-3-5,.pure-u-3-8,.pure-u-4-24,.pure-u-4-5,.pure-u-5-12,.pure-u-5-24,.pure-u-5-5,.pure-u-5-6,.pure-u-5-8,.pure-u-6-24,.pure-u-7-12,.pure-u-7-24,.pure-u-7-8,.pure-u-8-24,.pure-u-9-24{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-u-1-24{width:4.1667%}.pure-u-1-12,.pure-u-2-24{width:8.3333%}.pure-u-1-8,.pure-u-3-24{width:12.5%}.pure-u-1-6,.pure-u-4-24{width:16.6667%}.pure-u-1-5{width:20%}.pure-u-5-24{width:20.8333%}.pure-u-1-4,.pure-u-6-24{width:25%}.pure-u-7-24{width:29.1667%}.pure-u-1-3,.pure-u-8-24{width:33.3333%}.pure-u-3-8,.pure-u-9-24{width:37.5%}.pure-u-2-5{width:40%}.pure-u-10-24,.pure-u-5-12{width:41.6667%}.pure-u-11-24{width:45.8333%}.pure-u-1-2,.pure-u-12-24{width:50%}.pure-u-13-24{width:54.1667%}.pure-u-14-24,.pure-u-7-12{width:58.3333%}.pure-u-3-5{width:60%}.pure-u-15-24,.pure-u-5-8{width:62.5%}.pure-u-16-24,.pure-u-2-3{width:66.6667%}.pure-u-17-24{width:70.8333%}.pure-u-18-24,.pure-u-3-4{width:75%}.pure-u-19-24{width:79.1667%}.pure-u-4-5{width:80%}.pure-u-20-24,.pure-u-5-6{width:83.3333%}.pure-u-21-24,.pure-u-7-8{width:87.5%}.pure-u-11-12,.pure-u-22-24{width:91.6667%}.pure-u-23-24{width:95.8333%}.pure-u-1,.pure-u-1-1,.pure-u-24-24,.pure-u-5-5{width:100%}
+.pure-g{letter-spacing:-.31em;text-rendering:optimizespeed;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active) {table .pure-g{display:block}}.opera-only :-o-prefocus,.pure-g{word-spacing:-.43em}.pure-u{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-g [class*=pure-u]{font-family:sans-serif}.pure-u-1,.pure-u-1-1,.pure-u-1-12,.pure-u-1-2,.pure-u-1-24,.pure-u-1-3,.pure-u-1-4,.pure-u-1-5,.pure-u-1-6,.pure-u-1-8,.pure-u-10-24,.pure-u-11-12,.pure-u-11-24,.pure-u-12-24,.pure-u-13-24,.pure-u-14-24,.pure-u-15-24,.pure-u-16-24,.pure-u-17-24,.pure-u-18-24,.pure-u-19-24,.pure-u-2-24,.pure-u-2-3,.pure-u-2-5,.pure-u-20-24,.pure-u-21-24,.pure-u-22-24,.pure-u-23-24,.pure-u-24-24,.pure-u-3-24,.pure-u-3-4,.pure-u-3-5,.pure-u-3-8,.pure-u-4-24,.pure-u-4-5,.pure-u-5-12,.pure-u-5-24,.pure-u-5-5,.pure-u-5-6,.pure-u-5-8,.pure-u-6-24,.pure-u-7-12,.pure-u-7-24,.pure-u-7-8,.pure-u-8-24,.pure-u-9-24{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-u-1-24{width:4.1667%}.pure-u-1-12,.pure-u-2-24{width:8.3333%}.pure-u-1-8,.pure-u-3-24{width:12.5%}.pure-u-1-6,.pure-u-4-24{width:16.6667%}.pure-u-1-5{width:20%}.pure-u-5-24{width:20.8333%}.pure-u-1-4,.pure-u-6-24{width:25%}.pure-u-7-24{width:29.1667%}.pure-u-1-3,.pure-u-8-24{width:33.3333%}.pure-u-3-8,.pure-u-9-24{width:37.5%}.pure-u-2-5{width:40%}.pure-u-10-24,.pure-u-5-12{width:41.6667%}.pure-u-11-24{width:45.8333%}.pure-u-1-2,.pure-u-12-24{width:50%}.pure-u-13-24{width:54.1667%}.pure-u-14-24,.pure-u-7-12{width:58.3333%}.pure-u-3-5{width:60%}.pure-u-15-24,.pure-u-5-8{width:62.5%}.pure-u-16-24,.pure-u-2-3{width:66.6667%}.pure-u-17-24{width:70.8333%}.pure-u-18-24,.pure-u-3-4{width:75%}.pure-u-19-24{width:79.1667%}.pure-u-4-5{width:80%}.pure-u-20-24,.pure-u-5-6{width:83.3333%}.pure-u-21-24,.pure-u-7-8{width:87.5%}.pure-u-11-12,.pure-u-22-24{width:91.6667%}.pure-u-23-24{width:95.8333%}.pure-u-1,.pure-u-1-1,.pure-u-24-24,.pure-u-5-5{width:100%}
.block {
margin: 0.5rem;
padding: 0;
@@ -237,67 +237,35 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
var status_haproxy = document.getElementById('status_haproxy');
var status_kcptun = document.getElementById('status_kcptun');
if (data) {
- var tcp_node_num = 1;
- if (tcp_node_num >= 1) {
+ if (true) {
var status_tcp_node = document.getElementById('status_tcp_node');
if (status_tcp_node) {
var text = 'TCP
';
- if (tcp_node_num == 1) {
- if (data["tcp_node_status"])
- text += '<%:RUNNING%>';
- else
- text += '<%:NOT RUNNING%>';
- } else {
- for(var i = 0; i < tcp_node_num; i++) {
- var k = i + 1;
- if (data["tcp_node" + k + "_status"])
- text += ' ✓';
- else
- text += ' X';
- }
- }
+ if (data["tcp_node_status"])
+ text += '<%:RUNNING%>';
+ else
+ text += '<%:NOT RUNNING%>';
status_tcp_node.innerHTML = text;
}
var status_kcptun = document.getElementById('status_kcptun');
if (status_kcptun) {
var text = 'Kcptun
';
- if (tcp_node_num == 1) {
- if (data["kcptun_tcp_node_status"])
- text += '<%:RUNNING%>';
- else
- text += '<%:NOT RUNNING%>';
- } else {
- for(var i = 0; i < tcp_node_num; i++) {
- var k = i + 1;
- if (data["kcptun_tcp_node" + k + "_status"])
- text += ' ✓';
- else
- text += ' X';
- }
- }
+ if (data["kcptun_tcp_node_status"])
+ text += '<%:RUNNING%>';
+ else
+ text += '<%:NOT RUNNING%>';
status_kcptun.innerHTML = text;
}
}
- var udp_node_num = 1;
- if (udp_node_num >= 1) {
+ if (true) {
var status_udp_node = document.getElementById('status_udp_node');
if (status_udp_node) {
var text = 'UDP
';
- if (udp_node_num == 1) {
- if (data["udp_node_status"])
- text += '<%:RUNNING%>';
- else
- text += '<%:NOT RUNNING%>';
- } else {
- for(var i = 0; i < udp_node_num; i++) {
- var k = i + 1;
- if (data["udp_node" + k + "_status"])
- text += ' ✓';
- else
- text += ' X';
- }
- }
+ if (data["udp_node_status"])
+ text += '<%:RUNNING%>';
+ else
+ text += '<%:NOT RUNNING%>';
status_udp_node.innerHTML = text;
}
}
diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm
index 3dbab23185..05234f7f72 100644
--- a/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm
+++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/global/status2.htm
@@ -161,65 +161,33 @@ local status = api.uci_get_type("global_other", "status", "")
if (x && x.status == 200) {
var tcp_node_status = document.getElementById('_tcp_node_status');
if (tcp_node_status) {
- var tcp_node_num = 1;
- if (tcp_node_num >= 1) {
+ if (true) {
var text = '';
- if (tcp_node_num == 1) {
- if (json["tcp_node_status"])
- text += '<%:RUNNING%> ✓';
- else
- text += '<%:NOT RUNNING%> X';
- } else {
- for(var i = 0; i < tcp_node_num; i++) {
- var k = i + 1;
- if (json["tcp_node" + k + "_status"])
- text += ' ✓';
- else
- text += ' X';
- }
- }
+ if (json["tcp_node_status"])
+ text += '<%:RUNNING%> ✓';
+ else
+ text += '<%:NOT RUNNING%> X';
tcp_node_status.innerHTML = text;
var kcptun_tcp_node_status = document.getElementById('_kcptun_tcp_node_status');
text = "";
- if (tcp_node_num == 1) {
- if (json["kcptun_tcp_node_status"])
- text += '<%:RUNNING%> ✓';
- else
- text += '<%:NOT RUNNING%> X';
- } else {
- for(var i = 0; i < tcp_node_num; i++) {
- var k = i + 1;
- if (json["tcp_node" + k + "_status"])
- text += ' ✓';
- else
- text += ' X';
- }
- }
- if(kcptun_tcp_node_status)
+ if (json["kcptun_tcp_node_status"])
+ text += '<%:RUNNING%> ✓';
+ else
+ text += '<%:NOT RUNNING%> X';
+ if (kcptun_tcp_node_status)
kcptun_tcp_node_status.innerHTML = text;
}
}
var udp_node_status = document.getElementById('_udp_node_status');
if (udp_node_status) {
- var udp_node_num = 1;
- if (udp_node_num >= 1) {
+ if (true) {
var text = '';
- if (udp_node_num == 1) {
- if (json["udp_node_status"])
- text += '<%:RUNNING%> ✓';
- else
- text += '<%:NOT RUNNING%> X';
- } else {
- for(var i = 0; i < udp_node_num; i++) {
- var k = i + 1;
- if (json["udp_node" + k + "_status"])
- text += ' ✓';
- else
- text += ' X';
- }
- }
+ if (json["udp_node_status"])
+ text += '<%:RUNNING%> ✓';
+ else
+ text += '<%:NOT RUNNING%> X';
udp_node_status.innerHTML = text;
}
}
@@ -251,20 +219,18 @@ local status = api.uci_get_type("global_other", "status", "")
} else {
color = "red";
}
- //s.setAttribute("color", color);
- btn.setAttribute("style","color: " + color + " !important");
- btn.value = use_time + " ms";;
+ s.setAttribute("color", color);
+ s.innerHTML = use_time + " ms";
} else if (rv.status) {
- btn.setAttribute("style","color: green !important");
- btn.value = "<%:Working...%>";
+ s.setAttribute("color", "green");
+ s.innerHTML = "<%:Working...%>";
} else {
- //s.setAttribute("color", "red");
- btn.setAttribute("style","color: red !important");
- btn.value = '<%:Problem detected!%> X';
+ s.setAttribute("color", "red");
+ s.innerHTML = '<%:Problem detected!%> X';
}
}
btn.disabled = false;
- //btn.value = '<%:Check%>';
+ btn.value = '<%:Check%>';
}
);
return false;
diff --git a/package/lienol/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm b/package/lienol/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm
index 77a31ed1f6..0079d4a43e 100644
--- a/package/lienol/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm
+++ b/package/lienol/luci-app-passwall/luasrc/view/passwall/node_list/node_list.htm
@@ -2,8 +2,6 @@
-- Copyright (C) 2018-2020 L-WRT Team
local api = require "luci.model.cbi.passwall.api.api"
local dsp = require "luci.dispatcher"
-
- local nodes_display = api.uci_get_type("global_other", "nodes_display", "")
-%>