Private
Public Access
1
0

scores: csv handler

This commit is contained in:
2023-12-10 21:02:04 -08:00
parent adab600e26
commit 61245cc77c
12 changed files with 750 additions and 2 deletions

23
ntpdb/monitor.go Normal file
View File

@@ -0,0 +1,23 @@
package ntpdb
import (
"strconv"
"strings"
)
func (m *Monitor) DisplayName() string {
switch {
case len(m.Name) > 0:
return m.Name
case m.TlsName.Valid && len(m.TlsName.String) > 0:
name := m.TlsName.String
if idx := strings.Index(name, "."); idx > 0 {
name = name[0:idx]
}
return name
case len(m.Location) > 0:
return m.Location + " (" + strconv.Itoa(int(m.ID)) + ")" // todo: IDToken instead of ID
default:
return strconv.Itoa(int(m.ID)) // todo: IDToken
}
}