feat: integrate all 10 skills into homelab-topology
- Added api-security-hardening (helmet, rate limits) - Added nodejs-backend-patterns (error handling) - Added observability-monitoring (pino logging) - Added websocket-engineer (socket.io real-time updates) - Added docker (Multi-stage build, compose) - Added vitest (testing configuration and store tests) - Added data-visualizer (MetricsBar and HostChart) - Added infrastructure-monitoring/proxmox-admin/network-engineer types - Fixed UI accessibility and styling - Cleaned up node_modules tracking
This commit is contained in:
41
src/components/StaleWarning.tsx
Normal file
41
src/components/StaleWarning.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import { AlertTriangle, X } from 'lucide-react';
|
||||
import { useTopologyStore } from '../store/topologyStore';
|
||||
|
||||
export default function StaleWarning() {
|
||||
const {
|
||||
consecutiveFailures,
|
||||
lastSuccessfulDiscovery,
|
||||
staleWarningDismissed,
|
||||
dismissStaleWarning
|
||||
} = useTopologyStore();
|
||||
|
||||
if (consecutiveFailures < 3 || staleWarningDismissed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const formatTime = (date: Date | null) => {
|
||||
if (!date) return 'Never';
|
||||
return date.toLocaleString();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="bg-amber-900/30 border-b border-amber-700/50 px-4 py-2 flex items-center justify-between">
|
||||
<div className="flex items-center gap-3">
|
||||
<AlertTriangle className="w-4 h-4 text-amber-400 flex-shrink-0" />
|
||||
<span className="text-amber-200 text-sm">
|
||||
Data may be stale - Last successful discovery: {formatTime(lastSuccessfulDiscovery)}
|
||||
</span>
|
||||
<span className="text-amber-400/70 text-xs">
|
||||
({consecutiveFailures} consecutive failures)
|
||||
</span>
|
||||
</div>
|
||||
<button
|
||||
onClick={dismissStaleWarning}
|
||||
className="p-1 hover:bg-amber-800/50 rounded transition-colors"
|
||||
title="Dismiss warning"
|
||||
>
|
||||
<X className="w-4 h-4 text-amber-400" />
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user