mirror of
https://github.com/tailscale/tailscale.git
synced 2025-07-29 15:23:45 +00:00
wip, health status icons now work
This commit is contained in:
parent
906b1e01f2
commit
e475c589e6
@ -455,6 +455,12 @@ func (t *Tracker) setHealthyLocked(w *Warnable) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (t *Tracker) notifyWatchersLocked() {
|
||||||
|
for _, cb := range t.watchers {
|
||||||
|
go cb(nil, nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// AppendWarnableDebugFlags appends to base any health items that are currently in failed
|
// AppendWarnableDebugFlags appends to base any health items that are currently in failed
|
||||||
// state and were created with MapDebugFlag.
|
// state and were created with MapDebugFlag.
|
||||||
func (t *Tracker) AppendWarnableDebugFlags(base []string) []string {
|
func (t *Tracker) AppendWarnableDebugFlags(base []string) []string {
|
||||||
@ -647,6 +653,7 @@ func (t *Tracker) SetControlHealth(problems []tailcfg.Health) {
|
|||||||
defer t.mu.Unlock()
|
defer t.mu.Unlock()
|
||||||
t.controlHealth = problems
|
t.controlHealth = problems
|
||||||
t.selfCheckLocked()
|
t.selfCheckLocked()
|
||||||
|
t.notifyWatchersLocked()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GotStreamedMapResponse notes that we got a tailcfg.MapResponse
|
// GotStreamedMapResponse notes that we got a tailcfg.MapResponse
|
||||||
@ -1151,17 +1158,6 @@ func (t *Tracker) updateBuiltinWarnablesLocked() {
|
|||||||
t.setHealthyLocked(derpRegionErrorWarnable)
|
t.setHealthyLocked(derpRegionErrorWarnable)
|
||||||
}
|
}
|
||||||
|
|
||||||
if t.controlHealth != nil {
|
|
||||||
// for _, cb := range t.watchers {
|
|
||||||
// go cb(nil, nil)
|
|
||||||
// }
|
|
||||||
if len(t.controlHealth) > 0 {
|
|
||||||
t.setUnhealthyLocked(controlHealthWarnable, nil)
|
|
||||||
} else {
|
|
||||||
t.setHealthyLocked(controlHealthWarnable)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := envknob.ApplyDiskConfigError(); err != nil {
|
if err := envknob.ApplyDiskConfigError(); err != nil {
|
||||||
t.setUnhealthyLocked(applyDiskConfigWarnable, Args{
|
t.setUnhealthyLocked(applyDiskConfigWarnable, Args{
|
||||||
ArgError: err.Error(),
|
ArgError: err.Error(),
|
||||||
|
@ -967,15 +967,14 @@ func (b *LocalBackend) linkChange(delta *netmon.ChangeDelta) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *LocalBackend) onHealthChange(w *health.Warnable, us *health.UnhealthyState) {
|
func (b *LocalBackend) onHealthChange(_ *health.Warnable, us *health.UnhealthyState) {
|
||||||
if w == nil {
|
// if w != nil {
|
||||||
return
|
// if us == nil {
|
||||||
}
|
// b.logf("health(warnable=%s): ok", w.Code)
|
||||||
if us == nil {
|
// } else {
|
||||||
b.logf("health(warnable=%s): ok", w.Code)
|
// b.logf("health(warnable=%s): error: %s", w.Code, us.Text)
|
||||||
} else {
|
// }
|
||||||
b.logf("health(warnable=%s): error: %s", w.Code, us.Text)
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
// Whenever health changes, send the current health state to the frontend.
|
// Whenever health changes, send the current health state to the frontend.
|
||||||
state := b.health.CurrentState()
|
state := b.health.CurrentState()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user