' +
+ '
' +
'
<%:Subscription%>
' +
'<%:Subscribing,Please do not refresh!%>
' +
'' +
@@ -24,7 +24,10 @@
//显示并开始刷新订阅
function update_subscribe() {
$("body").append(modal);
- $(".modals-bg").show();
+ $(".modals-bg").removeClass("hide");
+ setTimeout(function(){
+ $(".modals").removeClass("hide");
+ }, 200);
setTimeout("get_realtime_log();", 500);
}
//保存订阅按钮
diff --git a/package/ctcgfw/luci-app-vssr/po/zh-cn/vssr.po b/package/ctcgfw/luci-app-vssr/po/zh-cn/vssr.po
index ba0b7b14e2..d39453b898 100644
--- a/package/ctcgfw/luci-app-vssr/po/zh-cn/vssr.po
+++ b/package/ctcgfw/luci-app-vssr/po/zh-cn/vssr.po
@@ -173,7 +173,10 @@ msgid "Alias"
msgstr "别名"
msgid "V2ray SOCKS5 Proxy"
-msgstr "V2ray SOCKS5代理"
+msgstr "V2ray SOCKS5 代理"
+
+msgid "V2ray HTTP Proxy"
+msgstr "V2ray HTTP 代理"
msgid "Server"
msgstr "服务器"
@@ -539,6 +542,12 @@ msgstr "用户名"
msgid "Socks pass"
msgstr "密码"
+msgid "HTTP user"
+msgstr "用户名"
+
+msgid "HTTP pass"
+msgstr "密码"
+
msgid "Enable Servers"
msgstr "开启服务"
diff --git a/package/ctcgfw/luci-app-vssr/root/etc/config/vssr b/package/ctcgfw/luci-app-vssr/root/etc/config/vssr
index 088a72a5c5..8db9e5a9ca 100755
--- a/package/ctcgfw/luci-app-vssr/root/etc/config/vssr
+++ b/package/ctcgfw/luci-app-vssr/root/etc/config/vssr
@@ -21,6 +21,14 @@ config socks5_proxy
option Socks_user 'user'
option Socks_pass 'password'
+config http_proxy
+ option enable_server '0'
+ option local_port '1088'
+ option local_address '0.0.0.0'
+ option enable_auth '0'
+ option http_user 'user'
+ option http_pass 'password'
+
config access_control
option wan_bp_list '/etc/vssr/china_ssr.txt'
option lan_ac_mode 'b'
diff --git a/package/ctcgfw/luci-app-vssr/root/etc/init.d/vssr b/package/ctcgfw/luci-app-vssr/root/etc/init.d/vssr
index 028f6c1df1..b8175707e0 100755
--- a/package/ctcgfw/luci-app-vssr/root/etc/init.d/vssr
+++ b/package/ctcgfw/luci-app-vssr/root/etc/init.d/vssr
@@ -19,7 +19,12 @@ EXTRA_COMMANDS=rules
CONFIG_FILE=/var/etc/${NAME}_t.json
CONFIG_UDP_FILE=/var/etc/${NAME}_u.json
CONFIG_SOCK5_FILE=/var/etc/${NAME}_s.json
+CRON_FILE=/etc/crontabs/root
+#定义可执行文件路径
+VSSR_RULES_BIN=/usr/bin/vssr-rules
+
+#初始化配置
server_count=0
redir_tcp=0
redir_udp=0
@@ -32,9 +37,10 @@ switch_enable=0
shunt_enable=0
switch_server=$1
MAXFD=32768
-CRON_FILE=/etc/crontabs/root
threads=1
-scount=0
+
+
+#读取 uci 数据
uci_get_by_name() {
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
echo ${ret:=$3}
@@ -45,6 +51,24 @@ uci_get_by_type() {
echo ${ret:=$3}
}
+run_mode=$(uci_get_by_type global run_mode)
+is_xray=$(uci_get_by_type global use_xray)
+
+#查找可执行文件
+find_bin() {
+ case "$1" in
+ ss) ret="ss-redir" ;;
+ ss-local) ret="ss-local" ;;
+ ssr) ret="ssr-redir" ;;
+ ssr-local) ret="ssr-local" ;;
+ ssr-server) ret="ssr-server" ;;
+ v2ray | vless) [[ $is_xray = "1" ]] && ret="xray" || ret="v2ray" ;;
+ trojan) ret="trojan" ;;
+ esac
+ echo $(find /usr -perm /+x -type f -name $ret)
+}
+
+#添加定时执行脚本
add_cron() {
sed -i '/vssr.log/d' $CRON_FILE && echo '0 1 * * * echo "" > /tmp/vssr.log' >>$CRON_FILE
[ $(uci_get_by_type server_subscribe auto_update 0) -eq 1 ] && echo "0 $(uci_get_by_type server_subscribe auto_update_time) * * * /usr/bin/lua /usr/share/vssr/subscribe.lua" >>$CRON_FILE
@@ -52,13 +76,16 @@ add_cron() {
crontab $CRON_FILE
}
+#删除定时执行脚本
del_cron() {
sed -i '/vssr/d' $CRON_FILE
sed -i '/vssr.log/d' $CRON_FILE
/etc/init.d/cron restart
}
+
+#计算分流数量
count_shunt() {
- scount=0
+ snum=0
eval shunt_array1="youtube"
eval shunt_array2="tw_video"
eval shunt_array3="netflix"
@@ -71,17 +98,16 @@ count_shunt() {
local server_index=$(uci_get_by_type global ${a}_server)
local server_type=$(uci_get_by_name $server_index type)
if [ "$server_type" != "" ]; then
- scount=$(($scount + 1))
+ snum=$(($snum + 1))
fi
done
+ echo $snum
}
-count_shunt
-run_mode=$(uci_get_by_type global run_mode)
-is_xray=$(uci_get_by_type global use_xray)
+
+#创建配置文件
gen_config_file() {
local hostip=$(uci_get_by_name $1 server)
-
[ $2 = "0" -a $kcp_flag = "1" ] && hostip="127.0.0.1"
if [ $2 = "0" ]; then
@@ -93,17 +119,12 @@ gen_config_file() {
config_file=$CONFIG_UDP_FILE
server_obj=$UDP_RELAY_SERVER
fi
- if [ $(uci_get_by_name $1 fast_open 0) = "1" ]; then
- fastopen="true"
- else
- fastopen="false"
- fi
+ [[ $(uci_get_by_name $1 fast_open 0) = "1" ]] && fastopen="true" || fastopen="false"
local stype=$(uci_get_by_name $1 type)
local port=$(uci_get_by_name $1 local_port)
- if [ "$stype" == "vless" ]; then
- stype="v2ray"
- fi
+ [[ "$stype" == "vless" ]] && stype="v2ray"
+
if [ "$stype" == "trojan" ]; then
if [ "$re_type" == "udp" ]; then
re_type="client"
@@ -112,16 +133,19 @@ gen_config_file() {
re_type="nat"
fi
fi
+
local mport=0
if [ $3 = "1" ]; then
stype="v2ray"
mport=1090
re_type="tcp"
fi
+
lua /usr/share/vssr/genconfig_${stype}.lua ${server_obj} ${re_type} ${port} ${hostip} ${mport} >${config_file}
sed -i 's/\\//g' $config_file
}
+#获取arg输出
get_arg_out() {
case "$(uci_get_by_type access_control router_proxy 1)" in
1) echo "-o" ;;
@@ -129,6 +153,7 @@ get_arg_out() {
esac
}
+#启动规则
start_rules() {
local server=$(uci_get_by_name $GLOBAL_SERVER server)
#resolve name
@@ -184,15 +209,12 @@ start_rules() {
#deal gfw firewall rule
local gfwmode=""
- if [ "$run_mode" = "gfw" ]; then
- gfwmode="-g"
- elif [ "$run_mode" = "router" ]; then
- gfwmode="-r"
- elif [ "$run_mode" = "oversea" ]; then
- gfwmode="-c"
- elif [ "$run_mode" = "all" ]; then
- gfwmode="-z"
- fi
+ case "$run_mode" in
+ gfw) gfwmode="-g" ;;
+ router) gfwmode="-r" ;;
+ oversea) gfwmode="-c" ;;
+ all) gfwmode="-z" ;;
+ esac
local dports=$(uci_get_by_type global dports 1)
if [ $dports = "1" ]; then
@@ -201,7 +223,7 @@ start_rules() {
proxyport="-m multiport --dports 22,53,587,465,995,993,143,80,443 "
fi
- /usr/bin/vssr-rules \
+ $VSSR_RULES_BIN \
-s "$server" \
-l "$local_port" \
-S "$udp_server" \
@@ -217,6 +239,7 @@ start_rules() {
return $?
}
+#启动PDNSD
start_pdnsd() {
local usr_dns="$1"
local usr_port="$2"
@@ -264,24 +287,8 @@ start_pdnsd() {
/usr/sbin/pdnsd -c /var/etc/pdnsd.conf -d
}
-find_bin() {
- case "$1" in
- ss) ret="/usr/bin/ss-redir" ;;
- ss-local) ret="/usr/bin/ss-local" ;;
- ssr) ret="/usr/bin/ssr-redir" ;;
- ssr-local) ret="/usr/bin/ssr-local" ;;
- ssr-server) ret="/usr/bin/ssr-server" ;;
- v2ray | vless)
- ret="/usr/bin/v2ray/v2ray" && [ ! -f "$ret" ] && ret="/usr/bin/v2ray"
- if [ $is_xray = "1" ]; then
- ret="/usr/bin/xray" && [ ! -f "$ret" ] && ret="/usr/bin/xray/xray"
- fi
- ;;
- trojan) ret="/usr/sbin/trojan" ;;
- esac
- echo $ret
-}
-#分流节点
+
+#开启分流
start_shunt() {
eval shunt_type1="global"
eval shunt_type2="youtube"
@@ -359,8 +366,7 @@ start_redir() {
local stype=$(uci_get_by_name $GLOBAL_SERVER type)
sscmd=$(find_bin $stype)
- local utype=$(uci_get_by_name $UDP_RELAY_SERVER type)
- ucmd=$(find_bin $utype)
+
if [ "$(uci_get_by_type global threads 0)" = "0" ]; then
threads=$(cat /proc/cpuinfo | grep 'processor' | wc -l)
@@ -369,6 +375,7 @@ start_redir() {
fi
#转发TCP
redir_tcp=1
+ scount=$(count_shunt)
if [ $scount == "0" ]; then
local last_config_file=$CONFIG_FILE
case "$stype" in
@@ -407,6 +414,8 @@ start_redir() {
#转发UDP
if [ -n "$UDP_RELAY_SERVER" ]; then
redir_udp=1
+ local utype=$(uci_get_by_name $UDP_RELAY_SERVER type)
+ ucmd=$(find_bin $utype)
gen_config_file $UDP_RELAY_SERVER 1 0
last_config_file=$CONFIG_UDP_FILE
case "$stype" in
@@ -466,11 +475,7 @@ start_redir() {
}
gen_service_file() {
- if [ $(uci_get_by_name $1 fast_open) = "1" ]; then
- fastopen="true"
- else
- fastopen="false"
- fi
+ [[ $(uci_get_by_name $1 fast_open) = "1" ]] && fastopen="true" || fastopen="false"
cat <<-EOF >$2
{
"server": "0.0.0.0",
@@ -503,6 +508,7 @@ start_service() {
iptables -t filter -A SSR-SERVER-RULE -p udp --dport $(uci_get_by_name $1 server_port) -j ACCEPT
return 0
}
+
gen_serv_include() {
FWI=$(uci get firewall.vssr.path 2>/dev/null)
[ -n "$FWI" ] || return 0
@@ -534,15 +540,17 @@ start_server() {
}
start_local() {
- local local_server=$(uci_get_by_type socks5_proxy enable_server)
+ local socks_server=$(uci_get_by_type socks5_proxy enable_server)
+ local http_server=$(uci_get_by_type http_proxy enable_server)
- [ "$local_server" = "0" ] && return 1
+ if [ "$socks_server" = "0" -a "$http_server" = "0" ]; then
+ return 1
+ fi
mkdir -p /var/run /var/etc
lua /usr/share/vssr/genconfig_v2ray_s.lua >$CONFIG_SOCK5_FILE
sed -i 's/\\//g' $config_file
socksbin=$(find_bin "v2ray")
- echo $socksbin
$socksbin -config $CONFIG_SOCK5_FILE >/dev/null 2>&1 &
local_enable=1
}
@@ -638,7 +646,7 @@ stop() {
killall -q -9 ss-redir ss-local obfs-local ssr-redir ssr-local ssr-server v2ray v2ray-plugin xray trojan microsocks ipt2socks dns2socks pdnsd
if [ -f "/tmp/dnsmasq.d/dnsmasq-ssr.conf" ]; then
- rm -f /tmp/dnsmasq.d/dnsmasq-ssr.conf /tmp/dnsmasq.ssr /tmp/dnsmasq.oversea
+ rm -rf /tmp/dnsmasq.d/dnsmasq-ssr.conf /tmp/dnsmasq.ssr /tmp/dnsmasq.oversea
/etc/init.d/dnsmasq restart >/dev/null 2>&1
fi
del_cron
diff --git a/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/genconfig_v2ray_s.lua b/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/genconfig_v2ray_s.lua
index 17d7e7c8b9..beed53de26 100755
--- a/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/genconfig_v2ray_s.lua
+++ b/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/genconfig_v2ray_s.lua
@@ -2,25 +2,47 @@ local ucursor = require 'luci.model.uci'.cursor()
local name = 'vssr'
local json = require 'luci.jsonc'
local proto = 'socks'
+local socks_switch = ucursor:get_first(name, 'socks5_proxy', 'enable_server')
local auth_type = ucursor:get_first(name, 'socks5_proxy', 'enable_auth')
local local_port = ucursor:get_first(name, 'socks5_proxy', 'local_port')
local Socks_user = ucursor:get_first(name, 'socks5_proxy', 'Socks_user')
local Socks_pass = ucursor:get_first(name, 'socks5_proxy', 'Socks_pass')
+local http_switch = ucursor:get_first(name, 'socks5_proxy', 'enable_server')
+local auth_typeh = ucursor:get_first(name, 'http_proxy', 'enable_auth')
+local local_porth = ucursor:get_first(name, 'http_proxy', 'local_port')
+local http_user = ucursor:get_first(name, 'http_proxy', 'http_user')
+local http_pass = ucursor:get_first(name, 'http_proxy', 'http_pass')
+
+function gen_inbound(sw, auth_type, local_port, user, pass, proto)
+ local bound = {}
+ if sw == 0 then
+ bound = nil
+ else
+ bound = {
+ port = local_port,
+ protocol = proto,
+ settings = {
+ auth = (auth_type == '1') and 'password' or 'noauth',
+ accounts = (auth_type == '1') and {{user = (auth_type == '1') and user, pass = pass}} or nil
+ }
+ }
+ end
+ return bound
+end
+
+inbounds_table = {}
+
+table.insert(inbounds_table, gen_inbound(socks_switch, auth_type, local_port, Socks_user, Socks_pass, 'socks'))
+table.insert(inbounds_table, gen_inbound(http_switch, auth_typeh, local_porth, http_user, http_pass, 'http'))
+
local v2ray = {
log = {
-- error = "/var/log/v2ray.log",
loglevel = 'warning'
},
-- 传入连接
- inbound = {
- port = local_port,
- protocol = proto,
- settings = {
- auth = (auth_type == '1') and 'password' or 'noauth',
- accounts = (auth_type == '1') and {{user = (auth_type == '1') and Socks_user, pass = Socks_pass}} or nil
- }
- },
+ inbounds = inbounds_table,
-- 传出连接
outbound = {protocol = 'freedom'},
-- 额外传出连接
diff --git a/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/subscribe.lua b/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/subscribe.lua
index 357f3ec6b7..6397a5b543 100644
--- a/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/subscribe.lua
+++ b/package/ctcgfw/luci-app-vssr/root/usr/share/vssr/subscribe.lua
@@ -390,7 +390,7 @@ local execute = function()
end
-- diff
do
- assert(next(nodeResult), 'node result is empty')
+ assert(next(nodeResult), '获取不到节点信息,请检查路由器是否能够访问网络,或者订阅链接是否正确')
local add, del = 0, 0
ucic:foreach(
name,
@@ -453,7 +453,7 @@ if subscribe_url and #subscribe_url > 0 then
execute,
function(e)
log(e)
- log(debug.traceback())
+ -- log(debug.traceback())
log('发生错误, 正在恢复服务')
log('END SUBSCRIBE')
local firstServer = ucic:get_first(name, uciType)
diff --git a/package/ctcgfw/luci-app-vssr/root/www/luci-static/vssr/css/vssr.css b/package/ctcgfw/luci-app-vssr/root/www/luci-static/vssr/css/vssr.css
index a523425925..394ed97a77 100644
--- a/package/ctcgfw/luci-app-vssr/root/www/luci-static/vssr/css/vssr.css
+++ b/package/ctcgfw/luci-app-vssr/root/www/luci-static/vssr/css/vssr.css
@@ -622,7 +622,12 @@ footer.mobile-hide {
left: 0;
top: 0;
background: rgba(255, 255, 255, 0.8);
- display: none;
+ transition: all 0.2s;
+}
+
+.modals-bg.hide{
+ visibility: hidden;
+ opacity: 0;
}
.modals {
@@ -642,6 +647,14 @@ footer.mobile-hide {
/* Firefox */
-webkit-box-sizing: border-box;
/* Safari */
+ transition: all 0.3s ease-in-out;
+ transform: scale(1);
+}
+
+.modals.hide{
+ visibility: hidden;
+ opacity: 0;
+ transform: scale(0.5);
}
.modals h2 {
diff --git a/package/ctcgfw/spdlog/Makefile b/package/ctcgfw/spdlog/Makefile
deleted file mode 100644
index f2bff16610..0000000000
--- a/package/ctcgfw/spdlog/Makefile
+++ /dev/null
@@ -1,65 +0,0 @@
-####
- # File: /spdlog/Makefile
- # Project: ootoc-OpenWRT
- # File Created: Thursday, 12th March 2020 11:09:54 pm
- # Author: ElonH[EH](elonhhuang@gmail.com)
- # License: GNU General Public License v3.0 or later(http://www.gnu.org/licenses/gpl-3.0-standalone.html)
- # Copyright (C) 2020 [ElonH]
-####
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=spdlog
-PKG_VERSION:=1.7.0
-PKG_RELEASE:=1
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/gabime/spdlog.git
-PKG_MIRROR_HASH:=777dff5e8755d942159406c82d6e568f4fd5beda6c37a47eaf839222fdcd0e04
-PKG_SOURCE_VERSION:=616caa5d30172b65cc3a06800894c575d70cb8e6
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-
-PKG_LICENSE:=GPLv3
-PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=ElonH
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-
-PKG_INSTALL:=1
-PKG_USE_MIPS16:=0
-PKG_BUILD_PARALLEL:=1
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/cmake.mk
-
-CMAKE_OPTIONS+= -DSPDLOG_BUILD_EXAMPLE:BOOL=OFF \
- -DSPDLOG_BUILD_TESTS:BOOL=OFF -DSPDLOG_BUILD_SHARED:BOOL=ON \
- -DSPDLOG_FMT_EXTERNAL:BOOL=ON -DSPDLOG_FMT_EXTERNAL_HO:BOOL=OFF
-
-define Package/spdlog
- SECTION:=lib
- CATEGORY:=Libraries
- URL:=https://github.com/gabime/spdlog
- TITLE:=Fast C++ logging library.
- DEPENDS:=+libfmt
- MENU:=1
-endef
-
-define Package/spdlog/description
- Very fast, header-only/compiled, C++ logging library.
-endef
-
-
-define Build/InstallDev
- $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/include/spdlog/fmt/bundled
- $(CP) $(PKG_BUILD_DIR)/include/spdlog/fmt/bundled $(PKG_INSTALL_DIR)/usr/include/spdlog/fmt
- $(Build/InstallDev/cmake)
-endef
-
-define Package/spdlog/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libspdlog.so* $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,spdlog))
diff --git a/package/ctcgfw/tinyfecvpn/Makefile b/package/ctcgfw/tinyfecvpn/Makefile
new file mode 100644
index 0000000000..33457a8b6a
--- /dev/null
+++ b/package/ctcgfw/tinyfecvpn/Makefile
@@ -0,0 +1,58 @@
+#
+# Copyright (c) 2017 Yu Wang
+#
+# This is free software, licensed under the MIT.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=tinyfecVPN
+PKG_VERSION:=20180820.0
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/wangyu-/tinyfecVPN.git
+PKG_SOURCE_VERSION:=e8364ba8ff94415ee3bedcbdb9557bfe5994a469
+PKG_MIRROR_HASH:=30fd808b0203c70e8e6cfe8ca55b907faaea6a8be12a7a7fef6658f4ddbb523c
+
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+
+PKG_LICENSE:=MIT
+PKG_MAINTAINER:=Yu Wang
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tinyfecVPN
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=VPN
+ TITLE:=A Network Improving Tool
+ URL:=https://github.com/wangyu-/tinyfecVPN
+ DEPENDS:=+libpthread +libstdcpp +kmod-tun
+endef
+
+define Package/tinyfecVPN/description
+ A Lightweight VPN with Build-in Forward Error Correction Support (or A Network Improving Tool
+ which works at VPN mode). Improves your Network Quality on a High-latency Lossy Link.
+endef
+
+MAKE_FLAGS += cross
+
+define Build/Prepare
+ $(PKG_UNPACK)
+ sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile
+ sed -i '/\*gitversion/d' $(PKG_BUILD_DIR)/makefile
+ echo 'const char *gitversion = "$(PKG_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h
+endef
+
+define Package/tinyfecVPN/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/tinyvpn_cross $(1)/usr/bin/tinyvpn
+endef
+
+$(eval $(call BuildPackage,tinyfecVPN))
diff --git a/package/ctcgfw/tinyportmapper/Makefile b/package/ctcgfw/tinyportmapper/Makefile
new file mode 100644
index 0000000000..b703e6693f
--- /dev/null
+++ b/package/ctcgfw/tinyportmapper/Makefile
@@ -0,0 +1,57 @@
+#
+# Copyright (c) 2017 Yu Wang
+#
+# This is free software, licensed under the MIT.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=tinyPortMapper
+PKG_VERSION:=20200818.0
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/wangyu-/tinyPortMapper.git
+PKG_SOURCE_VERSION:=b6c5c05ba9a9db00571d185edcd534434f41b50a
+PKG_MIRROR_HASH:=93946ec018ef515d0f443fd9a6e6510ce3ceb1be373a2393fe2daeeb5e7ced95
+
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+
+PKG_LICENSE:=MIT
+PKG_MAINTAINER:=Yu Wang
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tinyPortMapper
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=A High-Performance Port Mapping/Forwarding Utility
+ URL:=https://github.com/wangyu-/tinyPortMapper
+ DEPENDS:=+libstdcpp +librt
+endef
+
+define Package/tinyPortMapper/description
+ A Lightweight High-Performance Port Mapping/Forwarding Utility
+ using epoll/libev, supports IPv4 and IPv6 for both TCP and UDP.
+endef
+
+MAKE_FLAGS += cross
+
+define Build/Prepare
+ $(PKG_UNPACK)
+ sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile
+ sed -i '/\*gitversion/d' $(PKG_BUILD_DIR)/makefile
+ echo 'const char *gitversion = "$(PKG_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h
+endef
+
+define Package/tinyPortMapper/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/tinymapper_cross $(1)/usr/bin/tinymapper
+endef
+
+$(eval $(call BuildPackage,tinyPortMapper))
diff --git a/package/lean/uugamebooster/Makefile b/package/lean/uugamebooster/Makefile
new file mode 100644
index 0000000000..c73446554e
--- /dev/null
+++ b/package/lean/uugamebooster/Makefile
@@ -0,0 +1,86 @@
+#
+# Copyright (C) 2021 KFERMercer
+#
+# This is free software, licensed under the GNU General Public License v3.
+#
+
+#
+# to get the latest version & md5 checksum:
+# curl -L -s -k -H "Accept:text/plain" "http://router.uu.163.com/api/plugin?type=openwrt-$(UU_ARCH)"
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=uugamebooster
+PKG_VERSION:=v2.7.2
+PKG_RELEASE:=2
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/$(PKG_NAME)
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=@(aarch64||arm||mips||mipsel||x86_64) +kmod-tun
+ TITLE:=NetEase UU Game Booster
+ URL:=https://uu.163.com
+endef
+
+define Package/$(PKG_NAME)/description
+NetEase's UU Game Booster Accelerates Triple-A Gameplay and Market
+endef
+
+ifeq ($(ARCH),x86_64)
+ UU_ARCH:=x86_64
+ PKG_MD5SUM:=07bf06131528276e7d4b8e3992fa2e8d
+endif
+
+ifeq ($(ARCH),mipsel)
+ UU_ARCH:=mipsel
+ PKG_MD5SUM:=3f11af92eb7abf2af2cce8102fea7499
+endif
+
+ifeq ($(ARCH),mips)
+ UU_ARCH:=mipsel
+ PKG_MD5SUM:=3f11af92eb7abf2af2cce8102fea7499
+endif
+
+ifeq ($(ARCH),arm)
+ UU_ARCH:=arm
+ PKG_MD5SUM:=5fce2b60df66ea8a8db4ddd55da3c6b4
+endif
+
+ifeq ($(ARCH),aarch64)
+ UU_ARCH:=aarch64
+ PKG_MD5SUM:=bc0e513cfce113c69b068e198e936100
+endif
+
+PKG_SOURCE_URL:=http://uu.gdl.netease.com/openwrt-$(UU_ARCH)/$(PKG_VERSION)/uu.tar.gz?
+PKG_SOURCE:=$(PKG_NAME)-$(UU_ARCH)-$(PKG_VERSION).tar.gz
+
+STRIP:=true
+
+UNTAR_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)-$(UU_ARCH)-bin
+
+define Build/Prepare
+ mkdir -vp $(UNTAR_DIR)
+ tar -zxvf $(DL_DIR)/$(PKG_SOURCE) -C $(UNTAR_DIR)
+endef
+
+define Build/Compile
+endef
+
+define Package/$(PKG_NAME)/install
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/uugamebooster.init $(1)/etc/init.d/uugamebooster
+
+ $(INSTALL_DIR) $(1)/usr/share/$(PKG_NAME)
+ $(INSTALL_BIN) $(UNTAR_DIR)/uuplugin $(1)/usr/share/$(PKG_NAME)/uuplugin
+ $(INSTALL_CONF) $(UNTAR_DIR)/uu.conf $(1)/usr/share/$(PKG_NAME)/uu.conf
+
+ # not finish yet:
+ # $(INSTALL_DIR) $(1)/usr/bin
+ # $(INSTALL_BIN) ./files/uugamebooster-update $(1)/usr/bin/$(PKG_NAME)
+ # $(LN) $(1)/usr/bin/$(PKG_NAME)/uugamebooster-update $(1)/usr/bin/uugamebooster-update
+endef
+
+$(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/package/lean/uugamebooster/files/uugamebooster-update b/package/lean/uugamebooster/files/uugamebooster-update
new file mode 100755
index 0000000000..8e07805888
--- /dev/null
+++ b/package/lean/uugamebooster/files/uugamebooster-update
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# Return: 0 means update flag is set.
+check_update() {
+ if [ -f "/usr/bin/uugamebooster/uu.update" ];then
+ return 0
+ else
+ return 1
+ fi
+}
+
+check_update
+if [ "$?" != "0" ];then
+ exit 0
+ return
+fi
+
+exit 0
diff --git a/package/lean/uugamebooster/files/uugamebooster.init b/package/lean/uugamebooster/files/uugamebooster.init
new file mode 100755
index 0000000000..7fa2ea8acc
--- /dev/null
+++ b/package/lean/uugamebooster/files/uugamebooster.init
@@ -0,0 +1,18 @@
+#!/bin/sh /etc/rc.common
+
+START=99
+STOP=10
+
+USE_PROCD=1
+
+NAME="uugamebooster"
+UU_BIN="/usr/share/uugamebooster/uuplugin"
+UU_CONF="/usr/share/uugamebooster/uu.conf"
+UU_LOGFILE="/tmp/uugamebooster.log"
+
+start_service() {
+ procd_open_instance
+ procd_set_param command $UU_BIN $UU_CONF >$UU_LOGFILE 2>&1
+ procd_set_param respawn
+ procd_close_instance
+}
diff --git a/package/lean/xray/Makefile b/package/lean/xray/Makefile
index 1a0959a3c6..89b5a7129b 100644
--- a/package/lean/xray/Makefile
+++ b/package/lean/xray/Makefile
@@ -9,13 +9,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=xray
-PKG_VERSION:=1.2.1
+PKG_VERSION:=1.2.2
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/Xray-core-$(PKG_VERSION)
PKG_SOURCE:=xray-core-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/XTLS/xray-core/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=eebea67d9176cc016d21de2d8123b0a6ab795ec82af2c6b8d7467212841bdc56
+PKG_HASH:=b9b38bc69e660d3a6d0545efea4d0891ee81a2d55c83a6fa893cbd680a071023
PKG_LICENSE:=MPL
PKG_LICENSE_FILES:=LICENSE
diff --git a/package/lienol/luci-app-passwall/Makefile b/package/lienol/luci-app-passwall/Makefile
index 81094c77f3..f4e631b6d2 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", "")
-%>