feat: real-time WebSocket metrics broadcaster and UI updates

- New metrics_broadcaster service (410 lines) — background broadcaster
  pushing CPU/RAM/disk/network stats to subscribed WebSocket clients
- WebSocket protocol extended: subscribe/unsubscribe channels,
  get_rrd/get_node_rrd requests with request_id
- main.py: metrics broadcaster started in lifespan, WS message dispatcher
- websocket_manager.py: subscription map support
- templates: dashboard, instance_detail, proxmox_server_detail,
  proxmox_vms, workspaces — real-time charts and UI updates
- auth.py, servers.py, settings.py: minor fixes
This commit is contained in:
markmorado
2026-03-15 02:49:38 +01:00
parent c4778d2972
commit ed7f1f779e
14 changed files with 1203 additions and 167 deletions

View File

@@ -80,6 +80,88 @@
</div>
<style>
/* ── Workspace Modal Overlay ────────────────────────────────── */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.65);
backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);
z-index: 1050;
display: flex;
justify-content: center;
align-items: center;
padding: 1.5rem;
}
.modal-container {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
width: 100%;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
animation: modalIn 0.2s ease;
}
@keyframes modalIn {
from { opacity: 0; transform: scale(0.96) translateY(-8px); }
to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
display: flex !important;
align-items: center !important;
justify-content: space-between !important;
padding: 1.25rem 1.5rem !important;
border-bottom: 1px solid var(--border-color) !important;
background: transparent !important;
}
.modal-header h3 {
margin: 0;
font-size: 1.05rem;
font-weight: 600;
color: var(--text-primary);
}
.modal-body {
padding: 1.5rem !important;
background: transparent !important;
color: var(--text-primary) !important;
}
.modal-footer {
display: flex !important;
justify-content: flex-end !important;
gap: 0.75rem !important;
padding: 1rem 1.5rem !important;
border-top: 1px solid var(--border-color) !important;
background: transparent !important;
}
.modal-close {
background: none;
border: none;
color: var(--text-muted);
font-size: 1.4rem;
line-height: 1;
cursor: pointer;
padding: 2px 6px;
border-radius: var(--radius-sm);
transition: color 0.15s, background 0.15s;
}
.modal-close:hover {
color: var(--text-primary);
background: var(--bg-hover);
}
/* ── Workspace Grid ─────────────────────────────────────────── */
.ws-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));