Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

fix: StatusDot not updating reactively when VM status changes

rcourtman4f27fb1951f6
diff --git a/frontend-modern/src/components/shared/StatusDot.tsx b/frontend-modern/src/components/shared/StatusDot.tsx
index 8b1b4b7a16..03b6905e4e 100644
--- a/frontend-modern/src/components/shared/StatusDot.tsx
+++ b/frontend-modern/src/components/shared/StatusDot.tsx
@@ -27,14 +27,15 @@ const SIZE_CLASSES: Record<StatusDotSize, string> = {
};
export function StatusDot(props: StatusDotProps): JSX.Element {
- const variant = props.variant ?? 'muted';
- const size = props.size ?? 'sm';
- const ariaHidden = props.ariaHidden ?? !props.ariaLabel;
+ // Use getters to maintain reactivity - props can change over time
+ const variant = () => props.variant ?? 'muted';
+ const size = () => props.size ?? 'sm';
+ const ariaHidden = () => props.ariaHidden ?? !props.ariaLabel;
- const className = [
+ const className = () => [
'inline-block rounded-full flex-shrink-0',
- SIZE_CLASSES[size],
- VARIANT_CLASSES[variant],
+ SIZE_CLASSES[size()],
+ VARIANT_CLASSES[variant()],
props.pulse ? 'animate-pulse' : '',
props.class ?? '',
]
@@ -43,10 +44,10 @@ export function StatusDot(props: StatusDotProps): JSX.Element {
return (
<span
- class={className}
+ class={className()}
title={props.title}
aria-label={props.ariaLabel}
- aria-hidden={ariaHidden}
+ aria-hidden={ariaHidden()}
role={props.ariaLabel ? 'img' : undefined}
/>
);