feat(protocol): Enhanced the heartbeat control mechanism of the frame writer

Added a heartbeatControl channel to support dynamic start/stop of the heartbeat function and optimized related resource management logic,

ensuring that the heartbeat ticker can be correctly stopped and rebuilt. Also adjusted the field initialization order to ensure concurrency safety.

fix(ui): Improved the tunnel connection status display style

Updated the URL line display content, added the "(forwarded link)" prompt text; adjusted the style layout of the local forwarding address and prompt information,

making the interface clearer and easier to read.
This commit is contained in:
Gouryella
2025-12-03 10:52:53 +08:00
parent fbd910b3a2
commit 0aa438e202
2 changed files with 53 additions and 14 deletions

View File

@@ -57,9 +57,19 @@ func RenderTunnelConnected(status *TunnelStatus) string {
lipgloss.NewStyle().MarginLeft(2).Render(typeBadge),
)
urlLine := urlStyle.Copy().Foreground(accent).Render(status.URL)
forwardLine := Muted("⇢ ") + valueStyle.Render(status.LocalAddr)
hint := mutedStyle.Render("Ctrl+C to stop • reconnects automatically")
urlLine := lipgloss.JoinHorizontal(
lipgloss.Left,
urlStyle.Copy().Foreground(accent).Render(status.URL),
lipgloss.NewStyle().MarginLeft(1).Foreground(mutedColor).Render("(forwarded link)"),
)
forwardLine := lipgloss.NewStyle().
MarginLeft(2).
Render(Muted("⇢ ") + valueStyle.Render(status.LocalAddr))
hint := lipgloss.NewStyle().
Foreground(latencyOrangeColor).
Render("Ctrl+C to stop • reconnects automatically")
content := lipgloss.JoinVertical(
lipgloss.Left,