mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-26 08:39:06 +02:00
tray: selectable exit nodes + push-based network list refresh
Make the tray Exit Node submenu selectable (mutually exclusive, sourced from ListNetworks by NetID) instead of read-only. Add networksRevision to the status snapshot, bumped by the route manager on network-map and selection changes, so the tray and the React NetworksContext re-fetch ListNetworks via the push stream instead of polling. The peer-status route list only carries chosen routes, so a candidate exit node appearing or disappearing would otherwise never reach the UI.
This commit is contained in:
@@ -126,6 +126,10 @@ type Status struct {
|
||||
Local LocalPeer `json:"local"`
|
||||
Peers []PeerStatus `json:"peers"`
|
||||
Events []SystemEvent `json:"events"`
|
||||
// NetworksRevision bumps whenever the daemon's routed-networks set or their
|
||||
// selected state changes. Consumers fingerprint on it to know when to
|
||||
// re-fetch ListNetworks instead of polling every snapshot.
|
||||
NetworksRevision uint64 `json:"networksRevision"`
|
||||
// SessionExpiresAt is the absolute UTC instant at which the peer's
|
||||
// SSO session expires. nil when the peer is not SSO-tracked or login
|
||||
// expiration is disabled (either server-side off, or peer not
|
||||
@@ -425,8 +429,9 @@ func statusFromProto(resp *proto.StatusResponse) Status {
|
||||
local := full.GetLocalPeerState()
|
||||
|
||||
st := Status{
|
||||
Status: resp.GetStatus(),
|
||||
DaemonVersion: resp.GetDaemonVersion(),
|
||||
Status: resp.GetStatus(),
|
||||
DaemonVersion: resp.GetDaemonVersion(),
|
||||
NetworksRevision: full.GetNetworksRevision(),
|
||||
Management: PeerLink{
|
||||
URL: mgmt.GetURL(),
|
||||
Connected: mgmt.GetConnected(),
|
||||
|
||||
Reference in New Issue
Block a user