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.

Show offline alert controls in the card threshold layout

rcourtman2071325b88ba
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index d7ca954774..604f9c374e 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,44 +1,40 @@
{
"version": 1,
- "base_sha": "4f61cc3bfeeca10f9f88d3c7d3e2d15ac45f1734",
- "verified_at": "2026-08-18T21:16:21Z",
+ "base_sha": "c52d01013808f272fc1b136065f539f63265f8b7",
+ "verified_at": "2026-08-19T05:31:38Z",
"result": "passed",
"changed_paths": [
- "frontend-modern/src/features/docker/DockerHostsTable.tsx",
- "frontend-modern/src/features/docker/dockerContainerTableModel.ts",
- "frontend-modern/src/features/standalone/AvailabilityChecksTable.tsx"
+ "frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx"
],
"content_sha256": {
- "frontend-modern/src/features/docker/DockerHostsTable.tsx": "dd5796344bfd34d0356e1cef58b6cdd9cf6a6da7383ff4a4853e6e8c68706f4f",
- "frontend-modern/src/features/docker/dockerContainerTableModel.ts": "48bf66fe7e3bacf6352c48d7ccd568dd337e9d27670da435f30c3caabccf79bc",
- "frontend-modern/src/features/standalone/AvailabilityChecksTable.tsx": "0ea207d0c931b9aabc9c8b0ab44420fbf8d8c2eff35d17ebc1599065e63d0dd5"
+ "frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx": "69cfe5813ada84cf2e0187dacdb77acec072aff328ea978ef90821b43cd09edf"
},
"routes": [
- "/docker/overview",
- "/standalone/availability"
+ "/alerts?tab=thresholds"
],
"viewports": [
{
- "width": 1440,
- "height": 900
+ "width": 1280,
+ "height": 800
},
{
- "width": 390,
- "height": 844
+ "width": 768,
+ "height": 1024
},
{
- "width": 320,
- "height": 844
+ "width": 375,
+ "height": 812
}
],
"states": [
- "Docker host and container summary rows both expose five readable fields in 37-pixel single-line rows at 320 pixels",
- "The all-running Docker container state still retains a stable five-field narrow projection instead of collapsing to four columns",
- "Standalone availability checks expose five readable fields in 37-pixel single-line rows at 320 and 390 pixels",
- "Docker Overview and standalone availability retain their full desktop column sets without table-shell overflow"
+ "Proxmox tab, Virtualization Hosts group expanded, card layout active at all three viewports against the mock dataset (the nodes section needs a 1216px table, so a 1280px window still renders cards, matching the browser-zoom report in #1738)",
+ "Global Defaults card renders the new Offline alerts tile with the On/Off badge next to the CPU, memory, disk and temp tiles",
+ "Each node card renders the new Offline row with the Enabled/Disabled badge",
+ "Guest cards in VMs & Containers render the tri-state Offline button (Warn label, warning-severity title)"
],
"interactions": [
- "expanded a standalone availability row by its visible disclosure and confirmed the inline full-value resource detail appeared",
- "measured both corrected routes at 320, 390, and 1440 pixels and confirmed their table shells remained within their containers"
+ "Clicked a node card Offline badge: Enabled -> Disabled staged an override and raised the Save Changes bar, second click reverted to Enabled via the remove-override path",
+ "Clicked a guest card tri-state Offline button three times: Warn -> Crit -> Off -> Warn, returning to the starting state",
+ "Reloaded without saving and confirmed the badges returned to their persisted states, so no test edits were persisted"
]
}
diff --git a/frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx b/frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx
index b3c4e0200e..6731040e2b 100644
--- a/frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx
+++ b/frontend-modern/src/components/Alerts/AlertResourceTableMobile.tsx
@@ -17,6 +17,8 @@ import {
getAlertResourceTableEmptyState,
getAlertResourceTableMetricOffToggleProps,
getAlertResourceTableMetricPlaceholder,
+ getAlertResourceTableOfflineStateOrder,
+ getAlertResourceTableOfflineStatePresentation,
getAlertResourceTableRevertToDefaultsLabel,
} from '@/utils/alertResourceTablePresentation';
import {
@@ -34,7 +36,7 @@ import {
resolveAlertResourceMetricEnableValue,
} from './alertResourceTableModel';
import type { Resource } from '@/features/alerts/thresholds/tableTypes';
-import type { ResourceTableProps } from './ResourceTable';
+import type { OfflineState, ResourceTableProps } from './ResourceTable';
interface AlertResourceTableMobileProps {
table: ResourceTableProps;
@@ -77,6 +79,35 @@ export function AlertResourceTableMobile(props: AlertResourceTableMobileProps) {
props.setActiveMetricInput(null);
};
+ const nextOfflineState = (state: OfflineState): OfflineState => {
+ const order = getAlertResourceTableOfflineStateOrder();
+ const idx = order.indexOf(state);
+ return order[(idx + 1) % order.length];
+ };
+
+ const renderOfflineStateButton = (
+ state: OfflineState,
+ disabled: boolean,
+ onToggle: () => void,
+ ) => {
+ const config = getAlertResourceTableOfflineStatePresentation(state);
+
+ return (
+ <button
+ type="button"
+ class={`inline-flex min-h-11 items-center justify-center px-2 py-0.5 text-xs font-medium rounded transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-1 sm:min-h-0 ${config.className} ${disabled ? 'opacity-60 cursor-not-allowed pointer-events-none' : ''}`.trim()}
+ disabled={disabled}
+ onClick={() => {
+ if (disabled) return;
+ onToggle();
+ }}
+ title={config.title}
+ >
+ {config.label}
+ </button>
+ );
+ };
+
const MetricValueWithHeat = (metricProps: {
resourceId: string;
metric: string;
@@ -226,6 +257,54 @@ export function AlertResourceTableMobile(props: AlertResourceTableMobileProps) {
);
}}
</For>
+ <Show when={props.table.showOfflineAlertsColumn}>
+ <div class="p-2 bg-surface rounded border border-border-subtle flex flex-col gap-1">
+ <span class="text-[10px] uppercase text-slate-500 font-medium">Offline alerts</span>
+ <div class="flex items-center min-h-11 sm:min-h-0">
+ <Show
+ when={props.table.onSetGlobalOfflineState}
+ fallback={
+ <Show
+ when={props.table.onToggleGlobalDisableOffline}
+ fallback={
+ <span class="text-sm text-slate-400" aria-hidden="true">
+ -
+ </span>
+ }
+ >
+ <StatusBadge
+ isEnabled={!(props.table.globalDisableOfflineFlag?.() ?? false)}
+ onToggle={() => {
+ props.table.onToggleGlobalDisableOffline?.();
+ props.table.setHasUnsavedChanges?.(true);
+ }}
+ labelEnabled="On"
+ labelDisabled="Off"
+ titleEnabled="Offline alerts currently enabled by default. Click to disable."
+ titleDisabled="Offline alerts currently disabled by default. Click to enable."
+ />
+ </Show>
+ }
+ >
+ {(() => {
+ const disabledGlobally = props.table.globalDisableFlag?.() ?? false;
+ const defaultDisabled = props.table.globalDisableOfflineFlag?.() ?? false;
+ const defaultSeverity = props.table.globalOfflineSeverity ?? 'warning';
+ const state: OfflineState = defaultDisabled
+ ? 'off'
+ : defaultSeverity === 'critical'
+ ? 'critical'
+ : 'warning';
+
+ return renderOfflineStateButton(state, disabledGlobally, () => {
+ if (disabledGlobally) return;
+ props.table.onSetGlobalOfflineState?.(nextOfflineState(state));
+ });
+ })()}
+ </Show>
+ </div>
+ </div>
+ </Show>
</div>
</Card>
</Show>
@@ -489,6 +568,70 @@ export function AlertResourceTableMobile(props: AlertResourceTableMobileProps) {
);
}}
</For>
+ <Show when={props.table.showOfflineAlertsColumn}>
+ {(() => {
+ const supportsTriState =
+ typeof props.table.onSetOfflineState === 'function' &&
+ (resource.type === 'guest' || resource.type === 'dockerContainer');
+ if (!supportsTriState && !props.table.onToggleNodeConnectivity) {
+ return null;
+ }
+ const disabledGlobally = () => props.table.globalDisableFlag?.() ?? false;
+
+ return (
+ <div class="flex justify-between items-center p-1.5 bg-surface-alt rounded">
+ <span class="text-[10px] uppercase font-bold tracking-wider">
+ Offline
+ </span>
+ <Show
+ when={supportsTriState}
+ fallback={
+ <StatusBadge
+ isEnabled={
+ !(props.table.globalDisableOfflineFlag?.() ?? false) &&
+ !resource.disableConnectivity
+ }
+ disabled={disabledGlobally()}
+ onToggle={() => {
+ if (disabledGlobally()) return;
+ props.table.onToggleNodeConnectivity?.(resource.id);
+ }}
+ titleEnabled="Offline alerts enabled. Click to disable for this resource."
+ titleDisabled="Offline alerts disabled. Click to enable for this resource."
+ titleWhenDisabled="Offline alerts controlled globally"
+ />
+ }
+ >
+ {(() => {
+ const defaultDisabled =
+ props.table.globalDisableOfflineFlag?.() ?? false;
+ const defaultSeverity =
+ props.table.globalOfflineSeverity ?? 'warning';
+
+ let state: OfflineState;
+ if (resource.disableConnectivity) {
+ state = 'off';
+ } else if (resource.poweredOffSeverity) {
+ state = resource.poweredOffSeverity;
+ } else if (defaultDisabled) {
+ state = 'off';
+ } else {
+ state = defaultSeverity === 'critical' ? 'critical' : 'warning';
+ }
+
+ return renderOfflineStateButton(state, disabledGlobally(), () => {
+ if (disabledGlobally()) return;
+ props.table.onSetOfflineState?.(
+ resource.id,
+ nextOfflineState(state),
+ );
+ });
+ })()}
+ </Show>
+ </div>
+ );
+ })()}
+ </Show>
</div>
</Card>
);