durable-actors-observer 0.18.5 → 0.18.7
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 +1339 -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: "Actor used more memory than it's 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,29 @@ 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
|
+
busy: !c && !a,
|
|
1716
|
+
className: "pb-3",
|
|
1717
|
+
children: a ? /* @__PURE__ */ u("p", {
|
|
1718
|
+
className: "py-4 text-[13px] text-muted-foreground",
|
|
1719
|
+
children: "Couldn't reach the observer API."
|
|
1720
|
+
}) : c ? /* @__PURE__ */ u(Sr, {
|
|
1721
|
+
events: c,
|
|
1722
|
+
noun: "event",
|
|
1723
|
+
showInstance: !0,
|
|
1724
|
+
expanded: n,
|
|
1725
|
+
onToggle: () => r(!n)
|
|
1726
|
+
}) : /* @__PURE__ */ u(Cr, { showInstance: !0 })
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
//#endregion
|
|
1160
1730
|
//#region src/components/ui/segmentedControl.tsx
|
|
1161
|
-
function
|
|
1731
|
+
function kr({ label: e, options: t, value: n, onChange: r }) {
|
|
1162
1732
|
return /* @__PURE__ */ u("div", {
|
|
1163
1733
|
role: "group",
|
|
1164
1734
|
"aria-label": e,
|
|
@@ -1181,21 +1751,21 @@ function On({ label: e, options: t, value: n, onChange: r }) {
|
|
|
1181
1751
|
}
|
|
1182
1752
|
//#endregion
|
|
1183
1753
|
//#region src/components/actorType/instanceStatus.tsx
|
|
1184
|
-
function
|
|
1754
|
+
function Ar({ live: e, className: t, children: n }) {
|
|
1185
1755
|
return /* @__PURE__ */ d("span", {
|
|
1186
|
-
className:
|
|
1756
|
+
className: V("inline-flex items-center gap-1.25", e ? "text-success" : "text-muted-foreground", t),
|
|
1187
1757
|
children: [e && /* @__PURE__ */ u("span", { className: "size-1.5 rounded-full bg-success" }), n]
|
|
1188
1758
|
});
|
|
1189
1759
|
}
|
|
1190
1760
|
//#endregion
|
|
1191
1761
|
//#region src/components/actorType/instancesCard.tsx
|
|
1192
|
-
var
|
|
1193
|
-
function
|
|
1194
|
-
let [i, a] = o("all"), s = (e &&
|
|
1762
|
+
var jr = 24, Mr = 240;
|
|
1763
|
+
function Nr({ actor: e, requests: t, failed: n, now: r }) {
|
|
1764
|
+
let [i, a] = o("all"), s = (e && tn(e.instances))?.filter((e) => i === "all" || e.status === i) ?? null;
|
|
1195
1765
|
return /* @__PURE__ */ u(K, {
|
|
1196
1766
|
title: "Instances",
|
|
1197
1767
|
description: "Sorted by last active. Number shows open sockets.",
|
|
1198
|
-
aside: e && /* @__PURE__ */ u(
|
|
1768
|
+
aside: e && /* @__PURE__ */ u(Pr, {
|
|
1199
1769
|
actor: e,
|
|
1200
1770
|
value: i,
|
|
1201
1771
|
onChange: a
|
|
@@ -1205,17 +1775,17 @@ function Mn({ actor: e, requests: t, failed: n, now: r }) {
|
|
|
1205
1775
|
children: n ? /* @__PURE__ */ u("p", {
|
|
1206
1776
|
className: "py-4 text-[13px] text-muted-foreground",
|
|
1207
1777
|
children: "Couldn't reach the observer API."
|
|
1208
|
-
}) : e && s ? /* @__PURE__ */ u(
|
|
1778
|
+
}) : e && s ? /* @__PURE__ */ u(Fr, {
|
|
1209
1779
|
actor: e,
|
|
1210
1780
|
instances: s,
|
|
1211
1781
|
requests: t,
|
|
1212
1782
|
now: r
|
|
1213
|
-
}) : /* @__PURE__ */ u(
|
|
1783
|
+
}) : /* @__PURE__ */ u(Vr, {})
|
|
1214
1784
|
});
|
|
1215
1785
|
}
|
|
1216
|
-
function
|
|
1786
|
+
function Pr({ actor: e, value: t, onChange: n }) {
|
|
1217
1787
|
let { total: r, live: i, dormant: a } = z(e);
|
|
1218
|
-
return /* @__PURE__ */ u(
|
|
1788
|
+
return /* @__PURE__ */ u(kr, {
|
|
1219
1789
|
label: "Filter instances",
|
|
1220
1790
|
value: t,
|
|
1221
1791
|
onChange: n,
|
|
@@ -1238,45 +1808,45 @@ function Nn({ actor: e, value: t, onChange: n }) {
|
|
|
1238
1808
|
]
|
|
1239
1809
|
});
|
|
1240
1810
|
}
|
|
1241
|
-
function
|
|
1811
|
+
function Fr({ actor: e, instances: t, requests: n, now: r }) {
|
|
1242
1812
|
let [i, a] = o(null);
|
|
1243
1813
|
if (!t.length) return /* @__PURE__ */ u("p", {
|
|
1244
1814
|
className: "py-4 text-[13px] text-muted-foreground",
|
|
1245
1815
|
children: "No instances match this filter."
|
|
1246
1816
|
});
|
|
1247
|
-
let s = t.slice(0,
|
|
1817
|
+
let s = t.slice(0, Mr);
|
|
1248
1818
|
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("ul", {
|
|
1249
1819
|
"aria-label": `${e.actorName} instances, most recently active first`,
|
|
1250
1820
|
className: "mt-6 grid grid-cols-24 gap-1.5 tabular-nums",
|
|
1251
|
-
children: s.map((e, t) => /* @__PURE__ */ u(
|
|
1821
|
+
children: s.map((e, t) => /* @__PURE__ */ u(Ir, {
|
|
1252
1822
|
instance: e,
|
|
1253
1823
|
active: e.actorId === i,
|
|
1254
|
-
alignRight: t %
|
|
1824
|
+
alignRight: t % jr >= jr / 2,
|
|
1255
1825
|
onActive: a,
|
|
1256
1826
|
requests: n,
|
|
1257
1827
|
now: r
|
|
1258
1828
|
}, e.actorId))
|
|
1259
|
-
}), /* @__PURE__ */ u(
|
|
1829
|
+
}), /* @__PURE__ */ u(zr, {
|
|
1260
1830
|
actor: e,
|
|
1261
1831
|
shown: s.length,
|
|
1262
1832
|
matching: t.length
|
|
1263
1833
|
})] });
|
|
1264
1834
|
}
|
|
1265
|
-
function
|
|
1835
|
+
function Ir({ instance: e, active: t, alignRight: n, onActive: r, requests: a, now: o }) {
|
|
1266
1836
|
let s = i(), c = e.status === "live", l = e.connections.length;
|
|
1267
1837
|
return /* @__PURE__ */ d("li", {
|
|
1268
1838
|
className: "relative",
|
|
1269
1839
|
children: [/* @__PURE__ */ u(f, {
|
|
1270
|
-
to:
|
|
1840
|
+
to: en(e.actorId),
|
|
1271
1841
|
"aria-label": `${e.actorId}, ${e.status}, ${O(l, "open socket")}`,
|
|
1272
1842
|
"aria-describedby": t ? s : void 0,
|
|
1273
1843
|
onMouseEnter: () => r(e.actorId),
|
|
1274
1844
|
onMouseLeave: () => r(null),
|
|
1275
1845
|
onFocus: () => r(e.actorId),
|
|
1276
1846
|
onBlur: () => r(null),
|
|
1277
|
-
className:
|
|
1847
|
+
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
1848
|
children: l > 0 ? E(l) : !c && /* @__PURE__ */ u("span", { className: "size-1 rounded-full bg-muted-foreground/40" })
|
|
1279
|
-
}), t && /* @__PURE__ */ u(
|
|
1849
|
+
}), t && /* @__PURE__ */ u(Lr, {
|
|
1280
1850
|
id: s,
|
|
1281
1851
|
instance: e,
|
|
1282
1852
|
requests: a,
|
|
@@ -1285,12 +1855,12 @@ function Fn({ instance: e, active: t, alignRight: n, onActive: r, requests: a, n
|
|
|
1285
1855
|
})]
|
|
1286
1856
|
});
|
|
1287
1857
|
}
|
|
1288
|
-
function
|
|
1289
|
-
let a = n?.filter((e) => e.actorId === t.actorId) ?? [], o =
|
|
1858
|
+
function Lr({ id: e, instance: t, requests: n, now: r, alignRight: i }) {
|
|
1859
|
+
let a = n?.filter((e) => e.actorId === t.actorId) ?? [], o = dn(a, nn), s = dn(a, B), c = t.status === "live";
|
|
1290
1860
|
return /* @__PURE__ */ d("div", {
|
|
1291
1861
|
id: e,
|
|
1292
1862
|
role: "tooltip",
|
|
1293
|
-
className:
|
|
1863
|
+
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
1864
|
children: [
|
|
1295
1865
|
/* @__PURE__ */ d("div", {
|
|
1296
1866
|
className: "flex items-center justify-between gap-3",
|
|
@@ -1298,32 +1868,32 @@ function In({ id: e, instance: t, requests: n, now: r, alignRight: i }) {
|
|
|
1298
1868
|
translate: "no",
|
|
1299
1869
|
className: "truncate",
|
|
1300
1870
|
children: t.actorId
|
|
1301
|
-
}), /* @__PURE__ */ u(
|
|
1871
|
+
}), /* @__PURE__ */ u(Ar, {
|
|
1302
1872
|
live: c,
|
|
1303
1873
|
className: "text-[11px] font-medium",
|
|
1304
1874
|
children: c ? "Live" : "Dormant"
|
|
1305
1875
|
})]
|
|
1306
1876
|
}),
|
|
1307
|
-
/* @__PURE__ */ u(
|
|
1877
|
+
/* @__PURE__ */ u(Rr, {
|
|
1308
1878
|
label: "Open sockets",
|
|
1309
1879
|
value: E(t.connections.length)
|
|
1310
1880
|
}),
|
|
1311
|
-
/* @__PURE__ */ u(
|
|
1881
|
+
/* @__PURE__ */ u(Rr, {
|
|
1312
1882
|
label: "Avg queue time",
|
|
1313
1883
|
value: o === null ? "—" : D(o)
|
|
1314
1884
|
}),
|
|
1315
|
-
/* @__PURE__ */ u(
|
|
1885
|
+
/* @__PURE__ */ u(Rr, {
|
|
1316
1886
|
label: "Avg latency",
|
|
1317
1887
|
value: s === null ? "—" : D(s)
|
|
1318
1888
|
}),
|
|
1319
|
-
/* @__PURE__ */ u(
|
|
1889
|
+
/* @__PURE__ */ u(Rr, {
|
|
1320
1890
|
label: "Last active",
|
|
1321
|
-
value: t.lastActiveAtMs ?
|
|
1891
|
+
value: t.lastActiveAtMs ? pt(t.lastActiveAtMs, r) : "—"
|
|
1322
1892
|
})
|
|
1323
1893
|
]
|
|
1324
1894
|
});
|
|
1325
1895
|
}
|
|
1326
|
-
function
|
|
1896
|
+
function Rr({ label: e, value: t }) {
|
|
1327
1897
|
return /* @__PURE__ */ d("div", {
|
|
1328
1898
|
className: "mt-1.5 flex justify-between text-muted-foreground",
|
|
1329
1899
|
children: [/* @__PURE__ */ u("span", { children: e }), /* @__PURE__ */ u("b", {
|
|
@@ -1332,17 +1902,17 @@ function Ln({ label: e, value: t }) {
|
|
|
1332
1902
|
})]
|
|
1333
1903
|
});
|
|
1334
1904
|
}
|
|
1335
|
-
function
|
|
1905
|
+
function zr({ actor: e, shown: t, matching: n }) {
|
|
1336
1906
|
let { live: r, dormant: i } = z(e);
|
|
1337
1907
|
return /* @__PURE__ */ d("div", {
|
|
1338
1908
|
className: "mt-4 flex flex-wrap items-center gap-5 text-[13px] text-muted-foreground tabular-nums",
|
|
1339
1909
|
children: [
|
|
1340
|
-
/* @__PURE__ */ u(
|
|
1910
|
+
/* @__PURE__ */ u(Br, {
|
|
1341
1911
|
swatch: "bg-success",
|
|
1342
1912
|
label: "Live",
|
|
1343
1913
|
count: r
|
|
1344
1914
|
}),
|
|
1345
|
-
/* @__PURE__ */ u(
|
|
1915
|
+
/* @__PURE__ */ u(Br, {
|
|
1346
1916
|
swatch: "bg-muted shadow-[inset_0_0_0_1px_var(--border)]",
|
|
1347
1917
|
label: "Dormant",
|
|
1348
1918
|
count: i
|
|
@@ -1356,7 +1926,7 @@ function Rn({ actor: e, shown: t, matching: n }) {
|
|
|
1356
1926
|
]
|
|
1357
1927
|
});
|
|
1358
1928
|
}
|
|
1359
|
-
function
|
|
1929
|
+
function Br({ swatch: e, label: t, count: n }) {
|
|
1360
1930
|
return /* @__PURE__ */ d("span", {
|
|
1361
1931
|
className: "flex items-center gap-1.75",
|
|
1362
1932
|
children: [
|
|
@@ -1370,19 +1940,19 @@ function zn({ swatch: e, label: t, count: n }) {
|
|
|
1370
1940
|
]
|
|
1371
1941
|
});
|
|
1372
1942
|
}
|
|
1373
|
-
function
|
|
1943
|
+
function Vr() {
|
|
1374
1944
|
return /* @__PURE__ */ u("div", {
|
|
1375
1945
|
className: "mt-6 grid grid-cols-24 gap-1.5",
|
|
1376
|
-
children: Array.from({ length: 72 }, (e, t) => /* @__PURE__ */ u(
|
|
1946
|
+
children: Array.from({ length: 72 }, (e, t) => /* @__PURE__ */ u(U, { className: "h-6.5 rounded-[5px]" }, t))
|
|
1377
1947
|
});
|
|
1378
1948
|
}
|
|
1379
1949
|
//#endregion
|
|
1380
1950
|
//#region src/components/ui/residencyBar.tsx
|
|
1381
|
-
function
|
|
1951
|
+
function Hr({ liveShare: e, label: t, pulse: n, className: r, style: i }) {
|
|
1382
1952
|
return /* @__PURE__ */ d("div", {
|
|
1383
1953
|
role: "img",
|
|
1384
1954
|
"aria-label": t,
|
|
1385
|
-
className:
|
|
1955
|
+
className: V("relative flex overflow-hidden", r),
|
|
1386
1956
|
style: i,
|
|
1387
1957
|
children: [/* @__PURE__ */ u("div", {
|
|
1388
1958
|
className: "relative bg-success",
|
|
@@ -1391,27 +1961,27 @@ function Vn({ liveShare: e, label: t, pulse: n, className: r, style: i }) {
|
|
|
1391
1961
|
}), /* @__PURE__ */ u("div", { className: "flex-1 bg-border" })]
|
|
1392
1962
|
});
|
|
1393
1963
|
}
|
|
1394
|
-
function
|
|
1964
|
+
function Ur({ live: e, dormant: t }) {
|
|
1395
1965
|
return /* @__PURE__ */ d("div", {
|
|
1396
1966
|
className: "mt-3 flex justify-between gap-4 text-[13px] tabular-nums",
|
|
1397
|
-
children: [/* @__PURE__ */ u(
|
|
1967
|
+
children: [/* @__PURE__ */ u(Gr, {
|
|
1398
1968
|
swatch: "bg-success",
|
|
1399
1969
|
label: "Live",
|
|
1400
1970
|
count: e
|
|
1401
|
-
}), /* @__PURE__ */ u(
|
|
1971
|
+
}), /* @__PURE__ */ u(Gr, {
|
|
1402
1972
|
swatch: "bg-border",
|
|
1403
1973
|
label: "Dormant",
|
|
1404
1974
|
count: t
|
|
1405
1975
|
})]
|
|
1406
1976
|
});
|
|
1407
1977
|
}
|
|
1408
|
-
function
|
|
1409
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
1978
|
+
function Wr() {
|
|
1979
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(U, { className: "mt-auto h-10 w-full rounded-sm" }), /* @__PURE__ */ d("div", {
|
|
1410
1980
|
className: "mt-3 flex justify-between gap-4",
|
|
1411
|
-
children: [/* @__PURE__ */ u(
|
|
1981
|
+
children: [/* @__PURE__ */ u(U, { className: "h-3.5 w-28" }), /* @__PURE__ */ u(U, { className: "h-3.5 w-28" })]
|
|
1412
1982
|
})] });
|
|
1413
1983
|
}
|
|
1414
|
-
function
|
|
1984
|
+
function Gr({ swatch: e, label: t, count: n }) {
|
|
1415
1985
|
return /* @__PURE__ */ d("span", {
|
|
1416
1986
|
className: "flex items-center gap-1.75 text-muted-foreground",
|
|
1417
1987
|
children: [
|
|
@@ -1427,7 +1997,7 @@ function Wn({ swatch: e, label: t, count: n }) {
|
|
|
1427
1997
|
}
|
|
1428
1998
|
//#endregion
|
|
1429
1999
|
//#region src/components/ui/statCard.tsx
|
|
1430
|
-
function
|
|
2000
|
+
function Kr({ label: e, value: t, unit: n, busy: r, children: a }) {
|
|
1431
2001
|
let o = i();
|
|
1432
2002
|
return /* @__PURE__ */ d("article", {
|
|
1433
2003
|
"aria-labelledby": o,
|
|
@@ -1439,7 +2009,7 @@ function Gn({ label: e, value: t, unit: n, busy: r, children: a }) {
|
|
|
1439
2009
|
className: "truncate text-[13px] font-medium text-muted-foreground",
|
|
1440
2010
|
children: e
|
|
1441
2011
|
}),
|
|
1442
|
-
t !== void 0 && /* @__PURE__ */ u(
|
|
2012
|
+
t !== void 0 && /* @__PURE__ */ u(qr, {
|
|
1443
2013
|
value: t,
|
|
1444
2014
|
unit: n,
|
|
1445
2015
|
className: "mt-3.5"
|
|
@@ -1448,9 +2018,9 @@ function Gn({ label: e, value: t, unit: n, busy: r, children: a }) {
|
|
|
1448
2018
|
]
|
|
1449
2019
|
});
|
|
1450
2020
|
}
|
|
1451
|
-
function
|
|
2021
|
+
function qr({ value: e, unit: t, className: n }) {
|
|
1452
2022
|
return /* @__PURE__ */ d("div", {
|
|
1453
|
-
className:
|
|
2023
|
+
className: V("flex items-baseline gap-2 text-[44px] leading-none font-bold tracking-[-0.035em] tabular-nums", n),
|
|
1454
2024
|
children: [e, t !== void 0 && /* @__PURE__ */ u("div", {
|
|
1455
2025
|
className: "text-[15px] font-medium tracking-normal text-muted-foreground",
|
|
1456
2026
|
children: t
|
|
@@ -1459,64 +2029,46 @@ function Kn({ value: e, unit: t, className: n }) {
|
|
|
1459
2029
|
}
|
|
1460
2030
|
//#endregion
|
|
1461
2031
|
//#region src/components/actorType/liveDormantCard.tsx
|
|
1462
|
-
function
|
|
1463
|
-
return /* @__PURE__ */ u(
|
|
2032
|
+
function Jr({ summary: e, failed: t }) {
|
|
2033
|
+
return /* @__PURE__ */ u(Kr, {
|
|
1464
2034
|
label: "Live & Dormant",
|
|
1465
2035
|
busy: !e && !t,
|
|
1466
|
-
children: e ? /* @__PURE__ */ u(
|
|
2036
|
+
children: e ? /* @__PURE__ */ u(Yr, { ...e }) : /* @__PURE__ */ u(Xr, { failed: t })
|
|
1467
2037
|
});
|
|
1468
2038
|
}
|
|
1469
|
-
function
|
|
2039
|
+
function Yr({ live: e, dormant: t, total: n }) {
|
|
1470
2040
|
let r = n ? e / n : 0;
|
|
1471
2041
|
return /* @__PURE__ */ d(l, { children: [
|
|
1472
2042
|
/* @__PURE__ */ d("div", {
|
|
1473
2043
|
className: "mt-3.5 flex flex-wrap gap-x-10 gap-y-2",
|
|
1474
|
-
children: [/* @__PURE__ */ u(
|
|
2044
|
+
children: [/* @__PURE__ */ u(qr, {
|
|
1475
2045
|
value: E(e),
|
|
1476
2046
|
unit: "live"
|
|
1477
|
-
}), /* @__PURE__ */ u(
|
|
2047
|
+
}), /* @__PURE__ */ u(qr, {
|
|
1478
2048
|
value: E(t),
|
|
1479
2049
|
unit: "dormant",
|
|
1480
2050
|
className: "text-muted-foreground/75"
|
|
1481
2051
|
})]
|
|
1482
2052
|
}),
|
|
1483
|
-
/* @__PURE__ */ u(
|
|
2053
|
+
/* @__PURE__ */ u(Hr, {
|
|
1484
2054
|
liveShare: r,
|
|
1485
|
-
label: `${E(e)} live, ${E(t)} dormant, ${
|
|
2055
|
+
label: `${E(e)} live, ${E(t)} dormant, ${dt(r)} live`,
|
|
1486
2056
|
pulse: !0,
|
|
1487
2057
|
className: "mt-auto h-10 rounded-sm"
|
|
1488
2058
|
}),
|
|
1489
|
-
/* @__PURE__ */ u(
|
|
2059
|
+
/* @__PURE__ */ u(Ur, {})
|
|
1490
2060
|
] });
|
|
1491
2061
|
}
|
|
1492
|
-
function
|
|
2062
|
+
function Xr({ failed: e }) {
|
|
1493
2063
|
return e ? /* @__PURE__ */ u("p", {
|
|
1494
2064
|
className: "mt-3.5 text-[13px] text-muted-foreground",
|
|
1495
2065
|
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
|
-
});
|
|
2066
|
+
}) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(U, { className: "mt-3.5 h-11 w-48 max-w-full" }), /* @__PURE__ */ u(Wr, {})] });
|
|
1515
2067
|
}
|
|
1516
2068
|
//#endregion
|
|
1517
2069
|
//#region src/components/ui/timeline.tsx
|
|
1518
|
-
var
|
|
1519
|
-
function $
|
|
2070
|
+
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)]";
|
|
2071
|
+
function $r({ timeWindow: e, grid: t, label: n, trailing: r }) {
|
|
1520
2072
|
return /* @__PURE__ */ d("div", {
|
|
1521
2073
|
"aria-hidden": !0,
|
|
1522
2074
|
className: `${t} h-6 border-b`,
|
|
@@ -1527,9 +2079,9 @@ function $n({ timeWindow: e, grid: t, label: n, trailing: r }) {
|
|
|
1527
2079
|
}),
|
|
1528
2080
|
/* @__PURE__ */ u("div", {
|
|
1529
2081
|
className: "relative h-full text-[11px] text-muted-foreground tabular-nums",
|
|
1530
|
-
children: N(e,
|
|
1531
|
-
className:
|
|
1532
|
-
style: { left: `${t /
|
|
2082
|
+
children: N(e, Zr).map((e, t) => /* @__PURE__ */ u("span", {
|
|
2083
|
+
className: V("absolute top-1", t === 0 ? "" : t === Zr ? "-translate-x-full text-foreground" : "-translate-x-1/2"),
|
|
2084
|
+
style: { left: `${t / Zr * 100}%` },
|
|
1533
2085
|
children: e
|
|
1534
2086
|
}, t))
|
|
1535
2087
|
}),
|
|
@@ -1540,15 +2092,15 @@ function $n({ timeWindow: e, grid: t, label: n, trailing: r }) {
|
|
|
1540
2092
|
]
|
|
1541
2093
|
});
|
|
1542
2094
|
}
|
|
1543
|
-
function
|
|
2095
|
+
function ei({ label: e, children: t }) {
|
|
1544
2096
|
return /* @__PURE__ */ u("div", {
|
|
1545
2097
|
role: "img",
|
|
1546
2098
|
"aria-label": e,
|
|
1547
|
-
className: `relative h-full ${
|
|
2099
|
+
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
2100
|
children: t
|
|
1549
2101
|
});
|
|
1550
2102
|
}
|
|
1551
|
-
function
|
|
2103
|
+
function ti(e, { fromMs: t, toMs: n }, r) {
|
|
1552
2104
|
let i = n - t, a = (t) => r && t === e.length - 1;
|
|
1553
2105
|
return e.map((e, r) => ({
|
|
1554
2106
|
fromMs: Math.max(e.fromMs, t),
|
|
@@ -1562,42 +2114,42 @@ function tr(e, { fromMs: t, toMs: n }, r) {
|
|
|
1562
2114
|
}
|
|
1563
2115
|
//#endregion
|
|
1564
2116
|
//#region src/components/ui/tooltip.tsx
|
|
1565
|
-
function
|
|
2117
|
+
function ni({ delayDuration: e = 0, ...t }) {
|
|
1566
2118
|
return /* @__PURE__ */ u(x.Provider, {
|
|
1567
2119
|
"data-slot": "tooltip-provider",
|
|
1568
2120
|
delayDuration: e,
|
|
1569
2121
|
...t
|
|
1570
2122
|
});
|
|
1571
2123
|
}
|
|
1572
|
-
function
|
|
1573
|
-
return /* @__PURE__ */ u(
|
|
2124
|
+
function q(e) {
|
|
2125
|
+
return /* @__PURE__ */ u(ni, { children: /* @__PURE__ */ u(x.Root, {
|
|
1574
2126
|
"data-slot": "tooltip",
|
|
1575
2127
|
...e
|
|
1576
2128
|
}) });
|
|
1577
2129
|
}
|
|
1578
|
-
function
|
|
2130
|
+
function J(e) {
|
|
1579
2131
|
return /* @__PURE__ */ u(x.Trigger, {
|
|
1580
2132
|
"data-slot": "tooltip-trigger",
|
|
1581
2133
|
...e
|
|
1582
2134
|
});
|
|
1583
2135
|
}
|
|
1584
|
-
function
|
|
2136
|
+
function Y({ className: e, sideOffset: t = 0, children: n, ...r }) {
|
|
1585
2137
|
return /* @__PURE__ */ u(x.Portal, { children: /* @__PURE__ */ d(x.Content, {
|
|
1586
2138
|
"data-slot": "tooltip-content",
|
|
1587
2139
|
sideOffset: t,
|
|
1588
|
-
className:
|
|
2140
|
+
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
2141
|
...r,
|
|
1590
2142
|
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
2143
|
}) });
|
|
1592
2144
|
}
|
|
1593
2145
|
//#endregion
|
|
1594
2146
|
//#region src/components/actorType/residencyCard.tsx
|
|
1595
|
-
var
|
|
1596
|
-
function
|
|
1597
|
-
let [a, s] = o(!1), c = e &&
|
|
2147
|
+
var ri = 10, ii = "grid grid-cols-[minmax(0,210px)_1fr_minmax(0,128px)] items-center gap-6";
|
|
2148
|
+
function ai({ actor: e, history: t, requests: n, failed: r, timeWindow: i }) {
|
|
2149
|
+
let [a, s] = o(!1), c = e && tn(e.instances), f = t && oi(t), p = a ? c : c?.slice(0, ri);
|
|
1598
2150
|
return /* @__PURE__ */ u(K, {
|
|
1599
2151
|
title: "Residency",
|
|
1600
|
-
aside: /* @__PURE__ */ u(
|
|
2152
|
+
aside: /* @__PURE__ */ u(si, {}),
|
|
1601
2153
|
busy: !p && !r,
|
|
1602
2154
|
className: "pb-3",
|
|
1603
2155
|
children: r ? /* @__PURE__ */ u("p", {
|
|
@@ -1605,18 +2157,18 @@ function cr({ actor: e, history: t, requests: n, failed: r, timeWindow: i }) {
|
|
|
1605
2157
|
children: "Couldn't reach the observer API."
|
|
1606
2158
|
}) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
|
|
1607
2159
|
className: "mt-3.5",
|
|
1608
|
-
children: [/* @__PURE__ */ u($
|
|
2160
|
+
children: [/* @__PURE__ */ u($r, {
|
|
1609
2161
|
timeWindow: i,
|
|
1610
|
-
grid:
|
|
2162
|
+
grid: ii,
|
|
1611
2163
|
label: "Instance",
|
|
1612
2164
|
trailing: "Time live"
|
|
1613
|
-
}), p && f ? p.map((e) => /* @__PURE__ */ u(
|
|
2165
|
+
}), p && f ? p.map((e) => /* @__PURE__ */ u(ci, {
|
|
1614
2166
|
instance: e,
|
|
1615
2167
|
periods: f.get(e.actorId) ?? [],
|
|
1616
2168
|
requests: n && n.filter((t) => t.actorId === e.actorId),
|
|
1617
2169
|
timeWindow: i
|
|
1618
|
-
}, e.actorId)) : /* @__PURE__ */ u(
|
|
1619
|
-
}), c && /* @__PURE__ */ u(
|
|
2170
|
+
}, e.actorId)) : /* @__PURE__ */ u(pi, {})]
|
|
2171
|
+
}), c && /* @__PURE__ */ u(Rn, {
|
|
1620
2172
|
shown: p?.length ?? 0,
|
|
1621
2173
|
total: c.length,
|
|
1622
2174
|
noun: "instance",
|
|
@@ -1626,12 +2178,12 @@ function cr({ actor: e, history: t, requests: n, failed: r, timeWindow: i }) {
|
|
|
1626
2178
|
})] })
|
|
1627
2179
|
});
|
|
1628
2180
|
}
|
|
1629
|
-
function
|
|
2181
|
+
function oi({ periods: e }) {
|
|
1630
2182
|
let t = /* @__PURE__ */ new Map();
|
|
1631
2183
|
for (let n of e) n.status === "live" && t.set(n.actorId, [...t.get(n.actorId) ?? [], n]);
|
|
1632
2184
|
return t;
|
|
1633
2185
|
}
|
|
1634
|
-
function
|
|
2186
|
+
function si() {
|
|
1635
2187
|
return /* @__PURE__ */ d("div", {
|
|
1636
2188
|
className: "flex gap-4.5 text-xs text-muted-foreground",
|
|
1637
2189
|
children: [/* @__PURE__ */ d("span", {
|
|
@@ -1643,17 +2195,17 @@ function ur() {
|
|
|
1643
2195
|
})]
|
|
1644
2196
|
});
|
|
1645
2197
|
}
|
|
1646
|
-
function
|
|
1647
|
-
let i = e.status === "live", a =
|
|
2198
|
+
function ci({ instance: e, periods: t, requests: n, timeWindow: r }) {
|
|
2199
|
+
let i = e.status === "live", a = ti(t, r, i && r.live), o = li(a);
|
|
1648
2200
|
return /* @__PURE__ */ d(f, {
|
|
1649
|
-
to:
|
|
1650
|
-
className: `${
|
|
2201
|
+
to: en(e.actorId),
|
|
2202
|
+
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
2203
|
children: [
|
|
1652
2204
|
/* @__PURE__ */ d("div", {
|
|
1653
2205
|
className: "flex min-w-0 items-center gap-2.5",
|
|
1654
2206
|
children: [/* @__PURE__ */ u("span", {
|
|
1655
2207
|
"aria-hidden": !0,
|
|
1656
|
-
className:
|
|
2208
|
+
className: V("size-2 shrink-0 rounded-full", i ? "bg-success" : "border border-muted-foreground/50")
|
|
1657
2209
|
}), /* @__PURE__ */ d("div", {
|
|
1658
2210
|
className: "min-w-0",
|
|
1659
2211
|
children: [/* @__PURE__ */ u("b", {
|
|
@@ -1662,26 +2214,26 @@ function dr({ instance: e, periods: t, requests: n, timeWindow: r }) {
|
|
|
1662
2214
|
children: e.actorId
|
|
1663
2215
|
}), /* @__PURE__ */ u("span", {
|
|
1664
2216
|
className: "mt-0.5 block truncate text-[11px] text-muted-foreground tabular-nums",
|
|
1665
|
-
children:
|
|
2217
|
+
children: ui(i, t, e, r.fromMs)
|
|
1666
2218
|
})]
|
|
1667
2219
|
})]
|
|
1668
2220
|
}),
|
|
1669
|
-
/* @__PURE__ */ u(
|
|
2221
|
+
/* @__PURE__ */ u(di, {
|
|
1670
2222
|
segments: a,
|
|
1671
2223
|
requests: n,
|
|
1672
2224
|
label: `${e.actorId}: ${o ? `live ${k(o)}` : "dormant"}, ${M(r)}`
|
|
1673
2225
|
}),
|
|
1674
2226
|
/* @__PURE__ */ u("span", {
|
|
1675
|
-
className:
|
|
2227
|
+
className: V("text-right text-[13px] tabular-nums", o ? "text-foreground/85" : "text-muted-foreground"),
|
|
1676
2228
|
children: k(o)
|
|
1677
2229
|
})
|
|
1678
2230
|
]
|
|
1679
2231
|
});
|
|
1680
2232
|
}
|
|
1681
|
-
function
|
|
2233
|
+
function li(e) {
|
|
1682
2234
|
return e.reduce((e, t) => e + t.toMs - t.fromMs, 0);
|
|
1683
2235
|
}
|
|
1684
|
-
function
|
|
2236
|
+
function ui(e, t, n, r) {
|
|
1685
2237
|
if (e) {
|
|
1686
2238
|
let e = t.at(-1)?.fromMs;
|
|
1687
2239
|
return e && e > r ? `Woke ${T(e)}` : "Live";
|
|
@@ -1689,31 +2241,31 @@ function pr(e, t, n, r) {
|
|
|
1689
2241
|
let i = t.at(-1)?.toMs ?? n.lastActiveAtMs;
|
|
1690
2242
|
return i ? `Slept ${T(i)}` : "Dormant";
|
|
1691
2243
|
}
|
|
1692
|
-
function
|
|
1693
|
-
return /* @__PURE__ */ u(
|
|
2244
|
+
function di({ segments: e, requests: t, label: n }) {
|
|
2245
|
+
return /* @__PURE__ */ u(ei, {
|
|
1694
2246
|
label: n,
|
|
1695
|
-
children: e.map((e) => /* @__PURE__ */ u(
|
|
2247
|
+
children: e.map((e) => /* @__PURE__ */ u(fi, {
|
|
1696
2248
|
segment: e,
|
|
1697
2249
|
requests: t
|
|
1698
2250
|
}, e.left))
|
|
1699
2251
|
});
|
|
1700
2252
|
}
|
|
1701
|
-
function
|
|
1702
|
-
let n = t &&
|
|
1703
|
-
return /* @__PURE__ */ d(
|
|
2253
|
+
function fi({ segment: e, requests: t }) {
|
|
2254
|
+
let n = t && cn(t, e);
|
|
2255
|
+
return /* @__PURE__ */ d(q, { children: [/* @__PURE__ */ u(J, {
|
|
1704
2256
|
asChild: !0,
|
|
1705
2257
|
children: /* @__PURE__ */ u("span", {
|
|
1706
|
-
className:
|
|
2258
|
+
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
2259
|
style: {
|
|
1708
2260
|
left: `${e.left * 100}%`,
|
|
1709
2261
|
width: `${e.width * 100}%`
|
|
1710
2262
|
}
|
|
1711
2263
|
})
|
|
1712
|
-
}), /* @__PURE__ */ d(
|
|
2264
|
+
}), /* @__PURE__ */ d(Y, {
|
|
1713
2265
|
className: "tabular-nums",
|
|
1714
2266
|
children: [/* @__PURE__ */ u("div", {
|
|
1715
2267
|
className: "font-medium",
|
|
1716
|
-
children:
|
|
2268
|
+
children: ct(e.fromMs, e.toMs)
|
|
1717
2269
|
}), /* @__PURE__ */ d("div", {
|
|
1718
2270
|
className: "mt-1 opacity-80",
|
|
1719
2271
|
children: [
|
|
@@ -1725,32 +2277,32 @@ function hr({ segment: e, requests: t }) {
|
|
|
1725
2277
|
})]
|
|
1726
2278
|
})] });
|
|
1727
2279
|
}
|
|
1728
|
-
function
|
|
2280
|
+
function pi() {
|
|
1729
2281
|
return Array.from({ length: 4 }, (e, t) => /* @__PURE__ */ d("div", {
|
|
1730
|
-
className: `${
|
|
2282
|
+
className: `${ii} h-11.5 border-b border-border/50 last:border-b-0`,
|
|
1731
2283
|
children: [
|
|
1732
2284
|
/* @__PURE__ */ d("div", {
|
|
1733
2285
|
className: "flex items-center gap-2.5",
|
|
1734
|
-
children: [/* @__PURE__ */ u(
|
|
2286
|
+
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
2287
|
}),
|
|
1736
|
-
/* @__PURE__ */ u(
|
|
2288
|
+
/* @__PURE__ */ u(U, {
|
|
1737
2289
|
className: "h-2.5 rounded-full",
|
|
1738
2290
|
style: { width: `${70 - t * 15}%` }
|
|
1739
2291
|
}),
|
|
1740
|
-
/* @__PURE__ */ u(
|
|
2292
|
+
/* @__PURE__ */ u(U, { className: "ml-auto h-3.5 w-12" })
|
|
1741
2293
|
]
|
|
1742
2294
|
}, t));
|
|
1743
2295
|
}
|
|
1744
2296
|
//#endregion
|
|
1745
2297
|
//#region src/components/ui/sparkline.tsx
|
|
1746
|
-
var
|
|
1747
|
-
function
|
|
1748
|
-
let a = i(), [s, c] = o(null), l =
|
|
2298
|
+
var X = 300, Z = 64, mi = 8;
|
|
2299
|
+
function hi({ values: e, color: t, label: n, describePoint: r }) {
|
|
2300
|
+
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
2301
|
return /* @__PURE__ */ d("div", {
|
|
1750
2302
|
className: "relative mt-auto h-16 w-full",
|
|
1751
2303
|
children: [
|
|
1752
2304
|
/* @__PURE__ */ d("svg", {
|
|
1753
|
-
viewBox: `0 0 ${
|
|
2305
|
+
viewBox: `0 0 ${X} ${Z}`,
|
|
1754
2306
|
preserveAspectRatio: "none",
|
|
1755
2307
|
role: "img",
|
|
1756
2308
|
"aria-label": n,
|
|
@@ -1779,13 +2331,13 @@ function vr({ values: e, color: t, label: n, describePoint: r }) {
|
|
|
1779
2331
|
/* @__PURE__ */ u("line", {
|
|
1780
2332
|
x1: "0",
|
|
1781
2333
|
y1: 63.5,
|
|
1782
|
-
x2:
|
|
2334
|
+
x2: X,
|
|
1783
2335
|
y2: 63.5,
|
|
1784
2336
|
className: "stroke-border",
|
|
1785
2337
|
vectorEffect: "non-scaling-stroke"
|
|
1786
2338
|
}),
|
|
1787
2339
|
/* @__PURE__ */ u("path", {
|
|
1788
|
-
d: `${f} L${
|
|
2340
|
+
d: `${f} L${X},${Z} L0,${Z} Z`,
|
|
1789
2341
|
fill: `url(#${a})`
|
|
1790
2342
|
}),
|
|
1791
2343
|
/* @__PURE__ */ u("path", {
|
|
@@ -1800,46 +2352,46 @@ function vr({ values: e, color: t, label: n, describePoint: r }) {
|
|
|
1800
2352
|
x1: p.x,
|
|
1801
2353
|
x2: p.x,
|
|
1802
2354
|
y1: 0,
|
|
1803
|
-
y2:
|
|
2355
|
+
y2: Z,
|
|
1804
2356
|
className: "stroke-muted-foreground/50",
|
|
1805
2357
|
strokeDasharray: "2 2",
|
|
1806
2358
|
vectorEffect: "non-scaling-stroke"
|
|
1807
2359
|
})
|
|
1808
2360
|
]
|
|
1809
2361
|
}),
|
|
1810
|
-
p && /* @__PURE__ */ u(
|
|
2362
|
+
p && /* @__PURE__ */ u(gi, {
|
|
1811
2363
|
point: p,
|
|
1812
2364
|
color: t
|
|
1813
2365
|
}),
|
|
1814
|
-
r && l.map((e, t) => /* @__PURE__ */ u(
|
|
1815
|
-
style:
|
|
2366
|
+
r && l.map((e, t) => /* @__PURE__ */ u(_i, {
|
|
2367
|
+
style: yi(t, l.length),
|
|
1816
2368
|
point: r(t),
|
|
1817
2369
|
onOpenChange: (e) => c((n) => e ? t : n === t ? null : n)
|
|
1818
2370
|
}, t))
|
|
1819
2371
|
]
|
|
1820
2372
|
});
|
|
1821
2373
|
}
|
|
1822
|
-
function
|
|
2374
|
+
function gi({ point: e, color: t }) {
|
|
1823
2375
|
return /* @__PURE__ */ u("span", {
|
|
1824
2376
|
"aria-hidden": !0,
|
|
1825
2377
|
className: "pointer-events-none absolute size-2 -translate-1/2 rounded-full border-2 border-background",
|
|
1826
2378
|
style: {
|
|
1827
|
-
left: `${e.x /
|
|
1828
|
-
top: `${e.y /
|
|
2379
|
+
left: `${e.x / X * 100}%`,
|
|
2380
|
+
top: `${e.y / Z * 100}%`,
|
|
1829
2381
|
backgroundColor: t
|
|
1830
2382
|
}
|
|
1831
2383
|
});
|
|
1832
2384
|
}
|
|
1833
|
-
function
|
|
1834
|
-
return /* @__PURE__ */ d(
|
|
2385
|
+
function _i({ style: e, point: t, onOpenChange: n }) {
|
|
2386
|
+
return /* @__PURE__ */ d(q, {
|
|
1835
2387
|
onOpenChange: n,
|
|
1836
|
-
children: [/* @__PURE__ */ u(
|
|
2388
|
+
children: [/* @__PURE__ */ u(J, {
|
|
1837
2389
|
asChild: !0,
|
|
1838
2390
|
children: /* @__PURE__ */ u("span", {
|
|
1839
2391
|
className: "absolute inset-y-0",
|
|
1840
2392
|
style: e
|
|
1841
2393
|
})
|
|
1842
|
-
}), /* @__PURE__ */ d(
|
|
2394
|
+
}), /* @__PURE__ */ d(Y, {
|
|
1843
2395
|
className: "tabular-nums",
|
|
1844
2396
|
children: [/* @__PURE__ */ u("div", {
|
|
1845
2397
|
className: "opacity-80",
|
|
@@ -1851,14 +2403,14 @@ function br({ style: e, point: t, onOpenChange: n }) {
|
|
|
1851
2403
|
})]
|
|
1852
2404
|
});
|
|
1853
2405
|
}
|
|
1854
|
-
function
|
|
1855
|
-
let t = Math.min(...e), n = Math.max(...e) - t || 1, r =
|
|
2406
|
+
function vi(e) {
|
|
2407
|
+
let t = Math.min(...e), n = Math.max(...e) - t || 1, r = X / Math.max(e.length - 1, 1);
|
|
1856
2408
|
return e.map((e, i) => ({
|
|
1857
2409
|
x: i * r,
|
|
1858
|
-
y:
|
|
2410
|
+
y: mi + (1 - (e - t) / n) * 40
|
|
1859
2411
|
}));
|
|
1860
2412
|
}
|
|
1861
|
-
function
|
|
2413
|
+
function yi(e, t) {
|
|
1862
2414
|
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
2415
|
return {
|
|
1864
2416
|
left: `${i * 100}%`,
|
|
@@ -1867,16 +2419,16 @@ function Sr(e, t) {
|
|
|
1867
2419
|
}
|
|
1868
2420
|
//#endregion
|
|
1869
2421
|
//#region src/components/ui/trendCard.tsx
|
|
1870
|
-
function
|
|
1871
|
-
return /* @__PURE__ */ d(
|
|
2422
|
+
function bi({ label: e, value: t, unit: n, busy: r, failed: i, series: a, axis: o, color: s, chartLabel: c, describePoint: f }) {
|
|
2423
|
+
return /* @__PURE__ */ d(Kr, {
|
|
1872
2424
|
label: e,
|
|
1873
2425
|
value: t,
|
|
1874
|
-
unit: r ? /* @__PURE__ */ u(
|
|
2426
|
+
unit: r ? /* @__PURE__ */ u(U, { className: "h-3.5 w-9" }) : n,
|
|
1875
2427
|
busy: r,
|
|
1876
2428
|
children: [i && /* @__PURE__ */ u("p", {
|
|
1877
2429
|
className: "mt-2 text-[13px] text-muted-foreground",
|
|
1878
2430
|
children: "Couldn't reach the observer API."
|
|
1879
|
-
}), r ? /* @__PURE__ */ u(
|
|
2431
|
+
}), r ? /* @__PURE__ */ u(xi, { ticks: o.length }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(hi, {
|
|
1880
2432
|
values: a,
|
|
1881
2433
|
color: s,
|
|
1882
2434
|
label: c,
|
|
@@ -1887,17 +2439,17 @@ function Cr({ label: e, value: t, unit: n, busy: r, failed: i, series: a, axis:
|
|
|
1887
2439
|
})] })]
|
|
1888
2440
|
});
|
|
1889
2441
|
}
|
|
1890
|
-
function
|
|
1891
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
2442
|
+
function xi({ ticks: e }) {
|
|
2443
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(U, { className: "mt-auto h-16 w-full rounded-sm" }), /* @__PURE__ */ u("div", {
|
|
1892
2444
|
className: "mt-1.5 flex h-4 items-center justify-between",
|
|
1893
|
-
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ u(
|
|
2445
|
+
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ u(U, { className: "h-3 w-9" }, t))
|
|
1894
2446
|
})] });
|
|
1895
2447
|
}
|
|
1896
2448
|
//#endregion
|
|
1897
2449
|
//#region src/components/actorType/timingCard.tsx
|
|
1898
|
-
function
|
|
1899
|
-
let s = i &&
|
|
1900
|
-
return /* @__PURE__ */ u(
|
|
2450
|
+
function Si({ label: e, pick: t, color: n, chartLabel: r, requests: i, failed: a, timeWindow: o }) {
|
|
2451
|
+
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);
|
|
2452
|
+
return /* @__PURE__ */ u(bi, {
|
|
1901
2453
|
label: e,
|
|
1902
2454
|
value: f,
|
|
1903
2455
|
unit: d,
|
|
@@ -1908,19 +2460,19 @@ function Tr({ label: e, pick: t, color: n, chartLabel: r, requests: i, failed: a
|
|
|
1908
2460
|
color: n,
|
|
1909
2461
|
chartLabel: r,
|
|
1910
2462
|
describePoint: (e) => ({
|
|
1911
|
-
at:
|
|
2463
|
+
at: Tt(o, e),
|
|
1912
2464
|
value: D(p[e] ?? 0)
|
|
1913
2465
|
})
|
|
1914
2466
|
});
|
|
1915
2467
|
}
|
|
1916
2468
|
//#endregion
|
|
1917
2469
|
//#region src/components/actorType/actorTypePage.tsx
|
|
1918
|
-
function
|
|
1919
|
-
let { actorName: e = "" } = _(), { actorTypes: t, isError: n } = R(), r = L(), { requests: i, isError: a } =
|
|
2470
|
+
function Ci() {
|
|
2471
|
+
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
2472
|
return /* @__PURE__ */ d("section", {
|
|
1921
2473
|
"aria-labelledby": "actor-type-heading",
|
|
1922
2474
|
className: "flex flex-col gap-5",
|
|
1923
|
-
children: [/* @__PURE__ */ u(
|
|
2475
|
+
children: [/* @__PURE__ */ u(wi, {
|
|
1924
2476
|
actorName: e,
|
|
1925
2477
|
actor: c,
|
|
1926
2478
|
loading: !t && !n
|
|
@@ -1937,22 +2489,22 @@ function Er() {
|
|
|
1937
2489
|
/* @__PURE__ */ d("div", {
|
|
1938
2490
|
className: "grid gap-4 lg:grid-cols-3",
|
|
1939
2491
|
children: [
|
|
1940
|
-
/* @__PURE__ */ u(
|
|
2492
|
+
/* @__PURE__ */ u(Jr, {
|
|
1941
2493
|
summary: c && z(c),
|
|
1942
2494
|
failed: n
|
|
1943
2495
|
}),
|
|
1944
|
-
/* @__PURE__ */ u(
|
|
2496
|
+
/* @__PURE__ */ u(Si, {
|
|
1945
2497
|
label: "Avg Queue Time",
|
|
1946
|
-
pick:
|
|
2498
|
+
pick: nn,
|
|
1947
2499
|
color: "var(--chart-1)",
|
|
1948
2500
|
chartLabel: `Average queue time, ${M(r)}`,
|
|
1949
2501
|
requests: i,
|
|
1950
2502
|
failed: a,
|
|
1951
2503
|
timeWindow: r
|
|
1952
2504
|
}),
|
|
1953
|
-
/* @__PURE__ */ u(
|
|
2505
|
+
/* @__PURE__ */ u(Si, {
|
|
1954
2506
|
label: "Avg Request Latency",
|
|
1955
|
-
pick:
|
|
2507
|
+
pick: B,
|
|
1956
2508
|
color: "var(--chart-2)",
|
|
1957
2509
|
chartLabel: `Average request latency, ${M(r)}`,
|
|
1958
2510
|
requests: i,
|
|
@@ -1961,91 +2513,95 @@ function Er() {
|
|
|
1961
2513
|
})
|
|
1962
2514
|
]
|
|
1963
2515
|
}),
|
|
1964
|
-
/* @__PURE__ */ u(
|
|
2516
|
+
/* @__PURE__ */ u(Nr, {
|
|
1965
2517
|
actor: c,
|
|
1966
2518
|
requests: i,
|
|
1967
2519
|
failed: n,
|
|
1968
2520
|
now: r.toMs
|
|
1969
2521
|
}),
|
|
1970
|
-
/* @__PURE__ */ u(
|
|
2522
|
+
/* @__PURE__ */ u(ai, {
|
|
1971
2523
|
actor: c,
|
|
1972
2524
|
history: o,
|
|
1973
2525
|
requests: i,
|
|
1974
2526
|
failed: n || s,
|
|
1975
2527
|
timeWindow: r
|
|
2528
|
+
}),
|
|
2529
|
+
/* @__PURE__ */ u(Or, {
|
|
2530
|
+
actorName: e,
|
|
2531
|
+
timeWindow: r
|
|
1976
2532
|
})
|
|
1977
2533
|
]
|
|
1978
2534
|
})]
|
|
1979
2535
|
});
|
|
1980
2536
|
}
|
|
1981
|
-
function
|
|
1982
|
-
return /* @__PURE__ */ u(
|
|
2537
|
+
function wi({ actorName: e, actor: t, loading: n }) {
|
|
2538
|
+
return /* @__PURE__ */ u(An, {
|
|
1983
2539
|
titleId: "actor-type-heading",
|
|
1984
2540
|
title: e,
|
|
1985
2541
|
back: {
|
|
1986
2542
|
to: "..",
|
|
1987
2543
|
label: "Overview"
|
|
1988
2544
|
},
|
|
1989
|
-
meta: t ? `Actor type · ${O(t.instances.length, "instance")}` : n ? /* @__PURE__ */ u(
|
|
1990
|
-
aside: /* @__PURE__ */ u(
|
|
2545
|
+
meta: t ? `Actor type · ${O(t.instances.length, "instance")}` : n ? /* @__PURE__ */ u(U, { className: "h-3.5 w-40" }) : "Actor type",
|
|
2546
|
+
aside: /* @__PURE__ */ u(On, {})
|
|
1991
2547
|
});
|
|
1992
2548
|
}
|
|
1993
2549
|
//#endregion
|
|
1994
2550
|
//#region src/components/overview/activeActorsCard.tsx
|
|
1995
|
-
function
|
|
1996
|
-
let { actorTypes: e, isError: t } = R(), n = e &&
|
|
1997
|
-
return /* @__PURE__ */ u(
|
|
2551
|
+
function Ti() {
|
|
2552
|
+
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" }) : "—";
|
|
2553
|
+
return /* @__PURE__ */ u(Kr, {
|
|
1998
2554
|
label: "Active Actors",
|
|
1999
2555
|
value: i,
|
|
2000
|
-
unit: r ? /* @__PURE__ */ u(
|
|
2556
|
+
unit: r ? /* @__PURE__ */ u(U, { className: "h-3.5 w-7" }) : "live",
|
|
2001
2557
|
busy: r,
|
|
2002
|
-
children: n ? /* @__PURE__ */ u(
|
|
2558
|
+
children: n ? /* @__PURE__ */ u(Di, { ...n }) : /* @__PURE__ */ u(Oi, { failed: t })
|
|
2003
2559
|
});
|
|
2004
2560
|
}
|
|
2005
|
-
function
|
|
2561
|
+
function Ei(e) {
|
|
2006
2562
|
let t = e.actors.flatMap((e) => e.instances);
|
|
2007
2563
|
return {
|
|
2008
2564
|
live: t.filter((e) => e.status === "live").length,
|
|
2009
2565
|
dormant: t.filter((e) => e.status === "dormant").length
|
|
2010
2566
|
};
|
|
2011
2567
|
}
|
|
2012
|
-
function
|
|
2568
|
+
function Di({ live: e, dormant: t }) {
|
|
2013
2569
|
let n = e + t, r = n ? e / n : 0;
|
|
2014
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
2570
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(Hr, {
|
|
2015
2571
|
liveShare: r,
|
|
2016
2572
|
label: `${E(e)} live actors, ${E(t)} dormant actors`,
|
|
2017
2573
|
pulse: !0,
|
|
2018
2574
|
className: "mt-auto h-10 rounded-sm"
|
|
2019
|
-
}), /* @__PURE__ */ u(
|
|
2575
|
+
}), /* @__PURE__ */ u(Ur, {
|
|
2020
2576
|
live: e,
|
|
2021
2577
|
dormant: t
|
|
2022
2578
|
})] });
|
|
2023
2579
|
}
|
|
2024
|
-
function
|
|
2580
|
+
function Oi({ failed: e }) {
|
|
2025
2581
|
return e ? /* @__PURE__ */ u("p", {
|
|
2026
2582
|
className: "mt-2 text-[13px] text-muted-foreground",
|
|
2027
2583
|
children: "Couldn't reach the observer API."
|
|
2028
|
-
}) : /* @__PURE__ */ u(
|
|
2584
|
+
}) : /* @__PURE__ */ u(Wr, {});
|
|
2029
2585
|
}
|
|
2030
2586
|
//#endregion
|
|
2031
2587
|
//#region src/components/overview/actorTypesCard.tsx
|
|
2032
|
-
function
|
|
2588
|
+
function ki() {
|
|
2033
2589
|
let { actorTypes: e, isError: t } = R(), n = e && e.actors.map(z).sort((e, t) => t.total - e.total);
|
|
2034
2590
|
return /* @__PURE__ */ u(K, {
|
|
2035
2591
|
title: "Actor Types",
|
|
2036
|
-
aside: /* @__PURE__ */ u(
|
|
2592
|
+
aside: /* @__PURE__ */ u(Ai, {}),
|
|
2037
2593
|
busy: !n && !t,
|
|
2038
2594
|
className: "pb-2.5",
|
|
2039
2595
|
children: /* @__PURE__ */ u("div", {
|
|
2040
2596
|
className: "mt-1.5",
|
|
2041
|
-
children: /* @__PURE__ */ u(
|
|
2597
|
+
children: /* @__PURE__ */ u(ji, {
|
|
2042
2598
|
rows: n,
|
|
2043
2599
|
failed: t
|
|
2044
2600
|
})
|
|
2045
2601
|
})
|
|
2046
2602
|
});
|
|
2047
2603
|
}
|
|
2048
|
-
function
|
|
2604
|
+
function Ai() {
|
|
2049
2605
|
return /* @__PURE__ */ d("div", {
|
|
2050
2606
|
className: "flex gap-4 text-xs text-muted-foreground",
|
|
2051
2607
|
children: [/* @__PURE__ */ d("span", {
|
|
@@ -2057,30 +2613,30 @@ function Nr() {
|
|
|
2057
2613
|
})]
|
|
2058
2614
|
});
|
|
2059
2615
|
}
|
|
2060
|
-
function
|
|
2616
|
+
function ji({ rows: e, failed: t }) {
|
|
2061
2617
|
if (t) return /* @__PURE__ */ u("p", {
|
|
2062
2618
|
className: "py-4 text-[13px] text-muted-foreground",
|
|
2063
2619
|
children: "Couldn't reach the observer API."
|
|
2064
2620
|
});
|
|
2065
|
-
if (!e) return /* @__PURE__ */ u(
|
|
2621
|
+
if (!e) return /* @__PURE__ */ u(Ii, {});
|
|
2066
2622
|
if (!e.length) return /* @__PURE__ */ u("p", {
|
|
2067
2623
|
className: "py-4 text-[13px] text-muted-foreground",
|
|
2068
2624
|
children: "No actor types deployed yet."
|
|
2069
2625
|
});
|
|
2070
2626
|
let n = Math.max(...e.map((e) => e.total), 1);
|
|
2071
|
-
return /* @__PURE__ */ u("ul", { children: e.map((e) => /* @__PURE__ */ u(
|
|
2627
|
+
return /* @__PURE__ */ u("ul", { children: e.map((e) => /* @__PURE__ */ u(Pi, {
|
|
2072
2628
|
row: e,
|
|
2073
2629
|
largest: n
|
|
2074
2630
|
}, e.actorName)) });
|
|
2075
2631
|
}
|
|
2076
|
-
var
|
|
2077
|
-
function
|
|
2632
|
+
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";
|
|
2633
|
+
function Pi({ row: e, largest: t }) {
|
|
2078
2634
|
let n = e.total ? e.live / e.total : 0;
|
|
2079
2635
|
return /* @__PURE__ */ u("li", {
|
|
2080
|
-
className:
|
|
2636
|
+
className: Ni,
|
|
2081
2637
|
children: /* @__PURE__ */ d(f, {
|
|
2082
|
-
to:
|
|
2083
|
-
className: `${
|
|
2638
|
+
to: $t(e.actorName),
|
|
2639
|
+
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
2640
|
children: [
|
|
2085
2641
|
/* @__PURE__ */ d("div", {
|
|
2086
2642
|
className: "min-w-0",
|
|
@@ -2093,7 +2649,7 @@ function Lr({ row: e, largest: t }) {
|
|
|
2093
2649
|
children: O(e.total, "instance")
|
|
2094
2650
|
})]
|
|
2095
2651
|
}),
|
|
2096
|
-
/* @__PURE__ */ u(
|
|
2652
|
+
/* @__PURE__ */ u(Fi, {
|
|
2097
2653
|
row: e,
|
|
2098
2654
|
liveShare: n,
|
|
2099
2655
|
width: e.total / t
|
|
@@ -2118,42 +2674,42 @@ function Lr({ row: e, largest: t }) {
|
|
|
2118
2674
|
})
|
|
2119
2675
|
});
|
|
2120
2676
|
}
|
|
2121
|
-
function
|
|
2677
|
+
function Fi({ row: e, liveShare: t, width: n }) {
|
|
2122
2678
|
return /* @__PURE__ */ u("div", {
|
|
2123
2679
|
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(
|
|
2680
|
+
children: /* @__PURE__ */ u(Hr, {
|
|
2125
2681
|
liveShare: t,
|
|
2126
|
-
label: `${E(e.live)} of ${E(e.total)} live, ${
|
|
2682
|
+
label: `${E(e.live)} of ${E(e.total)} live, ${dt(t)}`,
|
|
2127
2683
|
className: "h-5.5 min-w-2.5 rounded-[3px]",
|
|
2128
2684
|
style: { width: `${n * 100}%` }
|
|
2129
2685
|
})
|
|
2130
2686
|
});
|
|
2131
2687
|
}
|
|
2132
|
-
function
|
|
2688
|
+
function Ii() {
|
|
2133
2689
|
return /* @__PURE__ */ u("ul", { children: [
|
|
2134
2690
|
100,
|
|
2135
2691
|
60,
|
|
2136
2692
|
20
|
|
2137
2693
|
].map((e) => /* @__PURE__ */ d("li", {
|
|
2138
|
-
className: `${
|
|
2694
|
+
className: `${Mi} ${Ni}`,
|
|
2139
2695
|
children: [
|
|
2140
|
-
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(
|
|
2141
|
-
/* @__PURE__ */ u(
|
|
2696
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(U, { className: "h-4 w-28" }), /* @__PURE__ */ u(U, { className: "mt-1.5 h-3 w-20" })] }),
|
|
2697
|
+
/* @__PURE__ */ u(U, {
|
|
2142
2698
|
className: "h-5.5 rounded-[3px]",
|
|
2143
2699
|
style: { width: `${e}%` }
|
|
2144
2700
|
}),
|
|
2145
|
-
/* @__PURE__ */ u(
|
|
2701
|
+
/* @__PURE__ */ u(U, { className: "ml-auto h-8 w-32" })
|
|
2146
2702
|
]
|
|
2147
2703
|
}, e)) });
|
|
2148
2704
|
}
|
|
2149
2705
|
//#endregion
|
|
2150
2706
|
//#region src/components/overview/requestCountCard.tsx
|
|
2151
|
-
function
|
|
2152
|
-
let { requests: e, isRequestsError: t } = R(), n = L(), r = e &&
|
|
2707
|
+
function Li() {
|
|
2708
|
+
let { requests: e, isRequestsError: t } = R(), n = L(), r = e && zi(e, n), i = !r && !t, a = /* @__PURE__ */ u(Ri, {
|
|
2153
2709
|
total: r?.total,
|
|
2154
2710
|
loading: i
|
|
2155
2711
|
}), o = M(n), s = r?.series ?? Array(P(n)).fill(0);
|
|
2156
|
-
return /* @__PURE__ */ u(
|
|
2712
|
+
return /* @__PURE__ */ u(bi, {
|
|
2157
2713
|
label: "Total Requests",
|
|
2158
2714
|
value: a,
|
|
2159
2715
|
unit: "requests",
|
|
@@ -2164,16 +2720,16 @@ function Br() {
|
|
|
2164
2720
|
color: "var(--chart-1)",
|
|
2165
2721
|
chartLabel: r ? `Requests, ${o}, ${E(r.total)} in total` : `Requests, ${o}`,
|
|
2166
2722
|
describePoint: (e) => ({
|
|
2167
|
-
at:
|
|
2723
|
+
at: Tt(n, e),
|
|
2168
2724
|
value: O(s[e] ?? 0, "request")
|
|
2169
2725
|
})
|
|
2170
2726
|
});
|
|
2171
2727
|
}
|
|
2172
|
-
function
|
|
2173
|
-
return e === void 0 ? t ? /* @__PURE__ */ u(
|
|
2728
|
+
function Ri({ total: e, loading: t }) {
|
|
2729
|
+
return e === void 0 ? t ? /* @__PURE__ */ u(U, { className: "h-11 w-28" }) : /* @__PURE__ */ u(l, { children: "—" }) : /* @__PURE__ */ u(l, { children: E(e) });
|
|
2174
2730
|
}
|
|
2175
|
-
function
|
|
2176
|
-
let n =
|
|
2731
|
+
function zi(e, t) {
|
|
2732
|
+
let n = on(e, t);
|
|
2177
2733
|
return {
|
|
2178
2734
|
total: n.reduce((e, t) => e + t, 0),
|
|
2179
2735
|
series: n
|
|
@@ -2181,7 +2737,7 @@ function Hr(e, t) {
|
|
|
2181
2737
|
}
|
|
2182
2738
|
//#endregion
|
|
2183
2739
|
//#region src/lib/sockets.ts
|
|
2184
|
-
function
|
|
2740
|
+
function Bi(e) {
|
|
2185
2741
|
return {
|
|
2186
2742
|
fromMs: e.openedAtMs,
|
|
2187
2743
|
toMs: e.closedAtMs ?? Infinity
|
|
@@ -2189,56 +2745,56 @@ function Ur(e) {
|
|
|
2189
2745
|
}
|
|
2190
2746
|
//#endregion
|
|
2191
2747
|
//#region src/lib/trendWindow.ts
|
|
2192
|
-
var
|
|
2193
|
-
|
|
2194
|
-
var
|
|
2195
|
-
function
|
|
2748
|
+
var Q = 36e5;
|
|
2749
|
+
Q / 30;
|
|
2750
|
+
var Vi = Array(30).fill(0);
|
|
2751
|
+
function Hi(e) {
|
|
2196
2752
|
return [
|
|
2197
|
-
T(e -
|
|
2198
|
-
T(e -
|
|
2753
|
+
T(e - Q),
|
|
2754
|
+
T(e - Q / 2),
|
|
2199
2755
|
"Now"
|
|
2200
2756
|
];
|
|
2201
2757
|
}
|
|
2202
2758
|
//#endregion
|
|
2203
2759
|
//#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(
|
|
2760
|
+
function Ui() {
|
|
2761
|
+
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;
|
|
2762
|
+
return /* @__PURE__ */ u(bi, {
|
|
2207
2763
|
label: "WebSocket Connections",
|
|
2208
2764
|
value: c,
|
|
2209
2765
|
unit: "open",
|
|
2210
2766
|
busy: s,
|
|
2211
2767
|
failed: !o && a,
|
|
2212
2768
|
series: l,
|
|
2213
|
-
axis:
|
|
2769
|
+
axis: Hi(i),
|
|
2214
2770
|
color: "var(--chart-2)",
|
|
2215
2771
|
chartLabel: o ? `Open WebSocket connections over the last hour, now ${E(o.open)}` : "Open WebSocket connections over the last hour",
|
|
2216
2772
|
describePoint: (e) => ({
|
|
2217
|
-
at: T(
|
|
2773
|
+
at: T(Ki(i, e)),
|
|
2218
2774
|
value: O(l[e] ?? 0, "open connection")
|
|
2219
2775
|
})
|
|
2220
2776
|
});
|
|
2221
2777
|
}
|
|
2222
|
-
function
|
|
2778
|
+
function Wi(e, t, n) {
|
|
2223
2779
|
let r = e.actors.flatMap((e) => e.instances).reduce((e, t) => e + t.connections.length, 0);
|
|
2224
2780
|
return {
|
|
2225
2781
|
open: r,
|
|
2226
|
-
series: [...
|
|
2782
|
+
series: [...Gi(t, n).slice(0, -1), r]
|
|
2227
2783
|
};
|
|
2228
2784
|
}
|
|
2229
|
-
function
|
|
2230
|
-
return Array.from({ length: 30 }, (n, r) => e.filter((e) =>
|
|
2785
|
+
function Gi(e, t) {
|
|
2786
|
+
return Array.from({ length: 30 }, (n, r) => e.filter((e) => qi(e, Ki(t, r))).length);
|
|
2231
2787
|
}
|
|
2232
|
-
function
|
|
2233
|
-
return e -
|
|
2788
|
+
function Ki(e, t) {
|
|
2789
|
+
return e - Q + Q / 29 * t;
|
|
2234
2790
|
}
|
|
2235
|
-
function
|
|
2236
|
-
let n =
|
|
2791
|
+
function qi(e, t) {
|
|
2792
|
+
let n = Bi(e);
|
|
2237
2793
|
return n.fromMs <= t && t < n.toMs;
|
|
2238
2794
|
}
|
|
2239
2795
|
//#endregion
|
|
2240
2796
|
//#region src/components/overview/overview.tsx
|
|
2241
|
-
function
|
|
2797
|
+
function Ji() {
|
|
2242
2798
|
return /* @__PURE__ */ d("section", {
|
|
2243
2799
|
"aria-labelledby": "overview-heading",
|
|
2244
2800
|
className: "flex flex-col gap-5",
|
|
@@ -2254,77 +2810,77 @@ function Zr() {
|
|
|
2254
2810
|
children: [/* @__PURE__ */ d("div", {
|
|
2255
2811
|
className: "grid gap-4 lg:grid-cols-3",
|
|
2256
2812
|
children: [
|
|
2257
|
-
/* @__PURE__ */ u(
|
|
2258
|
-
/* @__PURE__ */ u(
|
|
2259
|
-
/* @__PURE__ */ u(
|
|
2813
|
+
/* @__PURE__ */ u(Ti, {}),
|
|
2814
|
+
/* @__PURE__ */ u(Li, {}),
|
|
2815
|
+
/* @__PURE__ */ u(Ui, {})
|
|
2260
2816
|
]
|
|
2261
|
-
}), /* @__PURE__ */ u(
|
|
2817
|
+
}), /* @__PURE__ */ u(ki, {})]
|
|
2262
2818
|
})]
|
|
2263
2819
|
});
|
|
2264
2820
|
}
|
|
2265
2821
|
//#endregion
|
|
2266
2822
|
//#region src/components/ui/drawer.tsx
|
|
2267
|
-
function
|
|
2823
|
+
function Yi({ ...e }) {
|
|
2268
2824
|
return /* @__PURE__ */ u(S.Root, {
|
|
2269
2825
|
"data-slot": "drawer",
|
|
2270
2826
|
...e
|
|
2271
2827
|
});
|
|
2272
2828
|
}
|
|
2273
|
-
function
|
|
2829
|
+
function Xi({ ...e }) {
|
|
2274
2830
|
return /* @__PURE__ */ u(S.Portal, {
|
|
2275
2831
|
"data-slot": "drawer-portal",
|
|
2276
2832
|
...e
|
|
2277
2833
|
});
|
|
2278
2834
|
}
|
|
2279
|
-
function
|
|
2835
|
+
function Zi({ ...e }) {
|
|
2280
2836
|
return /* @__PURE__ */ u(S.Close, {
|
|
2281
2837
|
"data-slot": "drawer-close",
|
|
2282
2838
|
...e
|
|
2283
2839
|
});
|
|
2284
2840
|
}
|
|
2285
|
-
function
|
|
2841
|
+
function Qi({ className: e, ...t }) {
|
|
2286
2842
|
return /* @__PURE__ */ u(S.Overlay, {
|
|
2287
2843
|
"data-slot": "drawer-overlay",
|
|
2288
|
-
className:
|
|
2844
|
+
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
2845
|
...t
|
|
2290
2846
|
});
|
|
2291
2847
|
}
|
|
2292
|
-
function
|
|
2293
|
-
return /* @__PURE__ */ d(
|
|
2848
|
+
function $i({ className: e, children: t, container: n, ...r }) {
|
|
2849
|
+
return /* @__PURE__ */ d(Xi, {
|
|
2294
2850
|
container: n,
|
|
2295
|
-
children: [/* @__PURE__ */ u(
|
|
2851
|
+
children: [/* @__PURE__ */ u(Qi, {}), /* @__PURE__ */ d(S.Content, {
|
|
2296
2852
|
"data-slot": "drawer-content",
|
|
2297
|
-
className:
|
|
2853
|
+
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
2854
|
...r,
|
|
2299
2855
|
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
2856
|
})]
|
|
2301
2857
|
});
|
|
2302
2858
|
}
|
|
2303
|
-
function
|
|
2859
|
+
function ea({ className: e, ...t }) {
|
|
2304
2860
|
return /* @__PURE__ */ u("div", {
|
|
2305
2861
|
"data-slot": "drawer-header",
|
|
2306
|
-
className:
|
|
2862
|
+
className: V("flex flex-col gap-1.5 p-4", e),
|
|
2307
2863
|
...t
|
|
2308
2864
|
});
|
|
2309
2865
|
}
|
|
2310
|
-
function
|
|
2866
|
+
function ta({ className: e, ...t }) {
|
|
2311
2867
|
return /* @__PURE__ */ u(S.Title, {
|
|
2312
2868
|
"data-slot": "drawer-title",
|
|
2313
|
-
className:
|
|
2869
|
+
className: V("font-medium text-foreground", e),
|
|
2314
2870
|
...t
|
|
2315
2871
|
});
|
|
2316
2872
|
}
|
|
2317
|
-
function
|
|
2873
|
+
function na({ className: e, ...t }) {
|
|
2318
2874
|
return /* @__PURE__ */ u(S.Description, {
|
|
2319
2875
|
"data-slot": "drawer-description",
|
|
2320
|
-
className:
|
|
2876
|
+
className: V("text-sm text-muted-foreground", e),
|
|
2321
2877
|
...t
|
|
2322
2878
|
});
|
|
2323
2879
|
}
|
|
2324
2880
|
//#endregion
|
|
2325
2881
|
//#region src/client/DrawerContext.tsx
|
|
2326
|
-
var
|
|
2327
|
-
function
|
|
2882
|
+
var ra = t(void 0);
|
|
2883
|
+
function ia({ children: e }) {
|
|
2328
2884
|
let [t, n] = o({
|
|
2329
2885
|
open: !1,
|
|
2330
2886
|
entry: null
|
|
@@ -2341,25 +2897,25 @@ function si({ children: e }) {
|
|
|
2341
2897
|
entry: e
|
|
2342
2898
|
}));
|
|
2343
2899
|
}
|
|
2344
|
-
return r(l, [s]), /* @__PURE__ */ d(
|
|
2900
|
+
return r(l, [s]), /* @__PURE__ */ d(ra.Provider, {
|
|
2345
2901
|
value: {
|
|
2346
2902
|
openKey: t.open ? t.entry.key : null,
|
|
2347
2903
|
show: c,
|
|
2348
2904
|
close: l
|
|
2349
2905
|
},
|
|
2350
|
-
children: [e, /* @__PURE__ */ u(
|
|
2906
|
+
children: [e, /* @__PURE__ */ u(Yi, {
|
|
2351
2907
|
direction: "right",
|
|
2352
2908
|
autoFocus: !0,
|
|
2353
2909
|
open: t.open,
|
|
2354
2910
|
onOpenChange: (e) => !e && l(),
|
|
2355
|
-
children: /* @__PURE__ */ d(
|
|
2911
|
+
children: /* @__PURE__ */ d($i, {
|
|
2356
2912
|
className: "bg-card font-satoshi text-card-foreground antialiased shadow-(--shadow-dialog) data-[vaul-drawer-direction=right]:w-full",
|
|
2357
2913
|
onCloseAutoFocus: (e) => {
|
|
2358
2914
|
e.preventDefault(), i.current?.focus({ preventScroll: !0 });
|
|
2359
2915
|
},
|
|
2360
|
-
children: [t.entry?.content, /* @__PURE__ */ u(
|
|
2916
|
+
children: [t.entry?.content, /* @__PURE__ */ u(Zi, {
|
|
2361
2917
|
asChild: !0,
|
|
2362
|
-
children: /* @__PURE__ */ u(
|
|
2918
|
+
children: /* @__PURE__ */ u(H, {
|
|
2363
2919
|
className: "absolute top-3 right-3",
|
|
2364
2920
|
variant: "ghost",
|
|
2365
2921
|
size: "icon",
|
|
@@ -2371,16 +2927,16 @@ function si({ children: e }) {
|
|
|
2371
2927
|
})]
|
|
2372
2928
|
});
|
|
2373
2929
|
}
|
|
2374
|
-
function
|
|
2375
|
-
let e = n(
|
|
2930
|
+
function aa() {
|
|
2931
|
+
let e = n(ra);
|
|
2376
2932
|
if (!e) throw Error("useDrawer must be used within a DrawerProvider");
|
|
2377
2933
|
return e;
|
|
2378
2934
|
}
|
|
2379
2935
|
//#endregion
|
|
2380
2936
|
//#region src/components/overview/requestRateCard.tsx
|
|
2381
|
-
function
|
|
2382
|
-
let i = e &&
|
|
2383
|
-
return /* @__PURE__ */ u(
|
|
2937
|
+
function oa({ requests: e, failed: t, timeWindow: n, color: r }) {
|
|
2938
|
+
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);
|
|
2939
|
+
return /* @__PURE__ */ u(bi, {
|
|
2384
2940
|
label: "Requests / Second",
|
|
2385
2941
|
value: o,
|
|
2386
2942
|
unit: "req/s",
|
|
@@ -2391,13 +2947,13 @@ function li({ requests: e, failed: t, timeWindow: n, color: r }) {
|
|
|
2391
2947
|
color: r,
|
|
2392
2948
|
chartLabel: `Requests per second, ${M(n)}`,
|
|
2393
2949
|
describePoint: (e) => ({
|
|
2394
|
-
at:
|
|
2395
|
-
value: `${
|
|
2950
|
+
at: Tt(n, e),
|
|
2951
|
+
value: `${ut(s[e] ?? 0)} req/s`
|
|
2396
2952
|
})
|
|
2397
2953
|
});
|
|
2398
2954
|
}
|
|
2399
|
-
function
|
|
2400
|
-
let n =
|
|
2955
|
+
function sa(e, t) {
|
|
2956
|
+
let n = an(e, t);
|
|
2401
2957
|
return {
|
|
2402
2958
|
current: n.at(-1) ?? 0,
|
|
2403
2959
|
series: n
|
|
@@ -2405,12 +2961,12 @@ function ui(e, t) {
|
|
|
2405
2961
|
}
|
|
2406
2962
|
//#endregion
|
|
2407
2963
|
//#region src/components/instance/connectionsCard.tsx
|
|
2408
|
-
var
|
|
2409
|
-
function
|
|
2410
|
-
let [s, c] = o(!1), f = e && t &&
|
|
2964
|
+
var ca = 10, la = "grid grid-cols-[minmax(0,150px)_1fr] items-center gap-6";
|
|
2965
|
+
function ua({ instance: e, sessions: t, livePeriods: n, requests: r, failed: i, timeWindow: a }) {
|
|
2966
|
+
let [s, c] = o(!1), f = e && t && da(t, a), p = s ? f : f?.slice(0, ca);
|
|
2411
2967
|
return /* @__PURE__ */ u(K, {
|
|
2412
2968
|
title: "WebSocket Connections",
|
|
2413
|
-
aside: /* @__PURE__ */ u(
|
|
2969
|
+
aside: /* @__PURE__ */ u(fa, { closed: f?.some((e) => !e.open) ?? !1 }),
|
|
2414
2970
|
busy: !p && !i,
|
|
2415
2971
|
className: "pb-3",
|
|
2416
2972
|
children: i ? /* @__PURE__ */ u("p", {
|
|
@@ -2418,17 +2974,17 @@ function fi({ instance: e, sessions: t, livePeriods: n, requests: r, failed: i,
|
|
|
2418
2974
|
children: "Couldn't reach the observer API."
|
|
2419
2975
|
}) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("div", {
|
|
2420
2976
|
className: "mt-3.5",
|
|
2421
|
-
children: [/* @__PURE__ */ u($
|
|
2977
|
+
children: [/* @__PURE__ */ u($r, {
|
|
2422
2978
|
timeWindow: a,
|
|
2423
|
-
grid:
|
|
2979
|
+
grid: la
|
|
2424
2980
|
}), e && f && p && n ? /* @__PURE__ */ d(l, { children: [
|
|
2425
|
-
/* @__PURE__ */ u(
|
|
2981
|
+
/* @__PURE__ */ u(pa, {
|
|
2426
2982
|
instance: e,
|
|
2427
2983
|
periods: n,
|
|
2428
2984
|
requests: r,
|
|
2429
2985
|
timeWindow: a
|
|
2430
2986
|
}),
|
|
2431
|
-
p.map((e) => /* @__PURE__ */ u(
|
|
2987
|
+
p.map((e) => /* @__PURE__ */ u(ma, {
|
|
2432
2988
|
row: e,
|
|
2433
2989
|
requests: r,
|
|
2434
2990
|
timeWindow: a
|
|
@@ -2441,8 +2997,8 @@ function fi({ instance: e, sessions: t, livePeriods: n, requests: r, failed: i,
|
|
|
2441
2997
|
"."
|
|
2442
2998
|
]
|
|
2443
2999
|
})
|
|
2444
|
-
] }) : /* @__PURE__ */ u(
|
|
2445
|
-
}), f && f.length >
|
|
3000
|
+
] }) : /* @__PURE__ */ u(ga, {})]
|
|
3001
|
+
}), f && f.length > ca && /* @__PURE__ */ u(Rn, {
|
|
2446
3002
|
shown: p?.length ?? 0,
|
|
2447
3003
|
total: f.length,
|
|
2448
3004
|
noun: "connection",
|
|
@@ -2452,9 +3008,9 @@ function fi({ instance: e, sessions: t, livePeriods: n, requests: r, failed: i,
|
|
|
2452
3008
|
})] })
|
|
2453
3009
|
});
|
|
2454
3010
|
}
|
|
2455
|
-
function
|
|
3011
|
+
function da(e, t) {
|
|
2456
3012
|
return e.flatMap((e) => {
|
|
2457
|
-
let n = e.status === "open", r =
|
|
3013
|
+
let n = e.status === "open", r = Bi(e), [i] = ti([r], t, n && t.live);
|
|
2458
3014
|
return i ? [{
|
|
2459
3015
|
session: e,
|
|
2460
3016
|
open: n,
|
|
@@ -2463,7 +3019,7 @@ function pi(e, t) {
|
|
|
2463
3019
|
}] : [];
|
|
2464
3020
|
}).sort((e, t) => e.span.fromMs - t.span.fromMs);
|
|
2465
3021
|
}
|
|
2466
|
-
function
|
|
3022
|
+
function fa({ closed: e }) {
|
|
2467
3023
|
return /* @__PURE__ */ d("div", {
|
|
2468
3024
|
className: "flex gap-4.5 text-xs text-muted-foreground",
|
|
2469
3025
|
children: [
|
|
@@ -2482,10 +3038,10 @@ function mi({ closed: e }) {
|
|
|
2482
3038
|
]
|
|
2483
3039
|
});
|
|
2484
3040
|
}
|
|
2485
|
-
function
|
|
2486
|
-
let i = e.status === "live", a =
|
|
3041
|
+
function pa({ instance: e, periods: t, requests: n, timeWindow: r }) {
|
|
3042
|
+
let i = e.status === "live", a = ti(t, r, i && r.live), o = li(a);
|
|
2487
3043
|
return /* @__PURE__ */ d("div", {
|
|
2488
|
-
className: `${
|
|
3044
|
+
className: `${la} mt-3 mb-4.5 h-10.5 overflow-hidden rounded-lg border border-border/70 bg-background/60`,
|
|
2489
3045
|
children: [/* @__PURE__ */ d("div", {
|
|
2490
3046
|
className: "pl-3",
|
|
2491
3047
|
children: [/* @__PURE__ */ u("b", {
|
|
@@ -2502,17 +3058,17 @@ function hi({ instance: e, periods: t, requests: n, timeWindow: r }) {
|
|
|
2502
3058
|
k(o)
|
|
2503
3059
|
]
|
|
2504
3060
|
})]
|
|
2505
|
-
}), /* @__PURE__ */ u(
|
|
3061
|
+
}), /* @__PURE__ */ u(di, {
|
|
2506
3062
|
segments: a,
|
|
2507
3063
|
requests: n,
|
|
2508
3064
|
label: `Residency: live ${k(o)}, ${M(r)}`
|
|
2509
3065
|
})]
|
|
2510
3066
|
});
|
|
2511
3067
|
}
|
|
2512
|
-
function
|
|
2513
|
-
let o = i ?
|
|
3068
|
+
function ma({ row: { session: e, open: t, span: n, segment: r }, requests: i, timeWindow: a }) {
|
|
3069
|
+
let o = i ? ln(i, e.connectionId, r) : null, s = o?.messages ?? e.messagesIn ?? 0, c = o?.failures ?? 0, l = !t && c > 0;
|
|
2514
3070
|
return /* @__PURE__ */ d("div", {
|
|
2515
|
-
className: `${
|
|
3071
|
+
className: `${la} h-11 border-b border-border/50 last:border-b-0`,
|
|
2516
3072
|
children: [/* @__PURE__ */ d("div", {
|
|
2517
3073
|
className: "min-w-0",
|
|
2518
3074
|
children: [/* @__PURE__ */ u("b", {
|
|
@@ -2520,12 +3076,12 @@ function gi({ row: { session: e, open: t, span: n, segment: r }, requests: i, ti
|
|
|
2520
3076
|
className: "block truncate text-[13px] font-medium",
|
|
2521
3077
|
children: e.connectionId
|
|
2522
3078
|
}), /* @__PURE__ */ d("span", {
|
|
2523
|
-
className:
|
|
3079
|
+
className: V("mt-0.5 block truncate text-[11px] text-muted-foreground tabular-nums", l && "text-danger"),
|
|
2524
3080
|
children: [t ? `${O(s, "message")} · ${k(a.toMs - n.fromMs)}` : `Closed ${T(n.toMs)}`, l && ` · ${O(c, "failure")}`]
|
|
2525
3081
|
})]
|
|
2526
|
-
}), /* @__PURE__ */ u(
|
|
2527
|
-
label: `${e.connectionId}: ${e.status}, ${
|
|
2528
|
-
children: /* @__PURE__ */ u(
|
|
3082
|
+
}), /* @__PURE__ */ u(ei, {
|
|
3083
|
+
label: `${e.connectionId}: ${e.status}, ${ct(r.fromMs, r.toMs)}`,
|
|
3084
|
+
children: /* @__PURE__ */ u(ha, {
|
|
2529
3085
|
messages: s,
|
|
2530
3086
|
failures: c,
|
|
2531
3087
|
segment: r,
|
|
@@ -2535,21 +3091,21 @@ function gi({ row: { session: e, open: t, span: n, segment: r }, requests: i, ti
|
|
|
2535
3091
|
})]
|
|
2536
3092
|
});
|
|
2537
3093
|
}
|
|
2538
|
-
function
|
|
2539
|
-
return /* @__PURE__ */ d(
|
|
3094
|
+
function ha({ messages: e, failures: t, segment: n, open: r, failed: i }) {
|
|
3095
|
+
return /* @__PURE__ */ d(q, { children: [/* @__PURE__ */ u(J, {
|
|
2540
3096
|
asChild: !0,
|
|
2541
3097
|
children: /* @__PURE__ */ u("span", {
|
|
2542
|
-
className:
|
|
3098
|
+
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
3099
|
style: {
|
|
2544
3100
|
left: `${n.left * 100}%`,
|
|
2545
3101
|
width: `${n.width * 100}%`
|
|
2546
3102
|
}
|
|
2547
3103
|
})
|
|
2548
|
-
}), /* @__PURE__ */ d(
|
|
3104
|
+
}), /* @__PURE__ */ d(Y, {
|
|
2549
3105
|
className: "tabular-nums",
|
|
2550
3106
|
children: [/* @__PURE__ */ u("div", {
|
|
2551
3107
|
className: "font-medium",
|
|
2552
|
-
children:
|
|
3108
|
+
children: ct(n.fromMs, n.toMs)
|
|
2553
3109
|
}), /* @__PURE__ */ d("div", {
|
|
2554
3110
|
className: "mt-1 opacity-80",
|
|
2555
3111
|
children: [
|
|
@@ -2560,131 +3116,60 @@ function _i({ messages: e, failures: t, segment: n, open: r, failed: i }) {
|
|
|
2560
3116
|
})]
|
|
2561
3117
|
})] });
|
|
2562
3118
|
}
|
|
2563
|
-
function
|
|
3119
|
+
function ga() {
|
|
2564
3120
|
return Array.from({ length: 4 }, (e, t) => /* @__PURE__ */ d("div", {
|
|
2565
|
-
className: `${
|
|
2566
|
-
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(
|
|
3121
|
+
className: `${la} h-11 border-b border-border/50 last:border-b-0`,
|
|
3122
|
+
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
3123
|
className: "h-2.5 rounded-full",
|
|
2568
3124
|
style: {
|
|
2569
3125
|
width: `${60 - t * 12}%`,
|
|
2570
3126
|
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
|
-
}
|
|
3127
|
+
}
|
|
3128
|
+
})]
|
|
3129
|
+
}, t));
|
|
2668
3130
|
}
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
3131
|
+
//#endregion
|
|
3132
|
+
//#region src/components/instance/eventsCard.tsx
|
|
3133
|
+
var _a = ["kill"];
|
|
3134
|
+
function va({ actorName: e, actorId: t, timeWindow: n }) {
|
|
3135
|
+
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);
|
|
3136
|
+
return /* @__PURE__ */ u(K, {
|
|
3137
|
+
title: "Events",
|
|
3138
|
+
busy: !l && !s,
|
|
3139
|
+
className: "pb-3",
|
|
3140
|
+
children: s ? /* @__PURE__ */ u("p", {
|
|
3141
|
+
className: "py-4 text-[13px] text-muted-foreground",
|
|
3142
|
+
children: "Couldn't reach the observer API."
|
|
3143
|
+
}) : l ? /* @__PURE__ */ u(Sr, {
|
|
3144
|
+
events: l,
|
|
3145
|
+
noun: "event",
|
|
3146
|
+
expanded: r,
|
|
3147
|
+
onToggle: () => i(!r)
|
|
3148
|
+
}) : /* @__PURE__ */ u(Cr, {})
|
|
3149
|
+
});
|
|
3150
|
+
}
|
|
3151
|
+
//#endregion
|
|
3152
|
+
//#region src/hooks/useDebouncedValue.ts
|
|
3153
|
+
function ya(e, t) {
|
|
3154
|
+
let [n, i] = o(e);
|
|
3155
|
+
return r(() => {
|
|
3156
|
+
let n = setTimeout(() => i(e), t);
|
|
3157
|
+
return () => clearTimeout(n);
|
|
3158
|
+
}, [e, t]), n;
|
|
2674
3159
|
}
|
|
2675
3160
|
//#endregion
|
|
2676
3161
|
//#region src/lib/views/logs.ts
|
|
2677
|
-
var
|
|
2678
|
-
function
|
|
2679
|
-
let t =
|
|
3162
|
+
var ba = 2e3;
|
|
3163
|
+
function xa(e) {
|
|
3164
|
+
let t = W.slice(e ? W.indexOf(e) : 0);
|
|
2680
3165
|
return (e, n) => {
|
|
2681
|
-
let r =
|
|
3166
|
+
let r = Ta(n).filter((e) => t.includes(e.level));
|
|
2682
3167
|
if (r.length === 0) return e;
|
|
2683
3168
|
let i = new Set(e.map((e) => e.logId));
|
|
2684
|
-
return [...r.filter((e) => !i.has(e.logId)).reverse(), ...e].slice(0,
|
|
3169
|
+
return [...r.filter((e) => !i.has(e.logId)).reverse(), ...e].slice(0, ba);
|
|
2685
3170
|
};
|
|
2686
3171
|
}
|
|
2687
|
-
function
|
|
3172
|
+
function Sa({ fromMs: e, bucketMs: t, buckets: n }, r) {
|
|
2688
3173
|
let i = {};
|
|
2689
3174
|
return n.forEach((n, r) => i[e + r * t] = n), {
|
|
2690
3175
|
bucketMs: t,
|
|
@@ -2692,14 +3177,14 @@ function Fi({ fromMs: e, bucketMs: t, buckets: n }, r) {
|
|
|
2692
3177
|
counts: i
|
|
2693
3178
|
};
|
|
2694
3179
|
}
|
|
2695
|
-
var
|
|
2696
|
-
let n =
|
|
3180
|
+
var Ca = (e, t) => {
|
|
3181
|
+
let n = Ta(t).filter((t) => t.timestampMs >= e.readAtMs && W.includes(t.level));
|
|
2697
3182
|
if (n.length === 0) return e;
|
|
2698
3183
|
let r = { ...e.counts };
|
|
2699
3184
|
for (let t of n) {
|
|
2700
3185
|
let n = Math.floor(t.timestampMs / e.bucketMs) * e.bucketMs;
|
|
2701
3186
|
r[n] = {
|
|
2702
|
-
...r[n] ??
|
|
3187
|
+
...r[n] ?? Ea(),
|
|
2703
3188
|
[t.level]: (r[n]?.[t.level] ?? 0) + 1
|
|
2704
3189
|
};
|
|
2705
3190
|
}
|
|
@@ -2708,19 +3193,19 @@ var Ii = (e, t) => {
|
|
|
2708
3193
|
counts: r
|
|
2709
3194
|
};
|
|
2710
3195
|
};
|
|
2711
|
-
function
|
|
3196
|
+
function wa({ bucketMs: e, counts: t }, { fromMs: n, toMs: r }) {
|
|
2712
3197
|
let i = [];
|
|
2713
|
-
for (let a = n; a < r; a += e) i.push(t[a] ??
|
|
3198
|
+
for (let a = n; a < r; a += e) i.push(t[a] ?? Ea());
|
|
2714
3199
|
return {
|
|
2715
3200
|
fromMs: n,
|
|
2716
3201
|
bucketMs: e,
|
|
2717
3202
|
buckets: i
|
|
2718
3203
|
};
|
|
2719
3204
|
}
|
|
2720
|
-
function
|
|
3205
|
+
function Ta(e) {
|
|
2721
3206
|
return e.flatMap((e) => e.type === "log" ? [e.item] : []);
|
|
2722
3207
|
}
|
|
2723
|
-
function
|
|
3208
|
+
function Ea() {
|
|
2724
3209
|
return {
|
|
2725
3210
|
debug: 0,
|
|
2726
3211
|
info: 0,
|
|
@@ -2730,10 +3215,10 @@ function zi() {
|
|
|
2730
3215
|
}
|
|
2731
3216
|
//#endregion
|
|
2732
3217
|
//#region src/hooks/useLogs.ts
|
|
2733
|
-
function
|
|
2734
|
-
let r =
|
|
3218
|
+
function Da(e, t, n) {
|
|
3219
|
+
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
3220
|
return {
|
|
2736
|
-
lines: s ?
|
|
3221
|
+
lines: s ? ja([...a ?? [], ...s.flatMap((e) => e.records)]) : null,
|
|
2737
3222
|
hasOlder: !!s?.at(-1)?.nextCursor,
|
|
2738
3223
|
loadingOlder: !!(s && i.size > s.length),
|
|
2739
3224
|
loadOlder: () => i.setSize((e) => e + 1),
|
|
@@ -2741,17 +3226,17 @@ function Bi(e, t, n) {
|
|
|
2741
3226
|
isError: !s && !!i.error
|
|
2742
3227
|
};
|
|
2743
3228
|
}
|
|
2744
|
-
function
|
|
2745
|
-
let t =
|
|
3229
|
+
function Oa(e) {
|
|
3230
|
+
let t = Ne({
|
|
2746
3231
|
...e,
|
|
2747
3232
|
level: null
|
|
2748
3233
|
});
|
|
2749
3234
|
return t.set("signals", "logs"), t;
|
|
2750
3235
|
}
|
|
2751
|
-
function
|
|
3236
|
+
function ka(e, t, n) {
|
|
2752
3237
|
let r = new C(e);
|
|
2753
3238
|
return be((r, i) => i && !i.nextCursor ? null : [
|
|
2754
|
-
...
|
|
3239
|
+
...Ee(e, n),
|
|
2755
3240
|
...F(t),
|
|
2756
3241
|
r === 0 ? null : i.nextCursor
|
|
2757
3242
|
], (e) => r.listLogs(n, I(t), e.at(-1)), {
|
|
@@ -2759,37 +3244,37 @@ function Hi(e, t, n) {
|
|
|
2759
3244
|
revalidateOnFocus: !1
|
|
2760
3245
|
});
|
|
2761
3246
|
}
|
|
2762
|
-
function
|
|
2763
|
-
let i =
|
|
2764
|
-
...
|
|
3247
|
+
function Aa(e, t, n, r) {
|
|
3248
|
+
let i = Wn(t.toMs - t.fromMs), { data: a } = w([
|
|
3249
|
+
...De(e, n),
|
|
2765
3250
|
...F(t),
|
|
2766
3251
|
i
|
|
2767
3252
|
], async () => {
|
|
2768
3253
|
let r = Date.now();
|
|
2769
|
-
return
|
|
2770
|
-
},
|
|
2771
|
-
return a &&
|
|
3254
|
+
return Sa(await new C(e).getLogHistogram(n, Gn(I(t), i), i), r);
|
|
3255
|
+
}, Ca, r, { keepPreviousData: !0 });
|
|
3256
|
+
return a && wa(a, Gn(I(t), i));
|
|
2772
3257
|
}
|
|
2773
|
-
function
|
|
3258
|
+
function ja(e) {
|
|
2774
3259
|
return [...new Map(e.map((e) => [e.logId, e])).values()].sort((e, t) => t.timestampMs - e.timestampMs || (e.logId < t.logId ? 1 : -1));
|
|
2775
3260
|
}
|
|
2776
3261
|
//#endregion
|
|
2777
3262
|
//#region src/components/instance/logChart.tsx
|
|
2778
|
-
var
|
|
3263
|
+
var Ma = {
|
|
2779
3264
|
debug: "bg-muted-foreground/25",
|
|
2780
3265
|
info: "bg-muted-foreground/55",
|
|
2781
3266
|
warn: "bg-warning",
|
|
2782
3267
|
error: "bg-danger"
|
|
2783
|
-
},
|
|
3268
|
+
}, Na = [
|
|
2784
3269
|
2,
|
|
2785
3270
|
4,
|
|
2786
3271
|
6,
|
|
2787
3272
|
10
|
|
2788
|
-
],
|
|
2789
|
-
function
|
|
3273
|
+
], Pa = 6;
|
|
3274
|
+
function Fa({ histogram: e, level: t, live: n, onZoom: r }) {
|
|
2790
3275
|
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 =
|
|
3276
|
+
if (!e) return /* @__PURE__ */ u(U, { className: "mt-4 mb-3.5 h-[122px] w-full rounded-sm" });
|
|
3277
|
+
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
3278
|
let t = e.currentTarget.getBoundingClientRect();
|
|
2794
3279
|
return Math.min(l.length - 1, Math.max(0, Math.floor((e.clientX - t.left) / t.width * l.length)));
|
|
2795
3280
|
};
|
|
@@ -2797,7 +3282,7 @@ function Ji({ histogram: e, level: t, live: n, onZoom: r }) {
|
|
|
2797
3282
|
className: "mt-4 border-b pb-3.5",
|
|
2798
3283
|
children: [/* @__PURE__ */ d("div", {
|
|
2799
3284
|
className: "relative pt-4",
|
|
2800
|
-
children: [/* @__PURE__ */ u(
|
|
3285
|
+
children: [/* @__PURE__ */ u(La, { scale: h }), /* @__PURE__ */ d("div", {
|
|
2801
3286
|
role: "img",
|
|
2802
3287
|
"aria-label": `Log lines per ${k(p)}; drag across the chart to zoom into a time range`,
|
|
2803
3288
|
className: "relative ml-[42px] h-24 cursor-crosshair touch-none select-none",
|
|
@@ -2824,36 +3309,36 @@ function Ji({ histogram: e, level: t, live: n, onZoom: r }) {
|
|
|
2824
3309
|
children: [
|
|
2825
3310
|
/* @__PURE__ */ u("div", {
|
|
2826
3311
|
className: "absolute inset-0 flex items-end gap-0.5",
|
|
2827
|
-
children: l.map((e, n) => /* @__PURE__ */ u(
|
|
3312
|
+
children: l.map((e, n) => /* @__PURE__ */ u(Ra, {
|
|
2828
3313
|
counts: e,
|
|
2829
3314
|
scale: h,
|
|
2830
3315
|
level: t,
|
|
2831
3316
|
hovered: n === m
|
|
2832
3317
|
}, n))
|
|
2833
3318
|
}),
|
|
2834
|
-
s && /* @__PURE__ */ u(
|
|
3319
|
+
s && /* @__PURE__ */ u(za, {
|
|
2835
3320
|
drag: s,
|
|
2836
3321
|
buckets: l.length
|
|
2837
3322
|
}),
|
|
2838
|
-
m !== null && !s &&
|
|
3323
|
+
m !== null && !s && G(l[m], null) > 0 && /* @__PURE__ */ u(Ba, {
|
|
2839
3324
|
index: m,
|
|
2840
3325
|
histogram: e
|
|
2841
3326
|
})
|
|
2842
3327
|
]
|
|
2843
3328
|
})]
|
|
2844
|
-
}), /* @__PURE__ */ u(
|
|
3329
|
+
}), /* @__PURE__ */ u(Va, {
|
|
2845
3330
|
histogram: e,
|
|
2846
3331
|
live: n
|
|
2847
3332
|
})]
|
|
2848
3333
|
});
|
|
2849
3334
|
}
|
|
2850
|
-
function
|
|
3335
|
+
function Ia(e) {
|
|
2851
3336
|
for (let t = 1;; t *= 10) {
|
|
2852
|
-
let n =
|
|
3337
|
+
let n = Na.find((n) => n * t >= e);
|
|
2853
3338
|
if (n) return n * t;
|
|
2854
3339
|
}
|
|
2855
3340
|
}
|
|
2856
|
-
function
|
|
3341
|
+
function La({ scale: e }) {
|
|
2857
3342
|
return /* @__PURE__ */ u("div", {
|
|
2858
3343
|
"aria-hidden": !0,
|
|
2859
3344
|
className: "pointer-events-none absolute inset-x-0 top-4 h-24",
|
|
@@ -2871,17 +3356,17 @@ function Xi({ scale: e }) {
|
|
|
2871
3356
|
}, t))
|
|
2872
3357
|
});
|
|
2873
3358
|
}
|
|
2874
|
-
function
|
|
2875
|
-
let i = n ?
|
|
2876
|
-
return
|
|
2877
|
-
className:
|
|
2878
|
-
children:
|
|
2879
|
-
className:
|
|
3359
|
+
function Ra({ counts: e, scale: t, level: n, hovered: r }) {
|
|
3360
|
+
let i = n ? W.indexOf(n) : 0;
|
|
3361
|
+
return G(e, null) ? /* @__PURE__ */ u("span", {
|
|
3362
|
+
className: V("flex h-full flex-1 flex-col-reverse rounded-[1px]", r && "outline outline-offset-1 outline-foreground"),
|
|
3363
|
+
children: W.map((n, r) => e[n] ? /* @__PURE__ */ u("span", {
|
|
3364
|
+
className: V("block w-full last:rounded-t-[1px]", Ma[n], r < i && "opacity-25"),
|
|
2880
3365
|
style: { height: `${e[n] / t * 100}%` }
|
|
2881
3366
|
}, n) : null)
|
|
2882
3367
|
}) : /* @__PURE__ */ u("span", { className: "h-px flex-1 bg-border/60" });
|
|
2883
3368
|
}
|
|
2884
|
-
function
|
|
3369
|
+
function za({ drag: e, buckets: t }) {
|
|
2885
3370
|
let n = Math.min(e.from, e.to), r = Math.abs(e.to - e.from) + 1;
|
|
2886
3371
|
return /* @__PURE__ */ u("div", {
|
|
2887
3372
|
className: "pointer-events-none absolute inset-y-0 rounded-sm bg-foreground/10 ring-1 ring-foreground/40",
|
|
@@ -2891,8 +3376,8 @@ function Qi({ drag: e, buckets: t }) {
|
|
|
2891
3376
|
}
|
|
2892
3377
|
});
|
|
2893
3378
|
}
|
|
2894
|
-
function
|
|
2895
|
-
let i = t[e], a = n + e * r, o = r < 6e4 ?
|
|
3379
|
+
function Ba({ index: e, histogram: { buckets: t, fromMs: n, bucketMs: r } }) {
|
|
3380
|
+
let i = t[e], a = n + e * r, o = r < 6e4 ? it : T, s = e >= t.length / 2;
|
|
2896
3381
|
return /* @__PURE__ */ d("div", {
|
|
2897
3382
|
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
3383
|
style: s ? { right: `calc(${100 - e / t.length * 100}% + 8px)` } : { left: `calc(${(e + 1) / t.length * 100}% + 8px)` },
|
|
@@ -2903,14 +3388,14 @@ function $i({ index: e, histogram: { buckets: t, fromMs: n, bucketMs: r } }) {
|
|
|
2903
3388
|
" – ",
|
|
2904
3389
|
o(a + r),
|
|
2905
3390
|
" · ",
|
|
2906
|
-
O(
|
|
3391
|
+
O(G(i, null), "line")
|
|
2907
3392
|
]
|
|
2908
3393
|
}), /* @__PURE__ */ u("span", {
|
|
2909
3394
|
className: "flex gap-3.5 tabular-nums",
|
|
2910
|
-
children: [...
|
|
3395
|
+
children: [...W].reverse().map((e) => /* @__PURE__ */ d("span", {
|
|
2911
3396
|
className: "flex items-center gap-1.5",
|
|
2912
3397
|
children: [
|
|
2913
|
-
/* @__PURE__ */ u("i", { className:
|
|
3398
|
+
/* @__PURE__ */ u("i", { className: V("size-1.5 rounded-full", Ma[e]) }),
|
|
2914
3399
|
E(i[e]),
|
|
2915
3400
|
" ",
|
|
2916
3401
|
e
|
|
@@ -2919,298 +3404,17 @@ function $i({ index: e, histogram: { buckets: t, fromMs: n, bucketMs: r } }) {
|
|
|
2919
3404
|
})]
|
|
2920
3405
|
});
|
|
2921
3406
|
}
|
|
2922
|
-
function
|
|
3407
|
+
function Va({ histogram: { fromMs: e, bucketMs: t, buckets: n }, live: r }) {
|
|
2923
3408
|
let i = t * n.length;
|
|
2924
3409
|
return /* @__PURE__ */ u("div", {
|
|
2925
3410
|
"aria-hidden": !0,
|
|
2926
3411
|
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"]
|
|
3412
|
+
children: Array.from({ length: 7 }, (t, n) => /* @__PURE__ */ u("span", { children: r && n === Pa ? "Now" : ot(e + n / Pa * i, i) }, n))
|
|
3200
3413
|
});
|
|
3201
3414
|
}
|
|
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
3415
|
//#endregion
|
|
3212
3416
|
//#region src/components/instance/logsCard.tsx
|
|
3213
|
-
var
|
|
3417
|
+
var Ha = [
|
|
3214
3418
|
{
|
|
3215
3419
|
value: "all",
|
|
3216
3420
|
label: "All"
|
|
@@ -3227,12 +3431,12 @@ var xa = [
|
|
|
3227
3431
|
value: "error",
|
|
3228
3432
|
label: "Error"
|
|
3229
3433
|
}
|
|
3230
|
-
],
|
|
3434
|
+
], Ua = "logs", Wa = 300, Ga = {
|
|
3231
3435
|
level: !0,
|
|
3232
3436
|
request: !1
|
|
3233
|
-
},
|
|
3234
|
-
function
|
|
3235
|
-
let { baseUrl: s } = R(), c =
|
|
3437
|
+
}, Ka = "durable-actors-observer:log-columns", qa = [["level", "Level"], ["request", "Request"]];
|
|
3438
|
+
function Ja({ actorName: e, actorId: t, requests: n, requestId: r, onRequestChange: i, timeWindow: a }) {
|
|
3439
|
+
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
3440
|
actorName: e,
|
|
3237
3441
|
actorId: t,
|
|
3238
3442
|
requestId: r,
|
|
@@ -3242,21 +3446,21 @@ function Da({ actorName: e, actorId: t, requests: n, requestId: r, onRequestChan
|
|
|
3242
3446
|
i(null), m(""), f("all");
|
|
3243
3447
|
};
|
|
3244
3448
|
return /* @__PURE__ */ d(K, {
|
|
3245
|
-
id:
|
|
3449
|
+
id: Ua,
|
|
3246
3450
|
title: "Logs",
|
|
3247
3451
|
aside: /* @__PURE__ */ d("div", {
|
|
3248
3452
|
className: "flex flex-wrap items-center gap-2",
|
|
3249
3453
|
children: [
|
|
3250
|
-
/* @__PURE__ */ u(
|
|
3454
|
+
/* @__PURE__ */ u(Ya, {
|
|
3251
3455
|
value: p,
|
|
3252
3456
|
onChange: m
|
|
3253
3457
|
}),
|
|
3254
|
-
/* @__PURE__ */ u(
|
|
3458
|
+
/* @__PURE__ */ u(Xa, {
|
|
3255
3459
|
value: l,
|
|
3256
3460
|
onChange: f,
|
|
3257
|
-
totals: y.histogram &&
|
|
3461
|
+
totals: y.histogram && Kn(y.histogram)
|
|
3258
3462
|
}),
|
|
3259
|
-
/* @__PURE__ */ u(
|
|
3463
|
+
/* @__PURE__ */ u(Za, {
|
|
3260
3464
|
columns: h,
|
|
3261
3465
|
onChange: g
|
|
3262
3466
|
})
|
|
@@ -3265,13 +3469,13 @@ function Da({ actorName: e, actorId: t, requests: n, requestId: r, onRequestChan
|
|
|
3265
3469
|
busy: !y.lines && !y.isError,
|
|
3266
3470
|
className: "pb-3.5",
|
|
3267
3471
|
children: [
|
|
3268
|
-
r && /* @__PURE__ */ u(
|
|
3472
|
+
r && /* @__PURE__ */ u(eo, {
|
|
3269
3473
|
requestId: r,
|
|
3270
3474
|
call: ee.get(r),
|
|
3271
3475
|
onRemove: () => i(null),
|
|
3272
3476
|
onClearFilters: te
|
|
3273
3477
|
}),
|
|
3274
|
-
/* @__PURE__ */ u(
|
|
3478
|
+
/* @__PURE__ */ u(Fa, {
|
|
3275
3479
|
histogram: y.histogram,
|
|
3276
3480
|
level: v,
|
|
3277
3481
|
live: a.live,
|
|
@@ -3280,7 +3484,7 @@ function Da({ actorName: e, actorId: t, requests: n, requestId: r, onRequestChan
|
|
|
3280
3484
|
...e
|
|
3281
3485
|
})
|
|
3282
3486
|
}),
|
|
3283
|
-
/* @__PURE__ */ u(
|
|
3487
|
+
/* @__PURE__ */ u(ir, {
|
|
3284
3488
|
lines: y.lines,
|
|
3285
3489
|
failed: y.isError,
|
|
3286
3490
|
search: _,
|
|
@@ -3293,7 +3497,7 @@ function Da({ actorName: e, actorId: t, requests: n, requestId: r, onRequestChan
|
|
|
3293
3497
|
]
|
|
3294
3498
|
});
|
|
3295
3499
|
}
|
|
3296
|
-
function
|
|
3500
|
+
function Ya({ value: e, onChange: t }) {
|
|
3297
3501
|
return /* @__PURE__ */ d("label", {
|
|
3298
3502
|
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
3503
|
children: [
|
|
@@ -3322,31 +3526,31 @@ function Oa({ value: e, onChange: t }) {
|
|
|
3322
3526
|
]
|
|
3323
3527
|
});
|
|
3324
3528
|
}
|
|
3325
|
-
function
|
|
3326
|
-
return /* @__PURE__ */ u(
|
|
3529
|
+
function Xa({ value: e, onChange: t, totals: n }) {
|
|
3530
|
+
return /* @__PURE__ */ u(kr, {
|
|
3327
3531
|
label: "Minimum log level",
|
|
3328
3532
|
value: e,
|
|
3329
3533
|
onChange: t,
|
|
3330
|
-
options:
|
|
3534
|
+
options: Ha.map((e) => ({
|
|
3331
3535
|
...e,
|
|
3332
|
-
icon: (e.value === "warn" || e.value === "error") && /* @__PURE__ */ u("i", { className:
|
|
3333
|
-
badge: n && E(
|
|
3536
|
+
icon: (e.value === "warn" || e.value === "error") && /* @__PURE__ */ u("i", { className: V("size-1.5 rounded-full", Ma[e.value]) }),
|
|
3537
|
+
badge: n && E(G(n, e.value === "all" ? null : e.value))
|
|
3334
3538
|
}))
|
|
3335
3539
|
});
|
|
3336
3540
|
}
|
|
3337
|
-
function
|
|
3338
|
-
return /* @__PURE__ */ d(
|
|
3541
|
+
function Za({ columns: e, onChange: t }) {
|
|
3542
|
+
return /* @__PURE__ */ d(yn, { children: [/* @__PURE__ */ u(bn, {
|
|
3339
3543
|
asChild: !0,
|
|
3340
|
-
children: /* @__PURE__ */ d(
|
|
3544
|
+
children: /* @__PURE__ */ d(H, {
|
|
3341
3545
|
variant: "outline",
|
|
3342
3546
|
size: "sm",
|
|
3343
3547
|
className: "h-8 text-xs",
|
|
3344
3548
|
children: [/* @__PURE__ */ u(ce, {}), "Columns"]
|
|
3345
3549
|
})
|
|
3346
|
-
}), /* @__PURE__ */ u(
|
|
3550
|
+
}), /* @__PURE__ */ u(xn, {
|
|
3347
3551
|
align: "end",
|
|
3348
3552
|
className: "w-44 p-1.5",
|
|
3349
|
-
children:
|
|
3553
|
+
children: qa.map(([n, r]) => /* @__PURE__ */ d("label", {
|
|
3350
3554
|
className: "flex cursor-pointer items-center gap-2.5 rounded-sm px-2 py-1.5 text-[13px] hover:bg-muted",
|
|
3351
3555
|
children: [/* @__PURE__ */ u("input", {
|
|
3352
3556
|
type: "checkbox",
|
|
@@ -3360,26 +3564,26 @@ function Aa({ columns: e, onChange: t }) {
|
|
|
3360
3564
|
}, n))
|
|
3361
3565
|
})] });
|
|
3362
3566
|
}
|
|
3363
|
-
function
|
|
3364
|
-
let [e, t] = o(
|
|
3567
|
+
function Qa() {
|
|
3568
|
+
let [e, t] = o($a);
|
|
3365
3569
|
return [e, (e) => {
|
|
3366
3570
|
t(e);
|
|
3367
3571
|
try {
|
|
3368
|
-
localStorage.setItem(
|
|
3572
|
+
localStorage.setItem(Ka, JSON.stringify(e));
|
|
3369
3573
|
} catch {}
|
|
3370
3574
|
}];
|
|
3371
3575
|
}
|
|
3372
|
-
function
|
|
3576
|
+
function $a() {
|
|
3373
3577
|
try {
|
|
3374
3578
|
return {
|
|
3375
|
-
...
|
|
3376
|
-
...JSON.parse(localStorage.getItem(
|
|
3579
|
+
...Ga,
|
|
3580
|
+
...JSON.parse(localStorage.getItem(Ka) ?? "{}")
|
|
3377
3581
|
};
|
|
3378
3582
|
} catch {
|
|
3379
|
-
return
|
|
3583
|
+
return Ga;
|
|
3380
3584
|
}
|
|
3381
3585
|
}
|
|
3382
|
-
function
|
|
3586
|
+
function eo({ requestId: e, call: t, onRemove: n, onClearFilters: r }) {
|
|
3383
3587
|
return /* @__PURE__ */ d("div", {
|
|
3384
3588
|
className: "mt-3.5 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",
|
|
3385
3589
|
children: [
|
|
@@ -3394,7 +3598,7 @@ function Na({ requestId: e, call: t, onRemove: n, onClearFilters: r }) {
|
|
|
3394
3598
|
/* @__PURE__ */ u("code", {
|
|
3395
3599
|
title: e,
|
|
3396
3600
|
className: "font-mono text-[11.5px] text-chart-2",
|
|
3397
|
-
children:
|
|
3601
|
+
children: Yn(e)
|
|
3398
3602
|
}),
|
|
3399
3603
|
t && /* @__PURE__ */ d("span", {
|
|
3400
3604
|
className: "text-muted-foreground",
|
|
@@ -3420,19 +3624,19 @@ function Na({ requestId: e, call: t, onRemove: n, onClearFilters: r }) {
|
|
|
3420
3624
|
}
|
|
3421
3625
|
//#endregion
|
|
3422
3626
|
//#region src/components/ui/barChart.tsx
|
|
3423
|
-
function
|
|
3627
|
+
function to({ values: e, label: t, highlighted: n, onSelect: r, barLabel: i, className: a }) {
|
|
3424
3628
|
let o = Math.max(...e, 1);
|
|
3425
3629
|
return r ? /* @__PURE__ */ u("div", {
|
|
3426
3630
|
role: "group",
|
|
3427
3631
|
"aria-label": t,
|
|
3428
|
-
className:
|
|
3632
|
+
className: V("flex items-end gap-0.5", a),
|
|
3429
3633
|
children: e.map((e, t) => /* @__PURE__ */ u("button", {
|
|
3430
3634
|
type: "button",
|
|
3431
3635
|
"aria-label": i?.(t),
|
|
3432
3636
|
"aria-pressed": t === n,
|
|
3433
3637
|
onClick: () => r(t),
|
|
3434
|
-
className:
|
|
3435
|
-
children: /* @__PURE__ */ u(
|
|
3638
|
+
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"),
|
|
3639
|
+
children: /* @__PURE__ */ u(no, {
|
|
3436
3640
|
share: e / o,
|
|
3437
3641
|
highlighted: t === n
|
|
3438
3642
|
})
|
|
@@ -3440,89 +3644,89 @@ function Pa({ values: e, label: t, highlighted: n, onSelect: r, barLabel: i, cla
|
|
|
3440
3644
|
}) : /* @__PURE__ */ u("div", {
|
|
3441
3645
|
role: "img",
|
|
3442
3646
|
"aria-label": t,
|
|
3443
|
-
className:
|
|
3444
|
-
children: e.map((e, t) => /* @__PURE__ */ u(
|
|
3647
|
+
className: V("flex items-end gap-1", a),
|
|
3648
|
+
children: e.map((e, t) => /* @__PURE__ */ u(no, {
|
|
3445
3649
|
share: e / o,
|
|
3446
3650
|
highlighted: t === n
|
|
3447
3651
|
}, t))
|
|
3448
3652
|
});
|
|
3449
3653
|
}
|
|
3450
|
-
function
|
|
3654
|
+
function no({ share: e, highlighted: t }) {
|
|
3451
3655
|
return /* @__PURE__ */ u("span", {
|
|
3452
|
-
className:
|
|
3656
|
+
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
3657
|
style: { height: e ? `${e * 100}%` : "1px" }
|
|
3454
3658
|
});
|
|
3455
3659
|
}
|
|
3456
3660
|
//#endregion
|
|
3457
3661
|
//#region src/components/ui/queueStripes.tsx
|
|
3458
|
-
function
|
|
3662
|
+
function ro({ className: e, ...t }) {
|
|
3459
3663
|
return /* @__PURE__ */ u("span", {
|
|
3460
3664
|
"data-slot": "queue-stripes",
|
|
3461
|
-
className:
|
|
3665
|
+
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
3666
|
...t
|
|
3463
3667
|
});
|
|
3464
3668
|
}
|
|
3465
3669
|
//#endregion
|
|
3466
3670
|
//#region src/components/instance/requestDetails.tsx
|
|
3467
|
-
var
|
|
3671
|
+
var io = {
|
|
3468
3672
|
completed: "Completed",
|
|
3469
3673
|
failed: "Failed",
|
|
3470
3674
|
rejected: "Rejected",
|
|
3471
3675
|
rerouted: "Rerouted",
|
|
3472
3676
|
interrupted: "Interrupted"
|
|
3473
|
-
},
|
|
3677
|
+
}, ao = {
|
|
3474
3678
|
method: "Method",
|
|
3475
3679
|
websocket: "WebSocket"
|
|
3476
3680
|
};
|
|
3477
|
-
function
|
|
3681
|
+
function oo({ call: e, blocker: t, onShowLogs: n }) {
|
|
3478
3682
|
let r = e.outcome !== "completed";
|
|
3479
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d(
|
|
3683
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d(ea, {
|
|
3480
3684
|
className: "shrink-0 gap-2 border-b px-5 py-4 pr-14",
|
|
3481
3685
|
children: [
|
|
3482
3686
|
/* @__PURE__ */ d("div", {
|
|
3483
3687
|
className: "flex items-center gap-2",
|
|
3484
|
-
children: [/* @__PURE__ */ u(
|
|
3485
|
-
className:
|
|
3486
|
-
children:
|
|
3688
|
+
children: [/* @__PURE__ */ u(uo, { state: e.hostState }), /* @__PURE__ */ u("span", {
|
|
3689
|
+
className: V("text-xs", r ? "text-danger" : "text-muted-foreground"),
|
|
3690
|
+
children: io[e.outcome]
|
|
3487
3691
|
})]
|
|
3488
3692
|
}),
|
|
3489
|
-
/* @__PURE__ */ u(
|
|
3693
|
+
/* @__PURE__ */ u(ta, {
|
|
3490
3694
|
translate: "no",
|
|
3491
3695
|
className: "truncate text-lg tracking-tight",
|
|
3492
3696
|
children: e.operation
|
|
3493
3697
|
}),
|
|
3494
|
-
/* @__PURE__ */ d(
|
|
3698
|
+
/* @__PURE__ */ d(na, {
|
|
3495
3699
|
className: "text-[13px] tabular-nums",
|
|
3496
3700
|
children: [
|
|
3497
|
-
|
|
3701
|
+
ao[e.kind],
|
|
3498
3702
|
" · ",
|
|
3499
|
-
|
|
3703
|
+
at(e.startedAtMs)
|
|
3500
3704
|
]
|
|
3501
3705
|
})
|
|
3502
3706
|
]
|
|
3503
|
-
}), /* @__PURE__ */ u(
|
|
3707
|
+
}), /* @__PURE__ */ u(so, {
|
|
3504
3708
|
call: e,
|
|
3505
3709
|
blocker: t,
|
|
3506
3710
|
onShowLogs: n
|
|
3507
3711
|
})] });
|
|
3508
3712
|
}
|
|
3509
|
-
function
|
|
3510
|
-
let r = e.queueWaitMs, i = r === null ? null :
|
|
3713
|
+
function so({ call: e, blocker: t, onShowLogs: n }) {
|
|
3714
|
+
let r = e.queueWaitMs, i = r === null ? null : B(e), a = r !== null && e.durationMs > 0 ? r / e.durationMs * 100 : 0;
|
|
3511
3715
|
return /* @__PURE__ */ d("div", {
|
|
3512
3716
|
className: "min-h-0 flex-1 overflow-y-auto px-5 py-4",
|
|
3513
3717
|
children: [
|
|
3514
3718
|
/* @__PURE__ */ d("div", {
|
|
3515
3719
|
className: "grid grid-cols-3 gap-3",
|
|
3516
3720
|
children: [
|
|
3517
|
-
/* @__PURE__ */ u(
|
|
3721
|
+
/* @__PURE__ */ u(lo, {
|
|
3518
3722
|
label: "Queue",
|
|
3519
3723
|
ms: r
|
|
3520
3724
|
}),
|
|
3521
|
-
/* @__PURE__ */ u(
|
|
3725
|
+
/* @__PURE__ */ u(lo, {
|
|
3522
3726
|
label: "In actor",
|
|
3523
3727
|
ms: i
|
|
3524
3728
|
}),
|
|
3525
|
-
/* @__PURE__ */ u(
|
|
3729
|
+
/* @__PURE__ */ u(lo, {
|
|
3526
3730
|
label: "Overall",
|
|
3527
3731
|
ms: e.durationMs
|
|
3528
3732
|
})
|
|
@@ -3531,7 +3735,7 @@ function Ba({ call: e, blocker: t, onShowLogs: n }) {
|
|
|
3531
3735
|
/* @__PURE__ */ d("div", {
|
|
3532
3736
|
className: "mt-3.5 flex h-2 overflow-hidden rounded-full bg-muted",
|
|
3533
3737
|
"aria-hidden": !0,
|
|
3534
|
-
children: [a > 0 && /* @__PURE__ */ u(
|
|
3738
|
+
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
3739
|
}),
|
|
3536
3740
|
r === null ? /* @__PURE__ */ u("p", {
|
|
3537
3741
|
className: "mt-2.5 text-xs text-muted-foreground",
|
|
@@ -3563,11 +3767,11 @@ function Ba({ call: e, blocker: t, onShowLogs: n }) {
|
|
|
3563
3767
|
}),
|
|
3564
3768
|
/* @__PURE__ */ u($, {
|
|
3565
3769
|
label: "Kind",
|
|
3566
|
-
value:
|
|
3770
|
+
value: ao[e.kind]
|
|
3567
3771
|
}),
|
|
3568
3772
|
/* @__PURE__ */ u($, {
|
|
3569
3773
|
label: "Outcome",
|
|
3570
|
-
value:
|
|
3774
|
+
value: io[e.outcome],
|
|
3571
3775
|
danger: e.outcome !== "completed"
|
|
3572
3776
|
}),
|
|
3573
3777
|
/* @__PURE__ */ u($, {
|
|
@@ -3597,16 +3801,16 @@ function Ba({ call: e, blocker: t, onShowLogs: n }) {
|
|
|
3597
3801
|
})
|
|
3598
3802
|
]
|
|
3599
3803
|
}),
|
|
3600
|
-
/* @__PURE__ */ u(
|
|
3804
|
+
/* @__PURE__ */ u(co, { onShowLogs: n })
|
|
3601
3805
|
]
|
|
3602
3806
|
});
|
|
3603
3807
|
}
|
|
3604
|
-
function
|
|
3605
|
-
let t =
|
|
3808
|
+
function co({ onShowLogs: e }) {
|
|
3809
|
+
let t = aa();
|
|
3606
3810
|
function n() {
|
|
3607
3811
|
t.close(), e();
|
|
3608
3812
|
}
|
|
3609
|
-
return /* @__PURE__ */ d(
|
|
3813
|
+
return /* @__PURE__ */ d(H, {
|
|
3610
3814
|
variant: "link",
|
|
3611
3815
|
size: "sm",
|
|
3612
3816
|
className: "mt-3 px-0 text-[13px] has-[>svg]:px-0",
|
|
@@ -3614,8 +3818,8 @@ function Va({ onShowLogs: e }) {
|
|
|
3614
3818
|
children: ["View logs", /* @__PURE__ */ u(y, { "aria-hidden": !0 })]
|
|
3615
3819
|
});
|
|
3616
3820
|
}
|
|
3617
|
-
function
|
|
3618
|
-
let [n, r] =
|
|
3821
|
+
function lo({ label: e, ms: t }) {
|
|
3822
|
+
let [n, r] = ft(t ?? 0);
|
|
3619
3823
|
return /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("div", {
|
|
3620
3824
|
className: "text-xs text-muted-foreground",
|
|
3621
3825
|
children: e
|
|
@@ -3627,11 +3831,11 @@ function Ha({ label: e, ms: t }) {
|
|
|
3627
3831
|
})] })
|
|
3628
3832
|
})] });
|
|
3629
3833
|
}
|
|
3630
|
-
function
|
|
3834
|
+
function uo({ state: e }) {
|
|
3631
3835
|
let t = e === "warm";
|
|
3632
3836
|
return /* @__PURE__ */ d("span", {
|
|
3633
|
-
className:
|
|
3634
|
-
children: [/* @__PURE__ */ u("span", { className:
|
|
3837
|
+
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"),
|
|
3838
|
+
children: [/* @__PURE__ */ u("span", { className: V("size-1.5 rounded-full", t ? "bg-success" : "bg-warning") }), t ? "Warm" : "Cold"]
|
|
3635
3839
|
});
|
|
3636
3840
|
}
|
|
3637
3841
|
function $({ label: e, value: t, mono: n, danger: r }) {
|
|
@@ -3642,14 +3846,14 @@ function $({ label: e, value: t, mono: n, danger: r }) {
|
|
|
3642
3846
|
children: e
|
|
3643
3847
|
}), /* @__PURE__ */ u("dd", {
|
|
3644
3848
|
translate: n ? "no" : void 0,
|
|
3645
|
-
className:
|
|
3849
|
+
className: V("text-[13px] text-foreground/90", n && "font-mono text-xs break-all", r && "text-danger"),
|
|
3646
3850
|
children: t
|
|
3647
3851
|
})]
|
|
3648
3852
|
});
|
|
3649
3853
|
}
|
|
3650
3854
|
//#endregion
|
|
3651
3855
|
//#region src/components/instance/requestsCard.tsx
|
|
3652
|
-
var
|
|
3856
|
+
var fo = .9, po = [
|
|
3653
3857
|
1,
|
|
3654
3858
|
2,
|
|
3655
3859
|
5,
|
|
@@ -3669,7 +3873,7 @@ var Wa = .9, Ga = [
|
|
|
3669
3873
|
9e5,
|
|
3670
3874
|
36e5,
|
|
3671
3875
|
216e5
|
|
3672
|
-
],
|
|
3876
|
+
], mo = [
|
|
3673
3877
|
{
|
|
3674
3878
|
label: "ms",
|
|
3675
3879
|
ms: 1,
|
|
@@ -3685,24 +3889,24 @@ var Wa = .9, Ga = [
|
|
|
3685
3889
|
ms: 6e4,
|
|
3686
3890
|
below: Infinity
|
|
3687
3891
|
}
|
|
3688
|
-
],
|
|
3892
|
+
], ho = "grid grid-cols-[52px_minmax(0,150px)_1fr_52px_70px_70px] items-center gap-4.5", go = {
|
|
3689
3893
|
completed: "ok",
|
|
3690
3894
|
failed: "failed",
|
|
3691
3895
|
rejected: "rejected",
|
|
3692
3896
|
rerouted: "rerouted",
|
|
3693
3897
|
interrupted: "interrupted"
|
|
3694
|
-
},
|
|
3898
|
+
}, _o = {
|
|
3695
3899
|
method: "rpc",
|
|
3696
3900
|
websocket: "ws"
|
|
3697
3901
|
};
|
|
3698
|
-
function
|
|
3699
|
-
let [i, a] = o(null), s =
|
|
3902
|
+
function vo({ requests: e, failed: t, timeWindow: n, onShowLogs: r }) {
|
|
3903
|
+
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
3904
|
function g(e, t) {
|
|
3701
3905
|
if (s.openKey === e.eventId) return s.close();
|
|
3702
|
-
let n = c ?
|
|
3906
|
+
let n = c ? Mo(e, c) : void 0;
|
|
3703
3907
|
s.show({
|
|
3704
3908
|
key: e.eventId,
|
|
3705
|
-
content: /* @__PURE__ */ u(
|
|
3909
|
+
content: /* @__PURE__ */ u(oo, {
|
|
3706
3910
|
call: e,
|
|
3707
3911
|
blocker: n,
|
|
3708
3912
|
onShowLogs: () => r(e.requestId)
|
|
@@ -3711,46 +3915,46 @@ function Xa({ requests: e, failed: t, timeWindow: n, onShowLogs: r }) {
|
|
|
3711
3915
|
}
|
|
3712
3916
|
return /* @__PURE__ */ u(K, {
|
|
3713
3917
|
title: "Requests",
|
|
3714
|
-
aside: /* @__PURE__ */ u(
|
|
3918
|
+
aside: /* @__PURE__ */ u(xo, {}),
|
|
3715
3919
|
busy: !f && !t,
|
|
3716
3920
|
className: "pb-3.5",
|
|
3717
3921
|
children: t ? /* @__PURE__ */ u("p", {
|
|
3718
3922
|
className: "py-4 text-[13px] text-muted-foreground",
|
|
3719
3923
|
children: "Couldn't reach the observer API."
|
|
3720
|
-
}) : f && p !== null && m && h ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
3924
|
+
}) : f && p !== null && m && h ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(So, {
|
|
3721
3925
|
counts: f,
|
|
3722
3926
|
selected: p,
|
|
3723
3927
|
onSelect: a,
|
|
3724
3928
|
timeWindow: n
|
|
3725
|
-
}), /* @__PURE__ */ u(
|
|
3929
|
+
}), /* @__PURE__ */ u(Co, {
|
|
3726
3930
|
calls: h,
|
|
3727
3931
|
total: m.length,
|
|
3728
3932
|
inspectedId: s.openKey,
|
|
3729
3933
|
onInspect: g
|
|
3730
|
-
})] }) : /* @__PURE__ */ u(
|
|
3934
|
+
})] }) : /* @__PURE__ */ u(Io, {})
|
|
3731
3935
|
});
|
|
3732
3936
|
}
|
|
3733
|
-
function
|
|
3937
|
+
function yo(e) {
|
|
3734
3938
|
let t = [...e].reverse().findIndex((e) => e > 0);
|
|
3735
3939
|
return e.length - 1 - Math.max(t, 0);
|
|
3736
3940
|
}
|
|
3737
|
-
function
|
|
3738
|
-
return e.filter((e) =>
|
|
3941
|
+
function bo(e, t, n) {
|
|
3942
|
+
return e.filter((e) => Dt(t, e.startedAtMs) === n).sort((e, t) => e.startedAtMs - t.startedAtMs);
|
|
3739
3943
|
}
|
|
3740
|
-
function
|
|
3944
|
+
function xo() {
|
|
3741
3945
|
return /* @__PURE__ */ d("div", {
|
|
3742
3946
|
className: "flex gap-4.5 text-xs text-muted-foreground",
|
|
3743
3947
|
children: [/* @__PURE__ */ d("span", {
|
|
3744
3948
|
className: "flex items-center gap-1.75",
|
|
3745
|
-
children: [/* @__PURE__ */ u(
|
|
3949
|
+
children: [/* @__PURE__ */ u(ro, { className: "h-2 w-4 rounded-xs" }), "Queue wait"]
|
|
3746
3950
|
}), /* @__PURE__ */ d("span", {
|
|
3747
3951
|
className: "flex items-center gap-1.75",
|
|
3748
3952
|
children: [/* @__PURE__ */ u("span", { className: "h-2 w-4 rounded-xs bg-foreground" }), "Running"]
|
|
3749
3953
|
})]
|
|
3750
3954
|
});
|
|
3751
3955
|
}
|
|
3752
|
-
function
|
|
3753
|
-
let i = (e) => r.fromMs + e * r.stepMs, a = Math.min(i(t + 1), r.toMs), o = r.stepMs < 6e4 ?
|
|
3956
|
+
function So({ counts: e, selected: t, onSelect: n, timeWindow: r }) {
|
|
3957
|
+
let i = (e) => r.fromMs + e * r.stepMs, a = Math.min(i(t + 1), r.toMs), o = r.stepMs < 6e4 ? it : T;
|
|
3754
3958
|
return /* @__PURE__ */ d("div", {
|
|
3755
3959
|
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
3960
|
children: [/* @__PURE__ */ d("div", {
|
|
@@ -3764,7 +3968,7 @@ function eo({ counts: e, selected: t, onSelect: n, timeWindow: r }) {
|
|
|
3764
3968
|
" – ",
|
|
3765
3969
|
o(a)
|
|
3766
3970
|
]
|
|
3767
|
-
}), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(
|
|
3971
|
+
}), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u(to, {
|
|
3768
3972
|
values: e,
|
|
3769
3973
|
highlighted: t,
|
|
3770
3974
|
onSelect: n,
|
|
@@ -3778,15 +3982,15 @@ function eo({ counts: e, selected: t, onSelect: n, timeWindow: r }) {
|
|
|
3778
3982
|
})] })]
|
|
3779
3983
|
});
|
|
3780
3984
|
}
|
|
3781
|
-
function
|
|
3985
|
+
function Co({ calls: e, total: t, inspectedId: n, onInspect: r }) {
|
|
3782
3986
|
if (!e.length) return /* @__PURE__ */ u("p", {
|
|
3783
3987
|
className: "py-6 text-[13px] text-muted-foreground",
|
|
3784
3988
|
children: "No requests in this slice."
|
|
3785
3989
|
});
|
|
3786
|
-
let i = e[0].startedAtMs, a =
|
|
3990
|
+
let i = e[0].startedAtMs, a = To(wo(e)), o = Eo(e);
|
|
3787
3991
|
return /* @__PURE__ */ d(l, { children: [
|
|
3788
|
-
/* @__PURE__ */ u(
|
|
3789
|
-
/* @__PURE__ */ u("ol", { children: o.map((t) => /* @__PURE__ */ u(
|
|
3992
|
+
/* @__PURE__ */ u(Do, { scale: a }),
|
|
3993
|
+
/* @__PURE__ */ u("ol", { children: o.map((t) => /* @__PURE__ */ u(Oo, {
|
|
3790
3994
|
row: t,
|
|
3791
3995
|
calls: e,
|
|
3792
3996
|
origin: i,
|
|
@@ -3794,24 +3998,24 @@ function to({ calls: e, total: t, inspectedId: n, onInspect: r }) {
|
|
|
3794
3998
|
inspectedId: n,
|
|
3795
3999
|
onInspect: r
|
|
3796
4000
|
}, t.key)) }),
|
|
3797
|
-
/* @__PURE__ */ u(
|
|
4001
|
+
/* @__PURE__ */ u(Fo, {
|
|
3798
4002
|
shown: e.length,
|
|
3799
4003
|
total: t
|
|
3800
4004
|
})
|
|
3801
4005
|
] });
|
|
3802
4006
|
}
|
|
3803
|
-
function
|
|
4007
|
+
function wo(e) {
|
|
3804
4008
|
return Math.max(...e.map((e) => e.startedAtMs + e.durationMs)) - e[0].startedAtMs;
|
|
3805
4009
|
}
|
|
3806
|
-
function
|
|
3807
|
-
let t = e /
|
|
4010
|
+
function To(e) {
|
|
4011
|
+
let t = e / fo, n = po.find((e) => t / e <= 6) ?? po.at(-1), r = Math.max(n, Math.ceil(t / n) * n);
|
|
3808
4012
|
return {
|
|
3809
4013
|
spanMs: r,
|
|
3810
4014
|
ticks: Array.from({ length: r / n + 1 }, (e, t) => t * n),
|
|
3811
|
-
unit:
|
|
4015
|
+
unit: mo.find((e) => r < e.below) ?? mo.at(-1)
|
|
3812
4016
|
};
|
|
3813
4017
|
}
|
|
3814
|
-
function
|
|
4018
|
+
function Eo(e) {
|
|
3815
4019
|
let t = /* @__PURE__ */ new Map();
|
|
3816
4020
|
for (let n of e) {
|
|
3817
4021
|
let e = `${n.kind}:${n.operation}`, r = t.get(e) ?? {
|
|
@@ -3824,19 +4028,19 @@ function io(e) {
|
|
|
3824
4028
|
}
|
|
3825
4029
|
return [...t.values()].sort((e, t) => t.calls.length - e.calls.length || e.calls[0].startedAtMs - t.calls[0].startedAtMs);
|
|
3826
4030
|
}
|
|
3827
|
-
function
|
|
4031
|
+
function Do({ scale: { spanMs: e, ticks: t, unit: n } }) {
|
|
3828
4032
|
return /* @__PURE__ */ d("div", {
|
|
3829
4033
|
"aria-hidden": !0,
|
|
3830
|
-
className: `${
|
|
4034
|
+
className: `${ho} h-7.5 border-b text-xs text-muted-foreground`,
|
|
3831
4035
|
children: [
|
|
3832
4036
|
/* @__PURE__ */ u("span", { children: "Kind" }),
|
|
3833
4037
|
/* @__PURE__ */ u("span", { children: "Method" }),
|
|
3834
4038
|
/* @__PURE__ */ u("div", {
|
|
3835
4039
|
className: "relative h-full text-[11px] tabular-nums",
|
|
3836
4040
|
children: t.map((r, i) => /* @__PURE__ */ u("span", {
|
|
3837
|
-
className:
|
|
4041
|
+
className: V("absolute top-2", i === 0 ? "" : i === t.length - 1 ? "-translate-x-full" : "-translate-x-1/2"),
|
|
3838
4042
|
style: { left: `${r / e * 100}%` },
|
|
3839
|
-
children: i === 0 ? `+0\u00a0${n.label}` :
|
|
4043
|
+
children: i === 0 ? `+0\u00a0${n.label}` : ut(r / n.ms)
|
|
3840
4044
|
}, r))
|
|
3841
4045
|
}),
|
|
3842
4046
|
/* @__PURE__ */ u("span", {
|
|
@@ -3854,18 +4058,18 @@ function ao({ scale: { spanMs: e, ticks: t, unit: n } }) {
|
|
|
3854
4058
|
]
|
|
3855
4059
|
});
|
|
3856
4060
|
}
|
|
3857
|
-
function
|
|
3858
|
-
let o = e.calls.some(
|
|
4061
|
+
function Oo({ row: e, calls: t, origin: n, scale: r, inspectedId: i, onInspect: a }) {
|
|
4062
|
+
let o = e.calls.some(ko), s = dn(e.calls, nn) ?? 0, c = dn(e.calls, B) ?? 0;
|
|
3859
4063
|
return /* @__PURE__ */ d("li", {
|
|
3860
|
-
className: `${
|
|
4064
|
+
className: `${ho} h-10 border-b border-border/50 text-xs tabular-nums last:border-b-0`,
|
|
3861
4065
|
children: [
|
|
3862
|
-
/* @__PURE__ */ u(
|
|
4066
|
+
/* @__PURE__ */ u(Ao, { kind: e.kind }),
|
|
3863
4067
|
/* @__PURE__ */ u("span", {
|
|
3864
4068
|
translate: "no",
|
|
3865
|
-
className:
|
|
4069
|
+
className: V("truncate text-[13px]", o ? "text-danger" : "text-foreground/90"),
|
|
3866
4070
|
children: e.operation
|
|
3867
4071
|
}),
|
|
3868
|
-
/* @__PURE__ */ u(
|
|
4072
|
+
/* @__PURE__ */ u(jo, {
|
|
3869
4073
|
row: e,
|
|
3870
4074
|
calls: t,
|
|
3871
4075
|
origin: n,
|
|
@@ -3874,7 +4078,7 @@ function oo({ row: e, calls: t, origin: n, scale: r, inspectedId: i, onInspect:
|
|
|
3874
4078
|
onInspect: a
|
|
3875
4079
|
}),
|
|
3876
4080
|
/* @__PURE__ */ u("span", {
|
|
3877
|
-
className:
|
|
4081
|
+
className: V("text-right", o ? "text-danger" : "text-foreground/90"),
|
|
3878
4082
|
children: E(e.calls.length)
|
|
3879
4083
|
}),
|
|
3880
4084
|
/* @__PURE__ */ u("span", {
|
|
@@ -3888,25 +4092,25 @@ function oo({ row: e, calls: t, origin: n, scale: r, inspectedId: i, onInspect:
|
|
|
3888
4092
|
]
|
|
3889
4093
|
});
|
|
3890
4094
|
}
|
|
3891
|
-
function
|
|
4095
|
+
function ko(e) {
|
|
3892
4096
|
return e.outcome !== "completed";
|
|
3893
4097
|
}
|
|
3894
|
-
function
|
|
4098
|
+
function Ao({ kind: e }) {
|
|
3895
4099
|
return /* @__PURE__ */ u("span", {
|
|
3896
|
-
className:
|
|
3897
|
-
children:
|
|
4100
|
+
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"),
|
|
4101
|
+
children: _o[e]
|
|
3898
4102
|
});
|
|
3899
4103
|
}
|
|
3900
|
-
function
|
|
4104
|
+
function jo({ row: e, calls: t, origin: n, scale: { spanMs: r, ticks: i }, inspectedId: a, onInspect: o }) {
|
|
3901
4105
|
let s = (e) => `${e / r * 100}%`;
|
|
3902
4106
|
return /* @__PURE__ */ u("div", {
|
|
3903
4107
|
role: "group",
|
|
3904
4108
|
"aria-label": `${e.operation} calls`,
|
|
3905
4109
|
className: "relative h-full bg-[linear-gradient(90deg,color-mix(in_oklab,var(--border)_55%,transparent)_1px,transparent_1px)]",
|
|
3906
4110
|
style: { backgroundSize: `${100 / (i.length - 1)}% 100%` },
|
|
3907
|
-
children: e.calls.map((e) => /* @__PURE__ */ u(
|
|
4111
|
+
children: e.calls.map((e) => /* @__PURE__ */ u(No, {
|
|
3908
4112
|
call: e,
|
|
3909
|
-
blocker:
|
|
4113
|
+
blocker: Mo(e, t),
|
|
3910
4114
|
selected: e.eventId === a,
|
|
3911
4115
|
onInspect: o,
|
|
3912
4116
|
left: s(e.startedAtMs - n),
|
|
@@ -3914,45 +4118,45 @@ function lo({ row: e, calls: t, origin: n, scale: { spanMs: r, ticks: i }, inspe
|
|
|
3914
4118
|
}, e.eventId))
|
|
3915
4119
|
});
|
|
3916
4120
|
}
|
|
3917
|
-
function
|
|
4121
|
+
function Mo(e, t) {
|
|
3918
4122
|
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
4123
|
}
|
|
3920
|
-
function
|
|
3921
|
-
let o = e.durationMs > 0 ? (e.queueWaitMs ?? 0) / e.durationMs : 0, s =
|
|
3922
|
-
return /* @__PURE__ */ d(
|
|
4124
|
+
function No({ call: e, blocker: t, selected: n, onInspect: r, left: i, width: a }) {
|
|
4125
|
+
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]}` : ""}`;
|
|
4126
|
+
return /* @__PURE__ */ d(q, { children: [/* @__PURE__ */ u(J, {
|
|
3923
4127
|
asChild: !0,
|
|
3924
4128
|
children: /* @__PURE__ */ d("button", {
|
|
3925
4129
|
type: "button",
|
|
3926
4130
|
"aria-pressed": n,
|
|
3927
4131
|
"aria-label": l,
|
|
3928
4132
|
onClick: (t) => r(e, t.currentTarget),
|
|
3929
|
-
className:
|
|
4133
|
+
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
4134
|
style: {
|
|
3931
4135
|
left: i,
|
|
3932
4136
|
width: a
|
|
3933
4137
|
},
|
|
3934
4138
|
children: [
|
|
3935
|
-
o > 0 && /* @__PURE__ */ u(
|
|
4139
|
+
o > 0 && /* @__PURE__ */ u(ro, {
|
|
3936
4140
|
className: "h-full rounded-l-[2px]",
|
|
3937
4141
|
style: { width: `${o * 100}%` }
|
|
3938
4142
|
}),
|
|
3939
|
-
/* @__PURE__ */ u("span", { className:
|
|
4143
|
+
/* @__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
4144
|
s && /* @__PURE__ */ u("span", {
|
|
3941
4145
|
className: "absolute top-1/2 left-full ml-2 -translate-y-1/2 text-[11px] whitespace-nowrap text-danger",
|
|
3942
|
-
children:
|
|
4146
|
+
children: go[e.outcome]
|
|
3943
4147
|
})
|
|
3944
4148
|
]
|
|
3945
4149
|
})
|
|
3946
|
-
}), /* @__PURE__ */ u(
|
|
4150
|
+
}), /* @__PURE__ */ u(Y, {
|
|
3947
4151
|
className: "tabular-nums",
|
|
3948
|
-
children: /* @__PURE__ */ u(
|
|
4152
|
+
children: /* @__PURE__ */ u(Po, {
|
|
3949
4153
|
call: e,
|
|
3950
4154
|
blocker: t
|
|
3951
4155
|
})
|
|
3952
4156
|
})] });
|
|
3953
4157
|
}
|
|
3954
|
-
function
|
|
3955
|
-
let n =
|
|
4158
|
+
function Po({ call: e, blocker: t }) {
|
|
4159
|
+
let n = B(e) ?? e.durationMs;
|
|
3956
4160
|
return /* @__PURE__ */ d("span", { children: [
|
|
3957
4161
|
/* @__PURE__ */ u("b", {
|
|
3958
4162
|
className: "font-medium capitalize",
|
|
@@ -3985,10 +4189,10 @@ function po({ call: e, blocker: t }) {
|
|
|
3985
4189
|
className: "font-medium",
|
|
3986
4190
|
children: D(n)
|
|
3987
4191
|
})] }),
|
|
3988
|
-
|
|
4192
|
+
ko(e) && ` · ${go[e.outcome]}`
|
|
3989
4193
|
] });
|
|
3990
4194
|
}
|
|
3991
|
-
function
|
|
4195
|
+
function Fo({ shown: e, total: t }) {
|
|
3992
4196
|
return e >= t ? null : /* @__PURE__ */ d("p", {
|
|
3993
4197
|
className: "border-t pt-3 text-xs text-muted-foreground tabular-nums",
|
|
3994
4198
|
children: [
|
|
@@ -3999,34 +4203,34 @@ function mo({ shown: e, total: t }) {
|
|
|
3999
4203
|
]
|
|
4000
4204
|
});
|
|
4001
4205
|
}
|
|
4002
|
-
function
|
|
4206
|
+
function Io() {
|
|
4003
4207
|
return /* @__PURE__ */ d("div", {
|
|
4004
4208
|
className: "mt-3.5 pb-1",
|
|
4005
|
-
children: [/* @__PURE__ */ u(
|
|
4006
|
-
className: `${
|
|
4209
|
+
children: [/* @__PURE__ */ u(U, { className: "h-10 w-full rounded-sm" }), Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ d("div", {
|
|
4210
|
+
className: `${ho} h-10`,
|
|
4007
4211
|
children: [
|
|
4008
|
-
/* @__PURE__ */ u(
|
|
4009
|
-
/* @__PURE__ */ u(
|
|
4010
|
-
/* @__PURE__ */ u(
|
|
4212
|
+
/* @__PURE__ */ u(U, { className: "h-4" }),
|
|
4213
|
+
/* @__PURE__ */ u(U, { className: "h-3.5 w-28" }),
|
|
4214
|
+
/* @__PURE__ */ u(U, {
|
|
4011
4215
|
className: "h-3 rounded-[2px]",
|
|
4012
4216
|
style: {
|
|
4013
4217
|
width: `${20 + t * 12}%`,
|
|
4014
4218
|
marginLeft: `${t * 14}%`
|
|
4015
4219
|
}
|
|
4016
4220
|
}),
|
|
4017
|
-
/* @__PURE__ */ u(
|
|
4018
|
-
/* @__PURE__ */ u(
|
|
4019
|
-
/* @__PURE__ */ u(
|
|
4221
|
+
/* @__PURE__ */ u(U, { className: "ml-auto h-3.5 w-6" }),
|
|
4222
|
+
/* @__PURE__ */ u(U, { className: "ml-auto h-3.5 w-10" }),
|
|
4223
|
+
/* @__PURE__ */ u(U, { className: "ml-auto h-3.5 w-10" })
|
|
4020
4224
|
]
|
|
4021
4225
|
}, t))]
|
|
4022
4226
|
});
|
|
4023
4227
|
}
|
|
4024
4228
|
//#endregion
|
|
4025
4229
|
//#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 } =
|
|
4230
|
+
function Lo() {
|
|
4231
|
+
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
4232
|
function ee(e) {
|
|
4029
|
-
y(e), document.getElementById(
|
|
4233
|
+
y(e), document.getElementById(Ua)?.scrollIntoView({
|
|
4030
4234
|
behavior: "smooth",
|
|
4031
4235
|
block: "start"
|
|
4032
4236
|
});
|
|
@@ -4034,7 +4238,7 @@ function go() {
|
|
|
4034
4238
|
return /* @__PURE__ */ d("section", {
|
|
4035
4239
|
"aria-labelledby": "instance-heading",
|
|
4036
4240
|
className: "flex flex-col gap-5",
|
|
4037
|
-
children: [/* @__PURE__ */ u(
|
|
4241
|
+
children: [/* @__PURE__ */ u(Ro, {
|
|
4038
4242
|
actorName: e,
|
|
4039
4243
|
actorId: t,
|
|
4040
4244
|
instance: m,
|
|
@@ -4056,24 +4260,24 @@ function go() {
|
|
|
4056
4260
|
/* @__PURE__ */ d("div", {
|
|
4057
4261
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
4058
4262
|
children: [
|
|
4059
|
-
/* @__PURE__ */ u(
|
|
4263
|
+
/* @__PURE__ */ u(oa, {
|
|
4060
4264
|
requests: c,
|
|
4061
4265
|
failed: l,
|
|
4062
4266
|
timeWindow: s,
|
|
4063
4267
|
color: "var(--foreground)"
|
|
4064
4268
|
}),
|
|
4065
|
-
/* @__PURE__ */ u(
|
|
4269
|
+
/* @__PURE__ */ u(Si, {
|
|
4066
4270
|
label: "Avg Queue Wait",
|
|
4067
|
-
pick:
|
|
4271
|
+
pick: nn,
|
|
4068
4272
|
color: "var(--chart-1)",
|
|
4069
4273
|
chartLabel: `Average queue wait, ${M(s)}`,
|
|
4070
4274
|
requests: c,
|
|
4071
4275
|
failed: l,
|
|
4072
4276
|
timeWindow: s
|
|
4073
4277
|
}),
|
|
4074
|
-
/* @__PURE__ */ u(
|
|
4278
|
+
/* @__PURE__ */ u(Si, {
|
|
4075
4279
|
label: "Avg Request Time",
|
|
4076
|
-
pick:
|
|
4280
|
+
pick: B,
|
|
4077
4281
|
color: "var(--foreground)",
|
|
4078
4282
|
chartLabel: `Average request time excluding the queue, ${M(s)}`,
|
|
4079
4283
|
requests: c,
|
|
@@ -4082,13 +4286,13 @@ function go() {
|
|
|
4082
4286
|
})
|
|
4083
4287
|
]
|
|
4084
4288
|
}),
|
|
4085
|
-
/* @__PURE__ */ u(
|
|
4289
|
+
/* @__PURE__ */ u(vo, {
|
|
4086
4290
|
requests: c,
|
|
4087
4291
|
failed: l,
|
|
4088
4292
|
timeWindow: s,
|
|
4089
4293
|
onShowLogs: ee
|
|
4090
4294
|
}),
|
|
4091
|
-
/* @__PURE__ */ u(
|
|
4295
|
+
/* @__PURE__ */ u(ua, {
|
|
4092
4296
|
instance: m,
|
|
4093
4297
|
sessions: h,
|
|
4094
4298
|
livePeriods: g,
|
|
@@ -4096,21 +4300,26 @@ function go() {
|
|
|
4096
4300
|
failed: r || a || p,
|
|
4097
4301
|
timeWindow: s
|
|
4098
4302
|
}),
|
|
4099
|
-
/* @__PURE__ */ u(
|
|
4303
|
+
/* @__PURE__ */ u(Ja, {
|
|
4100
4304
|
actorName: e,
|
|
4101
4305
|
actorId: t,
|
|
4102
4306
|
requests: c,
|
|
4103
4307
|
requestId: v,
|
|
4104
4308
|
onRequestChange: y,
|
|
4105
4309
|
timeWindow: s
|
|
4310
|
+
}),
|
|
4311
|
+
/* @__PURE__ */ u(va, {
|
|
4312
|
+
actorName: e,
|
|
4313
|
+
actorId: t,
|
|
4314
|
+
timeWindow: s
|
|
4106
4315
|
})
|
|
4107
4316
|
]
|
|
4108
4317
|
})]
|
|
4109
4318
|
});
|
|
4110
4319
|
}
|
|
4111
|
-
function
|
|
4320
|
+
function Ro({ actorName: e, actorId: t, instance: n, livePeriods: r, timeWindow: i, loading: a }) {
|
|
4112
4321
|
let o = n?.status === "live";
|
|
4113
|
-
return /* @__PURE__ */ u(
|
|
4322
|
+
return /* @__PURE__ */ u(An, {
|
|
4114
4323
|
titleId: "instance-heading",
|
|
4115
4324
|
title: t,
|
|
4116
4325
|
back: {
|
|
@@ -4118,46 +4327,46 @@ function _o({ actorName: e, actorId: t, instance: n, livePeriods: r, timeWindow:
|
|
|
4118
4327
|
relative: "path",
|
|
4119
4328
|
label: e
|
|
4120
4329
|
},
|
|
4121
|
-
badge: n && /* @__PURE__ */ u(
|
|
4122
|
-
meta: a ? /* @__PURE__ */ u(
|
|
4330
|
+
badge: n && /* @__PURE__ */ u(zo, { live: o }),
|
|
4331
|
+
meta: a ? /* @__PURE__ */ u(U, { className: "h-3.5 w-64" }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", {
|
|
4123
4332
|
translate: "no",
|
|
4124
4333
|
children: e
|
|
4125
4334
|
}), n && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", {
|
|
4126
4335
|
"aria-hidden": !0,
|
|
4127
4336
|
children: "·"
|
|
4128
|
-
}), /* @__PURE__ */ u("span", { children:
|
|
4129
|
-
aside: /* @__PURE__ */ u(
|
|
4337
|
+
}), /* @__PURE__ */ u("span", { children: Bo(n, r, i) })] })] }),
|
|
4338
|
+
aside: /* @__PURE__ */ u(On, {})
|
|
4130
4339
|
});
|
|
4131
4340
|
}
|
|
4132
|
-
function
|
|
4133
|
-
return /* @__PURE__ */ u(
|
|
4341
|
+
function zo({ live: e }) {
|
|
4342
|
+
return /* @__PURE__ */ u(Ar, {
|
|
4134
4343
|
live: e,
|
|
4135
4344
|
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
4345
|
children: e ? "Live" : "Dormant"
|
|
4137
4346
|
});
|
|
4138
4347
|
}
|
|
4139
|
-
function
|
|
4140
|
-
if (e.status !== "live") return e.lastActiveAtMs ? `Last active ${
|
|
4348
|
+
function Bo(e, t, { fromMs: n, toMs: r }) {
|
|
4349
|
+
if (e.status !== "live") return e.lastActiveAtMs ? `Last active ${pt(e.lastActiveAtMs, r)}` : "Dormant";
|
|
4141
4350
|
let i = t?.at(-1)?.fromMs;
|
|
4142
4351
|
return i === void 0 ? "Live" : i <= n ? "Live for the whole window" : `Live since ${T(i)} (${k(r - i)})`;
|
|
4143
4352
|
}
|
|
4144
4353
|
//#endregion
|
|
4145
4354
|
//#region src/routes.tsx
|
|
4146
|
-
function
|
|
4147
|
-
return /* @__PURE__ */ d(
|
|
4355
|
+
function Vo() {
|
|
4356
|
+
return /* @__PURE__ */ d(ia, { children: [/* @__PURE__ */ u(Uo, {}), /* @__PURE__ */ d(h, { children: [
|
|
4148
4357
|
/* @__PURE__ */ u(m, {
|
|
4149
4358
|
index: !0,
|
|
4150
|
-
element: /* @__PURE__ */ u(
|
|
4359
|
+
element: /* @__PURE__ */ u(Ji, {})
|
|
4151
4360
|
}),
|
|
4152
4361
|
/* @__PURE__ */ u(m, {
|
|
4153
4362
|
path: "actors/:actorName",
|
|
4154
|
-
element: /* @__PURE__ */ u(
|
|
4363
|
+
element: /* @__PURE__ */ u(Ci, {})
|
|
4155
4364
|
}),
|
|
4156
4365
|
/* @__PURE__ */ u(m, {
|
|
4157
4366
|
path: "actors/:actorName/instances/:actorId",
|
|
4158
|
-
element: /* @__PURE__ */ u(
|
|
4159
|
-
initialRange:
|
|
4160
|
-
children: /* @__PURE__ */ u(
|
|
4367
|
+
element: /* @__PURE__ */ u(Lt, {
|
|
4368
|
+
initialRange: yt,
|
|
4369
|
+
children: /* @__PURE__ */ u(Lo, {})
|
|
4161
4370
|
})
|
|
4162
4371
|
}),
|
|
4163
4372
|
/* @__PURE__ */ u(m, {
|
|
@@ -4169,20 +4378,20 @@ function bo() {
|
|
|
4169
4378
|
})
|
|
4170
4379
|
] })] });
|
|
4171
4380
|
}
|
|
4172
|
-
var
|
|
4381
|
+
var Ho = [
|
|
4173
4382
|
"actors",
|
|
4174
4383
|
"websockets",
|
|
4175
4384
|
"requests"
|
|
4176
4385
|
];
|
|
4177
|
-
function
|
|
4386
|
+
function Uo() {
|
|
4178
4387
|
let { pathname: e } = g(), { mutate: t } = c(), n = a(!0);
|
|
4179
4388
|
return r(() => {
|
|
4180
4389
|
if (n.current) {
|
|
4181
4390
|
n.current = !1;
|
|
4182
4391
|
return;
|
|
4183
4392
|
}
|
|
4184
|
-
t((e) => Array.isArray(e) &&
|
|
4393
|
+
t((e) => Array.isArray(e) && Ho.includes(e[0]));
|
|
4185
4394
|
}, [e, t]), null;
|
|
4186
4395
|
}
|
|
4187
4396
|
//#endregion
|
|
4188
|
-
export {
|
|
4397
|
+
export { Ci as ActorTypePage, Wt as DataProvider, Vo as ObserverRoutes, Ji as Overview, Lt as TimeRangeProvider };
|