@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
package/dist/panels/pwa.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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 { Plug 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 { useAppUpdate as d, useInstallPrompt as f, useOfflineStatus as p } from "@voltro/web";
|
|
6
6
|
import { usePlatform as m } from "@voltro/client";
|
|
@@ -41,7 +41,7 @@ var v = (e, t) => ({
|
|
|
41
41
|
pushEndpointHost: c
|
|
42
42
|
};
|
|
43
43
|
}, S = (e) => e === "activated" ? "success" : e === null ? "neutral" : "warning", C = () => {
|
|
44
|
-
let v =
|
|
44
|
+
let v = s().pwa, y = d(), b = f(), C = p(), w = m(), [T, E] = u(null), D = c(() => {
|
|
45
45
|
x().then(E);
|
|
46
46
|
}, []);
|
|
47
47
|
if (l(() => {
|
|
@@ -50,21 +50,21 @@ var v = (e, t) => ({
|
|
|
50
50
|
return e?.serviceWorker?.addEventListener?.("controllerchange", D), () => {
|
|
51
51
|
e?.serviceWorker?.removeEventListener?.("controllerchange", D);
|
|
52
52
|
};
|
|
53
|
-
}, [D]), T === null) return /* @__PURE__ */ g(
|
|
54
|
-
if (!T.worker.supported) return /* @__PURE__ */ g(
|
|
53
|
+
}, [D]), T === null) return /* @__PURE__ */ g(r, { children: v.loading });
|
|
54
|
+
if (!T.worker.supported) return /* @__PURE__ */ g(r, { children: v.unsupported });
|
|
55
55
|
let O = T.worker;
|
|
56
56
|
return /* @__PURE__ */ _("div", {
|
|
57
57
|
className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
|
|
58
58
|
children: [
|
|
59
|
-
/* @__PURE__ */ _(
|
|
60
|
-
Icon:
|
|
61
|
-
right: /* @__PURE__ */ g(
|
|
59
|
+
/* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, {
|
|
60
|
+
Icon: o,
|
|
61
|
+
right: /* @__PURE__ */ g(t, {
|
|
62
62
|
size: "sm",
|
|
63
63
|
onClick: D,
|
|
64
64
|
children: v.refresh
|
|
65
65
|
}),
|
|
66
66
|
children: v.worker
|
|
67
|
-
}), /* @__PURE__ */ g(
|
|
67
|
+
}), /* @__PURE__ */ g(i, { entries: [
|
|
68
68
|
{
|
|
69
69
|
key: v.scope,
|
|
70
70
|
value: O.scope ?? v.none
|
|
@@ -75,21 +75,21 @@ var v = (e, t) => ({
|
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
key: "installing",
|
|
78
|
-
value: /* @__PURE__ */ g(
|
|
78
|
+
value: /* @__PURE__ */ g(e, {
|
|
79
79
|
tone: S(O.installing),
|
|
80
80
|
children: O.installing ?? v.none
|
|
81
81
|
})
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
key: "waiting",
|
|
85
|
-
value: /* @__PURE__ */ g(
|
|
85
|
+
value: /* @__PURE__ */ g(e, {
|
|
86
86
|
tone: S(O.waiting),
|
|
87
87
|
children: O.waiting ?? v.none
|
|
88
88
|
})
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
key: "active",
|
|
92
|
-
value: /* @__PURE__ */ g(
|
|
92
|
+
value: /* @__PURE__ */ g(e, {
|
|
93
93
|
tone: S(O.active),
|
|
94
94
|
children: O.active ?? v.none
|
|
95
95
|
})
|
|
@@ -99,14 +99,14 @@ var v = (e, t) => ({
|
|
|
99
99
|
value: O.backgroundSync ? v.yes : v.no
|
|
100
100
|
}
|
|
101
101
|
] })] }),
|
|
102
|
-
/* @__PURE__ */ _(
|
|
103
|
-
right: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(
|
|
102
|
+
/* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, {
|
|
103
|
+
right: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(t, {
|
|
104
104
|
size: "sm",
|
|
105
105
|
onClick: () => {
|
|
106
106
|
y.check();
|
|
107
107
|
},
|
|
108
108
|
children: v.checkNow
|
|
109
|
-
}), /* @__PURE__ */ g(
|
|
109
|
+
}), /* @__PURE__ */ g(t, {
|
|
110
110
|
size: "sm",
|
|
111
111
|
variant: "accent",
|
|
112
112
|
disabled: !y.updateAvailable,
|
|
@@ -116,7 +116,7 @@ var v = (e, t) => ({
|
|
|
116
116
|
children: v.forceUpdate
|
|
117
117
|
})] }),
|
|
118
118
|
children: v.update
|
|
119
|
-
}), /* @__PURE__ */ g(
|
|
119
|
+
}), /* @__PURE__ */ g(i, { entries: [
|
|
120
120
|
{
|
|
121
121
|
key: v.currentBuild,
|
|
122
122
|
value: w.platform.appVersion ?? v.unknown
|
|
@@ -130,15 +130,15 @@ var v = (e, t) => ({
|
|
|
130
130
|
value: C.online ? v.yes : v.no
|
|
131
131
|
}
|
|
132
132
|
] })] }),
|
|
133
|
-
/* @__PURE__ */ _(
|
|
133
|
+
/* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, { children: v.precache }), T.caches.length === 0 ? /* @__PURE__ */ g("div", {
|
|
134
134
|
className: "vdt:px-3 vdt:py-2 vdt:text-xs vdt:text-foreground-subtle",
|
|
135
135
|
children: v.noCaches
|
|
136
|
-
}) : /* @__PURE__ */ g(
|
|
136
|
+
}) : /* @__PURE__ */ g(i, { entries: T.caches.map((e) => ({
|
|
137
137
|
key: e.name,
|
|
138
138
|
value: v.entries(e.entries)
|
|
139
139
|
})) })] }),
|
|
140
|
-
/* @__PURE__ */ _(
|
|
141
|
-
right: b.canInstall ? /* @__PURE__ */ g(
|
|
140
|
+
/* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, {
|
|
141
|
+
right: b.canInstall ? /* @__PURE__ */ g(t, {
|
|
142
142
|
size: "sm",
|
|
143
143
|
onClick: () => {
|
|
144
144
|
b.install();
|
|
@@ -146,7 +146,7 @@ var v = (e, t) => ({
|
|
|
146
146
|
children: v.install
|
|
147
147
|
}) : void 0,
|
|
148
148
|
children: v.installAndPush
|
|
149
|
-
}), /* @__PURE__ */ g(
|
|
149
|
+
}), /* @__PURE__ */ g(i, { entries: [
|
|
150
150
|
{
|
|
151
151
|
key: v.installed,
|
|
152
152
|
value: b.installed ? v.yes : v.no
|
package/dist/panels/routes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Card as e, Empty as t, KeyValue as n, SectionTitle as r } from "../components/primitives.js";
|
|
2
|
+
import { Compass as i } from "../components/icons.js";
|
|
3
|
+
import { useDevtoolsStrings as a } from "../strings.js";
|
|
4
4
|
import { useEffect as o, useState as s, useSyncExternalStore as c } from "react";
|
|
5
5
|
import { getRouteSnapshot as l, subscribeRouteSnapshot as u } from "@voltro/web";
|
|
6
6
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
@@ -23,18 +23,18 @@ var p = (e) => {
|
|
|
23
23
|
};
|
|
24
24
|
}, []), e;
|
|
25
25
|
}, g = () => {
|
|
26
|
-
let o = m(), c = h(), l =
|
|
26
|
+
let o = m(), c = h(), l = a().routes, [u, g] = s(!0), _ = o.pathname === "/" && Object.keys(o.params).length === 0 && o.loaderData === void 0 && c !== "/" ? c : o.pathname, v = Object.entries(o.params).map(([e, t]) => ({
|
|
27
27
|
key: e,
|
|
28
28
|
value: String(t)
|
|
29
29
|
}));
|
|
30
30
|
return /* @__PURE__ */ f("div", {
|
|
31
31
|
className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
|
|
32
|
-
children: [/* @__PURE__ */ f(
|
|
33
|
-
/* @__PURE__ */ d(
|
|
34
|
-
Icon:
|
|
32
|
+
children: [/* @__PURE__ */ f(e, { children: [
|
|
33
|
+
/* @__PURE__ */ d(r, {
|
|
34
|
+
Icon: i,
|
|
35
35
|
children: l.currentRoute
|
|
36
36
|
}),
|
|
37
|
-
/* @__PURE__ */ d(
|
|
37
|
+
/* @__PURE__ */ d(n, { entries: [{
|
|
38
38
|
key: "pathname",
|
|
39
39
|
value: _
|
|
40
40
|
}, {
|
|
@@ -43,11 +43,11 @@ var p = (e) => {
|
|
|
43
43
|
}] }),
|
|
44
44
|
v.length > 0 ? /* @__PURE__ */ d("div", {
|
|
45
45
|
className: "vdt:px-3 vdt:pb-3",
|
|
46
|
-
children: /* @__PURE__ */ d(
|
|
46
|
+
children: /* @__PURE__ */ d(n, { entries: v })
|
|
47
47
|
}) : null
|
|
48
|
-
] }), /* @__PURE__ */ f(
|
|
49
|
-
/* @__PURE__ */ d(
|
|
50
|
-
Icon:
|
|
48
|
+
] }), /* @__PURE__ */ f(e, { children: [
|
|
49
|
+
/* @__PURE__ */ d(r, {
|
|
50
|
+
Icon: i,
|
|
51
51
|
children: l.loaderData
|
|
52
52
|
}),
|
|
53
53
|
/* @__PURE__ */ d("button", {
|
|
@@ -55,7 +55,7 @@ var p = (e) => {
|
|
|
55
55
|
className: "vdt:px-3 vdt:py-1.5 vdt:text-[10px] vdt:uppercase vdt:tracking-wider vdt:text-foreground-muted vdt:hover:text-foreground",
|
|
56
56
|
children: u ? l.collapse : l.expand
|
|
57
57
|
}),
|
|
58
|
-
u ? o.loaderData === void 0 ? /* @__PURE__ */ f(
|
|
58
|
+
u ? o.loaderData === void 0 ? /* @__PURE__ */ f(t, { children: [l.noLoaderTitle, /* @__PURE__ */ d("div", {
|
|
59
59
|
className: "vdt:mt-1 vdt:text-foreground-subtle",
|
|
60
60
|
children: l.noLoaderHint(/* @__PURE__ */ d("code", { children: "<Router>" }))
|
|
61
61
|
})] }) : /* @__PURE__ */ d("pre", {
|
package/dist/panels/runtimes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Badge as e, Card as t, Empty as n, KeyValue as r, SectionTitle as i } from "../components/primitives.js";
|
|
2
|
+
import { Plug as a } from "../components/icons.js";
|
|
3
|
+
import { useDevtoolsStrings as o } from "../strings.js";
|
|
4
4
|
import { useFrameworkRuntimes as s } from "@voltro/client";
|
|
5
5
|
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
6
6
|
// src/panels/runtimes.tsx
|
|
@@ -15,22 +15,22 @@ var u = (e) => {
|
|
|
15
15
|
workflows: a
|
|
16
16
|
};
|
|
17
17
|
}, d = () => {
|
|
18
|
-
let d = s(), f =
|
|
19
|
-
return p.length === 0 ? /* @__PURE__ */ l(
|
|
18
|
+
let d = s(), f = o().runtimes, p = d.names;
|
|
19
|
+
return p.length === 0 ? /* @__PURE__ */ l(n, { children: [f.emptyTitle, /* @__PURE__ */ c("div", {
|
|
20
20
|
className: "vdt:mt-1 vdt:text-foreground-subtle",
|
|
21
21
|
children: f.emptyHint
|
|
22
22
|
})] }) : /* @__PURE__ */ c("div", {
|
|
23
23
|
className: "vdt:flex vdt:flex-col vdt:gap-3 vdt:p-3",
|
|
24
|
-
children: p.map((
|
|
25
|
-
let
|
|
26
|
-
return /* @__PURE__ */ l(
|
|
27
|
-
Icon:
|
|
28
|
-
right: /* @__PURE__ */ c(
|
|
24
|
+
children: p.map((n) => {
|
|
25
|
+
let o = d.get(n), s = u(o.descriptors);
|
|
26
|
+
return /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(i, {
|
|
27
|
+
Icon: a,
|
|
28
|
+
right: /* @__PURE__ */ c(e, {
|
|
29
29
|
tone: "success",
|
|
30
30
|
children: f.live
|
|
31
31
|
}),
|
|
32
|
-
children:
|
|
33
|
-
}), /* @__PURE__ */ c(
|
|
32
|
+
children: n
|
|
33
|
+
}), /* @__PURE__ */ c(r, { entries: [
|
|
34
34
|
{
|
|
35
35
|
key: "queries",
|
|
36
36
|
value: String(s.queries)
|
|
@@ -53,13 +53,13 @@ var u = (e) => {
|
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
key: "cacheSize",
|
|
56
|
-
value: String(
|
|
56
|
+
value: String(o.cache.size())
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
key: "descriptors",
|
|
60
|
-
value: String(Object.keys(
|
|
60
|
+
value: String(Object.keys(o.descriptors).length)
|
|
61
61
|
}
|
|
62
|
-
] })] },
|
|
62
|
+
] })] }, n);
|
|
63
63
|
})
|
|
64
64
|
});
|
|
65
65
|
};
|
package/dist/panels/stores.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
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 { ArrowUpDown as o, Database as s, Trash as c } from "../components/icons.js";
|
|
3
3
|
import { useState as l, useSyncExternalStore as u } from "react";
|
|
4
4
|
import { clearStoreHistory as d, definedStores as f, storeHistory as p, subscribeStoreHistory as m, travelToStoreState as h } from "@voltro/client";
|
|
5
5
|
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
@@ -12,22 +12,22 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
|
|
|
12
12
|
n = String(e);
|
|
13
13
|
}
|
|
14
14
|
return n.length > t ? `${n.slice(0, t)}…` : n;
|
|
15
|
-
}, x = (e, t) => typeof e != "object" || typeof t != "object" || e === null || t === null ? [] : [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => !Object.is(e[n], t[n])), S = ({ label:
|
|
16
|
-
let [
|
|
15
|
+
}, x = (e, t) => typeof e != "object" || typeof t != "object" || e === null || t === null ? [] : [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => !Object.is(e[n], t[n])), S = ({ label: t, state: n }) => {
|
|
16
|
+
let [r, a] = l(!1);
|
|
17
17
|
return /* @__PURE__ */ v("div", {
|
|
18
18
|
className: "vdt:border-t vdt:border-border",
|
|
19
19
|
children: [/* @__PURE__ */ v("button", {
|
|
20
20
|
type: "button",
|
|
21
21
|
className: "vdt:flex vdt:w-full vdt:items-center vdt:gap-2 vdt:px-3 vdt:py-2 vdt:text-left vdt:hover:bg-muted",
|
|
22
|
-
onClick: () =>
|
|
23
|
-
children: [/* @__PURE__ */ _(
|
|
22
|
+
onClick: () => a((e) => !e),
|
|
23
|
+
children: [/* @__PURE__ */ _(e, {
|
|
24
24
|
tone: "neutral",
|
|
25
|
-
children:
|
|
25
|
+
children: t
|
|
26
26
|
}), /* @__PURE__ */ _("span", {
|
|
27
27
|
className: "vdt:truncate vdt:font-mono vdt:text-[11px] vdt:text-foreground-muted",
|
|
28
|
-
children: b(
|
|
28
|
+
children: b(n)
|
|
29
29
|
})]
|
|
30
|
-
}),
|
|
30
|
+
}), r ? /* @__PURE__ */ _(i, { entries: Object.entries(n).map(([e, t]) => ({
|
|
31
31
|
key: e,
|
|
32
32
|
value: b(t, 200)
|
|
33
33
|
})) }) : null]
|
|
@@ -35,13 +35,13 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
|
|
|
35
35
|
}, C = () => {
|
|
36
36
|
let u = y(), [p, m] = l(null), C = f(), w = p ?? u.length;
|
|
37
37
|
return /* @__PURE__ */ v(g, { children: [
|
|
38
|
-
/* @__PURE__ */ v(
|
|
39
|
-
Icon:
|
|
40
|
-
right: /* @__PURE__ */ v(
|
|
38
|
+
/* @__PURE__ */ v(a, {
|
|
39
|
+
Icon: s,
|
|
40
|
+
right: /* @__PURE__ */ v(t, {
|
|
41
41
|
onClick: () => {
|
|
42
42
|
d(), m(null);
|
|
43
43
|
},
|
|
44
|
-
children: [/* @__PURE__ */ _(
|
|
44
|
+
children: [/* @__PURE__ */ _(c, {}), "Clear"]
|
|
45
45
|
}),
|
|
46
46
|
children: [
|
|
47
47
|
"Stores (",
|
|
@@ -49,8 +49,8 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
|
|
|
49
49
|
")"
|
|
50
50
|
]
|
|
51
51
|
}),
|
|
52
|
-
C.length === 0 ? /* @__PURE__ */ _(
|
|
53
|
-
/* @__PURE__ */ _(
|
|
52
|
+
C.length === 0 ? /* @__PURE__ */ _(r, { children: "No stores defined. `defineStore(name, () => state)` in a *.store.ts file." }) : C.map((e) => /* @__PURE__ */ v(n, { children: [
|
|
53
|
+
/* @__PURE__ */ _(a, { children: e.name }),
|
|
54
54
|
/* @__PURE__ */ _(S, {
|
|
55
55
|
label: "global",
|
|
56
56
|
state: e.get()
|
|
@@ -60,15 +60,15 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
|
|
|
60
60
|
state: e.get(t)
|
|
61
61
|
}, t))
|
|
62
62
|
] }, e.name)),
|
|
63
|
-
/* @__PURE__ */ v(
|
|
64
|
-
Icon:
|
|
65
|
-
right: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(
|
|
63
|
+
/* @__PURE__ */ v(a, {
|
|
64
|
+
Icon: o,
|
|
65
|
+
right: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(t, {
|
|
66
66
|
onClick: () => {
|
|
67
67
|
w <= 0 || h(w - 1, "before") && m(w - 1);
|
|
68
68
|
},
|
|
69
69
|
disabled: w <= 0,
|
|
70
70
|
children: "◀ Back"
|
|
71
|
-
}), /* @__PURE__ */ _(
|
|
71
|
+
}), /* @__PURE__ */ _(t, {
|
|
72
72
|
onClick: () => {
|
|
73
73
|
p === null || w >= u.length || h(w, "after") && m(w + 1);
|
|
74
74
|
},
|
|
@@ -82,42 +82,42 @@ var y = () => u(m, p, p), b = (e, t = 90) => {
|
|
|
82
82
|
p === null ? "" : ` — travelled to ${w}/${u.length}`
|
|
83
83
|
]
|
|
84
84
|
}),
|
|
85
|
-
u.length === 0 ? /* @__PURE__ */ _(
|
|
86
|
-
let
|
|
87
|
-
return /* @__PURE__ */ v(
|
|
85
|
+
u.length === 0 ? /* @__PURE__ */ _(r, { children: "No writes yet. Every `set()` lands here, labelled if you pass one." }) : [...u].reverse().map((t, r) => {
|
|
86
|
+
let a = u.length - 1 - r, o = x(t.prev, t.next);
|
|
87
|
+
return /* @__PURE__ */ v(n, { children: [/* @__PURE__ */ v("div", {
|
|
88
88
|
className: "vdt:flex vdt:items-center vdt:gap-2 vdt:px-3 vdt:py-2",
|
|
89
89
|
children: [
|
|
90
|
-
/* @__PURE__ */ _(
|
|
91
|
-
tone:
|
|
92
|
-
children:
|
|
90
|
+
/* @__PURE__ */ _(e, {
|
|
91
|
+
tone: t.isUndo === !0 ? "warning" : "neutral",
|
|
92
|
+
children: t.store
|
|
93
93
|
}),
|
|
94
|
-
|
|
94
|
+
t.key === void 0 ? null : /* @__PURE__ */ _(e, {
|
|
95
95
|
tone: "neutral",
|
|
96
|
-
children:
|
|
96
|
+
children: t.key
|
|
97
97
|
}),
|
|
98
|
-
|
|
98
|
+
t.label === void 0 ? null : /* @__PURE__ */ _("span", {
|
|
99
99
|
className: "vdt:truncate vdt:font-mono vdt:text-[11px] vdt:text-foreground-muted",
|
|
100
|
-
children:
|
|
100
|
+
children: t.label
|
|
101
101
|
}),
|
|
102
|
-
p !== null &&
|
|
102
|
+
p !== null && a === w ? /* @__PURE__ */ _(e, {
|
|
103
103
|
tone: "info",
|
|
104
104
|
children: "here"
|
|
105
105
|
}) : null
|
|
106
106
|
]
|
|
107
|
-
}), /* @__PURE__ */ _(
|
|
107
|
+
}), /* @__PURE__ */ _(i, { entries: [
|
|
108
108
|
{
|
|
109
109
|
key: "changed",
|
|
110
|
-
value:
|
|
110
|
+
value: o.length > 0 ? o.join(", ") : "(no field diff)"
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
key: "before",
|
|
114
|
-
value: b(
|
|
114
|
+
value: b(t.prev)
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
117
|
key: "after",
|
|
118
|
-
value: b(
|
|
118
|
+
value: b(t.next)
|
|
119
119
|
}
|
|
120
|
-
] })] }, `${
|
|
120
|
+
] })] }, `${t.at}-${a}`);
|
|
121
121
|
})
|
|
122
122
|
] });
|
|
123
123
|
};
|
package/dist/panels/traces.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useDocumentVisible as e } from "../useDocumentVisible.js";
|
|
2
|
+
import { ChevronDown as t } from "../components/icons.js";
|
|
3
3
|
import { useInspectToken as n } from "../inspectAuth.js";
|
|
4
4
|
import { fetchInspect as r } from "../inspectFetch.js";
|
|
5
|
-
import {
|
|
5
|
+
import { useDevtoolsStrings as i } from "../strings.js";
|
|
6
6
|
import { useEffect as a, useState as o } from "react";
|
|
7
7
|
import { useFrameworkRuntimes as s } from "@voltro/client";
|
|
8
8
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
@@ -11,8 +11,8 @@ var d = 4e3, f = async (e, t, n = !1) => {
|
|
|
11
11
|
if (e === "") return null;
|
|
12
12
|
let i = await r(`${e}/_voltro/inspect/traces${n ? "?includeBackground=1" : ""}`, t);
|
|
13
13
|
return i !== null && Array.isArray(i.traces) ? i : null;
|
|
14
|
-
}, p = [], m = (
|
|
15
|
-
let
|
|
14
|
+
}, p = [], m = (t, r = !1) => {
|
|
15
|
+
let i = s(), c = e(), l = n(), u = i.names.join(","), [m, h] = o(p), g = t && c;
|
|
16
16
|
return a(() => {
|
|
17
17
|
if (!g) {
|
|
18
18
|
h(p);
|
|
@@ -20,34 +20,34 @@ var d = 4e3, f = async (e, t, n = !1) => {
|
|
|
20
20
|
}
|
|
21
21
|
let e = u === "" ? [] : u.split(",").map((e) => ({
|
|
22
22
|
name: e,
|
|
23
|
-
baseUrl:
|
|
23
|
+
baseUrl: i.get(e).inspectBaseUrl
|
|
24
24
|
})).filter((e) => e.baseUrl !== "");
|
|
25
25
|
if (e.length === 0) {
|
|
26
26
|
h(p);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
let
|
|
30
|
-
let
|
|
31
|
-
if (
|
|
29
|
+
let t = !1, n = async () => {
|
|
30
|
+
let n = await Promise.all(e.map((e) => f(e.baseUrl, l, r)));
|
|
31
|
+
if (t) return;
|
|
32
32
|
let i = [];
|
|
33
|
-
|
|
33
|
+
n.forEach((t, n) => {
|
|
34
34
|
if (t !== null) for (let r of t.traces) i.push({
|
|
35
35
|
apiName: e[n].name,
|
|
36
36
|
trace: r
|
|
37
37
|
});
|
|
38
38
|
}), h(i);
|
|
39
39
|
};
|
|
40
|
-
|
|
41
|
-
let a = setInterval(
|
|
40
|
+
n();
|
|
41
|
+
let a = setInterval(n, d);
|
|
42
42
|
return () => {
|
|
43
|
-
|
|
43
|
+
t = !0, clearInterval(a);
|
|
44
44
|
};
|
|
45
45
|
}, [
|
|
46
|
-
|
|
46
|
+
i,
|
|
47
47
|
u,
|
|
48
48
|
g,
|
|
49
49
|
l,
|
|
50
|
-
|
|
50
|
+
r
|
|
51
51
|
]), m;
|
|
52
52
|
}, h = (e) => e < 1 ? "<1ms" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(2)}s`, g = (e) => {
|
|
53
53
|
let t = new Map(e.map((e) => [e.spanId, e])), n = /* @__PURE__ */ new Map(), r = (e, i) => {
|
|
@@ -65,55 +65,55 @@ var d = 4e3, f = async (e, t, n = !1) => {
|
|
|
65
65
|
} catch {
|
|
66
66
|
return String(e);
|
|
67
67
|
}
|
|
68
|
-
}, v = (e) => typeof e.attributes["db.query.text"] == "string" || e.name.startsWith("sql."), y = ({ trace:
|
|
69
|
-
let
|
|
68
|
+
}, v = (e) => typeof e.attributes["db.query.text"] == "string" || e.name.startsWith("sql."), y = ({ trace: e }) => {
|
|
69
|
+
let n = i().traces, r = g(e.spans), a = new Set(e.spans.map((e) => e.spanId)), o = e.spans.some((e) => e.parentSpanId !== null && !a.has(e.parentSpanId)), s = e.spans.length > 0 && e.spans.every(v), d = e.durationMs > 0 ? e.durationMs : 1;
|
|
70
70
|
return /* @__PURE__ */ u("div", {
|
|
71
71
|
className: "vdt-trace-detail",
|
|
72
72
|
children: [
|
|
73
73
|
/* @__PURE__ */ u("div", {
|
|
74
74
|
className: "vdt-trace-summary",
|
|
75
|
-
children: [/* @__PURE__ */ l("span", { children:
|
|
76
|
-
|
|
75
|
+
children: [/* @__PURE__ */ l("span", { children: n.spans(e.spanCount) }), e.kind === "subscription" ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("span", { children: [
|
|
76
|
+
e.deliveryCount ?? 0,
|
|
77
77
|
" ",
|
|
78
|
-
|
|
79
|
-
] }),
|
|
80
|
-
|
|
78
|
+
n.delivery(e.deliveryCount ?? 0)
|
|
79
|
+
] }), e.lastDeliveryMs === void 0 ? null : /* @__PURE__ */ u("span", { children: [
|
|
80
|
+
n.lastDelivery,
|
|
81
81
|
": ",
|
|
82
|
-
/* @__PURE__ */ l("strong", { children: h(
|
|
82
|
+
/* @__PURE__ */ l("strong", { children: h(e.lastDeliveryMs) })
|
|
83
83
|
] })] }) : /* @__PURE__ */ u("span", { children: [
|
|
84
|
-
|
|
84
|
+
n.duration,
|
|
85
85
|
": ",
|
|
86
|
-
/* @__PURE__ */ l("strong", { children: h(
|
|
86
|
+
/* @__PURE__ */ l("strong", { children: h(e.durationMs) })
|
|
87
87
|
] })]
|
|
88
88
|
}),
|
|
89
89
|
/* @__PURE__ */ u("code", {
|
|
90
90
|
className: "vdt-trace-id",
|
|
91
|
-
children: ["trace ",
|
|
91
|
+
children: ["trace ", e.traceId]
|
|
92
92
|
}),
|
|
93
93
|
o || s ? /* @__PURE__ */ l("p", {
|
|
94
94
|
className: "vdt-trace-context",
|
|
95
|
-
children: o ?
|
|
95
|
+
children: o ? n.missingParents : n.sqlWithoutCaller
|
|
96
96
|
}) : null,
|
|
97
|
-
|
|
98
|
-
let a = Math.min(
|
|
97
|
+
e.spans.map((i) => {
|
|
98
|
+
let a = Math.min(r.get(i.spanId) ?? 0, 8), o = Math.max(0, Math.min(100, (i.startMs - e.startMs) / d * 100)), s = Math.max(0, Math.min(100 - o, Math.max(1.5, i.durationMs / d * 100))), f = Object.entries(i.attributes);
|
|
99
99
|
return /* @__PURE__ */ u("details", {
|
|
100
100
|
className: "vdt-trace-span",
|
|
101
|
-
open:
|
|
102
|
-
"data-status":
|
|
101
|
+
open: i.status === "error",
|
|
102
|
+
"data-status": i.status,
|
|
103
103
|
children: [/* @__PURE__ */ u("summary", {
|
|
104
104
|
className: "vdt-trace-span-head",
|
|
105
105
|
style: { paddingLeft: 8 + a * 8 },
|
|
106
106
|
children: [
|
|
107
107
|
/* @__PURE__ */ u("span", {
|
|
108
108
|
className: "vdt-trace-span-label",
|
|
109
|
-
children: [/* @__PURE__ */ l(
|
|
109
|
+
children: [/* @__PURE__ */ l(t, { className: "vdt-trace-chevron" }), /* @__PURE__ */ l("code", {
|
|
110
110
|
className: "vdt-trace-span-name",
|
|
111
|
-
children:
|
|
111
|
+
children: i.name
|
|
112
112
|
})]
|
|
113
113
|
}),
|
|
114
114
|
/* @__PURE__ */ l("span", {
|
|
115
115
|
className: "vdt-trace-span-duration",
|
|
116
|
-
children: h(
|
|
116
|
+
children: h(i.durationMs)
|
|
117
117
|
}),
|
|
118
118
|
/* @__PURE__ */ l("span", {
|
|
119
119
|
className: "vdt-trace-span-bar",
|
|
@@ -130,28 +130,28 @@ var d = 4e3, f = async (e, t, n = !1) => {
|
|
|
130
130
|
/* @__PURE__ */ u("div", {
|
|
131
131
|
className: "vdt-trace-span-meta",
|
|
132
132
|
children: [
|
|
133
|
-
/* @__PURE__ */ l("span", { children:
|
|
134
|
-
/* @__PURE__ */ l("span", { children:
|
|
135
|
-
/* @__PURE__ */ l("code", { children:
|
|
133
|
+
/* @__PURE__ */ l("span", { children: i.kind }),
|
|
134
|
+
/* @__PURE__ */ l("span", { children: i.status }),
|
|
135
|
+
/* @__PURE__ */ l("code", { children: i.spanId })
|
|
136
136
|
]
|
|
137
137
|
}),
|
|
138
|
-
|
|
138
|
+
i.statusMessage ? /* @__PURE__ */ l("p", {
|
|
139
139
|
className: "vdt-trace-span-message",
|
|
140
|
-
children:
|
|
140
|
+
children: i.statusMessage
|
|
141
141
|
}) : null,
|
|
142
142
|
f.length > 0 ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", {
|
|
143
143
|
className: "vdt-trace-attributes-label",
|
|
144
|
-
children:
|
|
144
|
+
children: n.attributes
|
|
145
145
|
}), /* @__PURE__ */ l("dl", {
|
|
146
146
|
className: "vdt-trace-attributes",
|
|
147
147
|
children: f.map(([e, t]) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("dt", { children: e }), /* @__PURE__ */ l("dd", { children: /* @__PURE__ */ l("pre", { children: _(t) }) })] }, e))
|
|
148
148
|
})] }) : /* @__PURE__ */ l("p", {
|
|
149
149
|
className: "vdt-trace-no-attributes",
|
|
150
|
-
children:
|
|
150
|
+
children: n.noAttributes
|
|
151
151
|
})
|
|
152
152
|
]
|
|
153
153
|
})]
|
|
154
|
-
},
|
|
154
|
+
}, i.spanId);
|
|
155
155
|
})
|
|
156
156
|
]
|
|
157
157
|
});
|