@voltro/devtools 0.89.2 → 0.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1943 -0
- package/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/Devtools.js +170 -169
- package/dist/components/dockMenu.js +46 -46
- package/dist/console/Capsule.js +137 -68
- package/dist/console/Console.js +204 -199
- package/dist/console/InspectRefusals.js +12 -12
- package/dist/console/sources.js +13 -13
- package/dist/index.d.ts +10 -0
- package/dist/index.js +3 -3
- package/dist/inspectFetch.js +19 -19
- package/dist/inspectStream.js +9 -9
- package/dist/panels/desktop.js +18 -18
- package/dist/panels/indexes.js +71 -71
- package/dist/panels/pwa.js +22 -22
- package/dist/panels/routes.js +13 -13
- package/dist/panels/runtimes.js +15 -15
- package/dist/panels/stores.js +35 -35
- package/dist/panels/traces.js +42 -42
- package/dist/panels/webhooks.js +242 -117
- package/dist/panels/workflows.js +146 -146
- package/dist/strings.js +13 -3
- package/dist/styles.css +11 -3
- package/dist/useCapsuleClearance.js +6 -6
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { clearInspectRefusals as e, useInspectRefusals as t } from "../inspectRefusal.js";
|
|
2
|
+
import { useDevtoolsStrings as n } from "../strings.js";
|
|
3
3
|
import { useState as r } from "react";
|
|
4
4
|
import { useFrameworkRuntimes as i } from "@voltro/client";
|
|
5
5
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
@@ -10,21 +10,21 @@ var s = (e) => {
|
|
|
10
10
|
} catch {
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
}, c = ({ url:
|
|
14
|
-
let i =
|
|
15
|
-
|
|
13
|
+
}, c = ({ url: t }) => {
|
|
14
|
+
let i = n().inspect, [s, c] = r(""), [l, u] = r(null), d = async (n) => {
|
|
15
|
+
n.preventDefault(), u(null);
|
|
16
16
|
try {
|
|
17
|
-
let
|
|
17
|
+
let n = await fetch(t, {
|
|
18
18
|
method: "POST",
|
|
19
19
|
credentials: "same-origin",
|
|
20
20
|
headers: { "content-type": "application/json" },
|
|
21
21
|
body: JSON.stringify({ token: s })
|
|
22
22
|
});
|
|
23
|
-
if (
|
|
24
|
-
c(""),
|
|
23
|
+
if (n.ok) {
|
|
24
|
+
c(""), e();
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
let r = await
|
|
27
|
+
let r = await n.json().catch(() => null), i = typeof r == "object" && r && typeof r.reason == "string" ? r.reason : `HTTP ${n.status}`;
|
|
28
28
|
u(i);
|
|
29
29
|
} catch (e) {
|
|
30
30
|
u(e instanceof Error ? e.message : String(e));
|
|
@@ -54,13 +54,13 @@ var s = (e) => {
|
|
|
54
54
|
]
|
|
55
55
|
});
|
|
56
56
|
}, l = () => {
|
|
57
|
-
let
|
|
58
|
-
if (
|
|
57
|
+
let e = t(), r = i(), l = n().inspect;
|
|
58
|
+
if (e.length === 0) return null;
|
|
59
59
|
let u = (e) => r.names.find((t) => r.get(t).inspectBaseUrl === e) ?? e;
|
|
60
60
|
return /* @__PURE__ */ a("div", {
|
|
61
61
|
className: "vdt-refusals",
|
|
62
62
|
role: "status",
|
|
63
|
-
children:
|
|
63
|
+
children: e.map((e) => {
|
|
64
64
|
let t = e.locked === !0 ? s(e) : void 0;
|
|
65
65
|
return /* @__PURE__ */ o("div", {
|
|
66
66
|
className: "vdt-refusal",
|
package/dist/console/sources.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { getLogs as e, subscribeLogs as t } from "../logsBus.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { formatCacheKey as n, useLiveApiSections as r } from "../panels/subscriptions.js";
|
|
3
|
+
import { fmtDuration as i, useTracesAcrossApis as a } from "../panels/traces.js";
|
|
4
|
+
import { defaultDevtoolsStrings as o, useDevtoolsStrings as s } from "../strings.js";
|
|
5
5
|
import { compactJson as c } from "./searchIndex.js";
|
|
6
6
|
import { useMemo as l, useSyncExternalStore as u } from "react";
|
|
7
7
|
import { getMutations as d, subscribeMutations as f } from "@voltro/client";
|
|
8
8
|
// src/console/sources.ts
|
|
9
9
|
var p = (e) => e.recovery.phase === "stuck" || e.snapshot.error ? "err" : e.recovery.phase !== "steady" || e.snapshot.pendingPatches > 0 ? "warn" : e.snapshot.revision >= 0 ? "ok" : e.hasFiber ? "info" : "idle", m = (e, t) => {
|
|
10
|
-
let
|
|
11
|
-
t.subscriberCount > 0 &&
|
|
10
|
+
let r = n(t.key), i = [];
|
|
11
|
+
t.subscriberCount > 0 && i.push(`${t.subscriberCount} sub${t.subscriberCount === 1 ? "" : "s"}`), t.snapshot.revision >= 0 && i.push(`r${t.snapshot.revision}`), t.snapshot.pendingPatches > 0 && i.push(`+${t.snapshot.pendingPatches} pending`), t.evicting && i.push("evicting");
|
|
12
12
|
let a = t.snapshot.error ? "error" : t.recovery.phase === "steady" ? void 0 : t.recovery.phase;
|
|
13
13
|
return {
|
|
14
14
|
id: `sub:${e}:${t.key}`,
|
|
15
15
|
source: "subscription",
|
|
16
16
|
apiName: e,
|
|
17
|
-
name:
|
|
18
|
-
summary:
|
|
17
|
+
name: r,
|
|
18
|
+
summary: i.join(" · "),
|
|
19
19
|
...a === void 0 ? {} : { status: a },
|
|
20
20
|
tone: p(t),
|
|
21
21
|
at: 0,
|
|
@@ -64,11 +64,11 @@ var p = (e) => e.recovery.phase === "stuck" || e.snapshot.error ? "err" : e.reco
|
|
|
64
64
|
source: "log",
|
|
65
65
|
record: e
|
|
66
66
|
}
|
|
67
|
-
}), b = (e, t,
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
}), b = (e, t, n = o.traces) => {
|
|
68
|
+
let r = t.spans.map((e) => e.attributes["db.operation.name"] ?? e.attributes["db.operation"]).find((e) => typeof e == "string"), a = t.spans.filter((e) => e.name !== t.rootName).slice(0, 3).map((e) => e.name).join(" → "), s = t.kind === "subscription" ? `${t.deliveryCount ?? 0} ${n.delivery(t.deliveryCount ?? 0)}` : [
|
|
69
|
+
i(t.durationMs),
|
|
70
|
+
n.spans(t.spanCount),
|
|
71
|
+
r ?? a
|
|
72
72
|
].filter(Boolean).join(" · "), c = t.spans.filter((e) => e.status === "error").map((e) => `${e.name} ${e.statusMessage ?? ""}`).join(" ");
|
|
73
73
|
return {
|
|
74
74
|
id: `trace:${e}:${t.traceId}`,
|
|
@@ -87,7 +87,7 @@ var p = (e) => e.recovery.phase === "stuck" || e.snapshot.error ? "err" : e.reco
|
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
}, x = () => u(f, d, d), S = () => u(t, e, e), C = (e, t = !1) => {
|
|
90
|
-
let n =
|
|
90
|
+
let n = s().traces, i = r(), o = x(), c = S(), u = a(e, t);
|
|
91
91
|
return l(() => {
|
|
92
92
|
let e = [];
|
|
93
93
|
for (let t of i) for (let n of t.entries) e.push(m(t.name, n));
|
package/dist/index.d.ts
CHANGED
|
@@ -244,6 +244,16 @@ export declare interface DevtoolsStrings {
|
|
|
244
244
|
readonly active: string;
|
|
245
245
|
readonly paused: string;
|
|
246
246
|
readonly attempt: (n: number) => string;
|
|
247
|
+
readonly targetPages: string;
|
|
248
|
+
readonly deliveryPages: string;
|
|
249
|
+
readonly pageRange: (from: number, to: number) => string;
|
|
250
|
+
readonly pageLoading: string;
|
|
251
|
+
readonly pageError: string;
|
|
252
|
+
readonly pageFirst: string;
|
|
253
|
+
readonly pagePrevious: string;
|
|
254
|
+
readonly pageNext: string;
|
|
255
|
+
readonly pageRefresh: string;
|
|
256
|
+
readonly pageLiveHint: string;
|
|
247
257
|
};
|
|
248
258
|
/** <MutationsPanel> empty state + section chrome. */
|
|
249
259
|
readonly mutations: {
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
1
|
+
import { VoltroDevtools as e } from "./Devtools.js";
|
|
2
|
+
import { DevtoolsStringsProvider as t, defaultDevtoolsStrings as n, useDevtoolsStrings as r } from "./strings.js";
|
|
3
|
+
export { t as DevtoolsStringsProvider, e as VoltroDevtools, n as defaultDevtoolsStrings, r as useDevtoolsStrings };
|
package/dist/inspectFetch.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { inspectHeaders as e } from "./inspectAuth.js";
|
|
2
|
+
import { inspectBaseOf as t, isRefusalStatus as n, mayAskInspect as r, noteInspectFailure as i, noteInspectRefusal as a, noteInspectSuccess as o, readInspectRefusal as s } from "./inspectRefusal.js";
|
|
3
3
|
// src/inspectFetch.ts
|
|
4
|
-
var c = (e) => typeof e == "object" && !!e && "data" in e, l = (e) => c(e) ? e.data : null, u = async (
|
|
5
|
-
let
|
|
4
|
+
var c = (e) => typeof e == "object" && !!e && "data" in e, l = (e) => c(e) ? e.data : null, u = async (t, n, r) => {
|
|
5
|
+
let i = await fetch(t, {
|
|
6
6
|
method: "POST",
|
|
7
|
-
headers:
|
|
7
|
+
headers: e(n, {
|
|
8
8
|
accept: "application/json",
|
|
9
9
|
"content-type": "application/json"
|
|
10
10
|
}),
|
|
11
|
-
body: JSON.stringify(
|
|
12
|
-
}),
|
|
13
|
-
if (!
|
|
14
|
-
let e = typeof
|
|
11
|
+
body: JSON.stringify(r ?? {})
|
|
12
|
+
}), a = await i.json().catch(() => null);
|
|
13
|
+
if (!i.ok) {
|
|
14
|
+
let e = typeof a == "object" && a ? a : void 0, t = typeof e?.message == "string" ? e.message : typeof e?.error == "string" ? e.error : `HTTP ${i.status}`;
|
|
15
15
|
throw Error(t);
|
|
16
16
|
}
|
|
17
|
-
let
|
|
18
|
-
if (
|
|
19
|
-
return
|
|
17
|
+
let o = l(a);
|
|
18
|
+
if (o === null) throw Error("the api answered without an observation");
|
|
19
|
+
return o;
|
|
20
20
|
}, d = (e, t) => {
|
|
21
21
|
let n = `${e}\u0000${t ?? ""}`, r = f.get(n);
|
|
22
22
|
if (r !== void 0) return r;
|
|
@@ -25,17 +25,17 @@ var c = (e) => typeof e == "object" && !!e && "data" in e, l = (e) => c(e) ? e.d
|
|
|
25
25
|
});
|
|
26
26
|
return f.set(n, i), i;
|
|
27
27
|
}, f = /* @__PURE__ */ new Map(), p = async (c, u) => {
|
|
28
|
-
let d =
|
|
29
|
-
if (!
|
|
28
|
+
let d = t(c);
|
|
29
|
+
if (!r(d)) return null;
|
|
30
30
|
let f;
|
|
31
31
|
try {
|
|
32
|
-
f = await fetch(c, { headers:
|
|
32
|
+
f = await fetch(c, { headers: e(u, { accept: "application/json" }) });
|
|
33
33
|
} catch {
|
|
34
|
-
return
|
|
34
|
+
return i(d, !0), null;
|
|
35
35
|
}
|
|
36
|
-
if (
|
|
37
|
-
if (!f.ok) return
|
|
38
|
-
|
|
36
|
+
if (n(f.status)) return a(await s(d, f)), null;
|
|
37
|
+
if (!f.ok) return i(d, !1), null;
|
|
38
|
+
o(d);
|
|
39
39
|
try {
|
|
40
40
|
return l(await f.json());
|
|
41
41
|
} catch {
|
package/dist/inspectStream.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { inspectHeaders as e } from "./inspectAuth.js";
|
|
2
|
+
import { inspectRefusalFor as t, isRefusalStatus as n, noteInspectRefusal as r, readInspectRefusal as i } from "./inspectRefusal.js";
|
|
3
3
|
import { useEffect as a, useState as o } from "react";
|
|
4
4
|
// src/inspectStream.ts
|
|
5
5
|
var s = (a, o) => {
|
|
6
6
|
let s = `${a}/_voltro/inspect/stream?channels=${encodeURIComponent(o.channels.join(","))}`, c = !1, l = !1, u = 0, d, f, p = async () => {
|
|
7
7
|
if (c) return;
|
|
8
|
-
if (
|
|
8
|
+
if (t(a) !== void 0) {
|
|
9
9
|
l = !0;
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
d = new AbortController();
|
|
13
13
|
let m;
|
|
14
14
|
try {
|
|
15
|
-
let
|
|
16
|
-
headers:
|
|
15
|
+
let t = await fetch(s, {
|
|
16
|
+
headers: e(o.token, { accept: "text/event-stream" }),
|
|
17
17
|
signal: d.signal
|
|
18
18
|
});
|
|
19
|
-
if (t
|
|
20
|
-
if (!
|
|
19
|
+
if (n(t.status)) throw r(await i(a, t)), l = !0, Error(`inspect stream refused (HTTP ${t.status})`);
|
|
20
|
+
if (!t.ok || t.body === null) throw Error(`inspect stream HTTP ${t.status}`);
|
|
21
21
|
if (c) {
|
|
22
|
-
await
|
|
22
|
+
await t.body.cancel();
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
u = 0, m =
|
|
25
|
+
u = 0, m = t.body.getReader();
|
|
26
26
|
let f = new TextDecoder(), p = "";
|
|
27
27
|
for (; !c;) {
|
|
28
28
|
let { done: e, value: t } = await m.read();
|
package/dist/panels/desktop.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Badge as e, Button as t, Card as n, Empty as r, KeyValue as i, SectionTitle as a } from "../components/primitives.js";
|
|
2
|
+
import { Monitor as o } from "../components/icons.js";
|
|
3
|
+
import { useDevtoolsStrings as s } from "../strings.js";
|
|
4
4
|
import { useCallback as c, useEffect as l, useState as u } from "react";
|
|
5
5
|
import { readPairing as d, usePlatform as f, useShellExtension as p } from "@voltro/client";
|
|
6
6
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
7
7
|
// src/panels/desktop.tsx
|
|
8
8
|
var g = (e) => Object.entries(e ?? {}).filter(([, e]) => e === !0).map(([e]) => e).sort(), _ = (e) => [e.fullscreen ? "fullscreen" : e.maximized ? "maximized" : "windowed", e.focused ? "focused" : "unfocused"].join(", "), v = () => {
|
|
9
|
-
let v =
|
|
9
|
+
let v = s().desktop, y = f(), b = p("desktop"), [x, S] = u(0), [C, w] = u(null), [T, E] = u(null), D = c(() => S((e) => e + 1), []);
|
|
10
10
|
if (l(() => {
|
|
11
11
|
if (!b) return;
|
|
12
12
|
let e = b.window.subscribe(D), t = b.os.onThemeChange(D);
|
|
@@ -16,23 +16,23 @@ var g = (e) => Object.entries(e ?? {}).filter(([, e]) => e === !0).map(([e]) =>
|
|
|
16
16
|
}, [b, D]), l(() => {
|
|
17
17
|
let e = y.storage("local");
|
|
18
18
|
e === null ? E(null) : d(e).then(E);
|
|
19
|
-
}, [y, x]), !b) return /* @__PURE__ */ m(
|
|
19
|
+
}, [y, x]), !b) return /* @__PURE__ */ m(r, { children: v.notDesktop });
|
|
20
20
|
let O = g(y.capabilities);
|
|
21
21
|
return /* @__PURE__ */ h("div", {
|
|
22
22
|
className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
|
|
23
23
|
children: [
|
|
24
|
-
/* @__PURE__ */ h(
|
|
25
|
-
Icon:
|
|
26
|
-
right: /* @__PURE__ */ m(
|
|
24
|
+
/* @__PURE__ */ h(n, { children: [/* @__PURE__ */ m(a, {
|
|
25
|
+
Icon: o,
|
|
26
|
+
right: /* @__PURE__ */ m(t, {
|
|
27
27
|
size: "sm",
|
|
28
28
|
onClick: D,
|
|
29
29
|
children: v.refresh
|
|
30
30
|
}),
|
|
31
31
|
children: v.shell
|
|
32
|
-
}), /* @__PURE__ */ m(
|
|
32
|
+
}), /* @__PURE__ */ m(i, { entries: [
|
|
33
33
|
{
|
|
34
34
|
key: v.kind,
|
|
35
|
-
value: /* @__PURE__ */ m(
|
|
35
|
+
value: /* @__PURE__ */ m(e, {
|
|
36
36
|
tone: "info",
|
|
37
37
|
children: b.kind
|
|
38
38
|
})
|
|
@@ -54,8 +54,8 @@ var g = (e) => Object.entries(e ?? {}).filter(([, e]) => e === !0).map(([e]) =>
|
|
|
54
54
|
value: y.platform.appVersion ?? v.unknown
|
|
55
55
|
}
|
|
56
56
|
] })] }),
|
|
57
|
-
/* @__PURE__ */ h(
|
|
58
|
-
right: y.updates ? /* @__PURE__ */ m(
|
|
57
|
+
/* @__PURE__ */ h(n, { children: [/* @__PURE__ */ m(a, {
|
|
58
|
+
right: y.updates ? /* @__PURE__ */ m(t, {
|
|
59
59
|
size: "sm",
|
|
60
60
|
onClick: () => {
|
|
61
61
|
y.updates.check().then(w);
|
|
@@ -63,14 +63,14 @@ var g = (e) => Object.entries(e ?? {}).filter(([, e]) => e === !0).map(([e]) =>
|
|
|
63
63
|
children: v.checkNow
|
|
64
64
|
}) : void 0,
|
|
65
65
|
children: v.updater
|
|
66
|
-
}), /* @__PURE__ */ m(
|
|
66
|
+
}), /* @__PURE__ */ m(i, { entries: [{
|
|
67
67
|
key: v.updaterPort,
|
|
68
68
|
value: y.updates ? v.yes : v.no
|
|
69
69
|
}, {
|
|
70
70
|
key: v.waitingVersion,
|
|
71
71
|
value: C?.version ?? v.none
|
|
72
72
|
}] })] }),
|
|
73
|
-
/* @__PURE__ */ h(
|
|
73
|
+
/* @__PURE__ */ h(n, { children: [/* @__PURE__ */ m(a, { children: v.localStack }), /* @__PURE__ */ m(i, { entries: [
|
|
74
74
|
{
|
|
75
75
|
key: v.sidecarPort,
|
|
76
76
|
value: b.sidecar === void 0 ? v.no : v.yes
|
|
@@ -84,15 +84,15 @@ var g = (e) => Object.entries(e ?? {}).filter(([, e]) => e === !0).map(([e]) =>
|
|
|
84
84
|
value: T?.name ?? v.none
|
|
85
85
|
}
|
|
86
86
|
] })] }),
|
|
87
|
-
/* @__PURE__ */ h(
|
|
87
|
+
/* @__PURE__ */ h(n, { children: [/* @__PURE__ */ m(a, { children: v.capabilities }), O.length === 0 ? /* @__PURE__ */ m("div", {
|
|
88
88
|
className: "vdt:px-3 vdt:py-2 vdt:text-xs vdt:text-foreground-subtle",
|
|
89
89
|
children: v.noCapabilities
|
|
90
90
|
}) : /* @__PURE__ */ m("div", {
|
|
91
91
|
className: "vdt:flex vdt:flex-wrap vdt:gap-1 vdt:px-3 vdt:py-2",
|
|
92
|
-
children: O.map((
|
|
92
|
+
children: O.map((t) => /* @__PURE__ */ m(e, {
|
|
93
93
|
tone: "neutral",
|
|
94
|
-
children:
|
|
95
|
-
},
|
|
94
|
+
children: t
|
|
95
|
+
}, t))
|
|
96
96
|
})] })
|
|
97
97
|
]
|
|
98
98
|
});
|
package/dist/panels/indexes.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { Badge as e, Card as t, CardBody as n, Empty as r, SectionTitle as i } from "../components/primitives.js";
|
|
2
|
+
import { Activity as a } from "../components/icons.js";
|
|
3
|
+
import { useInspectToken as o } from "../inspectAuth.js";
|
|
4
|
+
import { fetchInspect as s } from "../inspectFetch.js";
|
|
5
|
+
import { inspectRefusalFor as c } from "../inspectRefusal.js";
|
|
6
|
+
import { useDocumentVisible as l } from "../useDocumentVisible.js";
|
|
7
|
+
import { useDevtoolsStrings as u } from "../strings.js";
|
|
8
8
|
import { useEffect as d, useState as f } from "react";
|
|
9
9
|
import { useFrameworkRuntimes as p } from "@voltro/client";
|
|
10
10
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
11
11
|
// src/panels/indexes.tsx
|
|
12
12
|
var _ = 5e3, v = async (e, t) => {
|
|
13
13
|
if (e === "") return null;
|
|
14
|
-
let n = await
|
|
14
|
+
let n = await s(`${e}/_voltro/inspect/subscriptions`, t);
|
|
15
15
|
return n !== null && Array.isArray(n.subscriptions) ? n : null;
|
|
16
16
|
}, y = (e) => {
|
|
17
|
-
let t = p(), n =
|
|
17
|
+
let t = p(), n = l(), r = o(), i = t.names, a = e && n, [s, u] = f(() => i.map((e) => ({
|
|
18
18
|
name: e,
|
|
19
19
|
response: null,
|
|
20
20
|
live: !1
|
|
@@ -22,17 +22,17 @@ var _ = 5e3, v = async (e, t) => {
|
|
|
22
22
|
return d(() => {
|
|
23
23
|
if (!a) return;
|
|
24
24
|
let e = !1, n = (t, n) => {
|
|
25
|
-
e ||
|
|
25
|
+
e || u((e) => e.map((e) => e.name === t ? {
|
|
26
26
|
...e,
|
|
27
27
|
...n
|
|
28
28
|
} : e));
|
|
29
29
|
}, o = i.map((i) => {
|
|
30
30
|
let a = t.get(i).inspectBaseUrl;
|
|
31
31
|
if (a === "") return { teardown: () => {} };
|
|
32
|
-
let o = null,
|
|
33
|
-
|
|
34
|
-
}, d = () =>
|
|
35
|
-
if (
|
|
32
|
+
let o = null, s = null, l, u = () => {
|
|
33
|
+
s !== null && clearInterval(s), s = null;
|
|
34
|
+
}, d = () => c(a) !== void 0, f = () => {
|
|
35
|
+
if (s !== null || d()) return;
|
|
36
36
|
let e = async () => {
|
|
37
37
|
let e = await v(a, r);
|
|
38
38
|
e !== null && n(i, {
|
|
@@ -40,7 +40,7 @@ var _ = 5e3, v = async (e, t) => {
|
|
|
40
40
|
live: !1
|
|
41
41
|
}), d() && (u(), o?.close());
|
|
42
42
|
};
|
|
43
|
-
e(),
|
|
43
|
+
e(), s = setInterval(() => {
|
|
44
44
|
e();
|
|
45
45
|
}, _);
|
|
46
46
|
};
|
|
@@ -77,7 +77,7 @@ var _ = 5e3, v = async (e, t) => {
|
|
|
77
77
|
t,
|
|
78
78
|
i,
|
|
79
79
|
r
|
|
80
|
-
]),
|
|
80
|
+
]), s;
|
|
81
81
|
}, b = (e) => {
|
|
82
82
|
if (typeof e != "object" || !e) return !1;
|
|
83
83
|
let t = e;
|
|
@@ -102,90 +102,90 @@ var _ = 5e3, v = async (e, t) => {
|
|
|
102
102
|
}
|
|
103
103
|
return typeof n.column == "string" && typeof n.op == "string" ? E(n) : JSON.stringify(e);
|
|
104
104
|
}, O = () => {
|
|
105
|
-
let
|
|
106
|
-
return
|
|
105
|
+
let e = y(!0), o = u().indexes, s = e.filter((e) => e.response !== null).length;
|
|
106
|
+
return e.length === 0 ? /* @__PURE__ */ h(r, { children: o.noApis }) : s === 0 ? /* @__PURE__ */ g(r, { children: [o.unreachableTitle, /* @__PURE__ */ h("div", {
|
|
107
107
|
className: "vdt:mt-1 vdt:text-foreground-subtle",
|
|
108
|
-
children:
|
|
108
|
+
children: o.unreachableHint
|
|
109
109
|
})] }) : /* @__PURE__ */ h("div", {
|
|
110
110
|
className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
|
|
111
|
-
children:
|
|
112
|
-
Icon:
|
|
113
|
-
children:
|
|
114
|
-
}), /* @__PURE__ */ h(
|
|
111
|
+
children: e.map(({ name: e, response: r, live: s }) => r === null ? /* @__PURE__ */ g(t, { children: [/* @__PURE__ */ h(i, {
|
|
112
|
+
Icon: a,
|
|
113
|
+
children: e
|
|
114
|
+
}), /* @__PURE__ */ h(n, {
|
|
115
115
|
className: "vdt:text-xs vdt:text-foreground-subtle",
|
|
116
|
-
children:
|
|
117
|
-
})] },
|
|
118
|
-
apiName:
|
|
119
|
-
response:
|
|
120
|
-
live:
|
|
121
|
-
},
|
|
116
|
+
children: o.offline
|
|
117
|
+
})] }, e) : /* @__PURE__ */ h(k, {
|
|
118
|
+
apiName: e,
|
|
119
|
+
response: r,
|
|
120
|
+
live: s
|
|
121
|
+
}, e))
|
|
122
122
|
});
|
|
123
|
-
}, k = ({ apiName:
|
|
124
|
-
let
|
|
125
|
-
return /* @__PURE__ */ g(
|
|
126
|
-
/* @__PURE__ */ h(
|
|
127
|
-
Icon:
|
|
123
|
+
}, k = ({ apiName: n, response: r, live: o }) => {
|
|
124
|
+
let s = u().indexes, c = [...r.subscriptions].sort((e, t) => t.subscriberCount - e.subscriberCount);
|
|
125
|
+
return /* @__PURE__ */ g(t, { children: [
|
|
126
|
+
/* @__PURE__ */ h(i, {
|
|
127
|
+
Icon: a,
|
|
128
128
|
right: /* @__PURE__ */ g("div", {
|
|
129
129
|
className: "vdt:flex vdt:items-center vdt:gap-1",
|
|
130
|
-
children: [/* @__PURE__ */ h(
|
|
130
|
+
children: [/* @__PURE__ */ h(e, {
|
|
131
131
|
tone: "info",
|
|
132
|
-
children:
|
|
133
|
-
}), /* @__PURE__ */ h(
|
|
134
|
-
tone:
|
|
135
|
-
children:
|
|
132
|
+
children: s.subsBadge(r.subscriptions.length)
|
|
133
|
+
}), /* @__PURE__ */ h(e, {
|
|
134
|
+
tone: o ? "success" : "neutral",
|
|
135
|
+
children: o ? s.live : s.poll
|
|
136
136
|
})]
|
|
137
137
|
}),
|
|
138
|
-
children:
|
|
138
|
+
children: n
|
|
139
139
|
}),
|
|
140
|
-
|
|
140
|
+
r.matcherStats.length > 0 && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
|
|
141
141
|
className: "vdt:text-[11px] vdt:uppercase vdt:tracking-wide vdt:text-foreground-subtle vdt:mt-3 vdt:mb-1",
|
|
142
|
-
children:
|
|
142
|
+
children: s.tables
|
|
143
143
|
}), /* @__PURE__ */ h("div", {
|
|
144
144
|
className: "vdt:flex vdt:flex-col vdt:gap-1",
|
|
145
|
-
children:
|
|
145
|
+
children: r.matcherStats.map((t) => /* @__PURE__ */ g("div", {
|
|
146
146
|
className: "vdt:flex vdt:items-baseline vdt:gap-3 vdt:text-xs",
|
|
147
147
|
children: [
|
|
148
148
|
/* @__PURE__ */ h("span", {
|
|
149
149
|
className: "vdt:font-mono vdt:text-foreground",
|
|
150
|
-
children:
|
|
150
|
+
children: t.tableName
|
|
151
151
|
}),
|
|
152
152
|
/* @__PURE__ */ g("span", {
|
|
153
153
|
className: "vdt:text-foreground-subtle",
|
|
154
|
-
children: [
|
|
154
|
+
children: [t.tupleRouted + t.columnBucketed + t.rangeBucketed + t.unindexedFallback, " subs"]
|
|
155
155
|
}),
|
|
156
|
-
|
|
156
|
+
t.tupleRouted > 0 && /* @__PURE__ */ h(e, {
|
|
157
157
|
tone: "success",
|
|
158
|
-
children: `${
|
|
158
|
+
children: `${t.tupleRouted} tuple`
|
|
159
159
|
}),
|
|
160
|
-
|
|
160
|
+
t.columnBucketed > 0 && /* @__PURE__ */ h(e, {
|
|
161
161
|
tone: "info",
|
|
162
|
-
children: `${
|
|
162
|
+
children: `${t.columnBucketed} column`
|
|
163
163
|
}),
|
|
164
|
-
|
|
164
|
+
t.rangeBucketed > 0 && /* @__PURE__ */ h(e, {
|
|
165
165
|
tone: "neutral",
|
|
166
|
-
children: `${
|
|
166
|
+
children: `${t.rangeBucketed} range`
|
|
167
167
|
}),
|
|
168
|
-
|
|
168
|
+
t.unindexedFallback > 0 && /* @__PURE__ */ h(e, {
|
|
169
169
|
tone: "warning",
|
|
170
|
-
children: `${
|
|
170
|
+
children: `${t.unindexedFallback} unindexed`
|
|
171
171
|
}),
|
|
172
|
-
|
|
172
|
+
t.distinctTupleKeys > 0 && /* @__PURE__ */ g("span", {
|
|
173
173
|
className: "vdt:text-foreground-subtle",
|
|
174
|
-
children: [
|
|
174
|
+
children: [t.distinctTupleKeys, " tuple keys"]
|
|
175
175
|
})
|
|
176
176
|
]
|
|
177
|
-
},
|
|
177
|
+
}, t.tableName))
|
|
178
178
|
})] }),
|
|
179
|
-
|
|
179
|
+
c.length > 0 && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", {
|
|
180
180
|
className: "vdt:text-[11px] vdt:uppercase vdt:tracking-wide vdt:text-foreground-subtle vdt:mt-3 vdt:mb-1",
|
|
181
|
-
children:
|
|
181
|
+
children: s.subscriptionsSection
|
|
182
182
|
}), /* @__PURE__ */ h("div", {
|
|
183
183
|
className: "vdt:flex vdt:flex-col vdt:gap-2",
|
|
184
|
-
children:
|
|
184
|
+
children: c.map((e) => /* @__PURE__ */ h(A, { sub: e }, e.fingerprint))
|
|
185
185
|
})] })
|
|
186
186
|
] });
|
|
187
|
-
}, A = ({ sub:
|
|
188
|
-
let
|
|
187
|
+
}, A = ({ sub: t }) => {
|
|
188
|
+
let n = u().indexes, r = S(t);
|
|
189
189
|
return /* @__PURE__ */ g("div", {
|
|
190
190
|
className: "vdt:flex vdt:flex-col vdt:gap-0.5 vdt:px-2 vdt:py-1 vdt:rounded-sm vdt:bg-muted/40",
|
|
191
191
|
children: [/* @__PURE__ */ g("div", {
|
|
@@ -193,35 +193,35 @@ var _ = 5e3, v = async (e, t) => {
|
|
|
193
193
|
children: [
|
|
194
194
|
/* @__PURE__ */ h("span", {
|
|
195
195
|
className: "vdt:font-mono vdt:text-foreground",
|
|
196
|
-
children:
|
|
196
|
+
children: t.table
|
|
197
197
|
}),
|
|
198
|
-
/* @__PURE__ */ h(
|
|
199
|
-
tone: C(
|
|
200
|
-
children: w(
|
|
198
|
+
/* @__PURE__ */ h(e, {
|
|
199
|
+
tone: C(r),
|
|
200
|
+
children: w(r)
|
|
201
201
|
}),
|
|
202
|
-
|
|
202
|
+
t.usingIndex && /* @__PURE__ */ g("span", {
|
|
203
203
|
className: "vdt:text-foreground-subtle",
|
|
204
204
|
children: [
|
|
205
|
-
|
|
205
|
+
n.via,
|
|
206
206
|
" ",
|
|
207
207
|
/* @__PURE__ */ h("span", {
|
|
208
208
|
className: "vdt:font-mono",
|
|
209
|
-
children:
|
|
209
|
+
children: t.usingIndex.name
|
|
210
210
|
})
|
|
211
211
|
]
|
|
212
212
|
}),
|
|
213
213
|
/* @__PURE__ */ g("span", {
|
|
214
214
|
className: "vdt:text-foreground-subtle vdt:ml-auto",
|
|
215
215
|
children: [
|
|
216
|
-
|
|
216
|
+
t.subscriberCount,
|
|
217
217
|
" ",
|
|
218
|
-
|
|
218
|
+
n.clients(t.subscriberCount)
|
|
219
219
|
]
|
|
220
220
|
})
|
|
221
221
|
]
|
|
222
222
|
}), /* @__PURE__ */ h("div", {
|
|
223
223
|
className: "vdt:text-[11px] vdt:font-mono vdt:text-foreground-subtle vdt:break-all",
|
|
224
|
-
children: D(
|
|
224
|
+
children: D(t.predicate)
|
|
225
225
|
})]
|
|
226
226
|
});
|
|
227
227
|
}, j = (e) => {
|