From 67a68be2290b3af6e7d2897e52b3cd19d1f4450d Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Fri, 26 Mar 2021 15:48:58 +0100 Subject: Location selection more responsive --- pkg/backend/status.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/backend/status.go') diff --git a/pkg/backend/status.go b/pkg/backend/status.go index 0e92253..bdbdd35 100644 --- a/pkg/backend/status.go +++ b/pkg/backend/status.go @@ -47,17 +47,21 @@ type connectionCtx struct { Locations map[string]float64 `json:"locations"` CurrentGateway string `json:"currentGateway"` CurrentLocation string `json:"currentLocation"` + CurrentCountry string `json:"currentCountry"` + ManualLocation bool `json:"manualLocation"` bm bitmask.Bitmask autostart bitmask.Autostart cfg *config.Config } -func (c connectionCtx) toJson() ([]byte, error) { +func (c *connectionCtx) toJson() ([]byte, error) { statusMutex.Lock() if c.bm != nil { c.Locations = c.bm.ListLocationFullness("openvpn") c.CurrentGateway = c.bm.GetCurrentGateway() c.CurrentLocation = c.bm.GetCurrentLocation() + c.CurrentCountry = c.bm.GetCurrentCountry() + c.ManualLocation = c.bm.IsManualLocation() } defer statusMutex.Unlock() b, err := json.Marshal(c) -- cgit v1.2.3