Add Starlink status lines for the physical gateway pane (closes #3)
check / check (push) Failing after 1s
check / check (push) Failing after 1s
When the non-VPN physical gateway is a Starlink dish, two lines are shown under that pane: state, uptime, obstruction and alert count; then pop-ping latency and drop rate with downlink/uplink throughput. They turn red when the dish is not connected or an alert is active. Detection is a TCP connect to the dish's fixed endpoint 192.168.100.1:9200, bound to the physical interface the same way the latency probes bind. Until a dish answers nothing is drawn and no status is fetched, so an absent dish adds no noise. Status comes from the dish's local get_status gRPC call. Detection and the fetch sit behind a small Client interface; the loop and the pure Render function are tested with a fake, no dish and no network. Model: opus-4-8
This commit is contained in:
@@ -19,6 +19,8 @@ import (
|
||||
"time"
|
||||
|
||||
tcell "github.com/gdamore/tcell/v2"
|
||||
|
||||
"git.eeqj.de/sneak/rtnetmon/internal/starlink"
|
||||
)
|
||||
|
||||
// Meter glyphs used to render the ASCII loss meter.
|
||||
@@ -90,6 +92,12 @@ type Monitor struct {
|
||||
// Interfaces to monitor (one or two)
|
||||
interfaces []*InterfaceStatus
|
||||
|
||||
// Starlink status for the physical (non-VPN gateway) pane. All three
|
||||
// are nil unless EnableStarlink was called for a monitored interface.
|
||||
slClient starlink.Client
|
||||
slState *starlinkState
|
||||
slPane *InterfaceStatus
|
||||
|
||||
// Logging
|
||||
logFile string
|
||||
|
||||
@@ -208,6 +216,8 @@ func (m *Monitor) Run(ctx context.Context) error {
|
||||
go m.tcpLoop(ctx, st, tcpHosts)
|
||||
}
|
||||
|
||||
go m.starlinkLoop(ctx)
|
||||
|
||||
m.logf("Starting UI loop")
|
||||
m.uiLoop(ctx)
|
||||
m.logf("UI loop exited, monitor ending")
|
||||
|
||||
Reference in New Issue
Block a user