diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2021-09-06 21:08:14 +0200 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2021-11-23 21:51:01 +0100 |
commit | 8543125fa656ddc2c114072adfc27e4e7c461695 (patch) | |
tree | 176f90c03f64c2645932dbaf3d87f2ad22b61489 /pkg/backend | |
parent | b8e0fe3b5003d22043042110e8036f4383602545 (diff) |
[ui] transient connecting state
Diffstat (limited to 'pkg/backend')
-rw-r--r-- | pkg/backend/status.go | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/pkg/backend/status.go b/pkg/backend/status.go index 0ffd853..c5f79d1 100644 --- a/pkg/backend/status.go +++ b/pkg/backend/status.go @@ -32,24 +32,27 @@ var updateMutex sync.Mutex // them. type connectionCtx struct { - AppName string `json:"appName"` - Provider string `json:"provider"` - TosURL string `json:"tosURL"` - HelpURL string `json:"helpURL"` - AskForDonations bool `json:"askForDonations"` - DonateDialog bool `json:"donateDialog"` - DonateURL string `json:"donateURL"` - LoginDialog bool `json:"loginDialog"` - LoginOk bool `json:"loginOk"` - Version string `json:"version"` - Errors string `json:"errors"` - Status status `json:"status"` - Locations map[string]float64 `json:"locations"` - CurrentGateway string `json:"currentGateway"` - CurrentLocation string `json:"currentLocation"` - CurrentCountry string `json:"currentCountry"` - ManualLocation bool `json:"manualLocation"` - IsReady bool `json:"isReady"` + AppName string `json:"appName"` + Provider string `json:"provider"` + TosURL string `json:"tosURL"` + HelpURL string `json:"helpURL"` + AskForDonations bool `json:"askForDonations"` + DonateDialog bool `json:"donateDialog"` + DonateURL string `json:"donateURL"` + LoginDialog bool `json:"loginDialog"` + LoginOk bool `json:"loginOk"` + Version string `json:"version"` + Errors string `json:"errors"` + Status status `json:"status"` + Locations map[string]float64 `json:"locations"` + LocationLabels map[string][]string `json:"locationLabels"` + CurrentGateway string `json:"currentGateway"` + CurrentLocation string `json:"currentLocation"` + CurrentCountry string `json:"currentCountry"` + BestLocation string `json:"bestLocation"` + Transport string `json:"transport"` + ManualLocation bool `json:"manualLocation"` + IsReady bool `json:"isReady"` bm bitmask.Bitmask autostart bitmask.Autostart cfg *config.Config @@ -60,9 +63,12 @@ func (c *connectionCtx) toJson() ([]byte, error) { if c.bm != nil { transport := c.bm.GetTransport() c.Locations = c.bm.ListLocationFullness(transport) + c.LocationLabels = c.bm.ListLocationLabels(transport) c.CurrentGateway = c.bm.GetCurrentGateway() c.CurrentLocation = c.bm.GetCurrentLocation() c.CurrentCountry = c.bm.GetCurrentCountry() + c.BestLocation = c.bm.GetBestLocation(transport) + c.Transport = transport c.ManualLocation = c.bm.IsManualLocation() } defer statusMutex.Unlock() |