[client/ui-wails] Wire up enforced-update tray menu item

Surface the Fyne UI's "Download latest version" / "Install version X.Y.Z"
About-submenu entry in the Wails tray. The item starts hidden and is
revealed by onUpdateAvailable when the daemon emits EventUpdateAvailable;
opt-in updates open github.com/netbirdio/netbird/releases/latest in the
browser, enforced updates surface the in-window /update progress page
and call TriggerUpdate on the daemon.

Also lift every user-facing string and external URL in tray.go into
named const declarations at the top of the file, so future copy edits
and (eventual) localisation have a single source of truth.

The /update React route is the frontend counterpart and is owned by the
React side of the refactor.
This commit is contained in:
Zoltán Papp
2026-05-05 11:56:57 +02:00
parent e3994d0c99
commit bc609c3ae7
2 changed files with 152 additions and 34 deletions

View File

@@ -93,6 +93,7 @@ func main() {
settings := services.NewSettings(conn)
profiles := services.NewProfiles(conn)
peers := services.NewPeers(conn, app.Event)
update := services.NewUpdate(conn)
notifier := notifications.New()
app.RegisterService(application.NewService(connection))
@@ -100,7 +101,7 @@ func main() {
app.RegisterService(application.NewService(services.NewNetworks(conn)))
app.RegisterService(application.NewService(profiles))
app.RegisterService(application.NewService(services.NewDebug(conn)))
app.RegisterService(application.NewService(services.NewUpdate(conn)))
app.RegisterService(application.NewService(update))
app.RegisterService(application.NewService(peers))
app.RegisterService(application.NewService(notifier))
@@ -128,7 +129,7 @@ func main() {
window.Hide()
})
tray = NewTray(app, window, connection, settings, profiles, peers, notifier)
tray = NewTray(app, window, connection, settings, profiles, peers, notifier, update)
listenForShowSignal(context.Background(), tray)
peers.Watch(context.Background())