Browse Source

Merge pull request #1116 from gravitl/bugfix_v0.14.1_node_health_gui

handled checkin time comparison for health better
dcarns 3 years ago
parent
commit
c3989fc6f1
1 changed files with 4 additions and 3 deletions
  1. 4 3
      netclient/gui/components/views/networks.go

+ 4 - 3
netclient/gui/components/views/networks.go

@@ -67,6 +67,7 @@ func GetSingleNetworkView(network string) fyne.CanvasObject {
 	LoadingNotify()
 	LoadingNotify()
 	nets, err := functions.List(network)
 	nets, err := functions.List(network)
 	if err != nil || len(nets) < 1 {
 	if err != nil || len(nets) < 1 {
+		ClearNotification()
 		return container.NewCenter(widget.NewLabel("No data retrieved."))
 		return container.NewCenter(widget.NewLabel("No data retrieved."))
 	}
 	}
 	var nodecfg config.ClientConfig
 	var nodecfg config.ClientConfig
@@ -79,10 +80,10 @@ func GetSingleNetworkView(network string) fyne.CanvasObject {
 	privateAddr6 := nodecfg.Node.Address6
 	privateAddr6 := nodecfg.Node.Address6
 	endpoint := nodecfg.Node.Endpoint
 	endpoint := nodecfg.Node.Endpoint
 	health := " (HEALTHY)"
 	health := " (HEALTHY)"
-	if time.Now().After(lastCheckInTime.Add(time.Minute * 5)) {
-		health = " (WARNING)"
-	} else if time.Now().After(lastCheckInTime.Add(time.Minute * 30)) {
+	if time.Now().After(lastCheckInTime.Add(time.Minute * 30)) {
 		health = " (ERROR)"
 		health = " (ERROR)"
+	} else if time.Now().After(lastCheckInTime.Add(time.Minute * 5)) {
+		health = " (WARNING)"
 	}
 	}
 	lastCheckIn += health
 	lastCheckIn += health
 	version := nodecfg.Node.Version
 	version := nodecfg.Node.Version