mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
feat: add DO server (web host) monitoring block to JARVIS Server panel
- /api/do now includes do_server key with jarvis-do agent metrics (CPU, RAM, disk, uptime from Tailscale-connected DO server agent) - Front page JARVIS SERVER panel has WEB HOST section with live CPU/RAM/DISK bars from DO server agent data - Panel title updated to show 10.48.200.211 (JARVIS VM IP) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,22 @@ foreach ($rows as $r) {
|
||||
$uptimeDays = intdiv($uptime, 86400);
|
||||
$uptimeHrs = intdiv($uptime % 86400, 3600);
|
||||
|
||||
|
||||
// DO server agent metrics (jarvis-do agent reporting via Tailscale)
|
||||
$doAgent = JarvisDB::query(
|
||||
"SELECT metric_data FROM agent_metrics WHERE agent_id='jarvis-do_orbis' AND metric_type='system' ORDER BY recorded_at DESC LIMIT 1"
|
||||
);
|
||||
$doMet = [];
|
||||
if (!empty($doAgent[0]['metric_data'])) {
|
||||
$dm = json_decode($doAgent[0]['metric_data'], true) ?? [];
|
||||
$doMet = [
|
||||
"cpu" => $dm['cpu_percent'] ?? 0,
|
||||
"mem" => $dm['memory']['percent'] ?? 0,
|
||||
"disk" => (int)($dm['disk'][0]['percent'] ?? 0),
|
||||
"uptime" => $dm['uptime']['human'] ?? "--",
|
||||
"online" => true,
|
||||
];
|
||||
}
|
||||
echo json_encode([
|
||||
"ip" => "10.48.200.211", // JARVIS VM (PVE1)
|
||||
"reachable" => true,
|
||||
@@ -73,5 +89,6 @@ echo json_encode([
|
||||
"uptime" => "{$uptimeDays}d {$uptimeHrs}h",
|
||||
"services" => $svcMap,
|
||||
"sites" => $sites,
|
||||
"do_server" => $doMet,
|
||||
"timestamp" => date("c"),
|
||||
]);
|
||||
|
||||
@@ -550,6 +550,21 @@ function renderDO(d) {
|
||||
</div>`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
// WEB HOST (DO server agent metrics)
|
||||
const ds = d.do_server || {};
|
||||
const doStatus = document.getElementById('do-host-status');
|
||||
const doCpu = document.getElementById('do-cpu');
|
||||
const doMem = document.getElementById('do-mem');
|
||||
const doDisk = document.getElementById('do-disk');
|
||||
if (ds.online) {
|
||||
if (doStatus) { doStatus.textContent = '●'; doStatus.style.color = 'var(--green)'; }
|
||||
if (doCpu) doCpu.textContent = (ds.cpu || 0) + '%';
|
||||
if (doMem) doMem.textContent = (ds.mem || 0) + '%';
|
||||
if (doDisk) doDisk.textContent = (ds.disk || 0) + '%';
|
||||
} else {
|
||||
if (doStatus) { doStatus.textContent = '○'; doStatus.style.color = 'var(--red)'; }
|
||||
}
|
||||
}
|
||||
|
||||
async function loadNetwork() {
|
||||
|
||||
+14
-7
@@ -103,7 +103,7 @@
|
||||
<div id="weather-forecast" style="display:grid;grid-template-columns:repeat(4,1fr);gap:4px"></div>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<div class="panel-title">JARVIS SERVER <span style="font-size:0.5rem;color:var(--text-dim)">165.22.1.228</span><div class="indicator"></div></div>
|
||||
<div class="panel-title">JARVIS SERVER <span style="font-size:0.5rem;color:var(--text-dim)">10.48.200.211</span><div class="indicator"></div></div>
|
||||
|
||||
<!-- Metric bars + sparklines -->
|
||||
<div class="metric-row">
|
||||
@@ -143,6 +143,13 @@
|
||||
<div class="loading-shimmer" style="margin-bottom:4px"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Web Host (DO Server) -->
|
||||
<div style="font-family:var(--font-display);font-size:0.5rem;letter-spacing:2px;color:var(--text-dim);margin:10px 0 5px">WEB HOST <span id="do-host-status" style="color:var(--green)">●</span></div>
|
||||
<div id="do-host-stats" style="display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;font-family:var(--font-mono);font-size:0.62rem">
|
||||
<div><div style="color:var(--text-dim);font-size:0.52rem">CPU</div><div id="do-cpu">--%</div></div>
|
||||
<div><div style="color:var(--text-dim);font-size:0.52rem">RAM</div><div id="do-mem">--%</div></div>
|
||||
<div><div style="color:var(--text-dim);font-size:0.52rem">DISK</div><div id="do-disk">--%</div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CENTER: Arc Reactor + Chat -->
|
||||
@@ -418,12 +425,12 @@
|
||||
style="position:fixed;top:-9999px;left:-9999px;width:320px;height:240px"></video>
|
||||
<script data-cfasync="false" src="https://cdn.jsdelivr.net/npm/face-api.js@0.22.2/dist/face-api.min.js" crossorigin="anonymous"></script>
|
||||
|
||||
<script data-cfasync="false" src="assets/js/jarvis-effects.js?v=20260618a"></script>
|
||||
<script data-cfasync="false" src="assets/js/jarvis-overlays.js?v=20260618a"></script>
|
||||
<script data-cfasync="false" src="assets/js/jarvis-app.js?v=20260618a"></script>
|
||||
<script data-cfasync="false" src="assets/js/panels/jarvis-arc.js?v=20260618a"></script>
|
||||
<script data-cfasync="false" src="assets/js/panels/jarvis-agents.js?v=20260618a"></script>
|
||||
<script data-cfasync="false" src="assets/js/panels/jarvis-assistant.js?v=20260618a"></script>
|
||||
<script data-cfasync="false" src="assets/js/jarvis-effects.js?v=20260618b"></script>
|
||||
<script data-cfasync="false" src="assets/js/jarvis-overlays.js?v=20260618b"></script>
|
||||
<script data-cfasync="false" src="assets/js/jarvis-app.js?v=20260618b"></script>
|
||||
<script data-cfasync="false" src="assets/js/panels/jarvis-arc.js?v=20260618b"></script>
|
||||
<script data-cfasync="false" src="assets/js/panels/jarvis-agents.js?v=20260618b"></script>
|
||||
<script data-cfasync="false" src="assets/js/panels/jarvis-assistant.js?v=20260618b"></script>
|
||||
|
||||
<!-- VISION LIGHTBOX -->
|
||||
<div id="vision-lightbox">
|
||||
|
||||
Reference in New Issue
Block a user