@nivaro/react 0.3.44 → 0.3.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +75 -7
- package/dist/shared/components/BaseMap.js +149 -103
- package/dist/shared/components/CollectionBrowserView.js +1390 -1358
- package/dist/shared/components/DataTable.js +356 -334
- package/dist/shared/components/ProfileView.js +16 -21
- package/dist/shared/components/command-center/CommandCenterView.js +331 -352
- package/dist/shared/components/command-center/Customize.js +353 -0
- package/dist/shared/components/command-center/Header.js +296 -0
- package/dist/shared/components/command-center/KioskLinks.js +198 -0
- package/dist/shared/components/command-center/PeekPanel.js +146 -0
- package/dist/shared/components/command-center/announce.js +13 -0
- package/dist/shared/components/command-center/api.js +26 -0
- package/dist/shared/components/command-center/board-prefs.js +99 -0
- package/dist/shared/components/command-center/freshness.js +29 -0
- package/dist/shared/components/command-center/layout.js +56 -0
- package/dist/shared/components/command-center/panels/AttentionPanel.js +135 -0
- package/dist/shared/components/command-center/panels/Banner.js +75 -0
- package/dist/shared/components/command-center/panels/BoardSettings.js +223 -0
- package/dist/shared/components/command-center/panels/FeedPanel.js +149 -0
- package/dist/shared/components/command-center/panels/FlowPanel.js +159 -0
- package/dist/shared/components/command-center/panels/ForecastPanel.js +247 -0
- package/dist/shared/components/command-center/panels/MapLegend.js +266 -0
- package/dist/shared/components/command-center/panels/MapPanel.js +224 -0
- package/dist/shared/components/command-center/panels/PartnersPanel.js +52 -0
- package/dist/shared/components/command-center/panels/PeoplePanel.js +264 -0
- package/dist/shared/components/command-center/panels/RegionPicker.js +91 -0
- package/dist/shared/components/command-center/panels/SystemPanel.js +173 -0
- package/dist/shared/components/command-center/panels/ThroughputPanel.js +310 -0
- package/dist/shared/components/command-center/panels/TimeBar.js +231 -0
- package/dist/shared/components/command-center/panels/TrafficPanel.js +15 -0
- package/dist/shared/components/command-center/panels/WorkloadPanel.js +85 -0
- package/dist/shared/components/command-center/panels/attention-actions.js +267 -0
- package/dist/shared/components/command-center/panels/map-shared.js +95 -0
- package/dist/shared/components/command-center/panels/registry.js +96 -0
- package/dist/shared/components/command-center/shell-hooks.js +118 -0
- package/dist/shared/components/command-center/shortcuts.js +37 -0
- package/dist/shared/components/command-center/state.js +12 -0
- package/dist/shared/components/command-center/theme.js +84 -0
- package/dist/shared/components/command-center/time.js +52 -0
- package/dist/shared/components/command-center/url-state.js +54 -0
- package/dist/shared/components/command-center/work-links.js +32 -0
- package/dist/shared/components/imports/ImportConsole.js +48 -47
- package/dist/shared/components/monitoring/TrafficMiniMap.js +111 -70
- package/dist/shared/components/notifications/TestMyRules.js +39 -38
- package/dist/shared/components/profile/TeamsConnect.js +2 -2
- package/dist/shared/components/queue/QueueQuickFilters.js +81 -63
- package/dist/shared/components/queue/QueueWorklist.js +598 -586
- package/dist/shared/lib/quick-filter-cascade.js +29 -0
- package/package.json +1 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as _ } from "react";
|
|
3
|
+
import { Popover as v, PopoverTrigger as y, PopoverContent as N } from "../../ui/popover.js";
|
|
4
|
+
import { useCc as b } from "../state.js";
|
|
5
|
+
import { PANEL as k, PANEL_HEAD as w, TITLE as $, FAINT as x, FOCUS as m, MUTED as g } from "../theme.js";
|
|
6
|
+
import { usePortalVars as S } from "../time.js";
|
|
7
|
+
const j = 10, R = 0.01, M = 50, A = 500;
|
|
8
|
+
function C(t) {
|
|
9
|
+
var c, o;
|
|
10
|
+
const a = [];
|
|
11
|
+
t.db_ok || a.push({ key: "db", severity: "critical", text: "The database is not answering" }), t.redis_ok || a.push({ key: "redis", severity: "critical", text: "Redis is not answering" });
|
|
12
|
+
const i = t.requests_1h > 0 ? t.errors_1h / t.requests_1h : t.errors_1h > 0 ? 1 : 0;
|
|
13
|
+
(t.errors_1h >= M || t.errors_1h >= j && i >= R) && a.push({
|
|
14
|
+
key: "errors",
|
|
15
|
+
severity: "warning",
|
|
16
|
+
text: `${t.errors_1h.toLocaleString()} server errors in the last hour (${(i * 100).toFixed(1)}% of requests)`
|
|
17
|
+
}), t.jobs_failed_1h > 0 && a.push({
|
|
18
|
+
key: "jobs",
|
|
19
|
+
severity: "warning",
|
|
20
|
+
text: `${t.jobs_failed_1h} background ${t.jobs_failed_1h === 1 ? "job" : "jobs"} failed in the last hour`
|
|
21
|
+
});
|
|
22
|
+
const s = ((o = (c = t.runtime) == null ? void 0 : c.event_loop_lag_ms) == null ? void 0 : o.max_1m) ?? 0;
|
|
23
|
+
return s >= A && a.push({
|
|
24
|
+
key: "lag",
|
|
25
|
+
severity: "warning",
|
|
26
|
+
text: `The server is busy: work waited up to ${Math.round(s)} ms in the last minute`
|
|
27
|
+
}), a;
|
|
28
|
+
}
|
|
29
|
+
function I() {
|
|
30
|
+
const { snapshot: t, navigate: a, at: i } = b(), s = S(), [c, o] = _(!1), d = t == null ? void 0 : t.health;
|
|
31
|
+
if (!d) return null;
|
|
32
|
+
const n = C(d), h = n.some((l) => l.severity === "critical"), u = n.length === 0 ? "All systems normal" : `${n.length} ${n.length === 1 ? "issue" : "issues"}`, f = n.length === 0 ? "bg-emerald-500/15 text-[var(--cc-good-text)]" : h ? "bg-red-500/15 text-[var(--cc-bad-text)]" : "bg-amber-500/15 text-[var(--cc-warn-text)]", p = (l) => {
|
|
33
|
+
o(!1), a(l);
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ r(v, { open: c, onOpenChange: o, children: [
|
|
36
|
+
/* @__PURE__ */ e(y, { asChild: !0, children: /* @__PURE__ */ r(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
type: "button",
|
|
40
|
+
className: `inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-[12px] font-medium ${f} ${m}`,
|
|
41
|
+
"aria-label": `System: ${u}${i ? " (now)" : ""}`,
|
|
42
|
+
"data-cc-system-pill": n.length,
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ e("span", { "aria-hidden": !0, className: "text-[10px]", children: n.length === 0 ? "●" : h ? "■" : "▲" }),
|
|
45
|
+
u
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
) }),
|
|
49
|
+
/* @__PURE__ */ r(
|
|
50
|
+
N,
|
|
51
|
+
{
|
|
52
|
+
align: "start",
|
|
53
|
+
className: "w-[320px] border-[var(--cc-border)] bg-[var(--cc-panel)] p-3 text-[var(--cc-text)]",
|
|
54
|
+
style: s,
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ r("p", { className: "text-[12.5px] font-semibold text-[var(--cc-strong)]", children: [
|
|
57
|
+
"System ",
|
|
58
|
+
i ? "(now)" : ""
|
|
59
|
+
] }),
|
|
60
|
+
n.length === 0 ? /* @__PURE__ */ e("p", { className: `mt-1 text-[12px] ${g}`, children: "Nothing needs attention." }) : /* @__PURE__ */ e("ul", { className: "mt-1.5 space-y-1 text-[12px]", children: n.map((l) => /* @__PURE__ */ r("li", { className: "flex gap-1.5", children: [
|
|
61
|
+
/* @__PURE__ */ e(
|
|
62
|
+
"span",
|
|
63
|
+
{
|
|
64
|
+
"aria-hidden": !0,
|
|
65
|
+
className: l.severity === "critical" ? "text-[var(--cc-bad-text)]" : "text-[var(--cc-warn-text)]",
|
|
66
|
+
children: l.severity === "critical" ? "■" : "▲"
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
/* @__PURE__ */ r("span", { children: [
|
|
70
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: l.severity === "critical" ? "Critical: " : "Warning: " }),
|
|
71
|
+
l.text
|
|
72
|
+
] })
|
|
73
|
+
] }, l.key)) }),
|
|
74
|
+
/* @__PURE__ */ r("dl", { className: `mt-2.5 grid grid-cols-2 gap-x-3 gap-y-0.5 text-[11.5px] ${g}`, children: [
|
|
75
|
+
/* @__PURE__ */ e("dt", { children: "Requests (1 h)" }),
|
|
76
|
+
/* @__PURE__ */ e("dd", { className: "text-right tabular-nums", children: d.requests_1h.toLocaleString() }),
|
|
77
|
+
/* @__PURE__ */ e("dt", { children: "Jobs running" }),
|
|
78
|
+
/* @__PURE__ */ e("dd", { className: "text-right tabular-nums", children: d.jobs_running }),
|
|
79
|
+
/* @__PURE__ */ e("dt", { children: "Servers" }),
|
|
80
|
+
/* @__PURE__ */ e("dd", { className: "text-right tabular-nums", children: d.instances }),
|
|
81
|
+
/* @__PURE__ */ e("dt", { children: "Memory" }),
|
|
82
|
+
/* @__PURE__ */ r("dd", { className: "text-right tabular-nums", children: [
|
|
83
|
+
Math.round(d.runtime.rss_mb),
|
|
84
|
+
" MB"
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ e("dt", { children: "Loop lag (1 min)" }),
|
|
87
|
+
/* @__PURE__ */ r("dd", { className: "text-right tabular-nums", children: [
|
|
88
|
+
Math.round(d.runtime.event_loop_lag_ms.max_1m),
|
|
89
|
+
" ms"
|
|
90
|
+
] })
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ r("div", { className: "mt-3 flex gap-3 text-[12px] font-medium", children: [
|
|
93
|
+
/* @__PURE__ */ e(
|
|
94
|
+
"button",
|
|
95
|
+
{
|
|
96
|
+
type: "button",
|
|
97
|
+
className: `rounded text-[var(--cc-strong)] underline-offset-2 hover:underline ${m}`,
|
|
98
|
+
onClick: () => p("/traffic-map"),
|
|
99
|
+
children: "Open Traffic Map"
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ e(
|
|
103
|
+
"button",
|
|
104
|
+
{
|
|
105
|
+
type: "button",
|
|
106
|
+
className: `rounded text-[var(--cc-strong)] underline-offset-2 hover:underline ${m}`,
|
|
107
|
+
onClick: () => p("/health"),
|
|
108
|
+
children: "Open Health"
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
] })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] });
|
|
116
|
+
}
|
|
117
|
+
function D() {
|
|
118
|
+
const { snapshot: t, at: a, navigate: i } = b(), s = t == null ? void 0 : t.health;
|
|
119
|
+
if (!s) return null;
|
|
120
|
+
const c = (o) => o ? "bg-emerald-500" : "bg-red-500";
|
|
121
|
+
return /* @__PURE__ */ r("section", { className: k, "data-cc-panel": "system", "aria-label": "System", children: [
|
|
122
|
+
/* @__PURE__ */ r("div", { className: w, children: [
|
|
123
|
+
/* @__PURE__ */ e("h2", { className: $, children: "System" }),
|
|
124
|
+
/* @__PURE__ */ r(
|
|
125
|
+
"button",
|
|
126
|
+
{
|
|
127
|
+
type: "button",
|
|
128
|
+
className: `rounded text-[11.5px] hover:underline ${x} ${m}`,
|
|
129
|
+
onClick: () => i("/traffic-map"),
|
|
130
|
+
children: [
|
|
131
|
+
"Traffic Map",
|
|
132
|
+
a ? " · now" : ""
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-1 px-3 py-2 text-[12px] text-[var(--cc-text)]", children: [
|
|
138
|
+
/* @__PURE__ */ r("span", { className: "flex items-center gap-1.5", children: [
|
|
139
|
+
/* @__PURE__ */ e("span", { className: `h-2 w-2 rounded-full ${c(s.db_ok)}`, "aria-hidden": !0 }),
|
|
140
|
+
"Database ",
|
|
141
|
+
s.db_ok ? "ok" : "down"
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ r("span", { className: "flex items-center gap-1.5", children: [
|
|
144
|
+
/* @__PURE__ */ e("span", { className: `h-2 w-2 rounded-full ${c(s.redis_ok)}`, "aria-hidden": !0 }),
|
|
145
|
+
"Redis ",
|
|
146
|
+
s.redis_ok ? "ok" : "down"
|
|
147
|
+
] }),
|
|
148
|
+
/* @__PURE__ */ r("span", { children: [
|
|
149
|
+
/* @__PURE__ */ e("b", { className: "tabular-nums", children: s.errors_1h }),
|
|
150
|
+
" errors",
|
|
151
|
+
/* @__PURE__ */ e("span", { className: x, children: " / 1 h" })
|
|
152
|
+
] }),
|
|
153
|
+
/* @__PURE__ */ r("span", { children: [
|
|
154
|
+
/* @__PURE__ */ e("b", { className: "tabular-nums", children: s.jobs_running }),
|
|
155
|
+
" jobs running",
|
|
156
|
+
s.jobs_failed_1h > 0 && /* @__PURE__ */ r("b", { className: "tabular-nums text-[var(--cc-warn-text)]", children: [
|
|
157
|
+
" · ",
|
|
158
|
+
s.jobs_failed_1h,
|
|
159
|
+
" failed"
|
|
160
|
+
] })
|
|
161
|
+
] })
|
|
162
|
+
] })
|
|
163
|
+
] });
|
|
164
|
+
}
|
|
165
|
+
export {
|
|
166
|
+
M as ERRORS_ALWAYS,
|
|
167
|
+
j as ERRORS_MIN,
|
|
168
|
+
R as ERRORS_SHARE,
|
|
169
|
+
A as LAG_MS,
|
|
170
|
+
D as SystemPanel,
|
|
171
|
+
I as SystemPill,
|
|
172
|
+
C as systemIssues
|
|
173
|
+
};
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as W, useRef as j, useMemo as z } from "react";
|
|
3
|
+
import { useCcQuery as B } from "../api.js";
|
|
4
|
+
import { useCc as K } from "../state.js";
|
|
5
|
+
import { useAppIsDark as O, PANEL as A, PANEL_HEAD as R, TITLE as E, FAINT as D, MUTED as U, FOCUS as _ } from "../theme.js";
|
|
6
|
+
const v = {
|
|
7
|
+
today: { label: "Today", light: "#2a78d6", dark: "#3987e5" },
|
|
8
|
+
yesterday: { label: "Yesterday", light: "#eb6834", dark: "#d95926" },
|
|
9
|
+
avg7: { label: "7-day average", light: "#1baf7a", dark: "#199e70" }
|
|
10
|
+
}, $ = ["today", "yesterday", "avg7"], N = 340, Y = 132, w = 28, L = 268, C = 10, T = 104;
|
|
11
|
+
function f(l) {
|
|
12
|
+
const i = (l % 24 + 24) % 24;
|
|
13
|
+
return `${i % 12 === 0 ? 12 : i % 12} ${i < 12 ? "AM" : "PM"}`;
|
|
14
|
+
}
|
|
15
|
+
function G(l) {
|
|
16
|
+
if (l <= 4) return 4;
|
|
17
|
+
const i = 10 ** Math.floor(Math.log10(l));
|
|
18
|
+
for (const r of [1, 2, 2.5, 5, 10]) if (r * i >= l) return r * i;
|
|
19
|
+
return 10 * i;
|
|
20
|
+
}
|
|
21
|
+
function Q(l, i) {
|
|
22
|
+
var x, h;
|
|
23
|
+
const r = new Date(l);
|
|
24
|
+
if (Number.isNaN(r.getTime())) return null;
|
|
25
|
+
try {
|
|
26
|
+
const d = new Intl.DateTimeFormat("en-US", {
|
|
27
|
+
timeZone: i || void 0,
|
|
28
|
+
hourCycle: "h23",
|
|
29
|
+
hour: "numeric",
|
|
30
|
+
minute: "numeric"
|
|
31
|
+
}).formatToParts(r), s = Number(((x = d.find((p) => p.type === "hour")) == null ? void 0 : x.value) ?? 0) % 24, a = Number(((h = d.find((p) => p.type === "minute")) == null ? void 0 : h.value) ?? 0);
|
|
32
|
+
return s + a / 60;
|
|
33
|
+
} catch {
|
|
34
|
+
return r.getHours() + r.getMinutes() / 60;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function X(l) {
|
|
38
|
+
const i = l.hours.filter((s) => s.today != null), r = l.today_total ?? i.reduce((s, a) => s + (a.today ?? 0), 0), x = i[i.length - 1], h = [
|
|
39
|
+
`${r.toLocaleString()} transitions today${x ? ` by ${f(x.hour)}` : ""}`
|
|
40
|
+
];
|
|
41
|
+
if (l.yesterday_same_time != null) {
|
|
42
|
+
const s = r - l.yesterday_same_time;
|
|
43
|
+
h.push(
|
|
44
|
+
s === 0 ? "the same as yesterday by this time" : `${Math.abs(s).toLocaleString()} ${s > 0 ? "more" : "fewer"} than yesterday by this time`
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
const d = [...i].sort((s, a) => (a.today ?? 0) - (s.today ?? 0))[0];
|
|
48
|
+
return d && (d.today ?? 0) > 0 && h.push(`busiest hour ${f(d.hour)} (${d.today})`), `${h.join(", ")}.`;
|
|
49
|
+
}
|
|
50
|
+
const Z = {
|
|
51
|
+
deploy: "D",
|
|
52
|
+
config: "C",
|
|
53
|
+
incident: "!"
|
|
54
|
+
}, P = {
|
|
55
|
+
deploy: "Deploy",
|
|
56
|
+
config: "Configuration change",
|
|
57
|
+
incident: "Incident"
|
|
58
|
+
};
|
|
59
|
+
function re() {
|
|
60
|
+
const l = K(), i = O() || l.tv, { data: r, isLoading: x } = B("/throughput", void 0, {
|
|
61
|
+
refetchInterval: l.at ? !1 : 6e4,
|
|
62
|
+
placeholderData: (e) => e
|
|
63
|
+
}), [h, d] = W(null), s = j(null), a = z(() => {
|
|
64
|
+
if (!r) return null;
|
|
65
|
+
const e = G(
|
|
66
|
+
Math.max(1, ...r.hours.flatMap((n) => [n.today ?? 0, n.yesterday, n.avg7]))
|
|
67
|
+
), u = (n) => w + n / 23 * (L - w), y = (n) => T - n / e * (T - C), M = (n) => {
|
|
68
|
+
let m = "";
|
|
69
|
+
for (const b of r.hours) {
|
|
70
|
+
const k = b[n];
|
|
71
|
+
k != null && (m += `${m ? "L" : "M"}${u(b.hour).toFixed(1)},${y(k).toFixed(1)}`);
|
|
72
|
+
}
|
|
73
|
+
return m;
|
|
74
|
+
}, g = $.map((n) => {
|
|
75
|
+
const m = r.hours.filter((k) => k[n] != null), b = m[m.length - 1];
|
|
76
|
+
return b ? { k: n, x: u(b.hour), y: y(b[n]) } : { k: n, x: u(0), y: y(0) };
|
|
77
|
+
}).sort((n, m) => n.y - m.y);
|
|
78
|
+
for (let n = 1; n < g.length; n++)
|
|
79
|
+
g[n].y - g[n - 1].y < 11 && (g[n].y = g[n - 1].y + 11);
|
|
80
|
+
return { max: e, x: u, y, path: M, ends: g };
|
|
81
|
+
}, [r]);
|
|
82
|
+
if (x && !r)
|
|
83
|
+
return /* @__PURE__ */ c("section", { className: A, "data-cc-panel": "throughput", "aria-label": "Throughput today", children: [
|
|
84
|
+
/* @__PURE__ */ t("div", { className: R, children: /* @__PURE__ */ t("h2", { className: E, children: "Throughput today" }) }),
|
|
85
|
+
/* @__PURE__ */ t("p", { className: `px-3 py-3 text-[12px] ${D}`, children: "Loading…" })
|
|
86
|
+
] });
|
|
87
|
+
if (!r || !a) return null;
|
|
88
|
+
const p = (e) => i ? v[e].dark : v[e].light, S = X(r), F = r.markers.map((e) => ({ ...e, h: Q(e.at, r.time_zone) })).filter((e) => e.h != null), I = (e) => {
|
|
89
|
+
var M;
|
|
90
|
+
const u = (M = s.current) == null ? void 0 : M.getBoundingClientRect();
|
|
91
|
+
if (!u || u.width === 0) return;
|
|
92
|
+
const y = (e.clientX - u.left) / u.width * N;
|
|
93
|
+
d(Math.max(0, Math.min(23, Math.round((y - w) / (L - w) * 23))));
|
|
94
|
+
}, H = (e) => {
|
|
95
|
+
e.key === "ArrowRight" || e.key === "ArrowLeft" ? (e.preventDefault(), d((u) => {
|
|
96
|
+
const y = u ?? (/* @__PURE__ */ new Date()).getHours();
|
|
97
|
+
return Math.max(0, Math.min(23, y + (e.key === "ArrowRight" ? 1 : -1)));
|
|
98
|
+
})) : e.key === "Escape" && d(null);
|
|
99
|
+
}, o = h != null ? r.hours[h] : null;
|
|
100
|
+
return /* @__PURE__ */ c(
|
|
101
|
+
"section",
|
|
102
|
+
{
|
|
103
|
+
className: `${A} relative`,
|
|
104
|
+
"data-cc-panel": "throughput",
|
|
105
|
+
"aria-label": "Throughput today",
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ c("div", { className: R, children: [
|
|
108
|
+
/* @__PURE__ */ t("h2", { className: E, children: "Throughput today" }),
|
|
109
|
+
/* @__PURE__ */ t("span", { className: `text-[11px] ${D}`, children: "transitions per hour" })
|
|
110
|
+
] }),
|
|
111
|
+
/* @__PURE__ */ c("div", { className: "px-3 pt-2", children: [
|
|
112
|
+
/* @__PURE__ */ t("p", { className: "text-[12px] text-[var(--cc-text)]", children: S }),
|
|
113
|
+
l.region && r.region_applies === !1 && /* @__PURE__ */ t("p", { className: `text-[11px] ${D}`, children: "Some pipelines can't be placed in regions — counted everywhere." }),
|
|
114
|
+
/* @__PURE__ */ t("ul", { className: "mt-1.5 flex flex-wrap gap-x-3 gap-y-0.5 text-[11px]", "aria-label": "Legend", children: $.map((e) => /* @__PURE__ */ c("li", { className: `flex items-center gap-1.5 ${U}`, children: [
|
|
115
|
+
/* @__PURE__ */ t(
|
|
116
|
+
"span",
|
|
117
|
+
{
|
|
118
|
+
"aria-hidden": "true",
|
|
119
|
+
className: "inline-block h-0.5 w-3.5 shrink-0 rounded-full",
|
|
120
|
+
style: { background: p(e) }
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
v[e].label
|
|
124
|
+
] }, e)) })
|
|
125
|
+
] }),
|
|
126
|
+
/* @__PURE__ */ c("div", { className: "relative px-1 pb-5", children: [
|
|
127
|
+
/* @__PURE__ */ t(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
role: "slider",
|
|
131
|
+
tabIndex: 0,
|
|
132
|
+
"aria-label": "Hour of the day",
|
|
133
|
+
"aria-valuemin": 0,
|
|
134
|
+
"aria-valuemax": 23,
|
|
135
|
+
"aria-valuenow": h ?? 0,
|
|
136
|
+
"aria-valuetext": o ? `${f(o.hour)}: today ${o.today ?? "not yet"}, yesterday ${o.yesterday}, 7-day average ${o.avg7}` : `${S} Use the arrow keys to read each hour.`,
|
|
137
|
+
className: `rounded ${_}`,
|
|
138
|
+
onKeyDown: H,
|
|
139
|
+
onBlur: () => d(null),
|
|
140
|
+
children: /* @__PURE__ */ c(
|
|
141
|
+
"svg",
|
|
142
|
+
{
|
|
143
|
+
ref: s,
|
|
144
|
+
viewBox: `0 0 ${N} ${Y}`,
|
|
145
|
+
className: "block w-full touch-none",
|
|
146
|
+
"aria-hidden": "true",
|
|
147
|
+
onPointerMove: I,
|
|
148
|
+
onPointerLeave: () => d(null),
|
|
149
|
+
children: [
|
|
150
|
+
[0, a.max / 2, a.max].map((e) => /* @__PURE__ */ c("g", { children: [
|
|
151
|
+
/* @__PURE__ */ t(
|
|
152
|
+
"line",
|
|
153
|
+
{
|
|
154
|
+
x1: w,
|
|
155
|
+
x2: L,
|
|
156
|
+
y1: a.y(e),
|
|
157
|
+
y2: a.y(e),
|
|
158
|
+
stroke: "var(--cc-border)",
|
|
159
|
+
strokeWidth: "1"
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
/* @__PURE__ */ t(
|
|
163
|
+
"text",
|
|
164
|
+
{
|
|
165
|
+
x: w - 4,
|
|
166
|
+
y: a.y(e) + 3,
|
|
167
|
+
textAnchor: "end",
|
|
168
|
+
fontSize: "9",
|
|
169
|
+
fill: "var(--cc-faint)",
|
|
170
|
+
className: "tabular-nums",
|
|
171
|
+
children: Math.round(e)
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
] }, e)),
|
|
175
|
+
[0, 6, 12, 18, 23].map((e) => /* @__PURE__ */ t(
|
|
176
|
+
"text",
|
|
177
|
+
{
|
|
178
|
+
x: a.x(e),
|
|
179
|
+
y: T + 12,
|
|
180
|
+
textAnchor: e === 0 ? "start" : e === 23 ? "end" : "middle",
|
|
181
|
+
fontSize: "9",
|
|
182
|
+
fill: "var(--cc-faint)",
|
|
183
|
+
children: f(e)
|
|
184
|
+
},
|
|
185
|
+
e
|
|
186
|
+
)),
|
|
187
|
+
[...$].reverse().map((e) => /* @__PURE__ */ t(
|
|
188
|
+
"path",
|
|
189
|
+
{
|
|
190
|
+
d: a.path(e),
|
|
191
|
+
fill: "none",
|
|
192
|
+
stroke: p(e),
|
|
193
|
+
strokeWidth: "2",
|
|
194
|
+
strokeLinejoin: "round",
|
|
195
|
+
strokeLinecap: "round"
|
|
196
|
+
},
|
|
197
|
+
e
|
|
198
|
+
)),
|
|
199
|
+
a.ends.map((e) => /* @__PURE__ */ t(
|
|
200
|
+
"text",
|
|
201
|
+
{
|
|
202
|
+
x: Math.min(e.x + 5, L + 4),
|
|
203
|
+
y: e.y + 3,
|
|
204
|
+
fontSize: "9",
|
|
205
|
+
fill: "var(--cc-muted)",
|
|
206
|
+
children: v[e.k].label
|
|
207
|
+
},
|
|
208
|
+
e.k
|
|
209
|
+
)),
|
|
210
|
+
o && /* @__PURE__ */ c("g", { pointerEvents: "none", children: [
|
|
211
|
+
/* @__PURE__ */ t(
|
|
212
|
+
"line",
|
|
213
|
+
{
|
|
214
|
+
x1: a.x(o.hour),
|
|
215
|
+
x2: a.x(o.hour),
|
|
216
|
+
y1: C,
|
|
217
|
+
y2: T,
|
|
218
|
+
stroke: "var(--cc-muted)",
|
|
219
|
+
strokeWidth: "1"
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
$.map(
|
|
223
|
+
(e) => o[e] == null ? null : /* @__PURE__ */ t(
|
|
224
|
+
"circle",
|
|
225
|
+
{
|
|
226
|
+
cx: a.x(o.hour),
|
|
227
|
+
cy: a.y(o[e]),
|
|
228
|
+
r: "4",
|
|
229
|
+
fill: p(e),
|
|
230
|
+
stroke: "var(--cc-panel)",
|
|
231
|
+
strokeWidth: "2"
|
|
232
|
+
},
|
|
233
|
+
e
|
|
234
|
+
)
|
|
235
|
+
)
|
|
236
|
+
] })
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
F.map((e) => /* @__PURE__ */ t(
|
|
243
|
+
"button",
|
|
244
|
+
{
|
|
245
|
+
type: "button",
|
|
246
|
+
className: `absolute flex h-4 w-4 -translate-x-1/2 items-center justify-center rounded-sm border border-[var(--cc-border)] bg-[var(--cc-raised)] text-[9px] font-semibold text-[var(--cc-text)] hover:bg-[var(--cc-chip-hover)] ${_}`,
|
|
247
|
+
style: {
|
|
248
|
+
left: `calc(4px + (100% - 8px) * ${(a.x(e.h) / N).toFixed(4)})`,
|
|
249
|
+
bottom: "0px"
|
|
250
|
+
},
|
|
251
|
+
"data-tip": `${P[e.kind]} · ${new Date(e.at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" })} — ${e.label}`,
|
|
252
|
+
"aria-label": `${P[e.kind]} at ${new Date(e.at).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" })}: ${e.label}`,
|
|
253
|
+
onClick: () => e.href ? l.navigate(e.href) : void 0,
|
|
254
|
+
children: Z[e.kind]
|
|
255
|
+
},
|
|
256
|
+
`${e.kind}-${e.at}-${e.label}`
|
|
257
|
+
)),
|
|
258
|
+
o && /* @__PURE__ */ c(
|
|
259
|
+
"div",
|
|
260
|
+
{
|
|
261
|
+
className: "pointer-events-none absolute top-1 rounded-md border border-[var(--cc-border)] bg-[var(--cc-panel)] px-2 py-1 text-[11px] shadow-sm",
|
|
262
|
+
style: a.x(o.hour) > N / 2 ? { right: `${((1 - a.x(o.hour) / N) * 100 + 3).toFixed(1)}%` } : { left: `${(a.x(o.hour) / N * 100 + 3).toFixed(1)}%` },
|
|
263
|
+
"aria-live": "polite",
|
|
264
|
+
children: [
|
|
265
|
+
/* @__PURE__ */ c("p", { className: "font-medium text-[var(--cc-strong)]", children: [
|
|
266
|
+
f(o.hour),
|
|
267
|
+
"–",
|
|
268
|
+
f(o.hour + 1)
|
|
269
|
+
] }),
|
|
270
|
+
$.map((e) => /* @__PURE__ */ c("p", { className: "flex items-center gap-1.5 tabular-nums text-[var(--cc-text)]", children: [
|
|
271
|
+
/* @__PURE__ */ t(
|
|
272
|
+
"span",
|
|
273
|
+
{
|
|
274
|
+
className: "inline-block h-0.5 w-2.5 rounded",
|
|
275
|
+
style: { background: p(e) },
|
|
276
|
+
"aria-hidden": !0
|
|
277
|
+
}
|
|
278
|
+
),
|
|
279
|
+
v[e].label,
|
|
280
|
+
": ",
|
|
281
|
+
o[e] == null ? "—" : o[e]
|
|
282
|
+
] }, e))
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
] }),
|
|
287
|
+
/* @__PURE__ */ c("table", { className: "sr-only", children: [
|
|
288
|
+
/* @__PURE__ */ t("caption", { children: "Transitions per hour" }),
|
|
289
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ c("tr", { children: [
|
|
290
|
+
/* @__PURE__ */ t("th", { scope: "col", children: "Hour" }),
|
|
291
|
+
$.map((e) => /* @__PURE__ */ t("th", { scope: "col", children: v[e].label }, e))
|
|
292
|
+
] }) }),
|
|
293
|
+
/* @__PURE__ */ t("tbody", { children: r.hours.map((e) => /* @__PURE__ */ c("tr", { children: [
|
|
294
|
+
/* @__PURE__ */ t("th", { scope: "row", children: f(e.hour) }),
|
|
295
|
+
/* @__PURE__ */ t("td", { children: e.today ?? "not yet" }),
|
|
296
|
+
/* @__PURE__ */ t("td", { children: e.yesterday }),
|
|
297
|
+
/* @__PURE__ */ t("td", { children: e.avg7 })
|
|
298
|
+
] }, e.hour)) })
|
|
299
|
+
] })
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
export {
|
|
305
|
+
re as ThroughputPanel,
|
|
306
|
+
f as hourLabel,
|
|
307
|
+
Q as hourOfDay,
|
|
308
|
+
G as niceMax,
|
|
309
|
+
X as throughputSummary
|
|
310
|
+
};
|