fix(web): correct observability runtime gate count
This commit is contained in:
@@ -98,6 +98,13 @@ function formatDateTime(value?: string) {
|
||||
})
|
||||
}
|
||||
|
||||
function countRuntimeAllowedBoundaries(boundaries?: Record<string, boolean>) {
|
||||
return Object.entries(boundaries ?? {}).filter(([key, allowed]) => {
|
||||
if (!allowed) return false
|
||||
return !key.startsWith('read_only')
|
||||
}).length
|
||||
}
|
||||
|
||||
function MetricTile({
|
||||
label,
|
||||
value,
|
||||
@@ -281,9 +288,14 @@ export default function ObservabilityPage({ params }: { params: { locale: string
|
||||
(state.serviceHealth?.rollups.target_ids_requiring_action.length ?? 0) +
|
||||
(state.deployment?.rollups.approval_required_target_ids.length ?? 0)
|
||||
const runtimeGateCount =
|
||||
Object.values(state.observability?.operation_boundaries ?? {}).filter(Boolean).length +
|
||||
Object.values(state.serviceHealth?.operation_boundaries ?? {}).filter(Boolean).length +
|
||||
Object.values(state.deployment?.approval_boundaries ?? {}).filter(Boolean).length
|
||||
countRuntimeAllowedBoundaries(state.observability?.operation_boundaries) +
|
||||
countRuntimeAllowedBoundaries(state.serviceHealth?.operation_boundaries) +
|
||||
Object.values(state.deployment?.approval_boundaries ?? {}).filter(Boolean).length +
|
||||
(state.serviceHealth?.rollups.service_restart_allowed_count ?? 0) +
|
||||
(state.serviceHealth?.rollups.endpoint_change_allowed_count ?? 0) +
|
||||
(state.serviceHealth?.rollups.active_probe_allowed_count ?? 0) +
|
||||
(state.serviceHealth?.rollups.notification_send_allowed_count ?? 0) +
|
||||
(state.serviceHealth?.rollups.runtime_execution_allowed_count ?? 0)
|
||||
|
||||
const domainRows = DOMAIN_ORDER.map(domainId => {
|
||||
const domain = state.deployment?.domains.find(item => item.domain_id === domainId)
|
||||
|
||||
Reference in New Issue
Block a user