// Fleet Dashboard — Views (Acme Bank branding, fully light) /* ============================== Shared helpers ============================== */ const panelBase = { background: '#FFFFFF', border: `1px solid ${FC.chromeBorder}`, borderRadius: 12, boxShadow: '0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04)', pointerEvents: 'auto', }; function SpecRow({ label, value, color, mono }) { return (
{label}
{value}
); } function Divider() { return
; } /* ============================== 1. PLACEMENT VIEW ============================== */ function PlacementView({ clusters = CLUSTERS, placement = PLACEMENT, fleetHub = FLEET_HUB }) { const boundList = placement.boundClusters || [placement.boundCluster]; const boundNames = boundList .map(id => clusters.find(c => c.id === id)?.name).filter(Boolean).join('\n'); const rejectedNames = placement.rejectedClusters .map(id => clusters.find(c => c.id === id)?.name).filter(Boolean).join('\n'); return (
{/* Map takes most of the space */}
{/* Regulatory banner (floating, bottom) */}
🛡
EU PSD2 Data Residency Payment workloads with PII must remain on EU-labeled clusters
{/* Spec sidebar */}
); } /* ============================== 2. OVERVIEW VIEW ============================== */ function StatCard({ label, value, accent, sub }) { return (
{label}
{value} {sub && ( {sub} )}
); } function OverviewView({ clusters = CLUSTERS, fleetStats = FLEET_STATS, activityFeed = ACTIVITY_FEED, fleetHub = FLEET_HUB }) { return (
{/* Stats bar */}
{/* Map + floating activity panel */}
{/* Activity panel */}
Recent Activity
{activityFeed.map((item, i) => (
{item.icon} {item.text} {item.time}
))}
); } /* ============================== 3. UPGRADE RUN VIEW ============================== */ function UpgradeView({ clusters = CLUSTERS, upgrade = UPGRADE, fleetHub = FLEET_HUB }) { const [approved, setApproved] = React.useState(false); const [approving, setApproving] = React.useState(false); function handleApprove() { setApproving(true); setTimeout(() => { setApproved(true); setApproving(false); }, 1200); } const displayUpgrade = approved ? { ...upgrade, stages: upgrade.stages.map(s => s.id === 2 ? { ...s, status: 'in-progress' } : s) } : upgrade; return (
{/* Upgrade header bar */}
Upgrade {upgrade.fromVersion} {upgrade.toVersion}
Strategy {upgrade.strategy}
Initiated {new Date(upgrade.startedAt).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })} UTC
{/* Map + approval panel */}
{/* Approval CTA */}
{!approved ? ( <> ) : (
Stage 2 approved — upgrade in progress on acme-aks-eu
)}
); } Object.assign(window, { PlacementView, OverviewView, UpgradeView });