From 20b414e74136f668cd9b64558380e4281080d25f Mon Sep 17 00:00:00 2001 From: Cheng Zhou Date: Tue, 23 Jun 2026 22:22:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E8=8F=9C=E5=8D=95=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=A1=B9=E6=98=BE=E7=A4=BA=E4=B8=BA=20dev(=E9=BB=98?= =?UTF-8?q?=E8=AE=A4)=20=E6=A0=BC=E5=BC=8F=EF=BC=8C=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=A7=BB=E9=99=A4=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- install.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/install.sh b/install.sh index bfec102a..23bfa3d6 100755 --- a/install.sh +++ b/install.sh @@ -143,14 +143,10 @@ select_menu() { local i for i in "${!options[@]}"; do - local tag="" tag_plain="" - if [[ "$i" -eq "${default_index:-99}" ]]; then - tag=" ${CC_SUCCESS}[自动]${C_RESET}"; tag_plain=" [自动]" - fi if [[ "$i" -eq "$selected" ]]; then - ctms_box_line "${C_BLUE}${C_BOLD}" "$UI_BOX_WIDTH" "${ICON_BULLET} ${options[$i]}${tag_plain}" "${CC_INFO}${C_BOLD}${ICON_BULLET} ${options[$i]}${C_RESET}${tag}" + ctms_box_line "${C_BLUE}${C_BOLD}" "$UI_BOX_WIDTH" "${ICON_BULLET} ${options[$i]}" "${CC_INFO}${C_BOLD}${ICON_BULLET} ${options[$i]}${C_RESET}" else - ctms_box_line "${C_BLUE}${C_BOLD}" "$UI_BOX_WIDTH" "${ICON_BULLET_OFF} ${options[$i]}${tag_plain}" "${CC_MUTED}${ICON_BULLET_OFF} ${options[$i]}${C_RESET}${tag}" + ctms_box_line "${C_BLUE}${C_BOLD}" "$UI_BOX_WIDTH" "${ICON_BULLET_OFF} ${options[$i]}" "${CC_MUTED}${ICON_BULLET_OFF} ${options[$i]}${C_RESET}" fi done ctms_box_bottom "${C_BLUE}${C_BOLD}" "$UI_BOX_WIDTH" @@ -180,10 +176,19 @@ pick_env() { main) default_index=1 ;; release) default_index=2 ;; esac - select_menu "选择环境" "$default_index" \ - "dev 本地开发环境 Vite 热加载 / 默认密钥" \ - "main 内网测试环境 预发布验证 / 生产模式" \ + local -a opts=( + "dev 本地开发环境 Vite 热加载 / 默认密钥" + "main 内网测试环境 预发布验证 / 生产模式" "release 生产环境 HTTPS / RSA 密钥" + ) + if [[ -n "$env" ]]; then + case "$default_index" in + 0) opts[0]="dev(默认) 本地开发环境 Vite 热加载 / 默认密钥" ;; + 1) opts[1]="main(默认) 内网测试环境 预发布验证 / 生产模式" ;; + 2) opts[2]="release(默认) 生产环境 HTTPS / RSA 密钥" ;; + esac + fi + select_menu "选择环境" "$default_index" "${opts[@]}" case "$SELECTED_INDEX" in 0) SELECTED_ENV="dev" ;; 1) SELECTED_ENV="main" ;; @@ -228,7 +233,7 @@ pause_return() { } interactive_main() { - select_menu "选择操作" "0" \ + select_menu "选择操作" "" \ "安装部署 配置环境、构建容器、迁移数据库、健康检查" \ "滚动更新 重建服务、执行迁移、复用安装健康检查" \ "安全卸载 停止并移除容器,保留 .env 与数据文件" \