fix(ntp+backends): /system/services response is {services:[]} not a bare array
Both NTP and Backends pages cast r.data.data directly to Array<…> but
the handler wraps the list as gin.H{"services": out}. The wrong cast
returned an object to .find()/.filter(), crashing with "s.find is not
a function" and breaking the NTP page entirely. Firewall/ForwardProxy/
DNS/Settings pages already used the correct {services:…} shape. v1.1.117.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,7 +60,7 @@ import (
|
|||||||
usersvc "git.netcell-it.de/projekte/edgeguard-native/internal/services/users"
|
usersvc "git.netcell-it.de/projekte/edgeguard-native/internal/services/users"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "1.1.116"
|
var version = "1.1.117"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
addr := os.Getenv("EDGEGUARD_API_ADDR")
|
addr := os.Getenv("EDGEGUARD_API_ADDR")
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"git.netcell-it.de/projekte/edgeguard-native/internal/services/setup"
|
"git.netcell-it.de/projekte/edgeguard-native/internal/services/setup"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "1.1.116"
|
var version = "1.1.117"
|
||||||
|
|
||||||
const usage = `edgeguard-ctl — EdgeGuard CLI
|
const usage = `edgeguard-ctl — EdgeGuard CLI
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ import (
|
|||||||
"git.netcell-it.de/projekte/edgeguard-native/internal/services/tlscerts"
|
"git.netcell-it.de/projekte/edgeguard-native/internal/services/tlscerts"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "1.1.116"
|
var version = "1.1.117"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// renewTickInterval — how often we re-evaluate expiring certs.
|
// renewTickInterval — how often we re-evaluate expiring certs.
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ export default function BackendsPage() {
|
|||||||
queryKey: ['system', 'services'],
|
queryKey: ['system', 'services'],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const r = await apiClient.get('/system/services')
|
const r = await apiClient.get('/system/services')
|
||||||
return isEnvelope(r.data) ? (r.data.data as Array<{ unit: string; active: boolean; state: string }>).filter(Boolean) : []
|
return isEnvelope(r.data) ? (r.data.data as { services: Array<{ unit: string; active: boolean; state: string }> }).services ?? [] : []
|
||||||
},
|
},
|
||||||
refetchInterval: 30_000,
|
refetchInterval: 30_000,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export default function NTPPage() {
|
|||||||
queryKey: ['system', 'services'],
|
queryKey: ['system', 'services'],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const r = await apiClient.get('/system/services')
|
const r = await apiClient.get('/system/services')
|
||||||
return isEnvelope(r.data) ? (r.data.data as Array<{ unit: string; active: boolean; state: string }>) : []
|
return isEnvelope(r.data) ? (r.data.data as { services: Array<{ unit: string; active: boolean; state: string }> }).services ?? [] : []
|
||||||
},
|
},
|
||||||
refetchInterval: 30_000,
|
refetchInterval: 30_000,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user