adonisjs-server-stats 1.8.0 → 1.10.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/dist/core/index.js +24 -22
- package/dist/core/log-utils.d.ts +14 -0
- package/dist/core/split-pane.d.ts +18 -0
- package/dist/core/trace-utils.d.ts +5 -0
- package/dist/core/types.d.ts +1 -1
- package/dist/react/{CacheSection-D5J5moz7.js → CacheSection-UCMptWyn.js} +1 -1
- package/dist/react/{CacheTab-F1MkWSZl.js → CacheTab-CA8LB1J5.js} +1 -1
- package/dist/react/{ConfigSection-DerLBu4o.js → ConfigSection-DfFd-WRq.js} +1 -1
- package/dist/react/{ConfigTab-Bsj7v9JW.js → ConfigTab-Bdg8YMer.js} +1 -1
- package/dist/react/{CustomPaneTab-gzdtDEvz.js → CustomPaneTab-Bxtv_8Rw.js} +1 -1
- package/dist/react/{EmailsSection-ndH3cvJk.js → EmailsSection-CM7stSyh.js} +1 -1
- package/dist/react/{EmailsTab-DVPHRx0L.js → EmailsTab-BDhEiomM.js} +1 -1
- package/dist/react/{EventsSection-ClIByDSk.js → EventsSection-ByQ-9blq.js} +1 -1
- package/dist/react/{EventsTab-CCzWEKrk.js → EventsTab-CMfY98Rl.js} +1 -1
- package/dist/react/{JobsSection-CVMyAs7O.js → JobsSection-DF3qEv9O.js} +1 -1
- package/dist/react/{JobsTab-CATUyb9V.js → JobsTab-BbrBWIOb.js} +1 -1
- package/dist/react/LogsSection-DcFTZY7b.js +227 -0
- package/dist/react/LogsTab-CicucmVk.js +103 -0
- package/dist/react/{OverviewSection-ae5AO2RG.js → OverviewSection-C4T1ur51.js} +1 -1
- package/dist/react/{QueriesSection-DFFr9Tbb.js → QueriesSection-PswteoF9.js} +1 -1
- package/dist/react/{QueriesTab-GrHRAREt.js → QueriesTab-osLUWd4L.js} +1 -1
- package/dist/react/RelatedLogs-DFDOyUMr.js +40 -0
- package/dist/react/RequestsSection-Nag30rEA.js +341 -0
- package/dist/react/{RoutesSection-F7nANhF0.js → RoutesSection-BUSkM6PY.js} +1 -1
- package/dist/react/{RoutesTab-rugjhCPH.js → RoutesTab-DgVzd2PZ.js} +1 -1
- package/dist/react/TimelineTab-Covg5weo.js +220 -0
- package/dist/react/{index-DDzo1bZk.js → index-Cflz9Ebj.js} +390 -395
- package/dist/react/index.js +1 -1
- package/dist/react/react/components/shared/JsonViewer.d.ts +2 -1
- package/dist/react/react/components/shared/RelatedLogs.d.ts +7 -0
- package/dist/react/style.css +1 -1
- package/dist/src/controller/debug_controller.js +1 -1
- package/dist/src/dashboard/dashboard_controller.js +13 -0
- package/dist/src/dashboard/dashboard_store.d.ts +1 -0
- package/dist/src/dashboard/dashboard_store.js +88 -41
- package/dist/src/dashboard/migrator.js +6 -0
- package/dist/src/data/data_access.d.ts +7 -0
- package/dist/src/data/data_access.js +32 -1
- package/dist/src/debug/trace_collector.d.ts +1 -1
- package/dist/src/debug/trace_collector.js +2 -1
- package/dist/src/debug/types.d.ts +4 -0
- package/dist/src/edge/client/dashboard.js +2 -2
- package/dist/src/edge/client/debug-panel-deferred.js +1 -1
- package/dist/src/edge/client-vue/dashboard.js +4 -4
- package/dist/src/edge/client-vue/debug-panel-deferred.js +3 -3
- package/dist/src/middleware/request_tracking_middleware.d.ts +1 -0
- package/dist/src/middleware/request_tracking_middleware.js +3 -1
- package/dist/src/provider/server_stats_provider.d.ts +3 -3
- package/dist/src/provider/server_stats_provider.js +29 -15
- package/dist/src/routes/register_routes.js +7 -2
- package/dist/src/styles/components.css +162 -0
- package/dist/src/styles/debug-panel.css +9 -0
- package/dist/src/types.d.ts +1 -1
- package/dist/vue/{CacheSection-DDvJ7bs2.js → CacheSection-oFAJL3mo.js} +2 -2
- package/dist/vue/{ConfigSection-GTCrvsPr.js → ConfigSection-BhfJ4KqL.js} +1 -1
- package/dist/vue/{EmailsSection-Ct5vsLCc.js → EmailsSection-BcNyhyHs.js} +1 -1
- package/dist/vue/{EventsSection-CRVhtagq.js → EventsSection-r60Q5Lmu.js} +2 -2
- package/dist/vue/{EventsTab-DQ4Nd6AK.js → EventsTab-BBM7olXF.js} +1 -1
- package/dist/vue/{JobsSection-B_wH2Co7.js → JobsSection-BHL-hkQw.js} +2 -2
- package/dist/vue/{JobsTab-BCvhOARO.js → JobsTab-WFnxPdN7.js} +1 -1
- package/dist/vue/{JsonViewer.vue_vue_type_script_setup_true_lang-Vsqar1zx.js → JsonViewer.vue_vue_type_script_setup_true_lang-Bid05zpm.js} +25 -23
- package/dist/vue/LogsSection-DRMGzJmg.js +252 -0
- package/dist/vue/LogsTab-Bg3o0Mm6.js +147 -0
- package/dist/vue/{OverviewSection-BqSwuMKH.js → OverviewSection-CXh6Ja1B.js} +1 -1
- package/dist/vue/{QueriesSection-D4Fs0YH6.js → QueriesSection-IodIsCJ-.js} +1 -1
- package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js +84 -0
- package/dist/vue/RequestsSection-BPuMdmMc.js +401 -0
- package/dist/vue/{RoutesSection-Ys5dTzvF.js → RoutesSection-NKo3Rbq3.js} +1 -1
- package/dist/vue/TimelineTab-zj5Z5OdT.js +338 -0
- package/dist/vue/components/Dashboard/sections/RequestsSection.vue.d.ts +4 -0
- package/dist/vue/components/DebugPanel/tabs/TimelineTab.vue.d.ts +4 -0
- package/dist/vue/components/shared/JsonViewer.vue.d.ts +3 -0
- package/dist/vue/components/{Dashboard/sections/TimelineSection.vue.d.ts → shared/RelatedLogs.vue.d.ts} +5 -6
- package/dist/vue/index-Dtgysd26.js +1229 -0
- package/dist/vue/index.js +1 -1
- package/dist/vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/react/LogsSection-hAsLaKOC.js +0 -212
- package/dist/react/LogsTab-QouH4NPQ.js +0 -88
- package/dist/react/RequestsSection-DtwnJOnM.js +0 -209
- package/dist/react/TimelineSection-F5ThmTdy.js +0 -158
- package/dist/react/TimelineTab-Dvpf-I5C.js +0 -193
- package/dist/react/WaterfallChart-Cj73WdfM.js +0 -100
- package/dist/react/react/components/Dashboard/sections/TimelineSection.d.ts +0 -8
- package/dist/vue/LogsSection-C4NRFOpA.js +0 -227
- package/dist/vue/LogsTab-DpEQ7euu.js +0 -122
- package/dist/vue/RequestsSection-B0A5SKcM.js +0 -243
- package/dist/vue/TimelineSection-D38iHB08.js +0 -186
- package/dist/vue/TimelineTab-Db6lKKsD.js +0 -250
- package/dist/vue/WaterfallChart.vue_vue_type_script_setup_true_lang-tZ13cNj1.js +0 -118
- package/dist/vue/index-Bj6pm5g3.js +0 -1235
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { DEFAULT_FEATURES as
|
|
4
|
-
import { createPortal as
|
|
1
|
+
import { jsx as e, jsxs as l, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import V, { useState as y, useRef as j, useEffect as R, useCallback as B, useMemo as O, Suspense as F, lazy as T } from "react";
|
|
3
|
+
import { DEFAULT_FEATURES as K, detectFeatures as G, ServerStatsController as Q, getTheme as X, onThemeChange as Y, toggleTheme as Z, buildSparklineData as ee, computeStats as se, formatStatNum as U, detectMetricGroupsFromStats as te, getVisibleMetricGroups as ne, METRIC_DEFINITIONS as oe, TAB_ICONS as L, DashboardDataController as re, subscribeToChannel as ie, DebugDataController as ae, compactPreview as le } from "adonisjs-server-stats/core";
|
|
4
|
+
import { createPortal as ce } from "react-dom";
|
|
5
5
|
function z(s = {}) {
|
|
6
|
-
const { baseUrl: i = "", debugEndpoint: t = "/admin/api/debug", authToken:
|
|
6
|
+
const { baseUrl: i = "", debugEndpoint: t = "/admin/api/debug", authToken: o } = s, [a, d] = y(K), [g, n] = y(!0), [v, p] = y(null), h = j(!1);
|
|
7
7
|
return R(() => {
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
let
|
|
8
|
+
if (h.current) return;
|
|
9
|
+
h.current = !0;
|
|
10
|
+
let u = !1;
|
|
11
11
|
return (async () => {
|
|
12
12
|
try {
|
|
13
|
-
const f = await
|
|
14
|
-
|
|
13
|
+
const f = await G({ baseUrl: i, debugEndpoint: t, authToken: o });
|
|
14
|
+
u || (d(f), n(!1));
|
|
15
15
|
} catch (f) {
|
|
16
|
-
|
|
16
|
+
u || (p(f instanceof Error ? f : new Error(String(f))), n(!1));
|
|
17
17
|
}
|
|
18
18
|
})(), () => {
|
|
19
|
-
|
|
19
|
+
u = !0;
|
|
20
20
|
};
|
|
21
|
-
}, [i, t,
|
|
21
|
+
}, [i, t, o]), { features: a, isLoading: g, error: v };
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function de(s = {}) {
|
|
24
24
|
const {
|
|
25
25
|
baseUrl: i = "",
|
|
26
26
|
endpoint: t = "/admin/api/server-stats",
|
|
27
|
-
channelName:
|
|
27
|
+
channelName: o = "admin/server-stats",
|
|
28
28
|
authToken: a,
|
|
29
|
-
pollInterval:
|
|
30
|
-
} = s, [
|
|
29
|
+
pollInterval: d = 3e3
|
|
30
|
+
} = s, [g, n] = y(null), [v, p] = y(!1), [h, u] = y(!1), [w, f] = y(null), [b, k] = y(!1), E = j(null);
|
|
31
31
|
R(() => {
|
|
32
32
|
if (b) return;
|
|
33
|
-
const I = new
|
|
33
|
+
const I = new Q({
|
|
34
34
|
baseUrl: i,
|
|
35
35
|
endpoint: t,
|
|
36
|
-
channelName:
|
|
36
|
+
channelName: o,
|
|
37
37
|
authToken: a,
|
|
38
|
-
pollInterval:
|
|
39
|
-
onStatsUpdate: (C) =>
|
|
38
|
+
pollInterval: d,
|
|
39
|
+
onStatsUpdate: (C) => n(C),
|
|
40
40
|
onConnectionChange: (C) => p(C),
|
|
41
|
-
onStaleChange: (C) =>
|
|
41
|
+
onStaleChange: (C) => u(C),
|
|
42
42
|
onError: (C) => f(C),
|
|
43
|
-
onUnauthorizedChange: (C) =>
|
|
43
|
+
onUnauthorizedChange: (C) => k(C)
|
|
44
44
|
});
|
|
45
45
|
return E.current = I, I.start(), () => {
|
|
46
46
|
I.stop(), E.current = null;
|
|
47
47
|
};
|
|
48
|
-
}, [i,
|
|
48
|
+
}, [i, o, a, d, b]);
|
|
49
49
|
const _ = B((I) => E.current?.getHistory(I) ?? [], []);
|
|
50
50
|
return {
|
|
51
|
-
stats:
|
|
51
|
+
stats: g,
|
|
52
52
|
history: E.current?.getAllHistory() ?? {},
|
|
53
53
|
getHistory: _,
|
|
54
|
-
isConnected:
|
|
55
|
-
isStale:
|
|
56
|
-
error:
|
|
54
|
+
isConnected: v,
|
|
55
|
+
isStale: h,
|
|
56
|
+
error: w,
|
|
57
57
|
unauthorized: b
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
function A() {
|
|
61
|
-
const [s, i] =
|
|
62
|
-
R(() =>
|
|
61
|
+
const [s, i] = y(() => X());
|
|
62
|
+
R(() => Y((a) => {
|
|
63
63
|
i(a);
|
|
64
64
|
}), []);
|
|
65
65
|
const t = B(() => {
|
|
66
|
-
const
|
|
67
|
-
return i(
|
|
66
|
+
const o = Z();
|
|
67
|
+
return i(o), o;
|
|
68
68
|
}, []);
|
|
69
69
|
return { theme: s, toggleTheme: t };
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function ue({
|
|
72
72
|
data: s,
|
|
73
73
|
color: i = "#34d399",
|
|
74
74
|
width: t = 120,
|
|
75
|
-
height:
|
|
75
|
+
height: o = 32,
|
|
76
76
|
className: a = ""
|
|
77
77
|
}) {
|
|
78
|
-
const
|
|
79
|
-
() =>
|
|
80
|
-
[s, t,
|
|
81
|
-
),
|
|
82
|
-
if (!
|
|
83
|
-
return /* @__PURE__ */ e("div", { className: `ss-dash-sparkline ${a}`, style:
|
|
78
|
+
const d = O(
|
|
79
|
+
() => ee(s, { width: t, height: o }),
|
|
80
|
+
[s, t, o]
|
|
81
|
+
), g = O(() => "ss-grad-" + Math.random().toString(36).slice(2, 8), []), n = { "--ss-accent": i };
|
|
82
|
+
if (!d)
|
|
83
|
+
return /* @__PURE__ */ e("div", { className: `ss-dash-sparkline ${a}`, style: n, children: /* @__PURE__ */ e(
|
|
84
84
|
"svg",
|
|
85
85
|
{
|
|
86
86
|
width: t,
|
|
87
|
-
height:
|
|
88
|
-
viewBox: `0 0 ${t} ${
|
|
87
|
+
height: o,
|
|
88
|
+
viewBox: `0 0 ${t} ${o}`,
|
|
89
89
|
style: { display: "block" },
|
|
90
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ l("text", { x: t / 2, y: o / 2 + 3, textAnchor: "middle", fill: "#737373", fontSize: "9", children: [
|
|
91
91
|
"collecting",
|
|
92
92
|
"…"
|
|
93
93
|
] })
|
|
94
94
|
}
|
|
95
95
|
) });
|
|
96
|
-
const
|
|
97
|
-
return /* @__PURE__ */ e("div", { className: `ss-dash-sparkline ${a}`, style:
|
|
96
|
+
const v = i || "var(--ss-accent)";
|
|
97
|
+
return /* @__PURE__ */ e("div", { className: `ss-dash-sparkline ${a}`, style: n, children: /* @__PURE__ */ l(
|
|
98
98
|
"svg",
|
|
99
99
|
{
|
|
100
100
|
width: t,
|
|
101
|
-
height:
|
|
102
|
-
viewBox: `0 0 ${t} ${
|
|
101
|
+
height: o,
|
|
102
|
+
viewBox: `0 0 ${t} ${o}`,
|
|
103
103
|
style: { display: "block" },
|
|
104
104
|
children: [
|
|
105
|
-
/* @__PURE__ */ e("defs", { children: /* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */ e("stop", { offset: "0%", stopColor:
|
|
107
|
-
/* @__PURE__ */ e("stop", { offset: "100%", stopColor:
|
|
105
|
+
/* @__PURE__ */ e("defs", { children: /* @__PURE__ */ l("linearGradient", { id: g, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
106
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: v, stopOpacity: "0.25" }),
|
|
107
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: v, stopOpacity: "0.02" })
|
|
108
108
|
] }) }),
|
|
109
|
-
/* @__PURE__ */ e("path", { d:
|
|
109
|
+
/* @__PURE__ */ e("path", { d: d.areaPath, fill: `url(#${g})` }),
|
|
110
110
|
/* @__PURE__ */ e(
|
|
111
111
|
"path",
|
|
112
112
|
{
|
|
113
113
|
className: "ss-dash-sparkline-line",
|
|
114
|
-
d: "M" +
|
|
114
|
+
d: "M" + d.points.replace(/ /g, " L"),
|
|
115
115
|
fill: "none",
|
|
116
|
-
stroke:
|
|
116
|
+
stroke: v,
|
|
117
117
|
strokeWidth: "1.5",
|
|
118
118
|
strokeLinejoin: "round",
|
|
119
119
|
strokeLinecap: "round"
|
|
@@ -123,14 +123,14 @@ function he({
|
|
|
123
123
|
}
|
|
124
124
|
) });
|
|
125
125
|
}
|
|
126
|
-
const
|
|
126
|
+
const he = {
|
|
127
127
|
"ss-red": "#f87171",
|
|
128
128
|
"ss-amber": "#fbbf24",
|
|
129
129
|
"ss-green": "#34d399",
|
|
130
130
|
"ss-muted": "#737373"
|
|
131
131
|
};
|
|
132
|
-
function
|
|
133
|
-
const [
|
|
132
|
+
function pe(s, i, t) {
|
|
133
|
+
const [o, a] = y({
|
|
134
134
|
position: "absolute",
|
|
135
135
|
bottom: "100%",
|
|
136
136
|
left: 0,
|
|
@@ -139,100 +139,100 @@ function me(s, i, t) {
|
|
|
139
139
|
});
|
|
140
140
|
return R(() => {
|
|
141
141
|
if (!t) return;
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
if (!
|
|
145
|
-
const p =
|
|
142
|
+
const d = () => {
|
|
143
|
+
const n = s.current, v = i.current;
|
|
144
|
+
if (!n || !v) return;
|
|
145
|
+
const p = n.closest(".ss-bar");
|
|
146
146
|
if (!p) return;
|
|
147
|
-
const
|
|
147
|
+
const h = n.getBoundingClientRect(), u = p.getBoundingClientRect(), w = h.left - u.left + h.width / 2;
|
|
148
148
|
a({
|
|
149
149
|
position: "absolute",
|
|
150
150
|
bottom: "100%",
|
|
151
|
-
left: `${
|
|
151
|
+
left: `${w}px`,
|
|
152
152
|
transform: "translateX(-50%)",
|
|
153
153
|
marginBottom: "10px",
|
|
154
154
|
zIndex: 180
|
|
155
155
|
}), requestAnimationFrame(() => {
|
|
156
|
-
const f =
|
|
156
|
+
const f = v.getBoundingClientRect();
|
|
157
157
|
let b = 0;
|
|
158
|
-
f.left < 8 ? b = 8 - f.left : f.right > window.innerWidth - 8 && (b = window.innerWidth - 8 - f.right), b && a((
|
|
159
|
-
...
|
|
158
|
+
f.left < 8 ? b = 8 - f.left : f.right > window.innerWidth - 8 && (b = window.innerWidth - 8 - f.right), b && a((k) => ({
|
|
159
|
+
...k,
|
|
160
160
|
transform: `translateX(calc(-50% + ${b}px))`
|
|
161
161
|
}));
|
|
162
162
|
});
|
|
163
163
|
};
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
return
|
|
167
|
-
|
|
164
|
+
d();
|
|
165
|
+
const g = s.current?.closest(".ss-bar-scroll");
|
|
166
|
+
return g?.addEventListener("scroll", d), window.addEventListener("resize", d), () => {
|
|
167
|
+
g?.removeEventListener("scroll", d), window.removeEventListener("resize", d);
|
|
168
168
|
};
|
|
169
|
-
}, [t, s, i]),
|
|
169
|
+
}, [t, s, i]), o;
|
|
170
170
|
}
|
|
171
|
-
function be({ metric: s, stats: i, history: t, className:
|
|
172
|
-
const [a,
|
|
171
|
+
function be({ metric: s, stats: i, history: t, className: o = "" }) {
|
|
172
|
+
const [a, d] = y(!1), [g, n] = y(!1), v = j(null), p = j(null);
|
|
173
173
|
if (s.show && !s.show(i))
|
|
174
174
|
return null;
|
|
175
|
-
const
|
|
176
|
-
$.stopPropagation(),
|
|
175
|
+
const h = s.value ? s.value(i) : s.format(i), u = s.color ? s.color(i) : "", w = u && he[u] || "#34d399", f = typeof s.detail == "function" ? s.detail(i) : s.detail, b = O(() => se(t), [t]), k = a || g, E = pe(v, p, k), _ = B(($) => {
|
|
176
|
+
$.stopPropagation(), d((r) => !r);
|
|
177
177
|
}, []);
|
|
178
178
|
R(() => {
|
|
179
179
|
if (!a) return;
|
|
180
|
-
const $ = (
|
|
181
|
-
const x =
|
|
182
|
-
|
|
183
|
-
},
|
|
184
|
-
|
|
180
|
+
const $ = (m) => {
|
|
181
|
+
const x = m.target;
|
|
182
|
+
v.current && !v.current.contains(x) && p.current && !p.current.contains(x) && d(!1);
|
|
183
|
+
}, r = (m) => {
|
|
184
|
+
m.key === "Escape" && d(!1);
|
|
185
185
|
};
|
|
186
|
-
return document.addEventListener("click", $), document.addEventListener("keydown",
|
|
187
|
-
document.removeEventListener("click", $), document.removeEventListener("keydown",
|
|
186
|
+
return document.addEventListener("click", $), document.addEventListener("keydown", r), () => {
|
|
187
|
+
document.removeEventListener("click", $), document.removeEventListener("keydown", r);
|
|
188
188
|
};
|
|
189
189
|
}, [a]);
|
|
190
|
-
const I =
|
|
191
|
-
/* @__PURE__ */
|
|
190
|
+
const I = v.current?.closest(".ss-bar"), C = k && I ? ce(
|
|
191
|
+
/* @__PURE__ */ l(
|
|
192
192
|
"div",
|
|
193
193
|
{
|
|
194
194
|
ref: p,
|
|
195
195
|
className: `ss-tooltip ${a ? "ss-pinned" : ""}`,
|
|
196
196
|
style: E,
|
|
197
197
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ l("div", { className: "ss-tooltip-inner", style: { position: "relative" }, children: [
|
|
199
199
|
a && /* @__PURE__ */ e(
|
|
200
200
|
"button",
|
|
201
201
|
{
|
|
202
202
|
className: "ss-tooltip-close",
|
|
203
203
|
onClick: ($) => {
|
|
204
|
-
$.stopPropagation(),
|
|
204
|
+
$.stopPropagation(), d(!1);
|
|
205
205
|
},
|
|
206
206
|
type: "button",
|
|
207
207
|
children: "×"
|
|
208
208
|
}
|
|
209
209
|
),
|
|
210
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ l("div", { className: "ss-tooltip-header", children: [
|
|
211
211
|
/* @__PURE__ */ e("span", { className: "ss-tooltip-title", children: s.title }),
|
|
212
212
|
s.unit && /* @__PURE__ */ e("span", { className: "ss-tooltip-unit", children: s.unit })
|
|
213
213
|
] }),
|
|
214
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ l("div", { className: "ss-tooltip-current", children: [
|
|
215
215
|
/* @__PURE__ */ e("span", { className: "ss-tooltip-current-label", children: "Current: " }),
|
|
216
|
-
/* @__PURE__ */ e("span", { className: "ss-tooltip-current-value", children:
|
|
216
|
+
/* @__PURE__ */ e("span", { className: "ss-tooltip-current-value", children: h })
|
|
217
217
|
] }),
|
|
218
|
-
b && /* @__PURE__ */
|
|
219
|
-
/* @__PURE__ */
|
|
218
|
+
b && /* @__PURE__ */ l("div", { className: "ss-tooltip-stats", children: [
|
|
219
|
+
/* @__PURE__ */ l("span", { children: [
|
|
220
220
|
"Min: ",
|
|
221
221
|
U(b.min, s.unit)
|
|
222
222
|
] }),
|
|
223
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ l("span", { children: [
|
|
224
224
|
"Max: ",
|
|
225
225
|
U(b.max, s.unit)
|
|
226
226
|
] }),
|
|
227
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ l("span", { children: [
|
|
228
228
|
"Avg: ",
|
|
229
229
|
U(b.avg, s.unit)
|
|
230
230
|
] })
|
|
231
231
|
] }),
|
|
232
232
|
f && /* @__PURE__ */ e("div", { className: "ss-tooltip-details", children: f }),
|
|
233
|
-
t.length > 0 && /* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */ e("div", { className: "ss-tooltip-sparkline", children: /* @__PURE__ */ e(
|
|
235
|
-
/* @__PURE__ */
|
|
233
|
+
t.length > 0 && /* @__PURE__ */ l(H, { children: [
|
|
234
|
+
/* @__PURE__ */ e("div", { className: "ss-tooltip-sparkline", children: /* @__PURE__ */ e(ue, { data: t, color: w }) }),
|
|
235
|
+
/* @__PURE__ */ l("div", { className: "ss-tooltip-samples", children: [
|
|
236
236
|
"Last ",
|
|
237
237
|
Math.min(t.length, 60),
|
|
238
238
|
" samples (~",
|
|
@@ -247,71 +247,71 @@ function be({ metric: s, stats: i, history: t, className: n = "" }) {
|
|
|
247
247
|
),
|
|
248
248
|
I
|
|
249
249
|
) : null;
|
|
250
|
-
return /* @__PURE__ */
|
|
251
|
-
/* @__PURE__ */
|
|
250
|
+
return /* @__PURE__ */ l(H, { children: [
|
|
251
|
+
/* @__PURE__ */ l(
|
|
252
252
|
"div",
|
|
253
253
|
{
|
|
254
|
-
ref:
|
|
255
|
-
className: `ss-badge ${a ? "ss-pinned" : ""} ${
|
|
254
|
+
ref: v,
|
|
255
|
+
className: `ss-badge ${a ? "ss-pinned" : ""} ${o}`,
|
|
256
256
|
onClick: _,
|
|
257
|
-
onMouseEnter: () => !a &&
|
|
258
|
-
onMouseLeave: () =>
|
|
257
|
+
onMouseEnter: () => !a && n(!0),
|
|
258
|
+
onMouseLeave: () => n(!1),
|
|
259
259
|
role: "button",
|
|
260
260
|
tabIndex: 0,
|
|
261
261
|
onKeyDown: ($) => $.key === "Enter" && _($),
|
|
262
262
|
children: [
|
|
263
263
|
/* @__PURE__ */ e("span", { className: "ss-label", children: s.label }),
|
|
264
|
-
/* @__PURE__ */ e("span", { className: `ss-value ${
|
|
264
|
+
/* @__PURE__ */ e("span", { className: `ss-value ${u}`, children: h })
|
|
265
265
|
]
|
|
266
266
|
}
|
|
267
267
|
),
|
|
268
268
|
C
|
|
269
269
|
] });
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function ze(s) {
|
|
272
272
|
const {
|
|
273
273
|
featureOptions: i,
|
|
274
274
|
autoHideOnUnauthorized: t = !0,
|
|
275
|
-
onOpenDebugPanel:
|
|
275
|
+
onOpenDebugPanel: o,
|
|
276
276
|
debugPanelOpen: a = !1,
|
|
277
|
-
onConnectionChange:
|
|
278
|
-
...
|
|
279
|
-
} = s, { stats:
|
|
277
|
+
onConnectionChange: d,
|
|
278
|
+
...g
|
|
279
|
+
} = s, { stats: n, getHistory: v, isConnected: p, isStale: h, unauthorized: u } = de(g);
|
|
280
280
|
R(() => {
|
|
281
|
-
|
|
282
|
-
}, [p,
|
|
283
|
-
const { features:
|
|
281
|
+
d?.(p);
|
|
282
|
+
}, [p, d]);
|
|
283
|
+
const { features: w } = z(i), { theme: f } = A(), [b, k] = y(() => typeof window > "u" ? !0 : localStorage.getItem("admin:stats-bar") !== "hidden"), E = j(null), _ = j(null);
|
|
284
284
|
R(() => {
|
|
285
|
-
t &&
|
|
286
|
-
}, [t,
|
|
285
|
+
t && u && k(!1);
|
|
286
|
+
}, [t, u]);
|
|
287
287
|
const I = B(() => {
|
|
288
|
-
|
|
289
|
-
const x = !
|
|
288
|
+
k((m) => {
|
|
289
|
+
const x = !m;
|
|
290
290
|
return localStorage.setItem("admin:stats-bar", x ? "visible" : "hidden"), x;
|
|
291
291
|
});
|
|
292
292
|
}, []);
|
|
293
293
|
R(() => {
|
|
294
|
-
const
|
|
295
|
-
if (!
|
|
296
|
-
const x = (
|
|
297
|
-
Math.abs(
|
|
294
|
+
const m = _.current;
|
|
295
|
+
if (!m) return;
|
|
296
|
+
const x = (N) => {
|
|
297
|
+
Math.abs(N.deltaX) > Math.abs(N.deltaY) || (N.preventDefault(), m.scrollLeft += N.deltaY);
|
|
298
298
|
};
|
|
299
|
-
return
|
|
299
|
+
return m.addEventListener("wheel", x, { passive: !1 }), () => m.removeEventListener("wheel", x);
|
|
300
300
|
}, []);
|
|
301
|
-
const C = O(() =>
|
|
302
|
-
() =>
|
|
301
|
+
const C = O(() => n ? te(n) : ne(w), [n, w]), $ = O(
|
|
302
|
+
() => oe.filter((m) => C.has(m.group || "core")),
|
|
303
303
|
[C]
|
|
304
|
-
),
|
|
305
|
-
const
|
|
304
|
+
), r = O(() => {
|
|
305
|
+
const m = [];
|
|
306
306
|
let x = "";
|
|
307
|
-
for (const
|
|
308
|
-
const D =
|
|
309
|
-
D !== x && (x = D,
|
|
307
|
+
for (const N of $) {
|
|
308
|
+
const D = N.group || "core";
|
|
309
|
+
D !== x && (x = D, m.push({ group: x, metrics: [] })), m[m.length - 1].metrics.push(N);
|
|
310
310
|
}
|
|
311
|
-
return
|
|
311
|
+
return m;
|
|
312
312
|
}, [$]);
|
|
313
|
-
return t &&
|
|
314
|
-
/* @__PURE__ */
|
|
313
|
+
return t && u ? null : /* @__PURE__ */ l(H, { children: [
|
|
314
|
+
/* @__PURE__ */ l(
|
|
315
315
|
"button",
|
|
316
316
|
{
|
|
317
317
|
type: "button",
|
|
@@ -320,35 +320,35 @@ function We(s) {
|
|
|
320
320
|
title: b ? "Hide stats bar" : "Show stats bar",
|
|
321
321
|
"data-ss-theme": f,
|
|
322
322
|
children: [
|
|
323
|
-
!b &&
|
|
324
|
-
C.has("process") && /* @__PURE__ */
|
|
325
|
-
/* @__PURE__ */
|
|
323
|
+
!b && n && /* @__PURE__ */ l("span", { className: "ss-toggle-summary", style: { display: "flex" }, children: [
|
|
324
|
+
C.has("process") && /* @__PURE__ */ l(H, { children: [
|
|
325
|
+
/* @__PURE__ */ l(
|
|
326
326
|
"span",
|
|
327
327
|
{
|
|
328
|
-
className: `ss-value ${
|
|
328
|
+
className: `ss-value ${n.cpuPercent > 80 ? "ss-red" : n.cpuPercent > 50 ? "ss-amber" : "ss-green"}`,
|
|
329
329
|
children: [
|
|
330
|
-
|
|
330
|
+
n.cpuPercent.toFixed(0),
|
|
331
331
|
"%"
|
|
332
332
|
]
|
|
333
333
|
}
|
|
334
334
|
),
|
|
335
|
-
/* @__PURE__ */ e("span", { className: "ss-value ss-green", children:
|
|
335
|
+
/* @__PURE__ */ e("span", { className: "ss-value ss-green", children: n.memHeapUsed !== void 0 ? Math.round(n.memHeapUsed / (1024 * 1024)) + "M" : "-" })
|
|
336
336
|
] }),
|
|
337
|
-
C.has("redis") &&
|
|
337
|
+
C.has("redis") && n.redisOk !== void 0 && /* @__PURE__ */ e("span", { className: `ss-value ${n.redisOk ? "ss-green" : "ss-red"}`, children: n.redisOk ? "✓" : "✗" })
|
|
338
338
|
] }),
|
|
339
339
|
b && /* @__PURE__ */ e("span", { className: "ss-toggle-label", style: { color: "#737373" }, children: "hide stats" }),
|
|
340
340
|
/* @__PURE__ */ e("span", { className: "ss-toggle-arrow", children: b ? "▼" : "▲" })
|
|
341
341
|
]
|
|
342
342
|
}
|
|
343
343
|
),
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
|
|
344
|
+
/* @__PURE__ */ l("div", { ref: E, className: b ? "ss-bar" : "ss-bar ss-hidden", "data-ss-theme": f, children: [
|
|
345
|
+
/* @__PURE__ */ l("div", { className: "ss-bar-left", children: [
|
|
346
|
+
o && /* @__PURE__ */ e(
|
|
347
347
|
"button",
|
|
348
348
|
{
|
|
349
349
|
type: "button",
|
|
350
350
|
className: `ss-dbg-btn ${a ? "ss-dbg-active" : ""}`,
|
|
351
|
-
onClick:
|
|
351
|
+
onClick: o,
|
|
352
352
|
title: "Toggle debug panel",
|
|
353
353
|
id: "ss-dbg-wrench",
|
|
354
354
|
children: /* @__PURE__ */ e(
|
|
@@ -367,35 +367,35 @@ function We(s) {
|
|
|
367
367
|
)
|
|
368
368
|
}
|
|
369
369
|
),
|
|
370
|
-
/* @__PURE__ */ e("div", { className:
|
|
370
|
+
/* @__PURE__ */ e("div", { className: h ? "ss-dot ss-stale" : "ss-dot" })
|
|
371
371
|
] }),
|
|
372
|
-
/* @__PURE__ */ e("div", { ref: _, className: "ss-bar-scroll", id: "ss-bar-scroll", children:
|
|
372
|
+
/* @__PURE__ */ e("div", { ref: _, className: "ss-bar-scroll", id: "ss-bar-scroll", children: n && r.map((m, x) => /* @__PURE__ */ l(V.Fragment, { children: [
|
|
373
373
|
x > 0 && /* @__PURE__ */ e("div", { className: "ss-group-sep" }),
|
|
374
|
-
/* @__PURE__ */ e("div", { className: "ss-group", children:
|
|
374
|
+
/* @__PURE__ */ e("div", { className: "ss-group", children: m.metrics.map((N) => /* @__PURE__ */ e(
|
|
375
375
|
be,
|
|
376
376
|
{
|
|
377
|
-
metric:
|
|
378
|
-
stats:
|
|
379
|
-
history:
|
|
377
|
+
metric: N,
|
|
378
|
+
stats: n,
|
|
379
|
+
history: v(N.historyKey || "")
|
|
380
380
|
},
|
|
381
|
-
|
|
381
|
+
N.id
|
|
382
382
|
)) })
|
|
383
|
-
] },
|
|
383
|
+
] }, m.group)) })
|
|
384
384
|
] })
|
|
385
385
|
] });
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function W({
|
|
388
388
|
theme: s,
|
|
389
389
|
onToggle: i,
|
|
390
390
|
className: t = "",
|
|
391
|
-
classPrefix:
|
|
391
|
+
classPrefix: o = "ss-dash"
|
|
392
392
|
}) {
|
|
393
393
|
const a = s === "dark";
|
|
394
394
|
return /* @__PURE__ */ e(
|
|
395
395
|
"button",
|
|
396
396
|
{
|
|
397
397
|
type: "button",
|
|
398
|
-
className: `${
|
|
398
|
+
className: `${o === "ss-dbg" ? "ss-dbg-theme-toggle" : "ss-dash-theme-btn"} ${t}`,
|
|
399
399
|
onClick: i,
|
|
400
400
|
title: a ? "Switch to light theme" : "Switch to dark theme",
|
|
401
401
|
"aria-label": a ? "Switch to light theme" : "Switch to dark theme",
|
|
@@ -435,23 +435,23 @@ function J({
|
|
|
435
435
|
}
|
|
436
436
|
);
|
|
437
437
|
}
|
|
438
|
-
const
|
|
439
|
-
function
|
|
438
|
+
const me = T(() => import("./QueriesTab-osLUWd4L.js")), ge = T(() => import("./EventsTab-CMfY98Rl.js")), ve = T(() => import("./EmailsTab-BDhEiomM.js")), fe = T(() => import("./RoutesTab-DgVzd2PZ.js")), we = T(() => import("./LogsTab-CicucmVk.js")), ke = T(() => import("./TimelineTab-Covg5weo.js")), Ne = T(() => import("./CacheTab-CA8LB1J5.js")), ye = T(() => import("./JobsTab-BbrBWIOb.js")), Ce = T(() => import("./ConfigTab-Bdg8YMer.js")), Se = T(() => import("./InternalsTab-Oij0A2fN.js")), Le = T(() => import("./CustomPaneTab-Bxtv_8Rw.js"));
|
|
439
|
+
function Ae(s) {
|
|
440
440
|
const {
|
|
441
441
|
defaultOpen: i = !1,
|
|
442
442
|
dashboardPath: t,
|
|
443
|
-
isOpen:
|
|
443
|
+
isOpen: o,
|
|
444
444
|
onOpenChange: a,
|
|
445
|
-
isLive:
|
|
446
|
-
...
|
|
447
|
-
} = s, [
|
|
448
|
-
a ? a(
|
|
449
|
-
}, [
|
|
445
|
+
isLive: d = !1,
|
|
446
|
+
...g
|
|
447
|
+
} = s, [n, v] = y(i), p = o !== void 0 ? o : n, h = (r) => {
|
|
448
|
+
a ? a(r) : v(r);
|
|
449
|
+
}, [u, w] = y("queries"), { features: f } = z(g), { theme: b, toggleTheme: k } = A(), E = f.customPanes || [];
|
|
450
450
|
R(() => {
|
|
451
|
-
const
|
|
452
|
-
|
|
451
|
+
const r = (m) => {
|
|
452
|
+
m.key === "Escape" && p && h(!1);
|
|
453
453
|
};
|
|
454
|
-
return document.addEventListener("keydown",
|
|
454
|
+
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
455
455
|
}, [p]);
|
|
456
456
|
const _ = O(
|
|
457
457
|
() => [
|
|
@@ -460,49 +460,49 @@ function Je(s) {
|
|
|
460
460
|
{ id: "emails", label: "Emails", visible: !0 },
|
|
461
461
|
{ id: "routes", label: "Routes", visible: !0 },
|
|
462
462
|
{ id: "logs", label: "Logs", visible: !0 },
|
|
463
|
-
{ id: "timeline", label: "
|
|
463
|
+
{ id: "timeline", label: "Requests", visible: f.tracing },
|
|
464
464
|
{ id: "cache", label: "Cache", visible: f.cache },
|
|
465
465
|
{ id: "jobs", label: "Jobs", visible: f.queues },
|
|
466
466
|
{ id: "config", label: "Config", visible: !0 },
|
|
467
467
|
{ id: "internals", label: "Internals", visible: !0 }
|
|
468
468
|
],
|
|
469
469
|
[f]
|
|
470
|
-
), I = O(() => _.filter((
|
|
470
|
+
), I = O(() => _.filter((r) => r.visible), [_]);
|
|
471
471
|
R(() => {
|
|
472
|
-
const
|
|
473
|
-
...I.map((
|
|
474
|
-
...E.map((
|
|
472
|
+
const r = [
|
|
473
|
+
...I.map((m) => m.id),
|
|
474
|
+
...E.map((m) => m.id)
|
|
475
475
|
];
|
|
476
|
-
!
|
|
477
|
-
}, [I, E,
|
|
476
|
+
!r.includes(u) && r.length > 0 && w(r[0]);
|
|
477
|
+
}, [I, E, u]);
|
|
478
478
|
const C = B(() => {
|
|
479
|
-
|
|
479
|
+
h(!p);
|
|
480
480
|
}, [p]), $ = B(() => {
|
|
481
|
-
const
|
|
482
|
-
if (
|
|
483
|
-
return /* @__PURE__ */ e(F, { fallback: /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading..." }), children: /* @__PURE__ */ e(
|
|
481
|
+
const r = { options: g }, m = E.find((N) => N.id === u);
|
|
482
|
+
if (m)
|
|
483
|
+
return /* @__PURE__ */ e(F, { fallback: /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading..." }), children: /* @__PURE__ */ e(Le, { pane: m, options: g }) });
|
|
484
484
|
const x = {
|
|
485
|
-
queries: /* @__PURE__ */ e(
|
|
486
|
-
events: /* @__PURE__ */ e(
|
|
487
|
-
emails: /* @__PURE__ */ e(
|
|
485
|
+
queries: /* @__PURE__ */ e(me, { ...r }),
|
|
486
|
+
events: /* @__PURE__ */ e(ge, { ...r }),
|
|
487
|
+
emails: /* @__PURE__ */ e(ve, { ...r }),
|
|
488
488
|
routes: /* @__PURE__ */ e(
|
|
489
|
-
|
|
489
|
+
fe,
|
|
490
490
|
{
|
|
491
|
-
...
|
|
491
|
+
...r,
|
|
492
492
|
currentPath: typeof window < "u" ? window.location.pathname : ""
|
|
493
493
|
}
|
|
494
494
|
),
|
|
495
|
-
logs: /* @__PURE__ */ e(
|
|
496
|
-
timeline: /* @__PURE__ */ e(
|
|
497
|
-
cache: /* @__PURE__ */ e(
|
|
498
|
-
jobs: /* @__PURE__ */ e(
|
|
499
|
-
config: /* @__PURE__ */ e(
|
|
500
|
-
internals: /* @__PURE__ */ e(
|
|
495
|
+
logs: /* @__PURE__ */ e(we, { ...r }),
|
|
496
|
+
timeline: /* @__PURE__ */ e(ke, { ...r }),
|
|
497
|
+
cache: /* @__PURE__ */ e(Ne, { ...r, dashboardPath: t }),
|
|
498
|
+
jobs: /* @__PURE__ */ e(ye, { ...r, dashboardPath: t }),
|
|
499
|
+
config: /* @__PURE__ */ e(Ce, { ...r, dashboardPath: t }),
|
|
500
|
+
internals: /* @__PURE__ */ e(Se, { ...r })
|
|
501
501
|
};
|
|
502
|
-
return /* @__PURE__ */ e(F, { fallback: /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading..." }), children: x[
|
|
503
|
-
}, [
|
|
504
|
-
return /* @__PURE__ */
|
|
505
|
-
|
|
502
|
+
return /* @__PURE__ */ e(F, { fallback: /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading..." }), children: x[u] || /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Unknown tab" }) });
|
|
503
|
+
}, [u, g, E]);
|
|
504
|
+
return /* @__PURE__ */ l(H, { children: [
|
|
505
|
+
o === void 0 && /* @__PURE__ */ e(
|
|
506
506
|
"button",
|
|
507
507
|
{
|
|
508
508
|
type: "button",
|
|
@@ -526,56 +526,56 @@ function Je(s) {
|
|
|
526
526
|
)
|
|
527
527
|
}
|
|
528
528
|
),
|
|
529
|
-
/* @__PURE__ */
|
|
529
|
+
/* @__PURE__ */ l(
|
|
530
530
|
"div",
|
|
531
531
|
{
|
|
532
532
|
className: `ss-dbg-panel ${p ? "ss-dbg-open" : ""}`,
|
|
533
533
|
"data-ss-theme": b,
|
|
534
534
|
id: "ss-dbg-panel",
|
|
535
535
|
children: [
|
|
536
|
-
/* @__PURE__ */
|
|
537
|
-
/* @__PURE__ */
|
|
538
|
-
I.map((
|
|
536
|
+
/* @__PURE__ */ l("div", { className: "ss-dbg-tabs", children: [
|
|
537
|
+
/* @__PURE__ */ l("div", { className: "ss-dbg-tabs-scroll", children: [
|
|
538
|
+
I.map((r) => /* @__PURE__ */ l(
|
|
539
539
|
"button",
|
|
540
540
|
{
|
|
541
541
|
type: "button",
|
|
542
|
-
className: `ss-dbg-tab ${
|
|
543
|
-
onClick: () =>
|
|
542
|
+
className: `ss-dbg-tab ${u === r.id ? "ss-dbg-active" : ""}`,
|
|
543
|
+
onClick: () => w(r.id),
|
|
544
544
|
children: [
|
|
545
|
-
L[
|
|
545
|
+
L[r.id] ? /* @__PURE__ */ e(
|
|
546
546
|
"svg",
|
|
547
547
|
{
|
|
548
548
|
className: "ss-dbg-tab-icon",
|
|
549
|
-
viewBox: L[
|
|
550
|
-
dangerouslySetInnerHTML: { __html: L[
|
|
549
|
+
viewBox: L[r.id].viewBox,
|
|
550
|
+
dangerouslySetInnerHTML: { __html: L[r.id].elements.join("") }
|
|
551
551
|
}
|
|
552
552
|
) : null,
|
|
553
|
-
|
|
553
|
+
r.label
|
|
554
554
|
]
|
|
555
555
|
},
|
|
556
|
-
|
|
556
|
+
r.id
|
|
557
557
|
)),
|
|
558
|
-
E.map((
|
|
558
|
+
E.map((r) => /* @__PURE__ */ e(
|
|
559
559
|
"button",
|
|
560
560
|
{
|
|
561
561
|
type: "button",
|
|
562
|
-
className: `ss-dbg-tab ${
|
|
563
|
-
onClick: () =>
|
|
564
|
-
children:
|
|
562
|
+
className: `ss-dbg-tab ${u === r.id ? "ss-dbg-active" : ""}`,
|
|
563
|
+
onClick: () => w(r.id),
|
|
564
|
+
children: r.label
|
|
565
565
|
},
|
|
566
|
-
|
|
566
|
+
r.id
|
|
567
567
|
))
|
|
568
568
|
] }),
|
|
569
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ l("div", { className: "ss-dbg-tabs-right", children: [
|
|
570
570
|
/* @__PURE__ */ e(
|
|
571
571
|
"span",
|
|
572
572
|
{
|
|
573
|
-
className: `ss-dbg-conn-mode ${
|
|
574
|
-
title:
|
|
575
|
-
children:
|
|
573
|
+
className: `ss-dbg-conn-mode ${d ? "ss-dbg-conn-live" : "ss-dbg-conn-polling"}`,
|
|
574
|
+
title: d ? "Connected via Transmit (SSE) — real-time updates" : "Polling every 3s",
|
|
575
|
+
children: d ? "live" : "polling"
|
|
576
576
|
}
|
|
577
577
|
),
|
|
578
|
-
/* @__PURE__ */ e(
|
|
578
|
+
/* @__PURE__ */ e(W, { theme: b, onToggle: k, classPrefix: "ss-dbg" }),
|
|
579
579
|
t && /* @__PURE__ */ e(
|
|
580
580
|
"a",
|
|
581
581
|
{
|
|
@@ -605,7 +605,7 @@ function Je(s) {
|
|
|
605
605
|
{
|
|
606
606
|
type: "button",
|
|
607
607
|
className: "ss-dbg-close",
|
|
608
|
-
onClick: () =>
|
|
608
|
+
onClick: () => h(!1),
|
|
609
609
|
title: "Close panel",
|
|
610
610
|
children: "×"
|
|
611
611
|
}
|
|
@@ -618,26 +618,26 @@ function Je(s) {
|
|
|
618
618
|
)
|
|
619
619
|
] });
|
|
620
620
|
}
|
|
621
|
-
function
|
|
621
|
+
function Te(s, i = {}) {
|
|
622
622
|
const {
|
|
623
623
|
baseUrl: t = "",
|
|
624
|
-
dashboardEndpoint:
|
|
624
|
+
dashboardEndpoint: o = "/__stats/api",
|
|
625
625
|
authToken: a,
|
|
626
|
-
page:
|
|
627
|
-
perPage:
|
|
628
|
-
search:
|
|
629
|
-
sort:
|
|
626
|
+
page: d = 1,
|
|
627
|
+
perPage: g = 50,
|
|
628
|
+
search: n,
|
|
629
|
+
sort: v,
|
|
630
630
|
sortDir: p,
|
|
631
|
-
filters:
|
|
632
|
-
timeRange:
|
|
633
|
-
refreshKey:
|
|
634
|
-
} = i, [f, b] =
|
|
635
|
-
|
|
631
|
+
filters: h,
|
|
632
|
+
timeRange: u,
|
|
633
|
+
refreshKey: w
|
|
634
|
+
} = i, [f, b] = y(null), [k, E] = y(null), [_, I] = y(!0), [C, $] = y(null), r = j(null), m = j(s), x = j(!1);
|
|
635
|
+
r.current || (r.current = new re({
|
|
636
636
|
baseUrl: t,
|
|
637
|
-
endpoint:
|
|
637
|
+
endpoint: o,
|
|
638
638
|
authToken: a,
|
|
639
639
|
section: s,
|
|
640
|
-
perPage:
|
|
640
|
+
perPage: g,
|
|
641
641
|
callbacks: {
|
|
642
642
|
onData: (M) => b(M),
|
|
643
643
|
onPagination: (M) => E(M),
|
|
@@ -647,20 +647,20 @@ function Ee(s, i = {}) {
|
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
})), R(() => {
|
|
650
|
-
const M =
|
|
651
|
-
return
|
|
650
|
+
const M = r.current, c = m.current !== s;
|
|
651
|
+
return m.current = s, M.configure({ page: d, perPage: g, search: n, sort: v, sortDir: p, filters: h, timeRange: u }), c || !x.current ? (c ? M.setSection(s) : M.start(), x.current = !0) : M.fetch(!0), () => {
|
|
652
652
|
M.stop();
|
|
653
653
|
};
|
|
654
|
-
}, [s,
|
|
655
|
-
const
|
|
656
|
-
|
|
654
|
+
}, [s, d, g, n, v, p, h, u, w]);
|
|
655
|
+
const N = B(() => {
|
|
656
|
+
r.current?.fetch(!0);
|
|
657
657
|
}, []), D = B(
|
|
658
|
-
async (M,
|
|
658
|
+
async (M, c = "post", S) => r.current.mutate(M, c, S),
|
|
659
659
|
[]
|
|
660
|
-
),
|
|
661
|
-
return { data: f, meta:
|
|
660
|
+
), q = B(() => r.current.getApi(), []);
|
|
661
|
+
return { data: f, meta: k, isLoading: _, error: C, refresh: N, mutate: D, getApi: q };
|
|
662
662
|
}
|
|
663
|
-
const
|
|
663
|
+
const Ee = [
|
|
664
664
|
"overview",
|
|
665
665
|
"requests",
|
|
666
666
|
"queries",
|
|
@@ -668,65 +668,61 @@ const $e = [
|
|
|
668
668
|
"routes",
|
|
669
669
|
"logs",
|
|
670
670
|
"emails",
|
|
671
|
-
"timeline",
|
|
672
671
|
"cache",
|
|
673
672
|
"jobs",
|
|
674
673
|
"config",
|
|
675
674
|
"internals"
|
|
676
|
-
],
|
|
677
|
-
function
|
|
678
|
-
return s === "timeline" ? "dashboard-timeline" : s;
|
|
679
|
-
}
|
|
680
|
-
function Ve(s) {
|
|
675
|
+
], $e = T(() => import("./OverviewSection-C4T1ur51.js")), xe = T(() => import("./RequestsSection-Nag30rEA.js")), Ie = T(() => import("./QueriesSection-PswteoF9.js")), Be = T(() => import("./EventsSection-ByQ-9blq.js")), Me = T(() => import("./RoutesSection-BUSkM6PY.js")), Re = T(() => import("./LogsSection-DcFTZY7b.js")), Oe = T(() => import("./EmailsSection-CM7stSyh.js")), _e = T(() => import("./CacheSection-UCMptWyn.js")), De = T(() => import("./JobsSection-DF3qEv9O.js")), je = T(() => import("./ConfigSection-DfFd-WRq.js")), He = T(() => import("./InternalsSection-t7ihcWO-.js"));
|
|
676
|
+
function We(s) {
|
|
681
677
|
const {
|
|
682
678
|
baseUrl: i = "",
|
|
683
679
|
dashboardEndpoint: t = "/__stats/api",
|
|
684
|
-
debugEndpoint:
|
|
680
|
+
debugEndpoint: o,
|
|
685
681
|
authToken: a,
|
|
686
|
-
backUrl:
|
|
687
|
-
channelName:
|
|
688
|
-
} = s, { features:
|
|
682
|
+
backUrl: d = "/",
|
|
683
|
+
channelName: g = "server-stats/dashboard"
|
|
684
|
+
} = s, { features: n } = z({ baseUrl: i, debugEndpoint: o, authToken: a }), { theme: v, toggleTheme: p } = A(), [h, u] = y("overview"), [w, f] = y(() => typeof window > "u" ? !1 : localStorage.getItem("ss-dash-sidebar") === "collapsed"), [b, k] = y(!1), [E, _] = y(0), I = j(0);
|
|
689
685
|
R(() => {
|
|
690
|
-
if (!
|
|
691
|
-
const
|
|
686
|
+
if (!g) return;
|
|
687
|
+
const c = ie({
|
|
692
688
|
baseUrl: i,
|
|
693
|
-
channelName:
|
|
689
|
+
channelName: g,
|
|
694
690
|
authToken: a,
|
|
695
691
|
onMessage: () => {
|
|
696
692
|
I.current += 1, _(I.current);
|
|
697
693
|
},
|
|
698
|
-
onConnect: () =>
|
|
699
|
-
onDisconnect: () =>
|
|
700
|
-
onError: () =>
|
|
694
|
+
onConnect: () => k(!0),
|
|
695
|
+
onDisconnect: () => k(!1),
|
|
696
|
+
onError: () => k(!1)
|
|
701
697
|
});
|
|
702
|
-
return () =>
|
|
703
|
-
}, [i,
|
|
704
|
-
const C =
|
|
705
|
-
(
|
|
706
|
-
const S =
|
|
707
|
-
return S && [
|
|
698
|
+
return () => c.unsubscribe();
|
|
699
|
+
}, [i, g, a]);
|
|
700
|
+
const C = n.customPanes || [], $ = B(
|
|
701
|
+
(c) => {
|
|
702
|
+
const S = c.replace("#", "").split("?")[0];
|
|
703
|
+
return S && [...Ee, ...C.map((J) => J.id)].includes(S) ? S : "overview";
|
|
708
704
|
},
|
|
709
705
|
[C]
|
|
710
706
|
);
|
|
711
707
|
R(() => {
|
|
712
708
|
if (typeof window > "u") return;
|
|
713
|
-
const
|
|
714
|
-
(
|
|
709
|
+
const c = $(window.location.hash);
|
|
710
|
+
(c !== "overview" || window.location.hash) && u(c);
|
|
715
711
|
}, [$]), R(() => {
|
|
716
|
-
const
|
|
712
|
+
const c = () => {
|
|
717
713
|
const S = $(window.location.hash);
|
|
718
|
-
S !==
|
|
714
|
+
S !== h && u(S);
|
|
719
715
|
};
|
|
720
|
-
return window.addEventListener("hashchange",
|
|
721
|
-
}, [
|
|
722
|
-
typeof window > "u" || (window.location.hash =
|
|
723
|
-
}, [
|
|
724
|
-
const
|
|
725
|
-
f((
|
|
726
|
-
const S = !
|
|
716
|
+
return window.addEventListener("hashchange", c), () => window.removeEventListener("hashchange", c);
|
|
717
|
+
}, [h, $]), R(() => {
|
|
718
|
+
typeof window > "u" || (window.location.hash = h);
|
|
719
|
+
}, [h]);
|
|
720
|
+
const r = B(() => {
|
|
721
|
+
f((c) => {
|
|
722
|
+
const S = !c;
|
|
727
723
|
return localStorage.setItem("ss-dash-sidebar", S ? "collapsed" : "expanded"), S;
|
|
728
724
|
});
|
|
729
|
-
}, []),
|
|
725
|
+
}, []), m = O(
|
|
730
726
|
() => [
|
|
731
727
|
{ id: "overview", label: "Overview", visible: !0 },
|
|
732
728
|
{ id: "requests", label: "Requests", visible: !0 },
|
|
@@ -735,48 +731,46 @@ function Ve(s) {
|
|
|
735
731
|
{ id: "routes", label: "Routes", visible: !0 },
|
|
736
732
|
{ id: "logs", label: "Logs", visible: !0 },
|
|
737
733
|
{ id: "emails", label: "Emails", visible: !0 },
|
|
738
|
-
{ id: "
|
|
739
|
-
{ id: "
|
|
740
|
-
{ id: "jobs", label: "Jobs", visible: r.queues },
|
|
734
|
+
{ id: "cache", label: "Cache", visible: n.cache },
|
|
735
|
+
{ id: "jobs", label: "Jobs", visible: n.queues },
|
|
741
736
|
{ id: "config", label: "Config", visible: !0 },
|
|
742
737
|
{ id: "internals", label: "Internals", visible: !0 }
|
|
743
738
|
],
|
|
744
|
-
[
|
|
745
|
-
), x = O(() =>
|
|
739
|
+
[n]
|
|
740
|
+
), x = O(() => m.filter((c) => c.visible), [m]), N = O(
|
|
746
741
|
() => ({ baseUrl: i, dashboardEndpoint: t, authToken: a, refreshKey: E }),
|
|
747
742
|
[i, t, a, E]
|
|
748
|
-
), { data: D } =
|
|
743
|
+
), { data: D } = Te("overview", N), q = O(() => {
|
|
749
744
|
if (!D) return {};
|
|
750
|
-
const
|
|
751
|
-
if (D.totalRequests > 0 && (
|
|
752
|
-
const S = D.logLevelBreakdown,
|
|
753
|
-
|
|
745
|
+
const c = {};
|
|
746
|
+
if (D.totalRequests > 0 && (c.requests = { count: D.totalRequests }), D.queryStats?.total > 0 && (c.queries = { count: D.queryStats.total }), D.logLevelBreakdown) {
|
|
747
|
+
const S = D.logLevelBreakdown, P = S.error + S.warn + S.info + S.debug;
|
|
748
|
+
P > 0 && (c.logs = { count: P });
|
|
754
749
|
}
|
|
755
|
-
return
|
|
750
|
+
return c;
|
|
756
751
|
}, [D]), M = B(() => {
|
|
757
|
-
const
|
|
758
|
-
overview: /* @__PURE__ */ e(
|
|
759
|
-
requests: /* @__PURE__ */ e(
|
|
760
|
-
queries: /* @__PURE__ */ e(
|
|
761
|
-
events: /* @__PURE__ */ e(
|
|
762
|
-
routes: /* @__PURE__ */ e(
|
|
763
|
-
logs: /* @__PURE__ */ e(
|
|
764
|
-
emails: /* @__PURE__ */ e(
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
internals: /* @__PURE__ */ e(qe, { options: k, debugEndpoint: n })
|
|
752
|
+
const c = {
|
|
753
|
+
overview: /* @__PURE__ */ e($e, { options: N }),
|
|
754
|
+
requests: /* @__PURE__ */ e(xe, { options: N }),
|
|
755
|
+
queries: /* @__PURE__ */ e(Ie, { options: N }),
|
|
756
|
+
events: /* @__PURE__ */ e(Be, { options: N }),
|
|
757
|
+
routes: /* @__PURE__ */ e(Me, { options: N }),
|
|
758
|
+
logs: /* @__PURE__ */ e(Re, { options: N }),
|
|
759
|
+
emails: /* @__PURE__ */ e(Oe, { options: N }),
|
|
760
|
+
cache: /* @__PURE__ */ e(_e, { options: N }),
|
|
761
|
+
jobs: /* @__PURE__ */ e(De, { options: N }),
|
|
762
|
+
config: /* @__PURE__ */ e(je, { options: N }),
|
|
763
|
+
internals: /* @__PURE__ */ e(He, { options: N, debugEndpoint: o })
|
|
770
764
|
};
|
|
771
|
-
return /* @__PURE__ */ e("div", { className: "ss-dash-pane ss-dash-active", id: `ss-dash-pane-${
|
|
772
|
-
}, [
|
|
773
|
-
return /* @__PURE__ */
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
-
/* @__PURE__ */
|
|
765
|
+
return /* @__PURE__ */ e("div", { className: "ss-dash-pane ss-dash-active", id: `ss-dash-pane-${h}`, children: /* @__PURE__ */ e("div", { className: "ss-dash-pane-inner", children: /* @__PURE__ */ e(F, { fallback: /* @__PURE__ */ e("div", { className: "ss-dash-empty", children: "Loading..." }), children: c[h] || /* @__PURE__ */ e("div", { className: "ss-dash-empty", children: "Unknown section" }) }) }) });
|
|
766
|
+
}, [h, N]);
|
|
767
|
+
return /* @__PURE__ */ l("div", { className: "ss-dash", "data-theme": v, id: "ss-dash", children: [
|
|
768
|
+
/* @__PURE__ */ l("div", { className: "ss-dash-header", children: [
|
|
769
|
+
/* @__PURE__ */ l("div", { className: "ss-dash-header-left", children: [
|
|
776
770
|
/* @__PURE__ */ e("span", { className: "ss-dash-logo", children: "Server Stats" }),
|
|
777
771
|
/* @__PURE__ */ e("span", { className: "ss-dash-logo-sub", children: "Dashboard" })
|
|
778
772
|
] }),
|
|
779
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ l("div", { className: "ss-dash-header-center", children: [
|
|
780
774
|
/* @__PURE__ */ e(
|
|
781
775
|
"span",
|
|
782
776
|
{
|
|
@@ -793,49 +787,49 @@ function Ve(s) {
|
|
|
793
787
|
}
|
|
794
788
|
)
|
|
795
789
|
] }),
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */ e(
|
|
798
|
-
|
|
790
|
+
/* @__PURE__ */ l("div", { className: "ss-dash-header-right", children: [
|
|
791
|
+
/* @__PURE__ */ e(W, { theme: v, onToggle: p }),
|
|
792
|
+
d && /* @__PURE__ */ e("a", { href: d, className: "ss-dash-back-link", title: "Back to app", children: "← App" })
|
|
799
793
|
] })
|
|
800
794
|
] }),
|
|
801
|
-
/* @__PURE__ */
|
|
802
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ l("div", { className: "ss-dash-body", children: [
|
|
796
|
+
/* @__PURE__ */ l(
|
|
803
797
|
"div",
|
|
804
798
|
{
|
|
805
|
-
className: `ss-dash-sidebar ${
|
|
799
|
+
className: `ss-dash-sidebar ${w ? "ss-dash-collapsed" : ""}`,
|
|
806
800
|
id: "ss-dash-sidebar",
|
|
807
801
|
children: [
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
x.map((
|
|
810
|
-
const S =
|
|
811
|
-
return /* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ l("nav", { className: "ss-dash-nav", children: [
|
|
803
|
+
x.map((c) => {
|
|
804
|
+
const S = q[c.id];
|
|
805
|
+
return /* @__PURE__ */ l(
|
|
812
806
|
"button",
|
|
813
807
|
{
|
|
814
808
|
type: "button",
|
|
815
|
-
className: `ss-dash-nav-item ${
|
|
816
|
-
"data-ss-section":
|
|
809
|
+
className: `ss-dash-nav-item ${h === c.id ? "ss-dash-active" : ""}`,
|
|
810
|
+
"data-ss-section": c.id,
|
|
817
811
|
onClick: () => {
|
|
818
|
-
|
|
812
|
+
c.id !== h && u(c.id);
|
|
819
813
|
},
|
|
820
|
-
title:
|
|
814
|
+
title: w ? c.label : void 0,
|
|
821
815
|
children: [
|
|
822
816
|
/* @__PURE__ */ e("span", { className: "ss-dash-nav-icon", children: /* @__PURE__ */ e(
|
|
823
817
|
"svg",
|
|
824
818
|
{
|
|
825
819
|
width: "20",
|
|
826
820
|
height: "20",
|
|
827
|
-
viewBox: (L[
|
|
821
|
+
viewBox: (L[c.id] || L.config).viewBox,
|
|
828
822
|
fill: "none",
|
|
829
823
|
stroke: "currentColor",
|
|
830
824
|
strokeWidth: "2",
|
|
831
825
|
strokeLinecap: "round",
|
|
832
826
|
strokeLinejoin: "round",
|
|
833
827
|
dangerouslySetInnerHTML: {
|
|
834
|
-
__html: (L[
|
|
828
|
+
__html: (L[c.id] || L.config).elements.join("")
|
|
835
829
|
}
|
|
836
830
|
}
|
|
837
831
|
) }),
|
|
838
|
-
/* @__PURE__ */ e("span", { className: "ss-dash-nav-label", children:
|
|
832
|
+
/* @__PURE__ */ e("span", { className: "ss-dash-nav-label", children: c.label }),
|
|
839
833
|
S && S.count > 0 && /* @__PURE__ */ e(
|
|
840
834
|
"span",
|
|
841
835
|
{
|
|
@@ -845,17 +839,17 @@ function Ve(s) {
|
|
|
845
839
|
)
|
|
846
840
|
]
|
|
847
841
|
},
|
|
848
|
-
|
|
842
|
+
c.id
|
|
849
843
|
);
|
|
850
844
|
}),
|
|
851
845
|
C.length > 0 && /* @__PURE__ */ e("div", { className: "ss-dash-nav-sep" }),
|
|
852
|
-
C.map((
|
|
846
|
+
C.map((c) => /* @__PURE__ */ l(
|
|
853
847
|
"button",
|
|
854
848
|
{
|
|
855
849
|
type: "button",
|
|
856
|
-
className: `ss-dash-nav-item ${
|
|
857
|
-
onClick: () =>
|
|
858
|
-
title:
|
|
850
|
+
className: `ss-dash-nav-item ${h === c.id ? "ss-dash-active" : ""}`,
|
|
851
|
+
onClick: () => u(c.id),
|
|
852
|
+
title: w ? c.label : void 0,
|
|
859
853
|
children: [
|
|
860
854
|
/* @__PURE__ */ e("span", { className: "ss-dash-nav-icon", children: /* @__PURE__ */ e(
|
|
861
855
|
"svg",
|
|
@@ -871,10 +865,10 @@ function Ve(s) {
|
|
|
871
865
|
dangerouslySetInnerHTML: { __html: L["custom-pane"].elements.join("") }
|
|
872
866
|
}
|
|
873
867
|
) }),
|
|
874
|
-
/* @__PURE__ */ e("span", { className: "ss-dash-nav-label", children:
|
|
868
|
+
/* @__PURE__ */ e("span", { className: "ss-dash-nav-label", children: c.label })
|
|
875
869
|
]
|
|
876
870
|
},
|
|
877
|
-
|
|
871
|
+
c.id
|
|
878
872
|
))
|
|
879
873
|
] }),
|
|
880
874
|
/* @__PURE__ */ e(
|
|
@@ -883,9 +877,9 @@ function Ve(s) {
|
|
|
883
877
|
type: "button",
|
|
884
878
|
className: "ss-dash-sidebar-toggle",
|
|
885
879
|
id: "ss-dash-sidebar-toggle",
|
|
886
|
-
onClick:
|
|
887
|
-
title:
|
|
888
|
-
children:
|
|
880
|
+
onClick: r,
|
|
881
|
+
title: w ? "Expand sidebar" : "Collapse sidebar",
|
|
882
|
+
children: w ? /* @__PURE__ */ e(
|
|
889
883
|
"svg",
|
|
890
884
|
{
|
|
891
885
|
width: "16",
|
|
@@ -917,38 +911,38 @@ function Ve(s) {
|
|
|
917
911
|
] })
|
|
918
912
|
] });
|
|
919
913
|
}
|
|
920
|
-
function
|
|
921
|
-
const { baseUrl: t = "", debugEndpoint:
|
|
922
|
-
|
|
914
|
+
function Je(s, i = {}) {
|
|
915
|
+
const { baseUrl: t = "", debugEndpoint: o = "/admin/api/debug", authToken: a } = i, [d, g] = y(null), [n, v] = y(!0), [p, h] = y(null), u = j(null);
|
|
916
|
+
u.current || (u.current = new ae({
|
|
923
917
|
baseUrl: t,
|
|
924
|
-
endpoint:
|
|
918
|
+
endpoint: o,
|
|
925
919
|
authToken: a,
|
|
926
|
-
onData: (
|
|
927
|
-
onLoading: (
|
|
928
|
-
onError: (
|
|
929
|
-
onUnauthorized: (
|
|
920
|
+
onData: (k) => g(k),
|
|
921
|
+
onLoading: (k) => v(k),
|
|
922
|
+
onError: (k) => h(k),
|
|
923
|
+
onUnauthorized: (k) => h(k)
|
|
930
924
|
})), R(() => {
|
|
931
|
-
const
|
|
932
|
-
return
|
|
925
|
+
const k = u.current;
|
|
926
|
+
return k.start(s), () => k.stop();
|
|
933
927
|
}, [s]);
|
|
934
|
-
const
|
|
935
|
-
|
|
928
|
+
const w = B(() => {
|
|
929
|
+
u.current?.refresh();
|
|
936
930
|
}, []), f = B(() => {
|
|
937
|
-
|
|
938
|
-
}, []), b = B((
|
|
939
|
-
|
|
931
|
+
g(null);
|
|
932
|
+
}, []), b = B((k, E) => {
|
|
933
|
+
u.current?.cacheForTab(k, E);
|
|
940
934
|
}, []);
|
|
941
|
-
return { data:
|
|
935
|
+
return { data: d, isLoading: n, error: p, refresh: w, clearData: f, cacheForTab: b };
|
|
942
936
|
}
|
|
943
|
-
function
|
|
937
|
+
function Ve({
|
|
944
938
|
color: s = "muted",
|
|
945
939
|
children: i,
|
|
946
940
|
className: t = "",
|
|
947
|
-
classPrefix:
|
|
941
|
+
classPrefix: o = "ss-dash"
|
|
948
942
|
}) {
|
|
949
|
-
return /* @__PURE__ */ e("span", { className: `${
|
|
943
|
+
return /* @__PURE__ */ e("span", { className: `${o}-badge ${o}-badge-${s} ${t}`, children: i });
|
|
950
944
|
}
|
|
951
|
-
function
|
|
945
|
+
function Ke({ method: s, className: i = "", classPrefix: t = "ss-dash" }) {
|
|
952
946
|
return /* @__PURE__ */ e(
|
|
953
947
|
"span",
|
|
954
948
|
{
|
|
@@ -957,17 +951,18 @@ function Qe({ method: s, className: i = "", classPrefix: t = "ss-dash" }) {
|
|
|
957
951
|
}
|
|
958
952
|
);
|
|
959
953
|
}
|
|
960
|
-
function
|
|
961
|
-
let
|
|
962
|
-
return s >= 500 ?
|
|
954
|
+
function Ge({ code: s, className: i = "", classPrefix: t = "ss-dash" }) {
|
|
955
|
+
let o = `${t}-status-2xx`;
|
|
956
|
+
return s >= 500 ? o = `${t}-status-5xx` : s >= 400 ? o = `${t}-status-4xx` : s >= 300 && (o = `${t}-status-3xx`), /* @__PURE__ */ e("span", { className: `${t}-status ${o} ${i}`, children: s });
|
|
963
957
|
}
|
|
964
|
-
function
|
|
958
|
+
function Qe({
|
|
965
959
|
data: s,
|
|
966
960
|
maxPreviewLength: i = 100,
|
|
967
961
|
className: t = "",
|
|
968
|
-
classPrefix:
|
|
962
|
+
classPrefix: o = "ss-dash",
|
|
963
|
+
defaultExpanded: a = !1
|
|
969
964
|
}) {
|
|
970
|
-
const [
|
|
965
|
+
const [d, g] = y(a), n = O(() => {
|
|
971
966
|
if (typeof s == "string")
|
|
972
967
|
try {
|
|
973
968
|
return JSON.parse(s);
|
|
@@ -975,73 +970,73 @@ function Ye({
|
|
|
975
970
|
return s;
|
|
976
971
|
}
|
|
977
972
|
return s;
|
|
978
|
-
}, [s]),
|
|
979
|
-
|
|
980
|
-
}, []),
|
|
973
|
+
}, [s]), v = O(() => typeof n == "object" && n !== null ? le(n, i) : String(n ?? "-"), [n, i]), p = O(() => typeof n == "object" && n !== null ? JSON.stringify(n, null, 2) : String(n), [n]), h = B(() => {
|
|
974
|
+
g((w) => !w);
|
|
975
|
+
}, []), u = B(async () => {
|
|
981
976
|
try {
|
|
982
|
-
await navigator.clipboard.writeText(
|
|
977
|
+
await navigator.clipboard.writeText(p);
|
|
983
978
|
} catch {
|
|
984
979
|
}
|
|
985
|
-
}, [
|
|
986
|
-
return !s && s !== 0 && s !== !1 ? /* @__PURE__ */ e("span", { className: `ss-dim ${
|
|
987
|
-
/* @__PURE__ */ e(
|
|
980
|
+
}, [p]);
|
|
981
|
+
return !s && s !== 0 && s !== !1 ? /* @__PURE__ */ e("span", { className: `ss-dim ${o}-c-dim`, children: "-" }) : /* @__PURE__ */ l("div", { className: `${o}-data-cell ${t}`, children: [
|
|
982
|
+
!d && /* @__PURE__ */ e(
|
|
988
983
|
"span",
|
|
989
984
|
{
|
|
990
|
-
className: `${
|
|
991
|
-
onClick:
|
|
985
|
+
className: `${o}-data-preview`,
|
|
986
|
+
onClick: h,
|
|
992
987
|
role: "button",
|
|
993
988
|
tabIndex: 0,
|
|
994
|
-
onKeyDown: (
|
|
995
|
-
children:
|
|
989
|
+
onKeyDown: (w) => w.key === "Enter" && h(),
|
|
990
|
+
children: v
|
|
996
991
|
}
|
|
997
992
|
),
|
|
998
|
-
|
|
993
|
+
d && /* @__PURE__ */ l("div", { className: `${o}-data-full`, onClick: h, children: [
|
|
999
994
|
/* @__PURE__ */ e(
|
|
1000
995
|
"button",
|
|
1001
996
|
{
|
|
1002
|
-
className: `${
|
|
1003
|
-
onClick: (
|
|
1004
|
-
|
|
997
|
+
className: `${o}-copy-btn`,
|
|
998
|
+
onClick: (w) => {
|
|
999
|
+
w.stopPropagation(), u();
|
|
1005
1000
|
},
|
|
1006
1001
|
title: "Copy to clipboard",
|
|
1007
1002
|
type: "button",
|
|
1008
1003
|
children: "Copy"
|
|
1009
1004
|
}
|
|
1010
1005
|
),
|
|
1011
|
-
/* @__PURE__ */ e("pre", { children:
|
|
1006
|
+
/* @__PURE__ */ e("pre", { children: p })
|
|
1012
1007
|
] })
|
|
1013
1008
|
] });
|
|
1014
1009
|
}
|
|
1015
|
-
function
|
|
1016
|
-
const [a,
|
|
1017
|
-
|
|
1018
|
-
}, []),
|
|
1019
|
-
|
|
1010
|
+
function Xe({ content: s, children: i, position: t = "top", className: o = "" }) {
|
|
1011
|
+
const [a, d] = y(!1), [g, n] = y({ left: 0, bottom: 0 }), v = j(null), p = j(null), h = B(() => {
|
|
1012
|
+
d(!0);
|
|
1013
|
+
}, []), u = B(() => {
|
|
1014
|
+
d(!1);
|
|
1020
1015
|
}, []);
|
|
1021
1016
|
return R(() => {
|
|
1022
|
-
if (!a || !
|
|
1023
|
-
const
|
|
1024
|
-
let b =
|
|
1025
|
-
b < 8 && (b = 8), b + f.width > window.innerWidth - 8 && (b = window.innerWidth - 8 - f.width), t === "top" && (
|
|
1026
|
-
}, [a, t]), /* @__PURE__ */
|
|
1017
|
+
if (!a || !v.current || !p.current) return;
|
|
1018
|
+
const w = v.current.getBoundingClientRect(), f = p.current.getBoundingClientRect();
|
|
1019
|
+
let b = w.left + w.width / 2 - f.width / 2, k;
|
|
1020
|
+
b < 8 && (b = 8), b + f.width > window.innerWidth - 8 && (b = window.innerWidth - 8 - f.width), t === "top" && (k = window.innerHeight - w.top + 8), n({ left: b, bottom: k ?? 0 });
|
|
1021
|
+
}, [a, t]), /* @__PURE__ */ l(
|
|
1027
1022
|
"div",
|
|
1028
1023
|
{
|
|
1029
|
-
ref:
|
|
1030
|
-
className: `ss-tooltip-trigger ${
|
|
1031
|
-
onMouseEnter:
|
|
1032
|
-
onMouseLeave:
|
|
1024
|
+
ref: v,
|
|
1025
|
+
className: `ss-tooltip-trigger ${o}`,
|
|
1026
|
+
onMouseEnter: h,
|
|
1027
|
+
onMouseLeave: u,
|
|
1033
1028
|
style: { display: "inline-flex", position: "relative" },
|
|
1034
1029
|
children: [
|
|
1035
1030
|
i,
|
|
1036
|
-
a && /* @__PURE__ */
|
|
1031
|
+
a && /* @__PURE__ */ l(
|
|
1037
1032
|
"div",
|
|
1038
1033
|
{
|
|
1039
1034
|
ref: p,
|
|
1040
1035
|
className: "ss-tooltip",
|
|
1041
1036
|
style: {
|
|
1042
1037
|
position: "fixed",
|
|
1043
|
-
left: `${
|
|
1044
|
-
bottom: t === "top" ? `${
|
|
1038
|
+
left: `${g.left}px`,
|
|
1039
|
+
bottom: t === "top" ? `${g.bottom}px` : void 0,
|
|
1045
1040
|
zIndex: 200,
|
|
1046
1041
|
pointerEvents: "none"
|
|
1047
1042
|
},
|
|
@@ -1056,19 +1051,19 @@ function Ze({ content: s, children: i, position: t = "top", className: n = "" })
|
|
|
1056
1051
|
);
|
|
1057
1052
|
}
|
|
1058
1053
|
export {
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1054
|
+
Ve as B,
|
|
1055
|
+
We as D,
|
|
1056
|
+
Qe as J,
|
|
1057
|
+
Ke as M,
|
|
1058
|
+
ue as S,
|
|
1059
|
+
W as T,
|
|
1060
|
+
Te as a,
|
|
1061
|
+
Ge as b,
|
|
1062
|
+
Ae as c,
|
|
1063
|
+
ze as d,
|
|
1064
|
+
Xe as e,
|
|
1070
1065
|
z as f,
|
|
1071
|
-
|
|
1066
|
+
de as g,
|
|
1072
1067
|
A as h,
|
|
1073
|
-
|
|
1068
|
+
Je as u
|
|
1074
1069
|
};
|