mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2026-05-22 13:56:30 +03:00
Add FriendlyName option, show friendly name and real endpoint in admin socket/yggdrasilctl
This commit is contained in:
@@ -155,6 +155,12 @@ func main() {
|
||||
minutes := uint(preformatted.(float64)/60) % 60
|
||||
hours := uint(preformatted.(float64) / 60 / 60)
|
||||
formatted = fmt.Sprintf("%02d:%02d:%02d", hours, minutes, seconds)
|
||||
case "friendly_name":
|
||||
if len(preformatted.(string)) > 32 {
|
||||
formatted = fmt.Sprintf("%s...", preformatted.(string)[:32])
|
||||
} else {
|
||||
formatted = preformatted.(string)
|
||||
}
|
||||
default:
|
||||
formatted = fmt.Sprint(preformatted)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user