luci: unified code style (#2395)

* luci: unified code style
- checked newline at end of file
- unified indent
- removed whitespaces at end of line

* luci: change the indentation of lua files to tabs
This commit is contained in:
nftbty 2023-03-22 08:55:34 +08:00 committed by sbwml
parent 5e84915db1
commit 36c6425b3f
38 changed files with 3688 additions and 3687 deletions

View File

@ -109,7 +109,7 @@ end
if (os.execute("lsmod | grep -i REDIRECT >/dev/null") == 0 and os.execute("lsmod | grep -i TPROXY >/dev/null") == 0) or (os.execute("lsmod | grep -i nft_redir >/dev/null") == 0 and os.execute("lsmod | grep -i nft_tproxy >/dev/null") == 0) then if (os.execute("lsmod | grep -i REDIRECT >/dev/null") == 0 and os.execute("lsmod | grep -i TPROXY >/dev/null") == 0) or (os.execute("lsmod | grep -i nft_redir >/dev/null") == 0 and os.execute("lsmod | grep -i nft_tproxy >/dev/null") == 0) then
o = s:option(ListValue, "tcp_proxy_way", translate("TCP Proxy Way")) o = s:option(ListValue, "tcp_proxy_way", translate("TCP Proxy Way"))
o.default = "tproxy" o.default = "redirect"
o:value("redirect", "REDIRECT") o:value("redirect", "REDIRECT")
o:value("tproxy", "TPROXY") o:value("tproxy", "TPROXY")
o:depends("ipv6_tproxy", false) o:depends("ipv6_tproxy", false)

View File

@ -70,4 +70,3 @@ m:append(Template("passwall/server/log"))
m:append(Template("passwall/server/users_list_status")) m:append(Template("passwall/server/users_list_status"))
return m return m

View File

@ -27,7 +27,6 @@ function gen_config_server(node)
return config return config
end end
function gen_config(var) function gen_config(var)
local node_id = var["-node"] local node_id = var["-node"]
if not node_id then if not node_id then

View File

@ -37,7 +37,6 @@ local version = {}
if (inProgressCount === 0) { if (inProgressCount === 0) {
window.onbeforeunload = undefined; window.onbeforeunload = undefined;
} }
} }
function onUpdateSuccess(btn) { function onUpdateSuccess(btn) {

View File

@ -10,6 +10,7 @@ local api = require "luci.passwall.api"
window.location.href = '<%=api.url("autoswitch_add_node")%>' + "?key=" + key; window.location.href = '<%=api.url("autoswitch_add_node")%>' + "?key=" + key;
} }
} }
function remove_node_by_key() { function remove_node_by_key() {
var key = prompt("<%:Please enter the node keyword, pay attention to distinguish between spaces, uppercase and lowercase.%>", ""); var key = prompt("<%:Please enter the node keyword, pay attention to distinguish between spaces, uppercase and lowercase.%>", "");
if (key) { if (key) {

View File

@ -14,6 +14,7 @@ local api = require "luci.passwall.api"
} }
); );
} }
XHR.poll(5, '<%=api.url("get_log")%>', null, XHR.poll(5, '<%=api.url("get_log")%>', null,
function(x, data) { function(x, data) {
if(x && x.status == 200) { if(x && x.status == 200) {

View File

@ -55,6 +55,7 @@ local has_xray = api.is_finded("xray")
return ''; return '';
return b64decsafe(v); return b64decsafe(v);
} }
function parseNodeUrl(url) { function parseNodeUrl(url) {
var m = url.match(/^(([^:\/?#]+:)?(?:\/\/((?:([^\/?#:]*)([^\/?#:]*)@)?([^\/?#:]*)(?::([^\/?#:]*))?)))?([^?#]*)(\?[^#]*)?(#.*)?$/), var m = url.match(/^(([^:\/?#]+:)?(?:\/\/((?:([^\/?#:]*)([^\/?#:]*)@)?([^\/?#:]*)(?::([^\/?#:]*))?)))?([^?#]*)(\?[^#]*)?(#.*)?$/),
r = { r = {

View File

@ -14,6 +14,7 @@ local api = require "luci.passwall.api"
} }
); );
} }
XHR.poll(3, '<%=api.url("server_get_log")%>', null, XHR.poll(3, '<%=api.url("server_get_log")%>', null,
function(x, data) { function(x, data) {
if(x && x.status == 200) { if(x && x.status == 200) {