durable-actors-observer 0.15.0 → 0.17.0
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/client/DatatContext.d.ts +2 -0
- package/dist/client/cacheKeys.d.ts +1 -3
- package/dist/client/events.d.ts +22 -0
- package/dist/components/actorType/timingCard.d.ts +1 -2
- package/dist/components/ui/residencyBar.d.ts +3 -4
- package/dist/components/ui/statCard.d.ts +1 -2
- package/dist/components/ui/trendCard.d.ts +2 -11
- package/dist/format.d.ts +1 -2
- package/dist/hooks/useActorRequests.d.ts +2 -3
- package/dist/hooks/useActors.d.ts +3 -3
- package/dist/hooks/useLiveView.d.ts +11 -0
- package/dist/hooks/useNow.d.ts +2 -0
- package/dist/hooks/useRequests.d.ts +3 -3
- package/dist/hooks/useWebSockets.d.ts +3 -3
- package/dist/index.js +1327 -1153
- package/dist/lib/requestStats.d.ts +0 -3
- package/dist/lib/sockets.d.ts +1 -1
- package/dist/lib/timeRange.d.ts +3 -2
- package/dist/lib/views/actors.d.ts +6 -0
- package/dist/lib/views/logs.d.ts +15 -0
- package/dist/lib/views/requests.d.ts +8 -0
- package/dist/lib/views/residency.d.ts +4 -0
- package/dist/lib/views/sockets.d.ts +5 -0
- package/dist/standalone/app.css +1 -1
- package/dist/standalone/app.js +15 -15
- package/dist/theme.css +1 -1
- package/dist/types/Actors.d.ts +13 -6
- package/dist/types/Events.d.ts +71 -0
- package/dist/types/Overview.d.ts +0 -8
- package/dist/types/Requests.d.ts +1 -3
- package/dist/types/Sockets.d.ts +10 -5
- package/package.json +1 -1
- package/dist/client/streams/actorStream.d.ts +0 -2
- package/dist/client/streams/logStream.d.ts +0 -2
- package/dist/client/streams/requestStream.d.ts +0 -2
- package/dist/components/overview/trendCard.d.ts +0 -22
- package/dist/components/ui/delta.d.ts +0 -5
- package/dist/hooks/useWindowedSWR.d.ts +0 -5
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Fragment as e, createContext as t, useContext as n, useEffect as r, useId as i, useRef as a, useState as o } from "react";
|
|
2
|
-
import s from "swr";
|
|
3
|
-
import c from "swr/subscription";
|
|
2
|
+
import s, { useSWRConfig as c } from "swr";
|
|
4
3
|
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
5
4
|
import { Link as f, Navigate as p, Route as m, Routes as h, useLocation as g, useParams as _ } from "react-router";
|
|
6
5
|
import { ArrowLeft as v, ArrowRight as y, CalendarIcon as ee, Check as te, ChevronDownIcon as ne, ChevronLeftIcon as re, ChevronRight as ie, ChevronRightIcon as ae, ChevronsDownUp as oe, ChevronsUpDown as se, Columns3 as ce, Copy as le, Pause as ue, Play as de, Search as fe, X as pe } from "lucide-react";
|
|
@@ -9,20 +8,16 @@ import { cva as he } from "class-variance-authority";
|
|
|
9
8
|
import { clsx as ge } from "clsx";
|
|
10
9
|
import { twMerge as _e } from "tailwind-merge";
|
|
11
10
|
import { DayPicker as ve, getDefaultClassNames as ye } from "react-day-picker";
|
|
12
|
-
import * as
|
|
13
|
-
import * as
|
|
14
|
-
import { Drawer as
|
|
15
|
-
import
|
|
11
|
+
import * as b from "@radix-ui/react-popover";
|
|
12
|
+
import * as x from "@radix-ui/react-tooltip";
|
|
13
|
+
import { Drawer as S } from "vaul";
|
|
14
|
+
import be from "swr/infinite";
|
|
16
15
|
//#region src/client/cacheKeys.ts
|
|
17
|
-
var
|
|
18
|
-
"requests/events",
|
|
19
|
-
e,
|
|
20
|
-
t
|
|
21
|
-
], Ee = (e, t) => [
|
|
16
|
+
var xe = (e) => ["actors", e], Se = (e) => ["requests", e], Ce = (e, t) => [
|
|
22
17
|
"residency",
|
|
23
18
|
e,
|
|
24
19
|
t
|
|
25
|
-
],
|
|
20
|
+
], we = (e) => ["websockets", e], Te = (e, { actorName: t, actorId: n, requestId: r, level: i, search: a }) => [
|
|
26
21
|
"logs",
|
|
27
22
|
e,
|
|
28
23
|
t,
|
|
@@ -30,22 +25,22 @@ var Se = (e) => ["actors", e], Ce = (e) => ["actors/events", e], we = (e) => ["r
|
|
|
30
25
|
r,
|
|
31
26
|
i,
|
|
32
27
|
a
|
|
33
|
-
],
|
|
28
|
+
], Ee = (e, { actorName: t, actorId: n, requestId: r, search: i }) => [
|
|
34
29
|
"logs/histogram",
|
|
35
30
|
e,
|
|
36
31
|
t,
|
|
37
32
|
n,
|
|
38
33
|
r,
|
|
39
34
|
i
|
|
40
|
-
],
|
|
35
|
+
], De = (e, t) => ["logs/streamed", ...Te(e, t).slice(1)], Oe = 500, ke = 20, Ae = "/api/observe", je = 200, C = class {
|
|
41
36
|
baseUrl;
|
|
42
|
-
constructor(e =
|
|
37
|
+
constructor(e = Ae) {
|
|
43
38
|
this.baseUrl = e;
|
|
44
39
|
}
|
|
45
40
|
async listActorTypes() {
|
|
46
41
|
return await this.get("actors");
|
|
47
42
|
}
|
|
48
|
-
async listRequests({ fromMs: e, toMs: t, limit: n =
|
|
43
|
+
async listRequests({ fromMs: e, toMs: t, limit: n = Oe, cursor: r, actorName: i, actorId: a }) {
|
|
49
44
|
let o = new URLSearchParams({
|
|
50
45
|
fromMs: String(e),
|
|
51
46
|
toMs: String(t),
|
|
@@ -65,11 +60,11 @@ var Se = (e) => ["actors", e], Ce = (e) => ["actors/events", e], we = (e) => ["r
|
|
|
65
60
|
return await this.get("websockets");
|
|
66
61
|
}
|
|
67
62
|
async listLogs(e, { fromMs: t, toMs: n }, r) {
|
|
68
|
-
let i =
|
|
69
|
-
return i.set("fromMs", String(t)), i.set("toMs", String(n)), i.set("limit", String(
|
|
63
|
+
let i = Me(e);
|
|
64
|
+
return i.set("fromMs", String(t)), i.set("toMs", String(n)), i.set("limit", String(je)), r && i.set("cursor", r), await this.get(`logs?${i}`);
|
|
70
65
|
}
|
|
71
66
|
async getLogHistogram(e, { fromMs: t, toMs: n }, r) {
|
|
72
|
-
let i =
|
|
67
|
+
let i = Me({
|
|
73
68
|
...e,
|
|
74
69
|
level: null
|
|
75
70
|
});
|
|
@@ -77,7 +72,7 @@ var Se = (e) => ["actors", e], Ce = (e) => ["actors/events", e], we = (e) => ["r
|
|
|
77
72
|
}
|
|
78
73
|
async collectRequests(e, t = {}) {
|
|
79
74
|
let n = [], r;
|
|
80
|
-
for (let i = 0; i <
|
|
75
|
+
for (let i = 0; i < ke; i++) {
|
|
81
76
|
let i = await this.listRequests({
|
|
82
77
|
...e,
|
|
83
78
|
...t,
|
|
@@ -99,93 +94,231 @@ var Se = (e) => ["actors", e], Ce = (e) => ["actors/events", e], we = (e) => ["r
|
|
|
99
94
|
return await t.json();
|
|
100
95
|
}
|
|
101
96
|
};
|
|
102
|
-
function
|
|
97
|
+
function Me({ actorName: e, actorId: t, requestId: n, level: r, search: i }) {
|
|
103
98
|
let a = new URLSearchParams({
|
|
104
99
|
actorName: e,
|
|
105
100
|
actorId: t
|
|
106
101
|
});
|
|
107
102
|
return n && a.set("requestId", n), r && a.set("level", r), i && a.set("search", i), a;
|
|
108
103
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region src/hooks/useActors.ts
|
|
117
|
-
function Le(e) {
|
|
118
|
-
let { data: t, error: n, isLoading: r } = s(Se(e), () => new S(e).listActorTypes()), { data: i } = c(Ce(e), (t, { next: n }) => Ie(e, (e) => n(null, e)));
|
|
104
|
+
function Ne(e, t) {
|
|
105
|
+
let n = new Map(e.actors.map((e) => [e.actorName, {
|
|
106
|
+
...e,
|
|
107
|
+
instances: [...e.instances]
|
|
108
|
+
}])), r = { ...e.gateways };
|
|
109
|
+
for (let e of t) Fe(n, r, e);
|
|
119
110
|
return {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
isError: !i && !!n,
|
|
123
|
-
error: n
|
|
111
|
+
actors: [...n.values()].sort((e, t) => e.actorName.localeCompare(t.actorName)),
|
|
112
|
+
gateways: r
|
|
124
113
|
};
|
|
125
114
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return s([...e, ...Be(t)], () => n(Ve(t)), r);
|
|
115
|
+
function Pe({ actors: e, gateways: t }, n) {
|
|
116
|
+
let r = (e) => {
|
|
117
|
+
let r = t?.[e];
|
|
118
|
+
return r === void 0 || r + 3e4 >= n;
|
|
119
|
+
};
|
|
120
|
+
return {
|
|
121
|
+
gateways: t,
|
|
122
|
+
actors: e.map((e) => Re(e, e.instances.map((e) => Le(e, r, n)).filter((e) => e.reportedAtMs !== null || e.connections.length > 0)))
|
|
123
|
+
};
|
|
136
124
|
}
|
|
137
|
-
function
|
|
138
|
-
|
|
125
|
+
function Fe(e, t, n) {
|
|
126
|
+
let r = (e, n) => t[e] = Math.max(t[e] ?? 0, n);
|
|
127
|
+
switch (n.type) {
|
|
128
|
+
case "instance": {
|
|
129
|
+
let { actorName: t, actorId: r, ...i } = n.item, a = Ie(e, t, r), o = e.get(t).instances[a];
|
|
130
|
+
if ((o.reportedAtMs ?? 0) > i.reportedAtMs) return;
|
|
131
|
+
let { status: s, reportedAtMs: c, staleAtMs: l, lastActiveAtMs: u, waiting: d } = i;
|
|
132
|
+
e.get(t).instances[a] = {
|
|
133
|
+
...o,
|
|
134
|
+
status: s,
|
|
135
|
+
reportedAtMs: c,
|
|
136
|
+
staleAtMs: l,
|
|
137
|
+
lastActiveAtMs: u,
|
|
138
|
+
waiting: d
|
|
139
|
+
};
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
case "connectionOpened": {
|
|
143
|
+
let { actorName: t, actorId: i, connectionId: a, gatewayId: o, metadata: s, openedAtMs: c } = n.item, l = Ie(e, t, i), u = e.get(t).instances[l];
|
|
144
|
+
u.connections.some((e) => e.id === a) || (e.get(t).instances[l] = {
|
|
145
|
+
...u,
|
|
146
|
+
connections: [...u.connections, {
|
|
147
|
+
id: a,
|
|
148
|
+
gatewayId: o,
|
|
149
|
+
metadata: s
|
|
150
|
+
}]
|
|
151
|
+
}), r(o, c);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
case "connectionClosed": {
|
|
155
|
+
let { actorName: t, actorId: i, connectionId: a, gatewayId: o, closedAtMs: s } = n.item, c = e.get(t), l = c?.instances.findIndex((e) => e.actorId === i) ?? -1;
|
|
156
|
+
c && l >= 0 && (c.instances[l] = {
|
|
157
|
+
...c.instances[l],
|
|
158
|
+
connections: c.instances[l].connections.filter((e) => e.id !== a)
|
|
159
|
+
}), r(o, s);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
case "gatewayAlive":
|
|
163
|
+
r(n.item.gatewayId, n.item.atMs);
|
|
164
|
+
return;
|
|
165
|
+
case "deployment": {
|
|
166
|
+
let t = new Map(n.item.actors.map((e) => [e.actorName, e.methods]));
|
|
167
|
+
for (let [n, r] of e) e.set(n, {
|
|
168
|
+
...r,
|
|
169
|
+
methods: t.get(n)
|
|
170
|
+
});
|
|
171
|
+
for (let [n, r] of t) e.has(n) || e.set(n, {
|
|
172
|
+
...ze(n),
|
|
173
|
+
methods: r
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
139
177
|
}
|
|
140
|
-
function
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
178
|
+
function Ie(e, t, n) {
|
|
179
|
+
e.has(t) || e.set(t, ze(t));
|
|
180
|
+
let r = e.get(t), i = r.instances.findIndex((e) => e.actorId === n);
|
|
181
|
+
return i >= 0 ? i : (r.instances.push({
|
|
182
|
+
actorId: n,
|
|
183
|
+
status: "dormant",
|
|
184
|
+
lastActiveAtMs: null,
|
|
185
|
+
reportedAtMs: null,
|
|
186
|
+
staleAtMs: null,
|
|
187
|
+
connections: [],
|
|
188
|
+
waiting: null
|
|
189
|
+
}), r.instances.length - 1);
|
|
190
|
+
}
|
|
191
|
+
function Le(e, t, n) {
|
|
192
|
+
let r = e.staleAtMs != null && n > e.staleAtMs;
|
|
193
|
+
return {
|
|
194
|
+
...e,
|
|
195
|
+
status: r ? "unknown" : e.status,
|
|
196
|
+
waiting: r ? null : e.waiting,
|
|
197
|
+
connections: e.connections.filter((e) => t(e.gatewayId))
|
|
144
198
|
};
|
|
145
|
-
|
|
199
|
+
}
|
|
200
|
+
function Re(e, t) {
|
|
201
|
+
let n = (e) => t.filter((t) => t.status === e).length;
|
|
146
202
|
return {
|
|
147
|
-
|
|
148
|
-
|
|
203
|
+
...e,
|
|
204
|
+
instances: t,
|
|
205
|
+
live: n("live"),
|
|
206
|
+
dormant: n("dormant"),
|
|
207
|
+
unknown: n("unknown")
|
|
149
208
|
};
|
|
150
209
|
}
|
|
151
|
-
|
|
152
|
-
//#region src/hooks/useRequests.ts
|
|
153
|
-
function He(e, t) {
|
|
154
|
-
let { live: n, fromMs: r, toMs: i } = t, a = i - r, { data: o, error: s, isLoading: l } = ze(we(e), t, (t) => new S(e).collectRequests(t)), { data: u } = c(n ? Te(e, a) : null, (t, { next: n }) => Re(e, (e) => n(null, (t) => Ue(t ?? [], e.records, a))));
|
|
210
|
+
function ze(e) {
|
|
155
211
|
return {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
212
|
+
actorName: e,
|
|
213
|
+
live: 0,
|
|
214
|
+
dormant: 0,
|
|
215
|
+
unknown: 0,
|
|
216
|
+
instances: []
|
|
160
217
|
};
|
|
161
218
|
}
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/types/Events.ts
|
|
221
|
+
var Be = [
|
|
222
|
+
"request",
|
|
223
|
+
"log",
|
|
224
|
+
"instance",
|
|
225
|
+
"connectionOpened",
|
|
226
|
+
"connectionClosed",
|
|
227
|
+
"gatewayAlive",
|
|
228
|
+
"deployment"
|
|
229
|
+
], Ve = 1e4, He = class {
|
|
230
|
+
listeners = /* @__PURE__ */ new Set();
|
|
231
|
+
reconnectListeners = /* @__PURE__ */ new Set();
|
|
232
|
+
recent = [];
|
|
233
|
+
subscribe(e) {
|
|
234
|
+
return this.listeners.add(e), () => this.listeners.delete(e);
|
|
235
|
+
}
|
|
236
|
+
onReconnect(e) {
|
|
237
|
+
return this.reconnectListeners.add(e), () => this.reconnectListeners.delete(e);
|
|
238
|
+
}
|
|
239
|
+
reset() {
|
|
240
|
+
this.recent = [];
|
|
241
|
+
}
|
|
242
|
+
recentEvents() {
|
|
243
|
+
let e = Date.now() - Ve;
|
|
244
|
+
return this.recent.filter((t) => t.atMs >= e).map((e) => e.event);
|
|
245
|
+
}
|
|
246
|
+
publish(e) {
|
|
247
|
+
let t = Date.now();
|
|
248
|
+
this.recent = [...this.recent.filter((e) => e.atMs >= t - Ve), ...e.map((e) => ({
|
|
249
|
+
atMs: t,
|
|
250
|
+
event: e
|
|
251
|
+
}))];
|
|
252
|
+
for (let t of this.listeners) t(e);
|
|
253
|
+
}
|
|
254
|
+
reconnected() {
|
|
255
|
+
for (let e of this.reconnectListeners) e();
|
|
256
|
+
}
|
|
257
|
+
};
|
|
162
258
|
function Ue(e, t, n) {
|
|
163
|
-
let r =
|
|
164
|
-
|
|
259
|
+
let r = new EventSource(`${e}/events?${t}`, { withCredentials: !0 });
|
|
260
|
+
for (let e of Be) r.addEventListener(e, (t) => n.publish(JSON.parse(t.data).map((t) => ({
|
|
261
|
+
type: e,
|
|
262
|
+
item: t
|
|
263
|
+
}))));
|
|
264
|
+
let i = !1;
|
|
265
|
+
return r.addEventListener("open", () => {
|
|
266
|
+
i && n.reconnected(), i = !0;
|
|
267
|
+
}), () => r.close();
|
|
165
268
|
}
|
|
166
269
|
//#endregion
|
|
167
|
-
//#region src/hooks/
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
270
|
+
//#region src/hooks/useLiveView.ts
|
|
271
|
+
function w(e, t, n, i, o) {
|
|
272
|
+
let c = a(n);
|
|
273
|
+
c.current = n;
|
|
274
|
+
let l = s(e, async () => {
|
|
275
|
+
let e = await t();
|
|
276
|
+
return i ? c.current(e, i.recentEvents()) : e;
|
|
277
|
+
}, o), { mutate: u } = l;
|
|
278
|
+
return r(() => {
|
|
279
|
+
if (!i) return;
|
|
280
|
+
let e = i.subscribe((e) => void u((t) => t === void 0 ? t : c.current(t, e), { revalidate: !1 })), t = i.onReconnect(() => void u());
|
|
281
|
+
return () => {
|
|
282
|
+
e(), t();
|
|
283
|
+
};
|
|
284
|
+
}, [i, u]), l;
|
|
285
|
+
}
|
|
286
|
+
function We(e, t) {
|
|
287
|
+
let [n] = o(() => new He()), i = t?.toString() ?? null;
|
|
288
|
+
return r(() => {
|
|
289
|
+
if (i !== null) return n.reset(), Ue(e, new URLSearchParams(i), n);
|
|
290
|
+
}, [
|
|
291
|
+
e,
|
|
292
|
+
n,
|
|
293
|
+
i
|
|
294
|
+
]), i === null ? null : n;
|
|
295
|
+
}
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region src/hooks/useActors.ts
|
|
298
|
+
function Ge(e, t) {
|
|
299
|
+
let { data: n, error: r, isLoading: i } = w(xe(e), () => new C(e).listActorTypes(), Ne, t);
|
|
171
300
|
return {
|
|
172
|
-
|
|
173
|
-
isLoading:
|
|
174
|
-
isError: !
|
|
175
|
-
error:
|
|
301
|
+
inventory: n ?? null,
|
|
302
|
+
isLoading: i,
|
|
303
|
+
isError: !n && !!r,
|
|
304
|
+
error: r
|
|
176
305
|
};
|
|
177
306
|
}
|
|
178
307
|
//#endregion
|
|
308
|
+
//#region src/hooks/useNow.ts
|
|
309
|
+
function Ke(e) {
|
|
310
|
+
let [t, n] = o(Date.now);
|
|
311
|
+
return r(() => {
|
|
312
|
+
let t = setInterval(() => n(Date.now()), e);
|
|
313
|
+
return () => clearInterval(t);
|
|
314
|
+
}, [e]), t;
|
|
315
|
+
}
|
|
316
|
+
//#endregion
|
|
179
317
|
//#region src/format.ts
|
|
180
|
-
var
|
|
318
|
+
var qe = new Intl.NumberFormat("en-US"), Je = new Intl.NumberFormat("en-US", { maximumFractionDigits: 1 }), Ye = new Intl.NumberFormat("en-US", { maximumSignificantDigits: 2 }), Xe = new Intl.NumberFormat("en-US", {
|
|
181
319
|
style: "percent",
|
|
182
320
|
minimumFractionDigits: 1,
|
|
183
321
|
maximumFractionDigits: 1
|
|
184
|
-
}), Xe = new Intl.NumberFormat("en-US", {
|
|
185
|
-
style: "percent",
|
|
186
|
-
signDisplay: "exceptZero",
|
|
187
|
-
minimumFractionDigits: 1,
|
|
188
|
-
maximumFractionDigits: 1
|
|
189
322
|
}), Ze = new Intl.DateTimeFormat("en-US", {
|
|
190
323
|
hour: "2-digit",
|
|
191
324
|
minute: "2-digit",
|
|
@@ -214,21 +347,27 @@ var Ke = new Intl.NumberFormat("en-US"), qe = new Intl.NumberFormat("en-US", { m
|
|
|
214
347
|
second: "2-digit",
|
|
215
348
|
fractionalSecondDigits: 3,
|
|
216
349
|
hourCycle: "h23"
|
|
217
|
-
}), nt = (e, t) => (n, r) => `${e.format(n)} – ${new Date(n).toDateString() === new Date(r).toDateString() ? t.format(r) : e.format(r)}`,
|
|
350
|
+
}), nt = (e, t) => (n, r) => `${e.format(n)} – ${new Date(n).toDateString() === new Date(r).toDateString() ? t.format(r) : e.format(r)}`, T = (e) => Ze.format(e), rt = (e) => $e.format(e), it = (e) => et.format(e), at = (e, t) => (t < 864e5 ? Ze : Qe).format(e), ot = nt(Qe, Ze), st = nt(et, $e), ct = (e) => tt.format(e), E = (e) => qe.format(e), lt = (e) => Je.format(e), ut = (e) => Xe.format(e), D = (e) => dt(e).join("\xA0"), O = (e, t) => `${qe.format(e)} ${e === 1 ? t : `${t}s`}`;
|
|
351
|
+
function dt(e) {
|
|
352
|
+
return e >= 999.5 ? [pt(e / 1e3), "s"] : e >= .9995 || e === 0 ? [pt(e), "ms"] : [pt(e * 1e3), "µs"];
|
|
353
|
+
}
|
|
218
354
|
function k(e) {
|
|
219
355
|
if (e < 6e4) return `${Math.round(e / 1e3)}\u00a0s`;
|
|
220
356
|
let t = Math.round(e / 6e4);
|
|
221
|
-
return t < 60 ? `${t}\u00a0min` : t < 2880 ? `${
|
|
357
|
+
return t < 60 ? `${t}\u00a0min` : t < 2880 ? `${Je.format(t / 60)}\u00a0h` : `${Je.format(t / 1440)}\u00a0d`;
|
|
222
358
|
}
|
|
223
|
-
function
|
|
359
|
+
function ft(e, t) {
|
|
224
360
|
let n = Math.max(0, Math.round((t - e) / 1e3));
|
|
225
361
|
return n < 60 ? `${n}\u00a0s ago` : n < 3600 ? `${Math.floor(n / 60)}\u00a0min ago` : n < 86400 ? `${Math.floor(n / 3600)}\u00a0h ago` : `${Math.floor(n / 86400)}\u00a0d ago`;
|
|
226
362
|
}
|
|
363
|
+
function pt(e) {
|
|
364
|
+
return e < 10 ? Ye.format(e) : qe.format(Math.round(e));
|
|
365
|
+
}
|
|
227
366
|
//#endregion
|
|
228
367
|
//#region src/lib/timeRange.ts
|
|
229
|
-
var
|
|
230
|
-
10 *
|
|
231
|
-
30 *
|
|
368
|
+
var mt = 1e3, A = 60 * mt, j = 60 * A, ht = 30, gt = [
|
|
369
|
+
10 * mt,
|
|
370
|
+
30 * mt,
|
|
232
371
|
A,
|
|
233
372
|
2 * A,
|
|
234
373
|
5 * A,
|
|
@@ -239,11 +378,11 @@ var ft = 1e3, A = 60 * ft, j = 60 * A, pt = 30, mt = [
|
|
|
239
378
|
6 * j,
|
|
240
379
|
12 * j,
|
|
241
380
|
24 * j
|
|
242
|
-
],
|
|
381
|
+
], _t = {
|
|
243
382
|
mode: "live",
|
|
244
383
|
durationMs: j
|
|
245
384
|
};
|
|
246
|
-
function
|
|
385
|
+
function vt() {
|
|
247
386
|
let e = Date.now();
|
|
248
387
|
return {
|
|
249
388
|
mode: "static",
|
|
@@ -251,7 +390,7 @@ function gt() {
|
|
|
251
390
|
toMs: e
|
|
252
391
|
};
|
|
253
392
|
}
|
|
254
|
-
var
|
|
393
|
+
var yt = [
|
|
255
394
|
{
|
|
256
395
|
label: "Last 15 minutes",
|
|
257
396
|
durationMs: 15 * A
|
|
@@ -273,23 +412,23 @@ var _t = [
|
|
|
273
412
|
durationMs: 168 * j
|
|
274
413
|
}
|
|
275
414
|
];
|
|
276
|
-
function
|
|
277
|
-
return
|
|
415
|
+
function bt(e) {
|
|
416
|
+
return yt.find((t) => t.durationMs === e)?.label ?? `Last ${Math.round(e / A)} minutes`;
|
|
278
417
|
}
|
|
279
|
-
function
|
|
418
|
+
function xt(e, t) {
|
|
280
419
|
let [n, r] = e.mode === "live" ? [t - e.durationMs, t] : [e.fromMs, e.toMs];
|
|
281
420
|
return {
|
|
282
421
|
fromMs: n,
|
|
283
422
|
toMs: r,
|
|
284
|
-
stepMs:
|
|
423
|
+
stepMs: Dt(r - n),
|
|
285
424
|
live: e.mode === "live"
|
|
286
425
|
};
|
|
287
426
|
}
|
|
288
|
-
function
|
|
427
|
+
function St(e, t) {
|
|
289
428
|
let [n = 0, r = 0] = t.split(":").map(Number);
|
|
290
429
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate(), n, r).getTime();
|
|
291
430
|
}
|
|
292
|
-
function
|
|
431
|
+
function Ct({ fromMs: e, toMs: t, live: n }) {
|
|
293
432
|
return n ? {
|
|
294
433
|
mode: "static",
|
|
295
434
|
fromMs: e,
|
|
@@ -306,119 +445,254 @@ function N({ fromMs: e, toMs: t, live: n }, r) {
|
|
|
306
445
|
let i = t - e;
|
|
307
446
|
return Array.from({ length: r + 1 }, (t, a) => n && a === r ? "Now" : at(e + a / r * i, i));
|
|
308
447
|
}
|
|
309
|
-
function
|
|
310
|
-
return at(
|
|
448
|
+
function wt(e, t) {
|
|
449
|
+
return at(Tt(e, t), e.toMs - e.fromMs);
|
|
311
450
|
}
|
|
312
|
-
function
|
|
451
|
+
function Tt({ fromMs: e, toMs: t, stepMs: n }, r) {
|
|
313
452
|
return Math.min(e + (r + 1) * n, t);
|
|
314
453
|
}
|
|
315
454
|
function P({ fromMs: e, toMs: t, stepMs: n }) {
|
|
316
455
|
return Math.max(1, Math.ceil((t - e) / n));
|
|
317
456
|
}
|
|
318
|
-
function
|
|
457
|
+
function Et(e, t) {
|
|
319
458
|
return t < e.fromMs || t > e.toMs ? null : Math.min(Math.floor((t - e.fromMs) / e.stepMs), P(e) - 1);
|
|
320
459
|
}
|
|
321
|
-
function
|
|
322
|
-
return
|
|
460
|
+
function Dt(e) {
|
|
461
|
+
return gt.find((t) => e / t <= ht) ?? gt.at(-1);
|
|
462
|
+
}
|
|
463
|
+
function F({ fromMs: e, toMs: t, live: n }) {
|
|
464
|
+
return n ? ["live", t - e] : [e, t];
|
|
465
|
+
}
|
|
466
|
+
function I({ fromMs: e, toMs: t, live: n }) {
|
|
467
|
+
if (!n) return {
|
|
468
|
+
fromMs: e,
|
|
469
|
+
toMs: t
|
|
470
|
+
};
|
|
471
|
+
let r = Date.now();
|
|
472
|
+
return {
|
|
473
|
+
fromMs: r - (t - e),
|
|
474
|
+
toMs: r
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region src/lib/views/requests.ts
|
|
479
|
+
function Ot(e, { actorName: t, actorId: n } = {}) {
|
|
480
|
+
return (r, i) => {
|
|
481
|
+
let a = [];
|
|
482
|
+
for (let e of i) {
|
|
483
|
+
if (e.type !== "request") continue;
|
|
484
|
+
let r = e.item;
|
|
485
|
+
(t === void 0 || r.actorName === t) && (n === void 0 || r.actorId === n) && a.push(r);
|
|
486
|
+
}
|
|
487
|
+
if (a.length === 0) return r;
|
|
488
|
+
let o = Date.now() - e;
|
|
489
|
+
return [...new Map([...r, ...a].map((e) => [e.eventId, e])).values()].filter((e) => e.startedAtMs >= o);
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
//#endregion
|
|
493
|
+
//#region src/hooks/useRequests.ts
|
|
494
|
+
function kt(e, t, n) {
|
|
495
|
+
let { data: r, error: i, isLoading: a } = w([...Se(e), ...F(t)], () => new C(e).collectRequests(I(t)), Ot(t.toMs - t.fromMs), t.live ? n : null);
|
|
496
|
+
return {
|
|
497
|
+
requests: r ?? null,
|
|
498
|
+
isLoading: a,
|
|
499
|
+
isError: !r && !!i,
|
|
500
|
+
error: i
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
//#endregion
|
|
504
|
+
//#region src/lib/views/sockets.ts
|
|
505
|
+
var At = 500;
|
|
506
|
+
function jt(e, t) {
|
|
507
|
+
let n = new Map(e.map((e) => [e.connectionId, e]));
|
|
508
|
+
for (let e of t) {
|
|
509
|
+
if (e.type === "connectionOpened" && !n.has(e.item.connectionId)) {
|
|
510
|
+
let { connectionId: t, actorName: r, actorId: i, gatewayId: a, openedAtMs: o, metadata: s } = e.item;
|
|
511
|
+
n.set(t, {
|
|
512
|
+
connectionId: t,
|
|
513
|
+
actorName: r,
|
|
514
|
+
actorId: i,
|
|
515
|
+
gatewayId: a,
|
|
516
|
+
status: "open",
|
|
517
|
+
openedAtMs: o,
|
|
518
|
+
closedAtMs: null,
|
|
519
|
+
metadata: s
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
if (e.type === "connectionClosed") {
|
|
523
|
+
let { connectionId: t, actorName: r, actorId: i, gatewayId: a, openedAtMs: o, closedAtMs: s, closeCode: c, closeReason: l, messagesIn: u, messagesOut: d } = e.item, f = n.get(t);
|
|
524
|
+
n.set(t, {
|
|
525
|
+
connectionId: t,
|
|
526
|
+
actorName: r,
|
|
527
|
+
actorId: i,
|
|
528
|
+
gatewayId: a,
|
|
529
|
+
metadata: f?.metadata,
|
|
530
|
+
status: "closed",
|
|
531
|
+
openedAtMs: f?.openedAtMs ?? o,
|
|
532
|
+
closedAtMs: s,
|
|
533
|
+
closeCode: c ?? void 0,
|
|
534
|
+
closeReason: l ?? void 0,
|
|
535
|
+
messagesIn: u ?? void 0,
|
|
536
|
+
messagesOut: d ?? void 0
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return [...n.values()].sort((e, t) => t.openedAtMs - e.openedAtMs).slice(0, At);
|
|
541
|
+
}
|
|
542
|
+
function Mt(e, t, n) {
|
|
543
|
+
return e.map((e) => {
|
|
544
|
+
if (e.status !== "open") return e;
|
|
545
|
+
let r = Math.max(t[e.gatewayId] ?? 0, e.openedAtMs);
|
|
546
|
+
return r + 3e4 >= n ? e : {
|
|
547
|
+
...e,
|
|
548
|
+
status: "lost",
|
|
549
|
+
closedAtMs: r
|
|
550
|
+
};
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
//#endregion
|
|
554
|
+
//#region src/hooks/useWebSockets.ts
|
|
555
|
+
function Nt(e, t) {
|
|
556
|
+
let { data: n, error: r, isLoading: i } = w(we(e), () => new C(e).listWebSockets(), jt, t);
|
|
557
|
+
return {
|
|
558
|
+
sessions: n ?? null,
|
|
559
|
+
isLoading: i,
|
|
560
|
+
isError: !n && !!r,
|
|
561
|
+
error: r
|
|
562
|
+
};
|
|
323
563
|
}
|
|
324
564
|
//#endregion
|
|
325
565
|
//#region src/client/TimeRangeContext.tsx
|
|
326
|
-
var
|
|
327
|
-
function
|
|
328
|
-
let [n, r] = o(e), i =
|
|
329
|
-
return /* @__PURE__ */ u(
|
|
566
|
+
var Pt = 5e3, Ft = t(void 0);
|
|
567
|
+
function It({ initialRange: e = _t, children: t }) {
|
|
568
|
+
let [n, r] = o(e), i = zt(n.mode === "live");
|
|
569
|
+
return /* @__PURE__ */ u(Ft.Provider, {
|
|
330
570
|
value: {
|
|
331
|
-
timeWindow:
|
|
571
|
+
timeWindow: xt(n, i),
|
|
332
572
|
setRange: r
|
|
333
573
|
},
|
|
334
574
|
children: t
|
|
335
575
|
});
|
|
336
576
|
}
|
|
337
|
-
function
|
|
338
|
-
return
|
|
577
|
+
function L() {
|
|
578
|
+
return Rt().timeWindow;
|
|
339
579
|
}
|
|
340
|
-
function
|
|
341
|
-
return
|
|
580
|
+
function Lt() {
|
|
581
|
+
return Rt().setRange;
|
|
342
582
|
}
|
|
343
|
-
function
|
|
344
|
-
let e = n(
|
|
583
|
+
function Rt() {
|
|
584
|
+
let e = n(Ft);
|
|
345
585
|
if (!e) throw Error("Time range hooks must be used within a TimeRangeProvider");
|
|
346
586
|
return e;
|
|
347
587
|
}
|
|
348
|
-
function
|
|
588
|
+
function zt(e) {
|
|
349
589
|
let [t, n] = o(Date.now);
|
|
350
590
|
return r(() => {
|
|
351
591
|
if (!e) return;
|
|
352
592
|
n(Date.now());
|
|
353
|
-
let t = setInterval(() => n(Date.now()),
|
|
593
|
+
let t = setInterval(() => n(Date.now()), Pt);
|
|
354
594
|
return () => clearInterval(t);
|
|
355
595
|
}, [e]), t;
|
|
356
596
|
}
|
|
357
597
|
//#endregion
|
|
358
598
|
//#region src/client/DatatContext.tsx
|
|
359
|
-
var
|
|
360
|
-
let {
|
|
361
|
-
return /* @__PURE__ */ u(
|
|
599
|
+
var Bt = 5e3, Vt = new URLSearchParams({ signals: "requests,platform" }), Ht = t(void 0), Ut = ({ baseUrl: e = Ae, children: t }) => {
|
|
600
|
+
let n = We(e, Vt), r = Ke(Bt), { inventory: i, isError: a } = Ge(e, n), { requests: o, isError: s } = kt(e, L(), n), { sessions: c, isError: l } = Nt(e, n);
|
|
601
|
+
return /* @__PURE__ */ u(Ht.Provider, {
|
|
362
602
|
value: {
|
|
363
603
|
baseUrl: e,
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
604
|
+
events: n,
|
|
605
|
+
actorTypes: i && Pe(i, r),
|
|
606
|
+
isError: a,
|
|
607
|
+
requests: o,
|
|
608
|
+
isRequestsError: s,
|
|
609
|
+
sessions: c && Mt(c, i?.gateways ?? {}, r),
|
|
610
|
+
isSocketsError: l
|
|
370
611
|
},
|
|
371
612
|
children: t
|
|
372
613
|
});
|
|
373
|
-
},
|
|
374
|
-
let e = n(
|
|
614
|
+
}, R = () => {
|
|
615
|
+
let e = n(Ht);
|
|
375
616
|
if (!e) throw Error("useData must be used within a DataProvider");
|
|
376
617
|
return e;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
618
|
+
};
|
|
619
|
+
//#endregion
|
|
620
|
+
//#region src/hooks/useActorRequests.ts
|
|
621
|
+
function Wt(e) {
|
|
622
|
+
return Kt({ actorName: e });
|
|
380
623
|
}
|
|
381
|
-
function
|
|
382
|
-
return
|
|
624
|
+
function Gt(e, t) {
|
|
625
|
+
return Kt({
|
|
383
626
|
actorName: e,
|
|
384
627
|
actorId: t
|
|
385
628
|
});
|
|
386
629
|
}
|
|
387
|
-
function
|
|
388
|
-
let { baseUrl: t,
|
|
389
|
-
...
|
|
630
|
+
function Kt(e) {
|
|
631
|
+
let { baseUrl: t, events: n } = R(), r = L(), { data: i, error: a, isLoading: o } = w([
|
|
632
|
+
...Se(t),
|
|
390
633
|
e.actorName,
|
|
391
|
-
e.actorId
|
|
392
|
-
|
|
634
|
+
e.actorId,
|
|
635
|
+
...F(r)
|
|
636
|
+
], () => new C(t).collectRequests(I(r), e), Ot(r.toMs - r.fromMs, e), r.live ? n : null);
|
|
393
637
|
return {
|
|
394
|
-
requests: i
|
|
638
|
+
requests: i?.filter((e) => e.startedAtMs >= r.fromMs) ?? null,
|
|
395
639
|
isLoading: o,
|
|
396
640
|
isError: !i && !!a,
|
|
397
641
|
error: a
|
|
398
642
|
};
|
|
399
643
|
}
|
|
400
|
-
|
|
401
|
-
|
|
644
|
+
//#endregion
|
|
645
|
+
//#region src/lib/views/residency.ts
|
|
646
|
+
function qt(e) {
|
|
647
|
+
return (t, n) => {
|
|
648
|
+
let r = [...t.periods];
|
|
649
|
+
for (let t of n) t.type === "instance" && t.item.actorName === e && Jt(r, t);
|
|
650
|
+
return {
|
|
651
|
+
...t,
|
|
652
|
+
periods: r
|
|
653
|
+
};
|
|
654
|
+
};
|
|
402
655
|
}
|
|
403
|
-
function
|
|
404
|
-
|
|
656
|
+
function Jt(e, { item: t }) {
|
|
657
|
+
let { actorId: n, status: r, occurredAtMs: i } = t, a = Yt(e, n), o = e[a];
|
|
658
|
+
if (!(o && i <= o.fromMs)) {
|
|
659
|
+
if (o?.status === r) {
|
|
660
|
+
e[a] = {
|
|
661
|
+
...o,
|
|
662
|
+
toMs: Math.max(o.toMs, i)
|
|
663
|
+
};
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
o && (e[a] = {
|
|
667
|
+
...o,
|
|
668
|
+
toMs: i
|
|
669
|
+
}), e.push({
|
|
670
|
+
actorId: n,
|
|
671
|
+
status: r,
|
|
672
|
+
fromMs: i,
|
|
673
|
+
toMs: i
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
function Yt(e, t) {
|
|
678
|
+
for (let n = e.length - 1; n >= 0; n--) if (e[n].actorId === t) return n;
|
|
679
|
+
return -1;
|
|
405
680
|
}
|
|
406
681
|
//#endregion
|
|
407
682
|
//#region src/hooks/useResidency.ts
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
let { baseUrl: n } = I(), { data: r, error: i, isLoading: a } = ze(Ee(n, e), t, (t) => new S(n).listResidency(e, t), { refreshInterval: t.live ? Bt : 0 });
|
|
683
|
+
function Xt(e, t) {
|
|
684
|
+
let { baseUrl: n, events: r } = R(), { data: i, error: a, isLoading: o } = w([...Ce(n, e), ...F(t)], () => new C(n).listResidency(e, I(t)), qt(e), t.live ? r : null);
|
|
411
685
|
return {
|
|
412
|
-
residency:
|
|
413
|
-
isLoading:
|
|
414
|
-
isError: !
|
|
415
|
-
error:
|
|
686
|
+
residency: i ?? null,
|
|
687
|
+
isLoading: o,
|
|
688
|
+
isError: !i && !!a,
|
|
689
|
+
error: a
|
|
416
690
|
};
|
|
417
691
|
}
|
|
418
692
|
//#endregion
|
|
419
693
|
//#region src/lib/actorTypes.ts
|
|
420
|
-
var
|
|
421
|
-
function
|
|
694
|
+
var Zt = (e) => `actors/${encodeURIComponent(e)}`, Qt = (e) => `instances/${encodeURIComponent(e)}`;
|
|
695
|
+
function z({ actorName: e, instances: t }) {
|
|
422
696
|
return {
|
|
423
697
|
actorName: e,
|
|
424
698
|
total: t.length,
|
|
@@ -426,79 +700,71 @@ function L({ actorName: e, instances: t }) {
|
|
|
426
700
|
dormant: t.filter((e) => e.status === "dormant").length
|
|
427
701
|
};
|
|
428
702
|
}
|
|
429
|
-
function
|
|
703
|
+
function $t(e) {
|
|
430
704
|
return [...e].sort((e, t) => (t.lastActiveAtMs ?? 0) - (e.lastActiveAtMs ?? 0));
|
|
431
705
|
}
|
|
432
706
|
//#endregion
|
|
433
707
|
//#region src/lib/requestStats.ts
|
|
434
|
-
var
|
|
435
|
-
function
|
|
436
|
-
let r = en(e, n);
|
|
708
|
+
var B = (e) => e.queueWaitMs, V = (e) => e.durationMs - (e.queueWaitMs ?? 0);
|
|
709
|
+
function en(e, t, n) {
|
|
437
710
|
return {
|
|
438
|
-
average:
|
|
439
|
-
|
|
440
|
-
max: r.length ? Math.max(...r) : 0,
|
|
441
|
-
series: tn(e, t, n)
|
|
711
|
+
average: cn(ln(e, n)),
|
|
712
|
+
series: un(e, t, n)
|
|
442
713
|
};
|
|
443
714
|
}
|
|
444
|
-
function
|
|
445
|
-
return
|
|
715
|
+
function tn(e, t) {
|
|
716
|
+
return nn(e, t).map((e) => e / (t.stepMs / 1e3));
|
|
446
717
|
}
|
|
447
|
-
function
|
|
718
|
+
function nn(e, t) {
|
|
448
719
|
let n = Array(P(t)).fill(0);
|
|
449
|
-
for (let r of
|
|
450
|
-
let e =
|
|
720
|
+
for (let r of rn(e)) {
|
|
721
|
+
let e = Et(t, r.startedAtMs);
|
|
451
722
|
e !== null && (n[e] += 1);
|
|
452
723
|
}
|
|
453
724
|
return n;
|
|
454
725
|
}
|
|
455
|
-
function
|
|
726
|
+
function rn(e) {
|
|
456
727
|
return e.filter((e) => e.outcome !== "rerouted");
|
|
457
728
|
}
|
|
458
|
-
function
|
|
459
|
-
return
|
|
729
|
+
function an(e, t) {
|
|
730
|
+
return rn(e).filter((e) => sn(e, t));
|
|
460
731
|
}
|
|
461
|
-
function
|
|
462
|
-
let r = e.filter((e) => e.kind === "websocket" && e.connectionId === t &&
|
|
732
|
+
function on(e, t, n) {
|
|
733
|
+
let r = e.filter((e) => e.kind === "websocket" && e.connectionId === t && sn(e, n));
|
|
463
734
|
return {
|
|
464
735
|
messages: r.filter((e) => e.operation === "onMessage").length,
|
|
465
736
|
failures: r.filter((e) => e.outcome !== "completed" && e.outcome !== "rerouted").length
|
|
466
737
|
};
|
|
467
738
|
}
|
|
468
|
-
function
|
|
739
|
+
function sn(e, t) {
|
|
469
740
|
return e.startedAtMs <= t.toMs && e.startedAtMs + e.durationMs >= t.fromMs;
|
|
470
741
|
}
|
|
471
|
-
function
|
|
472
|
-
let n =
|
|
473
|
-
return n.length ?
|
|
742
|
+
function H(e, t) {
|
|
743
|
+
let n = ln(e, t);
|
|
744
|
+
return n.length ? cn(n) : null;
|
|
474
745
|
}
|
|
475
|
-
function
|
|
746
|
+
function cn(e) {
|
|
476
747
|
return e.length ? e.reduce((e, t) => e + t, 0) / e.length : 0;
|
|
477
748
|
}
|
|
478
|
-
function
|
|
479
|
-
if (!e.length) return 0;
|
|
480
|
-
let n = [...e].sort((e, t) => e - t);
|
|
481
|
-
return n[Math.min(n.length - 1, Math.ceil(t * n.length) - 1)];
|
|
482
|
-
}
|
|
483
|
-
function en(e, t) {
|
|
749
|
+
function ln(e, t) {
|
|
484
750
|
return e.map(t).filter((e) => e !== null);
|
|
485
751
|
}
|
|
486
|
-
function
|
|
752
|
+
function un(e, t, n) {
|
|
487
753
|
let r = Array.from({ length: P(t) }, () => []);
|
|
488
754
|
for (let i of e) {
|
|
489
|
-
let e =
|
|
755
|
+
let e = Et(t, i.startedAtMs), a = n(i);
|
|
490
756
|
e !== null && a !== null && r[e].push(a);
|
|
491
757
|
}
|
|
492
|
-
return r.map(
|
|
758
|
+
return r.map(cn);
|
|
493
759
|
}
|
|
494
760
|
//#endregion
|
|
495
761
|
//#region src/lib/utils.ts
|
|
496
|
-
function
|
|
762
|
+
function U(...e) {
|
|
497
763
|
return _e(ge(e));
|
|
498
764
|
}
|
|
499
765
|
//#endregion
|
|
500
766
|
//#region src/components/ui/button.tsx
|
|
501
|
-
var
|
|
767
|
+
var dn = he("inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
502
768
|
variants: {
|
|
503
769
|
variant: {
|
|
504
770
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
@@ -524,12 +790,12 @@ var nn = he("inline-flex shrink-0 cursor-pointer items-center justify-center gap
|
|
|
524
790
|
size: "default"
|
|
525
791
|
}
|
|
526
792
|
});
|
|
527
|
-
function
|
|
793
|
+
function W({ className: e, variant: t = "default", size: n = "default", asChild: r = !1, ...i }) {
|
|
528
794
|
return /* @__PURE__ */ u(r ? me : "button", {
|
|
529
795
|
"data-slot": "button",
|
|
530
796
|
"data-variant": t,
|
|
531
797
|
"data-size": n,
|
|
532
|
-
className:
|
|
798
|
+
className: U(dn({
|
|
533
799
|
variant: t,
|
|
534
800
|
size: n,
|
|
535
801
|
className: e
|
|
@@ -539,56 +805,56 @@ function H({ className: e, variant: t = "default", size: n = "default", asChild:
|
|
|
539
805
|
}
|
|
540
806
|
//#endregion
|
|
541
807
|
//#region src/components/ui/calendar.tsx
|
|
542
|
-
function
|
|
808
|
+
function fn({ className: e, classNames: t, showOutsideDays: n = !0, captionLayout: r = "label", buttonVariant: i = "ghost", formatters: a, components: o, ...s }) {
|
|
543
809
|
let c = ye();
|
|
544
810
|
return /* @__PURE__ */ u(ve, {
|
|
545
811
|
showOutsideDays: n,
|
|
546
|
-
className:
|
|
812
|
+
className: U("group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, e),
|
|
547
813
|
captionLayout: r,
|
|
548
814
|
formatters: {
|
|
549
815
|
formatMonthDropdown: (e) => e.toLocaleString("default", { month: "short" }),
|
|
550
816
|
...a
|
|
551
817
|
},
|
|
552
818
|
classNames: {
|
|
553
|
-
root:
|
|
554
|
-
months:
|
|
555
|
-
month:
|
|
556
|
-
nav:
|
|
557
|
-
button_previous:
|
|
558
|
-
button_next:
|
|
559
|
-
month_caption:
|
|
560
|
-
dropdowns:
|
|
561
|
-
dropdown_root:
|
|
562
|
-
dropdown:
|
|
563
|
-
caption_label:
|
|
564
|
-
month_grid:
|
|
565
|
-
weekdays:
|
|
566
|
-
weekday:
|
|
567
|
-
week:
|
|
568
|
-
week_number_header:
|
|
569
|
-
week_number:
|
|
570
|
-
day:
|
|
571
|
-
range_start:
|
|
572
|
-
range_middle:
|
|
573
|
-
range_end:
|
|
574
|
-
today:
|
|
575
|
-
outside:
|
|
576
|
-
disabled:
|
|
577
|
-
hidden:
|
|
819
|
+
root: U("w-fit", c.root),
|
|
820
|
+
months: U("relative flex flex-col gap-4 md:flex-row", c.months),
|
|
821
|
+
month: U("flex w-full flex-col gap-4", c.month),
|
|
822
|
+
nav: U("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", c.nav),
|
|
823
|
+
button_previous: U(dn({ variant: i }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", c.button_previous),
|
|
824
|
+
button_next: U(dn({ variant: i }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", c.button_next),
|
|
825
|
+
month_caption: U("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", c.month_caption),
|
|
826
|
+
dropdowns: U("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", c.dropdowns),
|
|
827
|
+
dropdown_root: U("relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50", c.dropdown_root),
|
|
828
|
+
dropdown: U("absolute inset-0 bg-popover opacity-0", c.dropdown),
|
|
829
|
+
caption_label: U("font-medium select-none", r === "label" ? "text-sm" : "flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", c.caption_label),
|
|
830
|
+
month_grid: U("w-full border-collapse", c.month_grid),
|
|
831
|
+
weekdays: U("flex", c.weekdays),
|
|
832
|
+
weekday: U("flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none", c.weekday),
|
|
833
|
+
week: U("mt-2 flex w-full", c.week),
|
|
834
|
+
week_number_header: U("w-(--cell-size) select-none", c.week_number_header),
|
|
835
|
+
week_number: U("text-[0.8rem] text-muted-foreground select-none", c.week_number),
|
|
836
|
+
day: U("group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-md", s.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md", c.day),
|
|
837
|
+
range_start: U("rounded-l-md bg-accent", c.range_start),
|
|
838
|
+
range_middle: U("rounded-none", c.range_middle),
|
|
839
|
+
range_end: U("rounded-r-md bg-accent", c.range_end),
|
|
840
|
+
today: U("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none", c.today),
|
|
841
|
+
outside: U("text-muted-foreground aria-selected:text-muted-foreground", c.outside),
|
|
842
|
+
disabled: U("text-muted-foreground opacity-50", c.disabled),
|
|
843
|
+
hidden: U("invisible", c.hidden),
|
|
578
844
|
...t
|
|
579
845
|
},
|
|
580
846
|
components: {
|
|
581
847
|
Root: ({ className: e, rootRef: t, ...n }) => /* @__PURE__ */ u("div", {
|
|
582
848
|
"data-slot": "calendar",
|
|
583
849
|
ref: t,
|
|
584
|
-
className:
|
|
850
|
+
className: U(e),
|
|
585
851
|
...n
|
|
586
852
|
}),
|
|
587
853
|
Chevron: ({ className: e, orientation: t, ...n }) => u(t === "left" ? re : t === "right" ? ae : ne, {
|
|
588
|
-
className:
|
|
854
|
+
className: U("size-4", e),
|
|
589
855
|
...n
|
|
590
856
|
}),
|
|
591
|
-
DayButton:
|
|
857
|
+
DayButton: pn,
|
|
592
858
|
WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */ u("td", {
|
|
593
859
|
...t,
|
|
594
860
|
children: /* @__PURE__ */ u("div", {
|
|
@@ -601,11 +867,11 @@ function rn({ className: e, classNames: t, showOutsideDays: n = !0, captionLayou
|
|
|
601
867
|
...s
|
|
602
868
|
});
|
|
603
869
|
}
|
|
604
|
-
function
|
|
870
|
+
function pn({ className: e, day: t, modifiers: n, ...i }) {
|
|
605
871
|
let o = ye(), s = a(null);
|
|
606
872
|
return r(() => {
|
|
607
873
|
n.focused && s.current?.focus();
|
|
608
|
-
}, [n.focused]), /* @__PURE__ */ u(
|
|
874
|
+
}, [n.focused]), /* @__PURE__ */ u(W, {
|
|
609
875
|
ref: s,
|
|
610
876
|
variant: "ghost",
|
|
611
877
|
size: "icon",
|
|
@@ -614,70 +880,70 @@ function an({ className: e, day: t, modifiers: n, ...i }) {
|
|
|
614
880
|
"data-range-start": n.range_start,
|
|
615
881
|
"data-range-end": n.range_end,
|
|
616
882
|
"data-range-middle": n.range_middle,
|
|
617
|
-
className:
|
|
883
|
+
className: U("flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70", o.day, e),
|
|
618
884
|
...i
|
|
619
885
|
});
|
|
620
886
|
}
|
|
621
887
|
//#endregion
|
|
622
888
|
//#region src/components/ui/input.tsx
|
|
623
|
-
function
|
|
889
|
+
function mn({ className: e, type: t, ...n }) {
|
|
624
890
|
return /* @__PURE__ */ u("input", {
|
|
625
891
|
type: t,
|
|
626
892
|
"data-slot": "input",
|
|
627
|
-
className:
|
|
893
|
+
className: U("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", e),
|
|
628
894
|
...n
|
|
629
895
|
});
|
|
630
896
|
}
|
|
631
897
|
//#endregion
|
|
632
898
|
//#region src/components/ui/popover.tsx
|
|
633
|
-
function
|
|
634
|
-
return /* @__PURE__ */ u(
|
|
899
|
+
function hn(e) {
|
|
900
|
+
return /* @__PURE__ */ u(b.Root, {
|
|
635
901
|
"data-slot": "popover",
|
|
636
902
|
...e
|
|
637
903
|
});
|
|
638
904
|
}
|
|
639
|
-
function
|
|
640
|
-
return /* @__PURE__ */ u(
|
|
905
|
+
function gn(e) {
|
|
906
|
+
return /* @__PURE__ */ u(b.Trigger, {
|
|
641
907
|
"data-slot": "popover-trigger",
|
|
642
908
|
...e
|
|
643
909
|
});
|
|
644
910
|
}
|
|
645
|
-
function
|
|
646
|
-
return /* @__PURE__ */ u(
|
|
911
|
+
function _n({ className: e, align: t = "center", sideOffset: n = 4, ...r }) {
|
|
912
|
+
return /* @__PURE__ */ u(b.Portal, { children: /* @__PURE__ */ u(b.Content, {
|
|
647
913
|
"data-slot": "popover-content",
|
|
648
914
|
align: t,
|
|
649
915
|
sideOffset: n,
|
|
650
|
-
className:
|
|
916
|
+
className: U("z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", e),
|
|
651
917
|
...r
|
|
652
918
|
}) });
|
|
653
919
|
}
|
|
654
920
|
//#endregion
|
|
655
921
|
//#region src/components/timeRange/timeRangePicker.tsx
|
|
656
|
-
function
|
|
922
|
+
function vn({ timeWindow: e, onChange: t }) {
|
|
657
923
|
let [n, r] = o(!1), [i, a] = o("quick"), s = (t) => {
|
|
658
924
|
r(t), t && a(e.live ? "quick" : "custom");
|
|
659
925
|
}, c = (e) => {
|
|
660
926
|
t(e), r(!1);
|
|
661
927
|
};
|
|
662
|
-
return /* @__PURE__ */ d(
|
|
928
|
+
return /* @__PURE__ */ d(hn, {
|
|
663
929
|
open: n,
|
|
664
930
|
onOpenChange: s,
|
|
665
|
-
children: [/* @__PURE__ */ u(
|
|
931
|
+
children: [/* @__PURE__ */ u(gn, {
|
|
666
932
|
asChild: !0,
|
|
667
|
-
children: /* @__PURE__ */ d(
|
|
933
|
+
children: /* @__PURE__ */ d(W, {
|
|
668
934
|
variant: "outline",
|
|
669
935
|
size: "sm",
|
|
670
936
|
className: "text-xs tabular-nums",
|
|
671
|
-
children: [/* @__PURE__ */ u(
|
|
937
|
+
children: [/* @__PURE__ */ u(yn, { timeWindow: e }), /* @__PURE__ */ u(ne, { className: "opacity-60" })]
|
|
672
938
|
})
|
|
673
|
-
}), /* @__PURE__ */ u(
|
|
939
|
+
}), /* @__PURE__ */ u(_n, {
|
|
674
940
|
align: "end",
|
|
675
941
|
className: "w-auto p-0",
|
|
676
|
-
children: i === "quick" ? /* @__PURE__ */ u(
|
|
942
|
+
children: i === "quick" ? /* @__PURE__ */ u(bn, {
|
|
677
943
|
timeWindow: e,
|
|
678
944
|
onSelect: c,
|
|
679
945
|
onCustom: () => a("custom")
|
|
680
|
-
}) : /* @__PURE__ */ u(
|
|
946
|
+
}) : /* @__PURE__ */ u(xn, {
|
|
681
947
|
timeWindow: e,
|
|
682
948
|
onApply: c,
|
|
683
949
|
onBack: () => a("quick")
|
|
@@ -685,15 +951,15 @@ function un({ timeWindow: e, onChange: t }) {
|
|
|
685
951
|
})]
|
|
686
952
|
});
|
|
687
953
|
}
|
|
688
|
-
function
|
|
689
|
-
return n ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { className: "size-1.5 animate-pulse rounded-full bg-success motion-reduce:animate-none" }),
|
|
954
|
+
function yn({ timeWindow: { fromMs: e, toMs: t, live: n } }) {
|
|
955
|
+
return n ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { className: "size-1.5 animate-pulse rounded-full bg-success motion-reduce:animate-none" }), bt(t - e)] }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(ee, {}), ot(e, t)] });
|
|
690
956
|
}
|
|
691
|
-
function
|
|
957
|
+
function bn({ timeWindow: e, onSelect: t, onCustom: n }) {
|
|
692
958
|
let r = e.live ? e.toMs - e.fromMs : null;
|
|
693
959
|
return /* @__PURE__ */ d("div", {
|
|
694
960
|
className: "flex w-48 flex-col gap-0.5 p-1.5",
|
|
695
961
|
children: [
|
|
696
|
-
|
|
962
|
+
yt.map((e) => /* @__PURE__ */ u(W, {
|
|
697
963
|
variant: "ghost",
|
|
698
964
|
size: "sm",
|
|
699
965
|
"aria-pressed": e.durationMs === r,
|
|
@@ -701,11 +967,11 @@ function fn({ timeWindow: e, onSelect: t, onCustom: n }) {
|
|
|
701
967
|
mode: "live",
|
|
702
968
|
durationMs: e.durationMs
|
|
703
969
|
}),
|
|
704
|
-
className:
|
|
970
|
+
className: U("justify-start text-xs font-normal", e.durationMs === r && "bg-accent text-accent-foreground"),
|
|
705
971
|
children: e.label
|
|
706
972
|
}, e.durationMs)),
|
|
707
973
|
/* @__PURE__ */ u("div", { className: "my-1 border-t" }),
|
|
708
|
-
/* @__PURE__ */ d(
|
|
974
|
+
/* @__PURE__ */ d(W, {
|
|
709
975
|
variant: "ghost",
|
|
710
976
|
size: "sm",
|
|
711
977
|
onClick: n,
|
|
@@ -719,20 +985,20 @@ function fn({ timeWindow: e, onSelect: t, onCustom: n }) {
|
|
|
719
985
|
]
|
|
720
986
|
});
|
|
721
987
|
}
|
|
722
|
-
function
|
|
988
|
+
function xn({ timeWindow: e, onApply: t, onBack: n }) {
|
|
723
989
|
let [r, i] = o({
|
|
724
990
|
from: new Date(e.fromMs),
|
|
725
991
|
to: new Date(e.toMs)
|
|
726
|
-
}), [a, s] = o(
|
|
992
|
+
}), [a, s] = o(T(e.fromMs)), [c, l] = o(T(e.toMs)), f = Cn(r, a, c);
|
|
727
993
|
return /* @__PURE__ */ d("div", { children: [
|
|
728
|
-
/* @__PURE__ */ d(
|
|
994
|
+
/* @__PURE__ */ d(W, {
|
|
729
995
|
variant: "ghost",
|
|
730
996
|
size: "xs",
|
|
731
997
|
onClick: n,
|
|
732
998
|
className: "mt-2 ml-2 text-xs font-normal text-muted-foreground",
|
|
733
999
|
children: [/* @__PURE__ */ u(re, {}), "Quick ranges"]
|
|
734
1000
|
}),
|
|
735
|
-
/* @__PURE__ */ u(
|
|
1001
|
+
/* @__PURE__ */ u(fn, {
|
|
736
1002
|
mode: "range",
|
|
737
1003
|
selected: r,
|
|
738
1004
|
onSelect: i,
|
|
@@ -741,11 +1007,11 @@ function pn({ timeWindow: e, onApply: t, onBack: n }) {
|
|
|
741
1007
|
}),
|
|
742
1008
|
/* @__PURE__ */ d("div", {
|
|
743
1009
|
className: "grid grid-cols-2 gap-3 border-t p-3",
|
|
744
|
-
children: [/* @__PURE__ */ u(
|
|
1010
|
+
children: [/* @__PURE__ */ u(Sn, {
|
|
745
1011
|
label: "Start",
|
|
746
1012
|
value: a,
|
|
747
1013
|
onChange: s
|
|
748
|
-
}), /* @__PURE__ */ u(
|
|
1014
|
+
}), /* @__PURE__ */ u(Sn, {
|
|
749
1015
|
label: "End",
|
|
750
1016
|
value: c,
|
|
751
1017
|
onChange: l
|
|
@@ -753,7 +1019,7 @@ function pn({ timeWindow: e, onApply: t, onBack: n }) {
|
|
|
753
1019
|
}),
|
|
754
1020
|
/* @__PURE__ */ d("div", {
|
|
755
1021
|
className: "flex items-center justify-between gap-3 border-t p-3 text-xs text-muted-foreground tabular-nums",
|
|
756
|
-
children: [/* @__PURE__ */ u("span", { children: f ? ot(f.fromMs, f.toMs) : "End must be after start" }), /* @__PURE__ */ u(
|
|
1022
|
+
children: [/* @__PURE__ */ u("span", { children: f ? ot(f.fromMs, f.toMs) : "End must be after start" }), /* @__PURE__ */ u(W, {
|
|
757
1023
|
size: "sm",
|
|
758
1024
|
disabled: !f,
|
|
759
1025
|
onClick: () => f && t(f),
|
|
@@ -762,7 +1028,7 @@ function pn({ timeWindow: e, onApply: t, onBack: n }) {
|
|
|
762
1028
|
})
|
|
763
1029
|
] });
|
|
764
1030
|
}
|
|
765
|
-
function
|
|
1031
|
+
function Sn({ label: e, value: t, onChange: n }) {
|
|
766
1032
|
let r = i();
|
|
767
1033
|
return /* @__PURE__ */ d("div", {
|
|
768
1034
|
className: "grid gap-1.5",
|
|
@@ -770,7 +1036,7 @@ function mn({ label: e, value: t, onChange: n }) {
|
|
|
770
1036
|
htmlFor: r,
|
|
771
1037
|
className: "text-xs text-muted-foreground",
|
|
772
1038
|
children: e
|
|
773
|
-
}), /* @__PURE__ */ u(
|
|
1039
|
+
}), /* @__PURE__ */ u(mn, {
|
|
774
1040
|
id: r,
|
|
775
1041
|
type: "time",
|
|
776
1042
|
value: t,
|
|
@@ -779,9 +1045,9 @@ function mn({ label: e, value: t, onChange: n }) {
|
|
|
779
1045
|
})]
|
|
780
1046
|
});
|
|
781
1047
|
}
|
|
782
|
-
function
|
|
1048
|
+
function Cn(e, t, n) {
|
|
783
1049
|
if (!e?.from || !t || !n) return null;
|
|
784
|
-
let r =
|
|
1050
|
+
let r = St(e.from, t), i = St(e.to ?? e.from, n);
|
|
785
1051
|
return r < i ? {
|
|
786
1052
|
mode: "static",
|
|
787
1053
|
fromMs: r,
|
|
@@ -790,22 +1056,22 @@ function hn(e, t, n) {
|
|
|
790
1056
|
}
|
|
791
1057
|
//#endregion
|
|
792
1058
|
//#region src/components/timeRange/timeRangeControl.tsx
|
|
793
|
-
function
|
|
794
|
-
let e =
|
|
1059
|
+
function wn() {
|
|
1060
|
+
let e = L(), t = Lt();
|
|
795
1061
|
return /* @__PURE__ */ d("div", {
|
|
796
1062
|
className: "flex items-center gap-2",
|
|
797
|
-
children: [/* @__PURE__ */ u(
|
|
1063
|
+
children: [/* @__PURE__ */ u(vn, {
|
|
798
1064
|
timeWindow: e,
|
|
799
1065
|
onChange: t
|
|
800
|
-
}), /* @__PURE__ */ u(
|
|
1066
|
+
}), /* @__PURE__ */ u(Tn, {
|
|
801
1067
|
live: e.live,
|
|
802
|
-
onToggle: () => t(
|
|
1068
|
+
onToggle: () => t(Ct(e))
|
|
803
1069
|
})]
|
|
804
1070
|
});
|
|
805
1071
|
}
|
|
806
|
-
function
|
|
1072
|
+
function Tn({ live: e, onToggle: t }) {
|
|
807
1073
|
let n = e ? "Pause live updates" : "Resume live updates";
|
|
808
|
-
return /* @__PURE__ */ u(
|
|
1074
|
+
return /* @__PURE__ */ u(W, {
|
|
809
1075
|
variant: "outline",
|
|
810
1076
|
size: "icon-sm",
|
|
811
1077
|
"aria-label": n,
|
|
@@ -816,7 +1082,7 @@ function _n({ live: e, onToggle: t }) {
|
|
|
816
1082
|
}
|
|
817
1083
|
//#endregion
|
|
818
1084
|
//#region src/components/ui/pageHeader.tsx
|
|
819
|
-
function
|
|
1085
|
+
function En({ titleId: e, title: t, back: n, badge: r, meta: i, aside: a }) {
|
|
820
1086
|
return /* @__PURE__ */ d("header", {
|
|
821
1087
|
className: "flex flex-wrap items-end justify-between gap-4",
|
|
822
1088
|
children: [/* @__PURE__ */ d("div", {
|
|
@@ -850,22 +1116,22 @@ function vn({ titleId: e, title: t, back: n, badge: r, meta: i, aside: a }) {
|
|
|
850
1116
|
}
|
|
851
1117
|
//#endregion
|
|
852
1118
|
//#region src/components/ui/skeleton.tsx
|
|
853
|
-
function
|
|
1119
|
+
function G({ className: e, ...t }) {
|
|
854
1120
|
return /* @__PURE__ */ u("div", {
|
|
855
1121
|
"data-slot": "skeleton",
|
|
856
|
-
className:
|
|
1122
|
+
className: U("animate-pulse rounded-md bg-muted motion-reduce:animate-none", e),
|
|
857
1123
|
...t
|
|
858
1124
|
});
|
|
859
1125
|
}
|
|
860
1126
|
//#endregion
|
|
861
1127
|
//#region src/components/ui/sectionCard.tsx
|
|
862
|
-
function
|
|
1128
|
+
function K({ id: e, title: t, description: n, aside: r, busy: a, className: o, children: s }) {
|
|
863
1129
|
let c = i();
|
|
864
1130
|
return /* @__PURE__ */ d("section", {
|
|
865
1131
|
id: e,
|
|
866
1132
|
"aria-labelledby": c,
|
|
867
1133
|
"aria-busy": a || void 0,
|
|
868
|
-
className:
|
|
1134
|
+
className: U("rounded-xl border bg-card px-5.5 pt-5 text-card-foreground shadow-(--shadow-control)", o),
|
|
869
1135
|
children: [/* @__PURE__ */ d("header", {
|
|
870
1136
|
className: "flex flex-wrap items-end justify-between gap-3",
|
|
871
1137
|
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h2", {
|
|
@@ -881,7 +1147,7 @@ function W({ id: e, title: t, description: n, aside: r, busy: a, className: o, c
|
|
|
881
1147
|
}
|
|
882
1148
|
//#endregion
|
|
883
1149
|
//#region src/components/ui/segmentedControl.tsx
|
|
884
|
-
function
|
|
1150
|
+
function Dn({ label: e, options: t, value: n, onChange: r }) {
|
|
885
1151
|
return /* @__PURE__ */ u("div", {
|
|
886
1152
|
role: "group",
|
|
887
1153
|
"aria-label": e,
|
|
@@ -904,21 +1170,21 @@ function yn({ label: e, options: t, value: n, onChange: r }) {
|
|
|
904
1170
|
}
|
|
905
1171
|
//#endregion
|
|
906
1172
|
//#region src/components/actorType/instanceStatus.tsx
|
|
907
|
-
function
|
|
1173
|
+
function On({ live: e, className: t, children: n }) {
|
|
908
1174
|
return /* @__PURE__ */ d("span", {
|
|
909
|
-
className:
|
|
1175
|
+
className: U("inline-flex items-center gap-1.25", e ? "text-success" : "text-muted-foreground", t),
|
|
910
1176
|
children: [e && /* @__PURE__ */ u("span", { className: "size-1.5 rounded-full bg-success" }), n]
|
|
911
1177
|
});
|
|
912
1178
|
}
|
|
913
1179
|
//#endregion
|
|
914
1180
|
//#region src/components/actorType/instancesCard.tsx
|
|
915
|
-
var
|
|
916
|
-
function
|
|
917
|
-
let [i, a] = o("all"), s = (e &&
|
|
918
|
-
return /* @__PURE__ */ u(
|
|
1181
|
+
var kn = 24, An = 240;
|
|
1182
|
+
function jn({ actor: e, requests: t, failed: n, now: r }) {
|
|
1183
|
+
let [i, a] = o("all"), s = (e && $t(e.instances))?.filter((e) => i === "all" || e.status === i) ?? null;
|
|
1184
|
+
return /* @__PURE__ */ u(K, {
|
|
919
1185
|
title: "Instances",
|
|
920
1186
|
description: "Sorted by last active. Number shows open sockets.",
|
|
921
|
-
aside: e && /* @__PURE__ */ u(
|
|
1187
|
+
aside: e && /* @__PURE__ */ u(Mn, {
|
|
922
1188
|
actor: e,
|
|
923
1189
|
value: i,
|
|
924
1190
|
onChange: a
|
|
@@ -928,17 +1194,17 @@ function Cn({ actor: e, requests: t, failed: n, now: r }) {
|
|
|
928
1194
|
children: n ? /* @__PURE__ */ u("p", {
|
|
929
1195
|
className: "py-4 text-[13px] text-muted-foreground",
|
|
930
1196
|
children: "Couldn't reach the observer API."
|
|
931
|
-
}) : e && s ? /* @__PURE__ */ u(
|
|
1197
|
+
}) : e && s ? /* @__PURE__ */ u(Nn, {
|
|
932
1198
|
actor: e,
|
|
933
1199
|
instances: s,
|
|
934
1200
|
requests: t,
|
|
935
1201
|
now: r
|
|
936
|
-
}) : /* @__PURE__ */ u(
|
|
1202
|
+
}) : /* @__PURE__ */ u(zn, {})
|
|
937
1203
|
});
|
|
938
1204
|
}
|
|
939
|
-
function
|
|
940
|
-
let { total: r, live: i, dormant: a } =
|
|
941
|
-
return /* @__PURE__ */ u(
|
|
1205
|
+
function Mn({ actor: e, value: t, onChange: n }) {
|
|
1206
|
+
let { total: r, live: i, dormant: a } = z(e);
|
|
1207
|
+
return /* @__PURE__ */ u(Dn, {
|
|
942
1208
|
label: "Filter instances",
|
|
943
1209
|
value: t,
|
|
944
1210
|
onChange: n,
|
|
@@ -946,81 +1212,60 @@ function wn({ actor: e, value: t, onChange: n }) {
|
|
|
946
1212
|
{
|
|
947
1213
|
value: "all",
|
|
948
1214
|
label: "All",
|
|
949
|
-
badge:
|
|
1215
|
+
badge: E(r)
|
|
950
1216
|
},
|
|
951
1217
|
{
|
|
952
1218
|
value: "live",
|
|
953
1219
|
label: "Live",
|
|
954
|
-
badge:
|
|
1220
|
+
badge: E(i)
|
|
955
1221
|
},
|
|
956
1222
|
{
|
|
957
1223
|
value: "dormant",
|
|
958
1224
|
label: "Dormant",
|
|
959
|
-
badge:
|
|
1225
|
+
badge: E(a)
|
|
960
1226
|
}
|
|
961
1227
|
]
|
|
962
1228
|
});
|
|
963
1229
|
}
|
|
964
|
-
function
|
|
1230
|
+
function Nn({ actor: e, instances: t, requests: n, now: r }) {
|
|
965
1231
|
let [i, a] = o(null);
|
|
966
1232
|
if (!t.length) return /* @__PURE__ */ u("p", {
|
|
967
1233
|
className: "py-4 text-[13px] text-muted-foreground",
|
|
968
1234
|
children: "No instances match this filter."
|
|
969
1235
|
});
|
|
970
|
-
let s = t.slice(0,
|
|
971
|
-
return /* @__PURE__ */ d(l, { children: [
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
shown: s.length,
|
|
988
|
-
matching: t.length
|
|
989
|
-
})
|
|
990
|
-
] });
|
|
991
|
-
}
|
|
992
|
-
function En() {
|
|
993
|
-
return /* @__PURE__ */ d("div", {
|
|
994
|
-
"aria-hidden": !0,
|
|
995
|
-
className: "mt-4.5 grid grid-cols-24 gap-1.5 text-[11px] text-muted-foreground tabular-nums",
|
|
996
|
-
children: [
|
|
997
|
-
/* @__PURE__ */ u("span", { children: "001" }),
|
|
998
|
-
/* @__PURE__ */ u("span", {
|
|
999
|
-
className: "col-start-12",
|
|
1000
|
-
children: "012"
|
|
1001
|
-
}),
|
|
1002
|
-
/* @__PURE__ */ u("span", {
|
|
1003
|
-
className: "col-start-24 text-right",
|
|
1004
|
-
children: "024"
|
|
1005
|
-
})
|
|
1006
|
-
]
|
|
1007
|
-
});
|
|
1236
|
+
let s = t.slice(0, An);
|
|
1237
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("ul", {
|
|
1238
|
+
"aria-label": `${e.actorName} instances, most recently active first`,
|
|
1239
|
+
className: "mt-6 grid grid-cols-24 gap-1.5 tabular-nums",
|
|
1240
|
+
children: s.map((e, t) => /* @__PURE__ */ u(Pn, {
|
|
1241
|
+
instance: e,
|
|
1242
|
+
active: e.actorId === i,
|
|
1243
|
+
alignRight: t % kn >= kn / 2,
|
|
1244
|
+
onActive: a,
|
|
1245
|
+
requests: n,
|
|
1246
|
+
now: r
|
|
1247
|
+
}, e.actorId))
|
|
1248
|
+
}), /* @__PURE__ */ u(Ln, {
|
|
1249
|
+
actor: e,
|
|
1250
|
+
shown: s.length,
|
|
1251
|
+
matching: t.length
|
|
1252
|
+
})] });
|
|
1008
1253
|
}
|
|
1009
|
-
function
|
|
1254
|
+
function Pn({ instance: e, active: t, alignRight: n, onActive: r, requests: a, now: o }) {
|
|
1010
1255
|
let s = i(), c = e.status === "live", l = e.connections.length;
|
|
1011
1256
|
return /* @__PURE__ */ d("li", {
|
|
1012
1257
|
className: "relative",
|
|
1013
1258
|
children: [/* @__PURE__ */ u(f, {
|
|
1014
|
-
to:
|
|
1259
|
+
to: Qt(e.actorId),
|
|
1015
1260
|
"aria-label": `${e.actorId}, ${e.status}, ${O(l, "open socket")}`,
|
|
1016
1261
|
"aria-describedby": t ? s : void 0,
|
|
1017
1262
|
onMouseEnter: () => r(e.actorId),
|
|
1018
1263
|
onMouseLeave: () => r(null),
|
|
1019
1264
|
onFocus: () => r(e.actorId),
|
|
1020
1265
|
onBlur: () => r(null),
|
|
1021
|
-
className:
|
|
1022
|
-
children: l > 0 ?
|
|
1023
|
-
}), t && /* @__PURE__ */ u(
|
|
1266
|
+
className: U("grid h-6.5 w-full place-items-center rounded-[5px] text-[10px] font-medium outline-none", c ? "bg-success text-background" : "bg-muted shadow-[inset_0_0_0_1px_var(--border)]", t && "outline-2 outline-offset-2 outline-foreground"),
|
|
1267
|
+
children: l > 0 ? E(l) : !c && /* @__PURE__ */ u("span", { className: "size-1 rounded-full bg-muted-foreground/40" })
|
|
1268
|
+
}), t && /* @__PURE__ */ u(Fn, {
|
|
1024
1269
|
id: s,
|
|
1025
1270
|
instance: e,
|
|
1026
1271
|
requests: a,
|
|
@@ -1029,12 +1274,12 @@ function Dn({ instance: e, active: t, alignRight: n, onActive: r, requests: a, n
|
|
|
1029
1274
|
})]
|
|
1030
1275
|
});
|
|
1031
1276
|
}
|
|
1032
|
-
function
|
|
1033
|
-
let a = n?.filter((e) => e.actorId === t.actorId) ?? [], o =
|
|
1277
|
+
function Fn({ id: e, instance: t, requests: n, now: r, alignRight: i }) {
|
|
1278
|
+
let a = n?.filter((e) => e.actorId === t.actorId) ?? [], o = H(a, B), s = H(a, V), c = t.status === "live";
|
|
1034
1279
|
return /* @__PURE__ */ d("div", {
|
|
1035
1280
|
id: e,
|
|
1036
1281
|
role: "tooltip",
|
|
1037
|
-
className:
|
|
1282
|
+
className: U("absolute top-full z-10 mt-2 w-64 rounded-lg border bg-popover px-3.5 py-3 text-xs text-popover-foreground shadow-(--shadow-popover)", i ? "right-0" : "left-0"),
|
|
1038
1283
|
children: [
|
|
1039
1284
|
/* @__PURE__ */ d("div", {
|
|
1040
1285
|
className: "flex items-center justify-between gap-3",
|
|
@@ -1042,32 +1287,32 @@ function On({ id: e, instance: t, requests: n, now: r, alignRight: i }) {
|
|
|
1042
1287
|
translate: "no",
|
|
1043
1288
|
className: "truncate",
|
|
1044
1289
|
children: t.actorId
|
|
1045
|
-
}), /* @__PURE__ */ u(
|
|
1290
|
+
}), /* @__PURE__ */ u(On, {
|
|
1046
1291
|
live: c,
|
|
1047
1292
|
className: "text-[11px] font-medium",
|
|
1048
1293
|
children: c ? "Live" : "Dormant"
|
|
1049
1294
|
})]
|
|
1050
1295
|
}),
|
|
1051
|
-
/* @__PURE__ */ u(
|
|
1296
|
+
/* @__PURE__ */ u(In, {
|
|
1052
1297
|
label: "Open sockets",
|
|
1053
|
-
value:
|
|
1298
|
+
value: E(t.connections.length)
|
|
1054
1299
|
}),
|
|
1055
|
-
/* @__PURE__ */ u(
|
|
1300
|
+
/* @__PURE__ */ u(In, {
|
|
1056
1301
|
label: "Avg queue time",
|
|
1057
1302
|
value: o === null ? "—" : D(o)
|
|
1058
1303
|
}),
|
|
1059
|
-
/* @__PURE__ */ u(
|
|
1304
|
+
/* @__PURE__ */ u(In, {
|
|
1060
1305
|
label: "Avg latency",
|
|
1061
1306
|
value: s === null ? "—" : D(s)
|
|
1062
1307
|
}),
|
|
1063
|
-
/* @__PURE__ */ u(
|
|
1308
|
+
/* @__PURE__ */ u(In, {
|
|
1064
1309
|
label: "Last active",
|
|
1065
|
-
value: t.lastActiveAtMs ?
|
|
1310
|
+
value: t.lastActiveAtMs ? ft(t.lastActiveAtMs, r) : "—"
|
|
1066
1311
|
})
|
|
1067
1312
|
]
|
|
1068
1313
|
});
|
|
1069
1314
|
}
|
|
1070
|
-
function
|
|
1315
|
+
function In({ label: e, value: t }) {
|
|
1071
1316
|
return /* @__PURE__ */ d("div", {
|
|
1072
1317
|
className: "mt-1.5 flex justify-between text-muted-foreground",
|
|
1073
1318
|
children: [/* @__PURE__ */ u("span", { children: e }), /* @__PURE__ */ u("b", {
|
|
@@ -1076,37 +1321,31 @@ function kn({ label: e, value: t }) {
|
|
|
1076
1321
|
})]
|
|
1077
1322
|
});
|
|
1078
1323
|
}
|
|
1079
|
-
function
|
|
1080
|
-
let { live: r, dormant: i } =
|
|
1324
|
+
function Ln({ actor: e, shown: t, matching: n }) {
|
|
1325
|
+
let { live: r, dormant: i } = z(e);
|
|
1081
1326
|
return /* @__PURE__ */ d("div", {
|
|
1082
|
-
className: "mt-4 flex flex-wrap items-center
|
|
1083
|
-
children: [
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
t
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
] })
|
|
1102
|
-
]
|
|
1103
|
-
}), /* @__PURE__ */ u("span", {
|
|
1104
|
-
className: "text-xs",
|
|
1105
|
-
children: "Most recent → Least recent"
|
|
1106
|
-
})]
|
|
1327
|
+
className: "mt-4 flex flex-wrap items-center gap-5 text-[13px] text-muted-foreground tabular-nums",
|
|
1328
|
+
children: [
|
|
1329
|
+
/* @__PURE__ */ u(Rn, {
|
|
1330
|
+
swatch: "bg-success",
|
|
1331
|
+
label: "Live",
|
|
1332
|
+
count: r
|
|
1333
|
+
}),
|
|
1334
|
+
/* @__PURE__ */ u(Rn, {
|
|
1335
|
+
swatch: "bg-muted shadow-[inset_0_0_0_1px_var(--border)]",
|
|
1336
|
+
label: "Dormant",
|
|
1337
|
+
count: i
|
|
1338
|
+
}),
|
|
1339
|
+
t < n && /* @__PURE__ */ d("span", { children: [
|
|
1340
|
+
"Showing ",
|
|
1341
|
+
E(t),
|
|
1342
|
+
" of ",
|
|
1343
|
+
E(n)
|
|
1344
|
+
] })
|
|
1345
|
+
]
|
|
1107
1346
|
});
|
|
1108
1347
|
}
|
|
1109
|
-
function
|
|
1348
|
+
function Rn({ swatch: e, label: t, count: n }) {
|
|
1110
1349
|
return /* @__PURE__ */ d("span", {
|
|
1111
1350
|
className: "flex items-center gap-1.75",
|
|
1112
1351
|
children: [
|
|
@@ -1115,24 +1354,24 @@ function jn({ swatch: e, label: t, count: n }) {
|
|
|
1115
1354
|
" ",
|
|
1116
1355
|
/* @__PURE__ */ u("b", {
|
|
1117
1356
|
className: "font-bold text-foreground",
|
|
1118
|
-
children:
|
|
1357
|
+
children: E(n)
|
|
1119
1358
|
})
|
|
1120
1359
|
]
|
|
1121
1360
|
});
|
|
1122
1361
|
}
|
|
1123
|
-
function
|
|
1362
|
+
function zn() {
|
|
1124
1363
|
return /* @__PURE__ */ u("div", {
|
|
1125
1364
|
className: "mt-6 grid grid-cols-24 gap-1.5",
|
|
1126
|
-
children: Array.from({ length: 72 }, (e, t) => /* @__PURE__ */ u(
|
|
1365
|
+
children: Array.from({ length: 72 }, (e, t) => /* @__PURE__ */ u(G, { className: "h-6.5 rounded-[5px]" }, t))
|
|
1127
1366
|
});
|
|
1128
1367
|
}
|
|
1129
1368
|
//#endregion
|
|
1130
1369
|
//#region src/components/ui/residencyBar.tsx
|
|
1131
|
-
function
|
|
1370
|
+
function Bn({ liveShare: e, label: t, pulse: n, className: r, style: i }) {
|
|
1132
1371
|
return /* @__PURE__ */ d("div", {
|
|
1133
1372
|
role: "img",
|
|
1134
1373
|
"aria-label": t,
|
|
1135
|
-
className:
|
|
1374
|
+
className: U("relative flex overflow-hidden", r),
|
|
1136
1375
|
style: i,
|
|
1137
1376
|
children: [/* @__PURE__ */ u("div", {
|
|
1138
1377
|
className: "relative bg-success",
|
|
@@ -1141,30 +1380,27 @@ function Nn({ liveShare: e, label: t, pulse: n, className: r, style: i }) {
|
|
|
1141
1380
|
}), /* @__PURE__ */ u("div", { className: "flex-1 bg-border" })]
|
|
1142
1381
|
});
|
|
1143
1382
|
}
|
|
1144
|
-
function
|
|
1145
|
-
let r = e + t, i = r ? e / r : 0;
|
|
1383
|
+
function Vn({ live: e, dormant: t }) {
|
|
1146
1384
|
return /* @__PURE__ */ d("div", {
|
|
1147
1385
|
className: "mt-3 flex justify-between gap-4 text-[13px] tabular-nums",
|
|
1148
|
-
children: [/* @__PURE__ */ u(
|
|
1386
|
+
children: [/* @__PURE__ */ u(Un, {
|
|
1149
1387
|
swatch: "bg-success",
|
|
1150
1388
|
label: "Live",
|
|
1151
|
-
count:
|
|
1152
|
-
|
|
1153
|
-
}), /* @__PURE__ */ u(In, {
|
|
1389
|
+
count: e
|
|
1390
|
+
}), /* @__PURE__ */ u(Un, {
|
|
1154
1391
|
swatch: "bg-border",
|
|
1155
1392
|
label: "Dormant",
|
|
1156
|
-
count:
|
|
1157
|
-
share: r ? 1 - i : 0
|
|
1393
|
+
count: t
|
|
1158
1394
|
})]
|
|
1159
1395
|
});
|
|
1160
1396
|
}
|
|
1161
|
-
function
|
|
1162
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
1397
|
+
function Hn() {
|
|
1398
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(G, { className: "mt-auto h-10 w-full rounded-sm" }), /* @__PURE__ */ d("div", {
|
|
1163
1399
|
className: "mt-3 flex justify-between gap-4",
|
|
1164
|
-
children: [/* @__PURE__ */ u(
|
|
1400
|
+
children: [/* @__PURE__ */ u(G, { className: "h-3.5 w-28" }), /* @__PURE__ */ u(G, { className: "h-3.5 w-28" })]
|
|
1165
1401
|
})] });
|
|
1166
1402
|
}
|
|
1167
|
-
function
|
|
1403
|
+
function Un({ swatch: e, label: t, count: n }) {
|
|
1168
1404
|
return /* @__PURE__ */ d("span", {
|
|
1169
1405
|
className: "flex items-center gap-1.75 text-muted-foreground",
|
|
1170
1406
|
children: [
|
|
@@ -1173,42 +1409,37 @@ function In({ swatch: e, label: t, count: n, share: r }) {
|
|
|
1173
1409
|
" ",
|
|
1174
1410
|
n !== void 0 && /* @__PURE__ */ u("b", {
|
|
1175
1411
|
className: "font-bold text-foreground",
|
|
1176
|
-
children:
|
|
1177
|
-
})
|
|
1178
|
-
" · ",
|
|
1179
|
-
E(r)
|
|
1412
|
+
children: E(n)
|
|
1413
|
+
})
|
|
1180
1414
|
]
|
|
1181
1415
|
});
|
|
1182
1416
|
}
|
|
1183
1417
|
//#endregion
|
|
1184
1418
|
//#region src/components/ui/statCard.tsx
|
|
1185
|
-
function
|
|
1186
|
-
let
|
|
1419
|
+
function Wn({ label: e, value: t, unit: n, busy: r, children: a }) {
|
|
1420
|
+
let o = i();
|
|
1187
1421
|
return /* @__PURE__ */ d("article", {
|
|
1188
|
-
"aria-labelledby":
|
|
1189
|
-
"aria-busy":
|
|
1422
|
+
"aria-labelledby": o,
|
|
1423
|
+
"aria-busy": r || void 0,
|
|
1190
1424
|
className: "flex min-h-59 min-w-0 flex-col rounded-xl border bg-card px-5.5 pt-5 pb-4.5 text-card-foreground shadow-(--shadow-control)",
|
|
1191
1425
|
children: [
|
|
1192
|
-
/* @__PURE__ */
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
className: "truncate",
|
|
1197
|
-
children: e
|
|
1198
|
-
}), t]
|
|
1426
|
+
/* @__PURE__ */ u("span", {
|
|
1427
|
+
id: o,
|
|
1428
|
+
className: "truncate text-[13px] font-medium text-muted-foreground",
|
|
1429
|
+
children: e
|
|
1199
1430
|
}),
|
|
1200
|
-
|
|
1201
|
-
value:
|
|
1202
|
-
unit:
|
|
1431
|
+
t !== void 0 && /* @__PURE__ */ u(Gn, {
|
|
1432
|
+
value: t,
|
|
1433
|
+
unit: n,
|
|
1203
1434
|
className: "mt-3.5"
|
|
1204
1435
|
}),
|
|
1205
|
-
|
|
1436
|
+
a
|
|
1206
1437
|
]
|
|
1207
1438
|
});
|
|
1208
1439
|
}
|
|
1209
|
-
function
|
|
1440
|
+
function Gn({ value: e, unit: t, className: n }) {
|
|
1210
1441
|
return /* @__PURE__ */ d("div", {
|
|
1211
|
-
className:
|
|
1442
|
+
className: U("flex items-baseline gap-2 text-[44px] leading-none font-bold tracking-[-0.035em] tabular-nums", n),
|
|
1212
1443
|
children: [e, t !== void 0 && /* @__PURE__ */ u("div", {
|
|
1213
1444
|
className: "text-[15px] font-medium tracking-normal text-muted-foreground",
|
|
1214
1445
|
children: t
|
|
@@ -1217,58 +1448,50 @@ function Rn({ value: e, unit: t, className: n }) {
|
|
|
1217
1448
|
}
|
|
1218
1449
|
//#endregion
|
|
1219
1450
|
//#region src/components/actorType/liveDormantCard.tsx
|
|
1220
|
-
function
|
|
1221
|
-
|
|
1222
|
-
className: "shrink-0 text-xs font-normal tabular-nums",
|
|
1223
|
-
children: [w(e.total), " total"]
|
|
1224
|
-
});
|
|
1225
|
-
return /* @__PURE__ */ u(Ln, {
|
|
1451
|
+
function Kn({ summary: e, failed: t }) {
|
|
1452
|
+
return /* @__PURE__ */ u(Wn, {
|
|
1226
1453
|
label: "Live & Dormant",
|
|
1227
|
-
aside: n,
|
|
1228
1454
|
busy: !e && !t,
|
|
1229
|
-
children: e ? /* @__PURE__ */ u(
|
|
1455
|
+
children: e ? /* @__PURE__ */ u(qn, { ...e }) : /* @__PURE__ */ u(Jn, { failed: t })
|
|
1230
1456
|
});
|
|
1231
1457
|
}
|
|
1232
|
-
function
|
|
1458
|
+
function qn({ live: e, dormant: t, total: n }) {
|
|
1233
1459
|
let r = n ? e / n : 0;
|
|
1234
1460
|
return /* @__PURE__ */ d(l, { children: [
|
|
1235
1461
|
/* @__PURE__ */ d("div", {
|
|
1236
1462
|
className: "mt-3.5 flex flex-wrap gap-x-10 gap-y-2",
|
|
1237
|
-
children: [/* @__PURE__ */ u(
|
|
1238
|
-
value:
|
|
1463
|
+
children: [/* @__PURE__ */ u(Gn, {
|
|
1464
|
+
value: E(e),
|
|
1239
1465
|
unit: "live"
|
|
1240
|
-
}), /* @__PURE__ */ u(
|
|
1241
|
-
value:
|
|
1466
|
+
}), /* @__PURE__ */ u(Gn, {
|
|
1467
|
+
value: E(t),
|
|
1242
1468
|
unit: "dormant",
|
|
1243
1469
|
className: "text-muted-foreground/75"
|
|
1244
1470
|
})]
|
|
1245
1471
|
}),
|
|
1246
|
-
/* @__PURE__ */ u(
|
|
1472
|
+
/* @__PURE__ */ u(Bn, {
|
|
1247
1473
|
liveShare: r,
|
|
1248
|
-
label: `${
|
|
1474
|
+
label: `${E(e)} live, ${E(t)} dormant, ${ut(r)} live`,
|
|
1249
1475
|
pulse: !0,
|
|
1250
1476
|
className: "mt-auto h-10 rounded-sm"
|
|
1251
1477
|
}),
|
|
1252
|
-
/* @__PURE__ */ u(
|
|
1253
|
-
live: e,
|
|
1254
|
-
dormant: t
|
|
1255
|
-
})
|
|
1478
|
+
/* @__PURE__ */ u(Vn, {})
|
|
1256
1479
|
] });
|
|
1257
1480
|
}
|
|
1258
|
-
function
|
|
1481
|
+
function Jn({ failed: e }) {
|
|
1259
1482
|
return e ? /* @__PURE__ */ u("p", {
|
|
1260
1483
|
className: "mt-3.5 text-[13px] text-muted-foreground",
|
|
1261
1484
|
children: "Couldn't reach the observer API."
|
|
1262
|
-
}) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
1485
|
+
}) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(G, { className: "mt-3.5 h-11 w-48 max-w-full" }), /* @__PURE__ */ u(Hn, {})] });
|
|
1263
1486
|
}
|
|
1264
1487
|
//#endregion
|
|
1265
1488
|
//#region src/components/ui/expandFooter.tsx
|
|
1266
|
-
function
|
|
1489
|
+
function Yn({ shown: e, total: t, noun: n, expandLabel: r, expanded: i, onToggle: a }) {
|
|
1267
1490
|
return /* @__PURE__ */ d("div", {
|
|
1268
1491
|
className: "flex justify-between border-t pt-3 text-xs text-muted-foreground tabular-nums",
|
|
1269
1492
|
children: [/* @__PURE__ */ d("span", { children: [
|
|
1270
1493
|
"Showing ",
|
|
1271
|
-
|
|
1494
|
+
E(e),
|
|
1272
1495
|
" of ",
|
|
1273
1496
|
O(t, n)
|
|
1274
1497
|
] }), (i || e < t) && /* @__PURE__ */ u("button", {
|
|
@@ -1281,8 +1504,8 @@ function Hn({ shown: e, total: t, noun: n, expandLabel: r, expanded: i, onToggle
|
|
|
1281
1504
|
}
|
|
1282
1505
|
//#endregion
|
|
1283
1506
|
//#region src/components/ui/timeline.tsx
|
|
1284
|
-
var
|
|
1285
|
-
function
|
|
1507
|
+
var Xn = 6, Zn = "bg-[linear-gradient(90deg,color-mix(in_oklab,var(--border)_55%,transparent)_1px,transparent_1px)] bg-size-[calc(100%/6)_100%] shadow-[inset_-1px_0_0_var(--border)]";
|
|
1508
|
+
function Qn({ timeWindow: e, grid: t, label: n, trailing: r }) {
|
|
1286
1509
|
return /* @__PURE__ */ d("div", {
|
|
1287
1510
|
"aria-hidden": !0,
|
|
1288
1511
|
className: `${t} h-6 border-b`,
|
|
@@ -1293,9 +1516,9 @@ function Gn({ timeWindow: e, grid: t, label: n, trailing: r }) {
|
|
|
1293
1516
|
}),
|
|
1294
1517
|
/* @__PURE__ */ u("div", {
|
|
1295
1518
|
className: "relative h-full text-[11px] text-muted-foreground tabular-nums",
|
|
1296
|
-
children: N(e,
|
|
1297
|
-
className:
|
|
1298
|
-
style: { left: `${t /
|
|
1519
|
+
children: N(e, Xn).map((e, t) => /* @__PURE__ */ u("span", {
|
|
1520
|
+
className: U("absolute top-1", t === 0 ? "" : t === Xn ? "-translate-x-full text-foreground" : "-translate-x-1/2"),
|
|
1521
|
+
style: { left: `${t / Xn * 100}%` },
|
|
1299
1522
|
children: e
|
|
1300
1523
|
}, t))
|
|
1301
1524
|
}),
|
|
@@ -1306,15 +1529,15 @@ function Gn({ timeWindow: e, grid: t, label: n, trailing: r }) {
|
|
|
1306
1529
|
]
|
|
1307
1530
|
});
|
|
1308
1531
|
}
|
|
1309
|
-
function
|
|
1532
|
+
function $n({ label: e, children: t }) {
|
|
1310
1533
|
return /* @__PURE__ */ u("div", {
|
|
1311
1534
|
role: "img",
|
|
1312
1535
|
"aria-label": e,
|
|
1313
|
-
className: `relative h-full ${
|
|
1536
|
+
className: `relative h-full ${Zn} before:absolute before:inset-x-0 before:top-1/2 before:border-t before:border-dashed before:border-border`,
|
|
1314
1537
|
children: t
|
|
1315
1538
|
});
|
|
1316
1539
|
}
|
|
1317
|
-
function
|
|
1540
|
+
function er(e, { fromMs: t, toMs: n }, r) {
|
|
1318
1541
|
let i = n - t, a = (t) => r && t === e.length - 1;
|
|
1319
1542
|
return e.map((e, r) => ({
|
|
1320
1543
|
fromMs: Math.max(e.fromMs, t),
|
|
@@ -1328,42 +1551,42 @@ function qn(e, { fromMs: t, toMs: n }, r) {
|
|
|
1328
1551
|
}
|
|
1329
1552
|
//#endregion
|
|
1330
1553
|
//#region src/components/ui/tooltip.tsx
|
|
1331
|
-
function
|
|
1332
|
-
return /* @__PURE__ */ u(
|
|
1554
|
+
function tr({ delayDuration: e = 0, ...t }) {
|
|
1555
|
+
return /* @__PURE__ */ u(x.Provider, {
|
|
1333
1556
|
"data-slot": "tooltip-provider",
|
|
1334
1557
|
delayDuration: e,
|
|
1335
1558
|
...t
|
|
1336
1559
|
});
|
|
1337
1560
|
}
|
|
1338
|
-
function
|
|
1339
|
-
return /* @__PURE__ */ u(
|
|
1561
|
+
function nr(e) {
|
|
1562
|
+
return /* @__PURE__ */ u(tr, { children: /* @__PURE__ */ u(x.Root, {
|
|
1340
1563
|
"data-slot": "tooltip",
|
|
1341
1564
|
...e
|
|
1342
1565
|
}) });
|
|
1343
1566
|
}
|
|
1344
|
-
function
|
|
1345
|
-
return /* @__PURE__ */ u(
|
|
1567
|
+
function rr(e) {
|
|
1568
|
+
return /* @__PURE__ */ u(x.Trigger, {
|
|
1346
1569
|
"data-slot": "tooltip-trigger",
|
|
1347
1570
|
...e
|
|
1348
1571
|
});
|
|
1349
1572
|
}
|
|
1350
|
-
function
|
|
1351
|
-
return /* @__PURE__ */ u(
|
|
1573
|
+
function ir({ className: e, sideOffset: t = 0, children: n, ...r }) {
|
|
1574
|
+
return /* @__PURE__ */ u(x.Portal, { children: /* @__PURE__ */ d(x.Content, {
|
|
1352
1575
|
"data-slot": "tooltip-content",
|
|
1353
1576
|
sideOffset: t,
|
|
1354
|
-
className:
|
|
1577
|
+
className: U("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", e),
|
|
1355
1578
|
...r,
|
|
1356
|
-
children: [n, /* @__PURE__ */ u(
|
|
1579
|
+
children: [n, /* @__PURE__ */ u(x.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" })]
|
|
1357
1580
|
}) });
|
|
1358
1581
|
}
|
|
1359
1582
|
//#endregion
|
|
1360
1583
|
//#region src/components/actorType/residencyCard.tsx
|
|
1361
|
-
var
|
|
1362
|
-
function
|
|
1363
|
-
let [a, s] = o(!1), c = e &&
|
|
1364
|
-
return /* @__PURE__ */ u(
|
|
1584
|
+
var ar = 10, or = "grid grid-cols-[minmax(0,210px)_1fr_minmax(0,128px)] items-center gap-6";
|
|
1585
|
+
function sr({ actor: e, history: t, requests: n, failed: r, timeWindow: i }) {
|
|
1586
|
+
let [a, s] = o(!1), c = e && $t(e.instances), f = t && cr(t), p = a ? c : c?.slice(0, ar);
|
|
1587
|
+
return /* @__PURE__ */ u(K, {
|
|
1365
1588
|
title: "Residency",
|
|
1366
|
-
aside: /* @__PURE__ */ u(
|
|
1589
|
+
aside: /* @__PURE__ */ u(lr, {}),
|
|
1367
1590
|
busy: !p && !r,
|
|
1368
1591
|
className: "pb-3",
|
|
1369
1592
|
children: r ? /* @__PURE__ */ u("p", {
|
|
@@ -1371,18 +1594,18 @@ function er({ actor: e, history: t, requests: n, failed: r, timeWindow: i }) {
|
|
|
1371
1594
|
children: "Couldn't reach the observer API."
|
|
1372
1595
|
}) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
|
|
1373
1596
|
className: "mt-3.5",
|
|
1374
|
-
children: [/* @__PURE__ */ u(
|
|
1597
|
+
children: [/* @__PURE__ */ u(Qn, {
|
|
1375
1598
|
timeWindow: i,
|
|
1376
|
-
grid:
|
|
1599
|
+
grid: or,
|
|
1377
1600
|
label: "Instance",
|
|
1378
1601
|
trailing: "Time live"
|
|
1379
|
-
}), p && f ? p.map((e) => /* @__PURE__ */ u(
|
|
1602
|
+
}), p && f ? p.map((e) => /* @__PURE__ */ u(ur, {
|
|
1380
1603
|
instance: e,
|
|
1381
1604
|
periods: f.get(e.actorId) ?? [],
|
|
1382
1605
|
requests: n && n.filter((t) => t.actorId === e.actorId),
|
|
1383
1606
|
timeWindow: i
|
|
1384
|
-
}, e.actorId)) : /* @__PURE__ */ u(
|
|
1385
|
-
}), c && /* @__PURE__ */ u(
|
|
1607
|
+
}, e.actorId)) : /* @__PURE__ */ u(hr, {})]
|
|
1608
|
+
}), c && /* @__PURE__ */ u(Yn, {
|
|
1386
1609
|
shown: p?.length ?? 0,
|
|
1387
1610
|
total: c.length,
|
|
1388
1611
|
noun: "instance",
|
|
@@ -1392,12 +1615,12 @@ function er({ actor: e, history: t, requests: n, failed: r, timeWindow: i }) {
|
|
|
1392
1615
|
})] })
|
|
1393
1616
|
});
|
|
1394
1617
|
}
|
|
1395
|
-
function
|
|
1618
|
+
function cr({ periods: e }) {
|
|
1396
1619
|
let t = /* @__PURE__ */ new Map();
|
|
1397
1620
|
for (let n of e) n.status === "live" && t.set(n.actorId, [...t.get(n.actorId) ?? [], n]);
|
|
1398
1621
|
return t;
|
|
1399
1622
|
}
|
|
1400
|
-
function
|
|
1623
|
+
function lr() {
|
|
1401
1624
|
return /* @__PURE__ */ d("div", {
|
|
1402
1625
|
className: "flex gap-4.5 text-xs text-muted-foreground",
|
|
1403
1626
|
children: [/* @__PURE__ */ d("span", {
|
|
@@ -1409,17 +1632,17 @@ function nr() {
|
|
|
1409
1632
|
})]
|
|
1410
1633
|
});
|
|
1411
1634
|
}
|
|
1412
|
-
function
|
|
1413
|
-
let i = e.status === "live", a =
|
|
1635
|
+
function ur({ instance: e, periods: t, requests: n, timeWindow: r }) {
|
|
1636
|
+
let i = e.status === "live", a = er(t, r, i && r.live), o = dr(a);
|
|
1414
1637
|
return /* @__PURE__ */ d(f, {
|
|
1415
|
-
to:
|
|
1416
|
-
className: `${
|
|
1638
|
+
to: Qt(e.actorId),
|
|
1639
|
+
className: `${or} h-11.5 border-b border-border/50 transition-colors outline-none last:border-b-0 hover:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring`,
|
|
1417
1640
|
children: [
|
|
1418
1641
|
/* @__PURE__ */ d("div", {
|
|
1419
1642
|
className: "flex min-w-0 items-center gap-2.5",
|
|
1420
1643
|
children: [/* @__PURE__ */ u("span", {
|
|
1421
1644
|
"aria-hidden": !0,
|
|
1422
|
-
className:
|
|
1645
|
+
className: U("size-2 shrink-0 rounded-full", i ? "bg-success" : "border border-muted-foreground/50")
|
|
1423
1646
|
}), /* @__PURE__ */ d("div", {
|
|
1424
1647
|
className: "min-w-0",
|
|
1425
1648
|
children: [/* @__PURE__ */ u("b", {
|
|
@@ -1428,54 +1651,54 @@ function rr({ instance: e, periods: t, requests: n, timeWindow: r }) {
|
|
|
1428
1651
|
children: e.actorId
|
|
1429
1652
|
}), /* @__PURE__ */ u("span", {
|
|
1430
1653
|
className: "mt-0.5 block truncate text-[11px] text-muted-foreground tabular-nums",
|
|
1431
|
-
children:
|
|
1654
|
+
children: fr(i, t, e, r.fromMs)
|
|
1432
1655
|
})]
|
|
1433
1656
|
})]
|
|
1434
1657
|
}),
|
|
1435
|
-
/* @__PURE__ */ u(
|
|
1658
|
+
/* @__PURE__ */ u(pr, {
|
|
1436
1659
|
segments: a,
|
|
1437
1660
|
requests: n,
|
|
1438
1661
|
label: `${e.actorId}: ${o ? `live ${k(o)}` : "dormant"}, ${M(r)}`
|
|
1439
1662
|
}),
|
|
1440
1663
|
/* @__PURE__ */ u("span", {
|
|
1441
|
-
className:
|
|
1664
|
+
className: U("text-right text-[13px] tabular-nums", o ? "text-foreground/85" : "text-muted-foreground"),
|
|
1442
1665
|
children: k(o)
|
|
1443
1666
|
})
|
|
1444
1667
|
]
|
|
1445
1668
|
});
|
|
1446
1669
|
}
|
|
1447
|
-
function
|
|
1670
|
+
function dr(e) {
|
|
1448
1671
|
return e.reduce((e, t) => e + t.toMs - t.fromMs, 0);
|
|
1449
1672
|
}
|
|
1450
|
-
function
|
|
1673
|
+
function fr(e, t, n, r) {
|
|
1451
1674
|
if (e) {
|
|
1452
1675
|
let e = t.at(-1)?.fromMs;
|
|
1453
|
-
return e && e > r ? `Woke ${
|
|
1676
|
+
return e && e > r ? `Woke ${T(e)}` : "Live";
|
|
1454
1677
|
}
|
|
1455
1678
|
let i = t.at(-1)?.toMs ?? n.lastActiveAtMs;
|
|
1456
|
-
return i ? `Slept ${
|
|
1679
|
+
return i ? `Slept ${T(i)}` : "Dormant";
|
|
1457
1680
|
}
|
|
1458
|
-
function
|
|
1459
|
-
return /* @__PURE__ */ u(
|
|
1681
|
+
function pr({ segments: e, requests: t, label: n }) {
|
|
1682
|
+
return /* @__PURE__ */ u($n, {
|
|
1460
1683
|
label: n,
|
|
1461
|
-
children: e.map((e) => /* @__PURE__ */ u(
|
|
1684
|
+
children: e.map((e) => /* @__PURE__ */ u(mr, {
|
|
1462
1685
|
segment: e,
|
|
1463
1686
|
requests: t
|
|
1464
1687
|
}, e.left))
|
|
1465
1688
|
});
|
|
1466
1689
|
}
|
|
1467
|
-
function
|
|
1468
|
-
let n = t &&
|
|
1469
|
-
return /* @__PURE__ */ d(
|
|
1690
|
+
function mr({ segment: e, requests: t }) {
|
|
1691
|
+
let n = t && an(t, e);
|
|
1692
|
+
return /* @__PURE__ */ d(nr, { children: [/* @__PURE__ */ u(rr, {
|
|
1470
1693
|
asChild: !0,
|
|
1471
1694
|
children: /* @__PURE__ */ u("span", {
|
|
1472
|
-
className:
|
|
1695
|
+
className: U("absolute top-1/2 h-2.5 -translate-y-1/2 rounded-full bg-success shadow-[0_0_12px_color-mix(in_oklab,var(--success)_20%,transparent)] before:absolute before:-inset-x-1.5 before:-inset-y-2", e.now && "rounded-r-[1px] after:absolute after:top-0.75 after:right-1 after:size-1 after:rounded-full after:bg-background"),
|
|
1473
1696
|
style: {
|
|
1474
1697
|
left: `${e.left * 100}%`,
|
|
1475
1698
|
width: `${e.width * 100}%`
|
|
1476
1699
|
}
|
|
1477
1700
|
})
|
|
1478
|
-
}), /* @__PURE__ */ d(
|
|
1701
|
+
}), /* @__PURE__ */ d(ir, {
|
|
1479
1702
|
className: "tabular-nums",
|
|
1480
1703
|
children: [/* @__PURE__ */ u("div", {
|
|
1481
1704
|
className: "font-medium",
|
|
@@ -1491,32 +1714,32 @@ function sr({ segment: e, requests: t }) {
|
|
|
1491
1714
|
})]
|
|
1492
1715
|
})] });
|
|
1493
1716
|
}
|
|
1494
|
-
function
|
|
1717
|
+
function hr() {
|
|
1495
1718
|
return Array.from({ length: 4 }, (e, t) => /* @__PURE__ */ d("div", {
|
|
1496
|
-
className: `${
|
|
1719
|
+
className: `${or} h-11.5 border-b border-border/50 last:border-b-0`,
|
|
1497
1720
|
children: [
|
|
1498
1721
|
/* @__PURE__ */ d("div", {
|
|
1499
1722
|
className: "flex items-center gap-2.5",
|
|
1500
|
-
children: [/* @__PURE__ */ u(
|
|
1723
|
+
children: [/* @__PURE__ */ u(G, { className: "size-2 rounded-full" }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(G, { className: "h-3.5 w-32" }), /* @__PURE__ */ u(G, { className: "mt-1.5 h-2.5 w-16" })] })]
|
|
1501
1724
|
}),
|
|
1502
|
-
/* @__PURE__ */ u(
|
|
1725
|
+
/* @__PURE__ */ u(G, {
|
|
1503
1726
|
className: "h-2.5 rounded-full",
|
|
1504
1727
|
style: { width: `${70 - t * 15}%` }
|
|
1505
1728
|
}),
|
|
1506
|
-
/* @__PURE__ */ u(
|
|
1729
|
+
/* @__PURE__ */ u(G, { className: "ml-auto h-3.5 w-12" })
|
|
1507
1730
|
]
|
|
1508
1731
|
}, t));
|
|
1509
1732
|
}
|
|
1510
1733
|
//#endregion
|
|
1511
1734
|
//#region src/components/ui/sparkline.tsx
|
|
1512
|
-
var
|
|
1513
|
-
function
|
|
1514
|
-
let a = i(), [s, c] = o(null), l =
|
|
1735
|
+
var q = 300, J = 64, gr = 8;
|
|
1736
|
+
function _r({ values: e, color: t, label: n, describePoint: r }) {
|
|
1737
|
+
let a = i(), [s, c] = o(null), l = br(e), f = l.map(({ x: e, y: t }, n) => `${n ? "L" : "M"}${e.toFixed(1)},${t.toFixed(1)}`).join(" "), p = s === null ? void 0 : l[s];
|
|
1515
1738
|
return /* @__PURE__ */ d("div", {
|
|
1516
1739
|
className: "relative mt-auto h-16 w-full",
|
|
1517
1740
|
children: [
|
|
1518
1741
|
/* @__PURE__ */ d("svg", {
|
|
1519
|
-
viewBox: `0 0 ${
|
|
1742
|
+
viewBox: `0 0 ${q} ${J}`,
|
|
1520
1743
|
preserveAspectRatio: "none",
|
|
1521
1744
|
role: "img",
|
|
1522
1745
|
"aria-label": n,
|
|
@@ -1545,13 +1768,13 @@ function ur({ values: e, color: t, label: n, describePoint: r }) {
|
|
|
1545
1768
|
/* @__PURE__ */ u("line", {
|
|
1546
1769
|
x1: "0",
|
|
1547
1770
|
y1: 63.5,
|
|
1548
|
-
x2:
|
|
1771
|
+
x2: q,
|
|
1549
1772
|
y2: 63.5,
|
|
1550
1773
|
className: "stroke-border",
|
|
1551
1774
|
vectorEffect: "non-scaling-stroke"
|
|
1552
1775
|
}),
|
|
1553
1776
|
/* @__PURE__ */ u("path", {
|
|
1554
|
-
d: `${f} L${
|
|
1777
|
+
d: `${f} L${q},${J} L0,${J} Z`,
|
|
1555
1778
|
fill: `url(#${a})`
|
|
1556
1779
|
}),
|
|
1557
1780
|
/* @__PURE__ */ u("path", {
|
|
@@ -1566,46 +1789,46 @@ function ur({ values: e, color: t, label: n, describePoint: r }) {
|
|
|
1566
1789
|
x1: p.x,
|
|
1567
1790
|
x2: p.x,
|
|
1568
1791
|
y1: 0,
|
|
1569
|
-
y2:
|
|
1792
|
+
y2: J,
|
|
1570
1793
|
className: "stroke-muted-foreground/50",
|
|
1571
1794
|
strokeDasharray: "2 2",
|
|
1572
1795
|
vectorEffect: "non-scaling-stroke"
|
|
1573
1796
|
})
|
|
1574
1797
|
]
|
|
1575
1798
|
}),
|
|
1576
|
-
p && /* @__PURE__ */ u(
|
|
1799
|
+
p && /* @__PURE__ */ u(vr, {
|
|
1577
1800
|
point: p,
|
|
1578
1801
|
color: t
|
|
1579
1802
|
}),
|
|
1580
|
-
r && l.map((e, t) => /* @__PURE__ */ u(
|
|
1581
|
-
style:
|
|
1803
|
+
r && l.map((e, t) => /* @__PURE__ */ u(yr, {
|
|
1804
|
+
style: xr(t, l.length),
|
|
1582
1805
|
point: r(t),
|
|
1583
1806
|
onOpenChange: (e) => c((n) => e ? t : n === t ? null : n)
|
|
1584
1807
|
}, t))
|
|
1585
1808
|
]
|
|
1586
1809
|
});
|
|
1587
1810
|
}
|
|
1588
|
-
function
|
|
1811
|
+
function vr({ point: e, color: t }) {
|
|
1589
1812
|
return /* @__PURE__ */ u("span", {
|
|
1590
1813
|
"aria-hidden": !0,
|
|
1591
1814
|
className: "pointer-events-none absolute size-2 -translate-1/2 rounded-full border-2 border-background",
|
|
1592
1815
|
style: {
|
|
1593
|
-
left: `${e.x /
|
|
1594
|
-
top: `${e.y /
|
|
1816
|
+
left: `${e.x / q * 100}%`,
|
|
1817
|
+
top: `${e.y / J * 100}%`,
|
|
1595
1818
|
backgroundColor: t
|
|
1596
1819
|
}
|
|
1597
1820
|
});
|
|
1598
1821
|
}
|
|
1599
|
-
function
|
|
1600
|
-
return /* @__PURE__ */ d(
|
|
1822
|
+
function yr({ style: e, point: t, onOpenChange: n }) {
|
|
1823
|
+
return /* @__PURE__ */ d(nr, {
|
|
1601
1824
|
onOpenChange: n,
|
|
1602
|
-
children: [/* @__PURE__ */ u(
|
|
1825
|
+
children: [/* @__PURE__ */ u(rr, {
|
|
1603
1826
|
asChild: !0,
|
|
1604
1827
|
children: /* @__PURE__ */ u("span", {
|
|
1605
1828
|
className: "absolute inset-y-0",
|
|
1606
1829
|
style: e
|
|
1607
1830
|
})
|
|
1608
|
-
}), /* @__PURE__ */ d(
|
|
1831
|
+
}), /* @__PURE__ */ d(ir, {
|
|
1609
1832
|
className: "tabular-nums",
|
|
1610
1833
|
children: [/* @__PURE__ */ u("div", {
|
|
1611
1834
|
className: "opacity-80",
|
|
@@ -1617,14 +1840,14 @@ function fr({ style: e, point: t, onOpenChange: n }) {
|
|
|
1617
1840
|
})]
|
|
1618
1841
|
});
|
|
1619
1842
|
}
|
|
1620
|
-
function
|
|
1621
|
-
let t = Math.min(...e), n = Math.max(...e) - t || 1, r =
|
|
1843
|
+
function br(e) {
|
|
1844
|
+
let t = Math.min(...e), n = Math.max(...e) - t || 1, r = q / Math.max(e.length - 1, 1);
|
|
1622
1845
|
return e.map((e, i) => ({
|
|
1623
1846
|
x: i * r,
|
|
1624
|
-
y:
|
|
1847
|
+
y: gr + (1 - (e - t) / n) * 40
|
|
1625
1848
|
}));
|
|
1626
1849
|
}
|
|
1627
|
-
function
|
|
1850
|
+
function xr(e, t) {
|
|
1628
1851
|
let n = t > 1 ? e / (t - 1) : .5, r = .5 / Math.max(t - 1, 1), i = Math.max(0, n - r), a = Math.min(1, n + r);
|
|
1629
1852
|
return {
|
|
1630
1853
|
left: `${i * 100}%`,
|
|
@@ -1633,20 +1856,16 @@ function mr(e, t) {
|
|
|
1633
1856
|
}
|
|
1634
1857
|
//#endregion
|
|
1635
1858
|
//#region src/components/ui/trendCard.tsx
|
|
1636
|
-
function
|
|
1637
|
-
return /* @__PURE__ */ d(
|
|
1859
|
+
function Sr({ label: e, value: t, unit: n, busy: r, failed: i, series: a, axis: o, color: s, chartLabel: c, describePoint: f }) {
|
|
1860
|
+
return /* @__PURE__ */ d(Wn, {
|
|
1638
1861
|
label: e,
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
children: [/* @__PURE__ */ u("div", {
|
|
1647
|
-
className: "mt-2 flex flex-wrap items-center gap-x-4.5 gap-y-1 text-[13px] text-muted-foreground tabular-nums",
|
|
1648
|
-
children: p
|
|
1649
|
-
}), i ? /* @__PURE__ */ u(gr, { ticks: o.length }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(ur, {
|
|
1862
|
+
value: t,
|
|
1863
|
+
unit: r ? /* @__PURE__ */ u(G, { className: "h-3.5 w-9" }) : n,
|
|
1864
|
+
busy: r,
|
|
1865
|
+
children: [i && /* @__PURE__ */ u("p", {
|
|
1866
|
+
className: "mt-2 text-[13px] text-muted-foreground",
|
|
1867
|
+
children: "Couldn't reach the observer API."
|
|
1868
|
+
}), r ? /* @__PURE__ */ u(Cr, { ticks: o.length }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(_r, {
|
|
1650
1869
|
values: a,
|
|
1651
1870
|
color: s,
|
|
1652
1871
|
label: c,
|
|
@@ -1657,61 +1876,40 @@ function hr({ label: e, window: t, value: n, unit: r, busy: i, series: a, axis:
|
|
|
1657
1876
|
})] })]
|
|
1658
1877
|
});
|
|
1659
1878
|
}
|
|
1660
|
-
function
|
|
1661
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
1879
|
+
function Cr({ ticks: e }) {
|
|
1880
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(G, { className: "mt-auto h-16 w-full rounded-sm" }), /* @__PURE__ */ u("div", {
|
|
1662
1881
|
className: "mt-1.5 flex h-4 items-center justify-between",
|
|
1663
|
-
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ u(
|
|
1882
|
+
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ u(G, { className: "h-3 w-9" }, t))
|
|
1664
1883
|
})] });
|
|
1665
1884
|
}
|
|
1666
|
-
function _r({ failed: e }) {
|
|
1667
|
-
return e ? /* @__PURE__ */ u("span", { children: "Couldn't reach the observer API." }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(U, { className: "h-3.5 w-20" }), /* @__PURE__ */ u(U, { className: "h-3.5 w-28" })] });
|
|
1668
|
-
}
|
|
1669
|
-
function q({ label: e, value: t, suffix: n }) {
|
|
1670
|
-
return /* @__PURE__ */ d("span", { children: [
|
|
1671
|
-
e,
|
|
1672
|
-
" ",
|
|
1673
|
-
/* @__PURE__ */ u("b", {
|
|
1674
|
-
className: "font-bold text-foreground",
|
|
1675
|
-
children: t
|
|
1676
|
-
}),
|
|
1677
|
-
n && ` ${n}`
|
|
1678
|
-
] });
|
|
1679
|
-
}
|
|
1680
1885
|
//#endregion
|
|
1681
1886
|
//#region src/components/actorType/timingCard.tsx
|
|
1682
|
-
function
|
|
1683
|
-
let
|
|
1684
|
-
return /* @__PURE__ */ u(
|
|
1887
|
+
function wr({ label: e, pick: t, color: n, chartLabel: r, requests: i, failed: a, timeWindow: o }) {
|
|
1888
|
+
let s = i && en(i, o, t), c = !s && !a, [l, d] = dt(s?.average ?? 0), f = s ? l : c ? /* @__PURE__ */ u(G, { className: "h-11 w-20" }) : "—", p = s?.series ?? Array(P(o)).fill(0);
|
|
1889
|
+
return /* @__PURE__ */ u(Sr, {
|
|
1685
1890
|
label: e,
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
series:
|
|
1691
|
-
axis: N(
|
|
1692
|
-
color:
|
|
1693
|
-
chartLabel:
|
|
1891
|
+
value: f,
|
|
1892
|
+
unit: d,
|
|
1893
|
+
busy: c,
|
|
1894
|
+
failed: !s && a,
|
|
1895
|
+
series: p,
|
|
1896
|
+
axis: N(o, 2),
|
|
1897
|
+
color: n,
|
|
1898
|
+
chartLabel: r,
|
|
1694
1899
|
describePoint: (e) => ({
|
|
1695
|
-
at:
|
|
1696
|
-
value: D(
|
|
1697
|
-
})
|
|
1698
|
-
children: c ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(q, {
|
|
1699
|
-
label: "p95",
|
|
1700
|
-
value: D(c.p95)
|
|
1701
|
-
}), /* @__PURE__ */ u(q, {
|
|
1702
|
-
label: "Max",
|
|
1703
|
-
value: D(c.max)
|
|
1704
|
-
})] }) : /* @__PURE__ */ u(_r, { failed: o })
|
|
1900
|
+
at: wt(o, e),
|
|
1901
|
+
value: D(p[e] ?? 0)
|
|
1902
|
+
})
|
|
1705
1903
|
});
|
|
1706
1904
|
}
|
|
1707
1905
|
//#endregion
|
|
1708
1906
|
//#region src/components/actorType/actorTypePage.tsx
|
|
1709
|
-
function
|
|
1710
|
-
let { actorName: e = "" } = _(), { actorTypes: t, isError: n } =
|
|
1907
|
+
function Tr() {
|
|
1908
|
+
let { actorName: e = "" } = _(), { actorTypes: t, isError: n } = R(), r = L(), { requests: i, isError: a } = Wt(e), { residency: o, isError: s } = Xt(e, r), c = t?.actors.find((t) => t.actorName === e) ?? null;
|
|
1711
1909
|
return /* @__PURE__ */ d("section", {
|
|
1712
1910
|
"aria-labelledby": "actor-type-heading",
|
|
1713
1911
|
className: "flex flex-col gap-5",
|
|
1714
|
-
children: [/* @__PURE__ */ u(
|
|
1912
|
+
children: [/* @__PURE__ */ u(Er, {
|
|
1715
1913
|
actorName: e,
|
|
1716
1914
|
actor: c,
|
|
1717
1915
|
loading: !t && !n
|
|
@@ -1728,24 +1926,22 @@ function yr() {
|
|
|
1728
1926
|
/* @__PURE__ */ d("div", {
|
|
1729
1927
|
className: "grid gap-4 lg:grid-cols-3",
|
|
1730
1928
|
children: [
|
|
1731
|
-
/* @__PURE__ */ u(
|
|
1732
|
-
summary: c &&
|
|
1929
|
+
/* @__PURE__ */ u(Kn, {
|
|
1930
|
+
summary: c && z(c),
|
|
1733
1931
|
failed: n
|
|
1734
1932
|
}),
|
|
1735
|
-
/* @__PURE__ */ u(
|
|
1933
|
+
/* @__PURE__ */ u(wr, {
|
|
1736
1934
|
label: "Avg Queue Time",
|
|
1737
|
-
|
|
1738
|
-
pick: R,
|
|
1935
|
+
pick: B,
|
|
1739
1936
|
color: "var(--chart-1)",
|
|
1740
1937
|
chartLabel: `Average queue time, ${M(r)}`,
|
|
1741
1938
|
requests: i,
|
|
1742
1939
|
failed: a,
|
|
1743
1940
|
timeWindow: r
|
|
1744
1941
|
}),
|
|
1745
|
-
/* @__PURE__ */ u(
|
|
1942
|
+
/* @__PURE__ */ u(wr, {
|
|
1746
1943
|
label: "Avg Request Latency",
|
|
1747
|
-
|
|
1748
|
-
pick: z,
|
|
1944
|
+
pick: V,
|
|
1749
1945
|
color: "var(--chart-2)",
|
|
1750
1946
|
chartLabel: `Average request latency, ${M(r)}`,
|
|
1751
1947
|
requests: i,
|
|
@@ -1754,13 +1950,13 @@ function yr() {
|
|
|
1754
1950
|
})
|
|
1755
1951
|
]
|
|
1756
1952
|
}),
|
|
1757
|
-
/* @__PURE__ */ u(
|
|
1953
|
+
/* @__PURE__ */ u(jn, {
|
|
1758
1954
|
actor: c,
|
|
1759
1955
|
requests: i,
|
|
1760
1956
|
failed: n,
|
|
1761
1957
|
now: r.toMs
|
|
1762
1958
|
}),
|
|
1763
|
-
/* @__PURE__ */ u(
|
|
1959
|
+
/* @__PURE__ */ u(sr, {
|
|
1764
1960
|
actor: c,
|
|
1765
1961
|
history: o,
|
|
1766
1962
|
requests: i,
|
|
@@ -1771,87 +1967,74 @@ function yr() {
|
|
|
1771
1967
|
})]
|
|
1772
1968
|
});
|
|
1773
1969
|
}
|
|
1774
|
-
function
|
|
1775
|
-
return /* @__PURE__ */ u(
|
|
1970
|
+
function Er({ actorName: e, actor: t, loading: n }) {
|
|
1971
|
+
return /* @__PURE__ */ u(En, {
|
|
1776
1972
|
titleId: "actor-type-heading",
|
|
1777
1973
|
title: e,
|
|
1778
1974
|
back: {
|
|
1779
1975
|
to: "..",
|
|
1780
1976
|
label: "Overview"
|
|
1781
1977
|
},
|
|
1782
|
-
meta: t ? `Actor type · ${O(t.instances.length, "instance")}` : n ? /* @__PURE__ */ u(
|
|
1783
|
-
aside: /* @__PURE__ */ u(
|
|
1978
|
+
meta: t ? `Actor type · ${O(t.instances.length, "instance")}` : n ? /* @__PURE__ */ u(G, { className: "h-3.5 w-40" }) : "Actor type",
|
|
1979
|
+
aside: /* @__PURE__ */ u(wn, {})
|
|
1784
1980
|
});
|
|
1785
1981
|
}
|
|
1786
1982
|
//#endregion
|
|
1787
1983
|
//#region src/components/overview/activeActorsCard.tsx
|
|
1788
|
-
function
|
|
1789
|
-
let { actorTypes: e, isError: t } =
|
|
1790
|
-
return /* @__PURE__ */ u(
|
|
1984
|
+
function Dr() {
|
|
1985
|
+
let { actorTypes: e, isError: t } = R(), n = e && Or(e), r = !n && !t, i = n ? E(n.live) : r ? /* @__PURE__ */ u(G, { className: "h-11 w-28" }) : "—";
|
|
1986
|
+
return /* @__PURE__ */ u(Wn, {
|
|
1791
1987
|
label: "Active Actors",
|
|
1792
1988
|
value: i,
|
|
1793
|
-
unit: r ? /* @__PURE__ */ u(
|
|
1989
|
+
unit: r ? /* @__PURE__ */ u(G, { className: "h-3.5 w-7" }) : "live",
|
|
1794
1990
|
busy: r,
|
|
1795
|
-
children: n ? /* @__PURE__ */ u(
|
|
1991
|
+
children: n ? /* @__PURE__ */ u(kr, { ...n }) : /* @__PURE__ */ u(Ar, { failed: t })
|
|
1796
1992
|
});
|
|
1797
1993
|
}
|
|
1798
|
-
function
|
|
1994
|
+
function Or(e) {
|
|
1799
1995
|
let t = e.actors.flatMap((e) => e.instances);
|
|
1800
1996
|
return {
|
|
1801
1997
|
live: t.filter((e) => e.status === "live").length,
|
|
1802
1998
|
dormant: t.filter((e) => e.status === "dormant").length
|
|
1803
1999
|
};
|
|
1804
2000
|
}
|
|
1805
|
-
function
|
|
2001
|
+
function kr({ live: e, dormant: t }) {
|
|
1806
2002
|
let n = e + t, r = n ? e / n : 0;
|
|
1807
|
-
return /* @__PURE__ */ d(l, { children: [
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
}),
|
|
1817
|
-
/* @__PURE__ */ u(Nn, {
|
|
1818
|
-
liveShare: r,
|
|
1819
|
-
label: `${w(e)} live actors, ${w(t)} dormant actors`,
|
|
1820
|
-
pulse: !0,
|
|
1821
|
-
className: "mt-auto h-10 rounded-sm"
|
|
1822
|
-
}),
|
|
1823
|
-
/* @__PURE__ */ u(Pn, {
|
|
1824
|
-
live: e,
|
|
1825
|
-
dormant: t,
|
|
1826
|
-
showCounts: !0
|
|
1827
|
-
})
|
|
1828
|
-
] });
|
|
2003
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(Bn, {
|
|
2004
|
+
liveShare: r,
|
|
2005
|
+
label: `${E(e)} live actors, ${E(t)} dormant actors`,
|
|
2006
|
+
pulse: !0,
|
|
2007
|
+
className: "mt-auto h-10 rounded-sm"
|
|
2008
|
+
}), /* @__PURE__ */ u(Vn, {
|
|
2009
|
+
live: e,
|
|
2010
|
+
dormant: t
|
|
2011
|
+
})] });
|
|
1829
2012
|
}
|
|
1830
|
-
function
|
|
2013
|
+
function Ar({ failed: e }) {
|
|
1831
2014
|
return e ? /* @__PURE__ */ u("p", {
|
|
1832
2015
|
className: "mt-2 text-[13px] text-muted-foreground",
|
|
1833
2016
|
children: "Couldn't reach the observer API."
|
|
1834
|
-
}) : /* @__PURE__ */
|
|
2017
|
+
}) : /* @__PURE__ */ u(Hn, {});
|
|
1835
2018
|
}
|
|
1836
2019
|
//#endregion
|
|
1837
2020
|
//#region src/components/overview/actorTypesCard.tsx
|
|
1838
|
-
function
|
|
1839
|
-
let { actorTypes: e, isError: t } =
|
|
1840
|
-
return /* @__PURE__ */ u(
|
|
2021
|
+
function jr() {
|
|
2022
|
+
let { actorTypes: e, isError: t } = R(), n = e && e.actors.map(z).sort((e, t) => t.total - e.total);
|
|
2023
|
+
return /* @__PURE__ */ u(K, {
|
|
1841
2024
|
title: "Actor Types",
|
|
1842
|
-
aside: /* @__PURE__ */ u(
|
|
2025
|
+
aside: /* @__PURE__ */ u(Mr, {}),
|
|
1843
2026
|
busy: !n && !t,
|
|
1844
2027
|
className: "pb-2.5",
|
|
1845
2028
|
children: /* @__PURE__ */ u("div", {
|
|
1846
2029
|
className: "mt-1.5",
|
|
1847
|
-
children: /* @__PURE__ */ u(
|
|
2030
|
+
children: /* @__PURE__ */ u(Nr, {
|
|
1848
2031
|
rows: n,
|
|
1849
2032
|
failed: t
|
|
1850
2033
|
})
|
|
1851
2034
|
})
|
|
1852
2035
|
});
|
|
1853
2036
|
}
|
|
1854
|
-
function
|
|
2037
|
+
function Mr() {
|
|
1855
2038
|
return /* @__PURE__ */ d("div", {
|
|
1856
2039
|
className: "flex gap-4 text-xs text-muted-foreground",
|
|
1857
2040
|
children: [/* @__PURE__ */ d("span", {
|
|
@@ -1863,30 +2046,30 @@ function Er() {
|
|
|
1863
2046
|
})]
|
|
1864
2047
|
});
|
|
1865
2048
|
}
|
|
1866
|
-
function
|
|
2049
|
+
function Nr({ rows: e, failed: t }) {
|
|
1867
2050
|
if (t) return /* @__PURE__ */ u("p", {
|
|
1868
2051
|
className: "py-4 text-[13px] text-muted-foreground",
|
|
1869
2052
|
children: "Couldn't reach the observer API."
|
|
1870
2053
|
});
|
|
1871
|
-
if (!e) return /* @__PURE__ */ u(
|
|
2054
|
+
if (!e) return /* @__PURE__ */ u(Rr, {});
|
|
1872
2055
|
if (!e.length) return /* @__PURE__ */ u("p", {
|
|
1873
2056
|
className: "py-4 text-[13px] text-muted-foreground",
|
|
1874
2057
|
children: "No actor types deployed yet."
|
|
1875
2058
|
});
|
|
1876
2059
|
let n = Math.max(...e.map((e) => e.total), 1);
|
|
1877
|
-
return /* @__PURE__ */ u("ul", { children: e.map((e) => /* @__PURE__ */ u(
|
|
2060
|
+
return /* @__PURE__ */ u("ul", { children: e.map((e) => /* @__PURE__ */ u(Ir, {
|
|
1878
2061
|
row: e,
|
|
1879
2062
|
largest: n
|
|
1880
2063
|
}, e.actorName)) });
|
|
1881
2064
|
}
|
|
1882
|
-
var
|
|
1883
|
-
function
|
|
2065
|
+
var Pr = "grid items-center gap-x-7 gap-y-3 py-4 md:grid-cols-[190px_1fr_168px]", Fr = "border-t border-border/60 first:border-t-0";
|
|
2066
|
+
function Ir({ row: e, largest: t }) {
|
|
1884
2067
|
let n = e.total ? e.live / e.total : 0;
|
|
1885
2068
|
return /* @__PURE__ */ u("li", {
|
|
1886
|
-
className:
|
|
2069
|
+
className: Fr,
|
|
1887
2070
|
children: /* @__PURE__ */ d(f, {
|
|
1888
|
-
to:
|
|
1889
|
-
className: `${
|
|
2071
|
+
to: Zt(e.actorName),
|
|
2072
|
+
className: `${Pr} -mx-3 rounded-lg px-3 tabular-nums transition-colors outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring`,
|
|
1890
2073
|
children: [
|
|
1891
2074
|
/* @__PURE__ */ d("div", {
|
|
1892
2075
|
className: "min-w-0",
|
|
@@ -1899,7 +2082,7 @@ function Ar({ row: e, largest: t }) {
|
|
|
1899
2082
|
children: O(e.total, "instance")
|
|
1900
2083
|
})]
|
|
1901
2084
|
}),
|
|
1902
|
-
/* @__PURE__ */ u(
|
|
2085
|
+
/* @__PURE__ */ u(Lr, {
|
|
1903
2086
|
row: e,
|
|
1904
2087
|
liveShare: n,
|
|
1905
2088
|
width: e.total / t
|
|
@@ -1908,13 +2091,13 @@ function Ar({ row: e, largest: t }) {
|
|
|
1908
2091
|
className: "grid grid-cols-2 gap-5 text-right",
|
|
1909
2092
|
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("b", {
|
|
1910
2093
|
className: "block text-lg leading-tight font-bold tracking-tight",
|
|
1911
|
-
children:
|
|
1912
|
-
}), /* @__PURE__ */
|
|
2094
|
+
children: E(e.live)
|
|
2095
|
+
}), /* @__PURE__ */ u("span", {
|
|
1913
2096
|
className: "mt-0.75 block text-xs text-success",
|
|
1914
|
-
children:
|
|
2097
|
+
children: "live"
|
|
1915
2098
|
})] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("b", {
|
|
1916
2099
|
className: "block text-lg leading-tight font-medium tracking-tight text-foreground/85",
|
|
1917
|
-
children:
|
|
2100
|
+
children: E(e.dormant)
|
|
1918
2101
|
}), /* @__PURE__ */ u("span", {
|
|
1919
2102
|
className: "mt-0.75 block text-xs text-muted-foreground",
|
|
1920
2103
|
children: "dormant"
|
|
@@ -1924,177 +2107,127 @@ function Ar({ row: e, largest: t }) {
|
|
|
1924
2107
|
})
|
|
1925
2108
|
});
|
|
1926
2109
|
}
|
|
1927
|
-
function
|
|
2110
|
+
function Lr({ row: e, liveShare: t, width: n }) {
|
|
1928
2111
|
return /* @__PURE__ */ u("div", {
|
|
1929
2112
|
className: "relative flex h-5.5 items-center before:absolute before:inset-x-0 before:top-1/2 before:h-px before:bg-border/60",
|
|
1930
|
-
children: /* @__PURE__ */ u(
|
|
2113
|
+
children: /* @__PURE__ */ u(Bn, {
|
|
1931
2114
|
liveShare: t,
|
|
1932
|
-
label: `${
|
|
2115
|
+
label: `${E(e.live)} of ${E(e.total)} live, ${ut(t)}`,
|
|
1933
2116
|
className: "h-5.5 min-w-2.5 rounded-[3px]",
|
|
1934
2117
|
style: { width: `${n * 100}%` }
|
|
1935
2118
|
})
|
|
1936
2119
|
});
|
|
1937
2120
|
}
|
|
1938
|
-
function
|
|
2121
|
+
function Rr() {
|
|
1939
2122
|
return /* @__PURE__ */ u("ul", { children: [
|
|
1940
2123
|
100,
|
|
1941
2124
|
60,
|
|
1942
2125
|
20
|
|
1943
2126
|
].map((e) => /* @__PURE__ */ d("li", {
|
|
1944
|
-
className: `${
|
|
2127
|
+
className: `${Pr} ${Fr}`,
|
|
1945
2128
|
children: [
|
|
1946
|
-
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(
|
|
1947
|
-
/* @__PURE__ */ u(
|
|
2129
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(G, { className: "h-4 w-28" }), /* @__PURE__ */ u(G, { className: "mt-1.5 h-3 w-20" })] }),
|
|
2130
|
+
/* @__PURE__ */ u(G, {
|
|
1948
2131
|
className: "h-5.5 rounded-[3px]",
|
|
1949
2132
|
style: { width: `${e}%` }
|
|
1950
2133
|
}),
|
|
1951
|
-
/* @__PURE__ */ u(
|
|
2134
|
+
/* @__PURE__ */ u(G, { className: "ml-auto h-8 w-32" })
|
|
1952
2135
|
]
|
|
1953
2136
|
}, e)) });
|
|
1954
2137
|
}
|
|
1955
2138
|
//#endregion
|
|
1956
2139
|
//#region src/components/overview/requestCountCard.tsx
|
|
1957
|
-
function
|
|
1958
|
-
let { requests: e, isRequestsError: t } =
|
|
2140
|
+
function zr() {
|
|
2141
|
+
let { requests: e, isRequestsError: t } = R(), n = L(), r = e && Vr(e, n), i = !r && !t, a = /* @__PURE__ */ u(Br, {
|
|
1959
2142
|
total: r?.total,
|
|
1960
2143
|
loading: i
|
|
1961
2144
|
}), o = M(n), s = r?.series ?? Array(P(n)).fill(0);
|
|
1962
|
-
return /* @__PURE__ */ u(
|
|
2145
|
+
return /* @__PURE__ */ u(Sr, {
|
|
1963
2146
|
label: "Total Requests",
|
|
1964
|
-
window: o,
|
|
1965
2147
|
value: a,
|
|
1966
2148
|
unit: "requests",
|
|
1967
2149
|
busy: i,
|
|
2150
|
+
failed: !r && t,
|
|
1968
2151
|
series: s,
|
|
1969
2152
|
axis: N(n, 2),
|
|
1970
2153
|
color: "var(--chart-1)",
|
|
1971
|
-
chartLabel: r ? `Requests, ${o}, ${
|
|
2154
|
+
chartLabel: r ? `Requests, ${o}, ${E(r.total)} in total` : `Requests, ${o}`,
|
|
1972
2155
|
describePoint: (e) => ({
|
|
1973
|
-
at:
|
|
2156
|
+
at: wt(n, e),
|
|
1974
2157
|
value: O(s[e] ?? 0, "request")
|
|
1975
|
-
})
|
|
1976
|
-
children: r ? /* @__PURE__ */ u(Ir, { ...r }) : /* @__PURE__ */ u(_r, { failed: t })
|
|
2158
|
+
})
|
|
1977
2159
|
});
|
|
1978
2160
|
}
|
|
1979
|
-
function
|
|
1980
|
-
return e === void 0 ? t ? /* @__PURE__ */ u(
|
|
2161
|
+
function Br({ total: e, loading: t }) {
|
|
2162
|
+
return e === void 0 ? t ? /* @__PURE__ */ u(G, { className: "h-11 w-28" }) : /* @__PURE__ */ u(l, { children: "—" }) : /* @__PURE__ */ u(l, { children: E(e) });
|
|
1981
2163
|
}
|
|
1982
|
-
function
|
|
1983
|
-
let n =
|
|
2164
|
+
function Vr(e, t) {
|
|
2165
|
+
let n = nn(e, t);
|
|
1984
2166
|
return {
|
|
1985
|
-
total:
|
|
1986
|
-
perSecond: r / ((t.toMs - t.fromMs) / 1e3),
|
|
1987
|
-
peak: i,
|
|
1988
|
-
peakAt: C(Ct(t, n.indexOf(i))),
|
|
2167
|
+
total: n.reduce((e, t) => e + t, 0),
|
|
1989
2168
|
series: n
|
|
1990
2169
|
};
|
|
1991
2170
|
}
|
|
1992
|
-
function Ir({ perSecond: e, peak: t, peakAt: n }) {
|
|
1993
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(q, {
|
|
1994
|
-
label: "Avg",
|
|
1995
|
-
value: T(e),
|
|
1996
|
-
suffix: "req/s"
|
|
1997
|
-
}), /* @__PURE__ */ u(q, {
|
|
1998
|
-
label: "Peak",
|
|
1999
|
-
value: w(t),
|
|
2000
|
-
suffix: `at ${n}`
|
|
2001
|
-
})] });
|
|
2002
|
-
}
|
|
2003
2171
|
//#endregion
|
|
2004
2172
|
//#region src/lib/sockets.ts
|
|
2005
|
-
function
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
toMs: e.closedAtMs ?? (t ? Infinity : e.lastSeenMs ?? n)
|
|
2173
|
+
function Hr(e) {
|
|
2174
|
+
return {
|
|
2175
|
+
fromMs: e.openedAtMs,
|
|
2176
|
+
toMs: e.closedAtMs ?? Infinity
|
|
2010
2177
|
};
|
|
2011
2178
|
}
|
|
2012
2179
|
//#endregion
|
|
2013
2180
|
//#region src/lib/trendWindow.ts
|
|
2014
|
-
var
|
|
2015
|
-
|
|
2016
|
-
var
|
|
2017
|
-
function
|
|
2181
|
+
var Y = 36e5;
|
|
2182
|
+
Y / 30;
|
|
2183
|
+
var Ur = Array(30).fill(0);
|
|
2184
|
+
function Wr(e) {
|
|
2018
2185
|
return [
|
|
2019
|
-
|
|
2020
|
-
|
|
2186
|
+
T(e - Y),
|
|
2187
|
+
T(e - Y / 2),
|
|
2021
2188
|
"Now"
|
|
2022
2189
|
];
|
|
2023
2190
|
}
|
|
2024
2191
|
//#endregion
|
|
2025
|
-
//#region src/components/ui/delta.tsx
|
|
2026
|
-
function Br({ value: e, children: t }) {
|
|
2027
|
-
return /* @__PURE__ */ u("span", {
|
|
2028
|
-
className: `rounded-sm px-1.5 py-px text-xs font-medium tabular-nums ${e < 0 ? "bg-danger/15 text-danger" : "bg-success/15 text-success"}`,
|
|
2029
|
-
children: t
|
|
2030
|
-
});
|
|
2031
|
-
}
|
|
2032
|
-
//#endregion
|
|
2033
2192
|
//#region src/components/overview/socketsCard.tsx
|
|
2034
|
-
function
|
|
2035
|
-
let { actorTypes: e, sessions: t, isError: n, isSocketsError: r } =
|
|
2036
|
-
return /* @__PURE__ */ u(
|
|
2193
|
+
function Gr() {
|
|
2194
|
+
let { actorTypes: e, sessions: t, isError: n, isSocketsError: r } = R(), i = Date.now(), a = n || r, o = e && t && Kr(e, t, i), s = !o && !a, c = o ? E(o.open) : s ? /* @__PURE__ */ u(G, { className: "h-11 w-28" }) : "—", l = o?.series ?? Ur;
|
|
2195
|
+
return /* @__PURE__ */ u(Sr, {
|
|
2037
2196
|
label: "WebSocket Connections",
|
|
2038
|
-
window: "open now",
|
|
2039
2197
|
value: c,
|
|
2040
2198
|
unit: "open",
|
|
2041
2199
|
busy: s,
|
|
2200
|
+
failed: !o && a,
|
|
2042
2201
|
series: l,
|
|
2043
|
-
axis:
|
|
2202
|
+
axis: Wr(i),
|
|
2044
2203
|
color: "var(--chart-2)",
|
|
2045
|
-
chartLabel: o ? `Open WebSocket connections over the last hour, now ${
|
|
2204
|
+
chartLabel: o ? `Open WebSocket connections over the last hour, now ${E(o.open)}` : "Open WebSocket connections over the last hour",
|
|
2046
2205
|
describePoint: (e) => ({
|
|
2047
|
-
at:
|
|
2206
|
+
at: T(Jr(i, e)),
|
|
2048
2207
|
value: O(l[e] ?? 0, "open connection")
|
|
2049
|
-
})
|
|
2050
|
-
children: o ? /* @__PURE__ */ u(Jr, { ...o }) : /* @__PURE__ */ u(_r, { failed: a })
|
|
2208
|
+
})
|
|
2051
2209
|
});
|
|
2052
2210
|
}
|
|
2053
|
-
function
|
|
2054
|
-
let r = e.actors.flatMap((e) => e.instances)
|
|
2211
|
+
function Kr(e, t, n) {
|
|
2212
|
+
let r = e.actors.flatMap((e) => e.instances).reduce((e, t) => e + t.connections.length, 0);
|
|
2055
2213
|
return {
|
|
2056
|
-
open:
|
|
2057
|
-
|
|
2058
|
-
perLiveActor: a ? i / a : 0,
|
|
2059
|
-
series: o
|
|
2214
|
+
open: r,
|
|
2215
|
+
series: [...qr(t, n).slice(0, -1), r]
|
|
2060
2216
|
};
|
|
2061
2217
|
}
|
|
2062
|
-
function
|
|
2063
|
-
return
|
|
2064
|
-
}
|
|
2065
|
-
function Wr(e, t, n) {
|
|
2066
|
-
return Array.from({ length: 30 }, (r, i) => e.filter((e) => Kr(e, t, Gr(n, i))).length);
|
|
2067
|
-
}
|
|
2068
|
-
function Gr(e, t) {
|
|
2069
|
-
return e - J + J / 29 * t;
|
|
2218
|
+
function qr(e, t) {
|
|
2219
|
+
return Array.from({ length: 30 }, (n, r) => e.filter((e) => Yr(e, Jr(t, r))).length);
|
|
2070
2220
|
}
|
|
2071
|
-
function
|
|
2072
|
-
|
|
2073
|
-
return r !== null && r.fromMs <= n && n < r.toMs;
|
|
2074
|
-
}
|
|
2075
|
-
function qr(e, t, n) {
|
|
2076
|
-
return JSON.stringify([
|
|
2077
|
-
e,
|
|
2078
|
-
t,
|
|
2079
|
-
n
|
|
2080
|
-
]);
|
|
2221
|
+
function Jr(e, t) {
|
|
2222
|
+
return e - Y + Y / 29 * t;
|
|
2081
2223
|
}
|
|
2082
|
-
function
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
children: [/* @__PURE__ */ u(Br, {
|
|
2086
|
-
value: e,
|
|
2087
|
-
children: lt(e)
|
|
2088
|
-
}), "vs 1\xA0h ago"]
|
|
2089
|
-
}), /* @__PURE__ */ u(q, {
|
|
2090
|
-
label: "Avg",
|
|
2091
|
-
value: T(t),
|
|
2092
|
-
suffix: "per live actor"
|
|
2093
|
-
})] });
|
|
2224
|
+
function Yr(e, t) {
|
|
2225
|
+
let n = Hr(e);
|
|
2226
|
+
return n.fromMs <= t && t < n.toMs;
|
|
2094
2227
|
}
|
|
2095
2228
|
//#endregion
|
|
2096
2229
|
//#region src/components/overview/overview.tsx
|
|
2097
|
-
function
|
|
2230
|
+
function Xr() {
|
|
2098
2231
|
return /* @__PURE__ */ d("section", {
|
|
2099
2232
|
"aria-labelledby": "overview-heading",
|
|
2100
2233
|
className: "flex flex-col gap-5",
|
|
@@ -2110,77 +2243,77 @@ function Yr() {
|
|
|
2110
2243
|
children: [/* @__PURE__ */ d("div", {
|
|
2111
2244
|
className: "grid gap-4 lg:grid-cols-3",
|
|
2112
2245
|
children: [
|
|
2113
|
-
/* @__PURE__ */ u(
|
|
2114
|
-
/* @__PURE__ */ u(
|
|
2115
|
-
/* @__PURE__ */ u(
|
|
2246
|
+
/* @__PURE__ */ u(Dr, {}),
|
|
2247
|
+
/* @__PURE__ */ u(zr, {}),
|
|
2248
|
+
/* @__PURE__ */ u(Gr, {})
|
|
2116
2249
|
]
|
|
2117
|
-
}), /* @__PURE__ */ u(
|
|
2250
|
+
}), /* @__PURE__ */ u(jr, {})]
|
|
2118
2251
|
})]
|
|
2119
2252
|
});
|
|
2120
2253
|
}
|
|
2121
2254
|
//#endregion
|
|
2122
2255
|
//#region src/components/ui/drawer.tsx
|
|
2123
|
-
function
|
|
2124
|
-
return /* @__PURE__ */ u(
|
|
2256
|
+
function Zr({ ...e }) {
|
|
2257
|
+
return /* @__PURE__ */ u(S.Root, {
|
|
2125
2258
|
"data-slot": "drawer",
|
|
2126
2259
|
...e
|
|
2127
2260
|
});
|
|
2128
2261
|
}
|
|
2129
|
-
function
|
|
2130
|
-
return /* @__PURE__ */ u(
|
|
2262
|
+
function Qr({ ...e }) {
|
|
2263
|
+
return /* @__PURE__ */ u(S.Portal, {
|
|
2131
2264
|
"data-slot": "drawer-portal",
|
|
2132
2265
|
...e
|
|
2133
2266
|
});
|
|
2134
2267
|
}
|
|
2135
|
-
function
|
|
2136
|
-
return /* @__PURE__ */ u(
|
|
2268
|
+
function $r({ ...e }) {
|
|
2269
|
+
return /* @__PURE__ */ u(S.Close, {
|
|
2137
2270
|
"data-slot": "drawer-close",
|
|
2138
2271
|
...e
|
|
2139
2272
|
});
|
|
2140
2273
|
}
|
|
2141
|
-
function
|
|
2142
|
-
return /* @__PURE__ */ u(
|
|
2274
|
+
function ei({ className: e, ...t }) {
|
|
2275
|
+
return /* @__PURE__ */ u(S.Overlay, {
|
|
2143
2276
|
"data-slot": "drawer-overlay",
|
|
2144
|
-
className:
|
|
2277
|
+
className: U("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", e),
|
|
2145
2278
|
...t
|
|
2146
2279
|
});
|
|
2147
2280
|
}
|
|
2148
|
-
function
|
|
2149
|
-
return /* @__PURE__ */ d(
|
|
2281
|
+
function ti({ className: e, children: t, container: n, ...r }) {
|
|
2282
|
+
return /* @__PURE__ */ d(Qr, {
|
|
2150
2283
|
container: n,
|
|
2151
|
-
children: [/* @__PURE__ */ u(
|
|
2284
|
+
children: [/* @__PURE__ */ u(ei, {}), /* @__PURE__ */ d(S.Content, {
|
|
2152
2285
|
"data-slot": "drawer-content",
|
|
2153
|
-
className:
|
|
2286
|
+
className: U("group/drawer-content fixed z-50 flex h-auto flex-col bg-background", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:h-full data-[vaul-drawer-direction=right]:w-full data-[vaul-drawer-direction=right]:max-w-[440px] data-[vaul-drawer-direction=right]:border-l", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", e),
|
|
2154
2287
|
...r,
|
|
2155
2288
|
children: [/* @__PURE__ */ u("div", { className: "mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), t]
|
|
2156
2289
|
})]
|
|
2157
2290
|
});
|
|
2158
2291
|
}
|
|
2159
|
-
function
|
|
2292
|
+
function ni({ className: e, ...t }) {
|
|
2160
2293
|
return /* @__PURE__ */ u("div", {
|
|
2161
2294
|
"data-slot": "drawer-header",
|
|
2162
|
-
className:
|
|
2295
|
+
className: U("flex flex-col gap-1.5 p-4", e),
|
|
2163
2296
|
...t
|
|
2164
2297
|
});
|
|
2165
2298
|
}
|
|
2166
|
-
function
|
|
2167
|
-
return /* @__PURE__ */ u(
|
|
2299
|
+
function ri({ className: e, ...t }) {
|
|
2300
|
+
return /* @__PURE__ */ u(S.Title, {
|
|
2168
2301
|
"data-slot": "drawer-title",
|
|
2169
|
-
className:
|
|
2302
|
+
className: U("font-medium text-foreground", e),
|
|
2170
2303
|
...t
|
|
2171
2304
|
});
|
|
2172
2305
|
}
|
|
2173
|
-
function
|
|
2174
|
-
return /* @__PURE__ */ u(
|
|
2306
|
+
function ii({ className: e, ...t }) {
|
|
2307
|
+
return /* @__PURE__ */ u(S.Description, {
|
|
2175
2308
|
"data-slot": "drawer-description",
|
|
2176
|
-
className:
|
|
2309
|
+
className: U("text-sm text-muted-foreground", e),
|
|
2177
2310
|
...t
|
|
2178
2311
|
});
|
|
2179
2312
|
}
|
|
2180
2313
|
//#endregion
|
|
2181
2314
|
//#region src/client/DrawerContext.tsx
|
|
2182
|
-
var
|
|
2183
|
-
function
|
|
2315
|
+
var ai = t(void 0);
|
|
2316
|
+
function oi({ children: e }) {
|
|
2184
2317
|
let [t, n] = o({
|
|
2185
2318
|
open: !1,
|
|
2186
2319
|
entry: null
|
|
@@ -2197,25 +2330,25 @@ function ai({ children: e }) {
|
|
|
2197
2330
|
entry: e
|
|
2198
2331
|
}));
|
|
2199
2332
|
}
|
|
2200
|
-
return r(l, [s]), /* @__PURE__ */ d(
|
|
2333
|
+
return r(l, [s]), /* @__PURE__ */ d(ai.Provider, {
|
|
2201
2334
|
value: {
|
|
2202
2335
|
openKey: t.open ? t.entry.key : null,
|
|
2203
2336
|
show: c,
|
|
2204
2337
|
close: l
|
|
2205
2338
|
},
|
|
2206
|
-
children: [e, /* @__PURE__ */ u(
|
|
2339
|
+
children: [e, /* @__PURE__ */ u(Zr, {
|
|
2207
2340
|
direction: "right",
|
|
2208
2341
|
autoFocus: !0,
|
|
2209
2342
|
open: t.open,
|
|
2210
2343
|
onOpenChange: (e) => !e && l(),
|
|
2211
|
-
children: /* @__PURE__ */ d(
|
|
2344
|
+
children: /* @__PURE__ */ d(ti, {
|
|
2212
2345
|
className: "bg-card font-satoshi text-card-foreground antialiased shadow-(--shadow-dialog) data-[vaul-drawer-direction=right]:w-full",
|
|
2213
2346
|
onCloseAutoFocus: (e) => {
|
|
2214
2347
|
e.preventDefault(), i.current?.focus({ preventScroll: !0 });
|
|
2215
2348
|
},
|
|
2216
|
-
children: [t.entry?.content, /* @__PURE__ */ u(
|
|
2349
|
+
children: [t.entry?.content, /* @__PURE__ */ u($r, {
|
|
2217
2350
|
asChild: !0,
|
|
2218
|
-
children: /* @__PURE__ */ u(
|
|
2351
|
+
children: /* @__PURE__ */ u(W, {
|
|
2219
2352
|
className: "absolute top-3 right-3",
|
|
2220
2353
|
variant: "ghost",
|
|
2221
2354
|
size: "icon",
|
|
@@ -2227,58 +2360,44 @@ function ai({ children: e }) {
|
|
|
2227
2360
|
})]
|
|
2228
2361
|
});
|
|
2229
2362
|
}
|
|
2230
|
-
function
|
|
2231
|
-
let e = n(
|
|
2363
|
+
function si() {
|
|
2364
|
+
let e = n(ai);
|
|
2232
2365
|
if (!e) throw Error("useDrawer must be used within a DrawerProvider");
|
|
2233
2366
|
return e;
|
|
2234
2367
|
}
|
|
2235
2368
|
//#endregion
|
|
2236
2369
|
//#region src/components/overview/requestRateCard.tsx
|
|
2237
|
-
function
|
|
2238
|
-
let i = e &&
|
|
2239
|
-
return /* @__PURE__ */ u(
|
|
2370
|
+
function ci({ requests: e, failed: t, timeWindow: n, color: r }) {
|
|
2371
|
+
let i = e && li(e, n), a = !i && !t, o = i ? lt(i.current) : a ? /* @__PURE__ */ u(G, { className: "h-11 w-28" }) : "—", s = i?.series ?? Array(P(n)).fill(0);
|
|
2372
|
+
return /* @__PURE__ */ u(Sr, {
|
|
2240
2373
|
label: "Requests / Second",
|
|
2241
|
-
window: s,
|
|
2242
2374
|
value: o,
|
|
2243
2375
|
unit: "req/s",
|
|
2244
2376
|
busy: a,
|
|
2245
|
-
|
|
2377
|
+
failed: !i && t,
|
|
2378
|
+
series: s,
|
|
2246
2379
|
axis: N(n, 2),
|
|
2247
2380
|
color: r,
|
|
2248
|
-
chartLabel:
|
|
2381
|
+
chartLabel: `Requests per second, ${M(n)}`,
|
|
2249
2382
|
describePoint: (e) => ({
|
|
2250
|
-
at:
|
|
2251
|
-
value: `${
|
|
2252
|
-
})
|
|
2253
|
-
children: i ? /* @__PURE__ */ u(li, { ...i }) : /* @__PURE__ */ u(_r, { failed: t })
|
|
2383
|
+
at: wt(n, e),
|
|
2384
|
+
value: `${lt(s[e] ?? 0)} req/s`
|
|
2385
|
+
})
|
|
2254
2386
|
});
|
|
2255
2387
|
}
|
|
2256
|
-
function
|
|
2257
|
-
let n =
|
|
2388
|
+
function li(e, t) {
|
|
2389
|
+
let n = tn(e, t);
|
|
2258
2390
|
return {
|
|
2259
2391
|
current: n.at(-1) ?? 0,
|
|
2260
|
-
average: Qt(n),
|
|
2261
|
-
peak: r,
|
|
2262
|
-
peakAt: C(Ct(t, n.indexOf(r))),
|
|
2263
2392
|
series: n
|
|
2264
2393
|
};
|
|
2265
2394
|
}
|
|
2266
|
-
function li({ average: e, peak: t, peakAt: n }) {
|
|
2267
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(q, {
|
|
2268
|
-
label: "Avg",
|
|
2269
|
-
value: T(e)
|
|
2270
|
-
}), /* @__PURE__ */ u(q, {
|
|
2271
|
-
label: "Peak",
|
|
2272
|
-
value: T(t),
|
|
2273
|
-
suffix: `at ${n}`
|
|
2274
|
-
})] });
|
|
2275
|
-
}
|
|
2276
2395
|
//#endregion
|
|
2277
2396
|
//#region src/components/instance/connectionsCard.tsx
|
|
2278
|
-
var ui = 10,
|
|
2397
|
+
var ui = 10, X = "grid grid-cols-[minmax(0,150px)_1fr] items-center gap-6";
|
|
2279
2398
|
function di({ instance: e, sessions: t, livePeriods: n, requests: r, failed: i, timeWindow: a }) {
|
|
2280
|
-
let [s, c] = o(!1), f = e && t && fi(t,
|
|
2281
|
-
return /* @__PURE__ */ u(
|
|
2399
|
+
let [s, c] = o(!1), f = e && t && fi(t, a), p = s ? f : f?.slice(0, ui);
|
|
2400
|
+
return /* @__PURE__ */ u(K, {
|
|
2282
2401
|
title: "WebSocket Connections",
|
|
2283
2402
|
aside: /* @__PURE__ */ u(pi, { closed: f?.some((e) => !e.open) ?? !1 }),
|
|
2284
2403
|
busy: !p && !i,
|
|
@@ -2288,9 +2407,9 @@ function di({ instance: e, sessions: t, livePeriods: n, requests: r, failed: i,
|
|
|
2288
2407
|
children: "Couldn't reach the observer API."
|
|
2289
2408
|
}) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
|
|
2290
2409
|
className: "mt-3.5",
|
|
2291
|
-
children: [/* @__PURE__ */ u(
|
|
2410
|
+
children: [/* @__PURE__ */ u(Qn, {
|
|
2292
2411
|
timeWindow: a,
|
|
2293
|
-
grid:
|
|
2412
|
+
grid: X
|
|
2294
2413
|
}), e && f && p && n ? /* @__PURE__ */ d(l, { children: [
|
|
2295
2414
|
/* @__PURE__ */ u(mi, {
|
|
2296
2415
|
instance: e,
|
|
@@ -2312,7 +2431,7 @@ function di({ instance: e, sessions: t, livePeriods: n, requests: r, failed: i,
|
|
|
2312
2431
|
]
|
|
2313
2432
|
})
|
|
2314
2433
|
] }) : /* @__PURE__ */ u(_i, {})]
|
|
2315
|
-
}), f && f.length > ui && /* @__PURE__ */ u(
|
|
2434
|
+
}), f && f.length > ui && /* @__PURE__ */ u(Yn, {
|
|
2316
2435
|
shown: p?.length ?? 0,
|
|
2317
2436
|
total: f.length,
|
|
2318
2437
|
noun: "connection",
|
|
@@ -2322,15 +2441,14 @@ function di({ instance: e, sessions: t, livePeriods: n, requests: r, failed: i,
|
|
|
2322
2441
|
})] })
|
|
2323
2442
|
});
|
|
2324
2443
|
}
|
|
2325
|
-
function fi(e, t
|
|
2326
|
-
let r = new Set(t.connections.map((e) => e.id));
|
|
2444
|
+
function fi(e, t) {
|
|
2327
2445
|
return e.flatMap((e) => {
|
|
2328
|
-
let
|
|
2329
|
-
return i
|
|
2446
|
+
let n = e.status === "open", r = Hr(e), [i] = er([r], t, n && t.live);
|
|
2447
|
+
return i ? [{
|
|
2330
2448
|
session: e,
|
|
2331
|
-
open:
|
|
2332
|
-
span:
|
|
2333
|
-
segment:
|
|
2449
|
+
open: n,
|
|
2450
|
+
span: r,
|
|
2451
|
+
segment: i
|
|
2334
2452
|
}] : [];
|
|
2335
2453
|
}).sort((e, t) => e.span.fromMs - t.span.fromMs);
|
|
2336
2454
|
}
|
|
@@ -2354,9 +2472,9 @@ function pi({ closed: e }) {
|
|
|
2354
2472
|
});
|
|
2355
2473
|
}
|
|
2356
2474
|
function mi({ instance: e, periods: t, requests: n, timeWindow: r }) {
|
|
2357
|
-
let i = e.status === "live", a =
|
|
2475
|
+
let i = e.status === "live", a = er(t, r, i && r.live), o = dr(a);
|
|
2358
2476
|
return /* @__PURE__ */ d("div", {
|
|
2359
|
-
className: `${
|
|
2477
|
+
className: `${X} mt-3 mb-4.5 h-10.5 overflow-hidden rounded-lg border border-border/70 bg-background/60`,
|
|
2360
2478
|
children: [/* @__PURE__ */ d("div", {
|
|
2361
2479
|
className: "pl-3",
|
|
2362
2480
|
children: [/* @__PURE__ */ u("b", {
|
|
@@ -2373,7 +2491,7 @@ function mi({ instance: e, periods: t, requests: n, timeWindow: r }) {
|
|
|
2373
2491
|
k(o)
|
|
2374
2492
|
]
|
|
2375
2493
|
})]
|
|
2376
|
-
}), /* @__PURE__ */ u(
|
|
2494
|
+
}), /* @__PURE__ */ u(pr, {
|
|
2377
2495
|
segments: a,
|
|
2378
2496
|
requests: n,
|
|
2379
2497
|
label: `Residency: live ${k(o)}, ${M(r)}`
|
|
@@ -2381,9 +2499,9 @@ function mi({ instance: e, periods: t, requests: n, timeWindow: r }) {
|
|
|
2381
2499
|
});
|
|
2382
2500
|
}
|
|
2383
2501
|
function hi({ row: { session: e, open: t, span: n, segment: r }, requests: i, timeWindow: a }) {
|
|
2384
|
-
let o = i ?
|
|
2502
|
+
let o = i ? on(i, e.connectionId, r) : null, s = o?.messages ?? e.messagesIn ?? 0, c = o?.failures ?? 0, l = !t && c > 0;
|
|
2385
2503
|
return /* @__PURE__ */ d("div", {
|
|
2386
|
-
className: `${
|
|
2504
|
+
className: `${X} h-11 border-b border-border/50 last:border-b-0`,
|
|
2387
2505
|
children: [/* @__PURE__ */ d("div", {
|
|
2388
2506
|
className: "min-w-0",
|
|
2389
2507
|
children: [/* @__PURE__ */ u("b", {
|
|
@@ -2391,11 +2509,11 @@ function hi({ row: { session: e, open: t, span: n, segment: r }, requests: i, ti
|
|
|
2391
2509
|
className: "block truncate text-[13px] font-medium",
|
|
2392
2510
|
children: e.connectionId
|
|
2393
2511
|
}), /* @__PURE__ */ d("span", {
|
|
2394
|
-
className:
|
|
2395
|
-
children: [t ? `${O(s, "message")} · ${k(a.toMs - n.fromMs)}` : `Closed ${
|
|
2512
|
+
className: U("mt-0.5 block truncate text-[11px] text-muted-foreground tabular-nums", l && "text-danger"),
|
|
2513
|
+
children: [t ? `${O(s, "message")} · ${k(a.toMs - n.fromMs)}` : `Closed ${T(n.toMs)}`, l && ` · ${O(c, "failure")}`]
|
|
2396
2514
|
})]
|
|
2397
|
-
}), /* @__PURE__ */ u(
|
|
2398
|
-
label: `${e.connectionId}: ${
|
|
2515
|
+
}), /* @__PURE__ */ u($n, {
|
|
2516
|
+
label: `${e.connectionId}: ${e.status}, ${st(r.fromMs, r.toMs)}`,
|
|
2399
2517
|
children: /* @__PURE__ */ u(gi, {
|
|
2400
2518
|
messages: s,
|
|
2401
2519
|
failures: c,
|
|
@@ -2407,16 +2525,16 @@ function hi({ row: { session: e, open: t, span: n, segment: r }, requests: i, ti
|
|
|
2407
2525
|
});
|
|
2408
2526
|
}
|
|
2409
2527
|
function gi({ messages: e, failures: t, segment: n, open: r, failed: i }) {
|
|
2410
|
-
return /* @__PURE__ */ d(
|
|
2528
|
+
return /* @__PURE__ */ d(nr, { children: [/* @__PURE__ */ u(rr, {
|
|
2411
2529
|
asChild: !0,
|
|
2412
2530
|
children: /* @__PURE__ */ u("span", {
|
|
2413
|
-
className:
|
|
2531
|
+
className: U("absolute top-1/2 h-2.5 min-w-1 -translate-y-1/2 rounded-full before:absolute before:-inset-x-1.5 before:-inset-y-2", r ? "bg-chart-2 shadow-[0_0_12px_color-mix(in_oklab,var(--chart-2)_20%,transparent)]" : "bg-chart-2/55", n.now && "rounded-r-[1px] after:absolute after:top-0.75 after:right-1 after:size-1 after:rounded-full after:bg-background", !r && "after:absolute after:-top-0.75 after:right-0 after:h-4 after:w-0.5 after:rounded-[1px]", !r && (i ? "after:bg-danger" : "after:bg-chart-2")),
|
|
2414
2532
|
style: {
|
|
2415
2533
|
left: `${n.left * 100}%`,
|
|
2416
2534
|
width: `${n.width * 100}%`
|
|
2417
2535
|
}
|
|
2418
2536
|
})
|
|
2419
|
-
}), /* @__PURE__ */ d(
|
|
2537
|
+
}), /* @__PURE__ */ d(ir, {
|
|
2420
2538
|
className: "tabular-nums",
|
|
2421
2539
|
children: [/* @__PURE__ */ u("div", {
|
|
2422
2540
|
className: "font-medium",
|
|
@@ -2433,8 +2551,8 @@ function gi({ messages: e, failures: t, segment: n, open: r, failed: i }) {
|
|
|
2433
2551
|
}
|
|
2434
2552
|
function _i() {
|
|
2435
2553
|
return Array.from({ length: 4 }, (e, t) => /* @__PURE__ */ d("div", {
|
|
2436
|
-
className: `${
|
|
2437
|
-
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(
|
|
2554
|
+
className: `${X} h-11 border-b border-border/50 last:border-b-0`,
|
|
2555
|
+
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(G, { className: "h-3.5 w-24" }), /* @__PURE__ */ u(G, { className: "mt-1.5 h-2.5 w-14" })] }), /* @__PURE__ */ u(G, {
|
|
2438
2556
|
className: "h-2.5 rounded-full",
|
|
2439
2557
|
style: {
|
|
2440
2558
|
width: `${60 - t * 12}%`,
|
|
@@ -2453,19 +2571,13 @@ function vi(e, t) {
|
|
|
2453
2571
|
}, [e, t]), n;
|
|
2454
2572
|
}
|
|
2455
2573
|
//#endregion
|
|
2456
|
-
//#region src/client/streams/logStream.ts
|
|
2457
|
-
function yi(e, t, n) {
|
|
2458
|
-
let r = new EventSource(`${e}/logs/events?${Fe(t)}`, { withCredentials: !0 });
|
|
2459
|
-
return r.addEventListener("logs", (e) => n(JSON.parse(e.data).records)), () => r.close();
|
|
2460
|
-
}
|
|
2461
|
-
//#endregion
|
|
2462
2574
|
//#region src/lib/logs.ts
|
|
2463
|
-
var
|
|
2575
|
+
var Z = [
|
|
2464
2576
|
"debug",
|
|
2465
2577
|
"info",
|
|
2466
2578
|
"warn",
|
|
2467
2579
|
"error"
|
|
2468
|
-
],
|
|
2580
|
+
], yi = 1e3, bi = [
|
|
2469
2581
|
1,
|
|
2470
2582
|
2,
|
|
2471
2583
|
5,
|
|
@@ -2484,57 +2596,57 @@ var X = [
|
|
|
2484
2596
|
21600,
|
|
2485
2597
|
43200,
|
|
2486
2598
|
86400
|
|
2487
|
-
].map((e) => e *
|
|
2599
|
+
].map((e) => e * yi), xi = 60, Si = [
|
|
2488
2600
|
"message",
|
|
2489
2601
|
"msg",
|
|
2490
2602
|
"event"
|
|
2491
|
-
],
|
|
2492
|
-
function
|
|
2493
|
-
return
|
|
2603
|
+
], Ci = 6;
|
|
2604
|
+
function wi(e) {
|
|
2605
|
+
return bi.find((t) => e / t <= xi) ?? bi.at(-1);
|
|
2494
2606
|
}
|
|
2495
|
-
function
|
|
2607
|
+
function Ti({ fromMs: e, toMs: t }, n) {
|
|
2496
2608
|
let r = Math.floor(e / n) * n;
|
|
2497
2609
|
return {
|
|
2498
2610
|
fromMs: r,
|
|
2499
2611
|
toMs: Math.max(Math.ceil(t / n) * n, r + n)
|
|
2500
2612
|
};
|
|
2501
2613
|
}
|
|
2502
|
-
function
|
|
2614
|
+
function Ei({ buckets: e }) {
|
|
2503
2615
|
let t = {
|
|
2504
2616
|
debug: 0,
|
|
2505
2617
|
info: 0,
|
|
2506
2618
|
warn: 0,
|
|
2507
2619
|
error: 0
|
|
2508
2620
|
};
|
|
2509
|
-
for (let n of e) for (let e of
|
|
2621
|
+
for (let n of e) for (let e of Z) t[e] += n[e];
|
|
2510
2622
|
return t;
|
|
2511
2623
|
}
|
|
2512
|
-
function
|
|
2513
|
-
return
|
|
2624
|
+
function Q(e, t) {
|
|
2625
|
+
return Z.slice(t ? Z.indexOf(t) : 0).reduce((t, n) => t + e[n], 0);
|
|
2514
2626
|
}
|
|
2515
|
-
function
|
|
2627
|
+
function Di(e) {
|
|
2516
2628
|
let t = e.split("\n");
|
|
2517
2629
|
return {
|
|
2518
2630
|
firstLine: t[0] ?? "",
|
|
2519
2631
|
moreLines: t.length - 1,
|
|
2520
|
-
json:
|
|
2632
|
+
json: Ai(e)
|
|
2521
2633
|
};
|
|
2522
2634
|
}
|
|
2523
|
-
function
|
|
2635
|
+
function Oi(e) {
|
|
2524
2636
|
if (Array.isArray(e)) return {
|
|
2525
2637
|
headline: `${e.length} items`,
|
|
2526
2638
|
fields: []
|
|
2527
2639
|
};
|
|
2528
|
-
let t =
|
|
2640
|
+
let t = Si.find((t) => typeof e[t] == "string"), n = Object.entries(e).filter(([e]) => e !== t).slice(0, Ci).map(([e, t]) => [e, ji(t)]);
|
|
2529
2641
|
return {
|
|
2530
2642
|
headline: t && e[t],
|
|
2531
2643
|
fields: n
|
|
2532
2644
|
};
|
|
2533
2645
|
}
|
|
2534
|
-
function
|
|
2646
|
+
function ki(e) {
|
|
2535
2647
|
return /^[0-9a-f]{8}-[0-9a-f]{4}-/iu.test(e) ? e.slice(0, 8) : e.length > 14 ? `${e.slice(0, 4)}…${e.slice(-8)}` : e;
|
|
2536
2648
|
}
|
|
2537
|
-
function
|
|
2649
|
+
function Ai(e) {
|
|
2538
2650
|
let t = e.trim();
|
|
2539
2651
|
if (t.startsWith("{") || t.startsWith("[")) try {
|
|
2540
2652
|
let e = JSON.parse(t);
|
|
@@ -2543,72 +2655,130 @@ function ji(e) {
|
|
|
2543
2655
|
return;
|
|
2544
2656
|
}
|
|
2545
2657
|
}
|
|
2546
|
-
function
|
|
2658
|
+
function ji(e) {
|
|
2547
2659
|
if (Array.isArray(e)) return "[…]";
|
|
2548
2660
|
if (typeof e == "object" && e) return "{…}";
|
|
2549
2661
|
let t = JSON.stringify(e);
|
|
2550
2662
|
return t.length > 40 ? `${t.slice(0, 39)}…` : t;
|
|
2551
2663
|
}
|
|
2552
2664
|
//#endregion
|
|
2665
|
+
//#region src/lib/views/logs.ts
|
|
2666
|
+
var Mi = 2e3;
|
|
2667
|
+
function Ni(e) {
|
|
2668
|
+
let t = Z.slice(e ? Z.indexOf(e) : 0);
|
|
2669
|
+
return (e, n) => {
|
|
2670
|
+
let r = Li(n).filter((e) => t.includes(e.level));
|
|
2671
|
+
if (r.length === 0) return e;
|
|
2672
|
+
let i = new Set(e.map((e) => e.logId));
|
|
2673
|
+
return [...r.filter((e) => !i.has(e.logId)).reverse(), ...e].slice(0, Mi);
|
|
2674
|
+
};
|
|
2675
|
+
}
|
|
2676
|
+
function Pi({ fromMs: e, bucketMs: t, buckets: n }, r) {
|
|
2677
|
+
let i = {};
|
|
2678
|
+
return n.forEach((n, r) => i[e + r * t] = n), {
|
|
2679
|
+
bucketMs: t,
|
|
2680
|
+
readAtMs: r,
|
|
2681
|
+
counts: i
|
|
2682
|
+
};
|
|
2683
|
+
}
|
|
2684
|
+
var Fi = (e, t) => {
|
|
2685
|
+
let n = Li(t).filter((t) => t.timestampMs >= e.readAtMs && Z.includes(t.level));
|
|
2686
|
+
if (n.length === 0) return e;
|
|
2687
|
+
let r = { ...e.counts };
|
|
2688
|
+
for (let t of n) {
|
|
2689
|
+
let n = Math.floor(t.timestampMs / e.bucketMs) * e.bucketMs;
|
|
2690
|
+
r[n] = {
|
|
2691
|
+
...r[n] ?? Ri(),
|
|
2692
|
+
[t.level]: (r[n]?.[t.level] ?? 0) + 1
|
|
2693
|
+
};
|
|
2694
|
+
}
|
|
2695
|
+
return {
|
|
2696
|
+
...e,
|
|
2697
|
+
counts: r
|
|
2698
|
+
};
|
|
2699
|
+
};
|
|
2700
|
+
function Ii({ bucketMs: e, counts: t }, { fromMs: n, toMs: r }) {
|
|
2701
|
+
let i = [];
|
|
2702
|
+
for (let a = n; a < r; a += e) i.push(t[a] ?? Ri());
|
|
2703
|
+
return {
|
|
2704
|
+
fromMs: n,
|
|
2705
|
+
bucketMs: e,
|
|
2706
|
+
buckets: i
|
|
2707
|
+
};
|
|
2708
|
+
}
|
|
2709
|
+
function Li(e) {
|
|
2710
|
+
return e.flatMap((e) => e.type === "log" ? [e.item] : []);
|
|
2711
|
+
}
|
|
2712
|
+
function Ri() {
|
|
2713
|
+
return {
|
|
2714
|
+
debug: 0,
|
|
2715
|
+
info: 0,
|
|
2716
|
+
warn: 0,
|
|
2717
|
+
error: 0
|
|
2718
|
+
};
|
|
2719
|
+
}
|
|
2720
|
+
//#endregion
|
|
2553
2721
|
//#region src/hooks/useLogs.ts
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
let r = Ii(e, t, n), i = Li(e, t.live, n), { data: a } = Ri(e, t, n), o = r.data;
|
|
2722
|
+
function zi(e, t, n) {
|
|
2723
|
+
let r = We(e, t.live ? Bi(n) : null), i = Vi(e, t, n), { data: a } = w(De(e, n), async () => [], Ni(n.level), r), o = Hi(e, t, n, r), s = i.data;
|
|
2557
2724
|
return {
|
|
2558
|
-
lines:
|
|
2559
|
-
hasOlder: !!
|
|
2560
|
-
loadingOlder: !!(
|
|
2561
|
-
loadOlder: () =>
|
|
2562
|
-
histogram:
|
|
2563
|
-
isError: !
|
|
2725
|
+
lines: s ? Ui([...a ?? [], ...s.flatMap((e) => e.records)]) : null,
|
|
2726
|
+
hasOlder: !!s?.at(-1)?.nextCursor,
|
|
2727
|
+
loadingOlder: !!(s && i.size > s.length),
|
|
2728
|
+
loadOlder: () => i.setSize((e) => e + 1),
|
|
2729
|
+
histogram: o,
|
|
2730
|
+
isError: !s && !!i.error
|
|
2564
2731
|
};
|
|
2565
2732
|
}
|
|
2566
|
-
function
|
|
2567
|
-
let
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2733
|
+
function Bi(e) {
|
|
2734
|
+
let t = Me({
|
|
2735
|
+
...e,
|
|
2736
|
+
level: null
|
|
2737
|
+
});
|
|
2738
|
+
return t.set("signals", "logs"), t;
|
|
2739
|
+
}
|
|
2740
|
+
function Vi(e, t, n) {
|
|
2741
|
+
let r = new C(e);
|
|
2742
|
+
return be((r, i) => i && !i.nextCursor ? null : [
|
|
2743
|
+
...Te(e, n),
|
|
2744
|
+
...F(t),
|
|
2571
2745
|
r === 0 ? null : i.nextCursor
|
|
2572
|
-
], (e) => r.listLogs(n,
|
|
2746
|
+
], (e) => r.listLogs(n, I(t), e.at(-1)), {
|
|
2573
2747
|
revalidateFirstPage: !1,
|
|
2574
2748
|
revalidateOnFocus: !1
|
|
2575
2749
|
});
|
|
2576
2750
|
}
|
|
2577
|
-
function
|
|
2578
|
-
let
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
function Ri(e, t, n) {
|
|
2582
|
-
let r = new S(e), i = Ti(t.toMs - t.fromMs);
|
|
2583
|
-
return s([
|
|
2584
|
-
...ke(e, n),
|
|
2585
|
-
...Be(t),
|
|
2751
|
+
function Hi(e, t, n, r) {
|
|
2752
|
+
let i = wi(t.toMs - t.fromMs), { data: a } = w([
|
|
2753
|
+
...Ee(e, n),
|
|
2754
|
+
...F(t),
|
|
2586
2755
|
i
|
|
2587
|
-
], () =>
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
});
|
|
2756
|
+
], async () => {
|
|
2757
|
+
let r = Date.now();
|
|
2758
|
+
return Pi(await new C(e).getLogHistogram(n, Ti(I(t), i), i), r);
|
|
2759
|
+
}, Fi, r, { keepPreviousData: !0 });
|
|
2760
|
+
return a && Ii(a, Ti(I(t), i));
|
|
2591
2761
|
}
|
|
2592
|
-
function
|
|
2762
|
+
function Ui(e) {
|
|
2593
2763
|
return [...new Map(e.map((e) => [e.logId, e])).values()].sort((e, t) => t.timestampMs - e.timestampMs || (e.logId < t.logId ? 1 : -1));
|
|
2594
2764
|
}
|
|
2595
2765
|
//#endregion
|
|
2596
2766
|
//#region src/components/instance/logChart.tsx
|
|
2597
|
-
var
|
|
2767
|
+
var Wi = {
|
|
2598
2768
|
debug: "bg-muted-foreground/25",
|
|
2599
2769
|
info: "bg-muted-foreground/55",
|
|
2600
2770
|
warn: "bg-warning",
|
|
2601
2771
|
error: "bg-danger"
|
|
2602
|
-
},
|
|
2772
|
+
}, Gi = [
|
|
2603
2773
|
2,
|
|
2604
2774
|
4,
|
|
2605
2775
|
6,
|
|
2606
2776
|
10
|
|
2607
|
-
],
|
|
2608
|
-
function
|
|
2777
|
+
], Ki = 6;
|
|
2778
|
+
function qi({ histogram: e, level: t, live: n, onZoom: r }) {
|
|
2609
2779
|
let [i, a] = o(null), [s, c] = o(null);
|
|
2610
|
-
if (!e) return /* @__PURE__ */ u(
|
|
2611
|
-
let { buckets: l, fromMs: f, bucketMs: p } = e, m =
|
|
2780
|
+
if (!e) return /* @__PURE__ */ u(G, { className: "mt-4 mb-3.5 h-[122px] w-full rounded-sm" });
|
|
2781
|
+
let { buckets: l, fromMs: f, bucketMs: p } = e, m = i !== null && i < l.length ? i : null, h = Ji(Math.max(...l.map((e) => Q(e, null)), 1)), g = (e) => {
|
|
2612
2782
|
let t = e.currentTarget.getBoundingClientRect();
|
|
2613
2783
|
return Math.min(l.length - 1, Math.max(0, Math.floor((e.clientX - t.left) / t.width * l.length)));
|
|
2614
2784
|
};
|
|
@@ -2616,24 +2786,24 @@ function Ui({ histogram: e, level: t, live: n, onZoom: r }) {
|
|
|
2616
2786
|
className: "mt-4 border-b pb-3.5",
|
|
2617
2787
|
children: [/* @__PURE__ */ d("div", {
|
|
2618
2788
|
className: "relative pt-4",
|
|
2619
|
-
children: [/* @__PURE__ */ u(
|
|
2789
|
+
children: [/* @__PURE__ */ u(Yi, { scale: h }), /* @__PURE__ */ d("div", {
|
|
2620
2790
|
role: "img",
|
|
2621
2791
|
"aria-label": `Log lines per ${k(p)}; drag across the chart to zoom into a time range`,
|
|
2622
2792
|
className: "relative ml-[42px] h-24 cursor-crosshair touch-none select-none",
|
|
2623
2793
|
onPointerDown: (e) => {
|
|
2624
2794
|
e.currentTarget.setPointerCapture(e.pointerId), c({
|
|
2625
|
-
from:
|
|
2626
|
-
to:
|
|
2795
|
+
from: g(e),
|
|
2796
|
+
to: g(e)
|
|
2627
2797
|
});
|
|
2628
2798
|
},
|
|
2629
2799
|
onPointerMove: (e) => {
|
|
2630
|
-
a(
|
|
2800
|
+
a(g(e)), s && c({
|
|
2631
2801
|
...s,
|
|
2632
|
-
to:
|
|
2802
|
+
to: g(e)
|
|
2633
2803
|
});
|
|
2634
2804
|
},
|
|
2635
2805
|
onPointerUp: (e) => {
|
|
2636
|
-
let t =
|
|
2806
|
+
let t = g(e);
|
|
2637
2807
|
c(null), s && s.from !== t && r({
|
|
2638
2808
|
fromMs: f + Math.min(s.from, t) * p,
|
|
2639
2809
|
toMs: f + (Math.max(s.from, t) + 1) * p
|
|
@@ -2643,36 +2813,36 @@ function Ui({ histogram: e, level: t, live: n, onZoom: r }) {
|
|
|
2643
2813
|
children: [
|
|
2644
2814
|
/* @__PURE__ */ u("div", {
|
|
2645
2815
|
className: "absolute inset-0 flex items-end gap-0.5",
|
|
2646
|
-
children: l.map((e, n) => /* @__PURE__ */ u(
|
|
2816
|
+
children: l.map((e, n) => /* @__PURE__ */ u(Xi, {
|
|
2647
2817
|
counts: e,
|
|
2648
|
-
scale:
|
|
2818
|
+
scale: h,
|
|
2649
2819
|
level: t,
|
|
2650
|
-
hovered: n ===
|
|
2820
|
+
hovered: n === m
|
|
2651
2821
|
}, n))
|
|
2652
2822
|
}),
|
|
2653
|
-
s && /* @__PURE__ */ u(
|
|
2823
|
+
s && /* @__PURE__ */ u(Zi, {
|
|
2654
2824
|
drag: s,
|
|
2655
2825
|
buckets: l.length
|
|
2656
2826
|
}),
|
|
2657
|
-
|
|
2658
|
-
index:
|
|
2827
|
+
m !== null && !s && Q(l[m], null) > 0 && /* @__PURE__ */ u(Qi, {
|
|
2828
|
+
index: m,
|
|
2659
2829
|
histogram: e
|
|
2660
2830
|
})
|
|
2661
2831
|
]
|
|
2662
2832
|
})]
|
|
2663
|
-
}), /* @__PURE__ */ u(
|
|
2833
|
+
}), /* @__PURE__ */ u($i, {
|
|
2664
2834
|
histogram: e,
|
|
2665
2835
|
live: n
|
|
2666
2836
|
})]
|
|
2667
2837
|
});
|
|
2668
2838
|
}
|
|
2669
|
-
function
|
|
2839
|
+
function Ji(e) {
|
|
2670
2840
|
for (let t = 1;; t *= 10) {
|
|
2671
|
-
let n =
|
|
2841
|
+
let n = Gi.find((n) => n * t >= e);
|
|
2672
2842
|
if (n) return n * t;
|
|
2673
2843
|
}
|
|
2674
2844
|
}
|
|
2675
|
-
function
|
|
2845
|
+
function Yi({ scale: e }) {
|
|
2676
2846
|
return /* @__PURE__ */ u("div", {
|
|
2677
2847
|
"aria-hidden": !0,
|
|
2678
2848
|
className: "pointer-events-none absolute inset-x-0 top-4 h-24",
|
|
@@ -2685,22 +2855,22 @@ function Gi({ scale: e }) {
|
|
|
2685
2855
|
style: { top: `${t * 50}%` },
|
|
2686
2856
|
children: /* @__PURE__ */ u("span", {
|
|
2687
2857
|
className: "absolute bottom-0.5 left-0 text-[11px] leading-none text-muted-foreground tabular-nums",
|
|
2688
|
-
children:
|
|
2858
|
+
children: E(e)
|
|
2689
2859
|
})
|
|
2690
2860
|
}, t))
|
|
2691
2861
|
});
|
|
2692
2862
|
}
|
|
2693
|
-
function
|
|
2694
|
-
let i = n ?
|
|
2695
|
-
return
|
|
2696
|
-
className:
|
|
2697
|
-
children:
|
|
2698
|
-
className:
|
|
2863
|
+
function Xi({ counts: e, scale: t, level: n, hovered: r }) {
|
|
2864
|
+
let i = n ? Z.indexOf(n) : 0;
|
|
2865
|
+
return Q(e, null) ? /* @__PURE__ */ u("span", {
|
|
2866
|
+
className: U("flex h-full flex-1 flex-col-reverse rounded-[1px]", r && "outline outline-offset-1 outline-foreground"),
|
|
2867
|
+
children: Z.map((n, r) => e[n] ? /* @__PURE__ */ u("span", {
|
|
2868
|
+
className: U("block w-full last:rounded-t-[1px]", Wi[n], r < i && "opacity-25"),
|
|
2699
2869
|
style: { height: `${e[n] / t * 100}%` }
|
|
2700
2870
|
}, n) : null)
|
|
2701
2871
|
}) : /* @__PURE__ */ u("span", { className: "h-px flex-1 bg-border/60" });
|
|
2702
2872
|
}
|
|
2703
|
-
function
|
|
2873
|
+
function Zi({ drag: e, buckets: t }) {
|
|
2704
2874
|
let n = Math.min(e.from, e.to), r = Math.abs(e.to - e.from) + 1;
|
|
2705
2875
|
return /* @__PURE__ */ u("div", {
|
|
2706
2876
|
className: "pointer-events-none absolute inset-y-0 rounded-sm bg-foreground/10 ring-1 ring-foreground/40",
|
|
@@ -2710,8 +2880,8 @@ function qi({ drag: e, buckets: t }) {
|
|
|
2710
2880
|
}
|
|
2711
2881
|
});
|
|
2712
2882
|
}
|
|
2713
|
-
function
|
|
2714
|
-
let i = t[e], a = n + e * r, o = r < 6e4 ? rt :
|
|
2883
|
+
function Qi({ index: e, histogram: { buckets: t, fromMs: n, bucketMs: r } }) {
|
|
2884
|
+
let i = t[e], a = n + e * r, o = r < 6e4 ? rt : T, s = e >= t.length / 2;
|
|
2715
2885
|
return /* @__PURE__ */ d("div", {
|
|
2716
2886
|
className: "pointer-events-none absolute top-1 z-10 rounded-lg border bg-card px-3 py-2 text-xs whitespace-nowrap text-muted-foreground shadow-(--shadow-popover)",
|
|
2717
2887
|
style: s ? { right: `calc(${100 - e / t.length * 100}% + 8px)` } : { left: `calc(${(e + 1) / t.length * 100}% + 8px)` },
|
|
@@ -2722,15 +2892,15 @@ function Ji({ index: e, histogram: { buckets: t, fromMs: n, bucketMs: r } }) {
|
|
|
2722
2892
|
" – ",
|
|
2723
2893
|
o(a + r),
|
|
2724
2894
|
" · ",
|
|
2725
|
-
O(
|
|
2895
|
+
O(Q(i, null), "line")
|
|
2726
2896
|
]
|
|
2727
2897
|
}), /* @__PURE__ */ u("span", {
|
|
2728
2898
|
className: "flex gap-3.5 tabular-nums",
|
|
2729
|
-
children: [...
|
|
2899
|
+
children: [...Z].reverse().map((e) => /* @__PURE__ */ d("span", {
|
|
2730
2900
|
className: "flex items-center gap-1.5",
|
|
2731
2901
|
children: [
|
|
2732
|
-
/* @__PURE__ */ u("i", { className:
|
|
2733
|
-
|
|
2902
|
+
/* @__PURE__ */ u("i", { className: U("size-1.5 rounded-full", Wi[e]) }),
|
|
2903
|
+
E(i[e]),
|
|
2734
2904
|
" ",
|
|
2735
2905
|
e
|
|
2736
2906
|
]
|
|
@@ -2738,33 +2908,33 @@ function Ji({ index: e, histogram: { buckets: t, fromMs: n, bucketMs: r } }) {
|
|
|
2738
2908
|
})]
|
|
2739
2909
|
});
|
|
2740
2910
|
}
|
|
2741
|
-
function
|
|
2911
|
+
function $i({ histogram: { fromMs: e, bucketMs: t, buckets: n }, live: r }) {
|
|
2742
2912
|
let i = t * n.length;
|
|
2743
2913
|
return /* @__PURE__ */ u("div", {
|
|
2744
2914
|
"aria-hidden": !0,
|
|
2745
2915
|
className: "mt-1.5 ml-[42px] flex justify-between text-[11px] text-muted-foreground tabular-nums",
|
|
2746
|
-
children: Array.from({ length: 7 }, (t, n) => /* @__PURE__ */ u("span", { children: r && n ===
|
|
2916
|
+
children: Array.from({ length: 7 }, (t, n) => /* @__PURE__ */ u("span", { children: r && n === Ki ? "Now" : at(e + n / Ki * i, i) }, n))
|
|
2747
2917
|
});
|
|
2748
2918
|
}
|
|
2749
2919
|
//#endregion
|
|
2750
2920
|
//#region src/components/instance/logList.tsx
|
|
2751
|
-
var
|
|
2921
|
+
var ea = "grid items-center gap-x-4", ta = 16, na = 240, ra = {
|
|
2752
2922
|
time: 104,
|
|
2753
2923
|
level: 58,
|
|
2754
2924
|
request: 104
|
|
2755
|
-
},
|
|
2925
|
+
}, ia = {
|
|
2756
2926
|
debug: "border-border/60 text-muted-foreground/70",
|
|
2757
2927
|
info: "text-muted-foreground",
|
|
2758
2928
|
warn: "border-warning/35 bg-warning/10 text-warning",
|
|
2759
2929
|
error: "border-danger/40 bg-danger/15 text-danger"
|
|
2760
|
-
},
|
|
2930
|
+
}, aa = {
|
|
2761
2931
|
debug: "",
|
|
2762
2932
|
info: "",
|
|
2763
2933
|
warn: "shadow-[inset_2px_0_0_color-mix(in_oklab,var(--warning)_75%,transparent)]",
|
|
2764
2934
|
error: "bg-[linear-gradient(90deg,color-mix(in_oklab,var(--danger)_10%,transparent),transparent_70%)] shadow-[inset_2px_0_0_var(--danger)]"
|
|
2765
|
-
},
|
|
2766
|
-
function
|
|
2767
|
-
let l =
|
|
2935
|
+
}, oa = /("(?:\\.|[^"\\])*")(?=\s*:)\s*:|("(?:\\.|[^"\\])*")|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|\b(?:true|false|null)\b/gu;
|
|
2936
|
+
function sa({ lines: e, failed: t, search: n, filtered: r, onFilterRequest: i, onClearFilters: a, onReachEnd: s, columns: c }) {
|
|
2937
|
+
let l = ca(c), [f, p] = o({
|
|
2768
2938
|
all: !1,
|
|
2769
2939
|
toggled: /* @__PURE__ */ new Set()
|
|
2770
2940
|
});
|
|
@@ -2772,8 +2942,8 @@ function ra({ lines: e, failed: t, search: n, filtered: r, onFilterRequest: i, o
|
|
|
2772
2942
|
className: "py-6 text-[13px] text-muted-foreground",
|
|
2773
2943
|
children: "Couldn't reach the observer API."
|
|
2774
2944
|
});
|
|
2775
|
-
if (!e) return /* @__PURE__ */ u(
|
|
2776
|
-
if (!e.length) return /* @__PURE__ */ u(
|
|
2945
|
+
if (!e) return /* @__PURE__ */ u(la, { layout: l });
|
|
2946
|
+
if (!e.length) return /* @__PURE__ */ u(ua, {
|
|
2777
2947
|
filtered: r,
|
|
2778
2948
|
onClearFilters: a
|
|
2779
2949
|
});
|
|
@@ -2788,10 +2958,10 @@ function ra({ lines: e, failed: t, search: n, filtered: r, onFilterRequest: i, o
|
|
|
2788
2958
|
className: "max-h-[640px] overflow-y-auto",
|
|
2789
2959
|
onScroll: (e) => {
|
|
2790
2960
|
let t = e.currentTarget;
|
|
2791
|
-
s && t.scrollHeight - t.scrollTop - t.clientHeight <
|
|
2961
|
+
s && t.scrollHeight - t.scrollTop - t.clientHeight < na && s();
|
|
2792
2962
|
},
|
|
2793
2963
|
children: [/* @__PURE__ */ d("div", {
|
|
2794
|
-
className: `${
|
|
2964
|
+
className: `${ea} sticky top-0 z-[1] h-7.5 border-b bg-card px-2 text-xs text-muted-foreground`,
|
|
2795
2965
|
style: { gridTemplateColumns: l.gridTemplateColumns },
|
|
2796
2966
|
children: [
|
|
2797
2967
|
/* @__PURE__ */ u("span", { children: "Time" }),
|
|
@@ -2810,7 +2980,7 @@ function ra({ lines: e, failed: t, search: n, filtered: r, onFilterRequest: i, o
|
|
|
2810
2980
|
})]
|
|
2811
2981
|
})
|
|
2812
2982
|
]
|
|
2813
|
-
}), /* @__PURE__ */ u("ol", { children: e.map((e) => /* @__PURE__ */ u(
|
|
2983
|
+
}), /* @__PURE__ */ u("ol", { children: e.map((e) => /* @__PURE__ */ u(da, {
|
|
2814
2984
|
line: e,
|
|
2815
2985
|
layout: l,
|
|
2816
2986
|
expanded: m(e.logId),
|
|
@@ -2820,29 +2990,29 @@ function ra({ lines: e, failed: t, search: n, filtered: r, onFilterRequest: i, o
|
|
|
2820
2990
|
}, e.logId)) })]
|
|
2821
2991
|
});
|
|
2822
2992
|
}
|
|
2823
|
-
function
|
|
2993
|
+
function ca(e) {
|
|
2824
2994
|
let t = [
|
|
2825
|
-
|
|
2826
|
-
...e.level ? [
|
|
2827
|
-
...e.request ? [
|
|
2995
|
+
ra.time,
|
|
2996
|
+
...e.level ? [ra.level] : [],
|
|
2997
|
+
...e.request ? [ra.request] : []
|
|
2828
2998
|
];
|
|
2829
2999
|
return {
|
|
2830
3000
|
columns: e,
|
|
2831
3001
|
gridTemplateColumns: `${t.map((e) => `${e}px`).join(" ")} minmax(0,1fr) 16px`,
|
|
2832
|
-
messageOffset: t.reduce((e, t) => e + t +
|
|
3002
|
+
messageOffset: t.reduce((e, t) => e + t + ta, 0)
|
|
2833
3003
|
};
|
|
2834
3004
|
}
|
|
2835
|
-
function
|
|
3005
|
+
function la({ layout: e }) {
|
|
2836
3006
|
return /* @__PURE__ */ u("div", {
|
|
2837
3007
|
className: "py-2",
|
|
2838
3008
|
children: Array.from({ length: 6 }, (t, n) => /* @__PURE__ */ d("div", {
|
|
2839
|
-
className: `${
|
|
3009
|
+
className: `${ea} h-8.5 px-2`,
|
|
2840
3010
|
style: { gridTemplateColumns: e.gridTemplateColumns },
|
|
2841
3011
|
children: [
|
|
2842
|
-
/* @__PURE__ */ u(
|
|
2843
|
-
e.columns.level && /* @__PURE__ */ u(
|
|
2844
|
-
e.columns.request && /* @__PURE__ */ u(
|
|
2845
|
-
/* @__PURE__ */ u(
|
|
3012
|
+
/* @__PURE__ */ u(G, { className: "h-3.5 w-20" }),
|
|
3013
|
+
e.columns.level && /* @__PURE__ */ u(G, { className: "h-4 w-11" }),
|
|
3014
|
+
e.columns.request && /* @__PURE__ */ u(G, { className: "h-4 w-16" }),
|
|
3015
|
+
/* @__PURE__ */ u(G, {
|
|
2846
3016
|
className: "h-3.5",
|
|
2847
3017
|
style: { width: `${35 + n * 23 % 50}%` }
|
|
2848
3018
|
})
|
|
@@ -2850,7 +3020,7 @@ function aa({ layout: e }) {
|
|
|
2850
3020
|
}, n))
|
|
2851
3021
|
});
|
|
2852
3022
|
}
|
|
2853
|
-
function
|
|
3023
|
+
function ua({ filtered: e, onClearFilters: t }) {
|
|
2854
3024
|
return /* @__PURE__ */ u("p", {
|
|
2855
3025
|
className: "py-8 text-center text-[13px] text-muted-foreground",
|
|
2856
3026
|
children: e ? /* @__PURE__ */ d(l, { children: [
|
|
@@ -2865,13 +3035,13 @@ function oa({ filtered: e, onClearFilters: t }) {
|
|
|
2865
3035
|
] }) : "No logs in this time range."
|
|
2866
3036
|
});
|
|
2867
3037
|
}
|
|
2868
|
-
function
|
|
2869
|
-
let o =
|
|
3038
|
+
function da({ line: e, layout: t, expanded: n, onToggle: r, search: i, onFilterRequest: a }) {
|
|
3039
|
+
let o = Di(e.message);
|
|
2870
3040
|
return /* @__PURE__ */ d("li", {
|
|
2871
|
-
className:
|
|
3041
|
+
className: U("border-b border-border/55 px-2 last:border-b-0", aa[e.level]),
|
|
2872
3042
|
children: [/* @__PURE__ */ d("div", {
|
|
2873
3043
|
onClick: r,
|
|
2874
|
-
className: `${
|
|
3044
|
+
className: `${ea} min-h-8.5 cursor-pointer text-[12.5px]`,
|
|
2875
3045
|
style: { gridTemplateColumns: t.gridTemplateColumns },
|
|
2876
3046
|
children: [
|
|
2877
3047
|
/* @__PURE__ */ u("span", {
|
|
@@ -2879,14 +3049,14 @@ function sa({ line: e, layout: t, expanded: n, onToggle: r, search: i, onFilterR
|
|
|
2879
3049
|
children: ct(e.timestampMs)
|
|
2880
3050
|
}),
|
|
2881
3051
|
t.columns.level && /* @__PURE__ */ u("span", {
|
|
2882
|
-
className:
|
|
3052
|
+
className: U("justify-self-start rounded-sm border px-1.5 py-px text-[9.5px] font-bold tracking-[0.07em] uppercase", ia[e.level]),
|
|
2883
3053
|
children: e.level
|
|
2884
3054
|
}),
|
|
2885
|
-
t.columns.request && /* @__PURE__ */ u(
|
|
3055
|
+
t.columns.request && /* @__PURE__ */ u(fa, {
|
|
2886
3056
|
requestId: e.requestId,
|
|
2887
3057
|
onFilter: a
|
|
2888
3058
|
}),
|
|
2889
|
-
/* @__PURE__ */ u(
|
|
3059
|
+
/* @__PURE__ */ u(pa, {
|
|
2890
3060
|
parsed: o,
|
|
2891
3061
|
level: e.level,
|
|
2892
3062
|
search: i
|
|
@@ -2899,17 +3069,17 @@ function sa({ line: e, layout: t, expanded: n, onToggle: r, search: i, onFilterR
|
|
|
2899
3069
|
e.stopPropagation(), r();
|
|
2900
3070
|
},
|
|
2901
3071
|
className: "rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
2902
|
-
children: /* @__PURE__ */ u(ie, { className:
|
|
3072
|
+
children: /* @__PURE__ */ u(ie, { className: U("size-3.5 transition-transform", n && "rotate-90") })
|
|
2903
3073
|
})
|
|
2904
3074
|
]
|
|
2905
|
-
}), n && /* @__PURE__ */ u(
|
|
3075
|
+
}), n && /* @__PURE__ */ u(ha, {
|
|
2906
3076
|
line: e,
|
|
2907
3077
|
parsed: o,
|
|
2908
3078
|
indent: t.messageOffset
|
|
2909
3079
|
})]
|
|
2910
3080
|
});
|
|
2911
3081
|
}
|
|
2912
|
-
function
|
|
3082
|
+
function fa({ requestId: e, onFilter: t }) {
|
|
2913
3083
|
return e === null ? /* @__PURE__ */ u("span", {
|
|
2914
3084
|
className: "font-mono text-muted-foreground",
|
|
2915
3085
|
title: "Logged outside a request, for example by a timer that fired after its call returned",
|
|
@@ -2925,26 +3095,26 @@ function ca({ requestId: e, onFilter: t }) {
|
|
|
2925
3095
|
n.stopPropagation(), t(e);
|
|
2926
3096
|
},
|
|
2927
3097
|
className: "max-w-full justify-self-start truncate rounded-sm bg-chart-2/12 px-1.5 py-px font-mono text-[11.5px] text-chart-2 outline-none hover:bg-chart-2/22 focus-visible:ring-2 focus-visible:ring-ring",
|
|
2928
|
-
children:
|
|
3098
|
+
children: ki(e)
|
|
2929
3099
|
});
|
|
2930
3100
|
}
|
|
2931
|
-
function
|
|
2932
|
-
return e.json ? /* @__PURE__ */ u(
|
|
3101
|
+
function pa({ parsed: e, level: t, search: n }) {
|
|
3102
|
+
return e.json ? /* @__PURE__ */ u(ma, {
|
|
2933
3103
|
value: e.json,
|
|
2934
3104
|
search: n
|
|
2935
3105
|
}) : /* @__PURE__ */ d("span", {
|
|
2936
|
-
className:
|
|
3106
|
+
className: U("flex min-w-0 items-center gap-2 font-mono", t === "debug" ? "text-muted-foreground" : "text-foreground/95"),
|
|
2937
3107
|
children: [/* @__PURE__ */ u("span", {
|
|
2938
3108
|
className: "truncate",
|
|
2939
|
-
children:
|
|
3109
|
+
children: ya(e.firstLine, n)
|
|
2940
3110
|
}), e.moreLines > 0 && /* @__PURE__ */ d("span", {
|
|
2941
3111
|
className: "shrink-0 rounded-full border px-2 font-sans text-[11px] text-muted-foreground",
|
|
2942
3112
|
children: ["+", O(e.moreLines, "line")]
|
|
2943
3113
|
})]
|
|
2944
3114
|
});
|
|
2945
3115
|
}
|
|
2946
|
-
function
|
|
2947
|
-
let { headline: r, fields: i } =
|
|
3116
|
+
function ma({ value: t, search: n }) {
|
|
3117
|
+
let { headline: r, fields: i } = Oi(t);
|
|
2948
3118
|
return /* @__PURE__ */ d("span", {
|
|
2949
3119
|
className: "flex min-w-0 items-center gap-2 font-mono",
|
|
2950
3120
|
children: [/* @__PURE__ */ u("span", {
|
|
@@ -2954,7 +3124,7 @@ function ua({ value: t, search: n }) {
|
|
|
2954
3124
|
className: "truncate",
|
|
2955
3125
|
children: [r && /* @__PURE__ */ u("span", {
|
|
2956
3126
|
className: "mr-2.5 font-medium text-foreground",
|
|
2957
|
-
children:
|
|
3127
|
+
children: ya(r, n)
|
|
2958
3128
|
}), i.map(([t, r], i) => /* @__PURE__ */ d(e, { children: [
|
|
2959
3129
|
i > 0 && /* @__PURE__ */ u("span", {
|
|
2960
3130
|
className: "text-muted-foreground",
|
|
@@ -2966,13 +3136,13 @@ function ua({ value: t, search: n }) {
|
|
|
2966
3136
|
}),
|
|
2967
3137
|
/* @__PURE__ */ u("span", {
|
|
2968
3138
|
className: "text-foreground/95",
|
|
2969
|
-
children:
|
|
3139
|
+
children: ya(r, n)
|
|
2970
3140
|
})
|
|
2971
3141
|
] }, t))]
|
|
2972
3142
|
})]
|
|
2973
3143
|
});
|
|
2974
3144
|
}
|
|
2975
|
-
function
|
|
3145
|
+
function ha({ line: e, parsed: t, indent: n }) {
|
|
2976
3146
|
let r = {
|
|
2977
3147
|
timestamp: new Date(e.timestampMs).toISOString(),
|
|
2978
3148
|
level: e.level,
|
|
@@ -2984,21 +3154,21 @@ function da({ line: e, parsed: t, indent: n }) {
|
|
|
2984
3154
|
return /* @__PURE__ */ d("div", {
|
|
2985
3155
|
className: "pr-6 pb-4",
|
|
2986
3156
|
style: { paddingLeft: n },
|
|
2987
|
-
children: [/* @__PURE__ */ u(
|
|
3157
|
+
children: [/* @__PURE__ */ u(ga, { value: r }), /* @__PURE__ */ u("div", {
|
|
2988
3158
|
className: "mt-3",
|
|
2989
|
-
children: /* @__PURE__ */ u(
|
|
3159
|
+
children: /* @__PURE__ */ u(va, { text: JSON.stringify(r, null, 2) })
|
|
2990
3160
|
})]
|
|
2991
3161
|
});
|
|
2992
3162
|
}
|
|
2993
|
-
function
|
|
3163
|
+
function ga({ value: e }) {
|
|
2994
3164
|
return /* @__PURE__ */ u("pre", {
|
|
2995
3165
|
className: "max-h-96 overflow-auto rounded-lg border bg-(--code-bg) px-3.5 py-2.5 font-mono text-xs leading-relaxed break-words whitespace-pre-wrap",
|
|
2996
|
-
children:
|
|
3166
|
+
children: _a(JSON.stringify(e, null, 2))
|
|
2997
3167
|
});
|
|
2998
3168
|
}
|
|
2999
|
-
function
|
|
3169
|
+
function _a(e) {
|
|
3000
3170
|
let t = [], n = 0;
|
|
3001
|
-
for (let r of e.matchAll(
|
|
3171
|
+
for (let r of e.matchAll(oa)) {
|
|
3002
3172
|
let [i, a, o] = r;
|
|
3003
3173
|
t.push(e.slice(n, r.index), /* @__PURE__ */ u("span", {
|
|
3004
3174
|
className: a ? "text-(--tk-plain)" : o ? "text-(--tk-string)" : "text-(--tk-type)",
|
|
@@ -3007,9 +3177,9 @@ function pa(e) {
|
|
|
3007
3177
|
}
|
|
3008
3178
|
return t.push(e.slice(n)), t;
|
|
3009
3179
|
}
|
|
3010
|
-
function
|
|
3180
|
+
function va({ text: e }) {
|
|
3011
3181
|
let [t, n] = o(!1);
|
|
3012
|
-
return /* @__PURE__ */ d(
|
|
3182
|
+
return /* @__PURE__ */ d(W, {
|
|
3013
3183
|
variant: "outline",
|
|
3014
3184
|
size: "xs",
|
|
3015
3185
|
onClick: () => void navigator.clipboard.writeText(e).then(() => {
|
|
@@ -3018,7 +3188,7 @@ function ma({ text: e }) {
|
|
|
3018
3188
|
children: [u(t ? te : le, {}), t ? "Copied" : "Copy JSON"]
|
|
3019
3189
|
});
|
|
3020
3190
|
}
|
|
3021
|
-
function
|
|
3191
|
+
function ya(e, t) {
|
|
3022
3192
|
if (!t) return e;
|
|
3023
3193
|
let n = e.toLowerCase(), r = t.toLowerCase(), i = [], a = 0;
|
|
3024
3194
|
for (let t = n.indexOf(r); t >= 0; t = n.indexOf(r, a)) i.push(e.slice(a, t), /* @__PURE__ */ u("mark", {
|
|
@@ -3029,7 +3199,7 @@ function ha(e, t) {
|
|
|
3029
3199
|
}
|
|
3030
3200
|
//#endregion
|
|
3031
3201
|
//#region src/components/instance/logsCard.tsx
|
|
3032
|
-
var
|
|
3202
|
+
var ba = [
|
|
3033
3203
|
{
|
|
3034
3204
|
value: "all",
|
|
3035
3205
|
label: "All"
|
|
@@ -3046,12 +3216,12 @@ var ga = [
|
|
|
3046
3216
|
value: "error",
|
|
3047
3217
|
label: "Error"
|
|
3048
3218
|
}
|
|
3049
|
-
],
|
|
3219
|
+
], xa = "logs", Sa = 300, Ca = {
|
|
3050
3220
|
level: !0,
|
|
3051
3221
|
request: !1
|
|
3052
|
-
},
|
|
3053
|
-
function
|
|
3054
|
-
let { baseUrl: s } =
|
|
3222
|
+
}, wa = "durable-actors-observer:log-columns", Ta = [["level", "Level"], ["request", "Request"]];
|
|
3223
|
+
function Ea({ actorName: e, actorId: t, requests: n, requestId: r, onRequestChange: i, timeWindow: a }) {
|
|
3224
|
+
let { baseUrl: s } = R(), c = Lt(), [l, f] = o("all"), [p, m] = o(""), [h, g] = Aa(), _ = vi(p.trim(), Sa), v = l === "all" ? null : l, y = zi(s, a, {
|
|
3055
3225
|
actorName: e,
|
|
3056
3226
|
actorId: t,
|
|
3057
3227
|
requestId: r,
|
|
@@ -3060,22 +3230,22 @@ function Sa({ actorName: e, actorId: t, requests: n, requestId: r, onRequestChan
|
|
|
3060
3230
|
}), ee = new Map(n?.map((e) => [e.requestId, e])), te = () => {
|
|
3061
3231
|
i(null), m(""), f("all");
|
|
3062
3232
|
};
|
|
3063
|
-
return /* @__PURE__ */ d(
|
|
3064
|
-
id:
|
|
3233
|
+
return /* @__PURE__ */ d(K, {
|
|
3234
|
+
id: xa,
|
|
3065
3235
|
title: "Logs",
|
|
3066
3236
|
aside: /* @__PURE__ */ d("div", {
|
|
3067
3237
|
className: "flex flex-wrap items-center gap-2",
|
|
3068
3238
|
children: [
|
|
3069
|
-
/* @__PURE__ */ u(
|
|
3239
|
+
/* @__PURE__ */ u(Da, {
|
|
3070
3240
|
value: p,
|
|
3071
3241
|
onChange: m
|
|
3072
3242
|
}),
|
|
3073
|
-
/* @__PURE__ */ u(
|
|
3243
|
+
/* @__PURE__ */ u(Oa, {
|
|
3074
3244
|
value: l,
|
|
3075
3245
|
onChange: f,
|
|
3076
|
-
totals: y.histogram &&
|
|
3246
|
+
totals: y.histogram && Ei(y.histogram)
|
|
3077
3247
|
}),
|
|
3078
|
-
/* @__PURE__ */ u(
|
|
3248
|
+
/* @__PURE__ */ u(ka, {
|
|
3079
3249
|
columns: h,
|
|
3080
3250
|
onChange: g
|
|
3081
3251
|
})
|
|
@@ -3084,13 +3254,13 @@ function Sa({ actorName: e, actorId: t, requests: n, requestId: r, onRequestChan
|
|
|
3084
3254
|
busy: !y.lines && !y.isError,
|
|
3085
3255
|
className: "pb-3.5",
|
|
3086
3256
|
children: [
|
|
3087
|
-
r && /* @__PURE__ */ u(
|
|
3257
|
+
r && /* @__PURE__ */ u(Ma, {
|
|
3088
3258
|
requestId: r,
|
|
3089
3259
|
call: ee.get(r),
|
|
3090
3260
|
onRemove: () => i(null),
|
|
3091
3261
|
onClearFilters: te
|
|
3092
3262
|
}),
|
|
3093
|
-
/* @__PURE__ */ u(
|
|
3263
|
+
/* @__PURE__ */ u(qi, {
|
|
3094
3264
|
histogram: y.histogram,
|
|
3095
3265
|
level: v,
|
|
3096
3266
|
live: a.live,
|
|
@@ -3099,7 +3269,7 @@ function Sa({ actorName: e, actorId: t, requests: n, requestId: r, onRequestChan
|
|
|
3099
3269
|
...e
|
|
3100
3270
|
})
|
|
3101
3271
|
}),
|
|
3102
|
-
/* @__PURE__ */ u(
|
|
3272
|
+
/* @__PURE__ */ u(sa, {
|
|
3103
3273
|
lines: y.lines,
|
|
3104
3274
|
failed: y.isError,
|
|
3105
3275
|
search: _,
|
|
@@ -3112,7 +3282,7 @@ function Sa({ actorName: e, actorId: t, requests: n, requestId: r, onRequestChan
|
|
|
3112
3282
|
]
|
|
3113
3283
|
});
|
|
3114
3284
|
}
|
|
3115
|
-
function
|
|
3285
|
+
function Da({ value: e, onChange: t }) {
|
|
3116
3286
|
return /* @__PURE__ */ d("label", {
|
|
3117
3287
|
className: "flex h-8 w-64 items-center gap-2 rounded-lg border bg-background/40 px-2.5 text-[12.5px] focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/40",
|
|
3118
3288
|
children: [
|
|
@@ -3141,31 +3311,31 @@ function Ca({ value: e, onChange: t }) {
|
|
|
3141
3311
|
]
|
|
3142
3312
|
});
|
|
3143
3313
|
}
|
|
3144
|
-
function
|
|
3145
|
-
return /* @__PURE__ */ u(
|
|
3314
|
+
function Oa({ value: e, onChange: t, totals: n }) {
|
|
3315
|
+
return /* @__PURE__ */ u(Dn, {
|
|
3146
3316
|
label: "Minimum log level",
|
|
3147
3317
|
value: e,
|
|
3148
3318
|
onChange: t,
|
|
3149
|
-
options:
|
|
3319
|
+
options: ba.map((e) => ({
|
|
3150
3320
|
...e,
|
|
3151
|
-
icon: (e.value === "warn" || e.value === "error") && /* @__PURE__ */ u("i", { className:
|
|
3152
|
-
badge: n &&
|
|
3321
|
+
icon: (e.value === "warn" || e.value === "error") && /* @__PURE__ */ u("i", { className: U("size-1.5 rounded-full", Wi[e.value]) }),
|
|
3322
|
+
badge: n && E(Q(n, e.value === "all" ? null : e.value))
|
|
3153
3323
|
}))
|
|
3154
3324
|
});
|
|
3155
3325
|
}
|
|
3156
|
-
function
|
|
3157
|
-
return /* @__PURE__ */ d(
|
|
3326
|
+
function ka({ columns: e, onChange: t }) {
|
|
3327
|
+
return /* @__PURE__ */ d(hn, { children: [/* @__PURE__ */ u(gn, {
|
|
3158
3328
|
asChild: !0,
|
|
3159
|
-
children: /* @__PURE__ */ d(
|
|
3329
|
+
children: /* @__PURE__ */ d(W, {
|
|
3160
3330
|
variant: "outline",
|
|
3161
3331
|
size: "sm",
|
|
3162
3332
|
className: "h-8 text-xs",
|
|
3163
3333
|
children: [/* @__PURE__ */ u(ce, {}), "Columns"]
|
|
3164
3334
|
})
|
|
3165
|
-
}), /* @__PURE__ */ u(
|
|
3335
|
+
}), /* @__PURE__ */ u(_n, {
|
|
3166
3336
|
align: "end",
|
|
3167
3337
|
className: "w-44 p-1.5",
|
|
3168
|
-
children:
|
|
3338
|
+
children: Ta.map(([n, r]) => /* @__PURE__ */ d("label", {
|
|
3169
3339
|
className: "flex cursor-pointer items-center gap-2.5 rounded-sm px-2 py-1.5 text-[13px] hover:bg-muted",
|
|
3170
3340
|
children: [/* @__PURE__ */ u("input", {
|
|
3171
3341
|
type: "checkbox",
|
|
@@ -3179,26 +3349,26 @@ function Ta({ columns: e, onChange: t }) {
|
|
|
3179
3349
|
}, n))
|
|
3180
3350
|
})] });
|
|
3181
3351
|
}
|
|
3182
|
-
function
|
|
3183
|
-
let [e, t] = o(
|
|
3352
|
+
function Aa() {
|
|
3353
|
+
let [e, t] = o(ja);
|
|
3184
3354
|
return [e, (e) => {
|
|
3185
3355
|
t(e);
|
|
3186
3356
|
try {
|
|
3187
|
-
localStorage.setItem(
|
|
3357
|
+
localStorage.setItem(wa, JSON.stringify(e));
|
|
3188
3358
|
} catch {}
|
|
3189
3359
|
}];
|
|
3190
3360
|
}
|
|
3191
|
-
function
|
|
3361
|
+
function ja() {
|
|
3192
3362
|
try {
|
|
3193
3363
|
return {
|
|
3194
|
-
...
|
|
3195
|
-
...JSON.parse(localStorage.getItem(
|
|
3364
|
+
...Ca,
|
|
3365
|
+
...JSON.parse(localStorage.getItem(wa) ?? "{}")
|
|
3196
3366
|
};
|
|
3197
3367
|
} catch {
|
|
3198
|
-
return
|
|
3368
|
+
return Ca;
|
|
3199
3369
|
}
|
|
3200
3370
|
}
|
|
3201
|
-
function
|
|
3371
|
+
function Ma({ requestId: e, call: t, onRemove: n, onClearFilters: r }) {
|
|
3202
3372
|
return /* @__PURE__ */ d("div", {
|
|
3203
3373
|
className: "mt-3.5 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",
|
|
3204
3374
|
children: [
|
|
@@ -3213,7 +3383,7 @@ function Oa({ requestId: e, call: t, onRemove: n, onClearFilters: r }) {
|
|
|
3213
3383
|
/* @__PURE__ */ u("code", {
|
|
3214
3384
|
title: e,
|
|
3215
3385
|
className: "font-mono text-[11.5px] text-chart-2",
|
|
3216
|
-
children:
|
|
3386
|
+
children: ki(e)
|
|
3217
3387
|
}),
|
|
3218
3388
|
t && /* @__PURE__ */ d("span", {
|
|
3219
3389
|
className: "text-muted-foreground",
|
|
@@ -3239,19 +3409,19 @@ function Oa({ requestId: e, call: t, onRemove: n, onClearFilters: r }) {
|
|
|
3239
3409
|
}
|
|
3240
3410
|
//#endregion
|
|
3241
3411
|
//#region src/components/ui/barChart.tsx
|
|
3242
|
-
function
|
|
3412
|
+
function Na({ values: e, label: t, highlighted: n, onSelect: r, barLabel: i, className: a }) {
|
|
3243
3413
|
let o = Math.max(...e, 1);
|
|
3244
3414
|
return r ? /* @__PURE__ */ u("div", {
|
|
3245
3415
|
role: "group",
|
|
3246
3416
|
"aria-label": t,
|
|
3247
|
-
className:
|
|
3417
|
+
className: U("flex items-end gap-0.5", a),
|
|
3248
3418
|
children: e.map((e, t) => /* @__PURE__ */ u("button", {
|
|
3249
3419
|
type: "button",
|
|
3250
3420
|
"aria-label": i?.(t),
|
|
3251
3421
|
"aria-pressed": t === n,
|
|
3252
3422
|
onClick: () => r(t),
|
|
3253
|
-
className:
|
|
3254
|
-
children: /* @__PURE__ */ u(
|
|
3423
|
+
className: U("group relative flex h-full flex-1 items-end rounded-[2px] outline-none focus-visible:ring-2 focus-visible:ring-ring", t === n && "after:absolute after:inset-x-0 after:-bottom-1 after:h-0.5 after:rounded-full after:bg-foreground"),
|
|
3424
|
+
children: /* @__PURE__ */ u(Pa, {
|
|
3255
3425
|
share: e / o,
|
|
3256
3426
|
highlighted: t === n
|
|
3257
3427
|
})
|
|
@@ -3259,89 +3429,89 @@ function ka({ values: e, label: t, highlighted: n, onSelect: r, barLabel: i, cla
|
|
|
3259
3429
|
}) : /* @__PURE__ */ u("div", {
|
|
3260
3430
|
role: "img",
|
|
3261
3431
|
"aria-label": t,
|
|
3262
|
-
className:
|
|
3263
|
-
children: e.map((e, t) => /* @__PURE__ */ u(
|
|
3432
|
+
className: U("flex items-end gap-1", a),
|
|
3433
|
+
children: e.map((e, t) => /* @__PURE__ */ u(Pa, {
|
|
3264
3434
|
share: e / o,
|
|
3265
3435
|
highlighted: t === n
|
|
3266
3436
|
}, t))
|
|
3267
3437
|
});
|
|
3268
3438
|
}
|
|
3269
|
-
function
|
|
3439
|
+
function Pa({ share: e, highlighted: t }) {
|
|
3270
3440
|
return /* @__PURE__ */ u("span", {
|
|
3271
|
-
className:
|
|
3441
|
+
className: U("block flex-1 rounded-t-[1px]", e ? "bg-muted-foreground/40 group-hover:bg-muted-foreground/70" : "bg-border", t && "bg-foreground group-hover:bg-foreground"),
|
|
3272
3442
|
style: { height: e ? `${e * 100}%` : "1px" }
|
|
3273
3443
|
});
|
|
3274
3444
|
}
|
|
3275
3445
|
//#endregion
|
|
3276
3446
|
//#region src/components/ui/queueStripes.tsx
|
|
3277
|
-
function
|
|
3447
|
+
function Fa({ className: e, ...t }) {
|
|
3278
3448
|
return /* @__PURE__ */ u("span", {
|
|
3279
3449
|
"data-slot": "queue-stripes",
|
|
3280
|
-
className:
|
|
3450
|
+
className: U("bg-[repeating-linear-gradient(135deg,var(--chart-1)_0_2px,transparent_2px_4px)] shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--chart-1)_50%,transparent)]", e),
|
|
3281
3451
|
...t
|
|
3282
3452
|
});
|
|
3283
3453
|
}
|
|
3284
3454
|
//#endregion
|
|
3285
3455
|
//#region src/components/instance/requestDetails.tsx
|
|
3286
|
-
var
|
|
3456
|
+
var Ia = {
|
|
3287
3457
|
completed: "Completed",
|
|
3288
3458
|
failed: "Failed",
|
|
3289
3459
|
rejected: "Rejected",
|
|
3290
3460
|
rerouted: "Rerouted",
|
|
3291
3461
|
interrupted: "Interrupted"
|
|
3292
|
-
},
|
|
3462
|
+
}, La = {
|
|
3293
3463
|
method: "Method",
|
|
3294
3464
|
websocket: "WebSocket"
|
|
3295
3465
|
};
|
|
3296
|
-
function
|
|
3466
|
+
function Ra({ call: e, blocker: t, onShowLogs: n }) {
|
|
3297
3467
|
let r = e.outcome !== "completed";
|
|
3298
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d(
|
|
3468
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d(ni, {
|
|
3299
3469
|
className: "shrink-0 gap-2 border-b px-5 py-4 pr-14",
|
|
3300
3470
|
children: [
|
|
3301
3471
|
/* @__PURE__ */ d("div", {
|
|
3302
3472
|
className: "flex items-center gap-2",
|
|
3303
|
-
children: [/* @__PURE__ */ u(
|
|
3304
|
-
className:
|
|
3305
|
-
children:
|
|
3473
|
+
children: [/* @__PURE__ */ u(Ha, { state: e.hostState }), /* @__PURE__ */ u("span", {
|
|
3474
|
+
className: U("text-xs", r ? "text-danger" : "text-muted-foreground"),
|
|
3475
|
+
children: Ia[e.outcome]
|
|
3306
3476
|
})]
|
|
3307
3477
|
}),
|
|
3308
|
-
/* @__PURE__ */ u(
|
|
3478
|
+
/* @__PURE__ */ u(ri, {
|
|
3309
3479
|
translate: "no",
|
|
3310
3480
|
className: "truncate text-lg tracking-tight",
|
|
3311
3481
|
children: e.operation
|
|
3312
3482
|
}),
|
|
3313
|
-
/* @__PURE__ */ d(
|
|
3483
|
+
/* @__PURE__ */ d(ii, {
|
|
3314
3484
|
className: "text-[13px] tabular-nums",
|
|
3315
3485
|
children: [
|
|
3316
|
-
|
|
3486
|
+
La[e.kind],
|
|
3317
3487
|
" · ",
|
|
3318
3488
|
it(e.startedAtMs)
|
|
3319
3489
|
]
|
|
3320
3490
|
})
|
|
3321
3491
|
]
|
|
3322
|
-
}), /* @__PURE__ */ u(
|
|
3492
|
+
}), /* @__PURE__ */ u(za, {
|
|
3323
3493
|
call: e,
|
|
3324
3494
|
blocker: t,
|
|
3325
3495
|
onShowLogs: n
|
|
3326
3496
|
})] });
|
|
3327
3497
|
}
|
|
3328
|
-
function
|
|
3329
|
-
let r = e.queueWaitMs, i = r === null ? null :
|
|
3498
|
+
function za({ call: e, blocker: t, onShowLogs: n }) {
|
|
3499
|
+
let r = e.queueWaitMs, i = r === null ? null : V(e), a = r !== null && e.durationMs > 0 ? r / e.durationMs * 100 : 0;
|
|
3330
3500
|
return /* @__PURE__ */ d("div", {
|
|
3331
3501
|
className: "min-h-0 flex-1 overflow-y-auto px-5 py-4",
|
|
3332
3502
|
children: [
|
|
3333
3503
|
/* @__PURE__ */ d("div", {
|
|
3334
3504
|
className: "grid grid-cols-3 gap-3",
|
|
3335
3505
|
children: [
|
|
3336
|
-
/* @__PURE__ */ u(
|
|
3506
|
+
/* @__PURE__ */ u(Va, {
|
|
3337
3507
|
label: "Queue",
|
|
3338
3508
|
ms: r
|
|
3339
3509
|
}),
|
|
3340
|
-
/* @__PURE__ */ u(
|
|
3510
|
+
/* @__PURE__ */ u(Va, {
|
|
3341
3511
|
label: "In actor",
|
|
3342
3512
|
ms: i
|
|
3343
3513
|
}),
|
|
3344
|
-
/* @__PURE__ */ u(
|
|
3514
|
+
/* @__PURE__ */ u(Va, {
|
|
3345
3515
|
label: "Overall",
|
|
3346
3516
|
ms: e.durationMs
|
|
3347
3517
|
})
|
|
@@ -3350,7 +3520,7 @@ function Fa({ call: e, blocker: t, onShowLogs: n }) {
|
|
|
3350
3520
|
/* @__PURE__ */ d("div", {
|
|
3351
3521
|
className: "mt-3.5 flex h-2 overflow-hidden rounded-full bg-muted",
|
|
3352
3522
|
"aria-hidden": !0,
|
|
3353
|
-
children: [a > 0 && /* @__PURE__ */ u(
|
|
3523
|
+
children: [a > 0 && /* @__PURE__ */ u(Fa, { style: { width: `${a}%` } }), /* @__PURE__ */ u("span", { className: U("min-w-0.5 flex-1", e.outcome === "completed" ? "bg-foreground" : "bg-danger") })]
|
|
3354
3524
|
}),
|
|
3355
3525
|
r === null ? /* @__PURE__ */ u("p", {
|
|
3356
3526
|
className: "mt-2.5 text-xs text-muted-foreground",
|
|
@@ -3371,61 +3541,61 @@ function Fa({ call: e, blocker: t, onShowLogs: n }) {
|
|
|
3371
3541
|
/* @__PURE__ */ d("dl", {
|
|
3372
3542
|
className: "mt-5 border-t",
|
|
3373
3543
|
children: [
|
|
3374
|
-
/* @__PURE__ */ u(
|
|
3544
|
+
/* @__PURE__ */ u($, {
|
|
3375
3545
|
label: "Request ID",
|
|
3376
3546
|
value: e.requestId,
|
|
3377
3547
|
mono: !0
|
|
3378
3548
|
}),
|
|
3379
|
-
/* @__PURE__ */ u(
|
|
3549
|
+
/* @__PURE__ */ u($, {
|
|
3380
3550
|
label: "Routing",
|
|
3381
3551
|
value: D(e.routingMs)
|
|
3382
3552
|
}),
|
|
3383
|
-
/* @__PURE__ */ u(
|
|
3553
|
+
/* @__PURE__ */ u($, {
|
|
3384
3554
|
label: "Kind",
|
|
3385
|
-
value:
|
|
3555
|
+
value: La[e.kind]
|
|
3386
3556
|
}),
|
|
3387
|
-
/* @__PURE__ */ u(
|
|
3557
|
+
/* @__PURE__ */ u($, {
|
|
3388
3558
|
label: "Outcome",
|
|
3389
|
-
value:
|
|
3559
|
+
value: Ia[e.outcome],
|
|
3390
3560
|
danger: e.outcome !== "completed"
|
|
3391
3561
|
}),
|
|
3392
|
-
/* @__PURE__ */ u(
|
|
3562
|
+
/* @__PURE__ */ u($, {
|
|
3393
3563
|
label: "Actor",
|
|
3394
3564
|
value: e.actorName,
|
|
3395
3565
|
mono: !0
|
|
3396
3566
|
}),
|
|
3397
|
-
/* @__PURE__ */ u(
|
|
3567
|
+
/* @__PURE__ */ u($, {
|
|
3398
3568
|
label: "Instance",
|
|
3399
3569
|
value: e.actorId,
|
|
3400
3570
|
mono: !0
|
|
3401
3571
|
}),
|
|
3402
|
-
/* @__PURE__ */ u(
|
|
3572
|
+
/* @__PURE__ */ u($, {
|
|
3403
3573
|
label: "Host",
|
|
3404
3574
|
value: e.hostId,
|
|
3405
3575
|
mono: !0
|
|
3406
3576
|
}),
|
|
3407
|
-
/* @__PURE__ */ u(
|
|
3577
|
+
/* @__PURE__ */ u($, {
|
|
3408
3578
|
label: "Session",
|
|
3409
3579
|
value: e.sessionId,
|
|
3410
3580
|
mono: !0
|
|
3411
3581
|
}),
|
|
3412
|
-
e.connectionId && /* @__PURE__ */ u(
|
|
3582
|
+
e.connectionId && /* @__PURE__ */ u($, {
|
|
3413
3583
|
label: "Connection",
|
|
3414
3584
|
value: e.connectionId,
|
|
3415
3585
|
mono: !0
|
|
3416
3586
|
})
|
|
3417
3587
|
]
|
|
3418
3588
|
}),
|
|
3419
|
-
/* @__PURE__ */ u(
|
|
3589
|
+
/* @__PURE__ */ u(Ba, { onShowLogs: n })
|
|
3420
3590
|
]
|
|
3421
3591
|
});
|
|
3422
3592
|
}
|
|
3423
|
-
function
|
|
3424
|
-
let t =
|
|
3593
|
+
function Ba({ onShowLogs: e }) {
|
|
3594
|
+
let t = si();
|
|
3425
3595
|
function n() {
|
|
3426
3596
|
t.close(), e();
|
|
3427
3597
|
}
|
|
3428
|
-
return /* @__PURE__ */ d(
|
|
3598
|
+
return /* @__PURE__ */ d(W, {
|
|
3429
3599
|
variant: "link",
|
|
3430
3600
|
size: "sm",
|
|
3431
3601
|
className: "mt-3 px-0 text-[13px] has-[>svg]:px-0",
|
|
@@ -3433,26 +3603,27 @@ function Ia({ onShowLogs: e }) {
|
|
|
3433
3603
|
children: ["View logs", /* @__PURE__ */ u(y, { "aria-hidden": !0 })]
|
|
3434
3604
|
});
|
|
3435
3605
|
}
|
|
3436
|
-
function
|
|
3606
|
+
function Va({ label: e, ms: t }) {
|
|
3607
|
+
let [n, r] = dt(t ?? 0);
|
|
3437
3608
|
return /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("div", {
|
|
3438
3609
|
className: "text-xs text-muted-foreground",
|
|
3439
3610
|
children: e
|
|
3440
3611
|
}), /* @__PURE__ */ u("div", {
|
|
3441
3612
|
className: "mt-1.5 flex items-baseline gap-1.5 text-[22px] leading-none font-medium tracking-tight tabular-nums",
|
|
3442
|
-
children: t === null ? "—" : /* @__PURE__ */ d(l, { children: [
|
|
3613
|
+
children: t === null ? "—" : /* @__PURE__ */ d(l, { children: [n, /* @__PURE__ */ u("span", {
|
|
3443
3614
|
className: "text-xs font-medium tracking-normal text-muted-foreground",
|
|
3444
|
-
children:
|
|
3615
|
+
children: r
|
|
3445
3616
|
})] })
|
|
3446
3617
|
})] });
|
|
3447
3618
|
}
|
|
3448
|
-
function
|
|
3619
|
+
function Ha({ state: e }) {
|
|
3449
3620
|
let t = e === "warm";
|
|
3450
3621
|
return /* @__PURE__ */ d("span", {
|
|
3451
|
-
className:
|
|
3452
|
-
children: [/* @__PURE__ */ u("span", { className:
|
|
3622
|
+
className: U("inline-flex items-center gap-1.5 rounded-full border px-2 py-0.5 text-[11px] font-medium tracking-wide uppercase", t ? "border-success/25 bg-success/15 text-success" : "border-warning/30 bg-warning/15 text-warning"),
|
|
3623
|
+
children: [/* @__PURE__ */ u("span", { className: U("size-1.5 rounded-full", t ? "bg-success" : "bg-warning") }), t ? "Warm" : "Cold"]
|
|
3453
3624
|
});
|
|
3454
3625
|
}
|
|
3455
|
-
function
|
|
3626
|
+
function $({ label: e, value: t, mono: n, danger: r }) {
|
|
3456
3627
|
return /* @__PURE__ */ d("div", {
|
|
3457
3628
|
className: "grid grid-cols-[108px_minmax(0,1fr)] gap-3 border-b border-border/60 py-2.5",
|
|
3458
3629
|
children: [/* @__PURE__ */ u("dt", {
|
|
@@ -3460,14 +3631,14 @@ function Q({ label: e, value: t, mono: n, danger: r }) {
|
|
|
3460
3631
|
children: e
|
|
3461
3632
|
}), /* @__PURE__ */ u("dd", {
|
|
3462
3633
|
translate: n ? "no" : void 0,
|
|
3463
|
-
className:
|
|
3634
|
+
className: U("text-[13px] text-foreground/90", n && "font-mono text-xs break-all", r && "text-danger"),
|
|
3464
3635
|
children: t
|
|
3465
3636
|
})]
|
|
3466
3637
|
});
|
|
3467
3638
|
}
|
|
3468
3639
|
//#endregion
|
|
3469
3640
|
//#region src/components/instance/requestsCard.tsx
|
|
3470
|
-
var
|
|
3641
|
+
var Ua = .9, Wa = [
|
|
3471
3642
|
1,
|
|
3472
3643
|
2,
|
|
3473
3644
|
5,
|
|
@@ -3487,7 +3658,7 @@ var za = .9, Ba = [
|
|
|
3487
3658
|
9e5,
|
|
3488
3659
|
36e5,
|
|
3489
3660
|
216e5
|
|
3490
|
-
],
|
|
3661
|
+
], Ga = [
|
|
3491
3662
|
{
|
|
3492
3663
|
label: "ms",
|
|
3493
3664
|
ms: 1,
|
|
@@ -3503,72 +3674,72 @@ var za = .9, Ba = [
|
|
|
3503
3674
|
ms: 6e4,
|
|
3504
3675
|
below: Infinity
|
|
3505
3676
|
}
|
|
3506
|
-
],
|
|
3677
|
+
], Ka = "grid grid-cols-[52px_minmax(0,150px)_1fr_52px_70px_70px] items-center gap-4.5", qa = {
|
|
3507
3678
|
completed: "ok",
|
|
3508
3679
|
failed: "failed",
|
|
3509
3680
|
rejected: "rejected",
|
|
3510
3681
|
rerouted: "rerouted",
|
|
3511
3682
|
interrupted: "interrupted"
|
|
3512
|
-
},
|
|
3683
|
+
}, Ja = {
|
|
3513
3684
|
method: "rpc",
|
|
3514
3685
|
websocket: "ws"
|
|
3515
3686
|
};
|
|
3516
|
-
function
|
|
3517
|
-
let [i, a] = o(null), s =
|
|
3687
|
+
function Ya({ requests: e, failed: t, timeWindow: n, onShowLogs: r }) {
|
|
3688
|
+
let [i, a] = o(null), s = si(), c = e && rn(e), f = c && nn(c, n), p = f && (i !== null && i < f.length ? i : Xa(f)), m = c && p !== null ? Za(c, n, p) : null, h = m?.slice(-40);
|
|
3518
3689
|
function g(e, t) {
|
|
3519
3690
|
if (s.openKey === e.eventId) return s.close();
|
|
3520
|
-
let n = c ?
|
|
3691
|
+
let n = c ? lo(e, c) : void 0;
|
|
3521
3692
|
s.show({
|
|
3522
3693
|
key: e.eventId,
|
|
3523
|
-
content: /* @__PURE__ */ u(
|
|
3694
|
+
content: /* @__PURE__ */ u(Ra, {
|
|
3524
3695
|
call: e,
|
|
3525
3696
|
blocker: n,
|
|
3526
3697
|
onShowLogs: () => r(e.requestId)
|
|
3527
3698
|
})
|
|
3528
3699
|
}, t);
|
|
3529
3700
|
}
|
|
3530
|
-
return /* @__PURE__ */ u(
|
|
3701
|
+
return /* @__PURE__ */ u(K, {
|
|
3531
3702
|
title: "Requests",
|
|
3532
|
-
aside: /* @__PURE__ */ u(
|
|
3703
|
+
aside: /* @__PURE__ */ u(Qa, {}),
|
|
3533
3704
|
busy: !f && !t,
|
|
3534
3705
|
className: "pb-3.5",
|
|
3535
3706
|
children: t ? /* @__PURE__ */ u("p", {
|
|
3536
3707
|
className: "py-4 text-[13px] text-muted-foreground",
|
|
3537
3708
|
children: "Couldn't reach the observer API."
|
|
3538
|
-
}) : f && p !== null && m && h ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
3709
|
+
}) : f && p !== null && m && h ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u($a, {
|
|
3539
3710
|
counts: f,
|
|
3540
3711
|
selected: p,
|
|
3541
3712
|
onSelect: a,
|
|
3542
3713
|
timeWindow: n
|
|
3543
|
-
}), /* @__PURE__ */ u(
|
|
3714
|
+
}), /* @__PURE__ */ u(eo, {
|
|
3544
3715
|
calls: h,
|
|
3545
3716
|
total: m.length,
|
|
3546
3717
|
inspectedId: s.openKey,
|
|
3547
3718
|
onInspect: g
|
|
3548
|
-
})] }) : /* @__PURE__ */ u(
|
|
3719
|
+
})] }) : /* @__PURE__ */ u(mo, {})
|
|
3549
3720
|
});
|
|
3550
3721
|
}
|
|
3551
|
-
function
|
|
3722
|
+
function Xa(e) {
|
|
3552
3723
|
let t = [...e].reverse().findIndex((e) => e > 0);
|
|
3553
3724
|
return e.length - 1 - Math.max(t, 0);
|
|
3554
3725
|
}
|
|
3555
|
-
function
|
|
3556
|
-
return e.filter((e) =>
|
|
3726
|
+
function Za(e, t, n) {
|
|
3727
|
+
return e.filter((e) => Et(t, e.startedAtMs) === n).sort((e, t) => e.startedAtMs - t.startedAtMs);
|
|
3557
3728
|
}
|
|
3558
|
-
function
|
|
3729
|
+
function Qa() {
|
|
3559
3730
|
return /* @__PURE__ */ d("div", {
|
|
3560
3731
|
className: "flex gap-4.5 text-xs text-muted-foreground",
|
|
3561
3732
|
children: [/* @__PURE__ */ d("span", {
|
|
3562
3733
|
className: "flex items-center gap-1.75",
|
|
3563
|
-
children: [/* @__PURE__ */ u(
|
|
3734
|
+
children: [/* @__PURE__ */ u(Fa, { className: "h-2 w-4 rounded-xs" }), "Queue wait"]
|
|
3564
3735
|
}), /* @__PURE__ */ d("span", {
|
|
3565
3736
|
className: "flex items-center gap-1.75",
|
|
3566
3737
|
children: [/* @__PURE__ */ u("span", { className: "h-2 w-4 rounded-xs bg-foreground" }), "Running"]
|
|
3567
3738
|
})]
|
|
3568
3739
|
});
|
|
3569
3740
|
}
|
|
3570
|
-
function
|
|
3571
|
-
let i = (e) => r.fromMs + e * r.stepMs, a = Math.min(i(t + 1), r.toMs), o = r.stepMs < 6e4 ? rt :
|
|
3741
|
+
function $a({ counts: e, selected: t, onSelect: n, timeWindow: r }) {
|
|
3742
|
+
let i = (e) => r.fromMs + e * r.stepMs, a = Math.min(i(t + 1), r.toMs), o = r.stepMs < 6e4 ? rt : T;
|
|
3572
3743
|
return /* @__PURE__ */ d("div", {
|
|
3573
3744
|
className: "mt-3.5 grid items-end gap-x-6 gap-y-3 border-b pt-3 pb-3.5 md:grid-cols-[282px_1fr]",
|
|
3574
3745
|
children: [/* @__PURE__ */ d("div", {
|
|
@@ -3582,12 +3753,12 @@ function Ya({ counts: e, selected: t, onSelect: n, timeWindow: r }) {
|
|
|
3582
3753
|
" – ",
|
|
3583
3754
|
o(a)
|
|
3584
3755
|
]
|
|
3585
|
-
}), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(
|
|
3756
|
+
}), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(Na, {
|
|
3586
3757
|
values: e,
|
|
3587
3758
|
highlighted: t,
|
|
3588
3759
|
onSelect: n,
|
|
3589
3760
|
label: "Requests over the selected time range; pick a bar to inspect its requests",
|
|
3590
|
-
barLabel: (t) => `${O(e[t] ?? 0, "request")} from ${
|
|
3761
|
+
barLabel: (t) => `${O(e[t] ?? 0, "request")} from ${T(i(t))}`,
|
|
3591
3762
|
className: "h-10"
|
|
3592
3763
|
}), /* @__PURE__ */ u("div", {
|
|
3593
3764
|
"aria-hidden": !0,
|
|
@@ -3596,15 +3767,15 @@ function Ya({ counts: e, selected: t, onSelect: n, timeWindow: r }) {
|
|
|
3596
3767
|
})] })]
|
|
3597
3768
|
});
|
|
3598
3769
|
}
|
|
3599
|
-
function
|
|
3770
|
+
function eo({ calls: e, total: t, inspectedId: n, onInspect: r }) {
|
|
3600
3771
|
if (!e.length) return /* @__PURE__ */ u("p", {
|
|
3601
3772
|
className: "py-6 text-[13px] text-muted-foreground",
|
|
3602
3773
|
children: "No requests in this slice."
|
|
3603
3774
|
});
|
|
3604
|
-
let i = e[0].startedAtMs, a =
|
|
3775
|
+
let i = e[0].startedAtMs, a = no(to(e)), o = ro(e);
|
|
3605
3776
|
return /* @__PURE__ */ d(l, { children: [
|
|
3606
|
-
/* @__PURE__ */ u(
|
|
3607
|
-
/* @__PURE__ */ u("ol", { children: o.map((t) => /* @__PURE__ */ u(
|
|
3777
|
+
/* @__PURE__ */ u(io, { scale: a }),
|
|
3778
|
+
/* @__PURE__ */ u("ol", { children: o.map((t) => /* @__PURE__ */ u(ao, {
|
|
3608
3779
|
row: t,
|
|
3609
3780
|
calls: e,
|
|
3610
3781
|
origin: i,
|
|
@@ -3612,25 +3783,24 @@ function Xa({ calls: e, total: t, inspectedId: n, onInspect: r }) {
|
|
|
3612
3783
|
inspectedId: n,
|
|
3613
3784
|
onInspect: r
|
|
3614
3785
|
}, t.key)) }),
|
|
3615
|
-
/* @__PURE__ */ u(
|
|
3616
|
-
|
|
3617
|
-
methods: o.length,
|
|
3786
|
+
/* @__PURE__ */ u(po, {
|
|
3787
|
+
shown: e.length,
|
|
3618
3788
|
total: t
|
|
3619
3789
|
})
|
|
3620
3790
|
] });
|
|
3621
3791
|
}
|
|
3622
|
-
function
|
|
3792
|
+
function to(e) {
|
|
3623
3793
|
return Math.max(...e.map((e) => e.startedAtMs + e.durationMs)) - e[0].startedAtMs;
|
|
3624
3794
|
}
|
|
3625
|
-
function
|
|
3626
|
-
let t = e /
|
|
3795
|
+
function no(e) {
|
|
3796
|
+
let t = e / Ua, n = Wa.find((e) => t / e <= 6) ?? Wa.at(-1), r = Math.max(n, Math.ceil(t / n) * n);
|
|
3627
3797
|
return {
|
|
3628
3798
|
spanMs: r,
|
|
3629
3799
|
ticks: Array.from({ length: r / n + 1 }, (e, t) => t * n),
|
|
3630
|
-
unit:
|
|
3800
|
+
unit: Ga.find((e) => r < e.below) ?? Ga.at(-1)
|
|
3631
3801
|
};
|
|
3632
3802
|
}
|
|
3633
|
-
function
|
|
3803
|
+
function ro(e) {
|
|
3634
3804
|
let t = /* @__PURE__ */ new Map();
|
|
3635
3805
|
for (let n of e) {
|
|
3636
3806
|
let e = `${n.kind}:${n.operation}`, r = t.get(e) ?? {
|
|
@@ -3643,19 +3813,19 @@ function $a(e) {
|
|
|
3643
3813
|
}
|
|
3644
3814
|
return [...t.values()].sort((e, t) => t.calls.length - e.calls.length || e.calls[0].startedAtMs - t.calls[0].startedAtMs);
|
|
3645
3815
|
}
|
|
3646
|
-
function
|
|
3816
|
+
function io({ scale: { spanMs: e, ticks: t, unit: n } }) {
|
|
3647
3817
|
return /* @__PURE__ */ d("div", {
|
|
3648
3818
|
"aria-hidden": !0,
|
|
3649
|
-
className: `${
|
|
3819
|
+
className: `${Ka} h-7.5 border-b text-xs text-muted-foreground`,
|
|
3650
3820
|
children: [
|
|
3651
3821
|
/* @__PURE__ */ u("span", { children: "Kind" }),
|
|
3652
3822
|
/* @__PURE__ */ u("span", { children: "Method" }),
|
|
3653
3823
|
/* @__PURE__ */ u("div", {
|
|
3654
3824
|
className: "relative h-full text-[11px] tabular-nums",
|
|
3655
3825
|
children: t.map((r, i) => /* @__PURE__ */ u("span", {
|
|
3656
|
-
className:
|
|
3826
|
+
className: U("absolute top-2", i === 0 ? "" : i === t.length - 1 ? "-translate-x-full" : "-translate-x-1/2"),
|
|
3657
3827
|
style: { left: `${r / e * 100}%` },
|
|
3658
|
-
children: i === 0 ? `+0\u00a0${n.label}` :
|
|
3828
|
+
children: i === 0 ? `+0\u00a0${n.label}` : lt(r / n.ms)
|
|
3659
3829
|
}, r))
|
|
3660
3830
|
}),
|
|
3661
3831
|
/* @__PURE__ */ u("span", {
|
|
@@ -3673,18 +3843,18 @@ function eo({ scale: { spanMs: e, ticks: t, unit: n } }) {
|
|
|
3673
3843
|
]
|
|
3674
3844
|
});
|
|
3675
3845
|
}
|
|
3676
|
-
function
|
|
3677
|
-
let o = e.calls.some(
|
|
3846
|
+
function ao({ row: e, calls: t, origin: n, scale: r, inspectedId: i, onInspect: a }) {
|
|
3847
|
+
let o = e.calls.some(oo), s = H(e.calls, B) ?? 0, c = H(e.calls, V) ?? 0;
|
|
3678
3848
|
return /* @__PURE__ */ d("li", {
|
|
3679
|
-
className: `${
|
|
3849
|
+
className: `${Ka} h-10 border-b border-border/50 text-xs tabular-nums last:border-b-0`,
|
|
3680
3850
|
children: [
|
|
3681
|
-
/* @__PURE__ */ u(
|
|
3851
|
+
/* @__PURE__ */ u(so, { kind: e.kind }),
|
|
3682
3852
|
/* @__PURE__ */ u("span", {
|
|
3683
3853
|
translate: "no",
|
|
3684
|
-
className:
|
|
3854
|
+
className: U("truncate text-[13px]", o ? "text-danger" : "text-foreground/90"),
|
|
3685
3855
|
children: e.operation
|
|
3686
3856
|
}),
|
|
3687
|
-
/* @__PURE__ */ u(
|
|
3857
|
+
/* @__PURE__ */ u(co, {
|
|
3688
3858
|
row: e,
|
|
3689
3859
|
calls: t,
|
|
3690
3860
|
origin: n,
|
|
@@ -3693,8 +3863,8 @@ function to({ row: e, calls: t, origin: n, scale: r, inspectedId: i, onInspect:
|
|
|
3693
3863
|
onInspect: a
|
|
3694
3864
|
}),
|
|
3695
3865
|
/* @__PURE__ */ u("span", {
|
|
3696
|
-
className:
|
|
3697
|
-
children:
|
|
3866
|
+
className: U("text-right", o ? "text-danger" : "text-foreground/90"),
|
|
3867
|
+
children: E(e.calls.length)
|
|
3698
3868
|
}),
|
|
3699
3869
|
/* @__PURE__ */ u("span", {
|
|
3700
3870
|
className: "text-right text-muted-foreground",
|
|
@@ -3707,25 +3877,25 @@ function to({ row: e, calls: t, origin: n, scale: r, inspectedId: i, onInspect:
|
|
|
3707
3877
|
]
|
|
3708
3878
|
});
|
|
3709
3879
|
}
|
|
3710
|
-
function
|
|
3880
|
+
function oo(e) {
|
|
3711
3881
|
return e.outcome !== "completed";
|
|
3712
3882
|
}
|
|
3713
|
-
function
|
|
3883
|
+
function so({ kind: e }) {
|
|
3714
3884
|
return /* @__PURE__ */ u("span", {
|
|
3715
|
-
className:
|
|
3716
|
-
children:
|
|
3885
|
+
className: U("rounded-sm border py-0.5 text-center text-[10px] font-medium tracking-wide uppercase", e === "websocket" ? "border-chart-2/35 text-chart-2" : "text-foreground"),
|
|
3886
|
+
children: Ja[e]
|
|
3717
3887
|
});
|
|
3718
3888
|
}
|
|
3719
|
-
function
|
|
3889
|
+
function co({ row: e, calls: t, origin: n, scale: { spanMs: r, ticks: i }, inspectedId: a, onInspect: o }) {
|
|
3720
3890
|
let s = (e) => `${e / r * 100}%`;
|
|
3721
3891
|
return /* @__PURE__ */ u("div", {
|
|
3722
3892
|
role: "group",
|
|
3723
3893
|
"aria-label": `${e.operation} calls`,
|
|
3724
3894
|
className: "relative h-full bg-[linear-gradient(90deg,color-mix(in_oklab,var(--border)_55%,transparent)_1px,transparent_1px)]",
|
|
3725
3895
|
style: { backgroundSize: `${100 / (i.length - 1)}% 100%` },
|
|
3726
|
-
children: e.calls.map((e) => /* @__PURE__ */ u(
|
|
3896
|
+
children: e.calls.map((e) => /* @__PURE__ */ u(uo, {
|
|
3727
3897
|
call: e,
|
|
3728
|
-
blocker:
|
|
3898
|
+
blocker: lo(e, t),
|
|
3729
3899
|
selected: e.eventId === a,
|
|
3730
3900
|
onInspect: o,
|
|
3731
3901
|
left: s(e.startedAtMs - n),
|
|
@@ -3733,45 +3903,45 @@ function ro({ row: e, calls: t, origin: n, scale: { spanMs: r, ticks: i }, inspe
|
|
|
3733
3903
|
}, e.eventId))
|
|
3734
3904
|
});
|
|
3735
3905
|
}
|
|
3736
|
-
function
|
|
3906
|
+
function lo(e, t) {
|
|
3737
3907
|
if (e.queueWaitMs) return t.find((t) => t.eventId !== e.eventId && t.startedAtMs + (t.queueWaitMs ?? 0) <= e.startedAtMs && e.startedAtMs < t.startedAtMs + t.durationMs);
|
|
3738
3908
|
}
|
|
3739
|
-
function
|
|
3740
|
-
let o = e.durationMs > 0 ? (e.queueWaitMs ?? 0) / e.durationMs : 0, s =
|
|
3741
|
-
return /* @__PURE__ */ d(
|
|
3909
|
+
function uo({ call: e, blocker: t, selected: n, onInspect: r, left: i, width: a }) {
|
|
3910
|
+
let o = e.durationMs > 0 ? (e.queueWaitMs ?? 0) / e.durationMs : 0, s = oo(e), c = V(e) ?? e.durationMs, l = `${e.operation}, ${e.hostState}${e.queueWaitMs ? `, waited ${D(e.queueWaitMs)}` : ""}, ran ${D(c)}${s ? `, ${qa[e.outcome]}` : ""}`;
|
|
3911
|
+
return /* @__PURE__ */ d(nr, { children: [/* @__PURE__ */ u(rr, {
|
|
3742
3912
|
asChild: !0,
|
|
3743
3913
|
children: /* @__PURE__ */ d("button", {
|
|
3744
3914
|
type: "button",
|
|
3745
3915
|
"aria-pressed": n,
|
|
3746
3916
|
"aria-label": l,
|
|
3747
3917
|
onClick: (t) => r(e, t.currentTarget),
|
|
3748
|
-
className:
|
|
3918
|
+
className: U("group absolute top-1/2 flex h-3 min-w-0.75 -translate-y-1/2 cursor-pointer border-0 bg-transparent p-0 before:absolute before:-inset-y-2 before:inset-x-0", n && "z-10"),
|
|
3749
3919
|
style: {
|
|
3750
3920
|
left: i,
|
|
3751
3921
|
width: a
|
|
3752
3922
|
},
|
|
3753
3923
|
children: [
|
|
3754
|
-
o > 0 && /* @__PURE__ */ u(
|
|
3924
|
+
o > 0 && /* @__PURE__ */ u(Fa, {
|
|
3755
3925
|
className: "h-full rounded-l-[2px]",
|
|
3756
3926
|
style: { width: `${o * 100}%` }
|
|
3757
3927
|
}),
|
|
3758
|
-
/* @__PURE__ */ u("span", { className:
|
|
3928
|
+
/* @__PURE__ */ u("span", { className: U("h-full min-w-0.75 flex-1 rounded-[2px] outline-offset-2 group-hover:outline-2 group-hover:outline-foreground group-focus-visible:outline-2 group-focus-visible:outline-foreground", o > 0 && "rounded-l-none", n && "outline-2 outline-foreground", s ? "bg-danger" : "bg-foreground") }),
|
|
3759
3929
|
s && /* @__PURE__ */ u("span", {
|
|
3760
3930
|
className: "absolute top-1/2 left-full ml-2 -translate-y-1/2 text-[11px] whitespace-nowrap text-danger",
|
|
3761
|
-
children:
|
|
3931
|
+
children: qa[e.outcome]
|
|
3762
3932
|
})
|
|
3763
3933
|
]
|
|
3764
3934
|
})
|
|
3765
|
-
}), /* @__PURE__ */ u(
|
|
3935
|
+
}), /* @__PURE__ */ u(ir, {
|
|
3766
3936
|
className: "tabular-nums",
|
|
3767
|
-
children: /* @__PURE__ */ u(
|
|
3937
|
+
children: /* @__PURE__ */ u(fo, {
|
|
3768
3938
|
call: e,
|
|
3769
3939
|
blocker: t
|
|
3770
3940
|
})
|
|
3771
3941
|
})] });
|
|
3772
3942
|
}
|
|
3773
|
-
function
|
|
3774
|
-
let n =
|
|
3943
|
+
function fo({ call: e, blocker: t }) {
|
|
3944
|
+
let n = V(e) ?? e.durationMs;
|
|
3775
3945
|
return /* @__PURE__ */ d("span", { children: [
|
|
3776
3946
|
/* @__PURE__ */ u("b", {
|
|
3777
3947
|
className: "font-medium capitalize",
|
|
@@ -3804,57 +3974,48 @@ function oo({ call: e, blocker: t }) {
|
|
|
3804
3974
|
className: "font-medium",
|
|
3805
3975
|
children: D(n)
|
|
3806
3976
|
})] }),
|
|
3807
|
-
|
|
3977
|
+
oo(e) && ` · ${qa[e.outcome]}`
|
|
3808
3978
|
] });
|
|
3809
3979
|
}
|
|
3810
|
-
function
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
children: [/* @__PURE__ */ d("span", { children: [
|
|
3815
|
-
O(e.length, "call"),
|
|
3816
|
-
" across ",
|
|
3817
|
-
O(t, "method"),
|
|
3818
|
-
" · ",
|
|
3819
|
-
w(r),
|
|
3820
|
-
" waited in queue",
|
|
3821
|
-
i > 0 && ` · ${O(i, "error")}`
|
|
3822
|
-
] }), e.length < n && /* @__PURE__ */ d("span", { children: [
|
|
3980
|
+
function po({ shown: e, total: t }) {
|
|
3981
|
+
return e >= t ? null : /* @__PURE__ */ d("p", {
|
|
3982
|
+
className: "border-t pt-3 text-xs text-muted-foreground tabular-nums",
|
|
3983
|
+
children: [
|
|
3823
3984
|
"Showing the latest ",
|
|
3824
|
-
|
|
3985
|
+
E(e),
|
|
3825
3986
|
" of ",
|
|
3826
|
-
|
|
3827
|
-
]
|
|
3987
|
+
E(t)
|
|
3988
|
+
]
|
|
3828
3989
|
});
|
|
3829
3990
|
}
|
|
3830
|
-
function
|
|
3991
|
+
function mo() {
|
|
3831
3992
|
return /* @__PURE__ */ d("div", {
|
|
3832
3993
|
className: "mt-3.5 pb-1",
|
|
3833
|
-
children: [/* @__PURE__ */ u(
|
|
3834
|
-
className: `${
|
|
3994
|
+
children: [/* @__PURE__ */ u(G, { className: "h-10 w-full rounded-sm" }), Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ d("div", {
|
|
3995
|
+
className: `${Ka} h-10`,
|
|
3835
3996
|
children: [
|
|
3836
|
-
/* @__PURE__ */ u(
|
|
3837
|
-
/* @__PURE__ */ u(
|
|
3838
|
-
/* @__PURE__ */ u(
|
|
3997
|
+
/* @__PURE__ */ u(G, { className: "h-4" }),
|
|
3998
|
+
/* @__PURE__ */ u(G, { className: "h-3.5 w-28" }),
|
|
3999
|
+
/* @__PURE__ */ u(G, {
|
|
3839
4000
|
className: "h-3 rounded-[2px]",
|
|
3840
4001
|
style: {
|
|
3841
4002
|
width: `${20 + t * 12}%`,
|
|
3842
4003
|
marginLeft: `${t * 14}%`
|
|
3843
4004
|
}
|
|
3844
4005
|
}),
|
|
3845
|
-
/* @__PURE__ */ u(
|
|
3846
|
-
/* @__PURE__ */ u(
|
|
3847
|
-
/* @__PURE__ */ u(
|
|
4006
|
+
/* @__PURE__ */ u(G, { className: "ml-auto h-3.5 w-6" }),
|
|
4007
|
+
/* @__PURE__ */ u(G, { className: "ml-auto h-3.5 w-10" }),
|
|
4008
|
+
/* @__PURE__ */ u(G, { className: "ml-auto h-3.5 w-10" })
|
|
3848
4009
|
]
|
|
3849
4010
|
}, t))]
|
|
3850
4011
|
});
|
|
3851
4012
|
}
|
|
3852
4013
|
//#endregion
|
|
3853
4014
|
//#region src/components/instance/instancePage.tsx
|
|
3854
|
-
function
|
|
3855
|
-
let { actorName: e = "", actorId: t = "" } = _(), { actorTypes: n, isError: r, sessions: i, isSocketsError: a } =
|
|
4015
|
+
function ho() {
|
|
4016
|
+
let { actorName: e = "", actorId: t = "" } = _(), { actorTypes: n, isError: r, sessions: i, isSocketsError: a } = R(), s = L(), { requests: c, isError: l } = Gt(e, t), { residency: f, isError: p } = Xt(e, s), m = n?.actors.find((t) => t.actorName === e)?.instances.find((e) => e.actorId === t) ?? null, h = i?.filter((n) => n.actorName === e && n.actorId === t) ?? null, g = f && (cr(f).get(t) ?? []), [v, y] = o(null);
|
|
3856
4017
|
function ee(e) {
|
|
3857
|
-
y(e), document.getElementById(
|
|
4018
|
+
y(e), document.getElementById(xa)?.scrollIntoView({
|
|
3858
4019
|
behavior: "smooth",
|
|
3859
4020
|
block: "start"
|
|
3860
4021
|
});
|
|
@@ -3862,7 +4023,7 @@ function lo() {
|
|
|
3862
4023
|
return /* @__PURE__ */ d("section", {
|
|
3863
4024
|
"aria-labelledby": "instance-heading",
|
|
3864
4025
|
className: "flex flex-col gap-5",
|
|
3865
|
-
children: [/* @__PURE__ */ u(
|
|
4026
|
+
children: [/* @__PURE__ */ u(go, {
|
|
3866
4027
|
actorName: e,
|
|
3867
4028
|
actorId: t,
|
|
3868
4029
|
instance: m,
|
|
@@ -3884,26 +4045,24 @@ function lo() {
|
|
|
3884
4045
|
/* @__PURE__ */ d("div", {
|
|
3885
4046
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
3886
4047
|
children: [
|
|
3887
|
-
/* @__PURE__ */ u(
|
|
4048
|
+
/* @__PURE__ */ u(ci, {
|
|
3888
4049
|
requests: c,
|
|
3889
4050
|
failed: l,
|
|
3890
4051
|
timeWindow: s,
|
|
3891
4052
|
color: "var(--foreground)"
|
|
3892
4053
|
}),
|
|
3893
|
-
/* @__PURE__ */ u(
|
|
4054
|
+
/* @__PURE__ */ u(wr, {
|
|
3894
4055
|
label: "Avg Queue Wait",
|
|
3895
|
-
|
|
3896
|
-
pick: R,
|
|
4056
|
+
pick: B,
|
|
3897
4057
|
color: "var(--chart-1)",
|
|
3898
4058
|
chartLabel: `Average queue wait, ${M(s)}`,
|
|
3899
4059
|
requests: c,
|
|
3900
4060
|
failed: l,
|
|
3901
4061
|
timeWindow: s
|
|
3902
4062
|
}),
|
|
3903
|
-
/* @__PURE__ */ u(
|
|
4063
|
+
/* @__PURE__ */ u(wr, {
|
|
3904
4064
|
label: "Avg Request Time",
|
|
3905
|
-
|
|
3906
|
-
pick: z,
|
|
4065
|
+
pick: V,
|
|
3907
4066
|
color: "var(--foreground)",
|
|
3908
4067
|
chartLabel: `Average request time excluding the queue, ${M(s)}`,
|
|
3909
4068
|
requests: c,
|
|
@@ -3912,7 +4071,7 @@ function lo() {
|
|
|
3912
4071
|
})
|
|
3913
4072
|
]
|
|
3914
4073
|
}),
|
|
3915
|
-
/* @__PURE__ */ u(
|
|
4074
|
+
/* @__PURE__ */ u(Ya, {
|
|
3916
4075
|
requests: c,
|
|
3917
4076
|
failed: l,
|
|
3918
4077
|
timeWindow: s,
|
|
@@ -3926,7 +4085,7 @@ function lo() {
|
|
|
3926
4085
|
failed: r || a || p,
|
|
3927
4086
|
timeWindow: s
|
|
3928
4087
|
}),
|
|
3929
|
-
/* @__PURE__ */ u(
|
|
4088
|
+
/* @__PURE__ */ u(Ea, {
|
|
3930
4089
|
actorName: e,
|
|
3931
4090
|
actorId: t,
|
|
3932
4091
|
requests: c,
|
|
@@ -3938,9 +4097,9 @@ function lo() {
|
|
|
3938
4097
|
})]
|
|
3939
4098
|
});
|
|
3940
4099
|
}
|
|
3941
|
-
function
|
|
4100
|
+
function go({ actorName: e, actorId: t, instance: n, livePeriods: r, timeWindow: i, loading: a }) {
|
|
3942
4101
|
let o = n?.status === "live";
|
|
3943
|
-
return /* @__PURE__ */ u(
|
|
4102
|
+
return /* @__PURE__ */ u(En, {
|
|
3944
4103
|
titleId: "instance-heading",
|
|
3945
4104
|
title: t,
|
|
3946
4105
|
back: {
|
|
@@ -3948,46 +4107,46 @@ function uo({ actorName: e, actorId: t, instance: n, livePeriods: r, timeWindow:
|
|
|
3948
4107
|
relative: "path",
|
|
3949
4108
|
label: e
|
|
3950
4109
|
},
|
|
3951
|
-
badge: n && /* @__PURE__ */ u(
|
|
3952
|
-
meta: a ? /* @__PURE__ */ u(
|
|
4110
|
+
badge: n && /* @__PURE__ */ u(_o, { live: o }),
|
|
4111
|
+
meta: a ? /* @__PURE__ */ u(G, { className: "h-3.5 w-64" }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", {
|
|
3953
4112
|
translate: "no",
|
|
3954
4113
|
children: e
|
|
3955
4114
|
}), n && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", {
|
|
3956
4115
|
"aria-hidden": !0,
|
|
3957
4116
|
children: "·"
|
|
3958
|
-
}), /* @__PURE__ */ u("span", { children:
|
|
3959
|
-
aside: /* @__PURE__ */ u(
|
|
4117
|
+
}), /* @__PURE__ */ u("span", { children: vo(n, r, i) })] })] }),
|
|
4118
|
+
aside: /* @__PURE__ */ u(wn, {})
|
|
3960
4119
|
});
|
|
3961
4120
|
}
|
|
3962
|
-
function
|
|
3963
|
-
return /* @__PURE__ */ u(
|
|
4121
|
+
function _o({ live: e }) {
|
|
4122
|
+
return /* @__PURE__ */ u(On, {
|
|
3964
4123
|
live: e,
|
|
3965
4124
|
className: e ? "rounded-full border border-success/25 bg-success/15 py-0.75 pr-2.25 pl-2 text-xs font-medium" : "rounded-full border px-2.25 py-0.75 text-xs font-medium",
|
|
3966
4125
|
children: e ? "Live" : "Dormant"
|
|
3967
4126
|
});
|
|
3968
4127
|
}
|
|
3969
|
-
function
|
|
3970
|
-
if (e.status !== "live") return e.lastActiveAtMs ? `Last active ${
|
|
4128
|
+
function vo(e, t, { fromMs: n, toMs: r }) {
|
|
4129
|
+
if (e.status !== "live") return e.lastActiveAtMs ? `Last active ${ft(e.lastActiveAtMs, r)}` : "Dormant";
|
|
3971
4130
|
let i = t?.at(-1)?.fromMs;
|
|
3972
|
-
return i === void 0 ? "Live" : i <= n ? "Live for the whole window" : `Live since ${
|
|
4131
|
+
return i === void 0 ? "Live" : i <= n ? "Live for the whole window" : `Live since ${T(i)} (${k(r - i)})`;
|
|
3973
4132
|
}
|
|
3974
4133
|
//#endregion
|
|
3975
4134
|
//#region src/routes.tsx
|
|
3976
|
-
function
|
|
3977
|
-
return /* @__PURE__ */
|
|
4135
|
+
function yo() {
|
|
4136
|
+
return /* @__PURE__ */ d(oi, { children: [/* @__PURE__ */ u(xo, {}), /* @__PURE__ */ d(h, { children: [
|
|
3978
4137
|
/* @__PURE__ */ u(m, {
|
|
3979
4138
|
index: !0,
|
|
3980
|
-
element: /* @__PURE__ */ u(
|
|
4139
|
+
element: /* @__PURE__ */ u(Xr, {})
|
|
3981
4140
|
}),
|
|
3982
4141
|
/* @__PURE__ */ u(m, {
|
|
3983
4142
|
path: "actors/:actorName",
|
|
3984
|
-
element: /* @__PURE__ */ u(
|
|
4143
|
+
element: /* @__PURE__ */ u(Tr, {})
|
|
3985
4144
|
}),
|
|
3986
4145
|
/* @__PURE__ */ u(m, {
|
|
3987
4146
|
path: "actors/:actorName/instances/:actorId",
|
|
3988
|
-
element: /* @__PURE__ */ u(
|
|
3989
|
-
initialRange:
|
|
3990
|
-
children: /* @__PURE__ */ u(
|
|
4147
|
+
element: /* @__PURE__ */ u(It, {
|
|
4148
|
+
initialRange: vt,
|
|
4149
|
+
children: /* @__PURE__ */ u(ho, {})
|
|
3991
4150
|
})
|
|
3992
4151
|
}),
|
|
3993
4152
|
/* @__PURE__ */ u(m, {
|
|
@@ -3997,7 +4156,22 @@ function mo() {
|
|
|
3997
4156
|
replace: !0
|
|
3998
4157
|
})
|
|
3999
4158
|
})
|
|
4000
|
-
] }) });
|
|
4159
|
+
] })] });
|
|
4160
|
+
}
|
|
4161
|
+
var bo = [
|
|
4162
|
+
"actors",
|
|
4163
|
+
"websockets",
|
|
4164
|
+
"requests"
|
|
4165
|
+
];
|
|
4166
|
+
function xo() {
|
|
4167
|
+
let { pathname: e } = g(), { mutate: t } = c(), n = a(!0);
|
|
4168
|
+
return r(() => {
|
|
4169
|
+
if (n.current) {
|
|
4170
|
+
n.current = !1;
|
|
4171
|
+
return;
|
|
4172
|
+
}
|
|
4173
|
+
t((e) => Array.isArray(e) && bo.includes(e[0]));
|
|
4174
|
+
}, [e, t]), null;
|
|
4001
4175
|
}
|
|
4002
4176
|
//#endregion
|
|
4003
|
-
export {
|
|
4177
|
+
export { Tr as ActorTypePage, Ut as DataProvider, yo as ObserverRoutes, Xr as Overview, It as TimeRangeProvider };
|