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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
import type { JSX } from 'solid-js';
export const SUMMARY_ROW_ACTION_BUTTON_FOCUS_CLASS =
'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sky-400/70';
const isFinePointerEvent = (event: PointerEvent): boolean => {
const pointerType = typeof event.pointerType === 'string' ? event.pointerType : '';
if (pointerType === 'mouse' || pointerType === 'pen') {
return true;
}
if (pointerType === 'touch') {
return false;
}
if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
return window.matchMedia('(pointer: fine)').matches;
}
return true;
};
interface SummaryInteractiveRowPreviewOptions {
onPreview?: () => void;
onPreviewClear?: () => void;
}
interface SummaryInteractiveRowPreviewHandlers {
onFocusIn: JSX.EventHandler<HTMLElement, FocusEvent>;
onFocusOut: JSX.EventHandler<HTMLElement, FocusEvent>;
onPointerEnter: JSX.EventHandler<HTMLElement, PointerEvent>;
onPointerLeave: JSX.EventHandler<HTMLElement, PointerEvent>;
}
export const createSummaryInteractiveRowPreviewHandlers = (
options: SummaryInteractiveRowPreviewOptions,
): SummaryInteractiveRowPreviewHandlers => ({
onPointerEnter: (event) => {
if (isFinePointerEvent(event)) {
options.onPreview?.();
}
},
onPointerLeave: (event) => {
if (isFinePointerEvent(event)) {
options.onPreviewClear?.();
}
},
onFocusIn: () => {
options.onPreview?.();
},
onFocusOut: (event) => {
const nextTarget = event.relatedTarget;
if (nextTarget instanceof Node && event.currentTarget.contains(nextTarget)) {
return;
}
options.onPreviewClear?.();
},
});
interface SummaryInteractiveActionKeydownOptions {
onAction?: () => void;
onPreviewClear?: () => void;
}
export const createSummaryInteractiveActionKeydownHandler =
(
options: SummaryInteractiveActionKeydownOptions,
): JSX.EventHandler<HTMLButtonElement, KeyboardEvent> =>
(event) => {
if (
event.key === 'Enter' ||
event.key === ' ' ||
event.key === 'Space' ||
event.code === 'Space'
) {
event.preventDefault();
options.onAction?.();
return;
}
if (event.key !== 'Escape') {
return;
}
event.preventDefault();
options.onPreviewClear?.();
event.currentTarget.blur();
};
export const buildSummaryDisclosureControlsId = (seriesId: string): string =>
`summary-row-detail-${seriesId.replace(/[^a-zA-Z0-9_-]+/g, '-')}`;