health: show DisplayMessage actions in 'tailscale status'

Updates tailscale/corp#27759

Signed-off-by: James Sanderson <jsanderson@tailscale.com>
This commit is contained in:
James Sanderson
2025-06-04 12:10:15 +01:00
committed by James 'zofrex' Sanderson
parent 5fde183754
commit 13ee285675
2 changed files with 35 additions and 11 deletions

View File

@@ -1054,13 +1054,18 @@ func (t *Tracker) stringsLocked() []string {
warnLen := len(result)
for _, c := range t.controlMessages {
var msg string
if c.Title != "" && c.Text != "" {
result = append(result, c.Title+": "+c.Text)
msg = c.Title + ": " + c.Text
} else if c.Title != "" {
result = append(result, c.Title)
msg = c.Title + "."
} else if c.Text != "" {
result = append(result, c.Text)
msg = c.Text
}
if c.PrimaryAction != nil {
msg = msg + " " + c.PrimaryAction.Label + ": " + c.PrimaryAction.URL
}
result = append(result, msg)
}
sort.Strings(result[warnLen:])