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