diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile
index b83e4c1a4..44f595842 100644
--- a/luci-app-passwall/Makefile
+++ b/luci-app-passwall/Makefile
@@ -12,6 +12,7 @@ PKG_RELEASE:=1
PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_Iptables_Transparent_Proxy \
CONFIG_PACKAGE_$(PKG_NAME)_Nftables_Transparent_Proxy \
+ CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Geoview \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Haproxy \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy \
@@ -26,7 +27,6 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Trojan_Plus \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_tuic_client \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Geodata \
- CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Geoview \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Plugin \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Xray \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Xray_Plugin
@@ -64,6 +64,11 @@ config PACKAGE_$(PKG_NAME)_Nftables_Transparent_Proxy
select PACKAGE_kmod-nft-nat
default y if PACKAGE_firewall4
+config PACKAGE_$(PKG_NAME)_INCLUDE_Geoview
+ bool "Include Geoview"
+ select PACKAGE_geoview
+ default n
+
config PACKAGE_$(PKG_NAME)_INCLUDE_Haproxy
bool "Include Haproxy"
select PACKAGE_haproxy
@@ -141,11 +146,6 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Geodata
select PACKAGE_v2ray-geosite
default n
-config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Geoview
- bool "Include V2ray_Geoview"
- select PACKAGE_geoview
- default n
-
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Plugin
bool "Include V2ray-Plugin (Shadowsocks Plugin)"
select PACKAGE_v2ray-plugin
diff --git a/luci-app-passwall/luasrc/controller/passwall.lua b/luci-app-passwall/luasrc/controller/passwall.lua
index 8df6d62d0..f5a412974 100644
--- a/luci-app-passwall/luasrc/controller/passwall.lua
+++ b/luci-app-passwall/luasrc/controller/passwall.lua
@@ -289,6 +289,12 @@ function connect_status()
local gfw_list = uci:get(appname, "@global[0]", "use_gfw_list") or "1"
local proxy_mode = uci:get(appname, "@global[0]", "tcp_proxy_mode") or "proxy"
local socks_server = api.get_cache_var("GLOBAL_TCP_SOCKS_server")
+
+ -- 兼容 curl 8.6 time_starttransfer 错误
+ local curl_ver = luci.sys.exec("curl -V 2>/dev/null | head -n 1 | awk '{print $2}' | cut -d. -f1,2 | tr -d ' \n'") or "0"
+ url = (curl_ver == "8.6") and "-w %{http_code}:%{time_appconnect} https://" .. url
+ or "-w %{http_code}:%{time_starttransfer} http://" .. url
+
if socks_server and socks_server ~= "" then
if (chn_list == "proxy" and gfw_list == "0" and proxy_mode ~= "proxy" and baidu ~= nil) or (chn_list == "0" and gfw_list == "0" and proxy_mode == "proxy") then
-- 中国列表+百度 or 全局
@@ -298,7 +304,7 @@ function connect_status()
url = "-x socks5h://" .. socks_server .. " " .. url
end
end
- local result = luci.sys.exec('curl --connect-timeout 3 -o /dev/null -I -sk -w "%{http_code}:%{time_starttransfer}" ' .. url)
+ local result = luci.sys.exec('curl --connect-timeout 3 -o /dev/null -I -sk ' .. url)
local code = tonumber(luci.sys.exec("echo -n '" .. result .. "' | awk -F ':' '{print $1}'") or "0")
if code ~= 0 then
local use_time = luci.sys.exec("echo -n '" .. result .. "' | awk -F ':' '{print $2}'")
diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua
index c5ed6e209..b32f24099 100644
--- a/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua
+++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/acl_config.lua
@@ -290,6 +290,9 @@ o:depends({ _tcp_node_bool = "1" })
o:value("dnsmasq", "Dnsmasq")
o:value("chinadns-ng", translate("ChinaDNS-NG (recommended)"))
+o = s:option(DummyValue, "view_chinadns_log", " ")
+o.template = appname .. "/acl/view_chinadns_log"
+
o = s:option(Flag, "filter_proxy_ipv6", translate("Filter Proxy Host IPv6"), translate("Experimental feature."))
o.default = "0"
o:depends({ _tcp_node_bool = "1" })
@@ -418,6 +421,4 @@ o:value("direct", translate("Direct DNS"))
o.description = desc .. ""
o:depends({dns_shunt = "dnsmasq", tcp_proxy_mode = "proxy", chn_list = "direct"})
-m:append(Template(appname .. "/acl/footer"))
-
return m
diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/client/log.lua b/luci-app-passwall/luasrc/model/cbi/passwall/client/log.lua
index 6d2033936..0f96f015b 100644
--- a/luci-app-passwall/luasrc/model/cbi/passwall/client/log.lua
+++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/log.lua
@@ -16,9 +16,9 @@ s = fb:section(SimpleSection, translate("Backup and Restore"), translate("Backup
"
" ..
translate("Note: Restoring configurations across different versions may cause compatibility issues.") ..
"")
-o = s:option(DummyValue, '', nil)
-o.template = appname .. "/log/backup_restore"
+s.anonymous = true
+s:append(Template(appname .. "/log/backup_restore"))
local backup_files = {
"/etc/config/passwall",
diff --git a/luci-app-passwall/luasrc/passwall/api.lua b/luci-app-passwall/luasrc/passwall/api.lua
index 1dbeb84ad..3d9ac3882 100644
--- a/luci-app-passwall/luasrc/passwall/api.lua
+++ b/luci-app-passwall/luasrc/passwall/api.lua
@@ -4,7 +4,6 @@ bin = require "nixio".bin
fs = require "nixio.fs"
sys = require "luci.sys"
uci = require "luci.model.uci".cursor()
-libuci = require "uci".cursor()
util = require "luci.util"
datatypes = require "luci.cbi.datatypes"
jsonc = require "luci.jsonc"
@@ -35,33 +34,20 @@ function is_js_luci()
return sys.call('[ -f "/www/luci-static/resources/uci.js" ]') == 0
end
-function uci_set_list(cursor, config, section, option, value)
- if config and section and option then
- if not value or #value == 0 then
- return cursor:delete(config, section, option)
- end
- return cursor:set(
- config, section, option,
- ( type(value) == "table" and value or { value } )
- )
- end
- return false
-end
-
-function uci_section(cursor, config, type, name, values)
- local stat = true
- if name then
- stat = cursor:set(config, name, type)
- else
- name = cursor:add(config, type)
- stat = name and true
- end
-
- return stat and name
+function is_old_uci()
+ return sys.call("grep 'require \"uci\"' /usr/lib/lua/luci/model/uci.lua >/dev/null 2>&1") == 0
end
function uci_save(cursor, config, commit, apply)
- if is_js_luci() then
+ if is_old_uci() then
+ cursor:save(config)
+ if commit then
+ cursor:commit(config)
+ if apply then
+ sys.call("/etc/init.d/" .. config .. " reload > /dev/null 2>&1 &")
+ end
+ end
+ else
commit = true
if commit then
if apply then
@@ -70,14 +56,6 @@ function uci_save(cursor, config, commit, apply)
sh_uci_commit(config)
end
end
- else
- cursor:save(config)
- if commit then
- cursor:commit(config)
- if apply then
- sys.call("/etc/init.d/" .. config .. " reload > /dev/null 2>&1 &")
- end
- end
end
end
diff --git a/luci-app-passwall/luasrc/view/passwall/acl/footer.htm b/luci-app-passwall/luasrc/view/passwall/acl/view_chinadns_log.htm
similarity index 81%
rename from luci-app-passwall/luasrc/view/passwall/acl/footer.htm
rename to luci-app-passwall/luasrc/view/passwall/acl/view_chinadns_log.htm
index 6026e6dc9..7c9933a08 100644
--- a/luci-app-passwall/luasrc/view/passwall/acl/footer.htm
+++ b/luci-app-passwall/luasrc/view/passwall/acl/view_chinadns_log.htm
@@ -5,12 +5,6 @@ local api = require "luci.passwall.api"
//' + "?flag=" + sid + "', '_blank')");
+ logLink.setAttribute("onclick", "window.open('" + '<%=api.url("get_chinadns_log") .. "?flag=" .. section%>' + "', '_blank')");
select.insertAdjacentElement("afterend", logLink);
}
}, 1000);
diff --git a/luci-app-passwall/luasrc/view/passwall/global/status.htm b/luci-app-passwall/luasrc/view/passwall/global/status.htm
index a8729505e..133c2951b 100644
--- a/luci-app-passwall/luasrc/view/passwall/global/status.htm
+++ b/luci-app-passwall/luasrc/view/passwall/global/status.htm
@@ -166,7 +166,7 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
-