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 { isConnectedHealthStatus } from '@/utils/status';
export type UnifiedAgentMonitoringState = 'active' | 'removed';
export interface UnifiedAgentStatusPresentation {
badgeClass: string;
label: string;
}
export interface UnifiedAgentLookupStatusPresentation {
badgeClass: string;
label: string;
}
export const MONITORING_STOPPED_STATUS_LABEL = 'Monitoring stopped';
export function getUnifiedAgentStatusPresentation(
state: UnifiedAgentMonitoringState,
healthStatus?: string | null,
): UnifiedAgentStatusPresentation {
if (state === 'removed') {
return {
badgeClass: 'bg-amber-100 text-amber-800 dark:bg-amber-900/25 dark:text-amber-200',
label: MONITORING_STOPPED_STATUS_LABEL,
};
}
if (isConnectedHealthStatus(healthStatus)) {
return {
badgeClass: 'bg-green-100 text-green-800 dark:bg-green-900/25 dark:text-green-300',
label: healthStatus || 'unknown',
};
}
return {
badgeClass: 'bg-surface-alt text-base-content',
label: healthStatus || 'unknown',
};
}
export function getUnifiedAgentLookupStatusPresentation(
connected: boolean,
): UnifiedAgentLookupStatusPresentation {
if (connected) {
return {
badgeClass: 'bg-green-100 text-green-700 dark:bg-green-900/25 dark:text-green-300',
label: 'Connected',
};
}
return {
badgeClass: 'bg-amber-100 text-amber-800 dark:bg-amber-900/25 dark:text-amber-200',
label: 'Not reporting yet',
};
}