diff --git a/frontend-modern/src/components/Dashboard/GuestRow.tsx b/frontend-modern/src/components/Dashboard/GuestRow.tsx index 52eb7b314..d62a8b027 100644 --- a/frontend-modern/src/components/Dashboard/GuestRow.tsx +++ b/frontend-modern/src/components/Dashboard/GuestRow.tsx @@ -6,6 +6,7 @@ import { IOMetric } from './IOMetric'; import { TagBadges } from './TagBadges'; import { DiskList } from './DiskList'; import { GuestMetadataAPI } from '@/api/guestMetadata'; +import { isGuestRunning, shouldDisplayGuestMetrics } from '@/utils/status'; type Guest = VM | Container; @@ -152,12 +153,9 @@ export function GuestRow(props: GuestRowProps) { return (props.guest.disk.used / props.guest.disk.total) * 100; }); - const isRunning = createMemo(() => { - if (props.parentNodeOnline === false) { - return false; - } - return props.guest.status === 'running'; - }); + const parentOnline = createMemo(() => props.parentNodeOnline !== false); + const isRunning = createMemo(() => isGuestRunning(props.guest, parentOnline())); + const showGuestMetrics = createMemo(() => shouldDisplayGuestMetrics(props.guest, parentOnline())); // Get helpful tooltip for disk status const getDiskStatusTooltip = () => { @@ -196,7 +194,7 @@ export function GuestRow(props: GuestRowProps) { return true; }); - const drawerDisabled = createMemo(() => props.parentNodeOnline === false || !isRunning()); + const drawerDisabled = createMemo(() => !isRunning()); // Get row styling - include alert styles if present const rowClass = createMemo(() => { @@ -303,10 +301,7 @@ export function GuestRow(props: GuestRowProps) { {/* CPU */}