From aad43f15b308d4d9474c668cc26e83a604f5783b Mon Sep 17 00:00:00 2001 From: sofia-riese <253282481+sofia-riese@users.noreply.github.com> Date: Thu, 5 Feb 2026 13:59:05 +0800 Subject: [PATCH] chore: UI/UX adjustments --- scripts/lang/chs/userguide.lang | 4 +- scripts/menus/2_settings.sh | 27 ++++++-------- scripts/menus/4_setboot.sh | 5 ++- scripts/menus/8_tools.sh | 12 +++--- scripts/menus/9_upgrade.sh | 65 ++++++++++++++------------------- scripts/menus/userguide.sh | 9 +++-- 6 files changed, 57 insertions(+), 65 deletions(-) diff --git a/scripts/lang/chs/userguide.lang b/scripts/lang/chs/userguide.lang index 6a0acf85..4e98c3e9 100644 --- a/scripts/lang/chs/userguide.lang +++ b/scripts/lang/chs/userguide.lang @@ -8,7 +8,7 @@ UG_OPTION_3="还原之前备份的设置" UG_RESTORE_OK="脚本设置已还原!请重新启动脚本!" UG_IP_FORWARD_WARN="检测到你的设备尚未开启ip转发,局域网设备将无法正常连接网络,是否立即开启?" UG_ENABLE_LOW_MEM="检测到你的安装目录空间不足10M,是否开启小闪存模式?" -UG_IMPORT_CONFIG="是否导入配置文件?(这是运行前的最后一步)" +UG_IMPORT_CONFIG="这是运行前的最后一步" UG_CONFIG_TIP="你必须拥有一份配置文件才能运行服务!" -UG_CONFIG_RES="现在开始导入?" +UG_CONFIG_RES="是否立即导入配置文件?" UG_FINAL_TIP="很好!现在只需要执行启动就可以愉快的使用了!" diff --git a/scripts/menus/2_settings.sh b/scripts/menus/2_settings.sh index f9da88b4..672234f3 100644 --- a/scripts/menus/2_settings.sh +++ b/scripts/menus/2_settings.sh @@ -26,9 +26,9 @@ settings() { content_line "5) $SET_MENU_SNIFFER\t\033[36m$sniffer\033[0m" content_line "6) $SET_MENU_ADV_PORT" } - content_line "8) $SET_MENU_IPV6\t\033[36m$ipv6_redir\033[0m" - separator_line "-" - btm_box "a) \033[31m$SET_MENU_RESET\033[0m" \ + content_line "7) $SET_MENU_IPV6\t\033[36m$ipv6_redir\033[0m" + btm_box "" \ + "a) \033[31m$SET_MENU_RESET\033[0m" \ "b) \033[36m$SET_MENU_LANG\033[0m" \ "c) \033[33m$SET_MENU_UI\033[0m" \ "" \ @@ -140,7 +140,7 @@ settings() { set_adv_config fi ;; - 8) + 7) set_ipv6 ;; a) @@ -255,7 +255,7 @@ settings() { set_redir_config() { setconfig redir_mod "$redir_mod" setconfig dns_mod "$dns_mod" - msg_alert "\033[36m$SET_REDIR_APPLIED $redir_mod\033[0m" + msg_alert "\033[36m$SET_REDIR_APPLIED $redir_mod 模式\033[0m" } # 路由模式设置 @@ -269,10 +269,10 @@ set_redir_mod() { comp_box "\033[33m$SET_REDIR_RESTART_HINT\033[0m" \ "$SET_REDIR_CURRENT\033[47;30m$redir_mod$MENU_MOD\033[0m; $SET_CORE_CURRENT\033[47;30m$crashcore\033[0m" [ "$firewall_area" -le 3 ] && { - content_line "1) \033[32m$SET_REDIR_REDIR\033[0m:\t$SET_REDIR_REDIRDES" - content_line "2) \033[36m$SET_REDIR_MIX\033[0m:\t$SET_REDIR_MIXDES" - content_line "3) \033[32m$SET_REDIR_TPROXY\033[0m:$SET_REDIR_TPROXYDES" - content_line "4) \033[33m$SET_REDIR_TUN\033[0m:\t$SET_REDIR_TUNDES" + content_line "1) 设为\033[32m$SET_REDIR_REDIR\033[0m:\t$SET_REDIR_REDIRDES" + content_line "2) 设为\033[36m$SET_REDIR_MIX\033[0m:\t$SET_REDIR_MIXDES" + content_line "3) 设为\033[32m$SET_REDIR_TPROXY\033[0m:$SET_REDIR_TPROXYDES" + content_line "4) 设为\033[33m$SET_REDIR_TUN\033[0m:\t$SET_REDIR_TUNDES" content_line "" } [ "$firewall_area" = 5 ] && { @@ -644,13 +644,10 @@ set_ipv6() { [ -z "$ipv6_redir" ] && ipv6_redir=OFF [ -z "$ipv6_dns" ] && ipv6_dns=ON - line_break - separator_line "=" - content_line "1) $IPV6_REDIR:\t\033[36m$ipv6_redir\033[0m" + top_box "1) $IPV6_REDIR:\t\033[36m$ipv6_redir\033[0m" [ "$disoverride" != "1" ] && content_line "2) $IPV6_DNS:\t\033[36m$ipv6_dns\033[0m" - content_line "" - content_line "0) $COMMON_BACK" - separator_line "=" + btm_box "" \ + "0) $COMMON_BACK" read -r -p "$COMMON_INPUT> " num case "$num" in "" | 0) diff --git a/scripts/menus/4_setboot.sh b/scripts/menus/4_setboot.sh index 9726dfd2..5c4527e7 100644 --- a/scripts/menus/4_setboot.sh +++ b/scripts/menus/4_setboot.sh @@ -238,12 +238,13 @@ setboot() { echo "===========================================================" grep -v '任务' "$TMPDIR"/ShellCrash.log echo "===========================================================" - exit + line_break + exit else msg_alert "\033[31m未找到相关日志!\033[0m" fi ;; - *) + *) errornum ;; esac diff --git a/scripts/menus/8_tools.sh b/scripts/menus/8_tools.sh index c887ab8a..7174d951 100644 --- a/scripts/menus/8_tools.sh +++ b/scripts/menus/8_tools.sh @@ -501,7 +501,7 @@ log_pusher() { echo "===========================================================" cat "$TMPDIR"/ShellCrash.log echo "===========================================================" - exit + exit else msg_alert "\033[31m未找到相关日志!\033[0m" fi @@ -652,11 +652,11 @@ debug() { "如长时间运行后台监测,日志等级推荐error!防止文件过大!" \ "你亦可通过:\033[33mcrash -s debug 'warning'\033[0m命令使用其他日志等级" content_line "1) 仅测试\033[32m$config_tmp\033[0m配置文件可用性" - content_line "2) 前台运行\033[32m$config_tmp\033[0m配置文件,不配置防火墙劫持(\033[33m使用Ctrl+C手动停止\033[0m)" - content_line "3) 后台运行完整启动流程,并配置防火墙劫持,日志等级:\033[31merror\033[0m" - content_line "4) 后台运行完整启动流程,并配置防火墙劫持,日志等级:\033[32minfo\033[0m" - content_line "5) 后台运行完整启动流程,并配置防火墙劫持,日志等级:\033[33mdebug\033[0m" - content_line "6) 后台运行完整启动流程,并配置防火墙劫持,且将错误日志打印到闪存:\033[32m$CRASHDIR/debug.log\033[0m" + content_line "2) 前台运行\033[32m$config_tmp\033[0m配置文件,不配置防火墙劫持(\033[33m使用Ctrl+C手动停止\033[0m)" + content_line "3) 后台运行完整启动流程并配置防火墙劫持,日志等级:\033[31merror\033[0m" + content_line "4) 后台运行完整启动流程并配置防火墙劫持,日志等级:\033[32minfo\033[0m" + content_line "5) 后台运行完整启动流程并配置防火墙劫持,日志等级:\033[33mdebug\033[0m" + content_line "6) 后台运行完整启动流程并配置防火墙劫持,且将错误日志打印到闪存:\033[32m$CRASHDIR/debug.log\033[0m" content_line "" content_line "8) 后台运行完整启动流程,输出执行错误并查找上下文,之后关闭进程" [ -s "$TMPDIR"/jsons/inbounds.json ] && content_line "9) 将\033[32m$config_tmp\033[0m下json文件合并为$TMPDIR/debug.json" diff --git a/scripts/menus/9_upgrade.sh b/scripts/menus/9_upgrade.sh index cb3ddb4c..b5c324e7 100644 --- a/scripts/menus/9_upgrade.sh +++ b/scripts/menus/9_upgrade.sh @@ -72,39 +72,30 @@ upgrade() { ;; 9) comp_box "感谢以下项目及其开发者们的无私奉献!" - - content_line "\033[32mClash \033[0m开发:\033[36mDreamacro\033[0m" - content_line "" - - content_line "\033[32msing-box \033[0m开发:\033[36mSagerNet\033[0m" - content_line "项目地址:\033[32mhttps://github.com/SagerNet/sing-box\033[0m" - content_line "" - - content_line "\033[32mMetaCubeX \033[0m开发:\033[36mMetaCubeX\033[0m" - content_line "项目地址:\033[32mhttps://github.com/MetaCubeX\033[0m" - content_line "" - - content_line "\033[32mYACD面板 \033[0m开发:\033[36mhaishanh\033[0m" - content_line "项目地址:\033[32mhttps://github.com/haishanh/yacd\033[0m" - content_line "" - - content_line "\033[32mZashboard \033[0m开发:\033[36mZephyruso\033[0m" - content_line "项目地址:\033[32mhttps://github.com/Zephyruso/zashboard\033[0m" - content_line "" - - content_line "\033[32mSubconverter \033[0m开发:\033[36mtindy2013\033[0m" - content_line "项目地址:\033[32mhttps://github.com/tindy2013/subconverter\033[0m" - content_line "" - - content_line "\033[32msing-box-reF1nd \033[0m开发:\033[36mreF1nd\033[0m" - content_line "项目地址:\033[32mhttps://github.com/reF1nd/sing-box\033[0m" - content_line "" - - content_line "\033[32mDustinWin \033[0m开发:\033[36mDustinWin\033[0m" - content_line "开发者地址:\033[32mhttps://github.com/DustinWin\033[0m" - content_line "" - - comp_box "特别感谢:\033[36m所有帮助及赞助过此项目的同仁们!\033[0m" + btm_box "\033[32mClash \033[0m开发:\033[36mDreamacro\033[0m" \ + "" \ + "\033[32msing-box \033[0m开发:\033[36mSagerNet\033[0m" \ + "项目地址:\033[32mhttps://github.com/SagerNet/sing-box\033[0m" \ + "" \ + "\033[32mMetaCubeX \033[0m开发:\033[36mMetaCubeX\033[0m" \ + "项目地址:\033[32mhttps://github.com/MetaCubeX\033[0m" \ + "" \ + "\033[32mYACD面板 \033[0m开发:\033[36mhaishanh\033[0m" \ + "项目地址:\033[32mhttps://github.com/haishanh/yacd\033[0m" \ + "" \ + "\033[32mZashboard \033[0m开发:\033[36mZephyruso\033[0m" \ + "项目地址:\033[32mhttps://github.com/Zephyruso/zashboard\033[0m" \ + "" \ + "\033[32mSubconverter \033[0m开发:\033[36mtindy2013\033[0m" \ + "项目地址:\033[32mhttps://github.com/tindy2013/subconverter\033[0m" \ + "" \ + "\033[32msing-box-reF1nd \033[0m开发:\033[36mreF1nd\033[0m" \ + "项目地址:\033[32mhttps://github.com/reF1nd/sing-box\033[0m" \ + "" \ + "\033[32mDustinWin \033[0m开发:\033[36mDustinWin\033[0m" \ + "开发者地址:\033[32mhttps://github.com/DustinWin\033[0m" \ + "" + btm_box "特别感谢:\033[36m所有帮助及赞助过此项目的同仁们!\033[0m" sleep 2 ;; *) @@ -510,10 +501,10 @@ setcore() { comp_box "当前内核:\033[42;30m$crashcore\033[47;30m $core_v\033[0m" \ "当前系统处理器架构:\033[32m$cpucore\033[0m" \ - "\033[36m如需本地上传,请将.upx .gz .tar.gz文件上传至 /tmp 目录后重新运行crash命令\033[0m" + "\033[36m如需本地上传,请将.upx .gz .tar.gz文件上传至 /tmp 目录后重新运行crash命令\033[0m" \ + "" \ + "\033[33m请选择需要使用的核心版本:\033[0m" - content_line "\033[33m请选择需要使用的核心版本:\033[0m" - separator_line "-" content_line "1) \033[43;30mMihomo\033[0m:\033[32m$meta_v \033[32m(原meta内核)支持全面\033[0m \033[33m占用略高\033[0m" sub_content_line "说明文档:\033[36;4mhttps://wiki.metacubex.one\033[0m" @@ -533,7 +524,7 @@ setcore() { "7) \033[32m更新当前内核\033[0m" \ "9) 手动指定处理器架构" \ "" \ - "0 返回上级菜单" + "0) 返回上级菜单" read -r -p "请输入对应标号> " num case "$num" in "" | 0) diff --git a/scripts/menus/userguide.sh b/scripts/menus/userguide.sh index b3102b92..13796a81 100644 --- a/scripts/menus/userguide.sh +++ b/scripts/menus/userguide.sh @@ -108,9 +108,12 @@ userguide() { # 提示导入订阅或者配置文件 if [ ! -s "$CRASHDIR"/yamls/config.yaml ] && [ ! -s "$CRASHDIR"/jsons/config.json ]; then - comp_box "\033[32m$UG_IMPORT_CONFIG\033[0m" \ - "\033[0m$UG_CONFIG_TIP\033[0m" - read -r -p "$UG_CONFIG_RES(1/0)> " res + comp_box "\033[0m$UG_IMPORT_CONFIG\033[0m" \ + "\033[32m$UG_CONFIG_TIP\033[0m" \ + "$UG_CONFIG_RES" + btm_box "1) 立即导入" \ + "0) 暂不导入" + read -r -p "$COMMON_INPUT> " res [ "$res" = 1 ] && inuserguide=1 && { . "$CRASHDIR"/menus/6_core_config.sh && set_core_config inuserguide=""