diff --git a/package/lienol/luci-app-passwall/Makefile b/package/lienol/luci-app-passwall/Makefile index 03aa64822f..090904a836 100644 --- a/package/lienol/luci-app-passwall/Makefile +++ b/package/lienol/luci-app-passwall/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=3.5 -PKG_RELEASE:=16 +PKG_RELEASE:=17 PKG_DATA:=20200220 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua index 573aaf6c34..2593a68b00 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/api/api.lua @@ -13,9 +13,9 @@ LEDE_BOARD = nil DISTRIB_TARGET = nil function uci_get_type(type, config, default) - value = uci:get(appname, "@" .. type .. "[0]", config) or sys.exec( - "echo -n `uci -q get " .. appname .. ".@" .. type .. "[0]." .. - config .. "`") + local value = uci:get_first(appname, type, config, default) or sys.exec( + "echo -n `uci -q get " .. appname .. ".@" .. type .. + "[0]." .. config .. "`") if (value == nil or value == "") and (default and default ~= "") then value = default end @@ -23,10 +23,9 @@ function uci_get_type(type, config, default) end function uci_get_type_id(id, config, default) - value = uci:get(appname, id, config) or - sys.exec( - "echo -n `uci -q get " .. appname .. "." .. id .. "." .. - config .. "`") + local value = uci:get(appname, id, config, default) or + sys.exec("echo -n `uci -q get " .. appname .. "." .. id .. + "." .. config .. "`") if (value == nil or value == "") and (default and default ~= "") then value = default end @@ -175,7 +174,9 @@ function get_api_json(url) -- function(chunk) output[#output + 1] = chunk end) -- local json_content = util.trim(table.concat(output)) - local json_content = luci.sys.exec(wget .. " --no-check-certificate --timeout=10 -t 1 -O- " .. url) + local json_content = luci.sys.exec(wget .. + " --no-check-certificate --timeout=10 -t 1 -O- " .. + url) if json_content == "" then return {} end diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/auto_switch.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/auto_switch.lua index 2b7c2d7285..05be47e3c4 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/auto_switch.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/auto_switch.lua @@ -31,7 +31,7 @@ o = s:option(Value, "testing_time", translate("How often is a diagnosis made"), o.default = "3" ---- TCP Node -local tcp_node_num = api.uci_get_type("global_other", "tcp_node_num", 1) +local tcp_node_num = tonumber(api.uci_get_type("global_other", "tcp_node_num", 1)) for i = 1, tcp_node_num, 1 do o = s:option(DynamicList, "tcp_node" .. i, "TCP " .. i .. " " .. translate("List of backup nodes"), diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua index 654f33158a..b35707b0f0 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/global.lua @@ -37,7 +37,7 @@ table.sort(key_table) m = Map(appname) local status_use_big_icon = api.uci_get_type("global_other", "status_use_big_icon", 1) -if status_use_big_icon and status_use_big_icon == "1" then +if status_use_big_icon and tonumber(status_use_big_icon) == 1 then m:append(Template("passwall/global/status")) else m:append(Template("passwall/global/status2")) @@ -54,7 +54,7 @@ o = s:option(Flag, "enabled", translate("Main switch")) o.rmempty = false ---- TCP Node -local tcp_node_num = api.uci_get_type("global_other", "tcp_node_num", 1) +local tcp_node_num = tonumber(api.uci_get_type("global_other", "tcp_node_num", 1)) for i = 1, tcp_node_num, 1 do if i == 1 then o = s:option(ListValue, "tcp_node" .. i, translate("TCP Node"), @@ -68,7 +68,7 @@ for i = 1, tcp_node_num, 1 do end ---- UDP Node -local udp_node_num = api.uci_get_type("global_other", "udp_node_num", 1) +local udp_node_num = tonumber(api.uci_get_type("global_other", "udp_node_num", 1)) for i = 1, udp_node_num, 1 do if i == 1 then o = s:option(ListValue, "udp_node" .. i, translate("UDP Node"), @@ -85,7 +85,7 @@ for i = 1, udp_node_num, 1 do end ---- Socks5 Node -local socks5_node_num = api.uci_get_type("global_other", "socks5_node_num", 1) +local socks5_node_num = tonumber(api.uci_get_type("global_other", "socks5_node_num", 1)) for i = 1, socks5_node_num, 1 do if i == 1 then o = s:option(ListValue, "socks5_node" .. i, translate("Socks5 Node"), @@ -100,7 +100,7 @@ for i = 1, socks5_node_num, 1 do for _, key in pairs(key_table) do o:value(key, n[key]) end end -if tonumber(api.uci_get_type("global_other", "wangejibadns", 0)) == 1 then +if api.uci_get_type("global_other", "wangejibadns", "0") == "1" then o = s:option(Value, "up_china_dns", translate("China DNS Server") .. "(UDP)", translate( "If you want to work with other DNS acceleration services, use the default.
Example: 127.0.0.1#6053 ,Represents DNS on using 127.0.0.1 the 6053 port. such as SmartDNS, AdGuard Home...
Only use two at most, english comma separation, If you do not fill in the # and the following port, you are using port 53.
If you use custom, unless you know what you're doing, setting it up incorrectly can cause your stuck to crash !")) @@ -123,7 +123,7 @@ o = s:option(ListValue, "dns_mode", translate("DNS Mode"), translate( "if has problem, please try another mode.
if you use no patterns are used, DNS of wan will be used by default as upstream of dnsmasq.")) o.rmempty = false o:reset_values() -if is_finded("chinadns-ng") and tonumber(api.uci_get_type("global_other", "wangejibadns", 0)) == 1 then o:value("chinadns-ng", "ChinaDNS-NG") end +if is_finded("chinadns-ng") and api.uci_get_type("global_other", "wangejibadns", "0") == "1" then o:value("chinadns-ng", "ChinaDNS-NG") end if is_installed("pdnsd") or is_installed("pdnsd-alt") or is_finded("pdnsd") then o:value("pdnsd", "pdnsd") end diff --git a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/other.lua b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/other.lua index c94d101cdf..9976903de9 100644 --- a/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/other.lua +++ b/package/lienol/luci-app-passwall/luasrc/model/cbi/passwall/other.lua @@ -178,8 +178,8 @@ o.rmempty = false ---- Hide Menu o = s:option(Button, "hide", translate("Hide Menu"), translate( - "After the hidden to the display, input example in the address bar: ") .. - "http://192.168.1.1/cgi-bin/luci/admin/vpn/passwall/show") + "After the hidden to the display, input example in the address bar:") .. + " http://192.168.1.1/cgi-bin/luci/admin/vpn/passwall/show") o.inputstyle = "remove" function o.write(e, e) luci.http.redirect(luci.dispatcher.build_url("admin", "vpn", "passwall", 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 7ab2e7e2e4..c5aea3edd6 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 @@ -35,52 +35,6 @@ table td, .table .td {