style(iot-admin): переформатирование HTML (форматтер)

This commit is contained in:
Repinoid
2026-10-10 18:38:12 +03:00
parent a510522660
commit 56fadf6ca3
+325 -79
View File
@@ -6,6 +6,7 @@
Раздаётся по GET /iot-admin (go:embed в бинарнике iot-service). Раздаётся по GET /iot-admin (go:embed в бинарнике iot-service).
НЕ для конечных пользователей — только для администратора платформы. --> НЕ для конечных пользователей — только для администратора платформы. -->
<html lang="ru"> <html lang="ru">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -14,145 +15,384 @@
<link rel="icon" href="https://terra.k8c.ru/docs/nubes/nubes/2.0.2/30_registry/assets/favicon.png"> <link rel="icon" href="https://terra.k8c.ru/docs/nubes/nubes/2.0.2/30_registry/assets/favicon.png">
<style> <style>
/* Nubes brand palette — те же цвета что в iot-console.html */ /* Nubes brand palette — те же цвета что в iot-console.html */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } *,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body { body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
background: #001120; color: #e2ecf6; min-height: 100vh; background: #001120;
color: #e2ecf6;
min-height: 100vh;
} }
/* Navbar */ /* Navbar */
.navbar { .navbar {
background: #001C34; border-bottom: 1px solid #0b2d50; background: #001C34;
padding: 0 28px; height: 58px; border-bottom: 1px solid #0b2d50;
display: flex; align-items: center; gap: 14px; padding: 0 28px;
height: 58px;
display: flex;
align-items: center;
gap: 14px;
} }
.navbar-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.navbar-logo img { height: 18px; filter: brightness(0) invert(1); } .navbar-logo {
.navbar-logo-sep { width: 1px; height: 18px; background: #1a4a73; margin: 0 4px; } display: flex;
.navbar-title { font-size: 15px; font-weight: 600; color: #e2ecf6; } align-items: center;
gap: 10px;
text-decoration: none;
}
.navbar-logo img {
height: 18px;
filter: brightness(0) invert(1);
}
.navbar-logo-sep {
width: 1px;
height: 18px;
background: #1a4a73;
margin: 0 4px;
}
.navbar-title {
font-size: 15px;
font-weight: 600;
color: #e2ecf6;
}
.navbar-badge { .navbar-badge {
background: #2d1a00; border: 1px solid #7a3a00; color: #f0a030; background: #2d1a00;
font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 4px; border: 1px solid #7a3a00;
letter-spacing: 0.5px; text-transform: uppercase; color: #f0a030;
font-size: 10px;
font-weight: 700;
padding: 2px 7px;
border-radius: 4px;
letter-spacing: 0.5px;
text-transform: uppercase;
} }
.navbar-spacer { flex: 1; }
.navbar-spacer {
flex: 1;
}
.navbar-refresh { .navbar-refresh {
background: #0f3a60; border: 1px solid #1a5a8a; color: #7fc8f8; background: #0f3a60;
padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid #1a5a8a;
color: #7fc8f8;
padding: 6px 14px;
border-radius: 6px;
font-size: 13px;
cursor: pointer;
transition: background 0.15s; transition: background 0.15s;
} }
.navbar-refresh:hover { background: #1a5080; }
.navbar-refresh:disabled { opacity: 0.4; cursor: not-allowed; } .navbar-refresh:hover {
background: #1a5080;
}
.navbar-refresh:disabled {
opacity: 0.4;
cursor: not-allowed;
}
/* Layout */ /* Layout */
.container { max-width: 1280px; margin: 0 auto; padding: 28px 24px; } .container {
max-width: 1280px;
margin: 0 auto;
padding: 28px 24px;
}
/* Auth box */ /* Auth box */
.auth-box { .auth-box {
background: #001929; border: 1px solid #0b2d50; border-radius: 12px; background: #001929;
padding: 40px; max-width: 480px; margin: 80px auto; border: 1px solid #0b2d50;
display: flex; flex-direction: column; gap: 16px; border-radius: 12px;
padding: 40px;
max-width: 480px;
margin: 80px auto;
display: flex;
flex-direction: column;
gap: 16px;
} }
.auth-box h2 { font-size: 20px; font-weight: 600; color: #7fc8f8; }
.auth-box p { font-size: 13px; color: #6b8eaa; } .auth-box h2 {
font-size: 20px;
font-weight: 600;
color: #7fc8f8;
}
.auth-box p {
font-size: 13px;
color: #6b8eaa;
}
.auth-input { .auth-input {
background: #001120; border: 1px solid #1a4a73; color: #e2ecf6; background: #001120;
padding: 10px 14px; border-radius: 8px; font-size: 14px; font-family: monospace; border: 1px solid #1a4a73;
width: 100%; outline: none; color: #e2ecf6;
padding: 10px 14px;
border-radius: 8px;
font-size: 14px;
font-family: monospace;
width: 100%;
outline: none;
} }
.auth-input:focus { border-color: #1a7fd4; }
.auth-input:focus {
border-color: #1a7fd4;
}
.auth-btn { .auth-btn {
background: #1a7fd4; border: none; color: #fff; background: #1a7fd4;
padding: 10px 20px; border-radius: 8px; font-size: 14px; cursor: pointer; border: none;
font-weight: 600; transition: background 0.15s; color: #fff;
padding: 10px 20px;
border-radius: 8px;
font-size: 14px;
cursor: pointer;
font-weight: 600;
transition: background 0.15s;
}
.auth-btn:hover {
background: #1a6ab8;
}
.auth-error {
color: #f87171;
font-size: 13px;
} }
.auth-btn:hover { background: #1a6ab8; }
.auth-error { color: #f87171; font-size: 13px; }
/* Section header */ /* Section header */
.section-header { .section-header {
display: flex; align-items: center; gap: 10px; display: flex;
margin-bottom: 16px; padding-bottom: 10px; align-items: center;
gap: 10px;
margin-bottom: 16px;
padding-bottom: 10px;
border-bottom: 1px solid #0b2d50; border-bottom: 1px solid #0b2d50;
} }
.section-icon { width: 20px; height: 20px; opacity: 0.7; }
.section-title { font-size: 16px; font-weight: 600; color: #a0c4e8; } .section-icon {
.section { margin-bottom: 32px; } width: 20px;
height: 20px;
opacity: 0.7;
}
.section-title {
font-size: 16px;
font-weight: 600;
color: #a0c4e8;
}
.section {
margin-bottom: 32px;
}
/* Cards grid */ /* Cards grid */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; } .cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 16px;
}
/* Stat card */ /* Stat card */
.card { .card {
background: #001929; border: 1px solid #0b2d50; border-radius: 10px; background: #001929;
border: 1px solid #0b2d50;
border-radius: 10px;
padding: 20px; padding: 20px;
} }
.card-title { font-size: 12px; color: #6b8eaa; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.card-value { font-size: 28px; font-weight: 700; color: #e2ecf6; } .card-title {
.card-sub { font-size: 12px; color: #6b8eaa; margin-top: 4px; } font-size: 12px;
.card-accent { color: #1a7fd4; } color: #6b8eaa;
.card-warn { color: #f59e0b; } text-transform: uppercase;
.card-ok { color: #34d399; } letter-spacing: 0.5px;
.card-err { color: #f87171; } margin-bottom: 8px;
}
.card-value {
font-size: 28px;
font-weight: 700;
color: #e2ecf6;
}
.card-sub {
font-size: 12px;
color: #6b8eaa;
margin-top: 4px;
}
.card-accent {
color: #1a7fd4;
}
.card-warn {
color: #f59e0b;
}
.card-ok {
color: #34d399;
}
.card-err {
color: #f87171;
}
/* Tenant table */ /* Tenant table */
.tenant-table { width: 100%; border-collapse: collapse; font-size: 13px; } .tenant-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.tenant-table th { .tenant-table th {
text-align: left; padding: 8px 12px; color: #6b8eaa; text-align: left;
border-bottom: 1px solid #0b2d50; font-weight: 600; font-size: 11px; padding: 8px 12px;
text-transform: uppercase; letter-spacing: 0.3px; color: #6b8eaa;
border-bottom: 1px solid #0b2d50;
font-weight: 600;
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.3px;
} }
.tenant-table td { padding: 10px 12px; border-bottom: 1px solid #071a28; vertical-align: top; }
.tenant-table tr:last-child td { border-bottom: none; } .tenant-table td {
.tenant-table tr:hover td { background: rgba(26,127,212,0.05); } padding: 10px 12px;
border-bottom: 1px solid #071a28;
vertical-align: top;
}
.tenant-table tr:last-child td {
border-bottom: none;
}
.tenant-table tr:hover td {
background: rgba(26, 127, 212, 0.05);
}
.ns-tag { .ns-tag {
font-family: monospace; font-size: 12px; color: #7fc8f8; font-family: monospace;
background: #0b2d50; padding: 2px 6px; border-radius: 4px; font-size: 12px;
color: #7fc8f8;
background: #0b2d50;
padding: 2px 6px;
border-radius: 4px;
}
.num-big {
font-size: 16px;
font-weight: 600;
color: #e2ecf6;
}
.num-small {
font-size: 12px;
color: #6b8eaa;
} }
.num-big { font-size: 16px; font-weight: 600; color: #e2ecf6; }
.num-small { font-size: 12px; color: #6b8eaa; }
/* Latest msgs mini list */ /* Latest msgs mini list */
.latest-list { display: flex; flex-direction: column; gap: 4px; } .latest-list {
.latest-item { display: flex;
background: #001120; border: 1px solid #0b2d50; border-radius: 6px; flex-direction: column;
padding: 6px 10px; font-size: 11px; gap: 4px;
}
.latest-item {
background: #001120;
border: 1px solid #0b2d50;
border-radius: 6px;
padding: 6px 10px;
font-size: 11px;
}
.latest-dev {
color: #7fc8f8;
font-weight: 600;
}
.latest-ts {
color: #6b8eaa;
margin-left: 6px;
}
.latest-payload {
color: #a0c4e8;
margin-top: 2px;
word-break: break-all;
font-family: monospace;
} }
.latest-dev { color: #7fc8f8; font-weight: 600; }
.latest-ts { color: #6b8eaa; margin-left: 6px; }
.latest-payload { color: #a0c4e8; margin-top: 2px; word-break: break-all; font-family: monospace; }
/* Last updated */ /* Last updated */
.last-updated { font-size: 12px; color: #2d5070; text-align: center; margin-top: 16px; } .last-updated {
font-size: 12px;
color: #2d5070;
text-align: center;
margin-top: 16px;
}
/* Spinner */ /* Spinner */
.spinner { .spinner {
border: 3px solid #0b2d50; border-top-color: #1a7fd4; border: 3px solid #0b2d50;
border-radius: 50%; width: 32px; height: 32px; border-top-color: #1a7fd4;
border-radius: 50%;
width: 32px;
height: 32px;
animation: spin 0.8s linear infinite; animation: spin 0.8s linear infinite;
margin: 60px auto; margin: 60px auto;
} }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin {
to {
transform: rotate(360deg);
}
}
/* Error banner */ /* Error banner */
.error-banner { .error-banner {
background: #1a0000; border: 1px solid #5a0000; color: #f87171; background: #1a0000;
padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 20px; border: 1px solid #5a0000;
color: #f87171;
padding: 12px 16px;
border-radius: 8px;
font-size: 13px;
margin-bottom: 20px;
} }
/* Auto-refresh indicator */ /* Auto-refresh indicator */
.refresh-timer { .refresh-timer {
font-size: 11px; color: #2d5070; display: flex; align-items: center; gap: 6px; font-size: 11px;
color: #2d5070;
display: flex;
align-items: center;
gap: 6px;
} }
.refresh-progress { .refresh-progress {
width: 60px; height: 2px; background: #0b2d50; border-radius: 2px; overflow: hidden; width: 60px;
height: 2px;
background: #0b2d50;
border-radius: 2px;
overflow: hidden;
} }
.refresh-bar { .refresh-bar {
height: 100%; background: #1a7fd4; border-radius: 2px; height: 100%;
background: #1a7fd4;
border-radius: 2px;
transition: width 1s linear; transition: width 1s linear;
} }
</style> </style>
</head> </head>
<body> <body>
<!-- Navbar --> <!-- Navbar -->
@@ -166,7 +406,9 @@
<div class="navbar-spacer"></div> <div class="navbar-spacer"></div>
<div class="refresh-timer" id="refreshTimer" style="display:none"> <div class="refresh-timer" id="refreshTimer" style="display:none">
<span id="refreshCountdown">30</span>s <span id="refreshCountdown">30</span>s
<div class="refresh-progress"><div class="refresh-bar" id="refreshBar" style="width:100%"></div></div> <div class="refresh-progress">
<div class="refresh-bar" id="refreshBar" style="width:100%"></div>
</div>
</div> </div>
<button class="navbar-refresh" id="btnRefresh" onclick="loadStats()" disabled>Обновить</button> <button class="navbar-refresh" id="btnRefresh" onclick="loadStats()" disabled>Обновить</button>
</nav> </nav>
@@ -177,8 +419,7 @@
<div class="auth-box" id="authBox"> <div class="auth-box" id="authBox">
<h2>Доступ для администратора</h2> <h2>Доступ для администратора</h2>
<p>Введите ADMIN_STATS_TOKEN для просмотра статистики IoT pipeline.</p> <p>Введите ADMIN_STATS_TOKEN для просмотра статистики IoT pipeline.</p>
<input class="auth-input" id="tokenInput" type="password" <input class="auth-input" id="tokenInput" type="password" placeholder="Bearer token..." autocomplete="off"
placeholder="Bearer token..." autocomplete="off"
onkeydown="if(event.key==='Enter') doAuth()"> onkeydown="if(event.key==='Enter') doAuth()">
<button class="auth-btn" onclick="doAuth()">Войти</button> <button class="auth-btn" onclick="doAuth()">Войти</button>
<div class="auth-error" id="authError" style="display:none"></div> <div class="auth-error" id="authError" style="display:none"></div>
@@ -198,7 +439,9 @@
<div class="section"> <div class="section">
<div class="section-header"> <div class="section-header">
<svg class="section-icon" viewBox="0 0 24 24" fill="none" stroke="#7fc8f8" stroke-width="2"> <svg class="section-icon" viewBox="0 0 24 24" fill="none" stroke="#7fc8f8" stroke-width="2">
<path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/><path d="M2 12l10 5 10-5"/> <path d="M12 2L2 7l10 5 10-5-10-5z" />
<path d="M2 17l10 5 10-5" />
<path d="M2 12l10 5 10-5" />
</svg> </svg>
<span class="section-title">Очередь shared-SQS</span> <span class="section-title">Очередь shared-SQS</span>
</div> </div>
@@ -209,7 +452,8 @@
<div class="section"> <div class="section">
<div class="section-header"> <div class="section-header">
<svg class="section-icon" viewBox="0 0 24 24" fill="none" stroke="#7fc8f8" stroke-width="2"> <svg class="section-icon" viewBox="0 0 24 24" fill="none" stroke="#7fc8f8" stroke-width="2">
<rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8M12 17v4"/> <rect x="2" y="3" width="20" height="14" rx="2" />
<path d="M8 21h8M12 17v4" />
</svg> </svg>
<span class="section-title">Рантайм</span> <span class="section-title">Рантайм</span>
</div> </div>
@@ -220,7 +464,8 @@
<div class="section"> <div class="section">
<div class="section-header"> <div class="section-header">
<svg class="section-icon" viewBox="0 0 24 24" fill="none" stroke="#7fc8f8" stroke-width="2"> <svg class="section-icon" viewBox="0 0 24 24" fill="none" stroke="#7fc8f8" stroke-width="2">
<ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5"/> <ellipse cx="12" cy="5" rx="9" ry="3" />
<path d="M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" />
<path d="M3 12c0 1.66 4.03 3 9 3s9-1.34 9-3" /> <path d="M3 12c0 1.66 4.03 3 9 3s9-1.34 9-3" />
</svg> </svg>
<span class="section-title">PostgreSQL — Telemetry</span> <span class="section-title">PostgreSQL — Telemetry</span>
@@ -487,4 +732,5 @@ if (adminToken) {
} }
</script> </script>
</body> </body>
</html> </html>