mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-05 04:59:06 +02:00
Merge remote-tracking branch 'origin/ui-refactor' into ui-refactor
This commit is contained in:
@@ -19,10 +19,11 @@ import (
|
||||
// side) so UI-side consumers don't have to import the daemon-internal
|
||||
// package directly.
|
||||
const (
|
||||
MetaWarning = sessionwatch.MetaSessionWarning
|
||||
MetaFinal = sessionwatch.MetaSessionFinal
|
||||
MetaExpiresAt = sessionwatch.MetaSessionExpiresAt
|
||||
MetaLeadMinutes = sessionwatch.MetaSessionLeadMinutes
|
||||
MetaWarning = sessionwatch.MetaSessionWarning
|
||||
MetaFinal = sessionwatch.MetaSessionFinal
|
||||
MetaExpiresAt = sessionwatch.MetaSessionExpiresAt
|
||||
MetaLeadMinutes = sessionwatch.MetaSessionLeadMinutes
|
||||
MetaDeadlineRejected = sessionwatch.MetaSessionDeadlineRejected
|
||||
)
|
||||
|
||||
// Warning is the typed payload emitted on the session-warning Wails
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
"notify.sessionWarning.failed": "NetBird-Sitzung konnte nicht verlängert werden",
|
||||
"notify.sessionWarning.successTitle": "NetBird-Sitzung verlängert",
|
||||
"notify.sessionWarning.successBody": "Ihre Sitzung wurde erneuert.",
|
||||
"notify.sessionDeadlineRejected.title": "Sitzungsfrist abgelehnt",
|
||||
"notify.sessionDeadlineRejected.body": "Der Server hat eine ungültige Sitzungsfrist übermittelt. Bitte melden Sie sich erneut an.",
|
||||
|
||||
"common.cancel": "Abbrechen",
|
||||
"common.save": "Speichern",
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
"notify.sessionWarning.failed": "Failed to extend NetBird session",
|
||||
"notify.sessionWarning.successTitle": "NetBird session extended",
|
||||
"notify.sessionWarning.successBody": "Your session has been refreshed.",
|
||||
"notify.sessionDeadlineRejected.title": "Session deadline rejected",
|
||||
"notify.sessionDeadlineRejected.body": "The server sent an invalid session deadline. Please sign in again.",
|
||||
|
||||
"common.cancel": "Cancel",
|
||||
"common.save": "Save",
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
"notify.sessionWarning.failed": "A NetBird munkamenet meghosszabbítása sikertelen",
|
||||
"notify.sessionWarning.successTitle": "NetBird munkamenet meghosszabbítva",
|
||||
"notify.sessionWarning.successBody": "A munkamenet frissítve.",
|
||||
"notify.sessionDeadlineRejected.title": "Munkamenet-határidő elutasítva",
|
||||
"notify.sessionDeadlineRejected.body": "A szerver érvénytelen munkamenet-határidőt küldött. Kérjük, jelentkezzen be újra.",
|
||||
|
||||
"common.cancel": "Mégse",
|
||||
"common.save": "Mentés",
|
||||
|
||||
@@ -2,12 +2,7 @@
|
||||
|
||||
package main
|
||||
|
||||
// bindTrayClick is a no-op on macOS and Linux. On macOS the native
|
||||
// NSStatusItem auto-shows the menu on left-click; on Linux the
|
||||
// StatusNotifierItem host paints the menu independently. Binding an
|
||||
// OnClick→OpenMenu handler is both unnecessary there and actively harmful on
|
||||
// macOS, where OpenMenu routes through NSStatusItem's blocking [button
|
||||
// mouseDown:] on the serial main GCD queue and freezes the tray and webview
|
||||
// until the menu closes (commit c77e5cef8). Windows opts in via the sibling
|
||||
// tray_click_windows.go file.
|
||||
func bindTrayClick(*Tray) {}
|
||||
func bindTrayClick(*Tray) {
|
||||
// No-op: macOS/Linux native trays open the menu on click themselves.
|
||||
// Only Windows needs an explicit handler (tray_click_windows.go).
|
||||
}
|
||||
|
||||
@@ -22,11 +22,12 @@ func (t *Tray) onSystemEvent(ev *application.CustomEvent) {
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
// Session-warning events carry no UserMessage — the tray builds the
|
||||
// localised notification body locally from metadata. Every other
|
||||
// event needs a non-empty UserMessage to show anything meaningful.
|
||||
// Session-warning and deadline-rejected events carry no UserMessage —
|
||||
// the tray builds the localised notification body locally from metadata.
|
||||
// Every other event needs a non-empty UserMessage to show anything meaningful.
|
||||
isSessionWarning := se.Metadata[authsession.MetaWarning] == "true"
|
||||
if !isSessionWarning && se.UserMessage == "" {
|
||||
isDeadlineRejected := se.Metadata[authsession.MetaDeadlineRejected] != ""
|
||||
if !isSessionWarning && !isDeadlineRejected && se.UserMessage == "" {
|
||||
return
|
||||
}
|
||||
if shouldSkipSystemEvent(se) {
|
||||
@@ -52,6 +53,15 @@ func (t *Tray) onSystemEvent(ev *application.CustomEvent) {
|
||||
// - T-FinalWarningLead (MetaSessionFinal=true) → auto-open the
|
||||
// SessionExpiration dialog. No OS notification here; the
|
||||
// dialog is the last-chance reminder, doubling up would be noise.
|
||||
if isDeadlineRejected {
|
||||
t.notify(
|
||||
t.loc.T("notify.sessionDeadlineRejected.title"),
|
||||
t.loc.T("notify.sessionDeadlineRejected.body"),
|
||||
notifyIDSessionExpired,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
if se.Metadata != nil && se.Metadata[authsession.MetaWarning] == "true" {
|
||||
if se.Metadata[authsession.MetaFinal] == "true" {
|
||||
t.openSessionExpiration()
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
|
||||
package main
|
||||
|
||||
// startTrayTheme is a no-op off Linux: macOS uses template icons (the OS
|
||||
// recolours them per menubar appearance) and Windows ships colored PNGs, so
|
||||
// neither needs the freedesktop colour-scheme probe that the Linux build
|
||||
// uses to choose between the black and white monochrome silhouettes. Left
|
||||
// callable so NewTray can invoke it unconditionally; panelDark stays nil and
|
||||
// panelIsDark returns its default.
|
||||
func (t *Tray) startTrayTheme() {}
|
||||
func (t *Tray) startTrayTheme() {
|
||||
// No-op off Linux: macOS template icons and Windows colored PNGs need no
|
||||
// colour-scheme probe. panelDark stays nil; panelIsDark uses its default.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user