mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-12 09:40:46 +08:00
handled checkin time comparison for health better
This commit is contained in:
parent
f2ca830106
commit
aed80d0886
1 changed files with 4 additions and 3 deletions
|
|
@ -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)) {
|
if time.Now().After(lastCheckInTime.Add(time.Minute * 30)) {
|
||||||
health = " (WARNING)"
|
|
||||||
} else 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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue