diff --git a/src/webui/internal/handlers/ntp.go b/src/webui/internal/handlers/ntp.go index 0b456ffa..2f230c83 100644 --- a/src/webui/internal/handlers/ntp.go +++ b/src/webui/internal/handlers/ntp.go @@ -86,8 +86,12 @@ func (h *NTPHandler) Overview(w http.ResponseWriter, r *http.Request) { } `json:"ietf-ntp:ntp"` } if err := h.RC.Get(ctx, "/data/ietf-ntp:ntp", &raw); err != nil { - log.Printf("restconf ntp: %v", err) - data.Error = "Failed to fetch NTP data" + // 404 = NTP container absent (not configured). Render the empty-state + // section instead of a red error banner. + if !restconf.IsNotFound(err) { + log.Printf("restconf ntp: %v", err) + data.Error = "Failed to fetch NTP data" + } } else { ss := raw.NTP.ClockState.SystemStatus synced := strings.Contains(ss.ClockState, "synchronized") && diff --git a/src/webui/templates/pages/ntp.html b/src/webui/templates/pages/ntp.html index ccb7034a..17934c79 100644 --- a/src/webui/templates/pages/ntp.html +++ b/src/webui/templates/pages/ntp.html @@ -32,8 +32,8 @@ {{end}} - {{if .NTP.Associations}}
No associations.
+ {{end}} {{else if not .Error}}NTP data not available.
+