2025-12-10 21:15:04 -05:00

286 lines
6.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Strandcast Monitor</title>
<style>
/* --- RESET & BASICS --- */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
/* Unified Font Stack */
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
background: #0a0a0a;
color: #eee;
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* --- NAVIGATION BAR --- */
.navbar {
background-color: #111;
border-bottom: 1px solid #333;
padding: 15px 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.navbar .brand {
color: #00d2ff;
font-size: 18px;
font-weight: bold;
text-decoration: none;
}
.nav-links a {
color: #888;
text-decoration: none;
margin-left: 20px;
font-size: 14px;
padding: 5px;
}
.nav-links a:hover {
color: #fff;
}
.nav-links a.active {
color: #fff;
font-weight: bold;
border-bottom: 2px solid #00d2ff;
}
/* --- DASHBOARD --- */
h1 {
text-align: center;
margin: 20px 0;
font-weight: 300;
font-size: 24px;
/* Matched to index.html */
}
#dashboard {
padding: 10px 20px;
flex: 1;
overflow-x: hidden;
width: 100%;
max-width: 1200px;
margin: 0 auto;
}
.stream-container {
/* Matched to .card in index.html */
background: #161616;
border: 1px solid #333;
border-radius: 12px;
padding: 20px;
margin-bottom: 20px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
.stream-title {
color: #00d2ff;
font-size: 14px;
margin-bottom: 15px;
font-weight: bold;
text-transform: uppercase;
letter-spacing: 1px;
border-bottom: 1px solid #333;
padding-bottom: 8px;
}
/* The scrolling wrapper */
.chain-wrapper {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
padding-bottom: 10px;
}
.chain-visual {
display: flex;
align-items: stretch;
gap: 14px;
flex-wrap: wrap;
width: 100%;
}
/* Node wrapper: arrow + card */
.node-wrapper {
display: flex;
align-items: stretch;
gap: 10px;
padding: 0;
min-width: 210px;
max-width: 240px;
background: transparent;
border: none;
box-shadow: none;
}
.node-row {
display: flex;
align-items: center;
gap: 10px;
height: 100%;
}
.node-card {
display: grid;
grid-template-rows: auto 1fr;
gap: 8px;
background: #0f0f0f;
border: 1px solid #222;
border-radius: 10px;
padding: 10px;
flex: 1;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
justify-items: center;
}
/* The Nodes */
.node {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 86px;
height: 64px;
border-radius: 8px;
background: #222;
border: 1px solid #444;
position: relative;
transition: all 0.2s;
}
.node-id {
font-size: 11px;
font-weight: bold;
margin-bottom: 4px;
color: #fff;
}
.node-score {
font-size: 16px;
font-weight: bold;
}
.node-role {
font-size: 9px;
color: #888;
text-transform: uppercase;
margin-top: 4px;
letter-spacing: 0.5px;
}
.node-metrics {
font-size: 11px;
color: #ccc;
line-height: 1.4;
background: #111;
border: 1px solid #222;
border-radius: 8px;
padding: 6px 8px;
}
.metrics-grid {
display: grid;
grid-template-columns: 1fr;
gap: 12px;
}
.metric-row {
display: flex;
justify-content: space-between;
gap: 12px;
}
.metric-label {
color: #888;
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.metric-value {
color: #e5e5e5;
font-size: 12px;
text-align: right;
font-variant-numeric: tabular-nums;
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 2px;
}
/* Health Colors */
.healthy {
border-color: #00ff88;
color: #00ff88;
box-shadow: 0 0 10px rgba(0, 255, 136, 0.05);
}
.meh {
border-color: #ffaa00;
color: #ffaa00;
}
.weak {
border-color: #ff3333;
color: #ff3333;
}
/* Arrows */
.arrow {
font-size: 16px;
color: #555;
align-self: center;
}
/* --- MOBILE MEDIA QUERY --- */
@media (max-width: 600px) {
.navbar {
flex-direction: column;
padding: 10px;
}
.navbar .brand {
margin-bottom: 10px;
}
.nav-links a {
margin: 0 10px;
}
#dashboard {
padding: 10px;
}
h1 {
font-size: 20px;
}
}
</style>
</head>
<body>
<nav class="navbar">
<a href="/" class="brand">Strandcast</a>
<div class="nav-links">
<a href="/">Streams</a>
<a href="/monitor.html" class="active">Monitor</a>
</div>
</nav>
<h1>Network Status</h1>
<div id="dashboard" style="text-align: center; color: #555">Connecting...</div>
<script src="/socket.io/socket.io.js"></script>
<script src="monitor.js"></script>
</body>
</html>