summaryrefslogtreecommitdiff
path: root/pkg/backend
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-09-06 21:08:14 +0200
committerkali kaneko (leap communications) <kali@leap.se>2021-10-06 18:38:12 +0200
commit7fdad87222a963e57031132acce7c06f4b80e64d (patch)
tree6c93efc27ce892f56a4e5400c890f7bee8289ae5 /pkg/backend
parent566389285f60a59c8dc1323f977ecf4e36e7f679 (diff)
[ui] transient connecting state
Diffstat (limited to 'pkg/backend')
-rw-r--r--pkg/backend/status.go42
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()