fix(admin): read int values from YAML for port fields

This commit is contained in:
Claus Lohmar 2026-06-15 04:45:36 +00:00
parent 64ddd71358
commit 9edd6f1038

View file

@ -1,6 +1,7 @@
package admin
import (
"fmt"
"net/http"
"os"
@ -132,8 +133,15 @@ func getNested(m map[string]interface{}, keys ...string) string {
}
v = mp[k]
if i == len(keys)-1 {
s, _ := v.(string)
return s
switch val := v.(type) {
case string:
return val
case int:
return fmt.Sprintf("%d", val)
case float64:
return fmt.Sprintf("%.0f", val)
}
return ""
}
}
return ""