<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } $shieldNode = Database::fetchOne("SELECT * FROM nodes WHERE role_code=5050 LIMIT 1"); $filterNode = Database::fetchOne("SELECT * FROM nodes WHERE role_code=5052 LIMIT 1"); ?> <div id="shield-auth" class="panel"> <span class="section-label">Shield / VPN Authentication Status</span> <div class="detail-grid"> <div><span class="kpi-label">Shield Node</span><span class="kpi-value"><?= $shieldNode ? StatusCode::render((int)$shieldNode['status_code']) : '<span class="badge badge-danger">Not Found</span>' ?> </span></div> <div><span class="kpi-label">Shield IP</span><span><?= UI::e($shieldNode['wg_ip'] ?? 'N/A') ?> </span></div> <div><span class="kpi-label">Last Heartbeat</span><span><?= UI::e($shieldNode['last_heartbeat'] ?? 'Never') ?> </span></div> <div><span class="kpi-label">Filter Node</span><span class="kpi-value"><?= $filterNode ? StatusCode::render((int)$filterNode['status_code']) : '<span class="badge badge-danger">Not Found</span>' ?> </span></div> <div><span class="kpi-label">Filter IP</span><span><?= UI::e($filterNode['wg_ip'] ?? 'N/A') ?> </span></div> <div><span class="kpi-label">WireGuard Tunnel</span><span><?= ($shieldNode && (int)$shieldNode['status_code']===5001) ? '<span class="badge badge-success">Connected</span>' : '<span class="badge badge-danger">Down</span>' ?> </span></div> </div> <div class="form-actions"> <a id="shield-ping" class="btn" href="javascript:void(0)"><span>Ping Shield</span></a> <a id="filter-ping" class="btn" href="javascript:void(0)"><span>Ping Filter</span></a> </div> </div> <script nonce="<?= $cspNonce ?? '' ?> "> ['shield','filter'].forEach(function(t){document.getElementById(t+'-ping').addEventListener('click',function(){ window.dashFetch('verify',{action:'fleet_ping',target:t},function(r){alert(r.ok?t+' responded: '+r.latency+'ms':t+' unreachable');}); });}); </script>