<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } require_once DASHBOARD_ROOT."/core/fleet_orchestrator.php"; $nodes = FleetOrchestrator::getNodes(); echo "<div class=\"fleet-map\"><h3>Fleet Status</h3><div class=\"node-grid\">"; foreach ($nodes as $n) { $statusCls = $n["status"] === "online" ? "node-online" : "node-offline"; $hb = $n["last_heartbeat"] ?? "Never"; $cpu = number_format((float)($n["cpu_usage_pct"] ?? 0), 1); $mem = number_format((float)($n["mem_usage_pct"] ?? 0), 1); $disk = number_format((float)($n["disk_usage_pct"] ?? 0), 1); echo "<div class=\"node-card {$statusCls}\" data-id=\"{$n["id"]}\">"; echo "<h4>".UI::e($n["node_id"])."</h4>"; echo "<p>Role: ".UI::e($n["node_role"])."</p>"; echo "<p>WG: ".UI::e($n["wg_ip"] ?? "")."</p>"; echo "<p>Status: ".UI::badge($n["status"], $n["status"] === "online" ? "success" : "danger")."</p>"; echo "<p>CPU: {$cpu}% | Mem: {$mem}% | Disk: {$disk}%</p>"; echo "<p>Last HB: ".UI::e($hb)."</p>"; echo "<button data-action=\"openTerminal\" data-id=\"{$n["id"]}\">Terminal</button>"; echo "</div>"; } echo "</div></div>"; 