v2: live console (SSE+fast-poll), scheduled tasks, tag-group commands, CPU sparklines, dead-node alerts

This commit is contained in:
hermes
2026-09-23 19:40:36 +00:00
parent e3e5865419
commit 33dd524196
21 changed files with 9291 additions and 12 deletions

View File

@@ -13,6 +13,7 @@
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="styles_v2.css">
</head>
<body>
@@ -31,7 +32,7 @@
<div class="nav-metrics">
<div class="metric-pill">
<span class="pill-label">Server Endpoint:</span>
<span class="pill-value highlight-endpoint" id="navServerEndpoint">http://10.30.20.44:3000</span>
<span class="pill-value highlight-endpoint" id="navServerEndpoint">https://agent.thetempleofdoom.com</span>
</div>
<div class="metric-pill">
<span class="status-indicator online"></span>
@@ -53,6 +54,12 @@
<button class="btn btn-secondary" onclick="openBulkModal()">
<i class="fa-solid fa-layer-group"></i> Bulk Task
</button>
<button class="btn btn-secondary" onclick="openGroupCommandModal()">
<i class="fa-solid fa-tags"></i> Group Command
</button>
<button class="btn btn-secondary" onclick="openSchedulesModal()">
<i class="fa-solid fa-clock-rotate-left"></i> Schedules
</button>
<button class="btn btn-primary" onclick="openInstallerModal()">
<i class="fa-solid fa-plus"></i> Add Computer
</button>
@@ -244,7 +251,7 @@
<div class="tab-content active" id="tab-universal">
<p class="tab-description" style="color: var(--accent-emerald);"><strong>Recommended:</strong> Auto-detects OS and runs the correct installer. Single command, any platform, fully silent.</p>
<div class="code-block">
<code id="codeUniversal">curl -sSL <span class="server-url-placeholder">http://10.30.20.44:3000</span>/install | bash</code>
<code id="codeUniversal">curl -sSL <span class="server-url-placeholder">https://agent.thetempleofdoom.com</span>/install | bash</code>
<button class="btn-copy" onclick="copyCode('codeUniversal', this)"><i class="fa-regular fa-copy"></i> Copy</button>
</div>
</div>
@@ -252,11 +259,11 @@
<div class="tab-content" id="tab-binary">
<p class="tab-description">Compiled standalone binary executable (no Python installation required on target system).</p>
<div class="code-block">
<code id="codeBinary">curl -sSL <span class="server-url-placeholder">http://10.30.20.44:3000</span>/bin/NexusAgent -o NexusAgent && chmod +x NexusAgent && ./NexusAgent --server <span class="server-url-placeholder">http://10.30.20.44:3000</span></code>
<code id="codeBinary">curl -sSL <span class="server-url-placeholder">https://agent.thetempleofdoom.com</span>/bin/NexusAgent -o NexusAgent && chmod +x NexusAgent && ./NexusAgent --server <span class="server-url-placeholder">https://agent.thetempleofdoom.com</span></code>
<button class="btn-copy" onclick="copyCode('codeBinary', this)"><i class="fa-regular fa-copy"></i> Copy</button>
</div>
<div style="margin-top: 0.75rem;">
<a id="binaryDownloadLink" href="http://10.30.20.44:3000/bin/NexusAgent" download="NexusAgent" class="btn btn-secondary" style="text-decoration: none;">
<a id="binaryDownloadLink" href="https://agent.thetempleofdoom.com/bin/NexusAgent" download="NexusAgent" class="btn btn-secondary" style="text-decoration: none;">
<i class="fa-solid fa-file-arrow-down"></i> Direct Download Compiled Executable (NexusAgent)
</a>
</div>
@@ -265,7 +272,7 @@
<div class="tab-content" id="tab-linux">
<p class="tab-description">Executes automated installer, configures systemd service, and starts background heartbeat daemon.</p>
<div class="code-block">
<code id="codeLinux">curl -sSL <span class="server-url-placeholder">http://10.30.20.44:3000</span>/install.sh | sudo bash</code>
<code id="codeLinux">curl -sSL <span class="server-url-placeholder">https://agent.thetempleofdoom.com</span>/install.sh | sudo bash</code>
<button class="btn-copy" onclick="copyCode('codeLinux', this)"><i class="fa-regular fa-copy"></i> Copy</button>
</div>
</div>
@@ -273,7 +280,7 @@
<div class="tab-content" id="tab-windows">
<p class="tab-description">Downloads Python agent to ProgramData and launches background monitoring process.</p>
<div class="code-block">
<code id="codeWindows">iwr -useb <span class="server-url-placeholder">http://10.30.20.44:3000</span>/install.ps1 | iex</code>
<code id="codeWindows">iwr -useb <span class="server-url-placeholder">https://agent.thetempleofdoom.com</span>/install.ps1 | iex</code>
<button class="btn-copy" onclick="copyCode('codeWindows', this)"><i class="fa-regular fa-copy"></i> Copy</button>
</div>
</div>
@@ -281,7 +288,7 @@
<div class="tab-content" id="tab-mac">
<p class="tab-description">Installs agent as a launchd background daemon with KeepAlive enabled. Auto-starts on login.</p>
<div class="code-block">
<code id="codeMac">curl -sSL <span class="server-url-placeholder">http://10.30.20.44:3000</span>/install-mac.sh | bash</code>
<code id="codeMac">curl -sSL <span class="server-url-placeholder">https://agent.thetempleofdoom.com</span>/install-mac.sh | bash</code>
<button class="btn-copy" onclick="copyCode('codeMac', this)"><i class="fa-regular fa-copy"></i> Copy</button>
</div>
</div>
@@ -289,7 +296,7 @@
<div class="tab-content" id="tab-manual">
<p class="tab-description">Download and run directly using standard Python 3 (No external dependencies required).</p>
<div class="code-block">
<code id="codeManual">curl -sSL <span class="server-url-placeholder">http://10.30.20.44:3000</span>/agent.py -o agent.py && python3 agent.py --server <span class="server-url-placeholder">http://10.30.20.44:3000</span></code>
<code id="codeManual">curl -sSL <span class="server-url-placeholder">https://agent.thetempleofdoom.com</span>/agent.py -o agent.py && python3 agent.py --server <span class="server-url-placeholder">https://agent.thetempleofdoom.com</span></code>
<button class="btn-copy" onclick="copyCode('codeManual', this)"><i class="fa-regular fa-copy"></i> Copy</button>
</div>
</div>
@@ -297,7 +304,7 @@
<div class="modal-info-box">
<i class="fa-solid fa-circle-info"></i>
<div>
<strong>Server Endpoint Pre-configured:</strong> All installers link to <span class="server-url-placeholder">http://10.30.20.44:3000</span>.
<strong>Server Endpoint Pre-configured:</strong> All installers link to <span class="server-url-placeholder">https://agent.thetempleofdoom.com</span>.
</div>
</div>
</div>
@@ -519,7 +526,22 @@
</div>
<div style="text-align:center;padding:1.5rem;margin-top:2rem;border-top:1px solid rgba(148,163,184,0.1)"><a href="https://buymeacoffee.com/r26xrthzttg" target="_blank" rel="noopener" style="display:inline-flex;align-items:center;gap:0.5rem;background:linear-gradient(135deg,#FF813F,#FF5E0E);color:#fff;padding:0.5rem 1.2rem;border-radius:30px;text-decoration:none;font-weight:600;font-size:0.82rem;transition:all 0.2s;box-shadow:0 4px 15px rgba(255,94,14,0.3)"><span style="font-size:1.1rem">☕</span> Support This Project — Buy Me a Coffee</a></div>
<!-- Alerts panel + v2 modals/drawer -->
<section class="logs-section">
<div class="section-header">
<h3><i class="fa-solid fa-bell"></i> Node Alerts</h3>
<span class="badge" id="alertCount">0</span>
</div>
<div class="terminal-window" style="height: 180px;">
<div class="terminal-body" id="alertsFeed">
<div class="log-entry system">No alerts. All nodes checking in.</div>
</div>
</div>
</section>
<script src="app.js"></script>
<script src="app_v2.js"></script>
<!-- Toast stack -->
<div id="toastStack" class="toast-stack"></div>
@@ -542,3 +564,74 @@
</div>
</body>
</html>
<!-- ═══ NexusOps v2 UI markup ═══ -->
<!-- Live Console Drawer -->
<div id="consoleDrawer">
<div class="console-drawer-header">
<div class="title-with-icon">
<i class="fa-solid fa-terminal icon-accent"></i>
<div>
<h2>Live Console: <span id="consoleDrawerHostname">Node</span></h2>
<p>Fast-poll active — commands run within ~1s</p>
</div>
</div>
<button class="modal-close" onclick="closeLiveConsole()"><i class="fa-solid fa-xmark"></i></button>
</div>
<div id="consoleOutput" class="console-output"></div>
<div class="console-input-row">
<input type="text" id="consoleInput" class="form-input" placeholder="Type a command and press Enter…" onkeydown="if(event.key==='Enter') consoleRunCommand()">
<button class="btn btn-primary" onclick="consoleRunCommand()"><i class="fa-solid fa-paper-plane"></i> Run</button>
</div>
</div>
<!-- Schedules Modal -->
<div class="modal-overlay" id="schedulesModal">
<div class="modal-card" style="max-width: 640px;">
<div class="modal-header">
<div class="title-with-icon">
<i class="fa-solid fa-clock-rotate-left icon-accent"></i>
<div>
<h2>Scheduled Tasks</h2>
<p>Recurring commands across node groups.</p>
</div>
</div>
<button class="modal-close" onclick="closeSchedulesModal()"><i class="fa-solid fa-xmark"></i></button>
</div>
<div class="modal-body">
<div id="schedulesList" style="margin-bottom:1rem;"></div>
<div class="form-group"><label>Name (optional)</label><input type="text" id="schedName" class="form-input" placeholder="e.g. hourly disk check"></div>
<div class="form-group"><label>Command</label><input type="text" id="schedCommand" class="form-input" placeholder="e.g. df -h"></div>
<div class="form-group"><label>Interval (seconds, min 15)</label><input type="number" id="schedInterval" class="form-input" value="300" min="15"></div>
<div class="form-group"><label>Target group</label><select id="schedTag" class="form-input"><option value="all">All nodes</option></select></div>
</div>
<div class="modal-actions">
<button class="btn btn-secondary" onclick="closeSchedulesModal()">Close</button>
<button class="btn btn-primary" onclick="createSchedule()"><i class="fa-solid fa-plus"></i> Create Schedule</button>
</div>
</div>
</div>
<!-- Group Command Modal -->
<div class="modal-overlay" id="groupCmdModal">
<div class="modal-card" style="max-width: 560px;">
<div class="modal-header">
<div class="title-with-icon">
<i class="fa-solid fa-layer-group icon-accent"></i>
<div>
<h2>Group Command</h2>
<p>Run a command on one tag group instead of the whole fleet.</p>
</div>
</div>
<button class="modal-close" onclick="closeGroupCommandModal()"><i class="fa-solid fa-xmark"></i></button>
</div>
<div class="modal-body">
<div class="form-group"><label>Target group</label><select id="groupCmdTag" class="form-input"><option value="all">All nodes</option></select></div>
<div class="form-group"><label>Command</label><input type="text" id="groupCmdInput" class="form-input" placeholder="e.g. uptime" onkeydown="if(event.key==='Enter') submitGroupCommand()"></div>
</div>
<div class="modal-actions">
<button class="btn btn-secondary" onclick="closeGroupCommandModal()">Cancel</button>
<button class="btn btn-primary" onclick="submitGroupCommand()"><i class="fa-solid fa-bolt"></i> Run on Group</button>
</div>
</div>
</div>