adonisjs-server-stats 1.16.0 → 1.17.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/README.md +14 -2
- package/dist/core/core/dashboard-api.d.ts +6 -4
- package/dist/core/index.js +9 -6
- package/dist/core/types.d.ts +24 -1
- package/dist/react/{CacheSection-DkLtukWz.js → CacheSection-C-X2Tnca.js} +48 -44
- package/dist/react/{CacheTab-DWeXnEBI.js → CacheTab-D55mfmeE.js} +1 -1
- package/dist/react/{ConfigSection-DaVbFPDg.js → ConfigSection-C-HGnZfd.js} +1 -1
- package/dist/react/{ConfigTab-D4640WJZ.js → ConfigTab-CNnsOXBh.js} +1 -1
- package/dist/react/{CustomPaneTab-DglmAVMC.js → CustomPaneTab-D-267UVd.js} +1 -1
- package/dist/react/{EmailsSection-vYx6ExTb.js → EmailsSection-Bqw4DI4r.js} +65 -57
- package/dist/react/{EmailsTab-DKDrRmRH.js → EmailsTab-CkHOhj2F.js} +1 -1
- package/dist/react/{EventsSection-CapH5xut.js → EventsSection-CMeyjzVC.js} +1 -1
- package/dist/react/{EventsTab-BNVEySAm.js → EventsTab-DgS2v1HX.js} +1 -1
- package/dist/react/{JobsSection-ZIQsJWid.js → JobsSection-oWH6pbrG.js} +1 -1
- package/dist/react/{JobsTab-DXQzXrDt.js → JobsTab-zdxX_as-.js} +1 -1
- package/dist/react/{LogEntryRow-BWkHE51-.js → LogEntryRow-Cn8Ee_X0.js} +1 -1
- package/dist/react/{LogsSection-ConXdBkL.js → LogsSection-XmiI2MMs.js} +2 -2
- package/dist/react/{LogsTab-CJM47LPn.js → LogsTab-ixusY4v7.js} +2 -2
- package/dist/react/{OverviewSection-DOMu2qvl.js → OverviewSection-CvhObTLP.js} +119 -111
- package/dist/react/{QueriesSection-DFsaOSJI.js → QueriesSection-BvledwBI.js} +1 -1
- package/dist/react/{QueriesTab-CY9CG_7L.js → QueriesTab-smQQJvJa.js} +1 -1
- package/dist/react/{RequestsSection-CC-eVHsl.js → RequestsSection-DKuYpViv.js} +2 -2
- package/dist/react/{RoutesSection-p1DMq41y.js → RoutesSection-5RNVurQ6.js} +1 -1
- package/dist/react/{RoutesTab-Cnqy8UcK.js → RoutesTab-CpXNO-Rx.js} +1 -1
- package/dist/react/{SplitPaneWrapper-XgkA0QxE.js → SplitPaneWrapper-DQvJnsuk.js} +1 -1
- package/dist/react/{TimelineTab-1YOERxe5.js → TimelineTab-LHQHHKkO.js} +2 -2
- package/dist/react/components/Dashboard/overview-data-context.d.ts +15 -0
- package/dist/react/components/Dashboard/sections/OverviewSection.d.ts +9 -0
- package/dist/react/{index-DOSlCpZ9.js → index-LlFvooUN.js} +148 -141
- package/dist/react/index.js +1 -1
- package/dist/src/collectors/app_collector.d.ts +11 -0
- package/dist/src/collectors/app_collector.js +11 -0
- package/dist/src/collectors/redis_collector.js +13 -13
- package/dist/src/dashboard/cache_handlers.d.ts +17 -3
- package/dist/src/dashboard/cache_handlers.js +14 -19
- package/dist/src/dashboard/coalesce_cache.d.ts +2 -8
- package/dist/src/dashboard/coalesce_cache.js +25 -0
- package/dist/src/dashboard/dashboard_controller.d.ts +1 -0
- package/dist/src/dashboard/dashboard_controller.js +8 -3
- package/dist/src/dashboard/dashboard_store.d.ts +1 -3
- package/dist/src/dashboard/dashboard_store.js +14 -9
- package/dist/src/dashboard/dashboard_types.d.ts +2 -0
- package/dist/src/dashboard/filter_handlers.js +26 -4
- package/dist/src/dashboard/flush_manager.d.ts +2 -6
- package/dist/src/dashboard/flush_manager.js +9 -11
- package/dist/src/dashboard/format_helpers.d.ts +0 -4
- package/dist/src/dashboard/format_helpers.js +0 -19
- package/dist/src/dashboard/integrations/config_inspector.js +15 -52
- package/dist/src/dashboard/migrator_tables.js +4 -0
- package/dist/src/dashboard/paginate_helper.js +21 -11
- package/dist/src/dashboard/sensitive_patterns.d.ts +76 -0
- package/dist/src/dashboard/sensitive_patterns.js +259 -0
- package/dist/src/dashboard/write_queue.d.ts +27 -16
- package/dist/src/dashboard/write_queue.js +50 -47
- package/dist/src/debug/event_collector.d.ts +8 -0
- package/dist/src/debug/event_collector.js +12 -0
- package/dist/src/debug/query_collector.js +6 -1
- package/dist/src/debug/trace_collector.js +26 -13
- package/dist/src/edge/client/dashboard.js +2 -2
- package/dist/src/edge/client-vue/dashboard.js +5 -5
- package/dist/src/edge/views/dashboard.edge +1 -1
- package/dist/src/edge/views/debug-panel.edge +1 -1
- package/dist/src/edge/views/stats-bar.edge +1 -1
- package/dist/src/middleware/request_tracking_middleware.js +7 -2
- package/dist/src/provider/dashboard_init.d.ts +9 -1
- package/dist/src/provider/dashboard_init.js +19 -0
- package/dist/src/provider/email_helpers.js +20 -5
- package/dist/src/provider/server_stats_provider.d.ts +9 -0
- package/dist/src/provider/server_stats_provider.js +26 -7
- package/dist/src/provider/shutdown_helpers.js +3 -1
- package/dist/src/provider/toolbar_setup.js +21 -15
- package/dist/src/types.d.ts +24 -1
- package/dist/vue/CacheSection-Bm0goqX6.js +161 -0
- package/dist/vue/{ConfigSection-BiRAiaHj.js → ConfigSection-BrYslIMN.js} +1 -1
- package/dist/vue/{EmailsSection-Dl44qyqY.js → EmailsSection-B8N5vaWA.js} +89 -85
- package/dist/vue/{EventsSection-CWjeitjU.js → EventsSection-D2Y_xt0m.js} +1 -1
- package/dist/vue/{JobsSection-DOBb4LjZ.js → JobsSection-cEKqELLC.js} +1 -1
- package/dist/vue/{LogsSection-CXx-HOWJ.js → LogsSection-C3H2c0S3.js} +1 -1
- package/dist/vue/{OverviewSection-CyfNQ8uV.js → OverviewSection-I2swuHDa.js} +1 -1
- package/dist/vue/{QueriesSection-CXBsFp-y.js → QueriesSection-CF1IE3SN.js} +1 -1
- package/dist/vue/{RequestsSection-YTIaZGZd.js → RequestsSection-CuwgXzmU.js} +1 -1
- package/dist/vue/{RoutesSection-CDKMey49.js → RoutesSection-BhJCF7Rn.js} +1 -1
- package/dist/vue/composables/useDashboardData.d.ts +1 -1
- package/dist/vue/{index-14x39RI_.js → index-DUsImuIN.js} +95 -95
- package/dist/vue/index.js +1 -1
- package/package.json +12 -3
- package/dist/src/dashboard/explain_query.d.ts +0 -8
- package/dist/src/dashboard/explain_query.js +0 -22
- package/dist/src/provider/boot_initializer.d.ts +0 -28
- package/dist/src/provider/boot_initializer.js +0 -35
- package/dist/vue/CacheSection-CxEBVVkF.js +0 -156
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as s, jsxs as c, Fragment as P } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { DEFAULT_FEATURES as
|
|
4
|
-
import { createPortal as
|
|
2
|
+
import Q, { useState as w, useRef as R, useEffect as D, useCallback as x, useMemo as B, Suspense as W, lazy as T, createContext as X } from "react";
|
|
3
|
+
import { DEFAULT_FEATURES as Y, detectFeatures as Z, ServerStatsController as ee, getTheme as se, onThemeChange as te, toggleTheme as ne, buildSparklineData as re, computeStats as oe, formatStatNum as U, detectMetricGroupsFromStats as ae, getVisibleMetricGroups as ie, METRIC_DEFINITIONS as le, TAB_ICONS as C, DashboardDataController as ce, subscribeToChannel as de, DebugDataController as ue, compactPreview as he } from "adonisjs-server-stats/core";
|
|
4
|
+
import { createPortal as pe } from "react-dom";
|
|
5
5
|
function q(e = {}) {
|
|
6
|
-
const { baseUrl: r = "", debugEndpoint: t = "/admin/api/debug", authToken: n } = e, [o, l] = w(
|
|
7
|
-
return
|
|
6
|
+
const { baseUrl: r = "", debugEndpoint: t = "/admin/api/debug", authToken: n } = e, [o, l] = w(Y), [b, a] = w(!0), [v, m] = w(null), u = R(!1);
|
|
7
|
+
return D(() => {
|
|
8
8
|
if (u.current) return;
|
|
9
9
|
u.current = !0;
|
|
10
10
|
let d = !1;
|
|
11
11
|
return (async () => {
|
|
12
12
|
try {
|
|
13
|
-
const g = await
|
|
13
|
+
const g = await Z({ baseUrl: r, debugEndpoint: t, authToken: n });
|
|
14
14
|
d || (l(g), a(!1));
|
|
15
15
|
} catch (g) {
|
|
16
16
|
d || (m(g instanceof Error ? g : new Error(String(g))), a(!1));
|
|
@@ -20,19 +20,19 @@ function q(e = {}) {
|
|
|
20
20
|
};
|
|
21
21
|
}, [r, t, n]), { features: o, isLoading: b, error: v };
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function be(e = {}) {
|
|
24
24
|
const {
|
|
25
25
|
baseUrl: r = "",
|
|
26
26
|
endpoint: t = "/admin/api/server-stats",
|
|
27
27
|
channelName: n = "admin/server-stats",
|
|
28
28
|
authToken: o,
|
|
29
29
|
pollInterval: l = 3e3
|
|
30
|
-
} = e, [b, a] = w(null), [v, m] = w(!1), [u, d] = w(!1), [f, g] = w(null), [p, S] = w(!1),
|
|
31
|
-
|
|
30
|
+
} = e, [b, a] = w(null), [v, m] = w(!1), [u, d] = w(!1), [f, g] = w(null), [p, S] = w(!1), O = R(null);
|
|
31
|
+
D(() => {
|
|
32
32
|
S(!1);
|
|
33
|
-
}, [r, o]),
|
|
33
|
+
}, [r, o]), D(() => {
|
|
34
34
|
if (p) return;
|
|
35
|
-
const k = new
|
|
35
|
+
const k = new ee({
|
|
36
36
|
baseUrl: r,
|
|
37
37
|
endpoint: t,
|
|
38
38
|
channelName: n,
|
|
@@ -44,14 +44,14 @@ function ue(e = {}) {
|
|
|
44
44
|
onError: (y) => g(y),
|
|
45
45
|
onUnauthorizedChange: (y) => S(y)
|
|
46
46
|
});
|
|
47
|
-
return
|
|
48
|
-
k.stop(),
|
|
47
|
+
return O.current = k, k.start(), () => {
|
|
48
|
+
k.stop(), O.current = null;
|
|
49
49
|
};
|
|
50
50
|
}, [r, n, o, l, p]);
|
|
51
|
-
const I = x((k) =>
|
|
51
|
+
const I = x((k) => O.current?.getHistory(k) ?? [], []);
|
|
52
52
|
return {
|
|
53
53
|
stats: b,
|
|
54
|
-
history:
|
|
54
|
+
history: O.current?.getAllHistory() ?? {},
|
|
55
55
|
getHistory: I,
|
|
56
56
|
isConnected: v,
|
|
57
57
|
isStale: u,
|
|
@@ -60,27 +60,27 @@ function ue(e = {}) {
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
function F() {
|
|
63
|
-
const [e, r] = w(() =>
|
|
64
|
-
|
|
63
|
+
const [e, r] = w(() => se());
|
|
64
|
+
D(() => te((o) => {
|
|
65
65
|
r(o);
|
|
66
66
|
}), []);
|
|
67
67
|
const t = x(() => {
|
|
68
|
-
const n =
|
|
68
|
+
const n = ne();
|
|
69
69
|
return r(n), n;
|
|
70
70
|
}, []);
|
|
71
71
|
return { theme: e, toggleTheme: t };
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function ge({
|
|
74
74
|
data: e,
|
|
75
75
|
color: r = "#34d399",
|
|
76
76
|
width: t = 120,
|
|
77
77
|
height: n = 32,
|
|
78
78
|
className: o = ""
|
|
79
79
|
}) {
|
|
80
|
-
const l =
|
|
81
|
-
() =>
|
|
80
|
+
const l = B(
|
|
81
|
+
() => re(e, { width: t, height: n }),
|
|
82
82
|
[e, t, n]
|
|
83
|
-
), b =
|
|
83
|
+
), b = B(() => "ss-grad-" + Math.random().toString(36).slice(2, 8), []), a = { "--ss-accent": r };
|
|
84
84
|
if (!l)
|
|
85
85
|
return /* @__PURE__ */ s("div", { className: `ss-dash-sparkline ${o}`, style: a, children: /* @__PURE__ */ s(
|
|
86
86
|
"svg",
|
|
@@ -125,13 +125,13 @@ function he({
|
|
|
125
125
|
}
|
|
126
126
|
) });
|
|
127
127
|
}
|
|
128
|
-
const
|
|
128
|
+
const me = {
|
|
129
129
|
"ss-red": "#f87171",
|
|
130
130
|
"ss-amber": "#fbbf24",
|
|
131
131
|
"ss-green": "#34d399",
|
|
132
132
|
"ss-muted": "#737373"
|
|
133
133
|
};
|
|
134
|
-
function
|
|
134
|
+
function ve(e, r, t) {
|
|
135
135
|
const [n, o] = w({
|
|
136
136
|
position: "absolute",
|
|
137
137
|
bottom: "100%",
|
|
@@ -139,7 +139,7 @@ function be(e, r, t) {
|
|
|
139
139
|
marginBottom: "10px",
|
|
140
140
|
zIndex: 180
|
|
141
141
|
});
|
|
142
|
-
return
|
|
142
|
+
return D(() => {
|
|
143
143
|
if (!t) return;
|
|
144
144
|
const l = () => {
|
|
145
145
|
const a = e.current, v = r.current;
|
|
@@ -170,14 +170,14 @@ function be(e, r, t) {
|
|
|
170
170
|
};
|
|
171
171
|
}, [t, e, r]), n;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
const [o, l] = w(!1), [b, a] = w(!1), v =
|
|
173
|
+
function fe({ metric: e, stats: r, history: t, className: n = "" }) {
|
|
174
|
+
const [o, l] = w(!1), [b, a] = w(!1), v = R(null), m = R(null);
|
|
175
175
|
if (e.show && !e.show(r))
|
|
176
176
|
return null;
|
|
177
|
-
const u = e.value ? e.value(r) : e.format(r), d = e.color ? e.color(r) : "", f = d &&
|
|
177
|
+
const u = e.value ? e.value(r) : e.format(r), d = e.color ? e.color(r) : "", f = d && me[d] || "#34d399", g = typeof e.detail == "function" ? e.detail(r) : e.detail, p = B(() => oe(t), [t]), S = o || b, O = ve(v, m, S), I = x(($) => {
|
|
178
178
|
$.stopPropagation(), l((_) => !_);
|
|
179
179
|
}, []);
|
|
180
|
-
|
|
180
|
+
D(() => {
|
|
181
181
|
if (!o) return;
|
|
182
182
|
const $ = (N) => {
|
|
183
183
|
const i = N.target;
|
|
@@ -189,13 +189,13 @@ function ge({ metric: e, stats: r, history: t, className: n = "" }) {
|
|
|
189
189
|
document.removeEventListener("click", $), document.removeEventListener("keydown", _);
|
|
190
190
|
};
|
|
191
191
|
}, [o]);
|
|
192
|
-
const k = v.current?.closest(".ss-bar"), y = S && k ?
|
|
192
|
+
const k = v.current?.closest(".ss-bar"), y = S && k ? pe(
|
|
193
193
|
/* @__PURE__ */ c(
|
|
194
194
|
"div",
|
|
195
195
|
{
|
|
196
196
|
ref: m,
|
|
197
197
|
className: `ss-tooltip ${o ? "ss-pinned" : ""}`,
|
|
198
|
-
style:
|
|
198
|
+
style: O,
|
|
199
199
|
children: [
|
|
200
200
|
/* @__PURE__ */ c("div", { className: "ss-tooltip-inner", style: { position: "relative" }, children: [
|
|
201
201
|
o && /* @__PURE__ */ s(
|
|
@@ -233,7 +233,7 @@ function ge({ metric: e, stats: r, history: t, className: n = "" }) {
|
|
|
233
233
|
] }),
|
|
234
234
|
g && /* @__PURE__ */ s("div", { className: "ss-tooltip-details", children: g }),
|
|
235
235
|
t.length > 0 && /* @__PURE__ */ c(P, { children: [
|
|
236
|
-
/* @__PURE__ */ s("div", { className: "ss-tooltip-sparkline", children: /* @__PURE__ */ s(
|
|
236
|
+
/* @__PURE__ */ s("div", { className: "ss-tooltip-sparkline", children: /* @__PURE__ */ s(ge, { data: t, color: f }) }),
|
|
237
237
|
/* @__PURE__ */ c("div", { className: "ss-tooltip-samples", children: [
|
|
238
238
|
"Last ",
|
|
239
239
|
Math.min(t.length, 60),
|
|
@@ -270,7 +270,7 @@ function ge({ metric: e, stats: r, history: t, className: n = "" }) {
|
|
|
270
270
|
y
|
|
271
271
|
] });
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function es(e) {
|
|
274
274
|
const {
|
|
275
275
|
featureOptions: r,
|
|
276
276
|
autoHideOnUnauthorized: t = !0,
|
|
@@ -278,12 +278,12 @@ function Qe(e) {
|
|
|
278
278
|
debugPanelOpen: o = !1,
|
|
279
279
|
onConnectionChange: l,
|
|
280
280
|
...b
|
|
281
|
-
} = e, { stats: a, getHistory: v, isConnected: m, isStale: u, unauthorized: d } =
|
|
282
|
-
|
|
281
|
+
} = e, { stats: a, getHistory: v, isConnected: m, isStale: u, unauthorized: d } = be(b);
|
|
282
|
+
D(() => {
|
|
283
283
|
l?.(m);
|
|
284
284
|
}, [m, l]);
|
|
285
|
-
const { features: f } = q(r), { theme: g } = F(), [p, S] = w(() => typeof window > "u" ? !0 : localStorage.getItem("admin:stats-bar") !== "hidden"),
|
|
286
|
-
|
|
285
|
+
const { features: f } = q(r), { theme: g } = F(), [p, S] = w(() => typeof window > "u" ? !0 : localStorage.getItem("admin:stats-bar") !== "hidden"), O = R(null), I = R(null);
|
|
286
|
+
D(() => {
|
|
287
287
|
t && d && S(!1);
|
|
288
288
|
}, [t, d]);
|
|
289
289
|
const k = x(() => {
|
|
@@ -292,7 +292,7 @@ function Qe(e) {
|
|
|
292
292
|
return localStorage.setItem("admin:stats-bar", i ? "visible" : "hidden"), i;
|
|
293
293
|
});
|
|
294
294
|
}, []);
|
|
295
|
-
|
|
295
|
+
D(() => {
|
|
296
296
|
const N = I.current;
|
|
297
297
|
if (!N) return;
|
|
298
298
|
const i = (L) => {
|
|
@@ -300,10 +300,10 @@ function Qe(e) {
|
|
|
300
300
|
};
|
|
301
301
|
return N.addEventListener("wheel", i, { passive: !1 }), () => N.removeEventListener("wheel", i);
|
|
302
302
|
}, []);
|
|
303
|
-
const y =
|
|
304
|
-
() =>
|
|
303
|
+
const y = B(() => a ? ae(a) : ie(f), [a, f]), $ = B(
|
|
304
|
+
() => le.filter((N) => y.has(N.group || "core")),
|
|
305
305
|
[y]
|
|
306
|
-
), _ =
|
|
306
|
+
), _ = B(() => {
|
|
307
307
|
const N = [];
|
|
308
308
|
let i = "";
|
|
309
309
|
for (const L of $) {
|
|
@@ -343,7 +343,7 @@ function Qe(e) {
|
|
|
343
343
|
]
|
|
344
344
|
}
|
|
345
345
|
),
|
|
346
|
-
/* @__PURE__ */ c("div", { ref:
|
|
346
|
+
/* @__PURE__ */ c("div", { ref: O, className: p ? "ss-bar" : "ss-bar ss-hidden", "data-ss-theme": g, children: [
|
|
347
347
|
/* @__PURE__ */ c("div", { className: "ss-bar-left", children: [
|
|
348
348
|
n && /* @__PURE__ */ s(
|
|
349
349
|
"button",
|
|
@@ -371,10 +371,10 @@ function Qe(e) {
|
|
|
371
371
|
),
|
|
372
372
|
/* @__PURE__ */ s("div", { className: u ? "ss-dot ss-stale" : "ss-dot" })
|
|
373
373
|
] }),
|
|
374
|
-
/* @__PURE__ */ s("div", { ref: I, className: "ss-bar-scroll", id: "ss-bar-scroll", children: a && _.map((N, i) => /* @__PURE__ */ c(
|
|
374
|
+
/* @__PURE__ */ s("div", { ref: I, className: "ss-bar-scroll", id: "ss-bar-scroll", children: a && _.map((N, i) => /* @__PURE__ */ c(Q.Fragment, { children: [
|
|
375
375
|
i > 0 && /* @__PURE__ */ s("div", { className: "ss-group-sep" }),
|
|
376
376
|
/* @__PURE__ */ s("div", { className: "ss-group", children: N.metrics.map((L) => /* @__PURE__ */ s(
|
|
377
|
-
|
|
377
|
+
fe,
|
|
378
378
|
{
|
|
379
379
|
metric: L,
|
|
380
380
|
stats: a,
|
|
@@ -386,7 +386,7 @@ function Qe(e) {
|
|
|
386
386
|
] })
|
|
387
387
|
] });
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function K({
|
|
390
390
|
theme: e,
|
|
391
391
|
onToggle: r,
|
|
392
392
|
className: t = "",
|
|
@@ -437,8 +437,8 @@ function A({
|
|
|
437
437
|
}
|
|
438
438
|
);
|
|
439
439
|
}
|
|
440
|
-
const
|
|
441
|
-
function
|
|
440
|
+
const we = T(() => import("./QueriesTab-smQQJvJa.js")), ke = T(() => import("./EventsTab-DgS2v1HX.js")), ye = T(() => import("./EmailsTab-CkHOhj2F.js")), Ne = T(() => import("./RoutesTab-CpXNO-Rx.js")), Ce = T(() => import("./LogsTab-ixusY4v7.js")), Se = T(() => import("./TimelineTab-LHQHHKkO.js")), Le = T(() => import("./CacheTab-D55mfmeE.js")), Te = T(() => import("./JobsTab-zdxX_as-.js")), Ee = T(() => import("./ConfigTab-CNnsOXBh.js")), $e = T(() => import("./InternalsTab-BygoSorC.js")), xe = T(() => import("./CustomPaneTab-D-267UVd.js"));
|
|
441
|
+
function ss(e) {
|
|
442
442
|
const {
|
|
443
443
|
defaultOpen: r = !1,
|
|
444
444
|
dashboardPath: t,
|
|
@@ -448,18 +448,18 @@ function Xe(e) {
|
|
|
448
448
|
...b
|
|
449
449
|
} = e, [a, v] = w(r), m = n !== void 0 ? n : a, u = (i) => {
|
|
450
450
|
o ? o(i) : v(i);
|
|
451
|
-
}, [d, f] = w("queries"), g =
|
|
451
|
+
}, [d, f] = w("queries"), g = B(
|
|
452
452
|
() => b,
|
|
453
453
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
454
454
|
[b.baseUrl, b.debugEndpoint, b.authToken]
|
|
455
|
-
), { features: p } = q(g), { theme: S, toggleTheme:
|
|
456
|
-
|
|
455
|
+
), { features: p } = q(g), { theme: S, toggleTheme: O } = F(), I = p.customPanes || [];
|
|
456
|
+
D(() => {
|
|
457
457
|
const i = (L) => {
|
|
458
458
|
L.key === "Escape" && m && u(!1);
|
|
459
459
|
};
|
|
460
460
|
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
461
461
|
}, [m]);
|
|
462
|
-
const k =
|
|
462
|
+
const k = B(
|
|
463
463
|
() => [
|
|
464
464
|
{ id: "queries", label: "Queries", visible: !0 },
|
|
465
465
|
{ id: "events", label: "Events", visible: !0 },
|
|
@@ -473,8 +473,8 @@ function Xe(e) {
|
|
|
473
473
|
{ id: "internals", label: "Internals", visible: !0 }
|
|
474
474
|
],
|
|
475
475
|
[p]
|
|
476
|
-
), y =
|
|
477
|
-
|
|
476
|
+
), y = B(() => k.filter((i) => i.visible), [k]);
|
|
477
|
+
D(() => {
|
|
478
478
|
const i = [
|
|
479
479
|
...y.map((L) => L.id),
|
|
480
480
|
...I.map((L) => L.id)
|
|
@@ -483,42 +483,42 @@ function Xe(e) {
|
|
|
483
483
|
}, [y, I, d]);
|
|
484
484
|
const $ = x(() => {
|
|
485
485
|
u(!m);
|
|
486
|
-
}, [m]), _ =
|
|
486
|
+
}, [m]), _ = B(() => {
|
|
487
487
|
const i = { options: g }, L = I.find((M) => M.id === d);
|
|
488
488
|
if (L)
|
|
489
|
-
return /* @__PURE__ */ s(
|
|
489
|
+
return /* @__PURE__ */ s(xe, { pane: L, options: g });
|
|
490
490
|
switch (d) {
|
|
491
491
|
case "queries":
|
|
492
|
-
return /* @__PURE__ */ s(
|
|
492
|
+
return /* @__PURE__ */ s(we, { ...i });
|
|
493
493
|
case "events":
|
|
494
|
-
return /* @__PURE__ */ s(
|
|
494
|
+
return /* @__PURE__ */ s(ke, { ...i });
|
|
495
495
|
case "emails":
|
|
496
|
-
return /* @__PURE__ */ s(
|
|
496
|
+
return /* @__PURE__ */ s(ye, { ...i });
|
|
497
497
|
case "routes":
|
|
498
498
|
return /* @__PURE__ */ s(
|
|
499
|
-
|
|
499
|
+
Ne,
|
|
500
500
|
{
|
|
501
501
|
...i,
|
|
502
502
|
currentPath: typeof window < "u" ? window.location.pathname : ""
|
|
503
503
|
}
|
|
504
504
|
);
|
|
505
505
|
case "logs":
|
|
506
|
-
return /* @__PURE__ */ s(
|
|
506
|
+
return /* @__PURE__ */ s(Ce, { ...i });
|
|
507
507
|
case "timeline":
|
|
508
|
-
return /* @__PURE__ */ s(
|
|
508
|
+
return /* @__PURE__ */ s(Se, { ...i });
|
|
509
509
|
case "cache":
|
|
510
|
-
return /* @__PURE__ */ s(
|
|
510
|
+
return /* @__PURE__ */ s(Le, { ...i, dashboardPath: t });
|
|
511
511
|
case "jobs":
|
|
512
|
-
return /* @__PURE__ */ s(
|
|
512
|
+
return /* @__PURE__ */ s(Te, { ...i, dashboardPath: t });
|
|
513
513
|
case "config":
|
|
514
|
-
return /* @__PURE__ */ s(
|
|
514
|
+
return /* @__PURE__ */ s(Ee, { ...i, dashboardPath: t });
|
|
515
515
|
case "internals":
|
|
516
|
-
return /* @__PURE__ */ s(
|
|
516
|
+
return /* @__PURE__ */ s($e, { ...i });
|
|
517
517
|
default:
|
|
518
518
|
return /* @__PURE__ */ s("div", { className: "ss-dbg-empty", children: "Unknown tab" });
|
|
519
519
|
}
|
|
520
520
|
}, [d, g, I, t]), N = x(
|
|
521
|
-
() => /* @__PURE__ */ s(
|
|
521
|
+
() => /* @__PURE__ */ s(W, { fallback: /* @__PURE__ */ s("div", { className: "ss-dbg-empty", children: "Loading..." }), children: _ }),
|
|
522
522
|
[_]
|
|
523
523
|
);
|
|
524
524
|
return /* @__PURE__ */ c(P, { children: [
|
|
@@ -599,7 +599,7 @@ function Xe(e) {
|
|
|
599
599
|
children: l ? "live" : "polling"
|
|
600
600
|
}
|
|
601
601
|
),
|
|
602
|
-
/* @__PURE__ */ s(
|
|
602
|
+
/* @__PURE__ */ s(K, { theme: S, onToggle: O, classPrefix: "ss-dbg" }),
|
|
603
603
|
t && /* @__PURE__ */ s(
|
|
604
604
|
"a",
|
|
605
605
|
{
|
|
@@ -642,8 +642,8 @@ function Xe(e) {
|
|
|
642
642
|
)
|
|
643
643
|
] });
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
return new
|
|
645
|
+
function Ie(e, r) {
|
|
646
|
+
return new ce({
|
|
647
647
|
baseUrl: r.baseUrl,
|
|
648
648
|
endpoint: r.dashboardEndpoint,
|
|
649
649
|
authToken: r.authToken,
|
|
@@ -659,16 +659,16 @@ function Ee(e, r) {
|
|
|
659
659
|
}
|
|
660
660
|
});
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function Me(e, r) {
|
|
663
663
|
e.ctrl.configure(r);
|
|
664
664
|
const t = e.prevSection !== e.section;
|
|
665
665
|
return t || !e.hasFetched ? (t ? e.ctrl.setSection(e.section) : e.ctrl.start(), !0) : (e.ctrl.start(), e.hasFetched);
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function Be() {
|
|
668
668
|
const [e, r] = w(null), [t, n] = w(null), [o, l] = w(!0), [b, a] = w(null);
|
|
669
669
|
return { data: e, setData: r, meta: t, setMeta: n, isLoading: o, setIsLoading: l, error: b, setError: a };
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function De(e) {
|
|
672
672
|
const r = x(() => {
|
|
673
673
|
e.current?.fetch(!0);
|
|
674
674
|
}, [e]), t = x(
|
|
@@ -685,8 +685,8 @@ function Ie(e) {
|
|
|
685
685
|
}, [e]);
|
|
686
686
|
return { refresh: r, mutate: t, getApi: n };
|
|
687
687
|
}
|
|
688
|
-
function
|
|
689
|
-
e.current || (e.current =
|
|
688
|
+
function Oe(e, r, t, n) {
|
|
689
|
+
e.current || (e.current = Ie(r, {
|
|
690
690
|
...t,
|
|
691
691
|
setData: (o) => n.setData(o),
|
|
692
692
|
setMeta: n.setMeta,
|
|
@@ -694,7 +694,7 @@ function Me(e, r, t, n) {
|
|
|
694
694
|
setError: n.setError
|
|
695
695
|
}));
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function Re(e) {
|
|
698
698
|
return {
|
|
699
699
|
baseUrl: e.baseUrl ?? "",
|
|
700
700
|
dashboardEndpoint: e.dashboardEndpoint ?? "/__stats/api",
|
|
@@ -709,11 +709,11 @@ function Be(e) {
|
|
|
709
709
|
refreshKey: e.refreshKey
|
|
710
710
|
};
|
|
711
711
|
}
|
|
712
|
-
function
|
|
713
|
-
const t =
|
|
714
|
-
|
|
712
|
+
function _e(e, r = {}) {
|
|
713
|
+
const t = Re(r), n = Be(), o = R(null), l = R(e), b = R(!1);
|
|
714
|
+
Oe(o, e, t, n), D(() => {
|
|
715
715
|
const v = l.current;
|
|
716
|
-
return l.current = e, b.current =
|
|
716
|
+
return l.current = e, b.current = Me(
|
|
717
717
|
{
|
|
718
718
|
ctrl: o.current,
|
|
719
719
|
section: e,
|
|
@@ -735,7 +735,7 @@ function De(e, r = {}) {
|
|
|
735
735
|
t.timeRange,
|
|
736
736
|
t.refreshKey
|
|
737
737
|
]);
|
|
738
|
-
const a =
|
|
738
|
+
const a = De(o);
|
|
739
739
|
return {
|
|
740
740
|
data: n.data,
|
|
741
741
|
meta: n.meta,
|
|
@@ -744,7 +744,7 @@ function De(e, r = {}) {
|
|
|
744
744
|
...a
|
|
745
745
|
};
|
|
746
746
|
}
|
|
747
|
-
const
|
|
747
|
+
const je = X(void 0), Pe = [
|
|
748
748
|
"overview",
|
|
749
749
|
"requests",
|
|
750
750
|
"queries",
|
|
@@ -756,8 +756,8 @@ const Re = [
|
|
|
756
756
|
"jobs",
|
|
757
757
|
"config",
|
|
758
758
|
"internals"
|
|
759
|
-
],
|
|
760
|
-
function
|
|
759
|
+
], He = T(() => import("./OverviewSection-CvhObTLP.js")), Ue = T(() => import("./RequestsSection-DKuYpViv.js")), qe = T(() => import("./QueriesSection-BvledwBI.js")), Fe = T(() => import("./EventsSection-CMeyjzVC.js")), ze = T(() => import("./RoutesSection-5RNVurQ6.js")), Ae = T(() => import("./LogsSection-XmiI2MMs.js")), We = T(() => import("./EmailsSection-Bqw4DI4r.js")), Ke = T(() => import("./CacheSection-C-X2Tnca.js")), Ve = T(() => import("./JobsSection-oWH6pbrG.js")), Je = T(() => import("./ConfigSection-C-HGnZfd.js")), Ge = T(() => import("./InternalsSection-lOv_UcSV.js"));
|
|
760
|
+
function ts(e) {
|
|
761
761
|
const {
|
|
762
762
|
baseUrl: r = "",
|
|
763
763
|
dashboardEndpoint: t = "/__stats/api",
|
|
@@ -765,42 +765,42 @@ function Ye(e) {
|
|
|
765
765
|
authToken: o,
|
|
766
766
|
backUrl: l = "/",
|
|
767
767
|
channelName: b = "server-stats/dashboard"
|
|
768
|
-
} = e, { features: a } = q({ baseUrl: r, debugEndpoint: n, authToken: o }), { theme: v, toggleTheme: m } = F(), [u, d] = w("overview"), f =
|
|
768
|
+
} = e, { features: a } = q({ baseUrl: r, debugEndpoint: n, authToken: o }), { theme: v, toggleTheme: m } = F(), [u, d] = w("overview"), f = R(u);
|
|
769
769
|
f.current = u;
|
|
770
|
-
const [g, p] = w(() => typeof window > "u" ? !1 : localStorage.getItem("ss-dash-sidebar") === "collapsed"), [S,
|
|
771
|
-
|
|
770
|
+
const [g, p] = w(() => typeof window > "u" ? !1 : localStorage.getItem("ss-dash-sidebar") === "collapsed"), [S, O] = w(!1), [I, k] = w(0), y = R(0);
|
|
771
|
+
D(() => {
|
|
772
772
|
if (!b) return;
|
|
773
|
-
const h =
|
|
773
|
+
const h = de({
|
|
774
774
|
baseUrl: r,
|
|
775
775
|
channelName: b,
|
|
776
776
|
authToken: o,
|
|
777
777
|
onMessage: () => {
|
|
778
778
|
y.current += 1, k(y.current);
|
|
779
779
|
},
|
|
780
|
-
onConnect: () =>
|
|
781
|
-
onDisconnect: () =>
|
|
782
|
-
onError: () =>
|
|
780
|
+
onConnect: () => O(!0),
|
|
781
|
+
onDisconnect: () => O(!1),
|
|
782
|
+
onError: () => O(!1)
|
|
783
783
|
});
|
|
784
784
|
return () => h.unsubscribe();
|
|
785
785
|
}, [r, b, o]);
|
|
786
786
|
const $ = a.customPanes || [], _ = x(
|
|
787
787
|
(h) => {
|
|
788
788
|
const E = h.replace("#", "").split("?")[0];
|
|
789
|
-
return E && [...
|
|
789
|
+
return E && [...Pe, ...$.map((G) => G.id)].includes(E) ? E : "overview";
|
|
790
790
|
},
|
|
791
791
|
[$]
|
|
792
792
|
);
|
|
793
|
-
|
|
793
|
+
D(() => {
|
|
794
794
|
if (typeof window > "u") return;
|
|
795
795
|
const h = _(window.location.hash);
|
|
796
796
|
(h !== "overview" || window.location.hash) && d(h);
|
|
797
|
-
}, [_]),
|
|
797
|
+
}, [_]), D(() => {
|
|
798
798
|
const h = () => {
|
|
799
799
|
const E = _(window.location.hash);
|
|
800
800
|
E !== f.current && d(E);
|
|
801
801
|
};
|
|
802
802
|
return window.addEventListener("hashchange", h), () => window.removeEventListener("hashchange", h);
|
|
803
|
-
}, [_]),
|
|
803
|
+
}, [_]), D(() => {
|
|
804
804
|
typeof window > "u" || (window.location.hash = u);
|
|
805
805
|
}, [u]);
|
|
806
806
|
const N = x(() => {
|
|
@@ -808,7 +808,7 @@ function Ye(e) {
|
|
|
808
808
|
const E = !h;
|
|
809
809
|
return localStorage.setItem("ss-dash-sidebar", E ? "collapsed" : "expanded"), E;
|
|
810
810
|
});
|
|
811
|
-
}, []), i =
|
|
811
|
+
}, []), i = B(
|
|
812
812
|
() => [
|
|
813
813
|
{ id: "overview", label: "Overview", visible: !0 },
|
|
814
814
|
{ id: "requests", label: "Requests", visible: !0 },
|
|
@@ -823,10 +823,16 @@ function Ye(e) {
|
|
|
823
823
|
{ id: "internals", label: "Internals", visible: !0 }
|
|
824
824
|
],
|
|
825
825
|
[a]
|
|
826
|
-
), L =
|
|
826
|
+
), L = B(() => i.filter((h) => h.visible), [i]), M = B(
|
|
827
827
|
() => ({ baseUrl: r, dashboardEndpoint: t, authToken: o, refreshKey: I }),
|
|
828
828
|
[r, t, o, I]
|
|
829
|
-
), { data: j
|
|
829
|
+
), { data: j, isLoading: z } = _e(
|
|
830
|
+
"overview",
|
|
831
|
+
M
|
|
832
|
+
), A = B(
|
|
833
|
+
() => ({ data: j, isLoading: z }),
|
|
834
|
+
[j, z]
|
|
835
|
+
), V = B(() => {
|
|
830
836
|
if (!j) return {};
|
|
831
837
|
const h = {};
|
|
832
838
|
if (j.totalRequests > 0 && (h.requests = { count: j.totalRequests }), j.queryStats?.total > 0 && (h.queries = { count: j.queryStats.total }), j.logLevelBreakdown) {
|
|
@@ -834,22 +840,22 @@ function Ye(e) {
|
|
|
834
840
|
H > 0 && (h.logs = { count: H });
|
|
835
841
|
}
|
|
836
842
|
return h;
|
|
837
|
-
}, [j]),
|
|
843
|
+
}, [j]), J = x(() => {
|
|
838
844
|
const h = {
|
|
839
|
-
overview: /* @__PURE__ */ s(
|
|
840
|
-
requests: /* @__PURE__ */ s(
|
|
841
|
-
queries: /* @__PURE__ */ s(
|
|
842
|
-
events: /* @__PURE__ */ s(
|
|
843
|
-
routes: /* @__PURE__ */ s(
|
|
844
|
-
logs: /* @__PURE__ */ s(
|
|
845
|
-
emails: /* @__PURE__ */ s(
|
|
846
|
-
cache: /* @__PURE__ */ s(
|
|
847
|
-
jobs: /* @__PURE__ */ s(
|
|
848
|
-
config: /* @__PURE__ */ s(
|
|
849
|
-
internals: /* @__PURE__ */ s(
|
|
845
|
+
overview: /* @__PURE__ */ s(He, { options: M }),
|
|
846
|
+
requests: /* @__PURE__ */ s(Ue, { options: M }),
|
|
847
|
+
queries: /* @__PURE__ */ s(qe, { options: M }),
|
|
848
|
+
events: /* @__PURE__ */ s(Fe, { options: M }),
|
|
849
|
+
routes: /* @__PURE__ */ s(ze, { options: M }),
|
|
850
|
+
logs: /* @__PURE__ */ s(Ae, { options: M }),
|
|
851
|
+
emails: /* @__PURE__ */ s(We, { options: M }),
|
|
852
|
+
cache: /* @__PURE__ */ s(Ke, { options: M }),
|
|
853
|
+
jobs: /* @__PURE__ */ s(Ve, { options: M }),
|
|
854
|
+
config: /* @__PURE__ */ s(Je, { options: M }),
|
|
855
|
+
internals: /* @__PURE__ */ s(Ge, { options: M, debugEndpoint: n })
|
|
850
856
|
};
|
|
851
|
-
return /* @__PURE__ */ s("div", { className: "ss-dash-pane ss-dash-active", id: `ss-dash-pane-${u}`, children: /* @__PURE__ */ s("div", { className: "ss-dash-pane-inner", children: /* @__PURE__ */ s(
|
|
852
|
-
}, [u, M]);
|
|
857
|
+
return /* @__PURE__ */ s("div", { className: "ss-dash-pane ss-dash-active", id: `ss-dash-pane-${u}`, children: /* @__PURE__ */ s("div", { className: "ss-dash-pane-inner", children: /* @__PURE__ */ s(W, { fallback: /* @__PURE__ */ s("div", { className: "ss-dash-empty", children: "Loading..." }), children: /* @__PURE__ */ s(je.Provider, { value: A, children: h[u] || /* @__PURE__ */ s("div", { className: "ss-dash-empty", children: "Unknown section" }) }) }) }) });
|
|
858
|
+
}, [u, M, A]);
|
|
853
859
|
return /* @__PURE__ */ c("div", { className: "ss-dash", "data-theme": v, id: "ss-dash", children: [
|
|
854
860
|
/* @__PURE__ */ c("div", { className: "ss-dash-header", children: [
|
|
855
861
|
/* @__PURE__ */ c("div", { className: "ss-dash-header-left", children: [
|
|
@@ -874,7 +880,7 @@ function Ye(e) {
|
|
|
874
880
|
)
|
|
875
881
|
] }),
|
|
876
882
|
/* @__PURE__ */ c("div", { className: "ss-dash-header-right", children: [
|
|
877
|
-
/* @__PURE__ */ s(
|
|
883
|
+
/* @__PURE__ */ s(K, { theme: v, onToggle: m }),
|
|
878
884
|
l && /* @__PURE__ */ s("a", { href: l, className: "ss-dash-back-link", title: "Back to app", children: "← App" })
|
|
879
885
|
] })
|
|
880
886
|
] }),
|
|
@@ -887,7 +893,7 @@ function Ye(e) {
|
|
|
887
893
|
children: [
|
|
888
894
|
/* @__PURE__ */ c("nav", { className: "ss-dash-nav", role: "tablist", children: [
|
|
889
895
|
L.map((h) => {
|
|
890
|
-
const E =
|
|
896
|
+
const E = V[h.id];
|
|
891
897
|
return /* @__PURE__ */ c(
|
|
892
898
|
"button",
|
|
893
899
|
{
|
|
@@ -997,12 +1003,12 @@ function Ye(e) {
|
|
|
997
1003
|
]
|
|
998
1004
|
}
|
|
999
1005
|
),
|
|
1000
|
-
/* @__PURE__ */ s("div", { className: "ss-dash-main", children:
|
|
1006
|
+
/* @__PURE__ */ s("div", { className: "ss-dash-main", children: J() })
|
|
1001
1007
|
] })
|
|
1002
1008
|
] });
|
|
1003
1009
|
}
|
|
1004
|
-
function
|
|
1005
|
-
const { baseUrl: t = "", debugEndpoint: n = "/admin/api/debug", authToken: o } = r, [l, b] = w(null), [a, v] = w(!0), [m, u] = w(null), d =
|
|
1010
|
+
function ns(e, r = {}) {
|
|
1011
|
+
const { baseUrl: t = "", debugEndpoint: n = "/admin/api/debug", authToken: o } = r, [l, b] = w(null), [a, v] = w(!0), [m, u] = w(null), d = R(null), f = R(null), g = () => new ue({
|
|
1006
1012
|
baseUrl: t,
|
|
1007
1013
|
endpoint: n,
|
|
1008
1014
|
authToken: o,
|
|
@@ -1011,20 +1017,20 @@ function Ze(e, r = {}) {
|
|
|
1011
1017
|
onError: (k) => u(k),
|
|
1012
1018
|
onUnauthorized: (k) => u(k)
|
|
1013
1019
|
}), p = `${t}\0${n}\0${o ?? ""}`;
|
|
1014
|
-
(!d.current || f.current !== p) && (d.current?.stop(), d.current = g(), f.current = p),
|
|
1020
|
+
(!d.current || f.current !== p) && (d.current?.stop(), d.current = g(), f.current = p), D(() => {
|
|
1015
1021
|
const k = d.current;
|
|
1016
1022
|
return k.start(e), () => k.stop();
|
|
1017
1023
|
}, [e, p]);
|
|
1018
1024
|
const S = x(() => {
|
|
1019
1025
|
d.current?.refresh();
|
|
1020
|
-
}, []),
|
|
1026
|
+
}, []), O = x(() => {
|
|
1021
1027
|
b(null);
|
|
1022
1028
|
}, []), I = x((k, y) => {
|
|
1023
1029
|
d.current?.cacheForTab(k, y);
|
|
1024
1030
|
}, []);
|
|
1025
|
-
return { data: l, isLoading: a, error: m, refresh: S, clearData:
|
|
1031
|
+
return { data: l, isLoading: a, error: m, refresh: S, clearData: O, cacheForTab: I };
|
|
1026
1032
|
}
|
|
1027
|
-
function
|
|
1033
|
+
function rs({
|
|
1028
1034
|
color: e = "muted",
|
|
1029
1035
|
children: r,
|
|
1030
1036
|
className: t = "",
|
|
@@ -1032,7 +1038,7 @@ function es({
|
|
|
1032
1038
|
}) {
|
|
1033
1039
|
return /* @__PURE__ */ s("span", { className: `${n}-badge ${n}-badge-${e} ${t}`, children: r });
|
|
1034
1040
|
}
|
|
1035
|
-
function
|
|
1041
|
+
function os({ method: e, className: r = "", classPrefix: t = "ss-dash" }) {
|
|
1036
1042
|
return /* @__PURE__ */ s(
|
|
1037
1043
|
"span",
|
|
1038
1044
|
{
|
|
@@ -1041,18 +1047,18 @@ function ss({ method: e, className: r = "", classPrefix: t = "ss-dash" }) {
|
|
|
1041
1047
|
}
|
|
1042
1048
|
);
|
|
1043
1049
|
}
|
|
1044
|
-
function
|
|
1050
|
+
function as({ code: e, className: r = "", classPrefix: t = "ss-dash" }) {
|
|
1045
1051
|
let n = `${t}-status-2xx`;
|
|
1046
1052
|
return e >= 500 ? n = `${t}-status-5xx` : e >= 400 ? n = `${t}-status-4xx` : e >= 300 && (n = `${t}-status-3xx`), /* @__PURE__ */ s("span", { className: `${t}-status ${n} ${r}`, children: e });
|
|
1047
1053
|
}
|
|
1048
|
-
function
|
|
1054
|
+
function is({
|
|
1049
1055
|
data: e,
|
|
1050
1056
|
maxPreviewLength: r = 100,
|
|
1051
1057
|
className: t = "",
|
|
1052
1058
|
classPrefix: n = "ss-dash",
|
|
1053
1059
|
defaultExpanded: o = !1
|
|
1054
1060
|
}) {
|
|
1055
|
-
const [l, b] = w(o), a =
|
|
1061
|
+
const [l, b] = w(o), a = B(() => {
|
|
1056
1062
|
if (typeof e == "string")
|
|
1057
1063
|
try {
|
|
1058
1064
|
return JSON.parse(e);
|
|
@@ -1060,7 +1066,7 @@ function ns({
|
|
|
1060
1066
|
return e;
|
|
1061
1067
|
}
|
|
1062
1068
|
return e;
|
|
1063
|
-
}, [e]), v =
|
|
1069
|
+
}, [e]), v = B(() => typeof a == "object" && a !== null ? he(a, r) : String(a ?? "-"), [a, r]), m = B(() => typeof a == "object" && a !== null ? JSON.stringify(a, null, 2) : String(a), [a]), u = x(() => {
|
|
1064
1070
|
b((f) => !f);
|
|
1065
1071
|
}, []), d = x(async () => {
|
|
1066
1072
|
try {
|
|
@@ -1097,13 +1103,13 @@ function ns({
|
|
|
1097
1103
|
] })
|
|
1098
1104
|
] });
|
|
1099
1105
|
}
|
|
1100
|
-
function
|
|
1101
|
-
const [o, l] = w(!1), [b, a] = w({ left: 0, bottom: 0 }), v =
|
|
1106
|
+
function ls({ content: e, children: r, position: t = "top", className: n = "" }) {
|
|
1107
|
+
const [o, l] = w(!1), [b, a] = w({ left: 0, bottom: 0 }), v = R(null), m = R(null), u = x(() => {
|
|
1102
1108
|
l(!0);
|
|
1103
1109
|
}, []), d = x(() => {
|
|
1104
1110
|
l(!1);
|
|
1105
1111
|
}, []);
|
|
1106
|
-
return
|
|
1112
|
+
return D(() => {
|
|
1107
1113
|
if (!o || !v.current || !m.current) return;
|
|
1108
1114
|
const f = v.current.getBoundingClientRect(), g = m.current.getBoundingClientRect();
|
|
1109
1115
|
let p = f.left + f.width / 2 - g.width / 2, S;
|
|
@@ -1141,19 +1147,20 @@ function rs({ content: e, children: r, position: t = "top", className: n = "" })
|
|
|
1141
1147
|
);
|
|
1142
1148
|
}
|
|
1143
1149
|
export {
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1150
|
+
rs as B,
|
|
1151
|
+
ts as D,
|
|
1152
|
+
is as J,
|
|
1153
|
+
os as M,
|
|
1154
|
+
je as O,
|
|
1155
|
+
as as S,
|
|
1156
|
+
K as T,
|
|
1157
|
+
_e as a,
|
|
1158
|
+
ge as b,
|
|
1159
|
+
ss as c,
|
|
1160
|
+
es as d,
|
|
1161
|
+
ls as e,
|
|
1155
1162
|
q as f,
|
|
1156
|
-
|
|
1163
|
+
be as g,
|
|
1157
1164
|
F as h,
|
|
1158
|
-
|
|
1165
|
+
ns as u
|
|
1159
1166
|
};
|