品牌标识与握手诊断

- 向导开场:像素字符画 Logo(❯_ 提示符,青绿+光标绿)+ 版本/平台/配置信息 + 横线
- 运行面板头部加 ❯_ 标识;连接中状态改为 ◐◓◑◒ 旋转动画
- SSH banner 错误改为可读诊断文案;握手超时 12→25s;重连日志带尝试次数
This commit is contained in:
leefer
2026-09-27 20:57:46 +08:00
parent 5858656f62
commit 7229642c62
3 changed files with 67 additions and 15 deletions
+20 -8
View File
@@ -25,6 +25,25 @@ from engine import TunnelManager, probe_host # noqa: E402
from storage import Store, data_root # noqa: E402
import tui # noqa: E402
VERSION = "1.4"
def _print_banner(store: Store) -> None:
"""开场:像素 Logo + 产品信息(类 Claude Code 风格)。"""
from platform import python_version, system
logo = tui.logo_lines()
info = [
tui.bold("ssh-e2e · SSH 隧道管理器"),
tui.dim(f"v{VERSION} · 中文交互向导"),
tui.faint(f"{system()} · Python {python_version()}"),
tui.faint(f"配置 {store.path}"),
tui.faint("回车采用 [默认值] · Ctrl+C 退出"),
]
print()
for row, line in zip(logo, info):
print(f" {row} {line}")
print(" " + tui.accent("─" * 46))
def _print(msg: str) -> None:
print(msg, flush=True)
@@ -392,14 +411,7 @@ def _wizard_new_tunnel(store: Store, host: dict):
def wizard(store: Store) -> int:
_ensure_tty_stdin()
title = "SSH 隧道配置向导"
sub = "回车采用 [方括号] 默认值 · Ctrl+C 随时退出"
w = max(tui.disp_len(title) + 4, tui.disp_len(sub) + 4, 40)
print()
print(tui.accent("╭─ ") + tui.bold(title) + " " + tui.accent("─" * (w - tui.disp_len(title) - 3) + "╮"))
print(tui.accent("│") + " " + tui.faint(sub) + " " * (w - tui.disp_len(sub) - 2) + tui.accent("│"))
print(tui.accent("╰" + "─" * w + "╯"))
print(tui.faint(f" 配置文件: {store.path}"))
_print_banner(store)
if store.warn_plaintext:
_print("提示: 当前平台密码以明文保存于配置文件(权限已设为仅本用户可读)。")