Merge pull request #1174 from sofia-riese/redesign-2

feat(1_start.sh): redesign static text menu
This commit is contained in:
juewuy
2026-01-23 18:12:21 +08:00
committed by GitHub
2 changed files with 23 additions and 14 deletions

View File

@@ -1,6 +1,6 @@
# ===== 启动完成 =====
START_SERVICE_OK="服务已启动!"
START_WEB_HINT="请使用"
START_WEB_HINT="请前往"
START_WEB_HINT2="管理内置规则"
START_PAC_HINT="其他设备可使用 PAC 配置:"
START_PROXY_HINT="或使用 HTTP / SOCKS5 方式连接:"

View File

@@ -7,15 +7,18 @@ load_lang 1_start
# ===== 启动完成提示 =====
startover() {
echo -ne " \r"
echo -e "\033[32m$START_SERVICE_OK\033[0m"
echo -e "$START_WEB_HINT \033[4;36mhttp://$host$hostdir\033[0m $START_WEB_HINT2"
line_break
separator_line "="
content_line "\033[32m$START_SERVICE_OK\033[0m"
content_line "$START_WEB_HINT \033[4;36mhttp://$host$hostdir\033[0m $START_WEB_HINT2"
if [ "$firewall_area" = 4 ]; then
echo "-----------------------------------------------"
echo -e "$START_PAC_HINT \033[4;32mhttp://$host:$db_port/ui/pac\033[0m"
echo -e "$START_PROXY_HINT IP{\033[36m$host\033[0m} Port{\033[36m$mix_port\033[0m}"
content_line ""
content_line "$START_PAC_HINT \033[4;32mhttp://$host:$db_port/ui/pac\033[0m"
content_line "$START_PROXY_HINT IP{\033[36m$host\033[0m} Port{\033[36m$mix_port\033[0m}"
fi
separator_line "="
line_break
return 0
}
@@ -27,16 +30,16 @@ start_core() {
core_config="$CRASHDIR/yamls/config.yaml"
fi
echo "-----------------------------------------------"
if [ ! -s "$core_config" ] && [ -s "$CRASHDIR/configs/providers.cfg" ]; then
echo -e "\033[33m$START_NO_CORE_CFG_TRY_GEN\033[0m"
[ "$crashcore" = singboxr ] && coretype=singbox
[ "$crashcore" = meta -o "$crashcore" = clashpre ] && coretype=clash
. "$CRASHDIR/menus/6_core_config.sh" && gen_"${coretype}"_providers
line_break
separator_line "="
content_line "\033[33m$START_NO_CORE_CFG_TRY_GEN\033[0m"
separator_line "="
elif [ -s "$core_config" ] || [ -n "$Url" ] || [ -n "$Https" ]; then
"$CRASHDIR/start.sh" start
@@ -50,9 +53,11 @@ start_core() {
fi
startover
}
else
echo -e "\033[31m$START_NO_CORE_CFG_IMPORT_FIRST\033[0m"
line_break
separator_line "="
content_line "\033[31m$START_NO_CORE_CFG_IMPORT_FIRST\033[0m"
separator_line "="
. "$CRASHDIR/menus/6_core_config.sh" && set_core_config
fi
}
@@ -61,7 +66,11 @@ start_core() {
start_service() {
if [ "$firewall_area" = 5 ]; then
"$CRASHDIR/start.sh" start
echo -e "\033[32m$START_FIREWALL_DONE\033[0m"
line_break
separator_line "="
content_line "\033[32m$START_FIREWALL_DONE\033[0m"
separator_line "="
line_break
else
start_core
fi