mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-11 23:54:22 +08:00
handled checkin time comparison for health better
This commit is contained in:
parent
ccd5243f47
commit
8855cf214e
1 changed files with 4 additions and 3 deletions
|
@ -67,6 +67,7 @@ func GetSingleNetworkView(network string) fyne.CanvasObject {
|
|||
LoadingNotify()
|
||||
nets, err := functions.List(network)
|
||||
if err != nil || len(nets) < 1 {
|
||||
ClearNotification()
|
||||
return container.NewCenter(widget.NewLabel("No data retrieved."))
|
||||
}
|
||||
var nodecfg config.ClientConfig
|
||||
|
@ -79,10 +80,10 @@ func GetSingleNetworkView(network string) fyne.CanvasObject {
|
|||
privateAddr6 := nodecfg.Node.Address6
|
||||
endpoint := nodecfg.Node.Endpoint
|
||||
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)"
|
||||
} else if time.Now().After(lastCheckInTime.Add(time.Minute * 5)) {
|
||||
health = " (WARNING)"
|
||||
}
|
||||
lastCheckIn += health
|
||||
version := nodecfg.Node.Version
|
||||
|
|
Loading…
Add table
Reference in a new issue