adonisjs-server-stats 1.12.0 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/{CacheSection-DZFOiOYH.js → CacheSection-ewL3Ss82.js} +1 -1
- package/dist/react/{CacheTab-D8js5o69.js → CacheTab-B1wjTs64.js} +1 -1
- package/dist/react/{ConfigSection-DoJmvNkF.js → ConfigSection-DAHu9mfy.js} +1 -1
- package/dist/react/{ConfigTab-CDvljuBF.js → ConfigTab-B4E7Pitz.js} +1 -1
- package/dist/react/{CustomPaneTab-Db9eIQ-9.js → CustomPaneTab-iP7K6TLu.js} +1 -1
- package/dist/react/{EmailsSection-D7oxvAjA.js → EmailsSection-hUkyUnKo.js} +1 -1
- package/dist/react/{EmailsTab-BITuGTQm.js → EmailsTab-zZ4ucCv5.js} +1 -1
- package/dist/react/{EventsSection-7mDZv70I.js → EventsSection-CbGz-b_I.js} +1 -1
- package/dist/react/{EventsTab-DF13BChE.js → EventsTab-BUNTKy9p.js} +1 -1
- package/dist/react/{JobsSection-B_VJFWy6.js → JobsSection-D10TwmEZ.js} +1 -1
- package/dist/react/{JobsTab-DK8Fl9nz.js → JobsTab-CGrcuRPt.js} +1 -1
- package/dist/react/{LogEntryRow-Bdie9SFe.js → LogEntryRow-CkS9LMbl.js} +1 -1
- package/dist/react/{LogsSection-CrWqxWRr.js → LogsSection-BhS0Orbh.js} +2 -2
- package/dist/react/{LogsTab-DYSpL637.js → LogsTab-TChjBgV3.js} +2 -2
- package/dist/react/{OverviewSection-CuaccMZt.js → OverviewSection-DhU9kO4C.js} +1 -1
- package/dist/react/QueriesSection-Dz4Eird3.js +123 -0
- package/dist/react/QueriesTab-CGMtuFFF.js +87 -0
- package/dist/react/{RequestsSection-mENyeNsk.js → RequestsSection-CrwlbkXj.js} +2 -2
- package/dist/react/{RoutesSection-DjovlaNS.js → RoutesSection-DNmTM3w6.js} +1 -1
- package/dist/react/{RoutesTab-CbQECiUc.js → RoutesTab-BS4PNbRf.js} +1 -1
- package/dist/react/{SplitPaneWrapper-DyRyH5Re.js → SplitPaneWrapper-CIygm7YI.js} +1 -1
- package/dist/react/{TimelineTab-BKTFbsPe.js → TimelineTab-M3wrwrmF.js} +2 -2
- package/dist/react/{index-CAUHa8QX.js → index-LkZK--Bi.js} +2 -2
- package/dist/react/index.js +1 -1
- 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 +3 -3
- package/dist/vue/{CacheSection-Bx41lpfK.js → CacheSection-PpnXregU.js} +1 -1
- package/dist/vue/{ConfigSection-fkfUdCmx.js → ConfigSection-CX5Vg95P.js} +1 -1
- package/dist/vue/{EmailsSection-CbcDKF9Q.js → EmailsSection-BGHPwUgY.js} +1 -1
- package/dist/vue/{EventsSection-CWbTYOBi.js → EventsSection-x1DFVMLb.js} +1 -1
- package/dist/vue/{JobsSection-CGGO6rtS.js → JobsSection-BEiYKfvI.js} +1 -1
- package/dist/vue/{LogsSection-BPB-C-XA.js → LogsSection-ChxccWDj.js} +1 -1
- package/dist/vue/{OverviewSection-BTcnPeoM.js → OverviewSection-OAWpIQZS.js} +1 -1
- package/dist/vue/{QueriesSection-2SE3igQJ.js → QueriesSection-gKNTbjZz.js} +127 -115
- package/dist/vue/{RequestsSection-DXcG5Zok.js → RequestsSection-CgLTYSVg.js} +1 -1
- package/dist/vue/{RoutesSection-BkNGWdoP.js → RoutesSection-Bhnj_f3a.js} +1 -1
- package/dist/vue/{index-CptF6Qbp.js → index-DQxTdRYT.js} +1 -1
- package/dist/vue/index.js +1 -1
- package/package.json +1 -1
- package/dist/react/QueriesSection-CvGGh5Ij.js +0 -117
- package/dist/react/QueriesTab-C7CCwhVc.js +0 -87
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as o, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as c, useCallback as k } from "react";
|
|
3
3
|
import { formatCacheSize as x, formatTtl as D } from "adonisjs-server-stats/core";
|
|
4
|
-
import { a as N, J as V } from "./index-
|
|
4
|
+
import { a as N, J as V } from "./index-LkZK--Bi.js";
|
|
5
5
|
import { C as L } from "./CacheStatsBar-CRodCOeP.js";
|
|
6
6
|
import { D as F } from "./DataTable-YyShr5B-.js";
|
|
7
7
|
import { F as T } from "./FilterBar-CQ7bD669.js";
|
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as u, useMemo as T, useCallback as z } from "react";
|
|
3
3
|
import { formatTtl as K, formatCacheSize as L } from "adonisjs-server-stats/core";
|
|
4
4
|
import { u as R } from "./useDashboardApiBase-Bi36pJ2L.js";
|
|
5
|
-
import { u as $, J as j } from "./index-
|
|
5
|
+
import { u as $, J as j } from "./index-LkZK--Bi.js";
|
|
6
6
|
import { u as A } from "./useResizableTable-CNJmACdt.js";
|
|
7
7
|
import { C as F } from "./CacheStatsBar-CRodCOeP.js";
|
|
8
8
|
import { F as D } from "./FilterBar-CQ7bD669.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { a as i } from "./index-
|
|
2
|
+
import { a as i } from "./index-LkZK--Bi.js";
|
|
3
3
|
import { C as n } from "./ConfigContent-CnsEI4j3.js";
|
|
4
4
|
function m({ options: o = {} }) {
|
|
5
5
|
const { data: a, isLoading: s } = i("config", o);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { u as f } from "./useDashboardApiBase-Bi36pJ2L.js";
|
|
3
|
-
import { u as m } from "./index-
|
|
3
|
+
import { u as m } from "./index-LkZK--Bi.js";
|
|
4
4
|
import { C as d } from "./ConfigContent-CnsEI4j3.js";
|
|
5
5
|
function b({ options: r, dashboardPath: o }) {
|
|
6
6
|
const { resolvedOptions: a } = f(o, r), { data: e, isLoading: t, error: s } = m("config", a);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as w, useMemo as f } from "react";
|
|
3
3
|
import { compactPreview as k, formatDuration as x, durationClassName as M } from "adonisjs-server-stats/core";
|
|
4
|
-
import { u as L, B as A, M as B } from "./index-
|
|
4
|
+
import { u as L, B as A, M as B } from "./index-LkZK--Bi.js";
|
|
5
5
|
import { T as b } from "./TimeAgoCell-o3KigGfM.js";
|
|
6
6
|
import { u as D } from "./useResizableTable-CNJmACdt.js";
|
|
7
7
|
import { F as P } from "./FilterBar-CQ7bD669.js";
|
|
@@ -2,7 +2,7 @@ import { jsx as s, jsxs as y, Fragment as P } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as l, useEffect as T, useCallback as j } from "react";
|
|
3
3
|
import { resolveCcAddr as N, resolveToAddr as f, resolveFromAddr as b, resolveAttachmentCount as F, resolveTimestamp as _ } from "adonisjs-server-stats/core";
|
|
4
4
|
import { T as $ } from "./TimeAgoCell-o3KigGfM.js";
|
|
5
|
-
import { a as D } from "./index-
|
|
5
|
+
import { a as D } from "./index-LkZK--Bi.js";
|
|
6
6
|
import { D as E } from "./DataTable-YyShr5B-.js";
|
|
7
7
|
import { F as O } from "./FilterBar-CQ7bD669.js";
|
|
8
8
|
import { E as B } from "./EmailPreviewOverlay-BmXOAvqG.js";
|
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as c, useMemo as f, useCallback as w } from "react";
|
|
3
3
|
import { resolveTimestamp as k } from "adonisjs-server-stats/core";
|
|
4
4
|
import { T as E } from "./TimeAgoCell-o3KigGfM.js";
|
|
5
|
-
import { u as S } from "./index-
|
|
5
|
+
import { u as S } from "./index-LkZK--Bi.js";
|
|
6
6
|
import { u as j } from "./useResizableTable-CNJmACdt.js";
|
|
7
7
|
import { F as q } from "./FilterBar-CQ7bD669.js";
|
|
8
8
|
import { E as $ } from "./EmailPreviewOverlay-BmXOAvqG.js";
|
|
@@ -2,7 +2,7 @@ import { jsxs as i, jsx as e, Fragment as g } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as m, useEffect as f } from "react";
|
|
3
3
|
import { resolveEventName as y, resolveTimestamp as u } from "adonisjs-server-stats/core";
|
|
4
4
|
import { T as w } from "./TimeAgoCell-o3KigGfM.js";
|
|
5
|
-
import { a as b, J as N } from "./index-
|
|
5
|
+
import { a as b, J as N } from "./index-LkZK--Bi.js";
|
|
6
6
|
import { D as x } from "./DataTable-YyShr5B-.js";
|
|
7
7
|
import { F as P } from "./FilterBar-CQ7bD669.js";
|
|
8
8
|
import { P as k } from "./Pagination-BkmzUDY8.js";
|
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as p, useMemo as u } from "react";
|
|
3
3
|
import { resolveTimestamp as g } from "adonisjs-server-stats/core";
|
|
4
4
|
import { T as b } from "./TimeAgoCell-o3KigGfM.js";
|
|
5
|
-
import { u as f, J as v } from "./index-
|
|
5
|
+
import { u as f, J as v } from "./index-LkZK--Bi.js";
|
|
6
6
|
import { u as w } from "./useResizableTable-CNJmACdt.js";
|
|
7
7
|
import { F as y } from "./FilterBar-CQ7bD669.js";
|
|
8
8
|
function E({ options: c }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as y, jsx as t, Fragment as T } from "react/jsx-runtime";
|
|
2
2
|
import { useState as l, useCallback as C } from "react";
|
|
3
3
|
import { extractJobs as D, extractJobStats as F, JOB_STATUS_FILTERS as j, getJobStatusBadgeColor as B, formatDuration as A, resolveJobTimestamp as L } from "adonisjs-server-stats/core";
|
|
4
|
-
import { a as R, B as _, J as $ } from "./index-
|
|
4
|
+
import { a as R, B as _, J as $ } from "./index-LkZK--Bi.js";
|
|
5
5
|
import { J as M } from "./JobStatsBar-C7RslAFE.js";
|
|
6
6
|
import { T as O } from "./TimeAgoCell-o3KigGfM.js";
|
|
7
7
|
import { D as U } from "./DataTable-YyShr5B-.js";
|
|
@@ -3,7 +3,7 @@ import { useState as m, useMemo as C, useCallback as A } from "react";
|
|
|
3
3
|
import { extractJobs as B, extractJobStats as $, JOB_STATUS_FILTERS as D, getJobStatusCssClass as F, formatDuration as L, resolveJobTimestamp as R } from "adonisjs-server-stats/core";
|
|
4
4
|
import { T as P } from "./TimeAgoCell-o3KigGfM.js";
|
|
5
5
|
import { u as k } from "./useDashboardApiBase-Bi36pJ2L.js";
|
|
6
|
-
import { u as E, J as O } from "./index-
|
|
6
|
+
import { u as E, J as O } from "./index-LkZK--Bi.js";
|
|
7
7
|
import { u as q } from "./useResizableTable-CNJmACdt.js";
|
|
8
8
|
import { F as z } from "./FilterBar-CQ7bD669.js";
|
|
9
9
|
import { J as M } from "./JobStatsBar-C7RslAFE.js";
|
|
@@ -2,7 +2,7 @@ import { jsxs as i, jsx as s } from "react/jsx-runtime";
|
|
|
2
2
|
import g from "react";
|
|
3
3
|
import { T as v } from "./TimeAgoCell-o3KigGfM.js";
|
|
4
4
|
import { resolveLogLevel as u, resolveLogMessage as f, resolveLogTimestamp as h, resolveLogRequestId as L, getStructuredData as x, getLogLevelCssClass as N } from "adonisjs-server-stats/core";
|
|
5
|
-
import { J as y } from "./index-
|
|
5
|
+
import { J as y } from "./index-LkZK--Bi.js";
|
|
6
6
|
function $({ log: o, index: c, expanded: l, onToggleExpand: m, onReqIdClick: e }) {
|
|
7
7
|
const n = u(o), d = f(o), p = h(o), a = L(o), t = x(o);
|
|
8
8
|
return /* @__PURE__ */ i(g.Fragment, { children: [
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as a, useCallback as c } from "react";
|
|
3
3
|
import { LOG_LEVELS as B } from "adonisjs-server-stats/core";
|
|
4
|
-
import { a as G } from "./index-
|
|
4
|
+
import { a as G } from "./index-LkZK--Bi.js";
|
|
5
5
|
import { F as T } from "./FilterBar-CQ7bD669.js";
|
|
6
|
-
import { L as z } from "./LogEntryRow-
|
|
6
|
+
import { L as z } from "./LogEntryRow-CkS9LMbl.js";
|
|
7
7
|
import { P as H } from "./Pagination-BkmzUDY8.js";
|
|
8
8
|
function Z({ options: L = {} }) {
|
|
9
9
|
const [E, i] = a(1), [b, x] = a(""), [r, q] = a("all"), [n, h] = a(""), [u, p] = a(""), [m, y] = a([]), [v, R] = a("level"), [g, $] = a("equals"), [f, C] = a(""), [F, P] = a(null), o = {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import { useState as i, useMemo as v, useCallback as x } from "react";
|
|
3
3
|
import { filterLogsByLevel as C, resolveLogRequestId as N, resolveLogMessage as F, LOG_LEVELS as w } from "adonisjs-server-stats/core";
|
|
4
|
-
import { u as E } from "./index-
|
|
4
|
+
import { u as E } from "./index-LkZK--Bi.js";
|
|
5
5
|
import { F as I } from "./FilterBar-CQ7bD669.js";
|
|
6
|
-
import { L as k } from "./LogEntryRow-
|
|
6
|
+
import { L as k } from "./LogEntryRow-CkS9LMbl.js";
|
|
7
7
|
function M({ options: f }) {
|
|
8
8
|
const { data: t, isLoading: p, error: g } = E("logs", f), [d, L] = i("all"), [n, h] = i(""), [l, m] = i(""), [u, b] = i(null), c = v(() => {
|
|
9
9
|
let e = Array.isArray(t) ? t : t?.logs || t?.entries || [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as s, jsxs as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as T, useRef as P, useEffect as ss, useCallback as O } from "react";
|
|
3
3
|
import { resolveMetric as k, formatDuration as S, durationClassName as U, resolveEventName as es, resolveNormalizedSql as as } from "adonisjs-server-stats/core";
|
|
4
|
-
import { a as z, b as M } from "./index-
|
|
4
|
+
import { a as z, b as M } from "./index-LkZK--Bi.js";
|
|
5
5
|
import { T as ls } from "./TimeAgoCell-o3KigGfM.js";
|
|
6
6
|
const rs = [
|
|
7
7
|
{ value: "5m", label: "5m" },
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx as f, jsxs as T } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S, useRef as V, useCallback as i, useEffect as q, useMemo as b } from "react";
|
|
3
|
+
import { QueriesController as F, resolveField as l, computeDashboardQuerySummary as O } from "adonisjs-server-stats/core";
|
|
4
|
+
import { a as P } from "./index-LkZK--Bi.js";
|
|
5
|
+
import { Q as R } from "./QueriesContent-BDIx8zFn.js";
|
|
6
|
+
function K({ options: $ = {} }) {
|
|
7
|
+
const [y, d] = S(1), t = V(new F("list")), [x, D] = S(t.current.state), o = i(() => {
|
|
8
|
+
D({ ...t.current.state });
|
|
9
|
+
}, []), { viewMode: s, sort: C, search: E } = x, p = i(
|
|
10
|
+
(e) => {
|
|
11
|
+
e !== t.current.state.viewMode && (t.current.setViewMode(e), d(1), o());
|
|
12
|
+
},
|
|
13
|
+
[o]
|
|
14
|
+
), M = i(
|
|
15
|
+
(e) => {
|
|
16
|
+
t.current.setSearch(e), o();
|
|
17
|
+
},
|
|
18
|
+
[o]
|
|
19
|
+
);
|
|
20
|
+
q(() => d(1), [E]);
|
|
21
|
+
const Q = s === "grouped" ? "queries/grouped" : "queries", { data: g, meta: m, isLoading: _, getApi: v } = P(Q, {
|
|
22
|
+
...$,
|
|
23
|
+
page: y,
|
|
24
|
+
search: E,
|
|
25
|
+
sort: C.key,
|
|
26
|
+
sortDir: C.dir
|
|
27
|
+
}), N = i(
|
|
28
|
+
(e) => {
|
|
29
|
+
t.current.toggleSort(e), o();
|
|
30
|
+
},
|
|
31
|
+
[o]
|
|
32
|
+
), k = i(
|
|
33
|
+
(e) => {
|
|
34
|
+
t.current.toggleExpand(e), o();
|
|
35
|
+
},
|
|
36
|
+
[o]
|
|
37
|
+
), j = i(
|
|
38
|
+
async (e) => {
|
|
39
|
+
const r = t.current.getExplainState(e);
|
|
40
|
+
if (r && !r.loading) {
|
|
41
|
+
t.current.clearExplain(), o();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
t.current.startExplain(e), o();
|
|
45
|
+
try {
|
|
46
|
+
const n = await v().explainQuery(e);
|
|
47
|
+
if (n && n.error) {
|
|
48
|
+
const u = n.message ? `${n.error}: ${n.message}` : n.error;
|
|
49
|
+
t.current.failExplain(e, u);
|
|
50
|
+
} else
|
|
51
|
+
t.current.completeExplain(e, {
|
|
52
|
+
plan: n?.plan || void 0,
|
|
53
|
+
rows: n?.rows || void 0
|
|
54
|
+
});
|
|
55
|
+
} catch (n) {
|
|
56
|
+
console.warn("[ss] Query explain failed:", n);
|
|
57
|
+
let u = n instanceof Error ? n.message : String(n);
|
|
58
|
+
const w = n?.body;
|
|
59
|
+
if (w)
|
|
60
|
+
try {
|
|
61
|
+
const a = JSON.parse(w);
|
|
62
|
+
a.message ? u = a.error ? `${a.error}: ${a.message}` : a.message : a.error && (u = a.error);
|
|
63
|
+
} catch {
|
|
64
|
+
}
|
|
65
|
+
t.current.failExplain(e, u);
|
|
66
|
+
}
|
|
67
|
+
o();
|
|
68
|
+
},
|
|
69
|
+
[v, o]
|
|
70
|
+
), z = i(() => {
|
|
71
|
+
t.current.clearExplain(), o();
|
|
72
|
+
}, [o]), h = s === "grouped" ? g?.groups || [] : g || [], c = b(() => s !== "grouped" ? h : h.map((e) => {
|
|
73
|
+
const r = { ...e };
|
|
74
|
+
return r.sqlNormalized ??= l(e, "sql_normalized", "pattern") ?? void 0, r.count ??= l(e, "total_count"), r.avgDuration ??= l(e, "avg_duration"), r.maxDuration ??= l(e, "max_duration"), r.minDuration ??= l(e, "min_duration"), r.totalDuration ??= l(e, "total_duration"), r.percentOfTotal ??= l(e, "pct_time"), r;
|
|
75
|
+
}), [h, s]), L = b(() => {
|
|
76
|
+
if (s === "grouped")
|
|
77
|
+
return `${c.length} query patterns`;
|
|
78
|
+
const e = O(c, m ?? void 0), r = [`${e.totalCount} queries`];
|
|
79
|
+
return e.slowCount > 0 && r.push(`${e.slowCount} slow`), e.dupCount > 0 && r.push(`${e.dupCount} dup`), r.push(`avg ${(e.avgDuration || 0).toFixed(1)}ms`), r.join(", ");
|
|
80
|
+
}, [s, c, m]);
|
|
81
|
+
return /* @__PURE__ */ f(
|
|
82
|
+
R,
|
|
83
|
+
{
|
|
84
|
+
mode: "dashboard",
|
|
85
|
+
controllerState: x,
|
|
86
|
+
queries: c,
|
|
87
|
+
meta: m,
|
|
88
|
+
isLoading: _ && !g,
|
|
89
|
+
onSearchChange: M,
|
|
90
|
+
onSort: N,
|
|
91
|
+
onToggleExpand: k,
|
|
92
|
+
onViewModeChange: p,
|
|
93
|
+
onPageChange: d,
|
|
94
|
+
onExplain: j,
|
|
95
|
+
onCloseExplain: z,
|
|
96
|
+
summary: L,
|
|
97
|
+
filterBarChildren: /* @__PURE__ */ T("div", { className: "ss-dash-btn-group", children: [
|
|
98
|
+
/* @__PURE__ */ f(
|
|
99
|
+
"button",
|
|
100
|
+
{
|
|
101
|
+
type: "button",
|
|
102
|
+
className: `ss-dash-btn ${s === "list" ? "ss-dash-active" : ""}`,
|
|
103
|
+
onClick: () => p("list"),
|
|
104
|
+
children: "List"
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ f(
|
|
108
|
+
"button",
|
|
109
|
+
{
|
|
110
|
+
type: "button",
|
|
111
|
+
className: `ss-dash-btn ${s === "grouped" ? "ss-dash-active" : ""}`,
|
|
112
|
+
onClick: () => p("grouped"),
|
|
113
|
+
children: "Grouped"
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
] })
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
export {
|
|
121
|
+
K as QueriesSection,
|
|
122
|
+
K as default
|
|
123
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx as S, jsxs as w, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as M, useState as R, useCallback as o, useMemo as l } from "react";
|
|
3
|
+
import { QueriesController as q, filterQueries as z, countDuplicateQueries as A, computeQuerySummary as B, formatDuration as F } from "adonisjs-server-stats/core";
|
|
4
|
+
import { u as U } from "./index-LkZK--Bi.js";
|
|
5
|
+
import { Q as _ } from "./QueriesContent-BDIx8zFn.js";
|
|
6
|
+
function V({ options: m }) {
|
|
7
|
+
const { baseUrl: d = "", debugEndpoint: g = "/admin/api/debug", authToken: c } = m || {}, { data: u, isLoading: Q, error: h } = U("queries", m), e = M(new q("list")), [f, $] = R(e.current.state), n = o(() => {
|
|
8
|
+
$({ ...e.current.state });
|
|
9
|
+
}, []), { search: x } = f, b = o(
|
|
10
|
+
(r) => {
|
|
11
|
+
e.current.setSearch(r), n();
|
|
12
|
+
},
|
|
13
|
+
[n]
|
|
14
|
+
), y = o(
|
|
15
|
+
(r) => {
|
|
16
|
+
e.current.toggleExpand(r), n();
|
|
17
|
+
},
|
|
18
|
+
[n]
|
|
19
|
+
), v = o((r) => {
|
|
20
|
+
}, []), D = o(
|
|
21
|
+
async (r) => {
|
|
22
|
+
const C = e.current.getExplainState(r);
|
|
23
|
+
if (C && !C.loading) {
|
|
24
|
+
e.current.clearExplain(), n();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
e.current.startExplain(r), n();
|
|
28
|
+
try {
|
|
29
|
+
const s = {};
|
|
30
|
+
c && (s.Authorization = `Bearer ${c}`);
|
|
31
|
+
const k = `${d}${g}/queries/${r}/explain`, t = await (await fetch(k, { headers: s })).json();
|
|
32
|
+
if (t && t.error) {
|
|
33
|
+
const N = t.message ? `${t.error}: ${t.message}` : t.error;
|
|
34
|
+
e.current.failExplain(r, N);
|
|
35
|
+
} else
|
|
36
|
+
e.current.completeExplain(r, {
|
|
37
|
+
plan: t?.plan || void 0,
|
|
38
|
+
rows: t?.rows || void 0
|
|
39
|
+
});
|
|
40
|
+
} catch (s) {
|
|
41
|
+
console.warn("[ss] Query explain failed:", s), e.current.failExplain(
|
|
42
|
+
r,
|
|
43
|
+
s instanceof Error ? s.message : String(s)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
n();
|
|
47
|
+
},
|
|
48
|
+
[d, g, c, n]
|
|
49
|
+
), T = o(() => {
|
|
50
|
+
e.current.clearExplain(), n();
|
|
51
|
+
}, [n]), a = l(() => u?.queries || [], [u]), p = l(() => z(a, x), [a, x]), E = l(() => A(a), [a]), i = l(
|
|
52
|
+
() => B(a, E),
|
|
53
|
+
[a, E]
|
|
54
|
+
);
|
|
55
|
+
if (Q && !u)
|
|
56
|
+
return /* @__PURE__ */ S("div", { className: "ss-dash-empty", children: "Loading queries..." });
|
|
57
|
+
if (h)
|
|
58
|
+
return /* @__PURE__ */ w("div", { className: "ss-dash-empty", children: [
|
|
59
|
+
"Error: ",
|
|
60
|
+
h.message
|
|
61
|
+
] });
|
|
62
|
+
const j = /* @__PURE__ */ w(L, { children: [
|
|
63
|
+
p.length,
|
|
64
|
+
" queries",
|
|
65
|
+
i.slowCount > 0 && ` | ${i.slowCount} slow`,
|
|
66
|
+
i.dupCount > 0 && ` | ${i.dupCount} dup`,
|
|
67
|
+
p.length > 0 && ` | avg ${F(i.avgDuration)}`
|
|
68
|
+
] });
|
|
69
|
+
return /* @__PURE__ */ S(
|
|
70
|
+
_,
|
|
71
|
+
{
|
|
72
|
+
mode: "debug",
|
|
73
|
+
controllerState: f,
|
|
74
|
+
queries: p,
|
|
75
|
+
onSearchChange: b,
|
|
76
|
+
onSort: v,
|
|
77
|
+
onToggleExpand: y,
|
|
78
|
+
onExplain: D,
|
|
79
|
+
onCloseExplain: T,
|
|
80
|
+
summary: j
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
V as QueriesTab,
|
|
86
|
+
V as default
|
|
87
|
+
};
|
|
@@ -3,8 +3,8 @@ import { useMemo as $, useState as g, useEffect as E, useCallback as L } from "r
|
|
|
3
3
|
import { normalizeTraceFields as P, resolveStatusCode as j, resolveDuration as W, durationClassName as z, resolveSpanCount as G, resolveWarningCount as I, resolveTimestamp as U } from "adonisjs-server-stats/core";
|
|
4
4
|
import { T as Y } from "./TimeAgoCell-o3KigGfM.js";
|
|
5
5
|
import { u as K } from "./useApiClient-BVtNCmnL.js";
|
|
6
|
-
import { a as V, M as D, S as R } from "./index-
|
|
7
|
-
import { S as H, R as J } from "./SplitPaneWrapper-
|
|
6
|
+
import { a as V, M as D, S as R } from "./index-LkZK--Bi.js";
|
|
7
|
+
import { S as H, R as J } from "./SplitPaneWrapper-CIygm7YI.js";
|
|
8
8
|
import { D as Q } from "./DataTable-YyShr5B-.js";
|
|
9
9
|
import { F as X } from "./FilterBar-CQ7bD669.js";
|
|
10
10
|
import { P as Z } from "./Pagination-BkmzUDY8.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as m, jsx as r, Fragment as p } from "react/jsx-runtime";
|
|
2
2
|
import { useState as y } from "react";
|
|
3
|
-
import { a as u, M as f } from "./index-
|
|
3
|
+
import { a as u, M as f } from "./index-LkZK--Bi.js";
|
|
4
4
|
import { D as w } from "./DataTable-YyShr5B-.js";
|
|
5
5
|
import { F as b } from "./FilterBar-CQ7bD669.js";
|
|
6
6
|
function A({ options: n = {} }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { useState as g, useMemo as p } from "react";
|
|
3
|
-
import { u as b, M as f } from "./index-
|
|
3
|
+
import { u as b, M as f } from "./index-LkZK--Bi.js";
|
|
4
4
|
import { u as w } from "./useResizableTable-CNJmACdt.js";
|
|
5
5
|
import { F as N } from "./FilterBar-CQ7bD669.js";
|
|
6
6
|
function R({ options: o, currentPath: n }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as c, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { useState as d, useRef as o, useEffect as u } from "react";
|
|
3
|
-
import { L as p } from "./LogEntryRow-
|
|
3
|
+
import { L as p } from "./LogEntryRow-CkS9LMbl.js";
|
|
4
4
|
import { initSplitPane as f } from "adonisjs-server-stats/core";
|
|
5
5
|
function v({ logs: n, onReqIdClick: a }) {
|
|
6
6
|
const [t, s] = d(null);
|
|
@@ -2,11 +2,11 @@ import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as i, useMemo as q, useEffect as I, useCallback as O } from "react";
|
|
3
3
|
import { formatDuration as m, durationClassName as j } from "adonisjs-server-stats/core";
|
|
4
4
|
import { u as U } from "./useApiClient-BVtNCmnL.js";
|
|
5
|
-
import { u as W, M as D, S as L } from "./index-
|
|
5
|
+
import { u as W, M as D, S as L } from "./index-LkZK--Bi.js";
|
|
6
6
|
import { T as _ } from "./TimeAgoCell-o3KigGfM.js";
|
|
7
7
|
import { u as z } from "./useResizableTable-CNJmACdt.js";
|
|
8
8
|
import { F as G } from "./FilterBar-CQ7bD669.js";
|
|
9
|
-
import { S as K, R as V } from "./SplitPaneWrapper-
|
|
9
|
+
import { S as K, R as V } from "./SplitPaneWrapper-CIygm7YI.js";
|
|
10
10
|
const S = {
|
|
11
11
|
request: "#1e3a5f",
|
|
12
12
|
middleware: "rgba(30, 58, 95, 0.7)",
|
|
@@ -435,7 +435,7 @@ function A({
|
|
|
435
435
|
}
|
|
436
436
|
);
|
|
437
437
|
}
|
|
438
|
-
const ge = L(() => import("./QueriesTab-
|
|
438
|
+
const ge = L(() => import("./QueriesTab-CGMtuFFF.js")), me = L(() => import("./EventsTab-BUNTKy9p.js")), ve = L(() => import("./EmailsTab-zZ4ucCv5.js")), fe = L(() => import("./RoutesTab-BS4PNbRf.js")), we = L(() => import("./LogsTab-TChjBgV3.js")), ke = L(() => import("./TimelineTab-M3wrwrmF.js")), Ne = L(() => import("./CacheTab-B1wjTs64.js")), ye = L(() => import("./JobsTab-CGrcuRPt.js")), Ce = L(() => import("./ConfigTab-B4E7Pitz.js")), Se = L(() => import("./InternalsTab--RD-L1dX.js")), Le = L(() => import("./CustomPaneTab-iP7K6TLu.js"));
|
|
439
439
|
function Qe(s) {
|
|
440
440
|
const {
|
|
441
441
|
defaultOpen: o = !1,
|
|
@@ -724,7 +724,7 @@ const De = [
|
|
|
724
724
|
"jobs",
|
|
725
725
|
"config",
|
|
726
726
|
"internals"
|
|
727
|
-
], Re = L(() => import("./OverviewSection-
|
|
727
|
+
], Re = L(() => import("./OverviewSection-DhU9kO4C.js")), Oe = L(() => import("./RequestsSection-CrwlbkXj.js")), _e = L(() => import("./QueriesSection-Dz4Eird3.js")), je = L(() => import("./EventsSection-CbGz-b_I.js")), Pe = L(() => import("./RoutesSection-DNmTM3w6.js")), He = L(() => import("./LogsSection-BhS0Orbh.js")), qe = L(() => import("./EmailsSection-hUkyUnKo.js")), Ue = L(() => import("./CacheSection-ewL3Ss82.js")), Fe = L(() => import("./JobsSection-D10TwmEZ.js")), Ae = L(() => import("./ConfigSection-DAHu9mfy.js")), ze = L(() => import("./InternalsSection-BwrTfpjA.js"));
|
|
728
728
|
function Xe(s) {
|
|
729
729
|
const {
|
|
730
730
|
baseUrl: o = "",
|
package/dist/react/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as s, D as t, c as r, J as u, M as g, d as o, d, S as D, T as S, e as h, a as B, u as T, f as b, g as l, h as m } from "./index-
|
|
1
|
+
import { B as s, D as t, c as r, J as u, M as g, d as o, d, S as D, T as S, e as h, a as B, u as T, f as b, g as l, h as m } from "./index-LkZK--Bi.js";
|
|
2
2
|
export {
|
|
3
3
|
s as Badge,
|
|
4
4
|
t as DashboardPage,
|