durable-actors-observer 0.6.1 → 0.7.1
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 +7 -1
- package/dist/RequestTimeline.d.ts +7 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1309 -1108
- package/dist/request-timeline.d.ts +12 -0
- package/dist/standalone/app.css +1 -1
- package/dist/standalone/app.js +24 -24
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
2
|
import { useEffect as t, useId as n, useMemo as r, useRef as i, useState as a } from "react";
|
|
3
|
-
import { Activity as o, ArrowRight as s, Box as c, Cable as l, Calendar as u,
|
|
4
|
-
import { Command as
|
|
5
|
-
import { clsx as
|
|
6
|
-
import { extendTailwindMerge as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { Slot as
|
|
9
|
-
import { cva as
|
|
10
|
-
import { DayPicker as
|
|
11
|
-
import * as
|
|
3
|
+
import { Activity as o, ArrowRight as s, Box as c, Cable as l, Calendar as u, ChartNoAxesGantt as d, ChevronDown as f, ChevronDownIcon as p, ChevronLeftIcon as m, ChevronRightIcon as h, CircleHelp as g, Download as _, Hash as v, LayoutGrid as y, List as ee, Pause as b, Play as x, RefreshCw as te, Search as S, SearchIcon as C, SunMoon as w, Unplug as T, X as E } from "lucide-react";
|
|
4
|
+
import { Command as D } from "cmdk";
|
|
5
|
+
import { clsx as O } from "clsx";
|
|
6
|
+
import { extendTailwindMerge as k } from "tailwind-merge";
|
|
7
|
+
import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
8
|
+
import { Slot as N } from "@radix-ui/react-slot";
|
|
9
|
+
import { cva as P } from "class-variance-authority";
|
|
10
|
+
import { DayPicker as F, getDefaultClassNames as I } from "react-day-picker";
|
|
11
|
+
import * as ne from "@radix-ui/react-popover";
|
|
12
12
|
import * as L from "@radix-ui/react-dialog";
|
|
13
|
-
import { JsonView as
|
|
14
|
-
import { create as
|
|
15
|
-
import { format as
|
|
16
|
-
import { createParser as
|
|
13
|
+
import { JsonView as re } from "react-json-view-lite";
|
|
14
|
+
import { create as ie } from "jsondiffpatch";
|
|
15
|
+
import { format as ae } from "jsondiffpatch/formatters/html";
|
|
16
|
+
import { createParser as oe } from "eventsource-parser";
|
|
17
17
|
//#region src/lib/utils.ts
|
|
18
|
-
var
|
|
18
|
+
var se = k({ prefix: "la" });
|
|
19
19
|
function R(...e) {
|
|
20
|
-
return
|
|
20
|
+
return se(O(e));
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/components/ui/command.tsx
|
|
24
|
-
function
|
|
25
|
-
return /* @__PURE__ */
|
|
24
|
+
function ce({ className: e, ...t }) {
|
|
25
|
+
return /* @__PURE__ */ j(D, {
|
|
26
26
|
"data-slot": "command",
|
|
27
27
|
className: R("la:flex la:h-full la:w-full la:flex-col la:overflow-hidden la:rounded-md la:bg-popover la:text-popover-foreground", e),
|
|
28
28
|
...t
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
return /* @__PURE__ */
|
|
31
|
+
function le({ className: e, ...t }) {
|
|
32
|
+
return /* @__PURE__ */ M("div", {
|
|
33
33
|
"data-slot": "command-input-wrapper",
|
|
34
34
|
className: "la:flex la:h-9 la:items-center la:gap-2 la:border-b la:px-3",
|
|
35
|
-
children: [/* @__PURE__ */
|
|
35
|
+
children: [/* @__PURE__ */ j(C, { className: "la:size-4 la:shrink-0 la:opacity-50" }), /* @__PURE__ */ j(D.Input, {
|
|
36
36
|
"data-slot": "command-input",
|
|
37
37
|
className: R("la:flex la:h-10 la:w-full la:rounded-md la:bg-transparent la:py-3 la:text-sm la:outline-hidden la:placeholder:text-muted-foreground la:disabled:cursor-not-allowed la:disabled:opacity-50", e),
|
|
38
38
|
...t
|
|
39
39
|
})]
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return /* @__PURE__ */
|
|
42
|
+
function ue({ className: e, ...t }) {
|
|
43
|
+
return /* @__PURE__ */ j(D.List, {
|
|
44
44
|
"data-slot": "command-list",
|
|
45
45
|
className: R("la:max-h-[300px] la:scroll-py-1 la:overflow-x-hidden la:overflow-y-auto", e),
|
|
46
46
|
...t
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return /* @__PURE__ */
|
|
49
|
+
function de({ ...e }) {
|
|
50
|
+
return /* @__PURE__ */ j(D.Empty, {
|
|
51
51
|
"data-slot": "command-empty",
|
|
52
52
|
className: "la:py-6 la:text-center la:text-sm",
|
|
53
53
|
...e
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
return /* @__PURE__ */
|
|
56
|
+
function fe({ className: e, ...t }) {
|
|
57
|
+
return /* @__PURE__ */ j(D.Group, {
|
|
58
58
|
"data-slot": "command-group",
|
|
59
59
|
className: R("la:overflow-hidden la:p-1 la:text-foreground la:[&_[cmdk-group-heading]]:px-2 la:[&_[cmdk-group-heading]]:py-1.5 la:[&_[cmdk-group-heading]]:text-xs la:[&_[cmdk-group-heading]]:font-medium la:[&_[cmdk-group-heading]]:text-muted-foreground", e),
|
|
60
60
|
...t
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return /* @__PURE__ */
|
|
63
|
+
function pe({ className: e, ...t }) {
|
|
64
|
+
return /* @__PURE__ */ j(D.Separator, {
|
|
65
65
|
"data-slot": "command-separator",
|
|
66
66
|
className: R("la:-mx-1 la:h-px la:bg-border", e),
|
|
67
67
|
...t
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return /* @__PURE__ */
|
|
70
|
+
function me({ className: e, ...t }) {
|
|
71
|
+
return /* @__PURE__ */ j(D.Item, {
|
|
72
72
|
"data-slot": "command-item",
|
|
73
73
|
className: R("la:relative la:flex la:cursor-default la:items-center la:gap-2 la:rounded-sm la:px-2 la:py-1.5 la:text-sm la:outline-hidden la:select-none la:data-[disabled=true]:pointer-events-none la:data-[disabled=true]:opacity-50 la:data-[selected=true]:bg-accent la:data-[selected=true]:text-accent-foreground la:[&_svg]:pointer-events-none la:[&_svg]:shrink-0 la:[&_svg:not([class*='size-'])]:size-4 la:[&_svg:not([class*='text-'])]:text-muted-foreground", e),
|
|
74
74
|
...t
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return /* @__PURE__ */
|
|
77
|
+
function he({ className: e, ...t }) {
|
|
78
|
+
return /* @__PURE__ */ j("span", {
|
|
79
79
|
"data-slot": "command-shortcut",
|
|
80
80
|
className: R("la:ml-auto la:text-xs la:tracking-widest la:text-muted-foreground", e),
|
|
81
81
|
...t
|
|
@@ -83,9 +83,9 @@ function pe({ className: e, ...t }) {
|
|
|
83
83
|
}
|
|
84
84
|
//#endregion
|
|
85
85
|
//#region src/FilterCombobox.tsx
|
|
86
|
-
function
|
|
87
|
-
let [l, u] = a(!1), d =
|
|
88
|
-
return /* @__PURE__ */
|
|
86
|
+
function ge({ label: e, placeholder: t, value: n, onChange: r, onSelectSuggestion: i, suggestions: o, limit: s = 8, className: c }) {
|
|
87
|
+
let [l, u] = a(!1), d = _e(o, n, s, !!i), f = d.reduce((e, t) => e.set(t.group, [...e.get(t.group) ?? [], t]), /* @__PURE__ */ new Map()), p = l && d.length > 0;
|
|
88
|
+
return /* @__PURE__ */ M(ce, {
|
|
89
89
|
label: e,
|
|
90
90
|
shouldFilter: !1,
|
|
91
91
|
loop: !0,
|
|
@@ -93,7 +93,7 @@ function me({ label: e, placeholder: t, value: n, onChange: r, onSelectSuggestio
|
|
|
93
93
|
onKeyDown: (e) => {
|
|
94
94
|
e.key === "Escape" && u(!1), e.key === "ArrowDown" && u(!0);
|
|
95
95
|
},
|
|
96
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ j(le, {
|
|
97
97
|
placeholder: t,
|
|
98
98
|
value: n,
|
|
99
99
|
onValueChange: (e) => {
|
|
@@ -101,21 +101,21 @@ function me({ label: e, placeholder: t, value: n, onChange: r, onSelectSuggestio
|
|
|
101
101
|
},
|
|
102
102
|
onFocus: () => u(!0),
|
|
103
103
|
onBlur: () => u(!1)
|
|
104
|
-
}), p && /* @__PURE__ */
|
|
104
|
+
}), p && /* @__PURE__ */ j(ue, {
|
|
105
105
|
label: `${e} suggestions`,
|
|
106
106
|
className: "la:absolute la:top-full la:right-0 la:left-0 la:z-20 la:mt-1.5 la:rounded-md la:border la:bg-popover la:text-popover-foreground la:shadow-md",
|
|
107
107
|
onMouseDown: (e) => e.preventDefault(),
|
|
108
|
-
children: [...f].map(([e, t]) => /* @__PURE__ */
|
|
108
|
+
children: [...f].map(([e, t]) => /* @__PURE__ */ j(fe, {
|
|
109
109
|
heading: e,
|
|
110
|
-
children: t.map((t) => /* @__PURE__ */
|
|
110
|
+
children: t.map((t) => /* @__PURE__ */ M(me, {
|
|
111
111
|
value: t.id ?? `${e}:${t.value}`,
|
|
112
112
|
onSelect: () => {
|
|
113
113
|
i ? i(t) : r(t.value), u(!1);
|
|
114
114
|
},
|
|
115
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ j("span", {
|
|
116
116
|
className: "la:truncate la:font-mono la:text-xs",
|
|
117
117
|
children: t.value
|
|
118
|
-
}), t.hint && /* @__PURE__ */
|
|
118
|
+
}), t.hint && /* @__PURE__ */ j("span", {
|
|
119
119
|
className: "la:ml-auto la:text-xs la:text-muted-foreground",
|
|
120
120
|
children: t.hint
|
|
121
121
|
})]
|
|
@@ -124,7 +124,7 @@ function me({ label: e, placeholder: t, value: n, onChange: r, onSelectSuggestio
|
|
|
124
124
|
})]
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function _e(e, t, n, r = !1) {
|
|
128
128
|
let i = t.trim().toLocaleLowerCase(), a = i.split(/\s+/u).filter(Boolean), o = /* @__PURE__ */ new Set(), s = [];
|
|
129
129
|
for (let t of e) {
|
|
130
130
|
let e = t.id ?? `${t.group}:${t.value}`, n = [t.value, ...t.keywords ?? []].join(" ").toLocaleLowerCase(), c = t.value.toLocaleLowerCase() === i && !t.keywords?.length;
|
|
@@ -133,8 +133,161 @@ function he(e, t, n, r = !1) {
|
|
|
133
133
|
return s.sort((e, t) => Number(t.value.toLocaleLowerCase().startsWith(i)) - Number(e.value.toLocaleLowerCase().startsWith(i))).slice(0, n);
|
|
134
134
|
}
|
|
135
135
|
//#endregion
|
|
136
|
+
//#region src/request-timeline.ts
|
|
137
|
+
function ve(e) {
|
|
138
|
+
let t = [...e].sort((e, t) => e.startedAtMs - t.startedAtMs || e.sequence - t.sequence), n = t[0]?.startedAtMs ?? 0, r = n, i = /* @__PURE__ */ new Map(), a = t.map((e) => {
|
|
139
|
+
let t = JSON.stringify([
|
|
140
|
+
e.projectId,
|
|
141
|
+
e.actorName,
|
|
142
|
+
e.actorId
|
|
143
|
+
]), a = i.get(t), o = e.startedAtMs + e.durationMs;
|
|
144
|
+
return i.set(t, Math.max(a ?? o, o)), r = Math.max(r, o), {
|
|
145
|
+
record: e,
|
|
146
|
+
offsetMs: e.startedAtMs - n,
|
|
147
|
+
gapMs: a === void 0 ? null : e.startedAtMs - a
|
|
148
|
+
};
|
|
149
|
+
});
|
|
150
|
+
return {
|
|
151
|
+
start: n,
|
|
152
|
+
span: r - n,
|
|
153
|
+
rows: a
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function z(e) {
|
|
157
|
+
return e >= 6e4 ? `${(e / 6e4).toLocaleString(void 0, { maximumFractionDigits: 2 })} min` : e >= 1e3 ? `${(e / 1e3).toLocaleString(void 0, { maximumFractionDigits: 2 })} s` : `${e.toLocaleString(void 0, { maximumFractionDigits: 1 })} ms`;
|
|
158
|
+
}
|
|
159
|
+
function ye(e) {
|
|
160
|
+
return e === null ? "First in view" : e < 0 ? "Overlapping" : e === 0 ? "No gap" : `${z(e)} gap`;
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/RequestTimeline.tsx
|
|
164
|
+
var be = [
|
|
165
|
+
0,
|
|
166
|
+
.25,
|
|
167
|
+
.5,
|
|
168
|
+
.75,
|
|
169
|
+
1
|
|
170
|
+
];
|
|
171
|
+
function xe({ records: e, selected: t, onSelect: n }) {
|
|
172
|
+
let { start: r, span: i, rows: a } = ve(e), o = Math.max(1, i);
|
|
173
|
+
return /* @__PURE__ */ M("div", {
|
|
174
|
+
className: "request-waterfall",
|
|
175
|
+
role: "group",
|
|
176
|
+
"aria-label": "Invocation waterfall",
|
|
177
|
+
children: [
|
|
178
|
+
/* @__PURE__ */ j(Se, {
|
|
179
|
+
count: e.length,
|
|
180
|
+
span: i
|
|
181
|
+
}),
|
|
182
|
+
/* @__PURE__ */ M("div", {
|
|
183
|
+
className: "request-waterfall-scroll",
|
|
184
|
+
tabIndex: 0,
|
|
185
|
+
"aria-label": "Invocation timeline, scroll for more calls",
|
|
186
|
+
children: [/* @__PURE__ */ M("div", {
|
|
187
|
+
className: "request-waterfall-axis",
|
|
188
|
+
"aria-hidden": "true",
|
|
189
|
+
children: [
|
|
190
|
+
/* @__PURE__ */ j("span", { children: "Operation / instance" }),
|
|
191
|
+
/* @__PURE__ */ j("div", { children: be.map((e) => /* @__PURE__ */ j("span", {
|
|
192
|
+
style: { left: `${e * 100}%` },
|
|
193
|
+
children: z(o * e)
|
|
194
|
+
}, e)) }),
|
|
195
|
+
/* @__PURE__ */ j("span", { children: "Total / gap" })
|
|
196
|
+
]
|
|
197
|
+
}), a.map((e) => /* @__PURE__ */ j(Ce, {
|
|
198
|
+
row: e,
|
|
199
|
+
scale: o,
|
|
200
|
+
selected: t === e.record,
|
|
201
|
+
onSelect: n
|
|
202
|
+
}, e.record.eventId ?? e.record.sequence))]
|
|
203
|
+
}),
|
|
204
|
+
/* @__PURE__ */ M("div", {
|
|
205
|
+
className: "request-waterfall-caption",
|
|
206
|
+
children: [/* @__PURE__ */ M("span", { children: ["Relative to ", /* @__PURE__ */ j("time", {
|
|
207
|
+
dateTime: new Date(r).toISOString(),
|
|
208
|
+
children: new Date(r).toLocaleString([], { hour12: !1 })
|
|
209
|
+
})] }), /* @__PURE__ */ j("span", { children: "Gaps use preceding calls on the same instance in this view." })]
|
|
210
|
+
})
|
|
211
|
+
]
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
function Se({ count: e, span: t }) {
|
|
215
|
+
return /* @__PURE__ */ M("div", {
|
|
216
|
+
className: "request-waterfall-heading",
|
|
217
|
+
children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("strong", { children: "Invocation waterfall" }), /* @__PURE__ */ M("span", { children: [
|
|
218
|
+
e.toLocaleString(),
|
|
219
|
+
" calls · ",
|
|
220
|
+
z(t),
|
|
221
|
+
" elapsed"
|
|
222
|
+
] })] }), /* @__PURE__ */ M("ul", {
|
|
223
|
+
className: "request-waterfall-legend",
|
|
224
|
+
"aria-label": "Timing legend",
|
|
225
|
+
children: [
|
|
226
|
+
/* @__PURE__ */ M("li", { children: [/* @__PURE__ */ j("i", { className: "request-waterfall-method" }), "Method"] }),
|
|
227
|
+
/* @__PURE__ */ M("li", { children: [/* @__PURE__ */ j("i", { className: "request-waterfall-websocket" }), "WebSocket"] }),
|
|
228
|
+
/* @__PURE__ */ M("li", { children: [/* @__PURE__ */ j("i", { className: "request-waterfall-queue" }), "Queue wait"] }),
|
|
229
|
+
/* @__PURE__ */ M("li", { children: [/* @__PURE__ */ j("i", { className: "request-waterfall-failed" }), "Failed / rejected"] }),
|
|
230
|
+
/* @__PURE__ */ M("li", { children: [/* @__PURE__ */ j("i", { className: "request-waterfall-interrupted" }), "Interrupted / rerouted"] })
|
|
231
|
+
]
|
|
232
|
+
})]
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function Ce({ row: { record: e, offsetMs: t, gapMs: n }, scale: r, selected: i, onSelect: a }) {
|
|
236
|
+
return /* @__PURE__ */ M("button", {
|
|
237
|
+
type: "button",
|
|
238
|
+
className: "request-waterfall-row",
|
|
239
|
+
"data-state": i ? "selected" : void 0,
|
|
240
|
+
"aria-label": `Inspect ${e.operation} request on ${e.actorName} / ${e.actorId}, ${e.outcome}, ${z(e.durationMs)}, starts +${z(t)}, ${ye(n)}`,
|
|
241
|
+
"aria-haspopup": "dialog",
|
|
242
|
+
title: `${e.actorName} / ${e.actorId}\n${e.operation} · ${e.outcome}\nStart: ${new Date(e.startedAtMs).toLocaleString()} (+${z(t)})\nTotal: ${z(e.durationMs)}\nQueue wait: ${e.queueWaitMs === null ? "Did not begin processing" : z(e.queueWaitMs)}\n${ye(n)}${n === null ? "" : " relative to preceding calls on this instance"}`,
|
|
243
|
+
onClick: (t) => a(e, t.currentTarget),
|
|
244
|
+
children: [
|
|
245
|
+
/* @__PURE__ */ M("span", {
|
|
246
|
+
className: "request-waterfall-label",
|
|
247
|
+
children: [/* @__PURE__ */ j("strong", { children: e.operation }), /* @__PURE__ */ M("span", { children: [
|
|
248
|
+
e.actorName,
|
|
249
|
+
" / ",
|
|
250
|
+
e.actorId
|
|
251
|
+
] })]
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ M("span", {
|
|
254
|
+
className: "request-waterfall-track",
|
|
255
|
+
"aria-hidden": "true",
|
|
256
|
+
children: [
|
|
257
|
+
be.map((e) => /* @__PURE__ */ j("i", {
|
|
258
|
+
className: "request-waterfall-gridline",
|
|
259
|
+
style: { left: `${e * 100}%` }
|
|
260
|
+
}, e)),
|
|
261
|
+
n !== null && n > 0 && /* @__PURE__ */ j("span", {
|
|
262
|
+
className: "request-waterfall-gap",
|
|
263
|
+
style: {
|
|
264
|
+
left: `${(t - n) / r * 100}%`,
|
|
265
|
+
width: `${n / r * 100}%`
|
|
266
|
+
}
|
|
267
|
+
}),
|
|
268
|
+
/* @__PURE__ */ j("span", {
|
|
269
|
+
className: `request-waterfall-bar request-waterfall-${e.kind} request-waterfall-${e.outcome}`,
|
|
270
|
+
style: {
|
|
271
|
+
left: `${t / r * 100}%`,
|
|
272
|
+
width: `${e.durationMs / r * 100}%`
|
|
273
|
+
},
|
|
274
|
+
children: e.queueWaitMs !== null && e.queueWaitMs > 0 && /* @__PURE__ */ j("span", {
|
|
275
|
+
className: "request-waterfall-queue",
|
|
276
|
+
style: { width: `${e.queueWaitMs / e.durationMs * 100}%` }
|
|
277
|
+
})
|
|
278
|
+
})
|
|
279
|
+
]
|
|
280
|
+
}),
|
|
281
|
+
/* @__PURE__ */ M("span", {
|
|
282
|
+
className: "request-waterfall-timing",
|
|
283
|
+
children: [/* @__PURE__ */ j("strong", { children: z(e.durationMs) }), /* @__PURE__ */ j("span", { children: ye(n) })]
|
|
284
|
+
})
|
|
285
|
+
]
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
//#endregion
|
|
136
289
|
//#region src/components/ui/button.tsx
|
|
137
|
-
var
|
|
290
|
+
var we = P("la:inline-flex la:shrink-0 la:items-center la:justify-center la:gap-2 la:whitespace-nowrap la:rounded-md la:text-sm la:font-medium la:outline-none la:transition-[background-color,border-color,color,box-shadow,transform] la:duration-150 la:ease-out la:active:translate-y-px la:disabled:pointer-events-none la:disabled:translate-y-0 la:disabled:opacity-45 la:focus-visible:ring-2 la:focus-visible:ring-ring la:focus-visible:ring-offset-2 la:focus-visible:ring-offset-background la:aria-invalid:border-destructive la:aria-invalid:ring-destructive/25 la:[&_svg]:pointer-events-none la:[&_svg]:shrink-0 la:[&_svg:not([class*='size-'])]:size-4", {
|
|
138
291
|
variants: {
|
|
139
292
|
variant: {
|
|
140
293
|
default: "la:bg-primary la:text-primary-foreground la:shadow-[var(--shadow-control)] la:hover:bg-primary/88",
|
|
@@ -158,10 +311,10 @@ var ge = N("la:inline-flex la:shrink-0 la:items-center la:justify-center la:gap-
|
|
|
158
311
|
size: "default"
|
|
159
312
|
}
|
|
160
313
|
});
|
|
161
|
-
function
|
|
162
|
-
return /* @__PURE__ */
|
|
314
|
+
function B({ className: e, variant: t, size: n, asChild: r = !1, ...i }) {
|
|
315
|
+
return /* @__PURE__ */ j(r ? N : "button", {
|
|
163
316
|
"data-slot": "button",
|
|
164
|
-
className: R(
|
|
317
|
+
className: R(we({
|
|
165
318
|
variant: t,
|
|
166
319
|
size: n,
|
|
167
320
|
className: e
|
|
@@ -171,9 +324,9 @@ function z({ className: e, variant: t, size: n, asChild: r = !1, ...i }) {
|
|
|
171
324
|
}
|
|
172
325
|
//#endregion
|
|
173
326
|
//#region src/components/ui/calendar.tsx
|
|
174
|
-
function
|
|
175
|
-
let c =
|
|
176
|
-
return /* @__PURE__ */
|
|
327
|
+
function Te({ className: e, classNames: t, showOutsideDays: n = !0, captionLayout: r = "label", buttonVariant: i = "ghost", formatters: a, components: o, ...s }) {
|
|
328
|
+
let c = I();
|
|
329
|
+
return /* @__PURE__ */ j(F, {
|
|
177
330
|
showOutsideDays: n,
|
|
178
331
|
className: R("la:group/calendar la:bg-background la:p-3 la:[--cell-size:--spacing(8)] la:[[data-slot=card-content]_&]:bg-transparent la:[[data-slot=popover-content]_&]:bg-transparent", e),
|
|
179
332
|
captionLayout: r,
|
|
@@ -186,8 +339,8 @@ function _e({ className: e, classNames: t, showOutsideDays: n = !0, captionLayou
|
|
|
186
339
|
months: R("la:relative la:flex la:flex-col la:gap-4 la:md:flex-row", c.months),
|
|
187
340
|
month: R("la:flex la:w-full la:flex-col la:gap-4", c.month),
|
|
188
341
|
nav: R("la:absolute la:inset-x-0 la:top-0 la:flex la:w-full la:items-center la:justify-between la:gap-1", c.nav),
|
|
189
|
-
button_previous: R(
|
|
190
|
-
button_next: R(
|
|
342
|
+
button_previous: R(we({ variant: i }), "la:size-(--cell-size) la:p-0 la:select-none la:aria-disabled:opacity-50", c.button_previous),
|
|
343
|
+
button_next: R(we({ variant: i }), "la:size-(--cell-size) la:p-0 la:select-none la:aria-disabled:opacity-50", c.button_next),
|
|
191
344
|
month_caption: R("la:flex la:h-(--cell-size) la:w-full la:items-center la:justify-center la:px-(--cell-size)", c.month_caption),
|
|
192
345
|
dropdowns: R("la:flex la:h-(--cell-size) la:w-full la:items-center la:justify-center la:gap-1.5 la:text-sm la:font-medium", c.dropdowns),
|
|
193
346
|
dropdown_root: R("la:relative la:rounded-md la:border la:border-input la:shadow-xs la:has-focus:border-ring la:has-focus:ring-[3px] la:has-focus:ring-ring/50", c.dropdown_root),
|
|
@@ -210,20 +363,20 @@ function _e({ className: e, classNames: t, showOutsideDays: n = !0, captionLayou
|
|
|
210
363
|
...t
|
|
211
364
|
},
|
|
212
365
|
components: {
|
|
213
|
-
Root: ({ className: e, rootRef: t, ...n }) => /* @__PURE__ */
|
|
366
|
+
Root: ({ className: e, rootRef: t, ...n }) => /* @__PURE__ */ j("div", {
|
|
214
367
|
"data-slot": "calendar",
|
|
215
368
|
ref: t,
|
|
216
369
|
className: R(e),
|
|
217
370
|
...n
|
|
218
371
|
}),
|
|
219
|
-
Chevron: ({ className: e, orientation: t, ...n }) =>
|
|
372
|
+
Chevron: ({ className: e, orientation: t, ...n }) => j(t === "left" ? m : t === "right" ? h : p, {
|
|
220
373
|
className: R("la:size-4", e),
|
|
221
374
|
...n
|
|
222
375
|
}),
|
|
223
|
-
DayButton:
|
|
224
|
-
WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */
|
|
376
|
+
DayButton: Ee,
|
|
377
|
+
WeekNumber: ({ children: e, ...t }) => /* @__PURE__ */ j("td", {
|
|
225
378
|
...t,
|
|
226
|
-
children: /* @__PURE__ */
|
|
379
|
+
children: /* @__PURE__ */ j("div", {
|
|
227
380
|
className: "la:flex la:size-(--cell-size) la:items-center la:justify-center la:text-center",
|
|
228
381
|
children: e
|
|
229
382
|
})
|
|
@@ -233,11 +386,11 @@ function _e({ className: e, classNames: t, showOutsideDays: n = !0, captionLayou
|
|
|
233
386
|
...s
|
|
234
387
|
});
|
|
235
388
|
}
|
|
236
|
-
function
|
|
237
|
-
let a =
|
|
389
|
+
function Ee({ className: t, day: n, modifiers: r, ...i }) {
|
|
390
|
+
let a = I(), o = e.useRef(null);
|
|
238
391
|
return e.useEffect(() => {
|
|
239
392
|
r.focused && o.current?.focus();
|
|
240
|
-
}, [r.focused]), /* @__PURE__ */
|
|
393
|
+
}, [r.focused]), /* @__PURE__ */ j(B, {
|
|
241
394
|
ref: o,
|
|
242
395
|
variant: "ghost",
|
|
243
396
|
size: "icon",
|
|
@@ -252,8 +405,8 @@ function ve({ className: t, day: n, modifiers: r, ...i }) {
|
|
|
252
405
|
}
|
|
253
406
|
//#endregion
|
|
254
407
|
//#region src/components/ui/input.tsx
|
|
255
|
-
function
|
|
256
|
-
return /* @__PURE__ */
|
|
408
|
+
function V({ className: e, type: t, ...n }) {
|
|
409
|
+
return /* @__PURE__ */ j("input", {
|
|
257
410
|
type: t,
|
|
258
411
|
"data-slot": "input",
|
|
259
412
|
className: R("la:flex la:h-9 la:w-full la:min-w-0 la:rounded-md la:border la:border-input la:bg-card la:px-3 la:py-1 la:text-sm la:text-foreground la:outline-none la:transition-colors la:placeholder:text-muted-foreground la:focus-visible:border-ring la:focus-visible:ring-2 la:focus-visible:ring-ring/20 la:disabled:cursor-not-allowed la:disabled:opacity-50 la:max-md:min-h-11", e),
|
|
@@ -262,20 +415,20 @@ function B({ className: e, type: t, ...n }) {
|
|
|
262
415
|
}
|
|
263
416
|
//#endregion
|
|
264
417
|
//#region src/components/ui/popover.tsx
|
|
265
|
-
function
|
|
266
|
-
return /* @__PURE__ */
|
|
418
|
+
function De({ ...e }) {
|
|
419
|
+
return /* @__PURE__ */ j(ne.Root, {
|
|
267
420
|
"data-slot": "popover",
|
|
268
421
|
...e
|
|
269
422
|
});
|
|
270
423
|
}
|
|
271
|
-
function
|
|
272
|
-
return /* @__PURE__ */
|
|
424
|
+
function Oe({ ...e }) {
|
|
425
|
+
return /* @__PURE__ */ j(ne.Trigger, {
|
|
273
426
|
"data-slot": "popover-trigger",
|
|
274
427
|
...e
|
|
275
428
|
});
|
|
276
429
|
}
|
|
277
|
-
function
|
|
278
|
-
return /* @__PURE__ */
|
|
430
|
+
function ke({ className: e, align: t = "center", sideOffset: n = 4, ...r }) {
|
|
431
|
+
return /* @__PURE__ */ j(ne.Portal, { children: /* @__PURE__ */ j(ne.Content, {
|
|
279
432
|
"data-slot": "popover-content",
|
|
280
433
|
align: t,
|
|
281
434
|
sideOffset: n,
|
|
@@ -283,28 +436,28 @@ function xe({ className: e, align: t = "center", sideOffset: n = 4, ...r }) {
|
|
|
283
436
|
...r
|
|
284
437
|
}) });
|
|
285
438
|
}
|
|
286
|
-
function
|
|
287
|
-
return /* @__PURE__ */
|
|
439
|
+
function Ae({ ...e }) {
|
|
440
|
+
return /* @__PURE__ */ j(ne.Anchor, {
|
|
288
441
|
"data-slot": "popover-anchor",
|
|
289
442
|
...e
|
|
290
443
|
});
|
|
291
444
|
}
|
|
292
|
-
function
|
|
293
|
-
return /* @__PURE__ */
|
|
445
|
+
function je({ className: e, ...t }) {
|
|
446
|
+
return /* @__PURE__ */ j("div", {
|
|
294
447
|
"data-slot": "popover-header",
|
|
295
448
|
className: R("la:flex la:flex-col la:gap-1 la:text-sm", e),
|
|
296
449
|
...t
|
|
297
450
|
});
|
|
298
451
|
}
|
|
299
|
-
function
|
|
300
|
-
return /* @__PURE__ */
|
|
452
|
+
function Me({ className: e, ...t }) {
|
|
453
|
+
return /* @__PURE__ */ j("div", {
|
|
301
454
|
"data-slot": "popover-title",
|
|
302
455
|
className: R("la:font-medium", e),
|
|
303
456
|
...t
|
|
304
457
|
});
|
|
305
458
|
}
|
|
306
|
-
function
|
|
307
|
-
return /* @__PURE__ */
|
|
459
|
+
function Ne({ className: e, ...t }) {
|
|
460
|
+
return /* @__PURE__ */ j("p", {
|
|
308
461
|
"data-slot": "popover-description",
|
|
309
462
|
className: R("la:text-muted-foreground", e),
|
|
310
463
|
...t
|
|
@@ -312,7 +465,7 @@ function Te({ className: e, ...t }) {
|
|
|
312
465
|
}
|
|
313
466
|
//#endregion
|
|
314
467
|
//#region src/time-range.ts
|
|
315
|
-
var
|
|
468
|
+
var Pe = [
|
|
316
469
|
{
|
|
317
470
|
minutes: 5,
|
|
318
471
|
label: "Last 5 minutes"
|
|
@@ -337,11 +490,11 @@ var Ee = [
|
|
|
337
490
|
minutes: 10080,
|
|
338
491
|
label: "Last 7 days"
|
|
339
492
|
}
|
|
340
|
-
],
|
|
493
|
+
], Fe = {
|
|
341
494
|
kind: "relative",
|
|
342
495
|
minutes: 60
|
|
343
496
|
};
|
|
344
|
-
function
|
|
497
|
+
function Ie(e, t) {
|
|
345
498
|
switch (e.kind) {
|
|
346
499
|
case "relative": return { fromMs: Math.floor((t - e.minutes * 6e4) / 6e4) * 6e4 };
|
|
347
500
|
case "absolute": return {
|
|
@@ -351,24 +504,24 @@ function Oe(e, t) {
|
|
|
351
504
|
case "all": return {};
|
|
352
505
|
}
|
|
353
506
|
}
|
|
354
|
-
function
|
|
507
|
+
function Le(e) {
|
|
355
508
|
switch (e.kind) {
|
|
356
|
-
case "relative": return
|
|
357
|
-
case "absolute": return `${
|
|
509
|
+
case "relative": return Pe.find((t) => t.minutes === e.minutes)?.label ?? `Last ${e.minutes} minutes`;
|
|
510
|
+
case "absolute": return `${ze(e.fromMs, e.toMs)} – ${ze(e.toMs, e.fromMs)}`;
|
|
358
511
|
case "all": return "All retained";
|
|
359
512
|
}
|
|
360
513
|
}
|
|
361
|
-
function
|
|
514
|
+
function H(e) {
|
|
362
515
|
switch (e.kind) {
|
|
363
|
-
case "relative": return `in the ${
|
|
364
|
-
case "absolute": return `between ${
|
|
516
|
+
case "relative": return `in the ${Le(e).toLocaleLowerCase()}`;
|
|
517
|
+
case "absolute": return `between ${Le(e)}`;
|
|
365
518
|
case "all": return "in retained history";
|
|
366
519
|
}
|
|
367
520
|
}
|
|
368
|
-
function
|
|
521
|
+
function Re(e, t) {
|
|
369
522
|
return e.kind === t.kind && (e.kind !== "relative" || e.minutes === t.minutes) && (e.kind !== "absolute" || e.fromMs === t.fromMs && e.toMs === t.toMs);
|
|
370
523
|
}
|
|
371
|
-
function
|
|
524
|
+
function ze(e, t) {
|
|
372
525
|
let n = new Date(e), r = n.toDateString() === new Date(t).toDateString(), i = n.toLocaleTimeString([], {
|
|
373
526
|
hour: "2-digit",
|
|
374
527
|
minute: "2-digit",
|
|
@@ -381,45 +534,45 @@ function je(e, t) {
|
|
|
381
534
|
}
|
|
382
535
|
//#endregion
|
|
383
536
|
//#region src/TimeRangePicker.tsx
|
|
384
|
-
function
|
|
385
|
-
let [o, s] = a(!1), [c, l] = a(() =>
|
|
537
|
+
function Be({ value: e, onChange: t, allowAll: n = !0, className: r, align: i = "end" }) {
|
|
538
|
+
let [o, s] = a(!1), [c, l] = a(() => He(e)), [d, p] = a(!1), m = (e) => {
|
|
386
539
|
t(e), s(!1);
|
|
387
540
|
};
|
|
388
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ M(De, {
|
|
389
542
|
open: o,
|
|
390
543
|
onOpenChange: (t) => {
|
|
391
|
-
t && (l(
|
|
544
|
+
t && (l(He(e)), p(!1)), s(t);
|
|
392
545
|
},
|
|
393
|
-
children: [/* @__PURE__ */
|
|
546
|
+
children: [/* @__PURE__ */ j(Oe, {
|
|
394
547
|
asChild: !0,
|
|
395
|
-
children: /* @__PURE__ */
|
|
548
|
+
children: /* @__PURE__ */ M(B, {
|
|
396
549
|
type: "button",
|
|
397
550
|
variant: "outline",
|
|
398
551
|
className: r,
|
|
399
|
-
"aria-label": `Time range: ${
|
|
552
|
+
"aria-label": `Time range: ${Le(e)}`,
|
|
400
553
|
children: [
|
|
401
|
-
/* @__PURE__ */
|
|
402
|
-
/* @__PURE__ */
|
|
554
|
+
/* @__PURE__ */ j(u, { "aria-hidden": "true" }),
|
|
555
|
+
/* @__PURE__ */ j("span", {
|
|
403
556
|
className: "la:truncate la:tabular-nums",
|
|
404
|
-
children:
|
|
557
|
+
children: Le(e)
|
|
405
558
|
}),
|
|
406
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ j(f, {
|
|
407
560
|
"aria-hidden": "true",
|
|
408
561
|
className: "la:text-muted-foreground"
|
|
409
562
|
})
|
|
410
563
|
]
|
|
411
564
|
})
|
|
412
|
-
}), /* @__PURE__ */
|
|
565
|
+
}), /* @__PURE__ */ M(ke, {
|
|
413
566
|
align: i,
|
|
414
567
|
"aria-label": "Time range",
|
|
415
568
|
className: "la:flex la:w-auto la:p-0 la:text-sm",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
569
|
+
children: [/* @__PURE__ */ M("div", {
|
|
417
570
|
className: "la:flex la:flex-col la:gap-0.5 la:border-r la:p-2",
|
|
418
571
|
role: "group",
|
|
419
572
|
"aria-label": "Preset ranges",
|
|
420
|
-
children: [
|
|
573
|
+
children: [Pe.map((t) => /* @__PURE__ */ j(Ve, {
|
|
421
574
|
label: t.label,
|
|
422
|
-
selected:
|
|
575
|
+
selected: Re(e, {
|
|
423
576
|
kind: "relative",
|
|
424
577
|
minutes: t.minutes
|
|
425
578
|
}),
|
|
@@ -427,17 +580,17 @@ function Me({ value: e, onChange: t, allowAll: n = !0, className: r, align: i =
|
|
|
427
580
|
kind: "relative",
|
|
428
581
|
minutes: t.minutes
|
|
429
582
|
})
|
|
430
|
-
}, t.minutes)), n && /* @__PURE__ */
|
|
583
|
+
}, t.minutes)), n && /* @__PURE__ */ j(Ve, {
|
|
431
584
|
label: "All retained",
|
|
432
585
|
selected: e.kind === "all",
|
|
433
586
|
onSelect: () => m({ kind: "all" })
|
|
434
587
|
})]
|
|
435
|
-
}), /* @__PURE__ */
|
|
588
|
+
}), /* @__PURE__ */ M("form", {
|
|
436
589
|
className: "la:flex la:w-[22rem] la:flex-col",
|
|
437
590
|
"aria-label": "Custom range",
|
|
438
591
|
onSubmit: (e) => {
|
|
439
592
|
e.preventDefault();
|
|
440
|
-
let t =
|
|
593
|
+
let t = Ue(c);
|
|
441
594
|
if (!t) {
|
|
442
595
|
p(!0);
|
|
443
596
|
return;
|
|
@@ -445,7 +598,7 @@ function Me({ value: e, onChange: t, allowAll: n = !0, className: r, align: i =
|
|
|
445
598
|
p(!1), m(t);
|
|
446
599
|
},
|
|
447
600
|
children: [
|
|
448
|
-
/* @__PURE__ */
|
|
601
|
+
/* @__PURE__ */ j(Te, {
|
|
449
602
|
mode: "range",
|
|
450
603
|
numberOfMonths: 1,
|
|
451
604
|
defaultMonth: c.dates?.to ?? c.dates?.from,
|
|
@@ -456,12 +609,12 @@ function Me({ value: e, onChange: t, allowAll: n = !0, className: r, align: i =
|
|
|
456
609
|
})),
|
|
457
610
|
disabled: { after: /* @__PURE__ */ new Date() }
|
|
458
611
|
}),
|
|
459
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ M("div", {
|
|
460
613
|
className: "la:flex la:items-end la:gap-2 la:border-t la:px-3 la:py-3",
|
|
461
614
|
children: [
|
|
462
|
-
/* @__PURE__ */
|
|
615
|
+
/* @__PURE__ */ M("label", {
|
|
463
616
|
className: "la:grid la:gap-1 la:text-xs la:text-muted-foreground",
|
|
464
|
-
children: ["From", /* @__PURE__ */
|
|
617
|
+
children: ["From", /* @__PURE__ */ j(V, {
|
|
465
618
|
type: "time",
|
|
466
619
|
name: "from",
|
|
467
620
|
required: !0,
|
|
@@ -471,12 +624,12 @@ function Me({ value: e, onChange: t, allowAll: n = !0, className: r, align: i =
|
|
|
471
624
|
...c,
|
|
472
625
|
fromTime: e.target.value
|
|
473
626
|
}),
|
|
474
|
-
"aria-invalid":
|
|
627
|
+
"aria-invalid": d || void 0
|
|
475
628
|
})]
|
|
476
629
|
}),
|
|
477
|
-
/* @__PURE__ */
|
|
630
|
+
/* @__PURE__ */ M("label", {
|
|
478
631
|
className: "la:grid la:gap-1 la:text-xs la:text-muted-foreground",
|
|
479
|
-
children: ["To", /* @__PURE__ */
|
|
632
|
+
children: ["To", /* @__PURE__ */ j(V, {
|
|
480
633
|
type: "time",
|
|
481
634
|
name: "to",
|
|
482
635
|
required: !0,
|
|
@@ -486,10 +639,10 @@ function Me({ value: e, onChange: t, allowAll: n = !0, className: r, align: i =
|
|
|
486
639
|
...c,
|
|
487
640
|
toTime: e.target.value
|
|
488
641
|
}),
|
|
489
|
-
"aria-invalid":
|
|
642
|
+
"aria-invalid": d || void 0
|
|
490
643
|
})]
|
|
491
644
|
}),
|
|
492
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ j(B, {
|
|
493
646
|
type: "submit",
|
|
494
647
|
variant: "outline",
|
|
495
648
|
size: "sm",
|
|
@@ -499,7 +652,7 @@ function Me({ value: e, onChange: t, allowAll: n = !0, className: r, align: i =
|
|
|
499
652
|
})
|
|
500
653
|
]
|
|
501
654
|
}),
|
|
502
|
-
|
|
655
|
+
d && /* @__PURE__ */ j("p", {
|
|
503
656
|
className: "la:px-3 la:pb-3 la:text-xs la:text-danger",
|
|
504
657
|
role: "alert",
|
|
505
658
|
children: "From must be before To."
|
|
@@ -509,8 +662,8 @@ function Me({ value: e, onChange: t, allowAll: n = !0, className: r, align: i =
|
|
|
509
662
|
})]
|
|
510
663
|
});
|
|
511
664
|
}
|
|
512
|
-
function
|
|
513
|
-
return /* @__PURE__ */
|
|
665
|
+
function Ve({ label: e, selected: t, onSelect: n }) {
|
|
666
|
+
return /* @__PURE__ */ j(B, {
|
|
514
667
|
type: "button",
|
|
515
668
|
variant: t ? "secondary" : "ghost",
|
|
516
669
|
size: "sm",
|
|
@@ -520,73 +673,73 @@ function Ne({ label: e, selected: t, onSelect: n }) {
|
|
|
520
673
|
children: e
|
|
521
674
|
});
|
|
522
675
|
}
|
|
523
|
-
function
|
|
524
|
-
let t = Date.now(), n =
|
|
676
|
+
function He(e) {
|
|
677
|
+
let t = Date.now(), n = Ie(e, t), r = new Date(n.fromMs ?? t - 36e5), i = new Date(n.toMs ?? t);
|
|
525
678
|
return {
|
|
526
679
|
dates: {
|
|
527
|
-
from:
|
|
528
|
-
to:
|
|
680
|
+
from: We(r),
|
|
681
|
+
to: We(i)
|
|
529
682
|
},
|
|
530
|
-
fromTime:
|
|
531
|
-
toTime:
|
|
683
|
+
fromTime: Ge(r),
|
|
684
|
+
toTime: Ge(i)
|
|
532
685
|
};
|
|
533
686
|
}
|
|
534
|
-
function
|
|
687
|
+
function Ue(e) {
|
|
535
688
|
let t = e.dates?.from, n = e.dates?.to ?? t;
|
|
536
689
|
if (!t || !n) return null;
|
|
537
|
-
let r =
|
|
690
|
+
let r = Ke(t, e.fromTime), i = Ke(n, e.toTime);
|
|
538
691
|
return Number.isFinite(r) && Number.isFinite(i) && r < i ? {
|
|
539
692
|
kind: "absolute",
|
|
540
693
|
fromMs: r,
|
|
541
694
|
toMs: i
|
|
542
695
|
} : null;
|
|
543
696
|
}
|
|
544
|
-
function
|
|
697
|
+
function We(e) {
|
|
545
698
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
546
699
|
}
|
|
547
|
-
function
|
|
700
|
+
function Ge(e) {
|
|
548
701
|
return `${String(e.getHours()).padStart(2, "0")}:${String(e.getMinutes()).padStart(2, "0")}`;
|
|
549
702
|
}
|
|
550
|
-
function
|
|
703
|
+
function Ke(e, t) {
|
|
551
704
|
let [n, r] = t.split(":").map(Number);
|
|
552
705
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate(), n ?? 0, r ?? 0).getTime();
|
|
553
706
|
}
|
|
554
707
|
//#endregion
|
|
555
708
|
//#region src/components/ui/badge.tsx
|
|
556
|
-
var
|
|
709
|
+
var qe = P("la:inline-flex la:items-center la:justify-center la:gap-1.5 la:rounded-md la:border la:px-2 la:py-0.5 la:text-xs la:font-medium la:whitespace-nowrap", {
|
|
557
710
|
variants: { variant: {
|
|
558
711
|
default: "la:border-transparent la:bg-muted la:text-muted-foreground",
|
|
559
712
|
outline: "la:border-border la:text-muted-foreground"
|
|
560
713
|
} },
|
|
561
714
|
defaultVariants: { variant: "default" }
|
|
562
715
|
});
|
|
563
|
-
function
|
|
564
|
-
return /* @__PURE__ */
|
|
716
|
+
function U({ className: e, variant: t, ...n }) {
|
|
717
|
+
return /* @__PURE__ */ j("span", {
|
|
565
718
|
"data-slot": "badge",
|
|
566
|
-
className: R(
|
|
719
|
+
className: R(qe({ variant: t }), e),
|
|
567
720
|
...n
|
|
568
721
|
});
|
|
569
722
|
}
|
|
570
723
|
//#endregion
|
|
571
724
|
//#region src/components/ui/native-select.tsx
|
|
572
|
-
function
|
|
573
|
-
return /* @__PURE__ */
|
|
725
|
+
function Je({ className: e, size: t = "default", ...n }) {
|
|
726
|
+
return /* @__PURE__ */ M("div", {
|
|
574
727
|
className: "la:group/native-select la:relative la:w-fit la:has-[select:disabled]:opacity-50",
|
|
575
728
|
"data-slot": "native-select-wrapper",
|
|
576
|
-
children: [/* @__PURE__ */
|
|
729
|
+
children: [/* @__PURE__ */ j("select", {
|
|
577
730
|
"data-slot": "native-select",
|
|
578
731
|
"data-size": t,
|
|
579
732
|
className: R("la:h-9 la:w-full la:min-w-0 la:appearance-none la:rounded-md la:border la:border-input la:bg-transparent la:px-3 la:py-2 la:pr-9 la:text-sm la:shadow-xs la:outline-none la:transition-[color,box-shadow] la:selection:bg-primary la:selection:text-primary-foreground la:disabled:pointer-events-none la:disabled:cursor-not-allowed la:data-[size=sm]:h-8 la:data-[size=sm]:py-1 la:focus-visible:border-ring la:focus-visible:ring-[3px] la:focus-visible:ring-ring/50 la:aria-invalid:border-destructive la:aria-invalid:ring-destructive/20 la:dark:bg-input/30 la:dark:hover:bg-input/50 la:dark:aria-invalid:ring-destructive/40", e),
|
|
580
733
|
...n
|
|
581
|
-
}), /* @__PURE__ */
|
|
734
|
+
}), /* @__PURE__ */ j(p, {
|
|
582
735
|
className: "la:pointer-events-none la:absolute la:top-1/2 la:right-3.5 la:size-4 la:-translate-y-1/2 la:text-muted-foreground la:opacity-50 la:select-none",
|
|
583
736
|
"aria-hidden": "true",
|
|
584
737
|
"data-slot": "native-select-icon"
|
|
585
738
|
})]
|
|
586
739
|
});
|
|
587
740
|
}
|
|
588
|
-
function
|
|
589
|
-
return /* @__PURE__ */
|
|
741
|
+
function W({ className: e, ...t }) {
|
|
742
|
+
return /* @__PURE__ */ j("option", {
|
|
590
743
|
"data-slot": "native-select-option",
|
|
591
744
|
className: R("la:bg-[Canvas] la:text-[CanvasText]", e),
|
|
592
745
|
...t
|
|
@@ -594,22 +747,22 @@ function U({ className: e, ...t }) {
|
|
|
594
747
|
}
|
|
595
748
|
//#endregion
|
|
596
749
|
//#region src/components/ui/sheet.tsx
|
|
597
|
-
var
|
|
598
|
-
function
|
|
599
|
-
return /* @__PURE__ */
|
|
750
|
+
var Ye = L.Root, Xe = L.Title, Ze = L.Description;
|
|
751
|
+
function Qe({ className: e, children: t, container: n, ...r }) {
|
|
752
|
+
return /* @__PURE__ */ M(L.Portal, {
|
|
600
753
|
container: n,
|
|
601
|
-
children: [/* @__PURE__ */
|
|
754
|
+
children: [/* @__PURE__ */ j(L.Overlay, { className: "la-sheet-overlay" }), /* @__PURE__ */ M(L.Content, {
|
|
602
755
|
"data-slot": "sheet-content",
|
|
603
756
|
className: R("la-observer la-sheet", e),
|
|
604
757
|
...r,
|
|
605
|
-
children: [t, /* @__PURE__ */
|
|
758
|
+
children: [t, /* @__PURE__ */ j(L.Close, {
|
|
606
759
|
asChild: !0,
|
|
607
|
-
children: /* @__PURE__ */
|
|
760
|
+
children: /* @__PURE__ */ j(B, {
|
|
608
761
|
className: "la-sheet-close",
|
|
609
762
|
variant: "ghost",
|
|
610
763
|
size: "icon",
|
|
611
764
|
"aria-label": "Close",
|
|
612
|
-
children: /* @__PURE__ */
|
|
765
|
+
children: /* @__PURE__ */ j(E, { "aria-hidden": "true" })
|
|
613
766
|
})
|
|
614
767
|
})]
|
|
615
768
|
})]
|
|
@@ -617,62 +770,62 @@ function We({ className: e, children: t, container: n, ...r }) {
|
|
|
617
770
|
}
|
|
618
771
|
//#endregion
|
|
619
772
|
//#region src/components/ui/table.tsx
|
|
620
|
-
function
|
|
621
|
-
return /* @__PURE__ */
|
|
773
|
+
function G({ className: e, containerProps: t, ...n }) {
|
|
774
|
+
return /* @__PURE__ */ j("div", {
|
|
622
775
|
...t,
|
|
623
776
|
"data-slot": "table-container",
|
|
624
777
|
className: R("la:relative la:w-full la:overflow-x-auto", t?.className),
|
|
625
|
-
children: /* @__PURE__ */
|
|
778
|
+
children: /* @__PURE__ */ j("table", {
|
|
626
779
|
"data-slot": "table",
|
|
627
780
|
className: R("la:w-full la:caption-bottom la:text-sm la:tabular-nums", e),
|
|
628
781
|
...n
|
|
629
782
|
})
|
|
630
783
|
});
|
|
631
784
|
}
|
|
632
|
-
function
|
|
633
|
-
return /* @__PURE__ */
|
|
785
|
+
function K({ className: e, ...t }) {
|
|
786
|
+
return /* @__PURE__ */ j("thead", {
|
|
634
787
|
"data-slot": "table-header",
|
|
635
788
|
className: R("la:[&_tr]:border-b", e),
|
|
636
789
|
...t
|
|
637
790
|
});
|
|
638
791
|
}
|
|
639
|
-
function
|
|
640
|
-
return /* @__PURE__ */
|
|
792
|
+
function q({ className: e, ...t }) {
|
|
793
|
+
return /* @__PURE__ */ j("tbody", {
|
|
641
794
|
"data-slot": "table-body",
|
|
642
795
|
className: R("la:[&_tr:last-child]:border-0", e),
|
|
643
796
|
...t
|
|
644
797
|
});
|
|
645
798
|
}
|
|
646
|
-
function
|
|
647
|
-
return /* @__PURE__ */
|
|
799
|
+
function $e({ className: e, ...t }) {
|
|
800
|
+
return /* @__PURE__ */ j("tfoot", {
|
|
648
801
|
"data-slot": "table-footer",
|
|
649
802
|
className: R("la:bg-muted/50 la:border-t la:font-medium la:[&>tr]:last:border-b-0", e),
|
|
650
803
|
...t
|
|
651
804
|
});
|
|
652
805
|
}
|
|
653
|
-
function
|
|
654
|
-
return /* @__PURE__ */
|
|
806
|
+
function J({ className: e, ...t }) {
|
|
807
|
+
return /* @__PURE__ */ j("tr", {
|
|
655
808
|
"data-slot": "table-row",
|
|
656
809
|
className: R("la:border-b la:transition-colors la:duration-150 la:hover:bg-muted/60 la:data-[state=selected]:bg-muted", e),
|
|
657
810
|
...t
|
|
658
811
|
});
|
|
659
812
|
}
|
|
660
|
-
function
|
|
661
|
-
return /* @__PURE__ */
|
|
813
|
+
function Y({ className: e, ...t }) {
|
|
814
|
+
return /* @__PURE__ */ j("th", {
|
|
662
815
|
"data-slot": "table-head",
|
|
663
816
|
className: R("la:h-10 la:whitespace-nowrap la:px-3 la:text-left la:align-middle la:text-xs la:font-medium la:text-muted-foreground la:[&:has([role=checkbox])]:pr-0 la:[&>[role=checkbox]]:translate-y-[2px]", e),
|
|
664
817
|
...t
|
|
665
818
|
});
|
|
666
819
|
}
|
|
667
|
-
function
|
|
668
|
-
return /* @__PURE__ */
|
|
820
|
+
function X({ className: e, ...t }) {
|
|
821
|
+
return /* @__PURE__ */ j("td", {
|
|
669
822
|
"data-slot": "table-cell",
|
|
670
823
|
className: R("la:whitespace-nowrap la:px-3 la:py-2.5 la:align-middle la:[&:has([role=checkbox])]:pr-0 la:[&>[role=checkbox]]:translate-y-[2px]", e),
|
|
671
824
|
...t
|
|
672
825
|
});
|
|
673
826
|
}
|
|
674
|
-
function
|
|
675
|
-
return /* @__PURE__ */
|
|
827
|
+
function et({ className: e, ...t }) {
|
|
828
|
+
return /* @__PURE__ */ j("caption", {
|
|
676
829
|
"data-slot": "table-caption",
|
|
677
830
|
className: R("la:text-muted-foreground la:mt-4 la:text-sm", e),
|
|
678
831
|
...t
|
|
@@ -680,7 +833,7 @@ function Ke({ className: e, ...t }) {
|
|
|
680
833
|
}
|
|
681
834
|
//#endregion
|
|
682
835
|
//#region src/observer-hooks.ts
|
|
683
|
-
function
|
|
836
|
+
function tt(e) {
|
|
684
837
|
let [n, r] = a(0), [i, o] = a(), [s, c] = a(!0), [l, u] = a(!1);
|
|
685
838
|
return t(() => {
|
|
686
839
|
let t = new AbortController(), n, r = 1e3;
|
|
@@ -713,7 +866,7 @@ function qe(e) {
|
|
|
713
866
|
retry: () => r((e) => e + 1)
|
|
714
867
|
};
|
|
715
868
|
}
|
|
716
|
-
function
|
|
869
|
+
function nt(e, n = !0) {
|
|
717
870
|
let [r, i] = a(), [o, s] = a(!1), [c, l] = a(0);
|
|
718
871
|
return t(() => i(void 0), [e]), t(() => {
|
|
719
872
|
if (!n) return;
|
|
@@ -722,7 +875,7 @@ function Je(e, n = !0) {
|
|
|
722
875
|
try {
|
|
723
876
|
if (!e.watchRequests) throw Error("Request traces unavailable");
|
|
724
877
|
if (await e.watchRequests((e) => {
|
|
725
|
-
r.signal.aborted || (t = e.resumeCursor, i((t) =>
|
|
878
|
+
r.signal.aborted || (t = e.resumeCursor, i((t) => rt(t, e)), s(!1), o = 1e3);
|
|
726
879
|
}, r.signal, t), !r.signal.aborted) throw Error("Request stream disconnected");
|
|
727
880
|
} catch {
|
|
728
881
|
r.signal.aborted || s(!0);
|
|
@@ -743,7 +896,7 @@ function Je(e, n = !0) {
|
|
|
743
896
|
retry: () => l((e) => e + 1)
|
|
744
897
|
};
|
|
745
898
|
}
|
|
746
|
-
function
|
|
899
|
+
function rt(e, t) {
|
|
747
900
|
let n = new Map((e?.epoch === t.epoch && !t.reset ? e.records : []).map((e) => [e.eventId ?? e.sequence, e]));
|
|
748
901
|
for (let e of t.records) n.set(e.eventId ?? e.sequence, e);
|
|
749
902
|
return {
|
|
@@ -752,7 +905,7 @@ function Ye(e, t) {
|
|
|
752
905
|
records: [...n.values()].sort((e, t) => t.sequence - e.sequence).slice(0, t.capacity)
|
|
753
906
|
};
|
|
754
907
|
}
|
|
755
|
-
function
|
|
908
|
+
function it(e, n, r, i = 1e4) {
|
|
756
909
|
let o = r ? JSON.stringify(n) : void 0, [s, c] = a(0), [l, u] = a(), [d, f] = a(!1), [p, m] = a(!1);
|
|
757
910
|
t(() => {
|
|
758
911
|
if (!o) return;
|
|
@@ -795,7 +948,7 @@ function Xe(e, n, r, i = 1e4) {
|
|
|
795
948
|
}
|
|
796
949
|
//#endregion
|
|
797
950
|
//#region src/request-history.ts
|
|
798
|
-
function
|
|
951
|
+
function at(e, n) {
|
|
799
952
|
let [r, o] = a(), [s, c] = a(!1), [l, u] = a(!1), d = i(() => {});
|
|
800
953
|
return t(() => {
|
|
801
954
|
if (o(void 0), u(!1), c(!1), !n) return;
|
|
@@ -838,176 +991,205 @@ function Ze(e, n) {
|
|
|
838
991
|
}
|
|
839
992
|
//#endregion
|
|
840
993
|
//#region src/RequestObserver.tsx
|
|
841
|
-
function
|
|
842
|
-
let [l, u] = a(), [
|
|
994
|
+
function ot({ client: e, actor: n, timeRange: o, onTimeRangeChange: s, focus: c }) {
|
|
995
|
+
let [l, u] = a(), [f, p] = a(Fe), m = o ?? f, h = s ?? p, g = at(e, r(() => l ? {
|
|
843
996
|
...l,
|
|
844
997
|
...n,
|
|
845
|
-
...l.requestId || l.connectionId ? {} :
|
|
998
|
+
...l.requestId || l.connectionId ? {} : Ie(m, Date.now())
|
|
846
999
|
} : void 0, [
|
|
847
1000
|
l,
|
|
848
1001
|
n?.actorName,
|
|
849
1002
|
n?.actorId,
|
|
850
|
-
|
|
851
|
-
])), { page:
|
|
1003
|
+
m
|
|
1004
|
+
])), { page: _, failed: v, retry: y } = nt(e), [S, C] = a(), [w, T] = a(), [E, D] = a("waterfall"), O = i(null), k = i(null), N = n ? "h3" : "h1", P = l ? g.page : S ?? _, F = _ ?? g.page, I = (P?.records ?? []).filter((e) => !n || e.actorName === n.actorName && e.actorId === n.actorId);
|
|
852
1005
|
return t(() => {
|
|
853
|
-
|
|
1006
|
+
C(void 0), u(void 0);
|
|
854
1007
|
}, [
|
|
855
1008
|
e,
|
|
856
1009
|
n?.actorName,
|
|
857
1010
|
n?.actorId
|
|
858
1011
|
]), t(() => {
|
|
859
1012
|
c && u(c);
|
|
860
|
-
}, [c]), t(() =>
|
|
1013
|
+
}, [c]), t(() => T(void 0), [
|
|
861
1014
|
e,
|
|
862
|
-
|
|
1015
|
+
_?.epoch,
|
|
863
1016
|
l,
|
|
864
1017
|
n?.actorName,
|
|
865
1018
|
n?.actorId
|
|
866
|
-
]), /* @__PURE__ */
|
|
867
|
-
ref:
|
|
1019
|
+
]), /* @__PURE__ */ M("section", {
|
|
1020
|
+
ref: O,
|
|
868
1021
|
className: "la-observer la-requests",
|
|
869
1022
|
"aria-label": "Request observer",
|
|
870
1023
|
children: [
|
|
871
|
-
(l?.requestId || l?.connectionId) && /* @__PURE__ */
|
|
1024
|
+
(l?.requestId || l?.connectionId) && /* @__PURE__ */ M("p", { children: [
|
|
872
1025
|
"Showing ",
|
|
873
1026
|
l.requestId ? `request ${l.requestId}` : `connection ${l?.connectionId}`,
|
|
874
1027
|
" ",
|
|
875
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ j(B, {
|
|
876
1029
|
variant: "link",
|
|
877
1030
|
onClick: () => u(void 0),
|
|
878
1031
|
children: "Clear filter"
|
|
879
1032
|
})
|
|
880
1033
|
] }),
|
|
881
|
-
/* @__PURE__ */
|
|
1034
|
+
/* @__PURE__ */ M("div", {
|
|
882
1035
|
className: "la-observer-toolbar",
|
|
883
|
-
children: [/* @__PURE__ */
|
|
1036
|
+
children: [/* @__PURE__ */ M("div", {
|
|
1037
|
+
className: n ? "la:sr-only" : void 0,
|
|
1038
|
+
children: [/* @__PURE__ */ j(N, { children: "Requests" }), /* @__PURE__ */ j("p", { children: n ? "Method calls and WebSocket events for this instance." : "Method calls and WebSocket events, with time spent waiting and processing." })]
|
|
1039
|
+
}), /* @__PURE__ */ M("div", {
|
|
884
1040
|
className: "la-request-actions",
|
|
885
|
-
children: [
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
1041
|
+
children: [
|
|
1042
|
+
/* @__PURE__ */ M("div", {
|
|
1043
|
+
className: "request-view-toggle",
|
|
1044
|
+
role: "group",
|
|
1045
|
+
"aria-label": "Request view",
|
|
1046
|
+
children: [/* @__PURE__ */ M(B, {
|
|
1047
|
+
variant: E === "waterfall" ? "secondary" : "ghost",
|
|
1048
|
+
"aria-pressed": E === "waterfall",
|
|
1049
|
+
onClick: () => D("waterfall"),
|
|
1050
|
+
children: [/* @__PURE__ */ j(d, { "aria-hidden": "true" }), "Waterfall"]
|
|
1051
|
+
}), /* @__PURE__ */ M(B, {
|
|
1052
|
+
variant: E === "table" ? "secondary" : "ghost",
|
|
1053
|
+
"aria-pressed": E === "table",
|
|
1054
|
+
onClick: () => D("table"),
|
|
1055
|
+
children: [/* @__PURE__ */ j(ee, { "aria-hidden": "true" }), "Table"]
|
|
1056
|
+
})]
|
|
1057
|
+
}),
|
|
1058
|
+
e.listRequests && /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(B, {
|
|
1059
|
+
variant: l ? "outline" : "secondary",
|
|
1060
|
+
"aria-pressed": !l,
|
|
1061
|
+
onClick: () => {
|
|
1062
|
+
u(void 0), C(void 0);
|
|
1063
|
+
},
|
|
1064
|
+
children: "Live"
|
|
1065
|
+
}), /* @__PURE__ */ j(B, {
|
|
1066
|
+
variant: l ? "secondary" : "outline",
|
|
1067
|
+
"aria-pressed": !!l,
|
|
1068
|
+
onClick: () => {
|
|
1069
|
+
l || u({});
|
|
1070
|
+
},
|
|
1071
|
+
children: "History"
|
|
1072
|
+
})] }),
|
|
1073
|
+
!l && /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ M(B, {
|
|
1074
|
+
variant: "outline",
|
|
1075
|
+
disabled: !P,
|
|
1076
|
+
onClick: () => C(S ? void 0 : _),
|
|
1077
|
+
children: [j(S ? x : b, { "aria-hidden": "true" }), S ? "Resume" : "Pause"]
|
|
1078
|
+
}), v && /* @__PURE__ */ M(B, {
|
|
1079
|
+
variant: "outline",
|
|
1080
|
+
onClick: y,
|
|
1081
|
+
children: [/* @__PURE__ */ j(te, { "aria-hidden": "true" }), "Retry"]
|
|
1082
|
+
})] })
|
|
1083
|
+
]
|
|
909
1084
|
})]
|
|
910
1085
|
}),
|
|
911
|
-
l && /* @__PURE__ */
|
|
1086
|
+
l && /* @__PURE__ */ j(st, {
|
|
912
1087
|
query: l,
|
|
913
|
-
range:
|
|
914
|
-
onRangeChange:
|
|
915
|
-
loading:
|
|
1088
|
+
range: m,
|
|
1089
|
+
onRangeChange: h,
|
|
1090
|
+
loading: g.loading,
|
|
916
1091
|
onSearch: u,
|
|
917
1092
|
scoped: !!n
|
|
918
1093
|
}),
|
|
919
|
-
l &&
|
|
1094
|
+
l && g.failed && /* @__PURE__ */ M("div", {
|
|
920
1095
|
className: "la-observer-error",
|
|
921
1096
|
role: "alert",
|
|
922
1097
|
children: [
|
|
923
1098
|
"Request history unavailable.",
|
|
924
1099
|
" ",
|
|
925
|
-
/* @__PURE__ */
|
|
1100
|
+
/* @__PURE__ */ j(B, {
|
|
926
1101
|
variant: "outline",
|
|
927
|
-
onClick:
|
|
1102
|
+
onClick: g.retry,
|
|
928
1103
|
children: "Retry history"
|
|
929
1104
|
})
|
|
930
1105
|
]
|
|
931
1106
|
}),
|
|
932
|
-
!l &&
|
|
1107
|
+
!l && v && /* @__PURE__ */ M("div", {
|
|
933
1108
|
className: "la-observer-error",
|
|
934
1109
|
role: "alert",
|
|
935
|
-
children: ["Request stream disconnected. Reconnecting… ",
|
|
1110
|
+
children: ["Request stream disconnected. Reconnecting… ", _ ? "Showing the last received requests." : "Check your connection and runtime version."]
|
|
936
1111
|
}),
|
|
937
|
-
!!
|
|
1112
|
+
!!F?.dropped && /* @__PURE__ */ M("div", {
|
|
938
1113
|
className: "la-observer-error",
|
|
939
1114
|
role: "alert",
|
|
940
|
-
children: [
|
|
1115
|
+
children: [F.dropped.toLocaleString(), " request traces were not delivered. This history is incomplete."]
|
|
941
1116
|
}),
|
|
942
|
-
|
|
1117
|
+
F?.persistenceFailed && /* @__PURE__ */ j("div", {
|
|
943
1118
|
className: "la-observer-error",
|
|
944
1119
|
role: "alert",
|
|
945
1120
|
children: "Some request events could not be saved. This history may be incomplete."
|
|
946
1121
|
}),
|
|
947
|
-
|
|
1122
|
+
P?.reset && /* @__PURE__ */ j("div", {
|
|
948
1123
|
className: "la-observer-error",
|
|
949
1124
|
role: "alert",
|
|
950
1125
|
children: "Some older events are no longer retained. Showing available history."
|
|
951
1126
|
}),
|
|
952
|
-
/* @__PURE__ */ j(
|
|
953
|
-
|
|
954
|
-
|
|
1127
|
+
E === "waterfall" && I.length > 0 && /* @__PURE__ */ j(xe, {
|
|
1128
|
+
records: I,
|
|
1129
|
+
selected: w,
|
|
1130
|
+
onSelect: (e, t) => {
|
|
1131
|
+
k.current = t, T(e);
|
|
1132
|
+
}
|
|
1133
|
+
}),
|
|
1134
|
+
/* @__PURE__ */ M("div", {
|
|
1135
|
+
className: E === "table" || !I.length ? "la-observer-table-frame" : void 0,
|
|
1136
|
+
children: [E === "table" && /* @__PURE__ */ M(G, {
|
|
955
1137
|
"aria-label": l ? "Saved requests" : "Recent requests",
|
|
956
1138
|
className: "la-request-table",
|
|
957
|
-
children: [/* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
1139
|
+
children: [/* @__PURE__ */ j(K, { children: /* @__PURE__ */ M(J, { children: [
|
|
1140
|
+
/* @__PURE__ */ j(Y, {
|
|
959
1141
|
scope: "col",
|
|
960
1142
|
children: "Time"
|
|
961
1143
|
}),
|
|
962
|
-
/* @__PURE__ */
|
|
1144
|
+
/* @__PURE__ */ j(Y, {
|
|
963
1145
|
scope: "col",
|
|
964
1146
|
children: "Request"
|
|
965
1147
|
}),
|
|
966
|
-
/* @__PURE__ */
|
|
1148
|
+
/* @__PURE__ */ j(Y, {
|
|
967
1149
|
scope: "col",
|
|
968
1150
|
children: "Instance"
|
|
969
1151
|
}),
|
|
970
|
-
/* @__PURE__ */
|
|
1152
|
+
/* @__PURE__ */ j(Y, {
|
|
971
1153
|
scope: "col",
|
|
972
1154
|
children: "Transport"
|
|
973
1155
|
}),
|
|
974
|
-
/* @__PURE__ */
|
|
1156
|
+
/* @__PURE__ */ j(Y, {
|
|
975
1157
|
scope: "col",
|
|
976
1158
|
children: "Outcome"
|
|
977
1159
|
}),
|
|
978
|
-
/* @__PURE__ */
|
|
1160
|
+
/* @__PURE__ */ j(Y, {
|
|
979
1161
|
scope: "col",
|
|
980
1162
|
children: "Total"
|
|
981
1163
|
}),
|
|
982
|
-
/* @__PURE__ */
|
|
1164
|
+
/* @__PURE__ */ j(Y, {
|
|
983
1165
|
scope: "col",
|
|
984
1166
|
children: "Queue wait"
|
|
985
1167
|
}),
|
|
986
|
-
/* @__PURE__ */
|
|
1168
|
+
/* @__PURE__ */ j(Y, {
|
|
987
1169
|
scope: "col",
|
|
988
|
-
children: /* @__PURE__ */
|
|
1170
|
+
children: /* @__PURE__ */ j("span", {
|
|
989
1171
|
className: "la:sr-only",
|
|
990
1172
|
children: "Details"
|
|
991
1173
|
})
|
|
992
1174
|
})
|
|
993
|
-
] }) }), /* @__PURE__ */
|
|
1175
|
+
] }) }), /* @__PURE__ */ j(q, { children: I.map((e) => /* @__PURE__ */ M(J, {
|
|
994
1176
|
className: "la-clickable-row",
|
|
995
|
-
"data-state":
|
|
1177
|
+
"data-state": w === e ? "selected" : void 0,
|
|
996
1178
|
onClick: (t) => {
|
|
997
|
-
|
|
1179
|
+
k.current = t.currentTarget.querySelector("button"), T(e);
|
|
998
1180
|
},
|
|
999
1181
|
children: [
|
|
1000
|
-
/* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ j("time", {
|
|
1001
1183
|
dateTime: new Date(e.startedAtMs).toISOString(),
|
|
1002
1184
|
title: new Date(e.startedAtMs).toLocaleString(),
|
|
1003
1185
|
children: l ? new Date(e.startedAtMs).toLocaleString([], { hour12: !1 }) : new Date(e.startedAtMs).toLocaleTimeString([], { hour12: !1 })
|
|
1004
1186
|
}) }),
|
|
1005
|
-
/* @__PURE__ */
|
|
1187
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ j("span", {
|
|
1006
1188
|
className: "la-request-operation",
|
|
1007
1189
|
title: e.operation,
|
|
1008
1190
|
children: e.operation
|
|
1009
1191
|
}) }),
|
|
1010
|
-
/* @__PURE__ */
|
|
1192
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ M("span", {
|
|
1011
1193
|
className: "la-request-actor",
|
|
1012
1194
|
title: `${e.actorName} / ${e.actorId}`,
|
|
1013
1195
|
children: [
|
|
@@ -1016,18 +1198,18 @@ function Qe({ client: e, actor: n, timeRange: o, onTimeRangeChange: s, focus: c
|
|
|
1016
1198
|
e.actorId
|
|
1017
1199
|
]
|
|
1018
1200
|
}) }),
|
|
1019
|
-
/* @__PURE__ */
|
|
1020
|
-
/* @__PURE__ */
|
|
1201
|
+
/* @__PURE__ */ j(X, { children: e.kind === "method" ? "Method" : "WebSocket" }),
|
|
1202
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ j(U, {
|
|
1021
1203
|
variant: "outline",
|
|
1022
1204
|
className: `la-request-outcome-${e.outcome}`,
|
|
1023
1205
|
children: e.outcome[0].toUpperCase() + e.outcome.slice(1)
|
|
1024
1206
|
}) }),
|
|
1025
|
-
/* @__PURE__ */
|
|
1026
|
-
/* @__PURE__ */
|
|
1207
|
+
/* @__PURE__ */ j(X, { children: z(e.durationMs) }),
|
|
1208
|
+
/* @__PURE__ */ j(X, { children: e.queueWaitMs === null ? /* @__PURE__ */ j("span", {
|
|
1027
1209
|
title: "Request did not begin processing",
|
|
1028
1210
|
children: "—"
|
|
1029
|
-
}) :
|
|
1030
|
-
/* @__PURE__ */
|
|
1211
|
+
}) : z(e.queueWaitMs) }),
|
|
1212
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ j(B, {
|
|
1031
1213
|
variant: "ghost",
|
|
1032
1214
|
size: "sm",
|
|
1033
1215
|
"aria-label": `Inspect ${e.operation} request`,
|
|
@@ -1035,58 +1217,61 @@ function Qe({ client: e, actor: n, timeRange: o, onTimeRangeChange: s, focus: c
|
|
|
1035
1217
|
children: "Details"
|
|
1036
1218
|
}) })
|
|
1037
1219
|
]
|
|
1038
|
-
}, e.eventId ?? `${
|
|
1039
|
-
}), !
|
|
1220
|
+
}, e.eventId ?? `${P.epoch}-${e.sequence}`)) })]
|
|
1221
|
+
}), !I.length && /* @__PURE__ */ M("div", {
|
|
1040
1222
|
className: "la-request-empty",
|
|
1041
1223
|
role: "status",
|
|
1042
|
-
children: [/* @__PURE__ */
|
|
1224
|
+
children: [/* @__PURE__ */ j("strong", { children: l ? g.loading ? "Loading history…" : g.failed ? "History unavailable" : "No saved requests in this range" : P ? "No requests yet" : v ? "Requests unavailable" : "Connecting to requests…" }), /* @__PURE__ */ j("p", { children: l ? "Try a wider time range or fewer filters. Local history retains the latest 10,000 events." : "Call an actor method or send a WebSocket message to see its timings." })]
|
|
1043
1225
|
})]
|
|
1044
1226
|
}),
|
|
1045
|
-
l &&
|
|
1227
|
+
l && P?.nextCursor && /* @__PURE__ */ j(B, {
|
|
1046
1228
|
className: "la-request-load-older",
|
|
1047
1229
|
variant: "outline",
|
|
1048
|
-
disabled:
|
|
1049
|
-
onClick:
|
|
1050
|
-
children:
|
|
1230
|
+
disabled: g.loading,
|
|
1231
|
+
onClick: g.loadOlder,
|
|
1232
|
+
children: g.loading ? "Loading…" : "Load older"
|
|
1051
1233
|
}),
|
|
1052
|
-
/* @__PURE__ */
|
|
1234
|
+
/* @__PURE__ */ M("div", {
|
|
1053
1235
|
className: "la-observer-footnote",
|
|
1054
|
-
children: [/* @__PURE__ */
|
|
1236
|
+
children: [/* @__PURE__ */ M("span", {
|
|
1055
1237
|
className: "la-observer-refresh-status",
|
|
1056
|
-
children: [!l && /* @__PURE__ */
|
|
1057
|
-
}), /* @__PURE__ */
|
|
1238
|
+
children: [!l && /* @__PURE__ */ j("span", { className: `la-observer-dot ${v ? "la-observer-dot-unknown" : "la-observer-dot-live"}` }), l ? "Saved history" : S ? "Display paused · collection continues" : v ? "Reconnecting…" : _ ? "Live updates" : "Connecting…"]
|
|
1239
|
+
}), /* @__PURE__ */ j("span", { children: l ? `${I.length.toLocaleString()} saved requests shown` : n ? `${I.length} matching requests from the latest ${P?.capacity ?? 500} on this control plane.` : `Latest ${P?.capacity ?? 500} requests on this control plane.` })]
|
|
1058
1240
|
}),
|
|
1059
|
-
!l && !!
|
|
1241
|
+
!l && !!P?.evicted && /* @__PURE__ */ M("p", {
|
|
1060
1242
|
className: "la-request-note",
|
|
1061
|
-
children: [
|
|
1243
|
+
children: [P.evicted.toLocaleString(), " older records have left this history window."]
|
|
1062
1244
|
}),
|
|
1063
|
-
/* @__PURE__ */
|
|
1245
|
+
/* @__PURE__ */ j("p", {
|
|
1064
1246
|
className: "la-request-note",
|
|
1065
1247
|
children: "Total includes queue wait, actor processing, and persistence. Queue wait includes the WebSocket message queue. Timings exclude the caller’s network round trip."
|
|
1066
1248
|
}),
|
|
1067
|
-
/* @__PURE__ */
|
|
1068
|
-
open: !!
|
|
1249
|
+
/* @__PURE__ */ j(Ye, {
|
|
1250
|
+
open: !!w,
|
|
1069
1251
|
onOpenChange: (e) => {
|
|
1070
|
-
e ||
|
|
1252
|
+
e || T(void 0);
|
|
1071
1253
|
},
|
|
1072
|
-
children: /* @__PURE__ */
|
|
1073
|
-
container:
|
|
1254
|
+
children: /* @__PURE__ */ M(Qe, {
|
|
1255
|
+
container: O.current,
|
|
1074
1256
|
onCloseAutoFocus: (e) => {
|
|
1075
|
-
e.preventDefault(),
|
|
1257
|
+
e.preventDefault(), k.current?.focus();
|
|
1076
1258
|
},
|
|
1077
1259
|
children: [
|
|
1078
|
-
/* @__PURE__ */
|
|
1079
|
-
/* @__PURE__ */
|
|
1080
|
-
|
|
1260
|
+
/* @__PURE__ */ j(Xe, { children: "Request details" }),
|
|
1261
|
+
/* @__PURE__ */ j(Ze, { children: "Full identifiers and timings for this request." }),
|
|
1262
|
+
w && /* @__PURE__ */ j(ct, {
|
|
1263
|
+
record: w,
|
|
1264
|
+
timing: ve(I).rows.find((e) => e.record === w)
|
|
1265
|
+
})
|
|
1081
1266
|
]
|
|
1082
1267
|
})
|
|
1083
1268
|
})
|
|
1084
1269
|
]
|
|
1085
1270
|
});
|
|
1086
1271
|
}
|
|
1087
|
-
function
|
|
1272
|
+
function st({ query: e, range: t, onRangeChange: r, loading: i, onSearch: a, scoped: o }) {
|
|
1088
1273
|
let s = n(), c = n();
|
|
1089
|
-
return /* @__PURE__ */
|
|
1274
|
+
return /* @__PURE__ */ M("form", {
|
|
1090
1275
|
className: "la-request-history-filters",
|
|
1091
1276
|
onSubmit: (e) => {
|
|
1092
1277
|
e.preventDefault();
|
|
@@ -1097,20 +1282,20 @@ function $e({ query: e, range: t, onRangeChange: r, loading: i, onSearch: a, sco
|
|
|
1097
1282
|
});
|
|
1098
1283
|
},
|
|
1099
1284
|
children: [
|
|
1100
|
-
/* @__PURE__ */
|
|
1285
|
+
/* @__PURE__ */ M("div", {
|
|
1101
1286
|
className: "la-request-history-range",
|
|
1102
|
-
children: [/* @__PURE__ */
|
|
1287
|
+
children: [/* @__PURE__ */ j("span", { children: "Time range" }), /* @__PURE__ */ j(Be, {
|
|
1103
1288
|
value: t,
|
|
1104
1289
|
onChange: r,
|
|
1105
1290
|
align: "start"
|
|
1106
1291
|
})]
|
|
1107
1292
|
}),
|
|
1108
|
-
!o && /* @__PURE__ */
|
|
1293
|
+
!o && /* @__PURE__ */ M("div", {
|
|
1109
1294
|
className: "la-request-history-field",
|
|
1110
|
-
children: [/* @__PURE__ */
|
|
1295
|
+
children: [/* @__PURE__ */ j("label", {
|
|
1111
1296
|
htmlFor: s,
|
|
1112
1297
|
children: "Actor ID"
|
|
1113
|
-
}), /* @__PURE__ */
|
|
1298
|
+
}), /* @__PURE__ */ j(V, {
|
|
1114
1299
|
id: s,
|
|
1115
1300
|
name: "actorId",
|
|
1116
1301
|
placeholder: "All actors",
|
|
@@ -1118,17 +1303,17 @@ function $e({ query: e, range: t, onRangeChange: r, loading: i, onSearch: a, sco
|
|
|
1118
1303
|
defaultValue: e.actorId
|
|
1119
1304
|
})]
|
|
1120
1305
|
}),
|
|
1121
|
-
/* @__PURE__ */
|
|
1306
|
+
/* @__PURE__ */ M("div", {
|
|
1122
1307
|
className: "la-request-history-field",
|
|
1123
|
-
children: [/* @__PURE__ */
|
|
1308
|
+
children: [/* @__PURE__ */ j("label", {
|
|
1124
1309
|
htmlFor: c,
|
|
1125
1310
|
children: "Outcome"
|
|
1126
|
-
}), /* @__PURE__ */
|
|
1311
|
+
}), /* @__PURE__ */ M(Je, {
|
|
1127
1312
|
id: c,
|
|
1128
1313
|
className: "la-observer-select",
|
|
1129
1314
|
name: "outcome",
|
|
1130
1315
|
defaultValue: e.outcome ?? "",
|
|
1131
|
-
children: [/* @__PURE__ */
|
|
1316
|
+
children: [/* @__PURE__ */ j(W, {
|
|
1132
1317
|
value: "",
|
|
1133
1318
|
children: "All outcomes"
|
|
1134
1319
|
}), [
|
|
@@ -1137,13 +1322,13 @@ function $e({ query: e, range: t, onRangeChange: r, loading: i, onSearch: a, sco
|
|
|
1137
1322
|
"rejected",
|
|
1138
1323
|
"rerouted",
|
|
1139
1324
|
"interrupted"
|
|
1140
|
-
].map((e) => /* @__PURE__ */
|
|
1325
|
+
].map((e) => /* @__PURE__ */ j(W, {
|
|
1141
1326
|
value: e,
|
|
1142
1327
|
children: e[0].toUpperCase() + e.slice(1)
|
|
1143
1328
|
}, e))]
|
|
1144
1329
|
})]
|
|
1145
1330
|
}),
|
|
1146
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ j(B, {
|
|
1147
1332
|
type: "submit",
|
|
1148
1333
|
variant: "outline",
|
|
1149
1334
|
disabled: i,
|
|
@@ -1152,8 +1337,8 @@ function $e({ query: e, range: t, onRangeChange: r, loading: i, onSearch: a, sco
|
|
|
1152
1337
|
]
|
|
1153
1338
|
});
|
|
1154
1339
|
}
|
|
1155
|
-
function
|
|
1156
|
-
let
|
|
1340
|
+
function ct({ record: e, timing: t }) {
|
|
1341
|
+
let n = {
|
|
1157
1342
|
Operation: e.operation,
|
|
1158
1343
|
"Actor class": e.actorName,
|
|
1159
1344
|
"Instance ID": e.actorId,
|
|
@@ -1161,29 +1346,30 @@ function et({ record: e }) {
|
|
|
1161
1346
|
Time: new Date(e.startedAtMs).toLocaleString(),
|
|
1162
1347
|
Transport: e.kind === "method" ? "Method" : "WebSocket",
|
|
1163
1348
|
Outcome: e.outcome,
|
|
1164
|
-
Total:
|
|
1165
|
-
"Queue wait": e.queueWaitMs === null ? "Did not begin processing" :
|
|
1349
|
+
Total: z(e.durationMs),
|
|
1350
|
+
"Queue wait": e.queueWaitMs === null ? "Did not begin processing" : z(e.queueWaitMs),
|
|
1351
|
+
...t ? {
|
|
1352
|
+
"Start offset in view": z(t.offsetMs),
|
|
1353
|
+
"Gap from preceding calls": ye(t.gapMs)
|
|
1354
|
+
} : {},
|
|
1166
1355
|
Host: e.hostId,
|
|
1167
1356
|
...e.connectionId ? { Connection: e.connectionId } : {}
|
|
1168
1357
|
};
|
|
1169
|
-
return /* @__PURE__ */
|
|
1358
|
+
return /* @__PURE__ */ j("dl", {
|
|
1170
1359
|
className: "la-request-details",
|
|
1171
|
-
children: Object.entries(
|
|
1360
|
+
children: Object.entries(n).map(([e, t]) => /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("dt", { children: e }), /* @__PURE__ */ j("dd", { children: t })] }, e))
|
|
1172
1361
|
});
|
|
1173
1362
|
}
|
|
1174
|
-
function tt(e) {
|
|
1175
|
-
return e >= 1e3 ? `${(e / 1e3).toLocaleString(void 0, { maximumFractionDigits: 2 })} s` : `${e.toLocaleString(void 0, { maximumFractionDigits: 1 })} ms`;
|
|
1176
|
-
}
|
|
1177
1363
|
//#endregion
|
|
1178
1364
|
//#region src/state-diff.ts
|
|
1179
|
-
var
|
|
1180
|
-
function
|
|
1181
|
-
let n =
|
|
1182
|
-
return n ?
|
|
1365
|
+
var lt = ie({ arrays: { detectMove: !1 } });
|
|
1366
|
+
function ut(e, t) {
|
|
1367
|
+
let n = lt.diff(e, t);
|
|
1368
|
+
return n ? ae(n, e) ?? "" : "";
|
|
1183
1369
|
}
|
|
1184
1370
|
//#endregion
|
|
1185
1371
|
//#region src/state-inspection.ts
|
|
1186
|
-
function
|
|
1372
|
+
function dt(e, n, r) {
|
|
1187
1373
|
let [o, s] = a(), [c, l] = a(), [u, d] = a(!1), [f, p] = a(!0), [m, h] = a(0), g = i(() => {});
|
|
1188
1374
|
return t(() => {
|
|
1189
1375
|
let t = new AbortController(), i = !1, a = !1, o, c;
|
|
@@ -1246,22 +1432,22 @@ function it(e, n, r) {
|
|
|
1246
1432
|
}
|
|
1247
1433
|
//#endregion
|
|
1248
1434
|
//#region src/StateInspector.tsx
|
|
1249
|
-
function
|
|
1250
|
-
let { client: t, actorName: n, actorId: r } = e, i =
|
|
1251
|
-
return /* @__PURE__ */
|
|
1435
|
+
function ft(e) {
|
|
1436
|
+
let { client: t, actorName: n, actorId: r } = e, i = dt(t, n, r), [o, s] = a("state"), [c, l] = a(), [u, d] = a(), [f, p] = a(""), [m, h] = a(0), g = i.current?.snapshot, v = g?.stateVersion ?? 0, y = c ?? v, ee = i.knownVersion > v || v > (i.history?.records[0]?.stateVersion ?? 0);
|
|
1437
|
+
return /* @__PURE__ */ M("section", {
|
|
1252
1438
|
className: "la-state",
|
|
1253
1439
|
"aria-label": "Persisted state",
|
|
1254
1440
|
children: [
|
|
1255
|
-
/* @__PURE__ */
|
|
1441
|
+
/* @__PURE__ */ M("div", {
|
|
1256
1442
|
className: "la-state-heading",
|
|
1257
|
-
children: [/* @__PURE__ */
|
|
1443
|
+
children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("h3", { children: "Persisted state" }), /* @__PURE__ */ j("p", { children: "Committed fields and their progression in storage." })] }), /* @__PURE__ */ M("div", {
|
|
1258
1444
|
className: "la-state-actions",
|
|
1259
|
-
children: [
|
|
1445
|
+
children: [g && /* @__PURE__ */ M(B, {
|
|
1260
1446
|
variant: "outline",
|
|
1261
1447
|
size: "sm",
|
|
1262
|
-
onClick: () =>
|
|
1263
|
-
children: [/* @__PURE__ */
|
|
1264
|
-
}), /* @__PURE__ */
|
|
1448
|
+
onClick: () => _t(g.state, `${n}-${r}-v${v}.json`),
|
|
1449
|
+
children: [/* @__PURE__ */ j(_, { "aria-hidden": "true" }), "Download JSON"]
|
|
1450
|
+
}), /* @__PURE__ */ M(B, {
|
|
1265
1451
|
variant: "outline",
|
|
1266
1452
|
size: "sm",
|
|
1267
1453
|
disabled: i.loading,
|
|
@@ -1269,87 +1455,87 @@ function at(e) {
|
|
|
1269
1455
|
i.refresh(), h((e) => e + 1);
|
|
1270
1456
|
},
|
|
1271
1457
|
"aria-label": "Refresh state",
|
|
1272
|
-
children: [/* @__PURE__ */
|
|
1458
|
+
children: [/* @__PURE__ */ j(te, { "aria-hidden": "true" }), "Refresh"]
|
|
1273
1459
|
})]
|
|
1274
1460
|
})]
|
|
1275
1461
|
}),
|
|
1276
|
-
/* @__PURE__ */
|
|
1462
|
+
/* @__PURE__ */ M("div", {
|
|
1277
1463
|
className: "la-state-tabs",
|
|
1278
1464
|
"aria-label": "State views",
|
|
1279
1465
|
children: [
|
|
1280
|
-
/* @__PURE__ */
|
|
1466
|
+
/* @__PURE__ */ j(B, {
|
|
1281
1467
|
variant: o === "state" ? "secondary" : "ghost",
|
|
1282
1468
|
"aria-pressed": o === "state",
|
|
1283
1469
|
onClick: () => s("state"),
|
|
1284
1470
|
children: "State"
|
|
1285
1471
|
}),
|
|
1286
|
-
/* @__PURE__ */
|
|
1472
|
+
/* @__PURE__ */ j(B, {
|
|
1287
1473
|
variant: o === "changes" ? "secondary" : "ghost",
|
|
1288
1474
|
"aria-pressed": o === "changes",
|
|
1289
1475
|
onClick: () => s("changes"),
|
|
1290
1476
|
children: "Changes"
|
|
1291
1477
|
}),
|
|
1292
|
-
|
|
1478
|
+
g && /* @__PURE__ */ M("span", {
|
|
1293
1479
|
className: "la-state-version",
|
|
1294
1480
|
children: ["Version ", v]
|
|
1295
1481
|
})
|
|
1296
1482
|
]
|
|
1297
1483
|
}),
|
|
1298
|
-
i.failed && /* @__PURE__ */
|
|
1484
|
+
i.failed && /* @__PURE__ */ M("p", {
|
|
1299
1485
|
role: "alert",
|
|
1300
1486
|
children: ["Could not refresh state. Check your connection and use Refresh to retry.", i.current && " Showing the last loaded version."]
|
|
1301
1487
|
}),
|
|
1302
|
-
|
|
1488
|
+
ee && /* @__PURE__ */ j("p", {
|
|
1303
1489
|
className: "la-state-notice",
|
|
1304
1490
|
role: "status",
|
|
1305
1491
|
children: "A newer commit is syncing to storage. Retrying automatically…"
|
|
1306
1492
|
}),
|
|
1307
|
-
!i.current && !i.failed && /* @__PURE__ */
|
|
1493
|
+
!i.current && !i.failed && /* @__PURE__ */ j("p", {
|
|
1308
1494
|
role: "status",
|
|
1309
1495
|
children: "Loading persisted state…"
|
|
1310
1496
|
}),
|
|
1311
|
-
i.current && !
|
|
1497
|
+
i.current && !g && /* @__PURE__ */ j("p", {
|
|
1312
1498
|
className: "la-state-empty",
|
|
1313
1499
|
children: "No persisted state yet. Fields appear after the actor commits its first change."
|
|
1314
1500
|
}),
|
|
1315
|
-
o === "state" &&
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
record:
|
|
1501
|
+
o === "state" && g && /* @__PURE__ */ M(A, { children: [
|
|
1502
|
+
/* @__PURE__ */ j(ht, {
|
|
1503
|
+
record: g,
|
|
1318
1504
|
onInspect: e.onInspectRequest
|
|
1319
1505
|
}),
|
|
1320
|
-
/* @__PURE__ */
|
|
1506
|
+
/* @__PURE__ */ j(V, {
|
|
1321
1507
|
"aria-label": "Filter persisted fields",
|
|
1322
1508
|
placeholder: "Filter fields…",
|
|
1323
1509
|
value: f,
|
|
1324
1510
|
onChange: (e) => p(e.target.value)
|
|
1325
1511
|
}),
|
|
1326
|
-
/* @__PURE__ */
|
|
1327
|
-
state:
|
|
1512
|
+
/* @__PURE__ */ j(pt, {
|
|
1513
|
+
state: g.state,
|
|
1328
1514
|
query: f,
|
|
1329
1515
|
schema: i.current?.schema ?? null
|
|
1330
1516
|
})
|
|
1331
1517
|
] }),
|
|
1332
|
-
o === "changes" && /* @__PURE__ */
|
|
1518
|
+
o === "changes" && /* @__PURE__ */ M("div", {
|
|
1333
1519
|
className: "la-state-history",
|
|
1334
|
-
children: [/* @__PURE__ */
|
|
1520
|
+
children: [/* @__PURE__ */ M("aside", {
|
|
1335
1521
|
"aria-label": "State versions",
|
|
1336
1522
|
children: [
|
|
1337
|
-
/* @__PURE__ */
|
|
1338
|
-
!i.history?.records.length && /* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1523
|
+
/* @__PURE__ */ j("h4", { children: "Versions" }),
|
|
1524
|
+
!i.history?.records.length && /* @__PURE__ */ j("p", { children: "No recorded history yet." }),
|
|
1525
|
+
/* @__PURE__ */ j("ol", { children: i.history?.records.map((e) => /* @__PURE__ */ j("li", { children: /* @__PURE__ */ M("button", {
|
|
1340
1526
|
type: "button",
|
|
1341
1527
|
"aria-label": `Version ${e.stateVersion} · ${e.attribution?.operation ?? "Unknown operation"}`,
|
|
1342
1528
|
"aria-pressed": y === e.stateVersion,
|
|
1343
1529
|
onClick: () => {
|
|
1344
1530
|
l(e.stateVersion), d(void 0);
|
|
1345
1531
|
},
|
|
1346
|
-
children: [/* @__PURE__ */
|
|
1532
|
+
children: [/* @__PURE__ */ M("strong", { children: [
|
|
1347
1533
|
"Version ",
|
|
1348
1534
|
e.stateVersion,
|
|
1349
|
-
/* @__PURE__ */
|
|
1350
|
-
] }), /* @__PURE__ */
|
|
1535
|
+
/* @__PURE__ */ j("span", { children: e.attribution?.operation ?? "Unknown operation" })
|
|
1536
|
+
] }), /* @__PURE__ */ j("small", { children: e.attribution ? new Date(e.attribution.committedAtMs).toLocaleTimeString() : "Time unavailable" })]
|
|
1351
1537
|
}) }, e.stateVersion)) }),
|
|
1352
|
-
i.history?.nextBefore && /* @__PURE__ */
|
|
1538
|
+
i.history?.nextBefore && /* @__PURE__ */ j(B, {
|
|
1353
1539
|
variant: "outline",
|
|
1354
1540
|
size: "sm",
|
|
1355
1541
|
disabled: i.loading,
|
|
@@ -1357,118 +1543,118 @@ function at(e) {
|
|
|
1357
1543
|
children: "Load older versions"
|
|
1358
1544
|
})
|
|
1359
1545
|
]
|
|
1360
|
-
}), /* @__PURE__ */
|
|
1546
|
+
}), /* @__PURE__ */ M("div", {
|
|
1361
1547
|
className: "la-state-comparison",
|
|
1362
|
-
children: [c !== void 0 && v > c && /* @__PURE__ */
|
|
1548
|
+
children: [c !== void 0 && v > c && /* @__PURE__ */ M(B, {
|
|
1363
1549
|
variant: "outline",
|
|
1364
1550
|
size: "sm",
|
|
1365
1551
|
onClick: () => {
|
|
1366
1552
|
l(void 0), d(void 0);
|
|
1367
1553
|
},
|
|
1368
1554
|
children: ["View latest · version ", v]
|
|
1369
|
-
}), !!y && /* @__PURE__ */
|
|
1555
|
+
}), !!y && /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ M("div", {
|
|
1370
1556
|
className: "la-state-compare-heading",
|
|
1371
|
-
children: [/* @__PURE__ */
|
|
1557
|
+
children: [/* @__PURE__ */ M("h4", { children: ["Version ", y] }), /* @__PURE__ */ M(Je, {
|
|
1372
1558
|
"aria-label": "Compare with version",
|
|
1373
1559
|
value: u ?? Math.max(0, y - 1),
|
|
1374
1560
|
onChange: (e) => d(Number(e.target.value)),
|
|
1375
|
-
children: [/* @__PURE__ */
|
|
1561
|
+
children: [/* @__PURE__ */ j(W, {
|
|
1376
1562
|
value: Math.max(0, y - 1),
|
|
1377
1563
|
children: y === 1 ? "Before first commit" : `Previous · version ${y - 1}`
|
|
1378
|
-
}), i.history?.records.filter((e) => e.stateVersion < y - 1).map((e) => /* @__PURE__ */
|
|
1564
|
+
}), i.history?.records.filter((e) => e.stateVersion < y - 1).map((e) => /* @__PURE__ */ M(W, {
|
|
1379
1565
|
value: e.stateVersion,
|
|
1380
1566
|
children: ["Version ", e.stateVersion]
|
|
1381
1567
|
}, e.stateVersion))]
|
|
1382
1568
|
})]
|
|
1383
|
-
}), /* @__PURE__ */
|
|
1569
|
+
}), /* @__PURE__ */ j(gt, {
|
|
1384
1570
|
...e,
|
|
1385
1571
|
version: y,
|
|
1386
1572
|
baseline: u ?? Math.max(0, y - 1)
|
|
1387
1573
|
}, `${n}/${r}/${y}/${u}/${m}`)] })]
|
|
1388
1574
|
})]
|
|
1389
1575
|
}),
|
|
1390
|
-
/* @__PURE__ */
|
|
1576
|
+
/* @__PURE__ */ j("p", {
|
|
1391
1577
|
className: "la-state-footnote",
|
|
1392
1578
|
children: "Values come from actor storage. Request events signal new versions; history follows completed uploads."
|
|
1393
1579
|
})
|
|
1394
1580
|
]
|
|
1395
1581
|
});
|
|
1396
1582
|
}
|
|
1397
|
-
function
|
|
1583
|
+
function pt({ state: e, query: t, schema: n }) {
|
|
1398
1584
|
let r = Object.entries(e).filter(([e]) => e.toLowerCase().includes(t.toLowerCase()));
|
|
1399
|
-
return /* @__PURE__ */
|
|
1585
|
+
return /* @__PURE__ */ M("div", {
|
|
1400
1586
|
className: "la-observer-table-frame",
|
|
1401
|
-
children: [/* @__PURE__ */
|
|
1587
|
+
children: [/* @__PURE__ */ M(G, {
|
|
1402
1588
|
"aria-label": "Persisted fields",
|
|
1403
|
-
children: [/* @__PURE__ */
|
|
1404
|
-
/* @__PURE__ */
|
|
1405
|
-
/* @__PURE__ */
|
|
1406
|
-
/* @__PURE__ */
|
|
1407
|
-
] }) }), /* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */
|
|
1589
|
+
children: [/* @__PURE__ */ j(K, { children: /* @__PURE__ */ M(J, { children: [
|
|
1590
|
+
/* @__PURE__ */ j(Y, { children: "Field" }),
|
|
1591
|
+
/* @__PURE__ */ j(Y, { children: "Type" }),
|
|
1592
|
+
/* @__PURE__ */ j(Y, { children: "Value" })
|
|
1593
|
+
] }) }), /* @__PURE__ */ j(q, { children: r.map(([e, t]) => /* @__PURE__ */ M(J, { children: [
|
|
1594
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ j("code", { children: e }) }),
|
|
1595
|
+
/* @__PURE__ */ M(X, { children: [/* @__PURE__ */ j("span", {
|
|
1410
1596
|
className: "la-state-type",
|
|
1411
|
-
children:
|
|
1412
|
-
}),
|
|
1597
|
+
children: vt(t)
|
|
1598
|
+
}), yt(n, e) && /* @__PURE__ */ j("small", {
|
|
1413
1599
|
className: "la-state-schema",
|
|
1414
|
-
children:
|
|
1600
|
+
children: yt(n, e)
|
|
1415
1601
|
})] }),
|
|
1416
|
-
/* @__PURE__ */
|
|
1602
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ j(mt, { value: t }) })
|
|
1417
1603
|
] }, e)) })]
|
|
1418
|
-
}), !r.length && /* @__PURE__ */
|
|
1604
|
+
}), !r.length && /* @__PURE__ */ j("p", {
|
|
1419
1605
|
className: "la-state-empty",
|
|
1420
1606
|
children: t ? "No matching fields." : "The persisted state is an empty object."
|
|
1421
1607
|
})]
|
|
1422
1608
|
});
|
|
1423
1609
|
}
|
|
1424
|
-
function
|
|
1610
|
+
function mt({ value: e }) {
|
|
1425
1611
|
let t = JSON.stringify(e);
|
|
1426
|
-
return t.length > 1e5 ? /* @__PURE__ */
|
|
1612
|
+
return t.length > 1e5 ? /* @__PURE__ */ M("span", { children: [
|
|
1427
1613
|
"Large value (",
|
|
1428
1614
|
Math.round(t.length / 1024),
|
|
1429
1615
|
" KB). Use Download JSON to inspect it."
|
|
1430
|
-
] }) : typeof e == "object" && e ? /* @__PURE__ */
|
|
1616
|
+
] }) : typeof e == "object" && e ? /* @__PURE__ */ j(re, {
|
|
1431
1617
|
data: e,
|
|
1432
1618
|
shouldExpandNode: (e) => e < 1,
|
|
1433
|
-
style:
|
|
1434
|
-
}) : /* @__PURE__ */
|
|
1435
|
-
className: `la-state-json-${
|
|
1619
|
+
style: bt
|
|
1620
|
+
}) : /* @__PURE__ */ j("code", {
|
|
1621
|
+
className: `la-state-json-${vt(e)}`,
|
|
1436
1622
|
children: t
|
|
1437
1623
|
});
|
|
1438
1624
|
}
|
|
1439
|
-
function
|
|
1625
|
+
function ht({ record: e, onInspect: t }) {
|
|
1440
1626
|
let n = e.attribution;
|
|
1441
|
-
return /* @__PURE__ */
|
|
1627
|
+
return /* @__PURE__ */ M("div", {
|
|
1442
1628
|
className: "la-state-attribution",
|
|
1443
1629
|
children: [
|
|
1444
|
-
/* @__PURE__ */
|
|
1445
|
-
/* @__PURE__ */
|
|
1630
|
+
/* @__PURE__ */ M("span", { children: ["Committed by ", /* @__PURE__ */ j("strong", { children: n?.operation ?? "Unknown operation" })] }),
|
|
1631
|
+
/* @__PURE__ */ M("span", { children: [
|
|
1446
1632
|
"Request",
|
|
1447
1633
|
" ",
|
|
1448
|
-
t ? /* @__PURE__ */
|
|
1634
|
+
t ? /* @__PURE__ */ j("button", {
|
|
1449
1635
|
type: "button",
|
|
1450
1636
|
onClick: () => t({ requestId: e.requestId }),
|
|
1451
1637
|
children: e.requestId
|
|
1452
|
-
}) : /* @__PURE__ */
|
|
1638
|
+
}) : /* @__PURE__ */ j("code", { children: e.requestId })
|
|
1453
1639
|
] }),
|
|
1454
|
-
n?.connectionId && /* @__PURE__ */
|
|
1640
|
+
n?.connectionId && /* @__PURE__ */ M("span", { children: [
|
|
1455
1641
|
"Connection",
|
|
1456
1642
|
" ",
|
|
1457
|
-
t ? /* @__PURE__ */
|
|
1643
|
+
t ? /* @__PURE__ */ j("button", {
|
|
1458
1644
|
type: "button",
|
|
1459
1645
|
onClick: () => t({ connectionId: n.connectionId }),
|
|
1460
1646
|
children: n.connectionId
|
|
1461
|
-
}) : /* @__PURE__ */
|
|
1647
|
+
}) : /* @__PURE__ */ j("code", { children: n.connectionId })
|
|
1462
1648
|
] }),
|
|
1463
|
-
n && /* @__PURE__ */
|
|
1649
|
+
n && /* @__PURE__ */ j("time", {
|
|
1464
1650
|
dateTime: new Date(n.committedAtMs).toISOString(),
|
|
1465
1651
|
children: new Date(n.committedAtMs).toLocaleString()
|
|
1466
1652
|
}),
|
|
1467
|
-
n?.interleaved && /* @__PURE__ */
|
|
1653
|
+
n?.interleaved && /* @__PURE__ */ j("p", { children: "Overlapping requests may contribute to this snapshot. This identifies the committing request." })
|
|
1468
1654
|
]
|
|
1469
1655
|
});
|
|
1470
1656
|
}
|
|
1471
|
-
function
|
|
1657
|
+
function gt({ client: e, actorName: n, actorId: r, version: i, baseline: o, onInspectRequest: s }) {
|
|
1472
1658
|
let [c, l] = a(), [u, d] = a(), [f, p] = a();
|
|
1473
1659
|
return t(() => {
|
|
1474
1660
|
let t = new AbortController(), a;
|
|
@@ -1501,7 +1687,7 @@ function lt({ client: e, actorName: n, actorId: r, version: i, baseline: o, onIn
|
|
|
1501
1687
|
after: u.state
|
|
1502
1688
|
})) : l({
|
|
1503
1689
|
after: u,
|
|
1504
|
-
html:
|
|
1690
|
+
html: ut(c.snapshot.state, u.state)
|
|
1505
1691
|
});
|
|
1506
1692
|
} catch (e) {
|
|
1507
1693
|
t.signal.aborted || d(e instanceof Error ? e.message : "Could not load versions.");
|
|
@@ -1516,44 +1702,44 @@ function lt({ client: e, actorName: n, actorId: r, version: i, baseline: o, onIn
|
|
|
1516
1702
|
r,
|
|
1517
1703
|
i,
|
|
1518
1704
|
o
|
|
1519
|
-
]), /* @__PURE__ */
|
|
1520
|
-
/* @__PURE__ */
|
|
1521
|
-
u && /* @__PURE__ */
|
|
1705
|
+
]), /* @__PURE__ */ M(A, { children: [
|
|
1706
|
+
/* @__PURE__ */ j("p", { children: o ? `Comparing version ${o} → ${i}` : "Changes in the first persisted snapshot" }),
|
|
1707
|
+
u && /* @__PURE__ */ j("p", {
|
|
1522
1708
|
role: "alert",
|
|
1523
1709
|
children: u
|
|
1524
1710
|
}),
|
|
1525
|
-
!u && !c && /* @__PURE__ */
|
|
1711
|
+
!u && !c && /* @__PURE__ */ j("p", {
|
|
1526
1712
|
role: "status",
|
|
1527
1713
|
children: "Loading comparison…"
|
|
1528
1714
|
}),
|
|
1529
|
-
f && /* @__PURE__ */
|
|
1715
|
+
f && /* @__PURE__ */ M(B, {
|
|
1530
1716
|
variant: "ghost",
|
|
1531
1717
|
size: "sm",
|
|
1532
|
-
onClick: () =>
|
|
1718
|
+
onClick: () => _t(f.state, `${n}-${r}-v${i}.json`),
|
|
1533
1719
|
children: ["Download version ", i]
|
|
1534
1720
|
}),
|
|
1535
|
-
c && /* @__PURE__ */
|
|
1721
|
+
c && /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(ht, {
|
|
1536
1722
|
record: c.after,
|
|
1537
1723
|
onInspect: s
|
|
1538
|
-
}), c.html ? /* @__PURE__ */
|
|
1724
|
+
}), c.html ? /* @__PURE__ */ j("div", {
|
|
1539
1725
|
className: "la-state-diff",
|
|
1540
1726
|
"aria-label": "State changes",
|
|
1541
1727
|
dangerouslySetInnerHTML: { __html: c.html }
|
|
1542
|
-
}) : /* @__PURE__ */
|
|
1728
|
+
}) : /* @__PURE__ */ j("p", { children: "No persisted fields changed between these versions." })] })
|
|
1543
1729
|
] });
|
|
1544
1730
|
}
|
|
1545
|
-
function
|
|
1731
|
+
function _t(e, t) {
|
|
1546
1732
|
let n = URL.createObjectURL(new Blob([JSON.stringify(e, null, 2)], { type: "application/json" })), r = document.createElement("a");
|
|
1547
1733
|
r.href = n, r.download = t, r.click(), setTimeout(() => URL.revokeObjectURL(n), 1e3);
|
|
1548
1734
|
}
|
|
1549
|
-
function
|
|
1735
|
+
function vt(e) {
|
|
1550
1736
|
return e === null ? "null" : Array.isArray(e) ? "array" : typeof e;
|
|
1551
1737
|
}
|
|
1552
|
-
function
|
|
1738
|
+
function yt(e, t) {
|
|
1553
1739
|
let n = e?.definitions, r = n?.State?.properties?.[t]?.$ref, i = r && n?.[r.split("/").pop().replace(/~1/g, "/").replace(/~0/g, "~")]?.type;
|
|
1554
1740
|
return i ? `Schema: ${Array.isArray(i) ? i.join(" | ") : i}` : void 0;
|
|
1555
1741
|
}
|
|
1556
|
-
var
|
|
1742
|
+
var bt = {
|
|
1557
1743
|
container: "la-state-json",
|
|
1558
1744
|
basicChildStyle: "la-state-json-child",
|
|
1559
1745
|
label: "la-state-json-label",
|
|
@@ -1572,8 +1758,8 @@ var pt = {
|
|
|
1572
1758
|
};
|
|
1573
1759
|
//#endregion
|
|
1574
1760
|
//#region src/queue-wait-history.ts
|
|
1575
|
-
function
|
|
1576
|
-
let r =
|
|
1761
|
+
function xt(e, t, n) {
|
|
1762
|
+
let r = it(e, {
|
|
1577
1763
|
...t,
|
|
1578
1764
|
actorName: n
|
|
1579
1765
|
}, e.listQueueWaits);
|
|
@@ -1585,26 +1771,26 @@ function mt(e, t, n) {
|
|
|
1585
1771
|
}
|
|
1586
1772
|
//#endregion
|
|
1587
1773
|
//#region src/queue-wait.ts
|
|
1588
|
-
function
|
|
1589
|
-
if (!Array.isArray(e) || !e.every(
|
|
1774
|
+
function St(e) {
|
|
1775
|
+
if (!Array.isArray(e) || !e.every(Ct)) throw Error("Invalid queue wait response");
|
|
1590
1776
|
return e;
|
|
1591
1777
|
}
|
|
1592
|
-
function
|
|
1778
|
+
function Ct(e) {
|
|
1593
1779
|
return !!e && typeof e.actorName == "string" && typeof e.actorId == "string" && Number.isSafeInteger(e.admitted) && e.admitted > 0 && [e.averageMs, e.maxMs].every((e) => typeof e == "number" && Number.isFinite(e) && e >= 0) && e.averageMs <= e.maxMs;
|
|
1594
1780
|
}
|
|
1595
|
-
function
|
|
1596
|
-
return
|
|
1781
|
+
function wt(e) {
|
|
1782
|
+
return Ot(e, () => "all").get("all") ?? null;
|
|
1597
1783
|
}
|
|
1598
|
-
function
|
|
1599
|
-
return
|
|
1784
|
+
function Tt(e) {
|
|
1785
|
+
return Ot(e, (e) => e.actorName);
|
|
1600
1786
|
}
|
|
1601
|
-
function
|
|
1602
|
-
return
|
|
1787
|
+
function Et(e, t) {
|
|
1788
|
+
return Ot(e.filter((e) => e.actorName === t), (e) => e.actorId);
|
|
1603
1789
|
}
|
|
1604
|
-
function
|
|
1790
|
+
function Dt(e) {
|
|
1605
1791
|
return e === void 0 ? "—" : e >= 1e3 ? `${(e / 1e3).toLocaleString(void 0, { maximumFractionDigits: 2 })} s` : `${e.toLocaleString(void 0, { maximumFractionDigits: 1 })} ms`;
|
|
1606
1792
|
}
|
|
1607
|
-
function
|
|
1793
|
+
function Ot(e, t) {
|
|
1608
1794
|
let n = /* @__PURE__ */ new Map();
|
|
1609
1795
|
for (let r of e) {
|
|
1610
1796
|
let e = n.get(t(r)) ?? {
|
|
@@ -1622,140 +1808,149 @@ function bt(e, t) {
|
|
|
1622
1808
|
}
|
|
1623
1809
|
//#endregion
|
|
1624
1810
|
//#region src/ActorObserver.tsx
|
|
1625
|
-
function
|
|
1626
|
-
let { inventory: u, loading: d, failed: f, retry: p } =
|
|
1811
|
+
function kt({ client: e, className: r = "", initialActorName: o, navigation: s, timeRange: c, onTimeRangeChange: l }) {
|
|
1812
|
+
let { inventory: u, loading: d, failed: f, retry: p } = tt(e), [m, h] = a(Fe), _ = c ?? m, v = l ?? h, [y, ee] = a(o), b = s ? s.actorName : y, x = s ? s.onSelectActor : ee, [S, C] = a(), [w, T] = a(""), E = i(null), D = JSON.stringify([b, S]), O = i(JSON.stringify([o, void 0])), k = n(), N = u?.actors.find((e) => e.actorName === b), P = N?.instances.find((e) => e.actorId === S), F = xt(e, Ie(_, Date.now()), b), I = F.rows && Tt(F.rows), ne = F.rows && b !== void 0 ? Et(F.rows, b) : void 0, L = F.supported && F.rows ? wt(F.rows) : void 0;
|
|
1627
1813
|
t(() => {
|
|
1628
|
-
|
|
1814
|
+
ee(o), C(void 0), T("");
|
|
1629
1815
|
}, [e, o]), t(() => {
|
|
1630
|
-
O.current !==
|
|
1631
|
-
}, [
|
|
1632
|
-
let
|
|
1633
|
-
|
|
1816
|
+
O.current !== D && E.current?.focus(), O.current = D;
|
|
1817
|
+
}, [D]);
|
|
1818
|
+
let re = (e) => {
|
|
1819
|
+
C(void 0), x(e);
|
|
1634
1820
|
};
|
|
1635
|
-
return /* @__PURE__ */
|
|
1636
|
-
className: `la-observer ${r}`,
|
|
1821
|
+
return /* @__PURE__ */ M("section", {
|
|
1822
|
+
className: `la-observer ${S === void 0 ? "" : "la-observer-instance-page"} ${r}`,
|
|
1637
1823
|
"aria-label": "Actor observer",
|
|
1638
1824
|
children: [
|
|
1639
|
-
|
|
1825
|
+
b !== void 0 && /* @__PURE__ */ M("nav", {
|
|
1640
1826
|
className: "la-observer-breadcrumb",
|
|
1641
1827
|
"aria-label": "Breadcrumb",
|
|
1642
1828
|
children: [
|
|
1643
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ j(B, {
|
|
1644
1830
|
variant: "link",
|
|
1645
1831
|
type: "button",
|
|
1646
1832
|
"aria-label": "Back to actors",
|
|
1647
|
-
onClick: () =>
|
|
1833
|
+
onClick: () => re(void 0),
|
|
1648
1834
|
children: "Actors"
|
|
1649
1835
|
}),
|
|
1650
|
-
/* @__PURE__ */
|
|
1836
|
+
/* @__PURE__ */ j("span", {
|
|
1651
1837
|
"aria-hidden": "true",
|
|
1652
1838
|
children: "/"
|
|
1653
1839
|
}),
|
|
1654
|
-
/* @__PURE__ */
|
|
1655
|
-
"aria-current":
|
|
1656
|
-
children:
|
|
1840
|
+
S === void 0 ? /* @__PURE__ */ j("span", {
|
|
1841
|
+
"aria-current": "page",
|
|
1842
|
+
children: b
|
|
1843
|
+
}) : /* @__PURE__ */ j(B, {
|
|
1844
|
+
variant: "link",
|
|
1845
|
+
"aria-label": "Back to instances",
|
|
1846
|
+
onClick: () => C(void 0),
|
|
1847
|
+
children: b
|
|
1657
1848
|
}),
|
|
1658
|
-
|
|
1849
|
+
S !== void 0 && /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j("span", {
|
|
1659
1850
|
"aria-hidden": "true",
|
|
1660
1851
|
children: "/"
|
|
1661
|
-
}), /* @__PURE__ */
|
|
1852
|
+
}), /* @__PURE__ */ j("span", {
|
|
1662
1853
|
"aria-current": "page",
|
|
1663
|
-
children:
|
|
1854
|
+
children: S
|
|
1664
1855
|
})] })
|
|
1665
1856
|
]
|
|
1666
1857
|
}),
|
|
1667
|
-
/* @__PURE__ */
|
|
1858
|
+
/* @__PURE__ */ M("div", {
|
|
1668
1859
|
className: "la-observer-toolbar",
|
|
1669
|
-
children: [/* @__PURE__ */
|
|
1860
|
+
children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ M("div", {
|
|
1670
1861
|
className: "la-observer-title",
|
|
1671
|
-
children: /* @__PURE__ */
|
|
1672
|
-
ref:
|
|
1862
|
+
children: [/* @__PURE__ */ j("h1", {
|
|
1863
|
+
ref: E,
|
|
1673
1864
|
tabIndex: -1,
|
|
1674
|
-
children:
|
|
1675
|
-
})
|
|
1676
|
-
|
|
1865
|
+
children: S ?? b ?? "Actors"
|
|
1866
|
+
}), P && /* @__PURE__ */ M(U, {
|
|
1867
|
+
variant: "outline",
|
|
1868
|
+
className: `la-observer-status-${P.status}`,
|
|
1869
|
+
children: [/* @__PURE__ */ j("span", { className: `la-observer-dot la-observer-dot-${P.status}` }), Gt(P.status)]
|
|
1870
|
+
})]
|
|
1871
|
+
}), S === void 0 && /* @__PURE__ */ j("p", { children: b === void 0 ? "Inspect instances, residency, and connections." : "Inspect this actor class’s instances, residency, and connections." })] }), /* @__PURE__ */ M("div", {
|
|
1677
1872
|
className: "la-observer-actions",
|
|
1678
|
-
children: [
|
|
1873
|
+
children: [F.supported && /* @__PURE__ */ j(Be, {
|
|
1679
1874
|
value: _,
|
|
1680
1875
|
onChange: v
|
|
1681
|
-
}), /* @__PURE__ */
|
|
1876
|
+
}), /* @__PURE__ */ M(B, {
|
|
1682
1877
|
variant: "outline",
|
|
1683
1878
|
type: "button",
|
|
1684
1879
|
disabled: d,
|
|
1685
1880
|
onClick: p,
|
|
1686
|
-
children: [/* @__PURE__ */
|
|
1881
|
+
children: [/* @__PURE__ */ j(te, {
|
|
1687
1882
|
"aria-hidden": "true",
|
|
1688
1883
|
className: d ? "la-observer-spin" : void 0
|
|
1689
1884
|
}), d ? "Refreshing…" : f ? "Try again" : "Refresh"]
|
|
1690
1885
|
})]
|
|
1691
1886
|
})]
|
|
1692
1887
|
}),
|
|
1693
|
-
f && /* @__PURE__ */
|
|
1888
|
+
f && /* @__PURE__ */ M("div", {
|
|
1694
1889
|
className: "la-observer-error",
|
|
1695
1890
|
role: "alert",
|
|
1696
|
-
children: [/* @__PURE__ */
|
|
1891
|
+
children: [/* @__PURE__ */ j(g, { "aria-hidden": "true" }), /* @__PURE__ */ j("p", { children: u ? "Could not refresh. These counts may be out of date." : "Could not load actors. Check your connection and access, then try again." })]
|
|
1697
1892
|
}),
|
|
1698
|
-
!u && !f && /* @__PURE__ */
|
|
1699
|
-
u && /* @__PURE__ */
|
|
1893
|
+
!u && !f && /* @__PURE__ */ j(At, {}),
|
|
1894
|
+
u && /* @__PURE__ */ M(A, { children: [b === void 0 ? /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(jt, {
|
|
1700
1895
|
inventory: u,
|
|
1701
|
-
queueWait:
|
|
1896
|
+
queueWait: F.supported ? L ?? null : void 0,
|
|
1702
1897
|
range: _
|
|
1703
|
-
}), u.actors.length ? /* @__PURE__ */
|
|
1898
|
+
}), u.actors.length ? /* @__PURE__ */ j(Mt, {
|
|
1704
1899
|
inventory: u,
|
|
1705
|
-
query:
|
|
1706
|
-
onQueryChange:
|
|
1707
|
-
onSelectActor:
|
|
1900
|
+
query: w,
|
|
1901
|
+
onQueryChange: T,
|
|
1902
|
+
onSelectActor: re,
|
|
1708
1903
|
onSelectInstance: (e, t) => {
|
|
1709
|
-
|
|
1904
|
+
C(t), x(e);
|
|
1710
1905
|
},
|
|
1711
|
-
waits:
|
|
1712
|
-
}) : /* @__PURE__ */
|
|
1906
|
+
waits: F.supported ? I : void 0
|
|
1907
|
+
}) : /* @__PURE__ */ j(Ut, {
|
|
1713
1908
|
title: "No actors yet",
|
|
1714
1909
|
description: "Deploy your actor classes to see them here. Instance counts appear as actors are used."
|
|
1715
|
-
})] }) : N ? /* @__PURE__ */
|
|
1910
|
+
})] }) : N ? /* @__PURE__ */ M(A, { children: [S === void 0 && /* @__PURE__ */ j(jt, {
|
|
1716
1911
|
inventory: { actors: [N] },
|
|
1717
|
-
actorName:
|
|
1718
|
-
queueWait:
|
|
1912
|
+
actorName: b,
|
|
1913
|
+
queueWait: F.supported ? L ?? null : void 0,
|
|
1719
1914
|
range: _
|
|
1720
|
-
}), /* @__PURE__ */
|
|
1915
|
+
}), /* @__PURE__ */ j(Ft, {
|
|
1721
1916
|
client: e,
|
|
1722
|
-
id:
|
|
1723
|
-
actorName:
|
|
1917
|
+
id: k,
|
|
1918
|
+
actorName: b,
|
|
1724
1919
|
instances: N.instances,
|
|
1725
|
-
waits:
|
|
1920
|
+
waits: F.supported ? ne : void 0,
|
|
1726
1921
|
range: _,
|
|
1727
|
-
selectedInstanceId:
|
|
1728
|
-
onSelectInstance:
|
|
1729
|
-
},
|
|
1922
|
+
selectedInstanceId: S,
|
|
1923
|
+
onSelectInstance: C
|
|
1924
|
+
}, b)] }) : /* @__PURE__ */ j(Ut, {
|
|
1730
1925
|
title: "Actor class unavailable",
|
|
1731
1926
|
description: "This actor class is no longer in the latest inventory. Return to Actors to see available classes."
|
|
1732
|
-
}), /* @__PURE__ */
|
|
1927
|
+
}), /* @__PURE__ */ M("div", {
|
|
1733
1928
|
className: "la-observer-footnote",
|
|
1734
|
-
children: [/* @__PURE__ */
|
|
1929
|
+
children: [/* @__PURE__ */ M("span", {
|
|
1735
1930
|
className: "la-observer-refresh-status",
|
|
1736
|
-
children: [/* @__PURE__ */
|
|
1737
|
-
}), /* @__PURE__ */
|
|
1931
|
+
children: [/* @__PURE__ */ j("span", { className: `la-observer-dot ${f ? "la-observer-dot-unknown" : e.watchActors ? "la-observer-dot-live" : ""}` }), f ? "Reconnecting…" : e.watchActors ? "Live updates" : "Auto-refresh every 5s"]
|
|
1932
|
+
}), /* @__PURE__ */ j("span", { children: e.watchActors ? "Changes stream from the control plane." : "Counts follow the latest host heartbeat." })]
|
|
1738
1933
|
})] })
|
|
1739
1934
|
]
|
|
1740
1935
|
});
|
|
1741
1936
|
}
|
|
1742
|
-
function
|
|
1743
|
-
return /* @__PURE__ */
|
|
1937
|
+
function At() {
|
|
1938
|
+
return /* @__PURE__ */ M("div", {
|
|
1744
1939
|
className: "la-observer-skeleton",
|
|
1745
1940
|
role: "status",
|
|
1746
1941
|
"aria-label": "Loading actors",
|
|
1747
1942
|
children: [
|
|
1748
|
-
/* @__PURE__ */
|
|
1943
|
+
/* @__PURE__ */ j("span", {
|
|
1749
1944
|
className: "la:sr-only",
|
|
1750
1945
|
children: "Loading actors…"
|
|
1751
1946
|
}),
|
|
1752
|
-
/* @__PURE__ */
|
|
1753
|
-
/* @__PURE__ */
|
|
1754
|
-
/* @__PURE__ */
|
|
1947
|
+
/* @__PURE__ */ j("div", {}),
|
|
1948
|
+
/* @__PURE__ */ j("div", {}),
|
|
1949
|
+
/* @__PURE__ */ j("div", {})
|
|
1755
1950
|
]
|
|
1756
1951
|
});
|
|
1757
1952
|
}
|
|
1758
|
-
function
|
|
1953
|
+
function jt({ inventory: e, actorName: t, queueWait: n, range: r }) {
|
|
1759
1954
|
let i = e.actors.reduce((e, t) => ({
|
|
1760
1955
|
live: e.live + t.live,
|
|
1761
1956
|
dormant: e.dormant + t.dormant,
|
|
@@ -1765,61 +1960,61 @@ function Ct({ inventory: e, actorName: t, queueWait: n, range: r }) {
|
|
|
1765
1960
|
dormant: 0,
|
|
1766
1961
|
unknown: 0
|
|
1767
1962
|
});
|
|
1768
|
-
return /* @__PURE__ */
|
|
1963
|
+
return /* @__PURE__ */ M("dl", {
|
|
1769
1964
|
className: "la-observer-summary",
|
|
1770
1965
|
children: [
|
|
1771
|
-
/* @__PURE__ */
|
|
1772
|
-
/* @__PURE__ */
|
|
1773
|
-
/* @__PURE__ */
|
|
1966
|
+
/* @__PURE__ */ M("div", { children: [
|
|
1967
|
+
/* @__PURE__ */ j("dt", { children: "Total instances" }),
|
|
1968
|
+
/* @__PURE__ */ j("dd", {
|
|
1774
1969
|
"aria-label": "Total instances",
|
|
1775
1970
|
children: (i.live + i.dormant + i.unknown).toLocaleString()
|
|
1776
1971
|
}),
|
|
1777
|
-
/* @__PURE__ */
|
|
1972
|
+
/* @__PURE__ */ j("p", { children: t === void 0 ? `${e.actors.length} actor ${e.actors.length === 1 ? "type" : "types"}` : "In this actor class" })
|
|
1778
1973
|
] }),
|
|
1779
|
-
/* @__PURE__ */
|
|
1780
|
-
/* @__PURE__ */
|
|
1781
|
-
/* @__PURE__ */
|
|
1974
|
+
/* @__PURE__ */ M("div", { children: [
|
|
1975
|
+
/* @__PURE__ */ M("dt", { children: [/* @__PURE__ */ j("span", { className: "la-observer-dot la-observer-dot-live" }), "Live"] }),
|
|
1976
|
+
/* @__PURE__ */ j("dd", {
|
|
1782
1977
|
"aria-label": "Live instances",
|
|
1783
1978
|
children: i.live.toLocaleString()
|
|
1784
1979
|
}),
|
|
1785
|
-
/* @__PURE__ */
|
|
1980
|
+
/* @__PURE__ */ j("p", { children: "Loaded in memory" })
|
|
1786
1981
|
] }),
|
|
1787
|
-
/* @__PURE__ */
|
|
1788
|
-
/* @__PURE__ */
|
|
1789
|
-
/* @__PURE__ */
|
|
1982
|
+
/* @__PURE__ */ M("div", { children: [
|
|
1983
|
+
/* @__PURE__ */ M("dt", { children: [/* @__PURE__ */ j("span", { className: "la-observer-dot" }), "Dormant"] }),
|
|
1984
|
+
/* @__PURE__ */ j("dd", {
|
|
1790
1985
|
"aria-label": "Dormant instances",
|
|
1791
1986
|
children: i.dormant.toLocaleString()
|
|
1792
1987
|
}),
|
|
1793
|
-
/* @__PURE__ */
|
|
1988
|
+
/* @__PURE__ */ j("p", { children: "Currently unloaded" })
|
|
1794
1989
|
] }),
|
|
1795
|
-
i.unknown > 0 && /* @__PURE__ */
|
|
1796
|
-
/* @__PURE__ */
|
|
1797
|
-
/* @__PURE__ */
|
|
1990
|
+
i.unknown > 0 && /* @__PURE__ */ M("div", { children: [
|
|
1991
|
+
/* @__PURE__ */ M("dt", { children: [/* @__PURE__ */ j("span", { className: "la-observer-dot la-observer-dot-unknown" }), "Unknown"] }),
|
|
1992
|
+
/* @__PURE__ */ j("dd", {
|
|
1798
1993
|
"aria-label": "Unknown instances",
|
|
1799
1994
|
children: i.unknown.toLocaleString()
|
|
1800
1995
|
}),
|
|
1801
|
-
/* @__PURE__ */
|
|
1996
|
+
/* @__PURE__ */ j("p", { children: "Awaiting host report" })
|
|
1802
1997
|
] }),
|
|
1803
|
-
n !== void 0 && /* @__PURE__ */
|
|
1998
|
+
n !== void 0 && /* @__PURE__ */ M("div", {
|
|
1804
1999
|
className: "la-observer-queue-wait",
|
|
1805
2000
|
children: [
|
|
1806
|
-
/* @__PURE__ */
|
|
1807
|
-
/* @__PURE__ */
|
|
2001
|
+
/* @__PURE__ */ j("dt", { children: "Avg queue wait" }),
|
|
2002
|
+
/* @__PURE__ */ j("dd", {
|
|
1808
2003
|
"aria-label": "Average queue wait",
|
|
1809
|
-
children:
|
|
2004
|
+
children: Dt(n?.averageMs)
|
|
1810
2005
|
}),
|
|
1811
|
-
/* @__PURE__ */
|
|
2006
|
+
/* @__PURE__ */ j("p", { children: n ? `Max ${Dt(n.maxMs)} · ${n.admitted.toLocaleString()} admitted ${H(r)}` : `No admitted requests ${H(r)}` })
|
|
1812
2007
|
]
|
|
1813
2008
|
})
|
|
1814
2009
|
]
|
|
1815
2010
|
});
|
|
1816
2011
|
}
|
|
1817
|
-
function
|
|
1818
|
-
let o = e.actors.some((e) => e.unknown > 0), s = e.actors.filter((e) =>
|
|
1819
|
-
return /* @__PURE__ */
|
|
1820
|
-
/* @__PURE__ */
|
|
2012
|
+
function Mt({ inventory: e, query: t, onQueryChange: n, onSelectActor: r, onSelectInstance: i, waits: a }) {
|
|
2013
|
+
let o = e.actors.some((e) => e.unknown > 0), s = e.actors.filter((e) => Pt(e, t)).sort((e, t) => Number(t.live > 0) - Number(e.live > 0)), l = Nt(e);
|
|
2014
|
+
return /* @__PURE__ */ M(A, { children: [
|
|
2015
|
+
/* @__PURE__ */ M("div", {
|
|
1821
2016
|
className: "la-observer-list-toolbar",
|
|
1822
|
-
children: [/* @__PURE__ */
|
|
2017
|
+
children: [/* @__PURE__ */ M("h2", { children: ["Actor names ", /* @__PURE__ */ j(U, { children: e.actors.length })] }), /* @__PURE__ */ j(ge, {
|
|
1823
2018
|
label: "Search actors and instances",
|
|
1824
2019
|
placeholder: "Search actor name or instance ID…",
|
|
1825
2020
|
value: t,
|
|
@@ -1833,80 +2028,80 @@ function wt({ inventory: e, query: t, onQueryChange: n, onSelectActor: r, onSele
|
|
|
1833
2028
|
className: "la-observer-lookup"
|
|
1834
2029
|
})]
|
|
1835
2030
|
}),
|
|
1836
|
-
/* @__PURE__ */
|
|
2031
|
+
/* @__PURE__ */ j("div", {
|
|
1837
2032
|
className: "la-observer-table-frame",
|
|
1838
|
-
children: s.length ? /* @__PURE__ */
|
|
2033
|
+
children: s.length ? /* @__PURE__ */ M(G, {
|
|
1839
2034
|
"aria-label": "Actor instance counts",
|
|
1840
2035
|
className: "la-observer-table",
|
|
1841
|
-
children: [/* @__PURE__ */
|
|
1842
|
-
/* @__PURE__ */
|
|
2036
|
+
children: [/* @__PURE__ */ j(K, { children: /* @__PURE__ */ M(J, { children: [
|
|
2037
|
+
/* @__PURE__ */ j(Y, {
|
|
1843
2038
|
scope: "col",
|
|
1844
2039
|
children: "Actor"
|
|
1845
2040
|
}),
|
|
1846
|
-
/* @__PURE__ */
|
|
2041
|
+
/* @__PURE__ */ j(Y, {
|
|
1847
2042
|
scope: "col",
|
|
1848
2043
|
children: "Live"
|
|
1849
2044
|
}),
|
|
1850
|
-
/* @__PURE__ */
|
|
2045
|
+
/* @__PURE__ */ j(Y, {
|
|
1851
2046
|
scope: "col",
|
|
1852
2047
|
children: "Dormant"
|
|
1853
2048
|
}),
|
|
1854
|
-
o && /* @__PURE__ */
|
|
2049
|
+
o && /* @__PURE__ */ j(Y, {
|
|
1855
2050
|
scope: "col",
|
|
1856
2051
|
children: "Unknown"
|
|
1857
2052
|
}),
|
|
1858
|
-
/* @__PURE__ */
|
|
2053
|
+
/* @__PURE__ */ j(Y, {
|
|
1859
2054
|
scope: "col",
|
|
1860
2055
|
children: "Total"
|
|
1861
2056
|
}),
|
|
1862
|
-
a && /* @__PURE__ */
|
|
2057
|
+
a && /* @__PURE__ */ j(Y, {
|
|
1863
2058
|
scope: "col",
|
|
1864
2059
|
className: "la-observer-wait-cell",
|
|
1865
2060
|
children: "Avg queue wait"
|
|
1866
2061
|
})
|
|
1867
|
-
] }) }), /* @__PURE__ */
|
|
2062
|
+
] }) }), /* @__PURE__ */ j(q, { children: s.map((e) => /* @__PURE__ */ M(J, {
|
|
1868
2063
|
className: "la-clickable-row",
|
|
1869
2064
|
onClick: () => r(e.actorName),
|
|
1870
2065
|
children: [
|
|
1871
|
-
/* @__PURE__ */
|
|
2066
|
+
/* @__PURE__ */ j(X, {
|
|
1872
2067
|
className: "la-observer-name",
|
|
1873
|
-
children: /* @__PURE__ */
|
|
2068
|
+
children: /* @__PURE__ */ M(B, {
|
|
1874
2069
|
variant: "ghost",
|
|
1875
2070
|
type: "button",
|
|
1876
2071
|
className: "la-observer-actor-button la-observer-class-button",
|
|
1877
|
-
children: [/* @__PURE__ */
|
|
2072
|
+
children: [/* @__PURE__ */ j(c, {
|
|
1878
2073
|
className: "la-observer-type-icon",
|
|
1879
2074
|
"aria-hidden": "true"
|
|
1880
|
-
}), /* @__PURE__ */
|
|
2075
|
+
}), /* @__PURE__ */ j("span", { children: e.actorName })]
|
|
1881
2076
|
})
|
|
1882
2077
|
}),
|
|
1883
|
-
/* @__PURE__ */
|
|
2078
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ j("span", {
|
|
1884
2079
|
className: e.live > 0 ? "la-observer-live" : void 0,
|
|
1885
2080
|
children: e.live.toLocaleString()
|
|
1886
2081
|
}) }),
|
|
1887
|
-
/* @__PURE__ */
|
|
1888
|
-
o && /* @__PURE__ */
|
|
1889
|
-
/* @__PURE__ */
|
|
1890
|
-
a && /* @__PURE__ */
|
|
2082
|
+
/* @__PURE__ */ j(X, { children: e.dormant.toLocaleString() }),
|
|
2083
|
+
o && /* @__PURE__ */ j(X, { children: e.unknown.toLocaleString() }),
|
|
2084
|
+
/* @__PURE__ */ j(X, { children: (e.live + e.dormant + e.unknown).toLocaleString() }),
|
|
2085
|
+
a && /* @__PURE__ */ j(X, {
|
|
1891
2086
|
className: "la-observer-wait-cell",
|
|
1892
|
-
children: /* @__PURE__ */
|
|
2087
|
+
children: /* @__PURE__ */ j(Lt, { stats: a.get(e.actorName) })
|
|
1893
2088
|
})
|
|
1894
2089
|
]
|
|
1895
2090
|
}, e.actorName)) })]
|
|
1896
|
-
}) : /* @__PURE__ */
|
|
2091
|
+
}) : /* @__PURE__ */ j(Ut, {
|
|
1897
2092
|
title: "No matching actors",
|
|
1898
2093
|
description: "Try a different actor name.",
|
|
1899
2094
|
action: "Clear search",
|
|
1900
2095
|
onReset: () => n("")
|
|
1901
2096
|
})
|
|
1902
2097
|
}),
|
|
1903
|
-
o && /* @__PURE__ */
|
|
2098
|
+
o && /* @__PURE__ */ M("p", {
|
|
1904
2099
|
className: "la-observer-unknown",
|
|
1905
|
-
children: [/* @__PURE__ */
|
|
2100
|
+
children: [/* @__PURE__ */ j(g, { "aria-hidden": "true" }), "Some hosts have not reported which instances are loaded. Their counts are shown as unknown."]
|
|
1906
2101
|
})
|
|
1907
2102
|
] });
|
|
1908
2103
|
}
|
|
1909
|
-
function
|
|
2104
|
+
function Nt(e) {
|
|
1910
2105
|
return e.actors.flatMap((e) => [{
|
|
1911
2106
|
id: JSON.stringify({ actorName: e.actorName }),
|
|
1912
2107
|
group: "Actor classes",
|
|
@@ -1920,350 +2115,356 @@ function Tt(e) {
|
|
|
1920
2115
|
group: "Instances",
|
|
1921
2116
|
value: t.actorId,
|
|
1922
2117
|
keywords: [e.actorName],
|
|
1923
|
-
hint: `${e.actorName} · ${
|
|
2118
|
+
hint: `${e.actorName} · ${Gt(t.status)} · ${t.connections.length.toLocaleString()} ${t.connections.length === 1 ? "connection" : "connections"}`
|
|
1924
2119
|
}))]);
|
|
1925
2120
|
}
|
|
1926
|
-
function
|
|
2121
|
+
function Pt(e, t) {
|
|
1927
2122
|
let n = t.trim().toLocaleLowerCase().split(/\s+/u).filter(Boolean), r = [e.actorName, ...e.instances.map((e) => e.actorId)].join(" ").toLocaleLowerCase();
|
|
1928
2123
|
return n.every((e) => r.includes(e));
|
|
1929
2124
|
}
|
|
1930
|
-
function
|
|
1931
|
-
let [
|
|
1932
|
-
|
|
1933
|
-
let
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
return t(() => {
|
|
1937
|
-
b.current?.focus();
|
|
1938
|
-
}, [l]), l === void 0 ? /* @__PURE__ */ j("section", {
|
|
1939
|
-
id: n,
|
|
2125
|
+
function Ft({ client: e, id: t, actorName: n, instances: r, waits: i, range: o, selectedInstanceId: s, onSelectInstance: c }) {
|
|
2126
|
+
let [l, u] = a(""), [d, f] = a("all"), p = r.filter((e) => Wt(e.actorId, l) && (d === "all" || e.status === d));
|
|
2127
|
+
p.sort((e, t) => Number(t.status === "live") - Number(e.status === "live"));
|
|
2128
|
+
let m = r.find((e) => e.actorId === s);
|
|
2129
|
+
return s === void 0 ? /* @__PURE__ */ M("section", {
|
|
2130
|
+
id: t,
|
|
1940
2131
|
className: "la-observer-instances",
|
|
1941
|
-
"aria-labelledby": `${
|
|
1942
|
-
children: [/* @__PURE__ */
|
|
2132
|
+
"aria-labelledby": `${t}-heading`,
|
|
2133
|
+
children: [/* @__PURE__ */ j("div", {
|
|
1943
2134
|
className: "la-observer-instances-heading",
|
|
1944
|
-
children: /* @__PURE__ */
|
|
1945
|
-
|
|
1946
|
-
tabIndex: -1,
|
|
1947
|
-
id: `${n}-heading`,
|
|
2135
|
+
children: /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ M("h2", {
|
|
2136
|
+
id: `${t}-heading`,
|
|
1948
2137
|
children: [
|
|
1949
|
-
|
|
2138
|
+
n,
|
|
1950
2139
|
" instances ",
|
|
1951
|
-
/* @__PURE__ */
|
|
2140
|
+
/* @__PURE__ */ j(U, {
|
|
1952
2141
|
"aria-hidden": "true",
|
|
1953
|
-
children:
|
|
2142
|
+
children: r.length.toLocaleString()
|
|
1954
2143
|
})
|
|
1955
2144
|
]
|
|
1956
|
-
}), /* @__PURE__ */
|
|
1957
|
-
}),
|
|
1958
|
-
/* @__PURE__ */
|
|
2145
|
+
}), /* @__PURE__ */ j("p", { children: "Select an instance to inspect its persisted state, requests, and WebSocket connections." })] })
|
|
2146
|
+
}), r.length ? /* @__PURE__ */ M(A, { children: [
|
|
2147
|
+
/* @__PURE__ */ M("div", {
|
|
1959
2148
|
className: "la-observer-filters",
|
|
1960
|
-
children: [/* @__PURE__ */
|
|
2149
|
+
children: [/* @__PURE__ */ j(Ht, {
|
|
1961
2150
|
label: "Search instances",
|
|
1962
2151
|
placeholder: "Search instance IDs…",
|
|
1963
|
-
value:
|
|
1964
|
-
onChange:
|
|
1965
|
-
}), /* @__PURE__ */
|
|
2152
|
+
value: l,
|
|
2153
|
+
onChange: u
|
|
2154
|
+
}), /* @__PURE__ */ M(Je, {
|
|
1966
2155
|
className: "la-observer-select",
|
|
1967
2156
|
"aria-label": "Instance state",
|
|
1968
|
-
value:
|
|
1969
|
-
onChange: (e) =>
|
|
2157
|
+
value: d,
|
|
2158
|
+
onChange: (e) => f(e.target.value),
|
|
1970
2159
|
children: [
|
|
1971
|
-
/* @__PURE__ */
|
|
2160
|
+
/* @__PURE__ */ j(W, {
|
|
1972
2161
|
value: "all",
|
|
1973
2162
|
children: "All states"
|
|
1974
2163
|
}),
|
|
1975
|
-
/* @__PURE__ */
|
|
2164
|
+
/* @__PURE__ */ j(W, {
|
|
1976
2165
|
value: "live",
|
|
1977
2166
|
children: "Live"
|
|
1978
2167
|
}),
|
|
1979
|
-
/* @__PURE__ */
|
|
2168
|
+
/* @__PURE__ */ j(W, {
|
|
1980
2169
|
value: "dormant",
|
|
1981
2170
|
children: "Dormant"
|
|
1982
2171
|
}),
|
|
1983
|
-
/* @__PURE__ */
|
|
2172
|
+
/* @__PURE__ */ j(W, {
|
|
1984
2173
|
value: "unknown",
|
|
1985
2174
|
children: "Unknown"
|
|
1986
2175
|
})
|
|
1987
2176
|
]
|
|
1988
2177
|
})]
|
|
1989
2178
|
}),
|
|
1990
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ j("div", {
|
|
1991
2180
|
className: "la-observer-table-frame",
|
|
1992
|
-
children:
|
|
1993
|
-
"aria-label": `${
|
|
2181
|
+
children: p.length ? /* @__PURE__ */ M(G, {
|
|
2182
|
+
"aria-label": `${n} instances`,
|
|
1994
2183
|
className: "la-observer-instance-table",
|
|
1995
|
-
children: [/* @__PURE__ */
|
|
1996
|
-
/* @__PURE__ */
|
|
2184
|
+
children: [/* @__PURE__ */ j(K, { children: /* @__PURE__ */ M(J, { children: [
|
|
2185
|
+
/* @__PURE__ */ j(Y, {
|
|
1997
2186
|
scope: "col",
|
|
1998
2187
|
children: "Instance"
|
|
1999
2188
|
}),
|
|
2000
|
-
/* @__PURE__ */
|
|
2189
|
+
/* @__PURE__ */ j(Y, {
|
|
2001
2190
|
scope: "col",
|
|
2002
2191
|
children: "State"
|
|
2003
2192
|
}),
|
|
2004
|
-
/* @__PURE__ */
|
|
2193
|
+
/* @__PURE__ */ j(Y, {
|
|
2005
2194
|
scope: "col",
|
|
2006
2195
|
children: "Connections"
|
|
2007
2196
|
}),
|
|
2008
|
-
|
|
2197
|
+
i && /* @__PURE__ */ j(Y, {
|
|
2009
2198
|
scope: "col",
|
|
2010
2199
|
className: "la-observer-wait-cell",
|
|
2011
2200
|
children: "Avg queue wait"
|
|
2012
2201
|
}),
|
|
2013
|
-
/* @__PURE__ */
|
|
2202
|
+
/* @__PURE__ */ j(Y, {
|
|
2014
2203
|
scope: "col",
|
|
2015
2204
|
className: "la-observer-waiting-cell",
|
|
2016
2205
|
children: "Waiting"
|
|
2017
2206
|
})
|
|
2018
|
-
] }) }), /* @__PURE__ */
|
|
2207
|
+
] }) }), /* @__PURE__ */ j(q, { children: p.map((e) => /* @__PURE__ */ M(J, {
|
|
2019
2208
|
className: "la-clickable-row",
|
|
2020
|
-
onClick: () =>
|
|
2209
|
+
onClick: () => c(e.actorId),
|
|
2021
2210
|
children: [
|
|
2022
|
-
/* @__PURE__ */
|
|
2211
|
+
/* @__PURE__ */ j(X, {
|
|
2023
2212
|
className: "la-observer-instance-id",
|
|
2024
|
-
children: /* @__PURE__ */
|
|
2213
|
+
children: /* @__PURE__ */ j(B, {
|
|
2025
2214
|
variant: "ghost",
|
|
2026
2215
|
type: "button",
|
|
2027
2216
|
className: "la-observer-actor-button",
|
|
2028
|
-
children: /* @__PURE__ */
|
|
2217
|
+
children: /* @__PURE__ */ j("span", { children: e.actorId })
|
|
2029
2218
|
})
|
|
2030
2219
|
}),
|
|
2031
|
-
/* @__PURE__ */
|
|
2220
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ M(U, {
|
|
2032
2221
|
variant: "outline",
|
|
2033
2222
|
className: `la-observer-status-${e.status}`,
|
|
2034
|
-
children: [/* @__PURE__ */
|
|
2223
|
+
children: [/* @__PURE__ */ j("span", { className: `la-observer-dot la-observer-dot-${e.status}` }), Gt(e.status)]
|
|
2035
2224
|
}) }),
|
|
2036
|
-
/* @__PURE__ */
|
|
2037
|
-
|
|
2225
|
+
/* @__PURE__ */ j(X, { children: e.connections.length.toLocaleString() }),
|
|
2226
|
+
i && /* @__PURE__ */ j(X, {
|
|
2038
2227
|
className: "la-observer-wait-cell",
|
|
2039
|
-
children: /* @__PURE__ */
|
|
2228
|
+
children: /* @__PURE__ */ j(Lt, { stats: i.get(e.actorId) })
|
|
2040
2229
|
}),
|
|
2041
|
-
/* @__PURE__ */
|
|
2230
|
+
/* @__PURE__ */ j(X, {
|
|
2042
2231
|
className: "la-observer-waiting-cell",
|
|
2043
|
-
children: /* @__PURE__ */
|
|
2232
|
+
children: /* @__PURE__ */ j(Bt, {
|
|
2044
2233
|
waiting: e.waiting,
|
|
2045
2234
|
compact: !0
|
|
2046
2235
|
})
|
|
2047
2236
|
})
|
|
2048
2237
|
]
|
|
2049
2238
|
}, e.actorId)) })]
|
|
2050
|
-
}) : /* @__PURE__ */
|
|
2239
|
+
}) : /* @__PURE__ */ j(Ut, {
|
|
2051
2240
|
title: "No matching instances",
|
|
2052
2241
|
description: "Try another instance ID or state.",
|
|
2053
2242
|
action: "Clear filters",
|
|
2054
2243
|
onReset: () => {
|
|
2055
|
-
|
|
2244
|
+
u(""), f("all");
|
|
2056
2245
|
}
|
|
2057
2246
|
})
|
|
2058
2247
|
}),
|
|
2059
|
-
/* @__PURE__ */
|
|
2248
|
+
/* @__PURE__ */ j("p", {
|
|
2060
2249
|
className: "la-observer-connection-note",
|
|
2061
2250
|
children: "Connections are active WebSocket connections, not unique people."
|
|
2062
2251
|
})
|
|
2063
|
-
] }) : /* @__PURE__ */
|
|
2252
|
+
] }) : /* @__PURE__ */ M("p", {
|
|
2064
2253
|
className: "la-observer-instance-empty",
|
|
2065
2254
|
role: "status",
|
|
2066
2255
|
children: [
|
|
2067
2256
|
"No ",
|
|
2068
|
-
|
|
2257
|
+
n,
|
|
2069
2258
|
" instances have been created yet."
|
|
2070
2259
|
]
|
|
2071
2260
|
})]
|
|
2072
|
-
}) : /* @__PURE__ */ j(
|
|
2261
|
+
}) : /* @__PURE__ */ j(It, {
|
|
2262
|
+
client: e,
|
|
2263
|
+
id: t,
|
|
2264
|
+
actorName: n,
|
|
2265
|
+
actorId: s,
|
|
2266
|
+
instance: m,
|
|
2267
|
+
waits: i,
|
|
2268
|
+
range: o
|
|
2269
|
+
}, s);
|
|
2270
|
+
}
|
|
2271
|
+
function It({ client: e, id: t, actorName: n, actorId: r, instance: o, waits: s, range: c }) {
|
|
2272
|
+
let [l, u] = a("requests"), [d, f] = a(), p = i(null), m = !!e.getState && !!e.listStateHistory;
|
|
2273
|
+
return /* @__PURE__ */ M("section", {
|
|
2073
2274
|
className: "la-observer-instance-detail",
|
|
2074
|
-
"aria-label": `${
|
|
2275
|
+
"aria-label": `${n} / ${r}`,
|
|
2075
2276
|
children: [
|
|
2076
|
-
/* @__PURE__ */
|
|
2077
|
-
variant: "link",
|
|
2078
|
-
"aria-label": "Back to instances",
|
|
2079
|
-
onClick: () => u(void 0),
|
|
2080
|
-
children: "Back to instances"
|
|
2081
|
-
}),
|
|
2082
|
-
/* @__PURE__ */ j("div", {
|
|
2083
|
-
className: "la-observer-instance-heading",
|
|
2084
|
-
children: [/* @__PURE__ */ A("h2", {
|
|
2085
|
-
ref: b,
|
|
2086
|
-
tabIndex: -1,
|
|
2087
|
-
children: l
|
|
2088
|
-
}), y && /* @__PURE__ */ A(H, {
|
|
2089
|
-
variant: "outline",
|
|
2090
|
-
className: `la-observer-status-${y.status}`,
|
|
2091
|
-
children: It(y.status)
|
|
2092
|
-
})]
|
|
2093
|
-
}),
|
|
2094
|
-
!y && /* @__PURE__ */ A("p", {
|
|
2277
|
+
!o && /* @__PURE__ */ j("p", {
|
|
2095
2278
|
role: "status",
|
|
2096
2279
|
children: "This instance is no longer in the current inventory. Its retained requests are still available below."
|
|
2097
2280
|
}),
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2281
|
+
/* @__PURE__ */ M("div", {
|
|
2282
|
+
className: "la-observer-instance-metrics",
|
|
2283
|
+
children: [s && /* @__PURE__ */ j(Rt, {
|
|
2284
|
+
stats: s.get(r),
|
|
2285
|
+
range: c
|
|
2286
|
+
}), o && /* @__PURE__ */ j(zt, { waiting: o.waiting })]
|
|
2101
2287
|
}),
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2288
|
+
/* @__PURE__ */ M("div", {
|
|
2289
|
+
className: "la-observer-instance-views",
|
|
2290
|
+
role: "group",
|
|
2291
|
+
"aria-label": "Instance view",
|
|
2292
|
+
children: [
|
|
2293
|
+
/* @__PURE__ */ j(B, {
|
|
2294
|
+
ref: p,
|
|
2295
|
+
variant: "ghost",
|
|
2296
|
+
"aria-pressed": l === "requests",
|
|
2297
|
+
onClick: () => u("requests"),
|
|
2298
|
+
children: "Requests"
|
|
2299
|
+
}),
|
|
2300
|
+
m && /* @__PURE__ */ j(B, {
|
|
2301
|
+
variant: "ghost",
|
|
2302
|
+
"aria-pressed": l === "state",
|
|
2303
|
+
onClick: () => u("state"),
|
|
2304
|
+
children: "State"
|
|
2305
|
+
}),
|
|
2306
|
+
o && /* @__PURE__ */ M(B, {
|
|
2307
|
+
variant: "ghost",
|
|
2308
|
+
"aria-pressed": l === "websockets",
|
|
2309
|
+
onClick: () => u("websockets"),
|
|
2310
|
+
children: ["WebSockets ", /* @__PURE__ */ j(U, { children: o.connections.length })]
|
|
2311
|
+
})
|
|
2312
|
+
]
|
|
2313
|
+
}),
|
|
2314
|
+
/* @__PURE__ */ j("div", {
|
|
2315
|
+
hidden: l !== "requests",
|
|
2316
|
+
children: e.watchRequests || e.listRequests ? /* @__PURE__ */ j(ot, {
|
|
2317
|
+
client: e,
|
|
2318
|
+
actor: {
|
|
2319
|
+
actorName: n,
|
|
2320
|
+
actorId: r
|
|
2321
|
+
},
|
|
2322
|
+
timeRange: c,
|
|
2323
|
+
focus: d
|
|
2324
|
+
}) : /* @__PURE__ */ M("section", { children: [/* @__PURE__ */ j("h3", { children: "Requests" }), /* @__PURE__ */ j("p", { children: "Request timings are unavailable for this connection." })] })
|
|
2325
|
+
}),
|
|
2326
|
+
/* @__PURE__ */ j("div", {
|
|
2327
|
+
hidden: l !== "state",
|
|
2328
|
+
children: m && /* @__PURE__ */ j(ft, {
|
|
2329
|
+
client: e,
|
|
2330
|
+
actorName: n,
|
|
2331
|
+
actorId: r,
|
|
2332
|
+
onInspectRequest: (e) => {
|
|
2333
|
+
f(e), u("requests"), p.current?.focus();
|
|
2334
|
+
}
|
|
2335
|
+
})
|
|
2336
|
+
}),
|
|
2337
|
+
/* @__PURE__ */ j("div", {
|
|
2338
|
+
hidden: l !== "websockets",
|
|
2339
|
+
children: o && /* @__PURE__ */ j(Vt, {
|
|
2340
|
+
id: `${t}-connections`,
|
|
2341
|
+
actorId: r,
|
|
2342
|
+
connections: o.connections
|
|
2343
|
+
})
|
|
2128
2344
|
})
|
|
2129
2345
|
]
|
|
2130
2346
|
});
|
|
2131
2347
|
}
|
|
2132
|
-
function
|
|
2133
|
-
return e ? /* @__PURE__ */
|
|
2348
|
+
function Lt({ stats: e }) {
|
|
2349
|
+
return e ? /* @__PURE__ */ M("span", {
|
|
2134
2350
|
className: "la-observer-wait",
|
|
2135
|
-
title: `Average of ${e.admitted.toLocaleString()} admitted requests in the selected time range; longest wait ${
|
|
2136
|
-
children: [
|
|
2137
|
-
}) : /* @__PURE__ */
|
|
2351
|
+
title: `Average of ${e.admitted.toLocaleString()} admitted requests in the selected time range; longest wait ${Dt(e.maxMs)}`,
|
|
2352
|
+
children: [Dt(e.averageMs), /* @__PURE__ */ M("small", { children: ["max ", Dt(e.maxMs)] })]
|
|
2353
|
+
}) : /* @__PURE__ */ j("span", {
|
|
2138
2354
|
title: "No admitted requests in the selected time range",
|
|
2139
2355
|
children: "—"
|
|
2140
2356
|
});
|
|
2141
2357
|
}
|
|
2142
|
-
function
|
|
2358
|
+
function Rt({ stats: e, range: t }) {
|
|
2143
2359
|
return /* @__PURE__ */ j("section", {
|
|
2144
2360
|
className: "la-observer-queue-wait-detail",
|
|
2145
2361
|
"aria-label": "Queue wait",
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
/* @__PURE__ */
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
}),
|
|
2166
|
-
/* @__PURE__ */ A("p", { children: "Single request" })
|
|
2167
|
-
] }),
|
|
2168
|
-
/* @__PURE__ */ j("div", { children: [
|
|
2169
|
-
/* @__PURE__ */ A("dt", { children: "Admitted" }),
|
|
2170
|
-
/* @__PURE__ */ A("dd", {
|
|
2171
|
-
"aria-label": "Admitted requests",
|
|
2172
|
-
children: e.admitted.toLocaleString()
|
|
2173
|
-
}),
|
|
2174
|
-
/* @__PURE__ */ A("p", { children: "Requests that entered the actor" })
|
|
2175
|
-
] })
|
|
2176
|
-
]
|
|
2177
|
-
})
|
|
2178
|
-
]
|
|
2362
|
+
title: `Time waiting to enter this actor ${H(t)}`,
|
|
2363
|
+
children: e ? /* @__PURE__ */ M("dl", { children: [
|
|
2364
|
+
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("dt", { children: "Avg queue wait" }), /* @__PURE__ */ j("dd", {
|
|
2365
|
+
"aria-label": "Average queue wait",
|
|
2366
|
+
children: Dt(e.averageMs)
|
|
2367
|
+
})] }),
|
|
2368
|
+
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("dt", { children: "Max" }), /* @__PURE__ */ j("dd", {
|
|
2369
|
+
"aria-label": "Longest queue wait",
|
|
2370
|
+
children: Dt(e.maxMs)
|
|
2371
|
+
})] }),
|
|
2372
|
+
/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("dt", { children: "Admitted" }), /* @__PURE__ */ j("dd", {
|
|
2373
|
+
"aria-label": "Admitted requests",
|
|
2374
|
+
children: e.admitted.toLocaleString()
|
|
2375
|
+
})] })
|
|
2376
|
+
] }) : /* @__PURE__ */ M("p", { children: [
|
|
2377
|
+
"No requests admitted ",
|
|
2378
|
+
H(t),
|
|
2379
|
+
"."
|
|
2380
|
+
] })
|
|
2179
2381
|
});
|
|
2180
2382
|
}
|
|
2181
|
-
function
|
|
2383
|
+
function zt({ waiting: e }) {
|
|
2182
2384
|
return /* @__PURE__ */ j("section", {
|
|
2183
2385
|
className: "la-observer-waiting",
|
|
2184
2386
|
"aria-label": "Waiting requests",
|
|
2185
|
-
children: [
|
|
2186
|
-
|
|
2187
|
-
/* @__PURE__ */
|
|
2188
|
-
|
|
2189
|
-
]
|
|
2387
|
+
children: e?.length ? /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ M("span", {
|
|
2388
|
+
className: "la-observer-waiting-label",
|
|
2389
|
+
children: ["Waiting ", /* @__PURE__ */ j("strong", { children: e.length })]
|
|
2390
|
+
}), /* @__PURE__ */ j(Bt, { waiting: e })] }) : /* @__PURE__ */ j("p", { children: e == null ? "Queue reporting unavailable" : "No requests waiting." })
|
|
2190
2391
|
});
|
|
2191
2392
|
}
|
|
2192
|
-
function
|
|
2193
|
-
if (e == null) return /* @__PURE__ */
|
|
2393
|
+
function Bt({ waiting: e, compact: t = !1 }) {
|
|
2394
|
+
if (e == null) return /* @__PURE__ */ j("span", {
|
|
2194
2395
|
title: "Queue reporting is unavailable",
|
|
2195
2396
|
children: "Unavailable"
|
|
2196
2397
|
});
|
|
2197
|
-
if (!e.length) return /* @__PURE__ */
|
|
2398
|
+
if (!e.length) return /* @__PURE__ */ j("span", {
|
|
2198
2399
|
className: "la-observer-queue-empty",
|
|
2199
2400
|
children: "None"
|
|
2200
2401
|
});
|
|
2201
2402
|
let n = t ? e.slice(0, 3) : e;
|
|
2202
|
-
return /* @__PURE__ */
|
|
2403
|
+
return /* @__PURE__ */ M("ol", {
|
|
2203
2404
|
className: `la-observer-queue${t ? " la-observer-queue-compact" : ""}`,
|
|
2204
2405
|
"aria-label": `${e.length} waiting requests, next to run first`,
|
|
2205
|
-
children: [n.map((e, n) => /* @__PURE__ */
|
|
2406
|
+
children: [n.map((e, n) => /* @__PURE__ */ j("li", { children: /* @__PURE__ */ M(U, {
|
|
2206
2407
|
variant: "outline",
|
|
2207
2408
|
className: "la-observer-queue-bubble",
|
|
2208
2409
|
title: e.operation,
|
|
2209
|
-
children: [!t && /* @__PURE__ */
|
|
2410
|
+
children: [!t && /* @__PURE__ */ j("span", {
|
|
2210
2411
|
className: "la-observer-queue-position",
|
|
2211
2412
|
children: n + 1
|
|
2212
|
-
}), /* @__PURE__ */
|
|
2413
|
+
}), /* @__PURE__ */ j("span", {
|
|
2213
2414
|
className: "la-observer-queue-operation",
|
|
2214
2415
|
children: e.operation
|
|
2215
2416
|
})]
|
|
2216
|
-
}) }, e.id)), t && e.length > n.length && /* @__PURE__ */
|
|
2417
|
+
}) }, e.id)), t && e.length > n.length && /* @__PURE__ */ j("li", { children: /* @__PURE__ */ M(U, {
|
|
2217
2418
|
"aria-label": `${e.length - n.length} more waiting requests`,
|
|
2218
2419
|
children: ["+", e.length - n.length]
|
|
2219
2420
|
}) })]
|
|
2220
2421
|
});
|
|
2221
2422
|
}
|
|
2222
|
-
function
|
|
2223
|
-
return /* @__PURE__ */
|
|
2423
|
+
function Vt({ id: e, actorId: t, connections: n }) {
|
|
2424
|
+
return /* @__PURE__ */ M("section", {
|
|
2224
2425
|
id: e,
|
|
2225
2426
|
className: "la-observer-connections",
|
|
2226
2427
|
"aria-labelledby": `${e}-heading`,
|
|
2227
|
-
children: [/* @__PURE__ */
|
|
2428
|
+
children: [/* @__PURE__ */ j("div", {
|
|
2228
2429
|
className: "la-observer-instances-heading",
|
|
2229
|
-
children: /* @__PURE__ */
|
|
2430
|
+
children: /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ M("h3", {
|
|
2230
2431
|
id: `${e}-heading`,
|
|
2231
2432
|
children: [
|
|
2232
2433
|
t,
|
|
2233
2434
|
" WebSockets ",
|
|
2234
|
-
/* @__PURE__ */
|
|
2435
|
+
/* @__PURE__ */ j(U, {
|
|
2235
2436
|
"aria-hidden": "true",
|
|
2236
2437
|
children: n.length.toLocaleString()
|
|
2237
2438
|
})
|
|
2238
2439
|
]
|
|
2239
|
-
}), /* @__PURE__ */
|
|
2240
|
-
}), n.length ? /* @__PURE__ */
|
|
2440
|
+
}), /* @__PURE__ */ j("p", { children: `${n.length.toLocaleString()} active ${n.length === 1 ? "connection" : "connections"}` })] })
|
|
2441
|
+
}), n.length ? /* @__PURE__ */ j("div", {
|
|
2241
2442
|
className: "la-observer-table-frame",
|
|
2242
|
-
children: /* @__PURE__ */
|
|
2443
|
+
children: /* @__PURE__ */ M(G, {
|
|
2243
2444
|
"aria-label": `${t} WebSocket connections`,
|
|
2244
2445
|
className: "la-observer-connection-table",
|
|
2245
|
-
children: [/* @__PURE__ */
|
|
2446
|
+
children: [/* @__PURE__ */ j(K, { children: /* @__PURE__ */ M(J, { children: [/* @__PURE__ */ j(Y, {
|
|
2246
2447
|
scope: "col",
|
|
2247
2448
|
children: "Socket"
|
|
2248
|
-
}), /* @__PURE__ */
|
|
2449
|
+
}), /* @__PURE__ */ j(Y, {
|
|
2249
2450
|
scope: "col",
|
|
2250
2451
|
children: "Metadata"
|
|
2251
|
-
})] }) }), /* @__PURE__ */
|
|
2452
|
+
})] }) }), /* @__PURE__ */ j(q, { children: n.map((e) => /* @__PURE__ */ M(J, { children: [/* @__PURE__ */ j(X, {
|
|
2252
2453
|
className: "la-observer-socket-id",
|
|
2253
2454
|
children: e.id
|
|
2254
|
-
}), /* @__PURE__ */
|
|
2455
|
+
}), /* @__PURE__ */ j(X, { children: /* @__PURE__ */ j("pre", { children: JSON.stringify(e.metadata, null, 2) }) })] }, e.id)) })]
|
|
2255
2456
|
})
|
|
2256
|
-
}) : /* @__PURE__ */
|
|
2457
|
+
}) : /* @__PURE__ */ M("div", {
|
|
2257
2458
|
className: "la-observer-no-connections",
|
|
2258
2459
|
role: "status",
|
|
2259
|
-
children: [/* @__PURE__ */
|
|
2460
|
+
children: [/* @__PURE__ */ j(T, { "aria-hidden": "true" }), /* @__PURE__ */ j("p", { children: "No active WebSocket connections." })]
|
|
2260
2461
|
})]
|
|
2261
2462
|
});
|
|
2262
2463
|
}
|
|
2263
|
-
function
|
|
2264
|
-
return /* @__PURE__ */
|
|
2464
|
+
function Ht({ label: e, placeholder: t, value: n, onChange: r }) {
|
|
2465
|
+
return /* @__PURE__ */ M("div", {
|
|
2265
2466
|
className: "la-observer-search",
|
|
2266
|
-
children: [/* @__PURE__ */
|
|
2467
|
+
children: [/* @__PURE__ */ j(S, { "aria-hidden": "true" }), /* @__PURE__ */ j(V, {
|
|
2267
2468
|
type: "search",
|
|
2268
2469
|
"aria-label": e,
|
|
2269
2470
|
placeholder: t,
|
|
@@ -2272,14 +2473,14 @@ function Nt({ label: e, placeholder: t, value: n, onChange: r }) {
|
|
|
2272
2473
|
})]
|
|
2273
2474
|
});
|
|
2274
2475
|
}
|
|
2275
|
-
function
|
|
2276
|
-
return /* @__PURE__ */
|
|
2476
|
+
function Ut({ title: e, description: t, action: n, onReset: r }) {
|
|
2477
|
+
return /* @__PURE__ */ M("div", {
|
|
2277
2478
|
className: "la-observer-empty",
|
|
2278
2479
|
children: [
|
|
2279
|
-
/* @__PURE__ */
|
|
2280
|
-
/* @__PURE__ */
|
|
2281
|
-
/* @__PURE__ */
|
|
2282
|
-
n && /* @__PURE__ */
|
|
2480
|
+
/* @__PURE__ */ j(S, { "aria-hidden": "true" }),
|
|
2481
|
+
/* @__PURE__ */ j("h3", { children: e }),
|
|
2482
|
+
/* @__PURE__ */ j("p", { children: t }),
|
|
2483
|
+
n && /* @__PURE__ */ j(B, {
|
|
2283
2484
|
type: "button",
|
|
2284
2485
|
variant: "outline",
|
|
2285
2486
|
onClick: r,
|
|
@@ -2288,26 +2489,26 @@ function Pt({ title: e, description: t, action: n, onReset: r }) {
|
|
|
2288
2489
|
]
|
|
2289
2490
|
});
|
|
2290
2491
|
}
|
|
2291
|
-
function
|
|
2492
|
+
function Wt(e, t) {
|
|
2292
2493
|
return e.toLocaleLowerCase().includes(t.trim().toLocaleLowerCase());
|
|
2293
2494
|
}
|
|
2294
|
-
function
|
|
2495
|
+
function Gt(e) {
|
|
2295
2496
|
return e[0].toUpperCase() + e.slice(1);
|
|
2296
2497
|
}
|
|
2297
2498
|
//#endregion
|
|
2298
2499
|
//#region src/overview-data.ts
|
|
2299
|
-
function
|
|
2500
|
+
function Kt(e) {
|
|
2300
2501
|
let t = e.filter((e) => e.outcome !== "rerouted");
|
|
2301
2502
|
return {
|
|
2302
2503
|
count: e.length,
|
|
2303
2504
|
success: t.length ? 100 * t.filter((e) => e.outcome === "completed").length / t.length : null,
|
|
2304
|
-
p95:
|
|
2505
|
+
p95: Xt(t.map((e) => e.durationMs))
|
|
2305
2506
|
};
|
|
2306
2507
|
}
|
|
2307
|
-
function
|
|
2508
|
+
function qt(e, t, n) {
|
|
2308
2509
|
return e.filter((e) => e.startedAtMs >= (t.fromMs ?? 0) && e.startedAtMs <= (t.toMs ?? n));
|
|
2309
2510
|
}
|
|
2310
|
-
function
|
|
2511
|
+
function Jt(e) {
|
|
2311
2512
|
return e.actors.reduce((e, t) => ({
|
|
2312
2513
|
live: e.live + t.live,
|
|
2313
2514
|
dormant: e.dormant + t.dormant,
|
|
@@ -2320,33 +2521,33 @@ function zt(e) {
|
|
|
2320
2521
|
connections: 0
|
|
2321
2522
|
});
|
|
2322
2523
|
}
|
|
2323
|
-
function
|
|
2324
|
-
return
|
|
2524
|
+
function Yt(e) {
|
|
2525
|
+
return Xt(e.filter((e) => e.outcome !== "rerouted" && e.queueWaitMs !== null).map((e) => e.queueWaitMs));
|
|
2325
2526
|
}
|
|
2326
|
-
function
|
|
2527
|
+
function Xt(e) {
|
|
2327
2528
|
return e.length ? e.sort((e, t) => e - t)[Math.ceil(e.length * .95) - 1] : null;
|
|
2328
2529
|
}
|
|
2329
2530
|
//#endregion
|
|
2330
2531
|
//#region src/overview-metrics.ts
|
|
2331
|
-
function
|
|
2532
|
+
function Zt(e) {
|
|
2332
2533
|
let t = e;
|
|
2333
|
-
if (!t || !
|
|
2534
|
+
if (!t || !Qt(t.total) || !Array.isArray(t.classes) || !t.classes.every(Qt)) throw Error("Invalid overview metrics response");
|
|
2334
2535
|
return t;
|
|
2335
2536
|
}
|
|
2336
|
-
function
|
|
2537
|
+
function Qt(e) {
|
|
2337
2538
|
return !!e && typeof e.actorName == "string" && Number.isSafeInteger(e.count) && e.count >= 0 && [
|
|
2338
2539
|
e.success,
|
|
2339
2540
|
e.p95,
|
|
2340
2541
|
e.queueP95
|
|
2341
2542
|
].every((e) => e === null || typeof e == "number" && Number.isFinite(e) && e >= 0) && (e.success === null || e.success <= 100);
|
|
2342
2543
|
}
|
|
2343
|
-
function
|
|
2544
|
+
function $t(e) {
|
|
2344
2545
|
let t = /* @__PURE__ */ new Map();
|
|
2345
2546
|
for (let n of e) t.set(n.actorName, [...t.get(n.actorName) ?? [], n]);
|
|
2346
2547
|
let n = (e, t) => ({
|
|
2347
2548
|
actorName: e,
|
|
2348
|
-
...
|
|
2349
|
-
queueP95:
|
|
2549
|
+
...Kt(t),
|
|
2550
|
+
queueP95: Yt(t)
|
|
2350
2551
|
});
|
|
2351
2552
|
return {
|
|
2352
2553
|
total: n("", e),
|
|
@@ -2355,47 +2556,47 @@ function Wt(e) {
|
|
|
2355
2556
|
}
|
|
2356
2557
|
//#endregion
|
|
2357
2558
|
//#region src/Overview.tsx
|
|
2358
|
-
function
|
|
2359
|
-
let o =
|
|
2559
|
+
function en({ client: e, onSelectActor: n, timeRange: r, onTimeRangeChange: i }) {
|
|
2560
|
+
let o = tt(e), [s, c] = a(Fe), l = r ?? s, u = i ?? c, [d, f] = a(Date.now);
|
|
2360
2561
|
t(() => {
|
|
2361
2562
|
let e = setInterval(() => f(Date.now()), 1e4);
|
|
2362
2563
|
return () => clearInterval(e);
|
|
2363
2564
|
}, []);
|
|
2364
|
-
let p =
|
|
2365
|
-
return /* @__PURE__ */
|
|
2565
|
+
let p = Ie(l, d), m = it(e, p, e.getMetrics), h = nt(e, !m.supported), g = h.page ? $t(qt(h.page.records, p, Math.max(d, Date.now()))) : void 0, _ = m.supported ? m.value : g, v = m.supported ? m.failed : h.failed;
|
|
2566
|
+
return /* @__PURE__ */ M("section", {
|
|
2366
2567
|
className: "la-observer overview",
|
|
2367
2568
|
"aria-label": "Runtime overview",
|
|
2368
2569
|
children: [
|
|
2369
|
-
/* @__PURE__ */
|
|
2570
|
+
/* @__PURE__ */ M("div", {
|
|
2370
2571
|
className: "overview-heading",
|
|
2371
|
-
children: [/* @__PURE__ */
|
|
2572
|
+
children: [/* @__PURE__ */ j("h1", { children: "Durable Actors" }), /* @__PURE__ */ M("div", {
|
|
2372
2573
|
className: "overview-controls",
|
|
2373
2574
|
children: [
|
|
2374
|
-
/* @__PURE__ */
|
|
2575
|
+
/* @__PURE__ */ j("span", {
|
|
2375
2576
|
className: "overview-updated",
|
|
2376
|
-
children: o.failed ? "Inventory reconnecting…" : o.updatedAt ? /* @__PURE__ */
|
|
2577
|
+
children: o.failed ? "Inventory reconnecting…" : o.updatedAt ? /* @__PURE__ */ M(A, { children: ["Last inventory update ", /* @__PURE__ */ j("time", {
|
|
2377
2578
|
dateTime: new Date(o.updatedAt).toISOString(),
|
|
2378
2579
|
children: new Date(o.updatedAt).toLocaleTimeString([], { hour12: !1 })
|
|
2379
2580
|
})] }) : "Connecting…"
|
|
2380
2581
|
}),
|
|
2381
|
-
/* @__PURE__ */
|
|
2582
|
+
/* @__PURE__ */ j(Be, {
|
|
2382
2583
|
value: l,
|
|
2383
2584
|
onChange: u,
|
|
2384
2585
|
className: "overview-range"
|
|
2385
2586
|
}),
|
|
2386
|
-
/* @__PURE__ */
|
|
2587
|
+
/* @__PURE__ */ j(B, {
|
|
2387
2588
|
variant: "outline",
|
|
2388
2589
|
size: "icon",
|
|
2389
2590
|
"aria-label": "Refresh overview",
|
|
2390
2591
|
onClick: () => {
|
|
2391
2592
|
o.retry(), m.retry(), h.retry();
|
|
2392
2593
|
},
|
|
2393
|
-
children: /* @__PURE__ */
|
|
2594
|
+
children: /* @__PURE__ */ j(te, { "aria-hidden": "true" })
|
|
2394
2595
|
})
|
|
2395
2596
|
]
|
|
2396
2597
|
})]
|
|
2397
2598
|
}),
|
|
2398
|
-
o.failed && /* @__PURE__ */
|
|
2599
|
+
o.failed && /* @__PURE__ */ M("p", {
|
|
2399
2600
|
className: "overview-alert",
|
|
2400
2601
|
role: "alert",
|
|
2401
2602
|
children: [
|
|
@@ -2404,7 +2605,7 @@ function Gt({ client: e, onSelectActor: n, timeRange: r, onTimeRangeChange: i })
|
|
|
2404
2605
|
" Retrying automatically."
|
|
2405
2606
|
]
|
|
2406
2607
|
}),
|
|
2407
|
-
v && /* @__PURE__ */
|
|
2608
|
+
v && /* @__PURE__ */ M("p", {
|
|
2408
2609
|
className: "overview-alert",
|
|
2409
2610
|
role: "alert",
|
|
2410
2611
|
children: [
|
|
@@ -2415,18 +2616,18 @@ function Gt({ client: e, onSelectActor: n, timeRange: r, onTimeRangeChange: i })
|
|
|
2415
2616
|
"Retrying automatically."
|
|
2416
2617
|
]
|
|
2417
2618
|
}),
|
|
2418
|
-
/* @__PURE__ */
|
|
2619
|
+
/* @__PURE__ */ j(tn, {
|
|
2419
2620
|
inventory: o.inventory,
|
|
2420
2621
|
metrics: _,
|
|
2421
2622
|
range: l
|
|
2422
2623
|
}),
|
|
2423
|
-
/* @__PURE__ */
|
|
2624
|
+
/* @__PURE__ */ j(nn, {
|
|
2424
2625
|
inventory: o.inventory,
|
|
2425
2626
|
metrics: _,
|
|
2426
2627
|
failed: o.failed,
|
|
2427
2628
|
onSelectActor: n
|
|
2428
2629
|
}),
|
|
2429
|
-
/* @__PURE__ */
|
|
2630
|
+
/* @__PURE__ */ j(sn, {
|
|
2430
2631
|
page: m.supported ? void 0 : h.page,
|
|
2431
2632
|
range: l,
|
|
2432
2633
|
saved: m.supported
|
|
@@ -2434,133 +2635,133 @@ function Gt({ client: e, onSelectActor: n, timeRange: r, onTimeRangeChange: i })
|
|
|
2434
2635
|
]
|
|
2435
2636
|
});
|
|
2436
2637
|
}
|
|
2437
|
-
function
|
|
2438
|
-
let r = e ?
|
|
2439
|
-
return /* @__PURE__ */
|
|
2638
|
+
function tn({ inventory: e, metrics: t, range: n }) {
|
|
2639
|
+
let r = e ? Jt(e) : void 0, i = r ? r.live + r.dormant + r.unknown : void 0, a = t?.total;
|
|
2640
|
+
return /* @__PURE__ */ M("div", {
|
|
2440
2641
|
className: "overview-metrics",
|
|
2441
2642
|
children: [
|
|
2442
|
-
/* @__PURE__ */
|
|
2643
|
+
/* @__PURE__ */ M("section", {
|
|
2443
2644
|
className: "overview-metric",
|
|
2444
2645
|
children: [
|
|
2445
|
-
/* @__PURE__ */
|
|
2446
|
-
/* @__PURE__ */
|
|
2646
|
+
/* @__PURE__ */ j("h2", { children: "Actor instances" }),
|
|
2647
|
+
/* @__PURE__ */ M("div", {
|
|
2447
2648
|
className: "overview-value",
|
|
2448
|
-
children: [/* @__PURE__ */
|
|
2649
|
+
children: [/* @__PURE__ */ j("strong", {
|
|
2449
2650
|
"aria-label": "Actor instances",
|
|
2450
2651
|
children: Z(i)
|
|
2451
|
-
}), /* @__PURE__ */
|
|
2652
|
+
}), /* @__PURE__ */ j("span", { children: e ? `${e.actors.length} actor ${e.actors.length === 1 ? "class" : "classes"}` : "Waiting for inventory" })]
|
|
2452
2653
|
}),
|
|
2453
|
-
/* @__PURE__ */
|
|
2654
|
+
/* @__PURE__ */ j("div", {
|
|
2454
2655
|
className: "overview-residency",
|
|
2455
2656
|
"aria-hidden": "true",
|
|
2456
|
-
children: r && Object.entries(r).filter(([e]) => e !== "connections").map(([e, t]) => /* @__PURE__ */
|
|
2657
|
+
children: r && Object.entries(r).filter(([e]) => e !== "connections").map(([e, t]) => /* @__PURE__ */ j("span", {
|
|
2457
2658
|
className: `residency-${e}`,
|
|
2458
2659
|
style: { flexGrow: t }
|
|
2459
2660
|
}, e))
|
|
2460
2661
|
}),
|
|
2461
|
-
/* @__PURE__ */
|
|
2662
|
+
/* @__PURE__ */ M("div", {
|
|
2462
2663
|
className: "overview-metric-foot",
|
|
2463
2664
|
children: [
|
|
2464
|
-
/* @__PURE__ */
|
|
2465
|
-
/* @__PURE__ */
|
|
2466
|
-
!!r?.unknown && /* @__PURE__ */
|
|
2665
|
+
/* @__PURE__ */ M("span", { children: [/* @__PURE__ */ j("b", { children: Z(r?.live) }), " live"] }),
|
|
2666
|
+
/* @__PURE__ */ M("span", { children: [/* @__PURE__ */ j("b", { children: Z(r?.dormant) }), " dormant"] }),
|
|
2667
|
+
!!r?.unknown && /* @__PURE__ */ M("span", { children: [/* @__PURE__ */ j("b", { children: Z(r.unknown) }), " unknown"] })
|
|
2467
2668
|
]
|
|
2468
2669
|
})
|
|
2469
2670
|
]
|
|
2470
2671
|
}),
|
|
2471
|
-
/* @__PURE__ */
|
|
2672
|
+
/* @__PURE__ */ M("section", {
|
|
2472
2673
|
className: "overview-metric",
|
|
2473
2674
|
children: [
|
|
2474
|
-
/* @__PURE__ */
|
|
2475
|
-
/* @__PURE__ */
|
|
2675
|
+
/* @__PURE__ */ j("h2", { children: "Requests" }),
|
|
2676
|
+
/* @__PURE__ */ M("div", {
|
|
2476
2677
|
className: "overview-value",
|
|
2477
|
-
children: [/* @__PURE__ */
|
|
2678
|
+
children: [/* @__PURE__ */ j("strong", {
|
|
2478
2679
|
"aria-label": "Retained requests",
|
|
2479
2680
|
children: Z(a?.count)
|
|
2480
|
-
}), /* @__PURE__ */
|
|
2681
|
+
}), /* @__PURE__ */ j("span", { children: H(n) })]
|
|
2481
2682
|
}),
|
|
2482
|
-
/* @__PURE__ */
|
|
2683
|
+
/* @__PURE__ */ M("div", {
|
|
2483
2684
|
className: "overview-health",
|
|
2484
2685
|
children: [
|
|
2485
|
-
/* @__PURE__ */
|
|
2686
|
+
/* @__PURE__ */ M("span", { children: [/* @__PURE__ */ j(an, {
|
|
2486
2687
|
value: a?.success,
|
|
2487
2688
|
kind: "success"
|
|
2488
2689
|
}), " success"] }),
|
|
2489
|
-
/* @__PURE__ */
|
|
2690
|
+
/* @__PURE__ */ M("span", { children: [/* @__PURE__ */ j(an, {
|
|
2490
2691
|
value: a?.p95,
|
|
2491
2692
|
kind: "latency"
|
|
2492
2693
|
}), " p95 latency"] }),
|
|
2493
|
-
/* @__PURE__ */
|
|
2694
|
+
/* @__PURE__ */ M("span", { children: [/* @__PURE__ */ j("b", { children: ln(a?.queueP95) }), " p95 queue wait"] })
|
|
2494
2695
|
]
|
|
2495
2696
|
})
|
|
2496
2697
|
]
|
|
2497
2698
|
}),
|
|
2498
|
-
/* @__PURE__ */
|
|
2699
|
+
/* @__PURE__ */ M("section", {
|
|
2499
2700
|
className: "overview-metric",
|
|
2500
2701
|
children: [
|
|
2501
|
-
/* @__PURE__ */
|
|
2502
|
-
/* @__PURE__ */
|
|
2702
|
+
/* @__PURE__ */ j("h2", { children: "WebSocket connections" }),
|
|
2703
|
+
/* @__PURE__ */ M("div", {
|
|
2503
2704
|
className: "overview-value",
|
|
2504
|
-
children: [/* @__PURE__ */
|
|
2705
|
+
children: [/* @__PURE__ */ j("strong", {
|
|
2505
2706
|
"aria-label": "Open WebSocket connections",
|
|
2506
2707
|
children: Z(r?.connections)
|
|
2507
|
-
}), /* @__PURE__ */
|
|
2708
|
+
}), /* @__PURE__ */ j("span", { children: "open" })]
|
|
2508
2709
|
}),
|
|
2509
|
-
/* @__PURE__ */
|
|
2710
|
+
/* @__PURE__ */ M("div", {
|
|
2510
2711
|
className: "overview-health",
|
|
2511
|
-
children: [/* @__PURE__ */
|
|
2712
|
+
children: [/* @__PURE__ */ j("span", { children: "Current inventory snapshot" }), /* @__PURE__ */ j("span", { children: "Active sockets" })]
|
|
2512
2713
|
})
|
|
2513
2714
|
]
|
|
2514
2715
|
})
|
|
2515
2716
|
]
|
|
2516
2717
|
});
|
|
2517
2718
|
}
|
|
2518
|
-
function
|
|
2719
|
+
function nn({ inventory: e, metrics: t, failed: n, onSelectActor: r }) {
|
|
2519
2720
|
let [i, o] = a(""), [s, c] = a("all"), l = e?.actors.filter((e) => e.actorName.toLocaleLowerCase().includes(i.trim().toLocaleLowerCase()) && (s === "all" || e[s] > 0)).sort((e, t) => Number(t.live > 0) - Number(e.live > 0)) ?? [];
|
|
2520
|
-
return /* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ M("section", {
|
|
2521
2722
|
"aria-label": "Actor classes",
|
|
2522
|
-
children: [/* @__PURE__ */
|
|
2723
|
+
children: [/* @__PURE__ */ M("div", {
|
|
2523
2724
|
className: "overview-section-heading",
|
|
2524
|
-
children: [/* @__PURE__ */
|
|
2525
|
-
}), /* @__PURE__ */
|
|
2725
|
+
children: [/* @__PURE__ */ M("h2", { children: ["Actor classes ", /* @__PURE__ */ j("span", { children: Z(e?.actors.length) })] }), /* @__PURE__ */ j(on, {})]
|
|
2726
|
+
}), /* @__PURE__ */ M("div", {
|
|
2526
2727
|
className: "overview-panel",
|
|
2527
2728
|
children: [
|
|
2528
|
-
/* @__PURE__ */
|
|
2729
|
+
/* @__PURE__ */ M("div", {
|
|
2529
2730
|
className: "overview-filterbar",
|
|
2530
|
-
children: [/* @__PURE__ */
|
|
2731
|
+
children: [/* @__PURE__ */ M("div", {
|
|
2531
2732
|
className: "overview-search",
|
|
2532
|
-
children: [/* @__PURE__ */
|
|
2733
|
+
children: [/* @__PURE__ */ j(S, { "aria-hidden": "true" }), /* @__PURE__ */ j(V, {
|
|
2533
2734
|
"aria-label": "Filter actor classes",
|
|
2534
2735
|
placeholder: "Filter actor classes…",
|
|
2535
2736
|
value: i,
|
|
2536
2737
|
onInput: (e) => o(e.currentTarget.value)
|
|
2537
2738
|
})]
|
|
2538
|
-
}), /* @__PURE__ */
|
|
2739
|
+
}), /* @__PURE__ */ M(Je, {
|
|
2539
2740
|
"aria-label": "Filter by residency",
|
|
2540
2741
|
size: "sm",
|
|
2541
2742
|
value: s,
|
|
2542
2743
|
onChange: (e) => c(e.target.value),
|
|
2543
2744
|
children: [
|
|
2544
|
-
/* @__PURE__ */
|
|
2745
|
+
/* @__PURE__ */ j(W, {
|
|
2545
2746
|
value: "all",
|
|
2546
2747
|
children: "All states"
|
|
2547
2748
|
}),
|
|
2548
|
-
/* @__PURE__ */
|
|
2749
|
+
/* @__PURE__ */ j(W, {
|
|
2549
2750
|
value: "live",
|
|
2550
2751
|
children: "Live instances"
|
|
2551
2752
|
}),
|
|
2552
|
-
/* @__PURE__ */
|
|
2753
|
+
/* @__PURE__ */ j(W, {
|
|
2553
2754
|
value: "dormant",
|
|
2554
2755
|
children: "Dormant instances"
|
|
2555
2756
|
}),
|
|
2556
|
-
/* @__PURE__ */
|
|
2757
|
+
/* @__PURE__ */ j(W, {
|
|
2557
2758
|
value: "unknown",
|
|
2558
2759
|
children: "Unknown residency"
|
|
2559
2760
|
})
|
|
2560
2761
|
]
|
|
2561
2762
|
})]
|
|
2562
2763
|
}),
|
|
2563
|
-
/* @__PURE__ */
|
|
2764
|
+
/* @__PURE__ */ M(G, {
|
|
2564
2765
|
className: "overview-table",
|
|
2565
2766
|
"aria-label": "Actor class metrics",
|
|
2566
2767
|
containerProps: {
|
|
@@ -2570,69 +2771,69 @@ function qt({ inventory: e, metrics: t, failed: n, onSelectActor: r }) {
|
|
|
2570
2771
|
tabIndex: 0
|
|
2571
2772
|
},
|
|
2572
2773
|
children: [
|
|
2573
|
-
/* @__PURE__ */
|
|
2574
|
-
/* @__PURE__ */
|
|
2774
|
+
/* @__PURE__ */ M("colgroup", { children: [/* @__PURE__ */ j("col", { className: "overview-class-column" }), /* @__PURE__ */ j("col", { span: 6 })] }),
|
|
2775
|
+
/* @__PURE__ */ M(K, { children: [/* @__PURE__ */ M(J, {
|
|
2575
2776
|
className: "overview-groups",
|
|
2576
2777
|
children: [
|
|
2577
|
-
/* @__PURE__ */
|
|
2778
|
+
/* @__PURE__ */ j(Y, {
|
|
2578
2779
|
scope: "colgroup",
|
|
2579
2780
|
colSpan: 2,
|
|
2580
2781
|
children: "Actors"
|
|
2581
2782
|
}),
|
|
2582
|
-
/* @__PURE__ */
|
|
2783
|
+
/* @__PURE__ */ j(Y, {
|
|
2583
2784
|
scope: "colgroup",
|
|
2584
2785
|
colSpan: 4,
|
|
2585
2786
|
children: "Requests"
|
|
2586
2787
|
}),
|
|
2587
|
-
/* @__PURE__ */
|
|
2788
|
+
/* @__PURE__ */ j(Y, {
|
|
2588
2789
|
scope: "colgroup",
|
|
2589
2790
|
children: "WebSockets"
|
|
2590
2791
|
})
|
|
2591
2792
|
]
|
|
2592
|
-
}), /* @__PURE__ */
|
|
2593
|
-
/* @__PURE__ */
|
|
2793
|
+
}), /* @__PURE__ */ M(J, { children: [
|
|
2794
|
+
/* @__PURE__ */ j(Y, {
|
|
2594
2795
|
scope: "col",
|
|
2595
2796
|
children: "Class"
|
|
2596
2797
|
}),
|
|
2597
|
-
/* @__PURE__ */
|
|
2798
|
+
/* @__PURE__ */ j(Y, {
|
|
2598
2799
|
scope: "col",
|
|
2599
2800
|
children: "Instances"
|
|
2600
2801
|
}),
|
|
2601
|
-
/* @__PURE__ */
|
|
2802
|
+
/* @__PURE__ */ j(Y, {
|
|
2602
2803
|
scope: "col",
|
|
2603
2804
|
children: "Total"
|
|
2604
2805
|
}),
|
|
2605
|
-
/* @__PURE__ */
|
|
2806
|
+
/* @__PURE__ */ j(Y, {
|
|
2606
2807
|
scope: "col",
|
|
2607
2808
|
children: "Success"
|
|
2608
2809
|
}),
|
|
2609
|
-
/* @__PURE__ */
|
|
2810
|
+
/* @__PURE__ */ j(Y, {
|
|
2610
2811
|
scope: "col",
|
|
2611
2812
|
children: "p95 latency"
|
|
2612
2813
|
}),
|
|
2613
|
-
/* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ j(Y, {
|
|
2614
2815
|
scope: "col",
|
|
2615
2816
|
children: "p95 queue wait"
|
|
2616
2817
|
}),
|
|
2617
|
-
/* @__PURE__ */
|
|
2818
|
+
/* @__PURE__ */ j(Y, {
|
|
2618
2819
|
scope: "col",
|
|
2619
2820
|
children: "Connected"
|
|
2620
2821
|
})
|
|
2621
2822
|
] })] }),
|
|
2622
|
-
/* @__PURE__ */
|
|
2823
|
+
/* @__PURE__ */ j(q, { children: l.map((e) => /* @__PURE__ */ j(rn, {
|
|
2623
2824
|
actor: e,
|
|
2624
|
-
metrics: t && (t.classes.find((t) => t.actorName === e.actorName) ??
|
|
2825
|
+
metrics: t && (t.classes.find((t) => t.actorName === e.actorName) ?? cn(e.actorName)),
|
|
2625
2826
|
onSelectActor: r
|
|
2626
2827
|
}, e.actorName)) })
|
|
2627
2828
|
]
|
|
2628
2829
|
}),
|
|
2629
|
-
!l.length && /* @__PURE__ */
|
|
2830
|
+
!l.length && /* @__PURE__ */ M("div", {
|
|
2630
2831
|
className: "overview-empty",
|
|
2631
2832
|
role: "status",
|
|
2632
2833
|
children: [
|
|
2633
|
-
/* @__PURE__ */
|
|
2634
|
-
/* @__PURE__ */
|
|
2635
|
-
!!e?.actors.length && /* @__PURE__ */
|
|
2834
|
+
/* @__PURE__ */ j("strong", { children: e ? e.actors.length ? "No matching actor classes" : "No actors yet" : n ? "Inventory unavailable" : "Loading actor classes…" }),
|
|
2835
|
+
/* @__PURE__ */ j("p", { children: e?.actors.length ? "Try another class name or residency state." : "Actor classes appear after deployment." }),
|
|
2836
|
+
!!e?.actors.length && /* @__PURE__ */ j(B, {
|
|
2636
2837
|
variant: "outline",
|
|
2637
2838
|
onClick: () => {
|
|
2638
2839
|
o(""), c("all");
|
|
@@ -2645,88 +2846,88 @@ function qt({ inventory: e, metrics: t, failed: n, onSelectActor: r }) {
|
|
|
2645
2846
|
})]
|
|
2646
2847
|
});
|
|
2647
2848
|
}
|
|
2648
|
-
function
|
|
2649
|
-
return /* @__PURE__ */
|
|
2849
|
+
function rn({ actor: e, metrics: t, onSelectActor: n }) {
|
|
2850
|
+
return /* @__PURE__ */ M(J, {
|
|
2650
2851
|
className: "la-clickable-row",
|
|
2651
2852
|
onClick: () => n(e.actorName),
|
|
2652
2853
|
children: [
|
|
2653
|
-
/* @__PURE__ */
|
|
2854
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ j(B, {
|
|
2654
2855
|
variant: "ghost",
|
|
2655
2856
|
type: "button",
|
|
2656
2857
|
className: "overview-class-link",
|
|
2657
2858
|
"aria-label": `Inspect ${e.actorName}`,
|
|
2658
|
-
children: /* @__PURE__ */
|
|
2859
|
+
children: /* @__PURE__ */ j("span", {
|
|
2659
2860
|
title: e.actorName,
|
|
2660
2861
|
children: e.actorName
|
|
2661
2862
|
})
|
|
2662
2863
|
}) }),
|
|
2663
|
-
/* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2864
|
+
/* @__PURE__ */ j(X, { children: Z(e.live + e.dormant + e.unknown) }),
|
|
2865
|
+
/* @__PURE__ */ j(X, { children: Z(t?.count) }),
|
|
2866
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ j(an, {
|
|
2666
2867
|
value: t?.success,
|
|
2667
2868
|
kind: "success"
|
|
2668
2869
|
}) }),
|
|
2669
|
-
/* @__PURE__ */
|
|
2870
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ j(an, {
|
|
2670
2871
|
value: t?.p95,
|
|
2671
2872
|
kind: "latency"
|
|
2672
2873
|
}) }),
|
|
2673
|
-
/* @__PURE__ */
|
|
2674
|
-
/* @__PURE__ */
|
|
2874
|
+
/* @__PURE__ */ j(X, { children: ln(t?.queueP95) }),
|
|
2875
|
+
/* @__PURE__ */ j(X, { children: Z(e.instances.reduce((e, t) => e + t.connections.length, 0)) })
|
|
2675
2876
|
]
|
|
2676
2877
|
});
|
|
2677
2878
|
}
|
|
2678
|
-
function
|
|
2679
|
-
if (e == null) return /* @__PURE__ */
|
|
2879
|
+
function an({ value: e, kind: t }) {
|
|
2880
|
+
if (e == null) return /* @__PURE__ */ j("span", {
|
|
2680
2881
|
title: "No retained execution attempts",
|
|
2681
2882
|
children: "—"
|
|
2682
2883
|
});
|
|
2683
2884
|
let n = t === "success" ? e < 95 ? "bad" : e < 99 ? "warn" : "good" : e > 100 ? "bad" : "good";
|
|
2684
|
-
return /* @__PURE__ */
|
|
2885
|
+
return /* @__PURE__ */ M("span", {
|
|
2685
2886
|
className: `overview-signal signal-${n}`,
|
|
2686
2887
|
title: n === "bad" ? "Critical threshold breached" : n === "warn" ? "Warning threshold breached" : "Within threshold",
|
|
2687
|
-
children: [n !== "good" && /* @__PURE__ */
|
|
2888
|
+
children: [n !== "good" && /* @__PURE__ */ j("span", {
|
|
2688
2889
|
"aria-hidden": "true",
|
|
2689
2890
|
children: n === "warn" ? "!" : "×"
|
|
2690
|
-
}), t === "success" ? `${e.toLocaleString(void 0, { maximumFractionDigits: 2 })}%` :
|
|
2891
|
+
}), t === "success" ? `${e.toLocaleString(void 0, { maximumFractionDigits: 2 })}%` : ln(e)]
|
|
2691
2892
|
});
|
|
2692
2893
|
}
|
|
2693
|
-
function
|
|
2694
|
-
return /* @__PURE__ */
|
|
2894
|
+
function on() {
|
|
2895
|
+
return /* @__PURE__ */ M("details", {
|
|
2695
2896
|
className: "overview-thresholds",
|
|
2696
|
-
children: [/* @__PURE__ */
|
|
2897
|
+
children: [/* @__PURE__ */ M("summary", { children: [/* @__PURE__ */ M("span", {
|
|
2697
2898
|
className: "threshold-dots",
|
|
2698
2899
|
"aria-hidden": "true",
|
|
2699
2900
|
children: [
|
|
2700
|
-
/* @__PURE__ */
|
|
2701
|
-
/* @__PURE__ */
|
|
2702
|
-
/* @__PURE__ */
|
|
2901
|
+
/* @__PURE__ */ j("i", {}),
|
|
2902
|
+
/* @__PURE__ */ j("i", {}),
|
|
2903
|
+
/* @__PURE__ */ j("i", {})
|
|
2703
2904
|
]
|
|
2704
|
-
}), "Thresholds"] }), /* @__PURE__ */
|
|
2705
|
-
/* @__PURE__ */
|
|
2706
|
-
/* @__PURE__ */
|
|
2707
|
-
/* @__PURE__ */
|
|
2708
|
-
/* @__PURE__ */
|
|
2905
|
+
}), "Thresholds"] }), /* @__PURE__ */ M("div", { children: [
|
|
2906
|
+
/* @__PURE__ */ j("strong", { children: "Display thresholds" }),
|
|
2907
|
+
/* @__PURE__ */ j("p", { children: "Success: warning below 99%; critical below 95%." }),
|
|
2908
|
+
/* @__PURE__ */ j("p", { children: "Latency: critical when p95 exceeds 100 ms." }),
|
|
2909
|
+
/* @__PURE__ */ j("p", { children: "Reroutes are excluded from success and latency. Queue wait has no health threshold." })
|
|
2709
2910
|
] })]
|
|
2710
2911
|
});
|
|
2711
2912
|
}
|
|
2712
|
-
function
|
|
2713
|
-
return /* @__PURE__ */
|
|
2913
|
+
function sn({ page: e, range: t, saved: n }) {
|
|
2914
|
+
return /* @__PURE__ */ M("div", {
|
|
2714
2915
|
className: "overview-data-scope",
|
|
2715
2916
|
children: [
|
|
2716
|
-
/* @__PURE__ */
|
|
2717
|
-
!!e?.dropped && /* @__PURE__ */
|
|
2917
|
+
/* @__PURE__ */ j("p", { children: n ? `Request metrics cover every retained request ${H(t)}${t.kind === "relative" ? " (refreshed every 10 seconds)" : ""}. Inventory counts are current snapshots.` : `Request metrics cover the latest ${e?.capacity ?? 500} retained traces within the selected window. Inventory counts are current snapshots.` }),
|
|
2918
|
+
!!e?.dropped && /* @__PURE__ */ M("p", {
|
|
2718
2919
|
role: "alert",
|
|
2719
2920
|
children: [Z(e.dropped), " traces were not delivered. Request metrics are incomplete."]
|
|
2720
2921
|
}),
|
|
2721
|
-
e?.persistenceFailed && /* @__PURE__ */
|
|
2922
|
+
e?.persistenceFailed && /* @__PURE__ */ j("p", {
|
|
2722
2923
|
role: "alert",
|
|
2723
2924
|
children: "Some request events could not be saved. This history may be incomplete."
|
|
2724
2925
|
}),
|
|
2725
|
-
!!e?.evicted && /* @__PURE__ */
|
|
2926
|
+
!!e?.evicted && /* @__PURE__ */ j("p", { children: "Earlier traces have expired; these metrics do not represent the full time window." })
|
|
2726
2927
|
]
|
|
2727
2928
|
});
|
|
2728
2929
|
}
|
|
2729
|
-
function
|
|
2930
|
+
function cn(e) {
|
|
2730
2931
|
return {
|
|
2731
2932
|
actorName: e,
|
|
2732
2933
|
count: 0,
|
|
@@ -2738,23 +2939,23 @@ function Qt(e) {
|
|
|
2738
2939
|
function Z(e) {
|
|
2739
2940
|
return e === void 0 ? "—" : e.toLocaleString();
|
|
2740
2941
|
}
|
|
2741
|
-
function
|
|
2942
|
+
function ln(e) {
|
|
2742
2943
|
return e == null ? "—" : `${e.toLocaleString(void 0, { maximumFractionDigits: 1 })} ms`;
|
|
2743
2944
|
}
|
|
2744
2945
|
//#endregion
|
|
2745
2946
|
//#region src/socket-sessions.ts
|
|
2746
|
-
function
|
|
2747
|
-
if (!Array.isArray(e) || !e.every((e) => !!e && typeof e == "object" &&
|
|
2947
|
+
function un(e) {
|
|
2948
|
+
if (!Array.isArray(e) || !e.every((e) => !!e && typeof e == "object" && vn(e))) throw Error("Invalid WebSocket session response");
|
|
2748
2949
|
return e;
|
|
2749
2950
|
}
|
|
2750
|
-
function
|
|
2951
|
+
function dn(e, t, n) {
|
|
2751
2952
|
return JSON.stringify([
|
|
2752
2953
|
e,
|
|
2753
2954
|
t,
|
|
2754
2955
|
n
|
|
2755
2956
|
]);
|
|
2756
2957
|
}
|
|
2757
|
-
function
|
|
2958
|
+
function fn(e, t, n = /* @__PURE__ */ new Map()) {
|
|
2758
2959
|
let r = /* @__PURE__ */ new Map();
|
|
2759
2960
|
for (let e of t?.actors ?? []) for (let t of e.instances) for (let n of t.connections) r.set(JSON.stringify([
|
|
2760
2961
|
e.actorName,
|
|
@@ -2781,7 +2982,7 @@ function nn(e, t, n = /* @__PURE__ */ new Map()) {
|
|
|
2781
2982
|
e.connectionId
|
|
2782
2983
|
])));
|
|
2783
2984
|
for (let e of t?.actors ?? []) for (let t of e.instances) for (let r of t.connections) {
|
|
2784
|
-
let o =
|
|
2985
|
+
let o = dn(e.actorName, t.actorId, r.id);
|
|
2785
2986
|
if (a.has(o)) continue;
|
|
2786
2987
|
let s = n.get(o);
|
|
2787
2988
|
i.unshift({
|
|
@@ -2801,7 +3002,7 @@ function nn(e, t, n = /* @__PURE__ */ new Map()) {
|
|
|
2801
3002
|
}
|
|
2802
3003
|
return i;
|
|
2803
3004
|
}
|
|
2804
|
-
function
|
|
3005
|
+
function pn(e, t) {
|
|
2805
3006
|
if (e.openedAtMs === null) return null;
|
|
2806
3007
|
let n = e.status === "closed" ? e.closedAtMs : e.status === "open" ? Math.max(t, e.openedAtMs) : e.lastSeenMs;
|
|
2807
3008
|
return {
|
|
@@ -2809,19 +3010,19 @@ function rn(e, t) {
|
|
|
2809
3010
|
lowerBound: e.status === "lost"
|
|
2810
3011
|
};
|
|
2811
3012
|
}
|
|
2812
|
-
function
|
|
2813
|
-
let n = e.map((e) =>
|
|
3013
|
+
function mn(e, t) {
|
|
3014
|
+
let n = e.map((e) => pn(e, t)).filter((e) => e !== null && !e.lowerBound), r = e.reduce((e, t) => e + t.messages, 0);
|
|
2814
3015
|
return {
|
|
2815
3016
|
total: e.length,
|
|
2816
3017
|
open: e.filter((e) => e.status === "open").length,
|
|
2817
3018
|
lost: e.filter((e) => e.status === "lost").length,
|
|
2818
|
-
median:
|
|
2819
|
-
p95:
|
|
3019
|
+
median: _n(n.map((e) => e.ms), .5),
|
|
3020
|
+
p95: _n(n.map((e) => e.ms), .95),
|
|
2820
3021
|
messages: r,
|
|
2821
3022
|
messagesPerSession: e.length ? r / e.length : null
|
|
2822
3023
|
};
|
|
2823
3024
|
}
|
|
2824
|
-
function
|
|
3025
|
+
function hn(e) {
|
|
2825
3026
|
if (e < 1e3) return `${e.toLocaleString(void 0, { maximumFractionDigits: 0 })} ms`;
|
|
2826
3027
|
if (e < 6e4) return `${(e / 1e3).toLocaleString(void 0, { maximumFractionDigits: 1 })} s`;
|
|
2827
3028
|
let t = Math.floor(e / 6e4);
|
|
@@ -2829,7 +3030,7 @@ function on(e) {
|
|
|
2829
3030
|
let n = Math.floor(t / 60);
|
|
2830
3031
|
return n < 24 ? `${n}h ${t % 60}m` : `${Math.floor(n / 24)}d ${n % 24}h`;
|
|
2831
3032
|
}
|
|
2832
|
-
function
|
|
3033
|
+
function gn(e, t = 3) {
|
|
2833
3034
|
if (e == null) return null;
|
|
2834
3035
|
if (typeof e != "object") return String(e);
|
|
2835
3036
|
let n = Array.isArray(e) ? e.map((e, t) => [String(t), e]) : Object.entries(e);
|
|
@@ -2837,10 +3038,10 @@ function sn(e, t = 3) {
|
|
|
2837
3038
|
let r = n.slice(0, t).map(([e, t]) => `${e}: ${typeof t == "string" ? t : JSON.stringify(t)}`);
|
|
2838
3039
|
return n.length > t ? `${r.join(" · ")} · +${n.length - t}` : r.join(" · ");
|
|
2839
3040
|
}
|
|
2840
|
-
function
|
|
3041
|
+
function _n(e, t) {
|
|
2841
3042
|
return e.length ? e.sort((e, t) => e - t)[Math.max(0, Math.ceil(e.length * t) - 1)] : null;
|
|
2842
3043
|
}
|
|
2843
|
-
function
|
|
3044
|
+
function vn(e) {
|
|
2844
3045
|
return typeof e.connectionId == "string" && typeof e.actorName == "string" && typeof e.actorId == "string" && (e.hostId === null || typeof e.hostId == "string") && [
|
|
2845
3046
|
e.openedAtMs,
|
|
2846
3047
|
e.closedAtMs,
|
|
@@ -2849,7 +3050,7 @@ function ln(e) {
|
|
|
2849
3050
|
}
|
|
2850
3051
|
//#endregion
|
|
2851
3052
|
//#region src/SocketTimeline.tsx
|
|
2852
|
-
var
|
|
3053
|
+
var yn = 18, bn = 8, xn = 40, Q = 6e4, Sn = 60 * Q, Cn = 24 * Sn, wn = [
|
|
2853
3054
|
1e3,
|
|
2854
3055
|
2e3,
|
|
2855
3056
|
5e3,
|
|
@@ -2862,17 +3063,17 @@ var un = 18, dn = 8, fn = 40, Q = 6e4, pn = 60 * Q, mn = 24 * pn, hn = [
|
|
|
2862
3063
|
10 * Q,
|
|
2863
3064
|
15 * Q,
|
|
2864
3065
|
30 * Q,
|
|
2865
|
-
|
|
2866
|
-
2 *
|
|
2867
|
-
3 *
|
|
2868
|
-
6 *
|
|
2869
|
-
12 *
|
|
2870
|
-
|
|
2871
|
-
2 *
|
|
2872
|
-
7 *
|
|
3066
|
+
Sn,
|
|
3067
|
+
2 * Sn,
|
|
3068
|
+
3 * Sn,
|
|
3069
|
+
6 * Sn,
|
|
3070
|
+
12 * Sn,
|
|
3071
|
+
Cn,
|
|
3072
|
+
2 * Cn,
|
|
3073
|
+
7 * Cn
|
|
2873
3074
|
];
|
|
2874
|
-
function
|
|
2875
|
-
let [s, c] = a(), l =
|
|
3075
|
+
function Tn({ sessions: e, start: t, end: n, endLabel: r = "now", selected: i, onSelect: o }) {
|
|
3076
|
+
let [s, c] = a(), l = On(e, t, n), u = l.slice(0, xn), d = Math.max(1, n - t), f = Mn(t, n), p = Nn(d), m = (e) => `${(Math.min(Math.max(e, t), n) - t) / d * 100}%`, h = (e, t) => {
|
|
2876
3077
|
let n = t.getBoundingClientRect(), r = t.closest(".socket-timeline").getBoundingClientRect(), i = n.top - r.top < 150;
|
|
2877
3078
|
c({
|
|
2878
3079
|
session: e,
|
|
@@ -2881,50 +3082,50 @@ function gn({ sessions: e, start: t, end: n, endLabel: r = "now", selected: i, o
|
|
|
2881
3082
|
below: i
|
|
2882
3083
|
});
|
|
2883
3084
|
};
|
|
2884
|
-
return /* @__PURE__ */
|
|
3085
|
+
return /* @__PURE__ */ M("div", {
|
|
2885
3086
|
className: "socket-timeline",
|
|
2886
3087
|
role: "group",
|
|
2887
3088
|
"aria-label": "Connection timeline",
|
|
2888
3089
|
onMouseLeave: () => c(void 0),
|
|
2889
3090
|
children: [
|
|
2890
|
-
/* @__PURE__ */
|
|
3091
|
+
/* @__PURE__ */ M("div", {
|
|
2891
3092
|
className: "socket-timeline-axis",
|
|
2892
3093
|
"aria-hidden": "true",
|
|
2893
|
-
children: [/* @__PURE__ */
|
|
3094
|
+
children: [/* @__PURE__ */ j("span", {}), /* @__PURE__ */ M("div", { children: [f.map((e) => /* @__PURE__ */ j("span", {
|
|
2894
3095
|
style: { left: m(e) },
|
|
2895
|
-
children:
|
|
2896
|
-
}, e)), /* @__PURE__ */
|
|
3096
|
+
children: Pn(e, p)
|
|
3097
|
+
}, e)), /* @__PURE__ */ j("span", {
|
|
2897
3098
|
className: "socket-timeline-now",
|
|
2898
3099
|
children: r
|
|
2899
3100
|
})] })]
|
|
2900
3101
|
}),
|
|
2901
|
-
/* @__PURE__ */
|
|
3102
|
+
/* @__PURE__ */ M("div", {
|
|
2902
3103
|
className: "socket-timeline-body",
|
|
2903
3104
|
children: [
|
|
2904
|
-
/* @__PURE__ */
|
|
3105
|
+
/* @__PURE__ */ j("div", {
|
|
2905
3106
|
className: "socket-timeline-grid",
|
|
2906
3107
|
"aria-hidden": "true",
|
|
2907
|
-
children: f.map((e) => /* @__PURE__ */
|
|
3108
|
+
children: f.map((e) => /* @__PURE__ */ j("i", { style: { left: m(e) } }, e))
|
|
2908
3109
|
}),
|
|
2909
|
-
u.map((e) => /* @__PURE__ */
|
|
3110
|
+
u.map((e) => /* @__PURE__ */ M("div", {
|
|
2910
3111
|
className: "socket-timeline-row",
|
|
2911
|
-
children: [/* @__PURE__ */
|
|
3112
|
+
children: [/* @__PURE__ */ M("div", {
|
|
2912
3113
|
className: "socket-timeline-label",
|
|
2913
3114
|
title: `${e.actorName} / ${e.actorId}`,
|
|
2914
|
-
children: [/* @__PURE__ */
|
|
2915
|
-
}), /* @__PURE__ */
|
|
3115
|
+
children: [/* @__PURE__ */ j("span", { children: e.actorName }), /* @__PURE__ */ j("strong", { children: e.actorId })]
|
|
3116
|
+
}), /* @__PURE__ */ j("div", {
|
|
2916
3117
|
className: "socket-timeline-lanes",
|
|
2917
|
-
style: { height: e.rows.length *
|
|
2918
|
-
children: e.rows.flatMap((e, t) => e.map((e) => /* @__PURE__ */
|
|
3118
|
+
style: { height: e.rows.length * yn + 16 },
|
|
3119
|
+
children: e.rows.flatMap((e, t) => e.map((e) => /* @__PURE__ */ j("button", {
|
|
2919
3120
|
type: "button",
|
|
2920
3121
|
className: `socket-bar socket-bar-${e.session.status}${e.openEnded ? " socket-bar-open-ended" : ""}${e.unknownStart ? " socket-bar-unknown-start" : ""}`,
|
|
2921
3122
|
"data-state": i === e.session ? "selected" : void 0,
|
|
2922
3123
|
style: {
|
|
2923
3124
|
left: m(e.from),
|
|
2924
3125
|
width: `${(e.to - e.from) / d * 100}%`,
|
|
2925
|
-
top:
|
|
3126
|
+
top: bn + t * yn
|
|
2926
3127
|
},
|
|
2927
|
-
"aria-label":
|
|
3128
|
+
"aria-label": Rn(e.session, n),
|
|
2928
3129
|
onClick: (t) => o(e.session, t.currentTarget),
|
|
2929
3130
|
onMouseEnter: (t) => h(e.session, t.currentTarget),
|
|
2930
3131
|
onFocus: (t) => h(e.session, t.currentTarget),
|
|
@@ -2932,62 +3133,62 @@ function gn({ sessions: e, start: t, end: n, endLabel: r = "now", selected: i, o
|
|
|
2932
3133
|
}, e.session.connectionId)))
|
|
2933
3134
|
})]
|
|
2934
3135
|
}, e.key)),
|
|
2935
|
-
l.length >
|
|
3136
|
+
l.length > xn && /* @__PURE__ */ M("p", {
|
|
2936
3137
|
className: "socket-timeline-more",
|
|
2937
3138
|
children: [
|
|
2938
|
-
(l.length -
|
|
3139
|
+
(l.length - xn).toLocaleString(),
|
|
2939
3140
|
" more ",
|
|
2940
|
-
l.length -
|
|
3141
|
+
l.length - xn === 1 ? "instance is" : "instances are",
|
|
2941
3142
|
" listed in the table below."
|
|
2942
3143
|
]
|
|
2943
3144
|
})
|
|
2944
3145
|
]
|
|
2945
3146
|
}),
|
|
2946
|
-
s && /* @__PURE__ */
|
|
3147
|
+
s && /* @__PURE__ */ M("div", {
|
|
2947
3148
|
role: "tooltip",
|
|
2948
3149
|
className: `socket-tooltip${s.below ? " socket-tooltip-below" : ""}`,
|
|
2949
3150
|
style: {
|
|
2950
3151
|
left: s.left,
|
|
2951
3152
|
top: s.top
|
|
2952
3153
|
},
|
|
2953
|
-
children: [/* @__PURE__ */
|
|
2954
|
-
/* @__PURE__ */
|
|
2955
|
-
/* @__PURE__ */
|
|
2956
|
-
/* @__PURE__ */
|
|
2957
|
-
/* @__PURE__ */
|
|
3154
|
+
children: [/* @__PURE__ */ j(Dn, { metadata: s.session.metadata }), /* @__PURE__ */ M("dl", { children: [
|
|
3155
|
+
/* @__PURE__ */ j("dt", { children: "Connection" }),
|
|
3156
|
+
/* @__PURE__ */ j("dd", { children: Ln(s.session.connectionId) }),
|
|
3157
|
+
/* @__PURE__ */ j("dt", { children: "Instance" }),
|
|
3158
|
+
/* @__PURE__ */ M("dd", { children: [
|
|
2958
3159
|
s.session.actorName,
|
|
2959
3160
|
" / ",
|
|
2960
3161
|
s.session.actorId
|
|
2961
3162
|
] }),
|
|
2962
|
-
/* @__PURE__ */
|
|
2963
|
-
/* @__PURE__ */
|
|
2964
|
-
/* @__PURE__ */
|
|
2965
|
-
/* @__PURE__ */
|
|
2966
|
-
/* @__PURE__ */
|
|
2967
|
-
/* @__PURE__ */
|
|
2968
|
-
/* @__PURE__ */
|
|
2969
|
-
/* @__PURE__ */
|
|
3163
|
+
/* @__PURE__ */ j("dt", { children: "Status" }),
|
|
3164
|
+
/* @__PURE__ */ j("dd", { children: Fn(s.session.status) }),
|
|
3165
|
+
/* @__PURE__ */ j("dt", { children: "Opened" }),
|
|
3166
|
+
/* @__PURE__ */ j("dd", { children: s.session.openedAtMs === null ? "Before retained history" : `${s.session.estimatedStart ? "≈ " : ""}${new Date(s.session.openedAtMs).toLocaleTimeString([], { hour12: !1 })}` }),
|
|
3167
|
+
/* @__PURE__ */ j("dt", { children: "Duration" }),
|
|
3168
|
+
/* @__PURE__ */ j("dd", { children: In(s.session, n) }),
|
|
3169
|
+
/* @__PURE__ */ j("dt", { children: "Messages" }),
|
|
3170
|
+
/* @__PURE__ */ j("dd", { children: s.session.messages.toLocaleString() })
|
|
2970
3171
|
] })]
|
|
2971
3172
|
})
|
|
2972
3173
|
]
|
|
2973
3174
|
});
|
|
2974
3175
|
}
|
|
2975
|
-
var
|
|
2976
|
-
function
|
|
3176
|
+
var En = 4;
|
|
3177
|
+
function Dn({ metadata: e }) {
|
|
2977
3178
|
if (e == null) return null;
|
|
2978
3179
|
let t = typeof e == "object" ? Array.isArray(e) ? e.map((e, t) => [String(t), e]) : Object.entries(e) : [["value", e]];
|
|
2979
|
-
return t.length ? /* @__PURE__ */
|
|
3180
|
+
return t.length ? /* @__PURE__ */ M("dl", {
|
|
2980
3181
|
className: "socket-tooltip-metadata",
|
|
2981
3182
|
"aria-label": "Connection metadata",
|
|
2982
|
-
children: [t.slice(0,
|
|
3183
|
+
children: [t.slice(0, En).map(([e, t]) => /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("dt", { children: e }), /* @__PURE__ */ j("dd", { children: typeof t == "string" ? t : JSON.stringify(t) })] }, e)), t.length > En && /* @__PURE__ */ M("p", { children: [
|
|
2983
3184
|
"+",
|
|
2984
|
-
t.length -
|
|
3185
|
+
t.length - En,
|
|
2985
3186
|
" more in details"
|
|
2986
3187
|
] })]
|
|
2987
3188
|
}) : null;
|
|
2988
3189
|
}
|
|
2989
|
-
function
|
|
2990
|
-
let r = /* @__PURE__ */ new Map(), i = e.map((e) =>
|
|
3190
|
+
function On(e, t, n) {
|
|
3191
|
+
let r = /* @__PURE__ */ new Map(), i = e.map((e) => kn(e, t, n)).filter((e) => e.to > t).sort((e, t) => e.from - t.from || e.to - t.to);
|
|
2991
3192
|
for (let e of i) {
|
|
2992
3193
|
let i = `${e.session.actorName}${e.session.actorId}`, a = r.get(i) ?? {
|
|
2993
3194
|
key: i,
|
|
@@ -2996,38 +3197,38 @@ function yn(e, t, n) {
|
|
|
2996
3197
|
rows: []
|
|
2997
3198
|
};
|
|
2998
3199
|
r.set(i, a);
|
|
2999
|
-
let o = a.rows.find((r) => r.at(-1).to +
|
|
3200
|
+
let o = a.rows.find((r) => r.at(-1).to + An(t, n) <= e.from);
|
|
3000
3201
|
o ? o.push(e) : a.rows.push([e]);
|
|
3001
3202
|
}
|
|
3002
|
-
return [...r.values()].sort((e, t) =>
|
|
3203
|
+
return [...r.values()].sort((e, t) => jn(t) - jn(e));
|
|
3003
3204
|
}
|
|
3004
|
-
function
|
|
3205
|
+
function kn(e, t, n) {
|
|
3005
3206
|
let r = e.openedAtMs ?? (e.status === "open" ? t : e.lastSeenMs ?? t), i = e.status === "closed" ? e.closedAtMs : e.status === "open" ? n : e.lastSeenMs ?? r;
|
|
3006
3207
|
return {
|
|
3007
3208
|
session: e,
|
|
3008
3209
|
from: Math.max(t, r),
|
|
3009
|
-
to: Math.max(Math.max(t, r) +
|
|
3210
|
+
to: Math.max(Math.max(t, r) + An(t, n), Math.min(n, i)),
|
|
3010
3211
|
openEnded: e.status !== "closed",
|
|
3011
3212
|
unknownStart: e.openedAtMs === null
|
|
3012
3213
|
};
|
|
3013
3214
|
}
|
|
3014
|
-
function
|
|
3215
|
+
function An(e, t) {
|
|
3015
3216
|
return Math.max(1, (t - e) / 160);
|
|
3016
3217
|
}
|
|
3017
|
-
function
|
|
3218
|
+
function jn(e) {
|
|
3018
3219
|
return Math.max(...e.rows.flat().map((e) => e.to));
|
|
3019
3220
|
}
|
|
3020
|
-
function
|
|
3021
|
-
let n =
|
|
3221
|
+
function Mn(e, t) {
|
|
3222
|
+
let n = Nn(Math.max(1, t - e)), r = [];
|
|
3022
3223
|
for (let i = Math.floor(e / n) * n + n; i < t - n * .35; i += n) r.push(i);
|
|
3023
3224
|
return r;
|
|
3024
3225
|
}
|
|
3025
|
-
function
|
|
3026
|
-
return
|
|
3226
|
+
function Nn(e) {
|
|
3227
|
+
return wn.find((t) => e / t <= 9) ?? wn.at(-1);
|
|
3027
3228
|
}
|
|
3028
|
-
function
|
|
3229
|
+
function Pn(e, t) {
|
|
3029
3230
|
let n = new Date(e);
|
|
3030
|
-
return t >=
|
|
3231
|
+
return t >= Cn ? n.toLocaleDateString([], {
|
|
3031
3232
|
month: "short",
|
|
3032
3233
|
day: "numeric"
|
|
3033
3234
|
}) : t >= Q ? n.toLocaleTimeString([], {
|
|
@@ -3036,24 +3237,24 @@ function Tn(e, t) {
|
|
|
3036
3237
|
hour12: !1
|
|
3037
3238
|
}) : n.toLocaleTimeString([], { hour12: !1 });
|
|
3038
3239
|
}
|
|
3039
|
-
function
|
|
3240
|
+
function Fn(e) {
|
|
3040
3241
|
return e === "open" ? "Open" : e === "closed" ? "Closed" : "Lost";
|
|
3041
3242
|
}
|
|
3042
|
-
function
|
|
3043
|
-
let n =
|
|
3044
|
-
return n ? `${n.lowerBound ? "≥ " : ""}${
|
|
3243
|
+
function In(e, t) {
|
|
3244
|
+
let n = pn(e, t);
|
|
3245
|
+
return n ? `${n.lowerBound ? "≥ " : ""}${hn(n.ms)}` : "Unknown";
|
|
3045
3246
|
}
|
|
3046
|
-
function
|
|
3247
|
+
function Ln(e) {
|
|
3047
3248
|
return e.length > 14 ? `${e.slice(0, 8)}…${e.slice(-4)}` : e;
|
|
3048
3249
|
}
|
|
3049
|
-
function
|
|
3050
|
-
let n =
|
|
3051
|
-
return `${
|
|
3250
|
+
function Rn(e, t) {
|
|
3251
|
+
let n = gn(e.metadata);
|
|
3252
|
+
return `${Fn(e.status)} connection ${Ln(e.connectionId)}${n === null ? "" : ` (${n})`} on ${e.actorName} ${e.actorId}, ${In(e, t)}`;
|
|
3052
3253
|
}
|
|
3053
3254
|
//#endregion
|
|
3054
3255
|
//#region src/socket-history.ts
|
|
3055
|
-
function
|
|
3056
|
-
let n =
|
|
3256
|
+
function zn(e, t) {
|
|
3257
|
+
let n = it(e, t, e.listWebSockets, 5e3);
|
|
3057
3258
|
return {
|
|
3058
3259
|
...n,
|
|
3059
3260
|
rows: n.value,
|
|
@@ -3062,52 +3263,52 @@ function An(e, t) {
|
|
|
3062
3263
|
}
|
|
3063
3264
|
//#endregion
|
|
3064
3265
|
//#region src/WebSocketObserver.tsx
|
|
3065
|
-
function
|
|
3066
|
-
let { inventory: c, failed: l, retry: u } =
|
|
3266
|
+
function Bn({ client: e, onSelectActor: n, timeRange: o, onTimeRangeChange: s }) {
|
|
3267
|
+
let { inventory: c, failed: l, retry: u } = tt(e), [d, f] = a(Fe), p = o ?? d, m = s ?? f, [h, g] = a(Date.now), [_, v] = a(""), [y, ee] = a("all"), [b, x] = a(), S = i(null), C = i(null);
|
|
3067
3268
|
t(() => {
|
|
3068
3269
|
let e = setInterval(() => g(Date.now()), 5e3);
|
|
3069
3270
|
return () => clearInterval(e);
|
|
3070
3271
|
}, []);
|
|
3071
|
-
let
|
|
3072
|
-
|
|
3272
|
+
let w = Ie(p, h), T = w.toMs ?? h, E = zn(e, w), D = Gn(c, E.retry), O = r(() => fn(E.rows ?? [], c, D), [
|
|
3273
|
+
E.rows,
|
|
3073
3274
|
c,
|
|
3074
|
-
|
|
3075
|
-
]),
|
|
3076
|
-
return t(() =>
|
|
3077
|
-
ref:
|
|
3275
|
+
D
|
|
3276
|
+
]), k = !!c || l, N = _.trim().toLocaleLowerCase(), P = O.filter((e) => (y === "all" || e.status === y) && (!N || `${e.connectionId} ${e.actorName} ${e.actorId} ${e.hostId ?? ""}`.toLocaleLowerCase().includes(N))).sort((e, t) => Number(t.status === "open") - Number(e.status === "open") || (t.openedAtMs ?? t.lastSeenMs ?? Infinity) - (e.openedAtMs ?? e.lastSeenMs ?? Infinity)), F = mn(O, h), I = Math.max(0, ...O.filter((e) => e.status !== "open").map((e) => pn(e, h)?.ms ?? 0)) || F.p95, ne = Wn(P, w.fromMs, T), L = r(() => Kn(O, c), [O, c]);
|
|
3277
|
+
return t(() => x(void 0), [e, p]), /* @__PURE__ */ M("section", {
|
|
3278
|
+
ref: S,
|
|
3078
3279
|
className: "la-observer overview websockets",
|
|
3079
3280
|
"aria-label": "WebSocket observer",
|
|
3080
3281
|
children: [
|
|
3081
|
-
/* @__PURE__ */
|
|
3282
|
+
/* @__PURE__ */ M("div", {
|
|
3082
3283
|
className: "overview-heading",
|
|
3083
|
-
children: [/* @__PURE__ */
|
|
3284
|
+
children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("h1", { children: "WebSockets" }), /* @__PURE__ */ j("p", { children: k ? `${F.open.toLocaleString()} open now${E.supported ? ` · ${F.total.toLocaleString()} ${F.total === 1 ? "session" : "sessions"} ${H(p)}` : ""}` : "Connecting to inventory…" })] }), /* @__PURE__ */ M("div", {
|
|
3084
3285
|
className: "overview-controls",
|
|
3085
3286
|
children: [
|
|
3086
|
-
/* @__PURE__ */
|
|
3287
|
+
/* @__PURE__ */ j("span", {
|
|
3087
3288
|
className: "overview-updated",
|
|
3088
|
-
children:
|
|
3089
|
-
dateTime: new Date(
|
|
3090
|
-
children: new Date(
|
|
3289
|
+
children: E.failed ? "History reconnecting…" : E.updatedAt ? /* @__PURE__ */ M(A, { children: ["Updated ", /* @__PURE__ */ j("time", {
|
|
3290
|
+
dateTime: new Date(E.updatedAt).toISOString(),
|
|
3291
|
+
children: new Date(E.updatedAt).toLocaleTimeString([], { hour12: !1 })
|
|
3091
3292
|
})] }) : null
|
|
3092
3293
|
}),
|
|
3093
|
-
|
|
3294
|
+
E.supported && /* @__PURE__ */ j(Be, {
|
|
3094
3295
|
value: p,
|
|
3095
3296
|
onChange: m,
|
|
3096
3297
|
className: "overview-range"
|
|
3097
3298
|
}),
|
|
3098
|
-
/* @__PURE__ */
|
|
3299
|
+
/* @__PURE__ */ j(B, {
|
|
3099
3300
|
variant: "outline",
|
|
3100
3301
|
size: "icon",
|
|
3101
3302
|
"aria-label": "Refresh connections",
|
|
3102
3303
|
onClick: () => {
|
|
3103
|
-
u(),
|
|
3304
|
+
u(), E.retry();
|
|
3104
3305
|
},
|
|
3105
|
-
children: /* @__PURE__ */
|
|
3306
|
+
children: /* @__PURE__ */ j(te, { "aria-hidden": "true" })
|
|
3106
3307
|
})
|
|
3107
3308
|
]
|
|
3108
3309
|
})]
|
|
3109
3310
|
}),
|
|
3110
|
-
l && /* @__PURE__ */
|
|
3311
|
+
l && /* @__PURE__ */ M("p", {
|
|
3111
3312
|
role: "alert",
|
|
3112
3313
|
className: "overview-alert",
|
|
3113
3314
|
children: [
|
|
@@ -3117,90 +3318,90 @@ function jn({ client: e, onSelectActor: n, timeRange: o, onTimeRangeChange: s })
|
|
|
3117
3318
|
" Retrying automatically."
|
|
3118
3319
|
]
|
|
3119
3320
|
}),
|
|
3120
|
-
|
|
3321
|
+
E.failed && /* @__PURE__ */ M("p", {
|
|
3121
3322
|
role: "alert",
|
|
3122
3323
|
className: "overview-alert",
|
|
3123
3324
|
children: [
|
|
3124
3325
|
"Connection history unavailable. ",
|
|
3125
|
-
|
|
3326
|
+
E.rows ? "Showing the last loaded sessions." : "Only currently open connections are shown.",
|
|
3126
3327
|
" Retrying automatically."
|
|
3127
3328
|
]
|
|
3128
3329
|
}),
|
|
3129
|
-
/* @__PURE__ */
|
|
3130
|
-
summary:
|
|
3131
|
-
ready:
|
|
3132
|
-
history:
|
|
3330
|
+
/* @__PURE__ */ j(Vn, {
|
|
3331
|
+
summary: F,
|
|
3332
|
+
ready: k,
|
|
3333
|
+
history: E.supported && !!E.rows,
|
|
3133
3334
|
range: p
|
|
3134
3335
|
}),
|
|
3135
|
-
/* @__PURE__ */
|
|
3336
|
+
/* @__PURE__ */ M("div", {
|
|
3136
3337
|
className: "socket-filterbar",
|
|
3137
|
-
children: [/* @__PURE__ */
|
|
3338
|
+
children: [/* @__PURE__ */ j(ge, {
|
|
3138
3339
|
label: "Filter connections",
|
|
3139
3340
|
placeholder: "Filter by connection, actor, instance, or host…",
|
|
3140
3341
|
value: _,
|
|
3141
3342
|
onChange: v,
|
|
3142
|
-
suggestions:
|
|
3143
|
-
}), /* @__PURE__ */
|
|
3343
|
+
suggestions: L
|
|
3344
|
+
}), /* @__PURE__ */ M(Je, {
|
|
3144
3345
|
"aria-label": "Filter by status",
|
|
3145
3346
|
size: "sm",
|
|
3146
3347
|
value: y,
|
|
3147
|
-
onChange: (e) =>
|
|
3348
|
+
onChange: (e) => ee(e.target.value),
|
|
3148
3349
|
children: [
|
|
3149
|
-
/* @__PURE__ */
|
|
3350
|
+
/* @__PURE__ */ j(W, {
|
|
3150
3351
|
value: "all",
|
|
3151
3352
|
children: "All statuses"
|
|
3152
3353
|
}),
|
|
3153
|
-
/* @__PURE__ */
|
|
3354
|
+
/* @__PURE__ */ j(W, {
|
|
3154
3355
|
value: "open",
|
|
3155
3356
|
children: "Open"
|
|
3156
3357
|
}),
|
|
3157
|
-
/* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ j(W, {
|
|
3158
3359
|
value: "closed",
|
|
3159
3360
|
children: "Closed"
|
|
3160
3361
|
}),
|
|
3161
|
-
/* @__PURE__ */
|
|
3362
|
+
/* @__PURE__ */ j(W, {
|
|
3162
3363
|
value: "lost",
|
|
3163
3364
|
children: "Lost"
|
|
3164
3365
|
})
|
|
3165
3366
|
]
|
|
3166
3367
|
})]
|
|
3167
3368
|
}),
|
|
3168
|
-
|
|
3369
|
+
E.supported && /* @__PURE__ */ M("section", {
|
|
3169
3370
|
className: "overview-panel socket-timeline-panel",
|
|
3170
3371
|
"aria-label": "Connection timeline",
|
|
3171
|
-
children: [/* @__PURE__ */
|
|
3372
|
+
children: [/* @__PURE__ */ M("div", {
|
|
3172
3373
|
className: "socket-panel-heading",
|
|
3173
|
-
children: [/* @__PURE__ */
|
|
3374
|
+
children: [/* @__PURE__ */ M("h2", { children: ["Timeline ", /* @__PURE__ */ j("span", { children: P.length.toLocaleString() })] }), /* @__PURE__ */ M("ul", {
|
|
3174
3375
|
className: "socket-legend",
|
|
3175
3376
|
"aria-label": "Timeline legend",
|
|
3176
3377
|
children: [
|
|
3177
|
-
/* @__PURE__ */
|
|
3178
|
-
/* @__PURE__ */
|
|
3179
|
-
/* @__PURE__ */
|
|
3378
|
+
/* @__PURE__ */ M("li", { children: [/* @__PURE__ */ j("i", { className: "socket-swatch socket-swatch-open" }), " Open"] }),
|
|
3379
|
+
/* @__PURE__ */ M("li", { children: [/* @__PURE__ */ j("i", { className: "socket-swatch socket-swatch-closed" }), " Closed"] }),
|
|
3380
|
+
/* @__PURE__ */ M("li", { children: [/* @__PURE__ */ j("i", { className: "socket-swatch socket-swatch-lost" }), " Lost · no disconnect recorded"] })
|
|
3180
3381
|
]
|
|
3181
3382
|
})]
|
|
3182
|
-
}),
|
|
3183
|
-
sessions:
|
|
3184
|
-
start:
|
|
3185
|
-
end:
|
|
3186
|
-
endLabel:
|
|
3383
|
+
}), P.length ? /* @__PURE__ */ j(Tn, {
|
|
3384
|
+
sessions: P,
|
|
3385
|
+
start: ne,
|
|
3386
|
+
end: T,
|
|
3387
|
+
endLabel: w.toMs === void 0 ? "now" : new Date(w.toMs).toLocaleTimeString([], {
|
|
3187
3388
|
hour: "2-digit",
|
|
3188
3389
|
minute: "2-digit",
|
|
3189
3390
|
hour12: !1
|
|
3190
3391
|
}),
|
|
3191
|
-
selected:
|
|
3392
|
+
selected: b,
|
|
3192
3393
|
onSelect: (e, t) => {
|
|
3193
|
-
|
|
3394
|
+
C.current = t, x(e);
|
|
3194
3395
|
}
|
|
3195
|
-
}) : /* @__PURE__ */
|
|
3396
|
+
}) : /* @__PURE__ */ M("div", {
|
|
3196
3397
|
className: "overview-empty socket-timeline-empty",
|
|
3197
3398
|
role: "status",
|
|
3198
|
-
children: [/* @__PURE__ */
|
|
3399
|
+
children: [/* @__PURE__ */ j("strong", { children: qn(k, E, O.length) }), /* @__PURE__ */ j("p", { children: O.length ? "Try another filter or a wider time window." : "Sessions appear here as clients connect to actors." })]
|
|
3199
3400
|
})]
|
|
3200
3401
|
}),
|
|
3201
|
-
/* @__PURE__ */
|
|
3402
|
+
/* @__PURE__ */ M("div", {
|
|
3202
3403
|
className: "overview-panel",
|
|
3203
|
-
children: [/* @__PURE__ */
|
|
3404
|
+
children: [/* @__PURE__ */ M(G, {
|
|
3204
3405
|
className: "overview-table socket-table",
|
|
3205
3406
|
"aria-label": "WebSocket connections",
|
|
3206
3407
|
containerProps: {
|
|
@@ -3209,87 +3410,87 @@ function jn({ client: e, onSelectActor: n, timeRange: o, onTimeRangeChange: s })
|
|
|
3209
3410
|
"aria-label": "WebSocket connections",
|
|
3210
3411
|
tabIndex: 0
|
|
3211
3412
|
},
|
|
3212
|
-
children: [/* @__PURE__ */
|
|
3213
|
-
/* @__PURE__ */
|
|
3413
|
+
children: [/* @__PURE__ */ j(K, { children: /* @__PURE__ */ M(J, { children: [
|
|
3414
|
+
/* @__PURE__ */ j(Y, {
|
|
3214
3415
|
scope: "col",
|
|
3215
3416
|
children: "Status"
|
|
3216
3417
|
}),
|
|
3217
|
-
/* @__PURE__ */
|
|
3418
|
+
/* @__PURE__ */ j(Y, {
|
|
3218
3419
|
scope: "col",
|
|
3219
3420
|
children: "Connection"
|
|
3220
3421
|
}),
|
|
3221
|
-
/* @__PURE__ */
|
|
3422
|
+
/* @__PURE__ */ j(Y, {
|
|
3222
3423
|
scope: "col",
|
|
3223
3424
|
children: "Actor class"
|
|
3224
3425
|
}),
|
|
3225
|
-
/* @__PURE__ */
|
|
3426
|
+
/* @__PURE__ */ j(Y, {
|
|
3226
3427
|
scope: "col",
|
|
3227
3428
|
children: "Instance"
|
|
3228
3429
|
}),
|
|
3229
|
-
/* @__PURE__ */
|
|
3430
|
+
/* @__PURE__ */ j(Y, {
|
|
3230
3431
|
scope: "col",
|
|
3231
3432
|
children: "Opened"
|
|
3232
3433
|
}),
|
|
3233
|
-
/* @__PURE__ */
|
|
3434
|
+
/* @__PURE__ */ j(Y, {
|
|
3234
3435
|
scope: "col",
|
|
3235
3436
|
children: "Duration"
|
|
3236
3437
|
}),
|
|
3237
|
-
/* @__PURE__ */
|
|
3438
|
+
/* @__PURE__ */ j(Y, {
|
|
3238
3439
|
scope: "col",
|
|
3239
3440
|
children: "Messages"
|
|
3240
3441
|
}),
|
|
3241
|
-
/* @__PURE__ */
|
|
3442
|
+
/* @__PURE__ */ j(Y, {
|
|
3242
3443
|
scope: "col",
|
|
3243
3444
|
children: "Metadata"
|
|
3244
3445
|
})
|
|
3245
|
-
] }) }), /* @__PURE__ */
|
|
3446
|
+
] }) }), /* @__PURE__ */ j(q, { children: P.map((e) => /* @__PURE__ */ j(Hn, {
|
|
3246
3447
|
session: e,
|
|
3247
3448
|
now: h,
|
|
3248
|
-
longest:
|
|
3249
|
-
selected:
|
|
3449
|
+
longest: I,
|
|
3450
|
+
selected: b === e,
|
|
3250
3451
|
onSelect: (t) => {
|
|
3251
|
-
|
|
3452
|
+
C.current = t, x(e);
|
|
3252
3453
|
}
|
|
3253
3454
|
}, JSON.stringify([
|
|
3254
3455
|
e.actorName,
|
|
3255
3456
|
e.actorId,
|
|
3256
3457
|
e.connectionId
|
|
3257
3458
|
]))) })]
|
|
3258
|
-
}), !
|
|
3459
|
+
}), !P.length && /* @__PURE__ */ M("div", {
|
|
3259
3460
|
className: "overview-empty",
|
|
3260
3461
|
role: "status",
|
|
3261
3462
|
children: [
|
|
3262
|
-
/* @__PURE__ */
|
|
3263
|
-
/* @__PURE__ */
|
|
3264
|
-
!!
|
|
3463
|
+
/* @__PURE__ */ j("strong", { children: qn(k, E, O.length) }),
|
|
3464
|
+
/* @__PURE__ */ j("p", { children: O.length ? "Try another connection, actor, or status." : "Open an actor WebSocket to see its connection and metadata here." }),
|
|
3465
|
+
!!O.length && /* @__PURE__ */ j(B, {
|
|
3265
3466
|
variant: "outline",
|
|
3266
3467
|
onClick: () => {
|
|
3267
|
-
v(""),
|
|
3468
|
+
v(""), ee("all");
|
|
3268
3469
|
},
|
|
3269
3470
|
children: "Clear filter"
|
|
3270
3471
|
})
|
|
3271
3472
|
]
|
|
3272
3473
|
})]
|
|
3273
3474
|
}),
|
|
3274
|
-
/* @__PURE__ */
|
|
3475
|
+
/* @__PURE__ */ j("div", {
|
|
3275
3476
|
className: "overview-data-scope",
|
|
3276
|
-
children: /* @__PURE__ */
|
|
3477
|
+
children: /* @__PURE__ */ j("p", { children: E.supported ? `Sessions pair each connection’s onConnect and onDisconnect events from retained request history${E.capped ? "; only the 500 most recent sessions are shown" : ""}. Open connections follow the latest host report. Lost connections have no recorded disconnect and are no longer reported by a host, so their duration is a lower bound.` : "Connections are active WebSockets, not unique people. Counts follow the latest host report." })
|
|
3277
3478
|
}),
|
|
3278
|
-
/* @__PURE__ */
|
|
3279
|
-
open: !!
|
|
3479
|
+
/* @__PURE__ */ j(Ye, {
|
|
3480
|
+
open: !!b,
|
|
3280
3481
|
onOpenChange: (e) => {
|
|
3281
|
-
e ||
|
|
3482
|
+
e || x(void 0);
|
|
3282
3483
|
},
|
|
3283
|
-
children: /* @__PURE__ */
|
|
3284
|
-
container:
|
|
3484
|
+
children: /* @__PURE__ */ M(Qe, {
|
|
3485
|
+
container: S.current,
|
|
3285
3486
|
onCloseAutoFocus: (e) => {
|
|
3286
|
-
e.preventDefault(),
|
|
3487
|
+
e.preventDefault(), C.current?.focus();
|
|
3287
3488
|
},
|
|
3288
3489
|
children: [
|
|
3289
|
-
/* @__PURE__ */
|
|
3290
|
-
/* @__PURE__ */
|
|
3291
|
-
|
|
3292
|
-
session:
|
|
3490
|
+
/* @__PURE__ */ j(Xe, { children: "Connection details" }),
|
|
3491
|
+
/* @__PURE__ */ j(Ze, { children: "Identifiers, timings, and metadata for this WebSocket." }),
|
|
3492
|
+
b && /* @__PURE__ */ j(Un, {
|
|
3493
|
+
session: b,
|
|
3293
3494
|
now: h,
|
|
3294
3495
|
onSelectActor: n
|
|
3295
3496
|
})
|
|
@@ -3299,131 +3500,131 @@ function jn({ client: e, onSelectActor: n, timeRange: o, onTimeRangeChange: s })
|
|
|
3299
3500
|
]
|
|
3300
3501
|
});
|
|
3301
3502
|
}
|
|
3302
|
-
function
|
|
3303
|
-
return /* @__PURE__ */
|
|
3503
|
+
function Vn({ summary: e, ready: t, history: n, range: r }) {
|
|
3504
|
+
return /* @__PURE__ */ M("div", {
|
|
3304
3505
|
className: "overview-metrics socket-metrics",
|
|
3305
3506
|
children: [
|
|
3306
|
-
/* @__PURE__ */
|
|
3507
|
+
/* @__PURE__ */ M("section", {
|
|
3307
3508
|
className: "overview-metric",
|
|
3308
3509
|
children: [
|
|
3309
|
-
/* @__PURE__ */
|
|
3310
|
-
/* @__PURE__ */
|
|
3510
|
+
/* @__PURE__ */ j("h2", { children: "Open now" }),
|
|
3511
|
+
/* @__PURE__ */ M("div", {
|
|
3311
3512
|
className: "overview-value",
|
|
3312
|
-
children: [/* @__PURE__ */
|
|
3513
|
+
children: [/* @__PURE__ */ j("strong", {
|
|
3313
3514
|
"aria-label": "Open WebSocket connections",
|
|
3314
3515
|
children: t ? e.open.toLocaleString() : "—"
|
|
3315
|
-
}), /* @__PURE__ */
|
|
3516
|
+
}), /* @__PURE__ */ j("span", { children: "live connections" })]
|
|
3316
3517
|
}),
|
|
3317
|
-
/* @__PURE__ */
|
|
3518
|
+
/* @__PURE__ */ j("div", {
|
|
3318
3519
|
className: "overview-metric-foot",
|
|
3319
|
-
children: /* @__PURE__ */
|
|
3520
|
+
children: /* @__PURE__ */ j("span", { children: "Latest host report" })
|
|
3320
3521
|
})
|
|
3321
3522
|
]
|
|
3322
3523
|
}),
|
|
3323
|
-
/* @__PURE__ */
|
|
3524
|
+
/* @__PURE__ */ M("section", {
|
|
3324
3525
|
className: "overview-metric",
|
|
3325
3526
|
children: [
|
|
3326
|
-
/* @__PURE__ */
|
|
3327
|
-
/* @__PURE__ */
|
|
3527
|
+
/* @__PURE__ */ j("h2", { children: "Sessions" }),
|
|
3528
|
+
/* @__PURE__ */ M("div", {
|
|
3328
3529
|
className: "overview-value",
|
|
3329
|
-
children: [/* @__PURE__ */
|
|
3530
|
+
children: [/* @__PURE__ */ j("strong", {
|
|
3330
3531
|
"aria-label": "WebSocket sessions",
|
|
3331
3532
|
children: n ? e.total.toLocaleString() : "—"
|
|
3332
|
-
}), /* @__PURE__ */
|
|
3533
|
+
}), /* @__PURE__ */ j("span", { children: r.kind === "absolute" ? Le(r) : H(r) })]
|
|
3333
3534
|
}),
|
|
3334
|
-
/* @__PURE__ */
|
|
3535
|
+
/* @__PURE__ */ M("div", {
|
|
3335
3536
|
className: "overview-metric-foot",
|
|
3336
|
-
children: [/* @__PURE__ */
|
|
3537
|
+
children: [/* @__PURE__ */ M("span", { children: [/* @__PURE__ */ j("b", { children: n ? (e.total - e.open - e.lost).toLocaleString() : "—" }), " closed"] }), /* @__PURE__ */ M("span", { children: [/* @__PURE__ */ j("b", { children: n ? e.lost.toLocaleString() : "—" }), " lost"] })]
|
|
3337
3538
|
})
|
|
3338
3539
|
]
|
|
3339
3540
|
}),
|
|
3340
|
-
/* @__PURE__ */
|
|
3541
|
+
/* @__PURE__ */ M("section", {
|
|
3341
3542
|
className: "overview-metric",
|
|
3342
3543
|
children: [
|
|
3343
|
-
/* @__PURE__ */
|
|
3344
|
-
/* @__PURE__ */
|
|
3544
|
+
/* @__PURE__ */ j("h2", { children: "Session duration" }),
|
|
3545
|
+
/* @__PURE__ */ M("div", {
|
|
3345
3546
|
className: "overview-value",
|
|
3346
|
-
children: [/* @__PURE__ */
|
|
3547
|
+
children: [/* @__PURE__ */ j("strong", {
|
|
3347
3548
|
"aria-label": "Median session duration",
|
|
3348
|
-
children: n && e.median !== null ?
|
|
3349
|
-
}), /* @__PURE__ */
|
|
3549
|
+
children: n && e.median !== null ? hn(e.median) : "—"
|
|
3550
|
+
}), /* @__PURE__ */ j("span", { children: "median" })]
|
|
3350
3551
|
}),
|
|
3351
|
-
/* @__PURE__ */
|
|
3552
|
+
/* @__PURE__ */ M("div", {
|
|
3352
3553
|
className: "overview-metric-foot",
|
|
3353
|
-
children: [/* @__PURE__ */
|
|
3554
|
+
children: [/* @__PURE__ */ M("span", { children: [/* @__PURE__ */ j("b", { children: n && e.p95 !== null ? hn(e.p95) : "—" }), " p95"] }), /* @__PURE__ */ j("span", { children: "Open sessions count up to now" })]
|
|
3354
3555
|
})
|
|
3355
3556
|
]
|
|
3356
3557
|
}),
|
|
3357
|
-
/* @__PURE__ */
|
|
3558
|
+
/* @__PURE__ */ M("section", {
|
|
3358
3559
|
className: "overview-metric",
|
|
3359
3560
|
children: [
|
|
3360
|
-
/* @__PURE__ */
|
|
3361
|
-
/* @__PURE__ */
|
|
3561
|
+
/* @__PURE__ */ j("h2", { children: "Messages" }),
|
|
3562
|
+
/* @__PURE__ */ M("div", {
|
|
3362
3563
|
className: "overview-value",
|
|
3363
|
-
children: [/* @__PURE__ */
|
|
3564
|
+
children: [/* @__PURE__ */ j("strong", {
|
|
3364
3565
|
"aria-label": "WebSocket messages",
|
|
3365
3566
|
children: n ? e.messages.toLocaleString() : "—"
|
|
3366
|
-
}), /* @__PURE__ */
|
|
3567
|
+
}), /* @__PURE__ */ j("span", { children: "received" })]
|
|
3367
3568
|
}),
|
|
3368
|
-
/* @__PURE__ */
|
|
3569
|
+
/* @__PURE__ */ j("div", {
|
|
3369
3570
|
className: "overview-metric-foot",
|
|
3370
|
-
children: /* @__PURE__ */
|
|
3571
|
+
children: /* @__PURE__ */ M("span", { children: [/* @__PURE__ */ j("b", { children: n && e.messagesPerSession !== null ? e.messagesPerSession.toLocaleString(void 0, { maximumFractionDigits: 1 }) : "—" }), " per session"] })
|
|
3371
3572
|
})
|
|
3372
3573
|
]
|
|
3373
3574
|
})
|
|
3374
3575
|
]
|
|
3375
3576
|
});
|
|
3376
3577
|
}
|
|
3377
|
-
function
|
|
3378
|
-
let a =
|
|
3379
|
-
return /* @__PURE__ */
|
|
3578
|
+
function Hn({ session: e, now: t, longest: n, selected: r, onSelect: i }) {
|
|
3579
|
+
let a = pn(e, t), o = a && n ? Math.min(1, a.ms / n) : 0;
|
|
3580
|
+
return /* @__PURE__ */ M(J, {
|
|
3380
3581
|
className: "la-clickable-row",
|
|
3381
3582
|
"data-state": r ? "selected" : void 0,
|
|
3382
3583
|
onClick: (e) => i(e.currentTarget.querySelector("button") ?? e.currentTarget),
|
|
3383
3584
|
children: [
|
|
3384
|
-
/* @__PURE__ */
|
|
3585
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ M("span", {
|
|
3385
3586
|
className: `socket-status socket-status-${e.status}`,
|
|
3386
|
-
children: [/* @__PURE__ */
|
|
3587
|
+
children: [/* @__PURE__ */ j("i", {
|
|
3387
3588
|
className: `socket-swatch socket-swatch-${e.status}`,
|
|
3388
3589
|
"aria-hidden": "true"
|
|
3389
|
-
}),
|
|
3590
|
+
}), Fn(e.status)]
|
|
3390
3591
|
}) }),
|
|
3391
|
-
/* @__PURE__ */
|
|
3592
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ j("button", {
|
|
3392
3593
|
type: "button",
|
|
3393
3594
|
className: "socket-connection",
|
|
3394
3595
|
title: e.connectionId,
|
|
3395
3596
|
"aria-label": `Inspect connection ${e.connectionId}`,
|
|
3396
|
-
children:
|
|
3597
|
+
children: Ln(e.connectionId)
|
|
3397
3598
|
}) }),
|
|
3398
|
-
/* @__PURE__ */
|
|
3599
|
+
/* @__PURE__ */ j(X, {
|
|
3399
3600
|
title: e.actorName,
|
|
3400
3601
|
children: e.actorName
|
|
3401
3602
|
}),
|
|
3402
|
-
/* @__PURE__ */
|
|
3603
|
+
/* @__PURE__ */ j(X, {
|
|
3403
3604
|
title: e.actorId,
|
|
3404
3605
|
children: e.actorId
|
|
3405
3606
|
}),
|
|
3406
|
-
/* @__PURE__ */
|
|
3607
|
+
/* @__PURE__ */ j(X, { children: e.openedAtMs === null ? /* @__PURE__ */ j("span", {
|
|
3407
3608
|
title: "The connect event is not in retained history",
|
|
3408
3609
|
children: "—"
|
|
3409
|
-
}) : /* @__PURE__ */
|
|
3610
|
+
}) : /* @__PURE__ */ M("time", {
|
|
3410
3611
|
dateTime: new Date(e.openedAtMs).toISOString(),
|
|
3411
3612
|
title: e.estimatedStart ? "Approximate: first reported by the host; the connect event has not been saved yet" : new Date(e.openedAtMs).toLocaleString(),
|
|
3412
3613
|
children: [e.estimatedStart ? "≈ " : "", new Date(e.openedAtMs).toLocaleTimeString([], { hour12: !1 })]
|
|
3413
3614
|
}) }),
|
|
3414
|
-
/* @__PURE__ */
|
|
3615
|
+
/* @__PURE__ */ j(X, { children: /* @__PURE__ */ M("span", {
|
|
3415
3616
|
className: "socket-duration",
|
|
3416
|
-
children: [/* @__PURE__ */
|
|
3617
|
+
children: [/* @__PURE__ */ j("span", { children: In(e, t) }), /* @__PURE__ */ j("i", {
|
|
3417
3618
|
className: `socket-duration-bar socket-duration-${e.status}`,
|
|
3418
3619
|
"aria-hidden": "true",
|
|
3419
|
-
children: /* @__PURE__ */
|
|
3620
|
+
children: /* @__PURE__ */ j("b", { style: { width: `${o * 100}%` } })
|
|
3420
3621
|
})]
|
|
3421
3622
|
}) }),
|
|
3422
|
-
/* @__PURE__ */
|
|
3423
|
-
/* @__PURE__ */
|
|
3623
|
+
/* @__PURE__ */ j(X, { children: e.messages.toLocaleString() }),
|
|
3624
|
+
/* @__PURE__ */ j(X, { children: e.metadata === void 0 ? /* @__PURE__ */ j("span", {
|
|
3424
3625
|
title: "No metadata was recorded for this connection",
|
|
3425
3626
|
children: "—"
|
|
3426
|
-
}) : /* @__PURE__ */
|
|
3627
|
+
}) : /* @__PURE__ */ j("code", {
|
|
3427
3628
|
className: "socket-metadata",
|
|
3428
3629
|
title: JSON.stringify(e.metadata),
|
|
3429
3630
|
children: JSON.stringify(e.metadata)
|
|
@@ -3431,46 +3632,46 @@ function Nn({ session: e, now: t, longest: n, selected: r, onSelect: i }) {
|
|
|
3431
3632
|
]
|
|
3432
3633
|
});
|
|
3433
3634
|
}
|
|
3434
|
-
function
|
|
3635
|
+
function Un({ session: e, now: t, onSelectActor: n }) {
|
|
3435
3636
|
let r = {
|
|
3436
|
-
Status: e.status === "lost" ? "Lost — no disconnect recorded" :
|
|
3637
|
+
Status: e.status === "lost" ? "Lost — no disconnect recorded" : Fn(e.status),
|
|
3437
3638
|
Connection: e.connectionId,
|
|
3438
3639
|
"Actor class": e.actorName,
|
|
3439
3640
|
"Instance ID": e.actorId,
|
|
3440
3641
|
Opened: e.openedAtMs === null ? "Before retained history" : `${e.estimatedStart ? "≈ " : ""}${new Date(e.openedAtMs).toLocaleString()}`,
|
|
3441
3642
|
...e.closedAtMs === null ? {} : { Closed: new Date(e.closedAtMs).toLocaleString() },
|
|
3442
3643
|
...e.status === "lost" && e.lastSeenMs !== null ? { "Last activity": new Date(e.lastSeenMs).toLocaleString() } : {},
|
|
3443
|
-
Duration:
|
|
3644
|
+
Duration: In(e, t),
|
|
3444
3645
|
Messages: e.messages.toLocaleString(),
|
|
3445
3646
|
Failures: e.failures.toLocaleString(),
|
|
3446
3647
|
Host: e.hostId ?? "Unknown"
|
|
3447
3648
|
};
|
|
3448
|
-
return /* @__PURE__ */
|
|
3449
|
-
/* @__PURE__ */
|
|
3649
|
+
return /* @__PURE__ */ M(A, { children: [
|
|
3650
|
+
/* @__PURE__ */ j("dl", {
|
|
3450
3651
|
className: "la-request-details",
|
|
3451
|
-
children: Object.entries(r).map(([e, t]) => /* @__PURE__ */
|
|
3652
|
+
children: Object.entries(r).map(([e, t]) => /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("dt", { children: e }), /* @__PURE__ */ j("dd", { children: t })] }, e))
|
|
3452
3653
|
}),
|
|
3453
|
-
e.metadata !== void 0 && /* @__PURE__ */
|
|
3654
|
+
e.metadata !== void 0 && /* @__PURE__ */ M("details", {
|
|
3454
3655
|
className: "socket-metadata-details",
|
|
3455
3656
|
open: !0,
|
|
3456
|
-
children: [/* @__PURE__ */
|
|
3657
|
+
children: [/* @__PURE__ */ j("summary", { children: "Metadata" }), /* @__PURE__ */ j("pre", { children: JSON.stringify(e.metadata, null, 2) })]
|
|
3457
3658
|
}),
|
|
3458
|
-
n && /* @__PURE__ */
|
|
3659
|
+
n && /* @__PURE__ */ M(B, {
|
|
3459
3660
|
variant: "outline",
|
|
3460
3661
|
onClick: () => n(e.actorName),
|
|
3461
3662
|
children: ["Open ", e.actorName]
|
|
3462
3663
|
})
|
|
3463
3664
|
] });
|
|
3464
3665
|
}
|
|
3465
|
-
function
|
|
3666
|
+
function Wn(e, t, n) {
|
|
3466
3667
|
let r = Math.min(...e.map((e) => e.openedAtMs ?? e.lastSeenMs ?? n)), i = Number.isFinite(r) ? r - Math.max(5e3, (n - r) * .06) : n - 6e4;
|
|
3467
3668
|
return Math.max(t ?? -Infinity, Math.min(i, n - 1e4));
|
|
3468
3669
|
}
|
|
3469
|
-
function
|
|
3670
|
+
function Gn(e, n) {
|
|
3470
3671
|
let [r, o] = a(/* @__PURE__ */ new Map()), s = i(void 0);
|
|
3471
3672
|
return t(() => {
|
|
3472
3673
|
if (!e) return;
|
|
3473
|
-
let t = new Set(e.actors.flatMap((e) => e.instances.flatMap((t) => t.connections.map((n) =>
|
|
3674
|
+
let t = new Set(e.actors.flatMap((e) => e.instances.flatMap((t) => t.connections.map((n) => dn(e.actorName, t.actorId, n.id))))), r = s.current;
|
|
3474
3675
|
if (s.current = t, !r) return;
|
|
3475
3676
|
let i = [...t].filter((e) => !r.has(e)), a = [...r].filter((e) => !t.has(e));
|
|
3476
3677
|
if (i.length || a.length) {
|
|
@@ -3482,7 +3683,7 @@ function In(e, n) {
|
|
|
3482
3683
|
}
|
|
3483
3684
|
}, [e]), r;
|
|
3484
3685
|
}
|
|
3485
|
-
function
|
|
3686
|
+
function Kn(e, t) {
|
|
3486
3687
|
let n = /* @__PURE__ */ new Map();
|
|
3487
3688
|
for (let e of t?.actors ?? []) n.set(e.actorName, new Set(e.instances.map((e) => e.actorId)));
|
|
3488
3689
|
for (let t of e) {
|
|
@@ -3499,16 +3700,16 @@ function Ln(e, t) {
|
|
|
3499
3700
|
hint: e
|
|
3500
3701
|
})))];
|
|
3501
3702
|
}
|
|
3502
|
-
function
|
|
3703
|
+
function qn(e, t, n) {
|
|
3503
3704
|
return !e && !t.rows ? t.failed ? "Connections unavailable" : "Loading connections…" : n ? "No matching connections" : t.supported ? "No WebSocket sessions" : "No active WebSockets";
|
|
3504
3705
|
}
|
|
3505
3706
|
//#endregion
|
|
3506
3707
|
//#region src/ConsoleApp.tsx
|
|
3507
|
-
var
|
|
3708
|
+
var Jn = [
|
|
3508
3709
|
{
|
|
3509
3710
|
id: "overview",
|
|
3510
3711
|
label: "Durable Actors",
|
|
3511
|
-
icon:
|
|
3712
|
+
icon: y
|
|
3512
3713
|
},
|
|
3513
3714
|
{
|
|
3514
3715
|
id: "actors",
|
|
@@ -3526,72 +3727,72 @@ var zn = [
|
|
|
3526
3727
|
icon: l
|
|
3527
3728
|
}
|
|
3528
3729
|
];
|
|
3529
|
-
function
|
|
3530
|
-
let [n, r] = a("overview"), [i, o] = a(), [l, u] = a(
|
|
3730
|
+
function Yn({ client: e, toggleTheme: t }) {
|
|
3731
|
+
let [n, r] = a("overview"), [i, o] = a(), [l, u] = a(Fe), d = {
|
|
3531
3732
|
timeRange: l,
|
|
3532
3733
|
onTimeRangeChange: u
|
|
3533
3734
|
};
|
|
3534
3735
|
function f(e) {
|
|
3535
3736
|
o(e), r("actors");
|
|
3536
3737
|
}
|
|
3537
|
-
return /* @__PURE__ */
|
|
3738
|
+
return /* @__PURE__ */ M("div", {
|
|
3538
3739
|
className: "console-shell",
|
|
3539
3740
|
children: [
|
|
3540
|
-
/* @__PURE__ */
|
|
3741
|
+
/* @__PURE__ */ j("a", {
|
|
3541
3742
|
className: "skip-link",
|
|
3542
3743
|
href: "#main",
|
|
3543
3744
|
children: "Skip to content"
|
|
3544
3745
|
}),
|
|
3545
|
-
/* @__PURE__ */
|
|
3746
|
+
/* @__PURE__ */ M("aside", {
|
|
3546
3747
|
className: "console-sidebar",
|
|
3547
3748
|
children: [
|
|
3548
|
-
/* @__PURE__ */
|
|
3749
|
+
/* @__PURE__ */ M("div", {
|
|
3549
3750
|
className: "console-brand",
|
|
3550
|
-
children: [/* @__PURE__ */
|
|
3751
|
+
children: [/* @__PURE__ */ j(v, { "aria-hidden": "true" }), /* @__PURE__ */ j("strong", { children: "Terse" })]
|
|
3551
3752
|
}),
|
|
3552
|
-
/* @__PURE__ */
|
|
3753
|
+
/* @__PURE__ */ j("nav", {
|
|
3553
3754
|
"aria-label": "Observability",
|
|
3554
|
-
children:
|
|
3755
|
+
children: Jn.map((e) => /* @__PURE__ */ M("button", {
|
|
3555
3756
|
type: "button",
|
|
3556
3757
|
"aria-current": n === e.id ? "page" : void 0,
|
|
3557
3758
|
onClick: () => {
|
|
3558
3759
|
o(void 0), r(e.id);
|
|
3559
3760
|
},
|
|
3560
|
-
children: [/* @__PURE__ */
|
|
3761
|
+
children: [/* @__PURE__ */ j(e.icon, { "aria-hidden": "true" }), e.label]
|
|
3561
3762
|
}, e.id))
|
|
3562
3763
|
}),
|
|
3563
|
-
/* @__PURE__ */
|
|
3764
|
+
/* @__PURE__ */ M("div", {
|
|
3564
3765
|
className: "console-sidebar-foot",
|
|
3565
|
-
children: [/* @__PURE__ */
|
|
3766
|
+
children: [/* @__PURE__ */ j(c, { "aria-hidden": "true" }), /* @__PURE__ */ M("span", { children: ["Runtime inspector", /* @__PURE__ */ j("small", { children: "Read-only observability" })] })]
|
|
3566
3767
|
})
|
|
3567
3768
|
]
|
|
3568
3769
|
}),
|
|
3569
|
-
/* @__PURE__ */
|
|
3770
|
+
/* @__PURE__ */ M("div", {
|
|
3570
3771
|
className: "console-workspace",
|
|
3571
|
-
children: [/* @__PURE__ */
|
|
3772
|
+
children: [/* @__PURE__ */ M("header", {
|
|
3572
3773
|
className: "console-topbar",
|
|
3573
|
-
children: [/* @__PURE__ */
|
|
3774
|
+
children: [/* @__PURE__ */ j("button", {
|
|
3574
3775
|
className: "theme-toggle",
|
|
3575
3776
|
type: "button",
|
|
3576
3777
|
onClick: t,
|
|
3577
3778
|
"aria-label": "Toggle color theme",
|
|
3578
|
-
children: /* @__PURE__ */
|
|
3579
|
-
}), /* @__PURE__ */
|
|
3779
|
+
children: /* @__PURE__ */ j(w, { "aria-hidden": "true" })
|
|
3780
|
+
}), /* @__PURE__ */ M("a", {
|
|
3580
3781
|
href: "https://github.com/TerseAI/durable-actors#readme",
|
|
3581
3782
|
target: "_blank",
|
|
3582
3783
|
rel: "noopener noreferrer",
|
|
3583
|
-
children: ["Docs", /* @__PURE__ */
|
|
3784
|
+
children: ["Docs", /* @__PURE__ */ j(s, { "aria-hidden": "true" })]
|
|
3584
3785
|
})]
|
|
3585
|
-
}), /* @__PURE__ */
|
|
3786
|
+
}), /* @__PURE__ */ M("main", {
|
|
3586
3787
|
id: "main",
|
|
3587
3788
|
tabIndex: -1,
|
|
3588
3789
|
children: [
|
|
3589
|
-
n === "overview" && /* @__PURE__ */
|
|
3790
|
+
n === "overview" && /* @__PURE__ */ j(en, {
|
|
3590
3791
|
client: e,
|
|
3591
3792
|
onSelectActor: f,
|
|
3592
3793
|
...d
|
|
3593
3794
|
}),
|
|
3594
|
-
n === "actors" && /* @__PURE__ */
|
|
3795
|
+
n === "actors" && /* @__PURE__ */ j(kt, {
|
|
3595
3796
|
client: e,
|
|
3596
3797
|
navigation: {
|
|
3597
3798
|
actorName: i,
|
|
@@ -3599,11 +3800,11 @@ function Bn({ client: e, toggleTheme: t }) {
|
|
|
3599
3800
|
},
|
|
3600
3801
|
...d
|
|
3601
3802
|
}),
|
|
3602
|
-
n === "requests" && /* @__PURE__ */
|
|
3803
|
+
n === "requests" && /* @__PURE__ */ j(ot, {
|
|
3603
3804
|
client: e,
|
|
3604
3805
|
...d
|
|
3605
3806
|
}),
|
|
3606
|
-
n === "websockets" && /* @__PURE__ */
|
|
3807
|
+
n === "websockets" && /* @__PURE__ */ j(Bn, {
|
|
3607
3808
|
client: e,
|
|
3608
3809
|
onSelectActor: f,
|
|
3609
3810
|
...d
|
|
@@ -3616,20 +3817,20 @@ function Bn({ client: e, toggleTheme: t }) {
|
|
|
3616
3817
|
}
|
|
3617
3818
|
//#endregion
|
|
3618
3819
|
//#region src/state-data.ts
|
|
3619
|
-
function
|
|
3620
|
-
if (!$(e) || !(e.snapshot === null ||
|
|
3820
|
+
function Xn(e) {
|
|
3821
|
+
if (!$(e) || !(e.snapshot === null || Qn(e.snapshot) && $(e.snapshot) && $(e.snapshot.state)) || !(e.schema === null || $(e.schema))) throw Error("Invalid state response");
|
|
3621
3822
|
return e;
|
|
3622
3823
|
}
|
|
3623
|
-
function
|
|
3624
|
-
if (!$(e) || !Array.isArray(e.records) || !e.records.every(
|
|
3824
|
+
function Zn(e) {
|
|
3825
|
+
if (!$(e) || !Array.isArray(e.records) || !e.records.every(Qn) || !(e.nextBefore === null || $n(e.nextBefore))) throw Error("Invalid state history");
|
|
3625
3826
|
return e;
|
|
3626
3827
|
}
|
|
3627
|
-
function
|
|
3628
|
-
if (!$(e) ||
|
|
3828
|
+
function Qn(e) {
|
|
3829
|
+
if (!$(e) || !$n(e.stateVersion) || !$n(e.ownerEpoch) || typeof e.requestId != "string") return !1;
|
|
3629
3830
|
let t = e.attribution;
|
|
3630
3831
|
return t === null || $(t) && typeof t.operation == "string" && (t.connectionId === null || typeof t.connectionId == "string") && typeof t.committedAtMs == "number" && Number.isSafeInteger(t.committedAtMs) && t.committedAtMs >= 0 && typeof t.interleaved == "boolean";
|
|
3631
3832
|
}
|
|
3632
|
-
function
|
|
3833
|
+
function $n(e) {
|
|
3633
3834
|
return typeof e == "number" && Number.isSafeInteger(e) && e > 0;
|
|
3634
3835
|
}
|
|
3635
3836
|
function $(e) {
|
|
@@ -3637,42 +3838,42 @@ function $(e) {
|
|
|
3637
3838
|
}
|
|
3638
3839
|
//#endregion
|
|
3639
3840
|
//#region src/client.ts
|
|
3640
|
-
var
|
|
3841
|
+
var er = class {
|
|
3641
3842
|
baseUrl;
|
|
3642
3843
|
request;
|
|
3643
3844
|
constructor(e = "/api/observe", t = globalThis.fetch.bind(globalThis)) {
|
|
3644
3845
|
this.baseUrl = e, this.request = t;
|
|
3645
3846
|
}
|
|
3646
3847
|
async getState(e, t) {
|
|
3647
|
-
return
|
|
3848
|
+
return Xn(await this.get(`state${tr(e)}`, t));
|
|
3648
3849
|
}
|
|
3649
3850
|
async listStateHistory(e, t) {
|
|
3650
|
-
return
|
|
3851
|
+
return Zn(await this.get(`state/history${tr(e)}`, t));
|
|
3651
3852
|
}
|
|
3652
3853
|
async getMetrics(e, t) {
|
|
3653
|
-
return
|
|
3854
|
+
return Zt(await this.get(`metrics${tr(e)}`, t));
|
|
3654
3855
|
}
|
|
3655
3856
|
async listQueueWaits(e, t) {
|
|
3656
|
-
return
|
|
3857
|
+
return St(await this.get(`queue-waits${tr(e)}`, t));
|
|
3657
3858
|
}
|
|
3658
3859
|
async listWebSockets(e, t) {
|
|
3659
|
-
return
|
|
3860
|
+
return un(await this.get(`websockets${tr(e)}`, t));
|
|
3660
3861
|
}
|
|
3661
3862
|
async listActors(e) {
|
|
3662
3863
|
let t = await this.get("actors", e);
|
|
3663
|
-
if (!
|
|
3864
|
+
if (!nr(t)) throw Error("Invalid actor inventory response.");
|
|
3664
3865
|
return t;
|
|
3665
3866
|
}
|
|
3666
3867
|
async watchActors(e, t) {
|
|
3667
|
-
return this.watch("events", "inventory",
|
|
3868
|
+
return this.watch("events", "inventory", nr, e, t);
|
|
3668
3869
|
}
|
|
3669
3870
|
async watchRequests(e, t, n) {
|
|
3670
3871
|
let r = n ? `?${new URLSearchParams({ after: n })}` : "";
|
|
3671
|
-
return this.watch(`requests/events${r}`, "requests",
|
|
3872
|
+
return this.watch(`requests/events${r}`, "requests", ar, e, t);
|
|
3672
3873
|
}
|
|
3673
3874
|
async listRequests(e, t) {
|
|
3674
|
-
let n = await this.get(`requests${
|
|
3675
|
-
if (!
|
|
3875
|
+
let n = await this.get(`requests${tr(e)}`, t);
|
|
3876
|
+
if (!ar(n)) throw Error("Invalid request history response");
|
|
3676
3877
|
return n;
|
|
3677
3878
|
}
|
|
3678
3879
|
async watch(e, t, n, r, i) {
|
|
@@ -3683,7 +3884,7 @@ var Gn = class {
|
|
|
3683
3884
|
headers: { accept: "text/event-stream" }
|
|
3684
3885
|
});
|
|
3685
3886
|
if (!a.ok || !a.headers.get("content-type")?.startsWith("text/event-stream") || !a.body) throw await a.body?.cancel(), Error("Live inventory is unavailable");
|
|
3686
|
-
let o = a.body.getReader(), s = new TextDecoder(), c =
|
|
3887
|
+
let o = a.body.getReader(), s = new TextDecoder(), c = oe({ onEvent(e) {
|
|
3687
3888
|
if (i.aborted) return;
|
|
3688
3889
|
if (e.event === "error") throw Error("Live inventory is unavailable");
|
|
3689
3890
|
if (e.event !== t) return;
|
|
@@ -3721,29 +3922,29 @@ var Gn = class {
|
|
|
3721
3922
|
return n.json();
|
|
3722
3923
|
}
|
|
3723
3924
|
};
|
|
3724
|
-
function
|
|
3925
|
+
function tr(e) {
|
|
3725
3926
|
let t = new URLSearchParams();
|
|
3726
3927
|
for (let [n, r] of Object.entries(e)) r !== void 0 && t.set(n, String(r));
|
|
3727
3928
|
return t.size ? `?${t}` : "";
|
|
3728
3929
|
}
|
|
3729
|
-
function
|
|
3930
|
+
function nr(e) {
|
|
3730
3931
|
return !e || typeof e != "object" || !("actors" in e) || !Array.isArray(e.actors) ? !1 : e.actors.every((e) => e && typeof e.actorName == "string" && [
|
|
3731
3932
|
e.live,
|
|
3732
3933
|
e.dormant,
|
|
3733
3934
|
e.unknown
|
|
3734
|
-
].every((e) => Number.isSafeInteger(e) && e >= 0) && Array.isArray(e.instances) && e.instances.every(
|
|
3935
|
+
].every((e) => Number.isSafeInteger(e) && e >= 0) && Array.isArray(e.instances) && e.instances.every(rr));
|
|
3735
3936
|
}
|
|
3736
|
-
function
|
|
3937
|
+
function rr(e) {
|
|
3737
3938
|
return !!e && typeof e == "object" && "actorId" in e && typeof e.actorId == "string" && "status" in e && [
|
|
3738
3939
|
"live",
|
|
3739
3940
|
"dormant",
|
|
3740
3941
|
"unknown"
|
|
3741
|
-
].includes(String(e.status)) && "connections" in e && Array.isArray(e.connections) && e.connections.every(
|
|
3942
|
+
].includes(String(e.status)) && "connections" in e && Array.isArray(e.connections) && e.connections.every(ir) && (!("waiting" in e) || e.waiting == null || Array.isArray(e.waiting) && e.waiting.every((e) => !!e && typeof e == "object" && typeof e.id == "string" && typeof e.operation == "string"));
|
|
3742
3943
|
}
|
|
3743
|
-
function
|
|
3944
|
+
function ir(e) {
|
|
3744
3945
|
return !!e && typeof e == "object" && "id" in e && typeof e.id == "string" && "metadata" in e;
|
|
3745
3946
|
}
|
|
3746
|
-
function
|
|
3947
|
+
function ar(e) {
|
|
3747
3948
|
if (!e || typeof e != "object") return !1;
|
|
3748
3949
|
let t = e;
|
|
3749
3950
|
return typeof t.epoch == "string" && [
|
|
@@ -3751,12 +3952,12 @@ function Xn(e) {
|
|
|
3751
3952
|
t.capacity,
|
|
3752
3953
|
t.evicted,
|
|
3753
3954
|
t.dropped
|
|
3754
|
-
].every(
|
|
3955
|
+
].every(or) && (t.persistenceFailed === void 0 || typeof t.persistenceFailed == "boolean") && (t.nextCursor == null || typeof t.nextCursor == "string") && (t.resumeCursor === void 0 || typeof t.resumeCursor == "string") && (t.reset === void 0 || typeof t.reset == "boolean") && t.capacity > 0 && t.capacity <= 500 && Array.isArray(t.records) && t.records.length <= t.capacity && t.records.every((e) => sr(e) && e.sequence <= t.cursor);
|
|
3755
3956
|
}
|
|
3756
|
-
function
|
|
3957
|
+
function or(e) {
|
|
3757
3958
|
return Number.isSafeInteger(e) && Number(e) >= 0;
|
|
3758
3959
|
}
|
|
3759
|
-
function
|
|
3960
|
+
function sr(e) {
|
|
3760
3961
|
if (!e || typeof e != "object") return !1;
|
|
3761
3962
|
let t = e;
|
|
3762
3963
|
return typeof t.projectId == "string" && /^[A-Za-z0-9._-]{1,64}$/u.test(t.projectId) && [
|
|
@@ -3766,7 +3967,7 @@ function Qn(e) {
|
|
|
3766
3967
|
t.actorName,
|
|
3767
3968
|
t.actorId,
|
|
3768
3969
|
t.operation
|
|
3769
|
-
].every((e) => typeof e == "string") && (t.eventId === void 0 || typeof t.eventId == "string" && t.eventId.length > 0) &&
|
|
3970
|
+
].every((e) => typeof e == "string") && (t.eventId === void 0 || typeof t.eventId == "string" && t.eventId.length > 0) && or(t.sequence) && or(t.startedAtMs) && t.startedAtMs <= 864e13 && ["method", "websocket"].includes(t.kind) && [
|
|
3770
3971
|
"completed",
|
|
3771
3972
|
"failed",
|
|
3772
3973
|
"rejected",
|
|
@@ -3775,4 +3976,4 @@ function Qn(e) {
|
|
|
3775
3976
|
].includes(t.outcome) && (t.connectionId === null || typeof t.connectionId == "string") && Number.isFinite(t.durationMs) && t.durationMs >= 0 && (t.queueWaitMs === null || Number.isFinite(t.queueWaitMs) && t.queueWaitMs >= 0 && t.queueWaitMs <= t.durationMs);
|
|
3776
3977
|
}
|
|
3777
3978
|
//#endregion
|
|
3778
|
-
export {
|
|
3979
|
+
export { kt as ActorObserver, U as Badge, B as Button, Te as Calendar, Ee as CalendarDayButton, ce as Command, de as CommandEmpty, fe as CommandGroup, le as CommandInput, me as CommandItem, ue as CommandList, pe as CommandSeparator, he as CommandShortcut, Yn as ConsoleApp, ge as FilterCombobox, er as HttpObserverClient, V as Input, en as Overview, De as Popover, Ae as PopoverAnchor, ke as PopoverContent, Ne as PopoverDescription, je as PopoverHeader, Me as PopoverTitle, Oe as PopoverTrigger, ot as RequestObserver, xe as RequestTimeline, Ye as Sheet, Qe as SheetContent, Ze as SheetDescription, Xe as SheetTitle, Tn as SocketTimeline, G as Table, q as TableBody, et as TableCaption, X as TableCell, $e as TableFooter, Y as TableHead, K as TableHeader, J as TableRow, Be as TimeRangePicker, Bn as WebSocketObserver, qe as badgeVariants, we as buttonVariants, Fe as defaultTimeRange, Le as rangeLabel, Ie as resolveRange };
|