fix: log path format, panel hotkey passthrough, TUI hint styling

- Fix log path default: $s→%s, show available fmt fields in prompt
- Panel handlers default return false (allows Ctrl+Alt+M/F/P/H to
  switch panels without closing current one)
- TUI bottom hints: replace Faint with Bold + brighter colors
  (suggest=cyan, status=bright white, hotkeys=bright gray)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
JiXieShi
2026-05-24 02:58:41 +08:00
parent 40709dadda
commit 4112e3fb03
2 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -101,7 +101,7 @@ func PrintUsage(ports []string) {
{"-k", "--hotkey-mod", "string", "hotkey modifier", "ctrl+alt"},
{"-f", "--forward", "[]int", "forward (0:none,1:TCP,2:UDP,3:TCP-S,4:UDP-S,5:COM)", "0"},
{"-a", "--address", "[]string", "forward address", "127.0.0.1:12345"},
{"-l", "--log", "string", "log path", "./%s-$s.txt"},
{"-l", "--log", "string", "log path (%s=port, then timestamp)", "./%s-%s.log"},
{"-t", "--time", "string", "timestamp format", "[06-01-02 15:04:05.000]"},
}
sort.Slice(flags, func(i, j int) bool { return flags[i].long < flags[j].long })
@@ -254,9 +254,9 @@ func GetCliFlag(cfg *config.Config) {
cfg.EnableLog = e
if e {
t, _ = inf.NewText(
text.WithPrompt("Path:"),
text.WithPrompt("Path(%s=port, then stamp):"),
text.WithPromptStyle(theme.DefaultTheme.PromptStyle),
text.WithDefaultValue("./%s-$s.txt"),
text.WithDefaultValue("./%s-%s.log"),
).Display()
cfg.LogFilePath = t
}
+3 -2
View File
@@ -258,12 +258,13 @@ func (m *Model) View() string {
}
modifier := strings.ToUpper(normalizeHotkeyPrefix(m.App.Cfg().HotkeyMod))
hotkeys := "Hotkeys: Ctrl+C remote | " + modifier + "+C local | " + modifier + "+F forward | " + modifier + "+P plugins | " + modifier + "+M mode | F1 help"
hotkeys = lipgloss.NewStyle().Faint(true).Foreground(lipgloss.Color("245")).Render(hotkeys)
hotkeys = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("244")).Render(hotkeys)
status := m.statusLine
if status == "" {
status = "Ready"
}
status = lipgloss.NewStyle().Foreground(lipgloss.Color("250")).Faint(true).Render(status)
status = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("255")).Render(status)
suggest = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("39")).Render(suggest)
base := fmt.Sprintf("%s\n%s\n%s\n%s\n%s", m.viewport.View(), suggest, status, m.input.View(), hotkeys)
if !m.showModal {
return fillScreen(m.width, m.height, base)