chore [UKD-346]: фикс детекта ошибок
This commit is contained in:
1 parent
00a6c9d98b
commit
36b46a6083
5 files changed
+681
-7
No files matched your search
@@ -39,6 +39,41 @@ function payload() {
|
|||||||
}
|
}
|
||||||
const flush = () => new Promise(resolve => setImmediate(resolve));
|
const flush = () => new Promise(resolve => setImmediate(resolve));
|
||||||
|
|
||||||
|
test('null response is a data error and preserves previous readings', async () => {
|
||||||
|
let data = null;
|
||||||
|
const ui = setup(async () => ({ ok: true, json: async () => data }));
|
||||||
|
await flush();
|
||||||
|
assert.equal(ui.elements.get('.metrics-panel').dataset.state, 'error');
|
||||||
|
assert.match(ui.elements.get('#metrics-note').textContent, /Некорректные данные/);
|
||||||
|
data = payload();
|
||||||
|
await vm.runInContext('pollMetrics()', ui.context);
|
||||||
|
data = null;
|
||||||
|
await vm.runInContext('pollMetrics()', ui.context);
|
||||||
|
assert.equal(ui.elements.get('.metrics-panel').dataset.state, 'stale');
|
||||||
|
assert.equal(ui.elements.get('#cpu-value').textContent, '15%');
|
||||||
|
assert.match(ui.elements.get('#metrics-note').textContent, /Некорректные данные/);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('invalid JSON is reported as a data error', async () => {
|
||||||
|
const ui = setup(async () => ({ ok: true, json: async () => { throw new SyntaxError('Invalid JSON'); } }));
|
||||||
|
await flush();
|
||||||
|
assert.equal(ui.elements.get('.metrics-panel').dataset.state, 'error');
|
||||||
|
assert.match(ui.elements.get('#metrics-note').textContent, /Некорректные данные/);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('network and body transfer failures are reported as connection errors', async () => {
|
||||||
|
for (const fetch of [
|
||||||
|
async () => { throw new TypeError('Failed to fetch'); },
|
||||||
|
async () => ({ ok: true, json: async () => { throw new TypeError('Connection lost'); } }),
|
||||||
|
async () => ({ ok: true, json: async () => { throw new DOMException('Aborted', 'AbortError'); } }),
|
||||||
|
]) {
|
||||||
|
const ui = setup(fetch);
|
||||||
|
await flush();
|
||||||
|
assert.equal(ui.elements.get('.metrics-panel').dataset.state, 'error');
|
||||||
|
assert.match(ui.elements.get('#metrics-note').textContent, /Нет связи/);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
test('live → stale → recovered preserves the last readings', async () => {
|
test('live → stale → recovered preserves the last readings', async () => {
|
||||||
let online = true;
|
let online = true;
|
||||||
const ui = setup(async () => ({ ok: online, json: async () => online ? payload() : { error: 'metrics_unavailable' } }));
|
const ui = setup(async () => ({ ok: online, json: async () => online ? payload() : { error: 'metrics_unavailable' } }));
|
||||||
|
|||||||
+16
-3
@@ -30,13 +30,26 @@ async function pollMetrics() {
|
|||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
const timeout = setTimeout(() => controller.abort(), 4000);
|
const timeout = setTimeout(() => controller.abort(), 4000);
|
||||||
try {
|
try {
|
||||||
const response = await fetch('/api/metrics', { signal: controller.signal, cache: 'no-store' });
|
let response;
|
||||||
|
try {
|
||||||
|
response = await fetch('/api/metrics', { signal: controller.signal, cache: 'no-store' });
|
||||||
|
} catch {
|
||||||
|
throw new Error('Нет связи со сборщиком метрик.');
|
||||||
|
}
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
let error;
|
let error;
|
||||||
try { error = (await response.json()).error; } catch { /* Static-only hosting may return HTML. */ }
|
try { error = (await response.json()).error; } catch { /* Static-only hosting may return HTML. */ }
|
||||||
throw new Error(error === 'metrics_not_configured' ? 'Сборщик метрик не настроен.' : 'Сборщик метрик недоступен.');
|
throw new Error(error === 'metrics_not_configured' ? 'Сборщик метрик не настроен.' : 'Сборщик метрик недоступен.');
|
||||||
}
|
}
|
||||||
const data = await response.json();
|
let data;
|
||||||
|
try {
|
||||||
|
data = await response.json();
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(error.name === 'SyntaxError' ? 'Некорректные данные метрик.' : 'Нет связи со сборщиком метрик.');
|
||||||
|
}
|
||||||
|
if (data === null || typeof data !== 'object' || Array.isArray(data)) {
|
||||||
|
throw new Error('Некорректные данные метрик.');
|
||||||
|
}
|
||||||
const sample = new Date(data.sampled_at);
|
const sample = new Date(data.sampled_at);
|
||||||
if (!Number.isFinite(sample.getTime()) || Date.now() - sample.getTime() > 20000 || sample.getTime() - Date.now() > 5000) {
|
if (!Number.isFinite(sample.getTime()) || Date.now() - sample.getTime() > 20000 || sample.getTime() - Date.now() > 5000) {
|
||||||
throw new Error('Свежий замер не получен.');
|
throw new Error('Свежий замер не получен.');
|
||||||
@@ -61,7 +74,7 @@ async function pollMetrics() {
|
|||||||
metricsState.textContent = 'Подключено';
|
metricsState.textContent = 'Подключено';
|
||||||
metricsNote.textContent = `Последний замер: ${sample.toLocaleTimeString('ru-RU')}`;
|
metricsNote.textContent = `Последний замер: ${sample.toLocaleTimeString('ru-RU')}`;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showMetricsError(error instanceof TypeError || error.name === 'AbortError' ? 'Нет связи со сборщиком метрик.' : error.message);
|
showMetricsError(error.message);
|
||||||
} finally {
|
} finally {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
polling = false;
|
polling = false;
|
||||||
|
|||||||
+1
-1
@@ -44,7 +44,7 @@
|
|||||||
<div class="metrics-header">
|
<div class="metrics-header">
|
||||||
<div>
|
<div>
|
||||||
<h2 id="metrics-heading">Состояние сервера</h2>
|
<h2 id="metrics-heading">Состояние сервера</h2>
|
||||||
<p>Метрики хоста · обновление каждые 5 секунд</p>
|
<p>Метрики хоста · пауза между запросами — 5 секунд</p>
|
||||||
</div>
|
</div>
|
||||||
<span class="metrics-state" id="metrics-state" role="status"
|
<span class="metrics-state" id="metrics-state" role="status"
|
||||||
>Подключение…</span
|
>Подключение…</span
|
||||||
|
|||||||
+628
-2
@@ -1,3 +1,629 @@
|
|||||||
:root{color-scheme:light;--ink:#243a35;--muted:#697973;--line:#e0e6df;--accent:#32694b;--paper:#fafbf7}*{box-sizing:border-box}html{scroll-behavior:smooth;scroll-padding-top:30px}body{margin:0;background:var(--paper);color:var(--ink);font:15px/1.75 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}a{color:var(--accent);text-underline-offset:4px}aside{position:fixed;inset:0 auto 0 0;width:280px;background:#f0f3ec;border-right:1px solid var(--line);padding:36px 24px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink);font-size:23px;font-weight:750;letter-spacing:1px}.brand>b{display:grid;place-items:center;width:42px;height:44px;background:#244d3b;color:#fff;border-radius:11px;position:relative;font-size:29px}.brand>b span{position:absolute;font-size:16px;right:2px;top:-7px;color:#c6e6a3}.brand div>span{display:block;font-size:8px;letter-spacing:1.7px;color:var(--muted);font-weight:600}.workspace{margin:36px 0 38px;padding:12px 10px;border:1px solid #d8dfd3;border-radius:8px;font-size:11px;background:#f8faf4}.dot{display:inline-block;width:7px;height:7px;margin-right:7px;border-radius:50%;background:#7e8c76}.nav-label{font-size:10px;letter-spacing:1.7px;color:#73816d;margin:0 12px 13px}nav{display:grid;gap:6px;overflow:auto}nav a{padding:10px 12px;text-decoration:none;font-size:13px;border-radius:7px;color:#526158}nav a span{font-size:10px;color:#8a9684;margin-right:13px;font-family:monospace}nav a:hover,nav a[aria-current]{background:#e0e8d8;color:#264c35}.sidebar-footer{margin-top:auto;padding:28px 12px 0;color:#778371;font-size:11px}.sidebar-footer code{font-size:11px;color:#40573e}.file-icon{color:#4d7250}.page{margin-left:280px}header{height:82px;padding:0 54px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;font-size:12px;color:var(--muted)}header strong{font-weight:500;color:var(--ink)}header i{margin:0 14px;color:#a0aca1;font-style:normal}.badge{font-size:9px;letter-spacing:1.4px}.badge span{margin:0 8px}main{max-width:1140px;padding:56px 64px 20px;margin:auto}.eyebrow{color:#608153;font-size:10px;letter-spacing:2px;margin-bottom:25px}.eyebrow>span{display:inline-block;width:22px;height:2px;background:#759859;vertical-align:middle;margin-right:9px}h1{font-size:clamp(34px,4vw,56px);line-height:1.13;font-weight:620;letter-spacing:-2px;max-width:680px;margin:0 0 24px}article>p{font-size:16px;color:var(--muted);max-width:700px;margin-bottom:44px}section{scroll-margin-top:30px;padding:28px 0 24px;border-top:1px solid var(--line)}h2{font-size:26px;line-height:1.3;letter-spacing:-.7px;margin:0 0 22px;font-weight:620}h3{font-size:16px;margin:27px 0 12px;font-weight:650}p{margin:12px 0;color:#53645b}blockquote{margin:24px 0;padding:19px 24px;background:#edf2e5;border-left:3px solid #91a96c;border-radius:0 8px 8px 0;color:#526447;font-size:13px}li{padding:4px 0;color:#53645b}ol,ul{padding-left:23px}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:10px;margin:20px 0;background:#fff}table{border-collapse:collapse;width:100%;font-size:13px;text-align:left}th{background:#f0f3eb;font-size:11px;font-weight:600;color:#637359}th,td{padding:14px 18px;border-bottom:1px solid var(--line);min-width:130px}tr:last-child td{border-bottom:0}td{color:#56635b}td:first-child{font-weight:550;color:#33483c}code{font:12px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace;background:#edf0e8;padding:3px 6px;border-radius:4px;overflow-wrap:anywhere}pre{background:#20362d;color:#dbe8ce;padding:23px;border-radius:10px;overflow:auto}pre code{background:transparent;padding:0;color:inherit;overflow-wrap:normal}footer{border-top:1px solid var(--line);padding:26px 0;display:flex;justify-content:space-between;gap:14px;font-size:10px;color:#7b8779}footer b{margin:0 8px;font-weight:400}input{width:100%;border:0;background:none;font:13px system-ui;color:var(--ink);min-width:0;padding:5px 0}input:focus{outline:0}kbd{font:11px monospace;border:1px solid var(--line);border-radius:4px;padding:0 6px;color:#819076}a:focus-visible,.table-wrap:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.skip{position:fixed;top:-80px;left:20px;z-index:10;padding:10px;background:white}.skip:focus{top:10px}[hidden]{display:none!important}@media(min-width:1400px){main{padding-top:70px}}@media(max-width:1000px){aside{width:235px;padding:28px 16px}.page{margin-left:235px}main{padding:38px 30px}header{padding:0 30px}.badge{display:none}}@media(max-width:700px){aside{position:static;width:auto;padding:22px;display:block;border-right:0;border-bottom:1px solid var(--line)}.brand{font-size:20px}.workspace,.sidebar-footer,.nav-label{display:none}nav{display:flex;overflow:auto;margin-top:22px;gap:6px}nav a{white-space:nowrap;background:#e8ede1;padding:8px 12px}nav a span{display:none}.page{margin-left:0}header{height:57px;padding:0 22px}main{padding:30px 22px 10px}h1{letter-spacing:-1px}h2{font-size:23px}footLine truncated
|
:root {
|
||||||
|
color-scheme:light;
|
||||||
|
--ink:#243a35;
|
||||||
|
--muted:#697973;
|
||||||
|
--line:#e0e6df;
|
||||||
|
--accent:#32694b;
|
||||||
|
--paper:#fafbf7
|
||||||
|
}
|
||||||
|
|
||||||
.metrics-panel{border:1px solid var(--line);border-radius:14px;padding:24px;margin:0 0 32px;background:#f3f6ee}.metrics-header{display:flex;justify-content:space-between;align-items:start;gap:18px;margin-bottom:20px}.metrics-header h2{font-size:22px;margin:0 0 5px}.metrics-header p,.metrics-note{font-size:12px;margin:0;color:var(--muted)}.metrics-state{font-size:11px;white-space:nowrap;padding:4px 10px;background:#e5e9df;border-radius:20px}.metrics-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.metric-card{padding:18px;background:#fff;border:1px solid var(--line);border-radius:10px;min-width:0}.metric-card h3{font-size:11px;letter-spacing:1.5px;margin:0 0 8px;color:var(--muted)}.metric-card strong{display:block;font-size:32px;line-height:1.4;font-weight:600;font-variant-numeric:tabular-nums}.metric-card p{font-size:11px;margin:8px 0 0;overflow-wrap:anywhere}.metric-card progress{display:block;width:100%;height:6px;margin-top:12px;accent-color:var(--accent)}.metrics-note{margin-top:15px}.metrics-panel[data-state=live] .metrics-state{background:#deebd5;color:#315734}.metrics-panel[data-state=stale] .metrics-state,.metrics-panel[data-state=error] .metrics-state{background:#f4e7cb;color:#79551b}.metrics-panel[data-state=stale] .metric-card{opacity:.6}@media(max-width:1000px){.metrics-grid{gap:8px}.metric-card{padding:12px}.metric-card strong{font-size:26px}}@media(max-width:700px){.metrics-header{flex-direction:column;gap:10px}.metrics-grid{grid-template-columns:1fr}.metrics-panel{padding:18px}.metric-card{padding:16px}}@media print{.metrics-panel{display:none}}
|
* {
|
||||||
|
box-sizing:border-box
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
scroll-behavior:smooth;
|
||||||
|
scroll-padding-top:30px
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin:0;
|
||||||
|
background:var(--paper);
|
||||||
|
color:var(--ink);
|
||||||
|
font:15px/1.75 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color:var(--accent);
|
||||||
|
text-underline-offset:4px
|
||||||
|
}
|
||||||
|
|
||||||
|
aside {
|
||||||
|
position:fixed;
|
||||||
|
inset:0 auto 0 0;
|
||||||
|
width:280px;
|
||||||
|
background:#f0f3ec;
|
||||||
|
border-right:1px solid var(--line);
|
||||||
|
padding:36px 24px;
|
||||||
|
display:flex;
|
||||||
|
flex-direction:column
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand {
|
||||||
|
display:flex;
|
||||||
|
align-items:center;
|
||||||
|
gap:12px;
|
||||||
|
text-decoration:none;
|
||||||
|
color:var(--ink);
|
||||||
|
font-size:23px;
|
||||||
|
font-weight:750;
|
||||||
|
letter-spacing:1px
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand>b {
|
||||||
|
display:grid;
|
||||||
|
place-items:center;
|
||||||
|
width:42px;
|
||||||
|
height:44px;
|
||||||
|
background:#244d3b;
|
||||||
|
color:#fff;
|
||||||
|
border-radius:11px;
|
||||||
|
position:relative;
|
||||||
|
font-size:29px
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand>b span {
|
||||||
|
position:absolute;
|
||||||
|
font-size:16px;
|
||||||
|
right:2px;
|
||||||
|
top:-7px;
|
||||||
|
color:#c6e6a3
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand div>span {
|
||||||
|
display:block;
|
||||||
|
font-size:8px;
|
||||||
|
letter-spacing:1.7px;
|
||||||
|
color:var(--muted);
|
||||||
|
font-weight:600
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace {
|
||||||
|
margin:36px 0 38px;
|
||||||
|
padding:12px 10px;
|
||||||
|
border:1px solid #d8dfd3;
|
||||||
|
border-radius:8px;
|
||||||
|
font-size:11px;
|
||||||
|
background:#f8faf4
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
display:inline-block;
|
||||||
|
width:7px;
|
||||||
|
height:7px;
|
||||||
|
margin-right:7px;
|
||||||
|
border-radius:50%;
|
||||||
|
background:#7e8c76
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-label {
|
||||||
|
font-size:10px;
|
||||||
|
letter-spacing:1.7px;
|
||||||
|
color:#73816d;
|
||||||
|
margin:0 12px 13px
|
||||||
|
}
|
||||||
|
|
||||||
|
nav {
|
||||||
|
display:grid;
|
||||||
|
gap:6px;
|
||||||
|
overflow:auto
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a {
|
||||||
|
padding:10px 12px;
|
||||||
|
text-decoration:none;
|
||||||
|
font-size:13px;
|
||||||
|
border-radius:7px;
|
||||||
|
color:#526158
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a span {
|
||||||
|
font-size:10px;
|
||||||
|
color:#8a9684;
|
||||||
|
margin-right:13px;
|
||||||
|
font-family:monospace
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a:hover,nav a[aria-current] {
|
||||||
|
background:#e0e8d8;
|
||||||
|
color:#264c35
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-footer {
|
||||||
|
margin-top:auto;
|
||||||
|
padding:28px 12px 0;
|
||||||
|
color:#778371;
|
||||||
|
font-size:11px
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-footer code {
|
||||||
|
font-size:11px;
|
||||||
|
color:#40573e
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-icon {
|
||||||
|
color:#4d7250
|
||||||
|
}
|
||||||
|
|
||||||
|
.page {
|
||||||
|
margin-left:280px
|
||||||
|
}
|
||||||
|
|
||||||
|
header {
|
||||||
|
height:82px;
|
||||||
|
padding:0 54px;
|
||||||
|
border-bottom:1px solid var(--line);
|
||||||
|
display:flex;
|
||||||
|
align-items:center;
|
||||||
|
justify-content:space-between;
|
||||||
|
font-size:12px;
|
||||||
|
color:var(--muted)
|
||||||
|
}
|
||||||
|
|
||||||
|
header strong {
|
||||||
|
font-weight:500;
|
||||||
|
color:var(--ink)
|
||||||
|
}
|
||||||
|
|
||||||
|
header i {
|
||||||
|
margin:0 14px;
|
||||||
|
color:#a0aca1;
|
||||||
|
font-style:normal
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
font-size:9px;
|
||||||
|
letter-spacing:1.4px
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge span {
|
||||||
|
margin:0 8px
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
max-width:1140px;
|
||||||
|
padding:56px 64px 20px;
|
||||||
|
margin:auto
|
||||||
|
}
|
||||||
|
|
||||||
|
.eyebrow {
|
||||||
|
color:#608153;
|
||||||
|
font-size:10px;
|
||||||
|
letter-spacing:2px;
|
||||||
|
margin-bottom:25px
|
||||||
|
}
|
||||||
|
|
||||||
|
.eyebrow>span {
|
||||||
|
display:inline-block;
|
||||||
|
width:22px;
|
||||||
|
height:2px;
|
||||||
|
background:#759859;
|
||||||
|
vertical-align:middle;
|
||||||
|
margin-right:9px
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size:clamp(34px,4vw,56px);
|
||||||
|
line-height:1.13;
|
||||||
|
font-weight:620;
|
||||||
|
letter-spacing:-2px;
|
||||||
|
max-width:680px;
|
||||||
|
margin:0 0 24px
|
||||||
|
}
|
||||||
|
|
||||||
|
article>p {
|
||||||
|
font-size:16px;
|
||||||
|
color:var(--muted);
|
||||||
|
max-width:700px;
|
||||||
|
margin-bottom:44px
|
||||||
|
}
|
||||||
|
|
||||||
|
section {
|
||||||
|
scroll-margin-top:30px;
|
||||||
|
padding:28px 0 24px;
|
||||||
|
border-top:1px solid var(--line)
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size:26px;
|
||||||
|
line-height:1.3;
|
||||||
|
letter-spacing:-.7px;
|
||||||
|
margin:0 0 22px;
|
||||||
|
font-weight:620
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-size:16px;
|
||||||
|
margin:27px 0 12px;
|
||||||
|
font-weight:650
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin:12px 0;
|
||||||
|
color:#53645b
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
margin:24px 0;
|
||||||
|
padding:19px 24px;
|
||||||
|
background:#edf2e5;
|
||||||
|
border-left:3px solid #91a96c;
|
||||||
|
border-radius:0 8px 8px 0;
|
||||||
|
color:#526447;
|
||||||
|
font-size:13px
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
padding:4px 0;
|
||||||
|
color:#53645b
|
||||||
|
}
|
||||||
|
|
||||||
|
ol,ul {
|
||||||
|
padding-left:23px
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-wrap {
|
||||||
|
overflow:auto;
|
||||||
|
border:1px solid var(--line);
|
||||||
|
border-radius:10px;
|
||||||
|
margin:20px 0;
|
||||||
|
background:#fff
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse:collapse;
|
||||||
|
width:100%;
|
||||||
|
font-size:13px;
|
||||||
|
text-align:left
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
background:#f0f3eb;
|
||||||
|
font-size:11px;
|
||||||
|
font-weight:600;
|
||||||
|
color:#637359
|
||||||
|
}
|
||||||
|
|
||||||
|
th,td {
|
||||||
|
padding:14px 18px;
|
||||||
|
border-bottom:1px solid var(--line);
|
||||||
|
min-width:130px
|
||||||
|
}
|
||||||
|
|
||||||
|
tr:last-child td {
|
||||||
|
border-bottom:0
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
color:#56635b
|
||||||
|
}
|
||||||
|
|
||||||
|
td:first-child {
|
||||||
|
font-weight:550;
|
||||||
|
color:#33483c
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
font:12px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace;
|
||||||
|
background:#edf0e8;
|
||||||
|
padding:3px 6px;
|
||||||
|
border-radius:4px;
|
||||||
|
overflow-wrap:anywhere
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
background:#20362d;
|
||||||
|
color:#dbe8ce;
|
||||||
|
padding:23px;
|
||||||
|
border-radius:10px;
|
||||||
|
overflow:auto
|
||||||
|
}
|
||||||
|
|
||||||
|
pre code {
|
||||||
|
background:transparent;
|
||||||
|
padding:0;
|
||||||
|
color:inherit;
|
||||||
|
overflow-wrap:normal
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
border-top:1px solid var(--line);
|
||||||
|
padding:26px 0;
|
||||||
|
display:flex;
|
||||||
|
justify-content:space-between;
|
||||||
|
gap:14px;
|
||||||
|
font-size:10px;
|
||||||
|
color:#7b8779
|
||||||
|
}
|
||||||
|
|
||||||
|
footer b {
|
||||||
|
margin:0 8px;
|
||||||
|
font-weight:400
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
width:100%;
|
||||||
|
border:0;
|
||||||
|
background:none;
|
||||||
|
font:13px system-ui;
|
||||||
|
color:var(--ink);
|
||||||
|
min-width:0;
|
||||||
|
padding:5px 0
|
||||||
|
}
|
||||||
|
|
||||||
|
input:focus {
|
||||||
|
outline:0
|
||||||
|
}
|
||||||
|
|
||||||
|
kbd {
|
||||||
|
font:11px monospace;
|
||||||
|
border:1px solid var(--line);
|
||||||
|
border-radius:4px;
|
||||||
|
padding:0 6px;
|
||||||
|
color:#819076
|
||||||
|
}
|
||||||
|
|
||||||
|
a:focus-visible,.table-wrap:focus-visible {
|
||||||
|
outline:2px solid var(--accent);
|
||||||
|
outline-offset:3px
|
||||||
|
}
|
||||||
|
|
||||||
|
.skip {
|
||||||
|
position:fixed;
|
||||||
|
top:-80px;
|
||||||
|
left:20px;
|
||||||
|
z-index:10;
|
||||||
|
padding:10px;
|
||||||
|
background:white
|
||||||
|
}
|
||||||
|
|
||||||
|
.skip:focus {
|
||||||
|
top:10px
|
||||||
|
}
|
||||||
|
|
||||||
|
[hidden] {
|
||||||
|
display:none!important
|
||||||
|
}
|
||||||
|
|
||||||
|
@media(min-width:1400px) {
|
||||||
|
main {
|
||||||
|
padding-top:70px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media(max-width:1000px) {
|
||||||
|
aside {
|
||||||
|
width:235px;
|
||||||
|
padding:28px 16px
|
||||||
|
}
|
||||||
|
.page {
|
||||||
|
margin-left:235px
|
||||||
|
}
|
||||||
|
main {
|
||||||
|
padding:38px 30px
|
||||||
|
}
|
||||||
|
header {
|
||||||
|
padding:0 30px
|
||||||
|
}
|
||||||
|
.badge {
|
||||||
|
display:none
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media(max-width:700px) {
|
||||||
|
aside {
|
||||||
|
position:static;
|
||||||
|
width:auto;
|
||||||
|
padding:22px;
|
||||||
|
display:block;
|
||||||
|
border-right:0;
|
||||||
|
border-bottom:1px solid var(--line)
|
||||||
|
}
|
||||||
|
.brand {
|
||||||
|
font-size:20px
|
||||||
|
}
|
||||||
|
.workspace,.sidebar-footer,.nav-label {
|
||||||
|
display:none
|
||||||
|
}
|
||||||
|
nav {
|
||||||
|
display:flex;
|
||||||
|
overflow:auto;
|
||||||
|
margin-top:22px;
|
||||||
|
gap:6px
|
||||||
|
}
|
||||||
|
nav a {
|
||||||
|
white-space:nowrap;
|
||||||
|
background:#e8ede1;
|
||||||
|
padding:8px 12px
|
||||||
|
}
|
||||||
|
nav a span {
|
||||||
|
display:none
|
||||||
|
}
|
||||||
|
.page {
|
||||||
|
margin-left:0
|
||||||
|
}
|
||||||
|
header {
|
||||||
|
height:57px;
|
||||||
|
padding:0 22px
|
||||||
|
}
|
||||||
|
main {
|
||||||
|
padding:30px 22px 10px
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
letter-spacing:-1px
|
||||||
|
}
|
||||||
|
h2 {
|
||||||
|
font-size:23px
|
||||||
|
}
|
||||||
|
footer {
|
||||||
|
flex-direction:column
|
||||||
|
}
|
||||||
|
th,td {
|
||||||
|
padding:12px
|
||||||
|
}
|
||||||
|
blockquote {
|
||||||
|
margin:20px 0;
|
||||||
|
padding:15px
|
||||||
|
}
|
||||||
|
section {
|
||||||
|
padding-top:25px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media(prefers-reduced-motion:reduce) {
|
||||||
|
html {
|
||||||
|
scroll-behavior:auto
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
aside,header,.eyebrow,footer {
|
||||||
|
display:none
|
||||||
|
}
|
||||||
|
.page {
|
||||||
|
margin:0
|
||||||
|
}
|
||||||
|
main {
|
||||||
|
padding:0;
|
||||||
|
max-width:none
|
||||||
|
}
|
||||||
|
section[hidden] {
|
||||||
|
display:block!important
|
||||||
|
}
|
||||||
|
pre {
|
||||||
|
white-space:pre-wrap
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
background:#fff
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-panel {
|
||||||
|
border:1px solid var(--line);
|
||||||
|
border-radius:14px;
|
||||||
|
padding:24px;
|
||||||
|
margin:0 0 32px;
|
||||||
|
background:#f3f6ee
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-header {
|
||||||
|
display:flex;
|
||||||
|
justify-content:space-between;
|
||||||
|
align-items:start;
|
||||||
|
gap:18px;
|
||||||
|
margin-bottom:20px
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-header h2 {
|
||||||
|
font-size:22px;
|
||||||
|
margin:0 0 5px
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-header p,.metrics-note {
|
||||||
|
font-size:12px;
|
||||||
|
margin:0;
|
||||||
|
color:var(--muted)
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-state {
|
||||||
|
font-size:11px;
|
||||||
|
white-space:nowrap;
|
||||||
|
padding:4px 10px;
|
||||||
|
background:#e5e9df;
|
||||||
|
border-radius:20px
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-grid {
|
||||||
|
display:grid;
|
||||||
|
grid-template-columns:repeat(3,minmax(0,1fr));
|
||||||
|
gap:14px
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-card {
|
||||||
|
padding:18px;
|
||||||
|
background:#fff;
|
||||||
|
border:1px solid var(--line);
|
||||||
|
border-radius:10px;
|
||||||
|
min-width:0
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-card h3 {
|
||||||
|
font-size:11px;
|
||||||
|
letter-spacing:1.5px;
|
||||||
|
margin:0 0 8px;
|
||||||
|
color:var(--muted)
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-card strong {
|
||||||
|
display:block;
|
||||||
|
font-size:32px;
|
||||||
|
line-height:1.4;
|
||||||
|
font-weight:600;
|
||||||
|
font-variant-numeric:tabular-nums
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-card p {
|
||||||
|
font-size:11px;
|
||||||
|
margin:8px 0 0;
|
||||||
|
overflow-wrap:anywhere
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-card progress {
|
||||||
|
display:block;
|
||||||
|
width:100%;
|
||||||
|
height:6px;
|
||||||
|
margin-top:12px;
|
||||||
|
accent-color:var(--accent)
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-note {
|
||||||
|
margin-top:15px
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-panel[data-state=live] .metrics-state {
|
||||||
|
background:#deebd5;
|
||||||
|
color:#315734
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-panel[data-state=stale] .metrics-state,.metrics-panel[data-state=error] .metrics-state {
|
||||||
|
background:#f4e7cb;
|
||||||
|
color:#79551b
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-panel[data-state=stale] .metric-card {
|
||||||
|
opacity:.6
|
||||||
|
}
|
||||||
|
|
||||||
|
@media(max-width:1000px) {
|
||||||
|
.metrics-grid {
|
||||||
|
gap:8px
|
||||||
|
}
|
||||||
|
.metric-card {
|
||||||
|
padding:12px
|
||||||
|
}
|
||||||
|
.metric-card strong {
|
||||||
|
font-size:26px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media(max-width:700px) {
|
||||||
|
.metrics-header {
|
||||||
|
flex-direction:column;
|
||||||
|
gap:10px
|
||||||
|
}
|
||||||
|
.metrics-grid {
|
||||||
|
grid-template-columns:1fr
|
||||||
|
}
|
||||||
|
.metrics-panel {
|
||||||
|
padding:18px
|
||||||
|
}
|
||||||
|
.metric-card {
|
||||||
|
padding:16px
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
.metrics-panel {
|
||||||
|
display:none
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user