adonisjs-server-stats 1.11.6 → 1.11.7
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 +13 -0
- package/dist/core/types-diagnostics.d.ts +2 -0
- package/dist/react/{CacheSection-BYN53kYO.js → CacheSection-DOUnyUrw.js} +1 -1
- package/dist/react/{CacheTab-DOhuK05d.js → CacheTab-D9o6bsPc.js} +1 -1
- package/dist/react/{ConfigSection-B9EHh4Rp.js → ConfigSection-DzNC7pOJ.js} +1 -1
- package/dist/react/{ConfigTab-C8kriE2b.js → ConfigTab-CT-Tu-ct.js} +1 -1
- package/dist/react/{CustomPaneTab-CvzQS_Wh.js → CustomPaneTab-CvIPe7NP.js} +1 -1
- package/dist/react/{EmailsSection-BJyFJf7A.js → EmailsSection-B1LT7Nx3.js} +1 -1
- package/dist/react/{EmailsTab-Ch8jp10B.js → EmailsTab-DKxK322z.js} +1 -1
- package/dist/react/{EventsSection-DJPwHeT8.js → EventsSection-D3AK0mhw.js} +1 -1
- package/dist/react/{EventsTab-B-FoehXC.js → EventsTab-BRRSW6RI.js} +1 -1
- package/dist/react/InternalsContent-BNOnSoi9.js +393 -0
- package/dist/react/{InternalsSection-B6VlVx5f.js → InternalsSection-BwrTfpjA.js} +1 -1
- package/dist/react/{InternalsTab-CkEKpRMU.js → InternalsTab--RD-L1dX.js} +1 -1
- package/dist/react/{JobsSection-DWF4i1t_.js → JobsSection-BMvj5886.js} +1 -1
- package/dist/react/{JobsTab-DqnifQXV.js → JobsTab-CQXWCrl8.js} +1 -1
- package/dist/react/{LogEntryRow-CMMkqA9M.js → LogEntryRow-DFI52ZEw.js} +1 -1
- package/dist/react/{LogsSection-C1xC5aP4.js → LogsSection-CW2hQ976.js} +2 -2
- package/dist/react/{LogsTab-CS4sLfLw.js → LogsTab-CV4Gf_yb.js} +2 -2
- package/dist/react/{OverviewSection-CxvfOR0v.js → OverviewSection-CxF9cabq.js} +1 -1
- package/dist/react/{QueriesSection-CrMdU5Ax.js → QueriesSection-CZJ-imAb.js} +117 -101
- package/dist/react/{QueriesTab-x85PjkyS.js → QueriesTab-CQHa1ck3.js} +23 -14
- package/dist/react/{RequestsSection-DETN9oZb.js → RequestsSection-Cb5YeqvI.js} +2 -2
- package/dist/react/{RoutesSection-CmorkJeC.js → RoutesSection-B43olD9v.js} +1 -1
- package/dist/react/{RoutesTab-CbzBOzpc.js → RoutesTab-RfhCUbkx.js} +1 -1
- package/dist/react/{SplitPaneWrapper-BiIgT4ND.js → SplitPaneWrapper-B05Mg6Sg.js} +1 -1
- package/dist/react/{TimelineTab-Ue9tUD_n.js → TimelineTab-Dx4686Ti.js} +2 -2
- package/dist/react/components/Dashboard/shared/DataTable.d.ts +1 -1
- package/dist/react/{index-DwDK-4oX.js → index-C4EMJrkH.js} +2 -2
- package/dist/react/index.js +1 -1
- package/dist/react/style.css +1 -1
- package/dist/src/collectors/db_pool_collector.js +17 -23
- 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/src/edge/client-vue/debug-panel-deferred.js +2 -2
- package/dist/src/provider/diagnostics.d.ts +3 -0
- package/dist/src/provider/diagnostics.js +1 -0
- package/dist/src/provider/server_stats_provider.d.ts +7 -0
- package/dist/src/provider/server_stats_provider.js +36 -0
- package/dist/src/styles/components.css +16 -0
- package/dist/src/styles/dashboard.css +20 -12
- package/dist/vue/{CacheSection-DT2Mwf_s.js → CacheSection-BAotiuQq.js} +1 -1
- package/dist/vue/{ConfigSection-BwKwS9lh.js → ConfigSection-JZjK5E5F.js} +1 -1
- package/dist/vue/{EmailsSection-B65g0FVS.js → EmailsSection-BLwyQO7B.js} +1 -1
- package/dist/vue/{EventsSection-CxqtVF-o.js → EventsSection-BUEwO-0A.js} +1 -1
- package/dist/vue/{InternalsSection-BJUXE-5F.js → InternalsSection-jhTCuK3j.js} +149 -130
- package/dist/vue/{InternalsTab-DEMjqtlw.js → InternalsTab-521fxYYj.js} +152 -133
- package/dist/vue/{JobsSection-rMIyMb-g.js → JobsSection-21A0yQMq.js} +1 -1
- package/dist/vue/{LogsSection-DmmZVJ7D.js → LogsSection-BmOx8SNa.js} +1 -1
- package/dist/vue/{OverviewSection-BMabyqw-.js → OverviewSection-BRDK3Ony.js} +1 -1
- package/dist/vue/QueriesSection-D2WGsuR4.js +444 -0
- package/dist/vue/QueriesTab-6D_xfi7Q.js +114 -0
- package/dist/vue/{RequestsSection-CTu4jPZ_.js → RequestsSection-DLrjCfcE.js} +1 -1
- package/dist/vue/{RoutesSection-zQZDedL7.js → RoutesSection-CPr9w42B.js} +1 -1
- package/dist/vue/{index-CM3yNVUR.js → index-CYaqRGIT.js} +2 -2
- package/dist/vue/index.js +1 -1
- package/dist/vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/react/InternalsContent-O8ino9oM.js +0 -370
- package/dist/vue/QueriesSection-BfDFwGqH.js +0 -428
- package/dist/vue/QueriesTab-DuTG7cpC.js +0 -106
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { resolveField as
|
|
4
|
-
import { a as ee } from "./index-
|
|
1
|
+
import { jsx as t, jsxs as r, Fragment as y } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g, useCallback as $, useEffect as X, useMemo as T } from "react";
|
|
3
|
+
import { resolveField as N, resolveNormalizedSql as A, durationClassName as R, resolveSqlMethod as z, resolveTimestamp as Y, SLOW_DURATION_MS as Z } from "adonisjs-server-stats/core";
|
|
4
|
+
import { a as ee } from "./index-C4EMJrkH.js";
|
|
5
5
|
import { D as U } from "./DataTable-YyShr5B-.js";
|
|
6
6
|
import { F as se } from "./FilterBar-CQ7bD669.js";
|
|
7
7
|
import { T as te } from "./TimeAgoCell-o3KigGfM.js";
|
|
8
|
-
import { P as
|
|
9
|
-
function W({ node:
|
|
10
|
-
if (!
|
|
11
|
-
const f = d * 20, u =
|
|
8
|
+
import { P as ne } from "./Pagination-BkmzUDY8.js";
|
|
9
|
+
function W({ node: n, depth: d = 0 }) {
|
|
10
|
+
if (!n) return null;
|
|
11
|
+
const f = d * 20, u = n["Node Type"] || "Unknown", S = n["Relation Name"] ? /* @__PURE__ */ r(y, { children: [
|
|
12
12
|
" on ",
|
|
13
|
-
/* @__PURE__ */ t("strong", { children:
|
|
14
|
-
] }) : null, c =
|
|
13
|
+
/* @__PURE__ */ t("strong", { children: n["Relation Name"] })
|
|
14
|
+
] }) : null, c = n.Alias && n.Alias !== n["Relation Name"] ? ` (${n.Alias})` : "", m = n["Index Name"] ? /* @__PURE__ */ r(y, { children: [
|
|
15
15
|
" using ",
|
|
16
|
-
/* @__PURE__ */ t("em", { children:
|
|
16
|
+
/* @__PURE__ */ t("em", { children: n["Index Name"] })
|
|
17
17
|
] }) : null, i = [];
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
i.push(`sort: ${
|
|
18
|
+
if (n["Startup Cost"] !== null && n["Startup Cost"] !== void 0 && i.push(`cost=${n["Startup Cost"]}..${n["Total Cost"]}`), n["Plan Rows"] !== null && n["Plan Rows"] !== void 0 && i.push(`rows=${n["Plan Rows"]}`), n["Plan Width"] !== null && n["Plan Width"] !== void 0 && i.push(`width=${n["Plan Width"]}`), n.Filter && i.push(`filter: ${n.Filter}`), n["Index Cond"] && i.push(`cond: ${n["Index Cond"]}`), n["Hash Cond"] && i.push(`hash: ${n["Hash Cond"]}`), n["Join Type"] && i.push(`join: ${n["Join Type"]}`), n["Sort Key"]) {
|
|
19
|
+
const l = Array.isArray(n["Sort Key"]) ? n["Sort Key"].join(", ") : n["Sort Key"];
|
|
20
|
+
i.push(`sort: ${l}`);
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
/* @__PURE__ */
|
|
22
|
+
const C = n.Plans || [];
|
|
23
|
+
return /* @__PURE__ */ r("div", { className: "ss-dash-explain-node", style: { marginLeft: `${f}px` }, children: [
|
|
24
|
+
/* @__PURE__ */ r("div", { className: "ss-dash-explain-node-header", children: [
|
|
25
25
|
/* @__PURE__ */ t("span", { className: "ss-dash-explain-node-type", children: u }),
|
|
26
|
-
|
|
26
|
+
S,
|
|
27
27
|
c,
|
|
28
28
|
m
|
|
29
29
|
] }),
|
|
30
30
|
i.length > 0 && /* @__PURE__ */ t("div", { className: "ss-dash-explain-metrics", children: i.join(" · ") }),
|
|
31
|
-
|
|
31
|
+
C.map((l, F) => /* @__PURE__ */ t(W, { node: l, depth: d + 1 }, F))
|
|
32
32
|
] });
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
if (!
|
|
34
|
+
function ae({ plan: n }) {
|
|
35
|
+
if (!n || !Array.isArray(n) || n.length === 0)
|
|
36
36
|
return /* @__PURE__ */ t("div", { className: "ss-dash-explain-result", children: "No plan data returned" });
|
|
37
|
-
const d =
|
|
37
|
+
const d = n[0];
|
|
38
38
|
if (d && d.Plan)
|
|
39
39
|
return /* @__PURE__ */ t("div", { className: "ss-dash-explain-result", children: /* @__PURE__ */ t(W, { node: d.Plan, depth: 0 }) });
|
|
40
40
|
if (typeof d == "object" && d !== null) {
|
|
41
41
|
const f = Object.keys(d);
|
|
42
|
-
return /* @__PURE__ */ t("div", { className: "ss-dash-explain-result", children: /* @__PURE__ */
|
|
42
|
+
return /* @__PURE__ */ t("div", { className: "ss-dash-explain-result", children: /* @__PURE__ */ r("table", { children: [
|
|
43
43
|
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: f.map((u) => /* @__PURE__ */ t("th", { children: u }, u)) }) }),
|
|
44
|
-
/* @__PURE__ */ t("tbody", { children:
|
|
44
|
+
/* @__PURE__ */ t("tbody", { children: n.map((u, S) => {
|
|
45
45
|
const c = u;
|
|
46
|
-
return /* @__PURE__ */ t("tr", { children: f.map((m) => /* @__PURE__ */ t("td", { children: c[m] !== null && c[m] !== void 0 ? String(c[m]) : "-" }, m)) },
|
|
46
|
+
return /* @__PURE__ */ t("tr", { children: f.map((m) => /* @__PURE__ */ t("td", { children: c[m] !== null && c[m] !== void 0 ? String(c[m]) : "-" }, m)) }, S);
|
|
47
47
|
}) })
|
|
48
48
|
] }) });
|
|
49
49
|
}
|
|
50
50
|
return /* @__PURE__ */ t("div", { className: "ss-dash-explain-result", children: "No plan data returned" });
|
|
51
51
|
}
|
|
52
52
|
const re = 8;
|
|
53
|
-
function me({ options:
|
|
54
|
-
const [d, f] =
|
|
53
|
+
function me({ options: n = {} }) {
|
|
54
|
+
const [d, f] = g(1), [u, S] = g(""), [c, m] = g("createdAt"), [i, C] = g("desc"), [l, F] = g("list"), [v, D] = g(null), [o, w] = g(null), [j, L] = g(null), I = $(
|
|
55
55
|
(e) => {
|
|
56
|
-
e !==
|
|
56
|
+
e !== l && (F(e), f(1), m(e === "list" ? "createdAt" : "count"), C("desc"), D(null), w(null), L(null));
|
|
57
57
|
},
|
|
58
|
-
[
|
|
58
|
+
[l]
|
|
59
59
|
);
|
|
60
60
|
X(() => f(1), [u]);
|
|
61
|
-
const H =
|
|
62
|
-
...
|
|
61
|
+
const H = l === "grouped" ? "queries/grouped" : "queries", { data: _, meta: k, isLoading: J, getApi: O } = ee(H, {
|
|
62
|
+
...n,
|
|
63
63
|
page: d,
|
|
64
64
|
search: u,
|
|
65
65
|
sort: c,
|
|
66
66
|
sortDir: i
|
|
67
67
|
}), K = $(
|
|
68
68
|
(e) => {
|
|
69
|
-
c === e ?
|
|
69
|
+
c === e ? C((s) => s === "asc" ? "desc" : "asc") : (m(e), C("desc"));
|
|
70
70
|
},
|
|
71
71
|
[c]
|
|
72
72
|
), V = $(
|
|
@@ -75,7 +75,7 @@ function me({ options: a = {} }) {
|
|
|
75
75
|
w(null);
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
L(e);
|
|
79
79
|
try {
|
|
80
80
|
const s = await O().explainQuery(e);
|
|
81
81
|
s && s.error ? w({
|
|
@@ -94,23 +94,23 @@ function me({ options: a = {} }) {
|
|
|
94
94
|
error: s instanceof Error ? s.message : String(s)
|
|
95
95
|
});
|
|
96
96
|
} finally {
|
|
97
|
-
|
|
97
|
+
L(null);
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
[O, o]
|
|
101
101
|
), B = $(
|
|
102
102
|
(e) => {
|
|
103
103
|
const s = e.id;
|
|
104
|
-
return !o || o.queryId !== s ? null : /* @__PURE__ */ t("tr", { className: "ss-dash-explain-row", children: /* @__PURE__ */ t("td", { colSpan: re, className: "ss-dash-explain", children: /* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: o.error ? /* @__PURE__ */
|
|
104
|
+
return !o || o.queryId !== s ? null : /* @__PURE__ */ t("tr", { className: "ss-dash-explain-row", children: /* @__PURE__ */ t("td", { colSpan: re, className: "ss-dash-explain", children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "start" }, children: [
|
|
105
|
+
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: o.error ? /* @__PURE__ */ r("div", { className: "ss-dash-explain-result ss-dash-explain-error", children: [
|
|
106
106
|
/* @__PURE__ */ t("strong", { children: "Error:" }),
|
|
107
107
|
" ",
|
|
108
108
|
o.error,
|
|
109
|
-
o.message && /* @__PURE__ */
|
|
109
|
+
o.message && /* @__PURE__ */ r(y, { children: [
|
|
110
110
|
/* @__PURE__ */ t("br", {}),
|
|
111
111
|
o.message
|
|
112
112
|
] })
|
|
113
|
-
] }) : /* @__PURE__ */ t(
|
|
113
|
+
] }) : /* @__PURE__ */ t(ae, { plan: o.plan }) }),
|
|
114
114
|
/* @__PURE__ */ t(
|
|
115
115
|
"button",
|
|
116
116
|
{
|
|
@@ -124,56 +124,56 @@ function me({ options: a = {} }) {
|
|
|
124
124
|
] }) }) });
|
|
125
125
|
},
|
|
126
126
|
[o]
|
|
127
|
-
),
|
|
127
|
+
), M = l === "grouped" ? _?.groups || [] : _ || [], h = T(() => l !== "grouped" ? M : M.map((e) => {
|
|
128
128
|
const s = { ...e };
|
|
129
|
-
return s.sqlNormalized ??=
|
|
130
|
-
}), [
|
|
131
|
-
const e = k?.total ??
|
|
132
|
-
let s = 0,
|
|
133
|
-
for (const
|
|
134
|
-
const P =
|
|
135
|
-
|
|
129
|
+
return s.sqlNormalized ??= N(e, "sql_normalized", "pattern") ?? void 0, s.count ??= N(e, "total_count"), s.avgDuration ??= N(e, "avg_duration"), s.maxDuration ??= N(e, "max_duration"), s.minDuration ??= N(e, "min_duration"), s.totalDuration ??= N(e, "total_duration"), s.percentOfTotal ??= N(e, "pct_time"), s;
|
|
130
|
+
}), [M, l]), b = T(() => {
|
|
131
|
+
const e = k?.total ?? h.length;
|
|
132
|
+
let s = 0, a = 0, p = 0, x = 0;
|
|
133
|
+
for (const q of h) {
|
|
134
|
+
const P = q.duration || 0;
|
|
135
|
+
p += P, x++, P > Z && s++;
|
|
136
136
|
}
|
|
137
|
-
const
|
|
138
|
-
for (const
|
|
139
|
-
const P = A(
|
|
140
|
-
|
|
137
|
+
const E = /* @__PURE__ */ new Map();
|
|
138
|
+
for (const q of h) {
|
|
139
|
+
const P = A(q);
|
|
140
|
+
E.set(P, (E.get(P) || 0) + 1);
|
|
141
141
|
}
|
|
142
|
-
for (const
|
|
143
|
-
|
|
142
|
+
for (const q of E.values())
|
|
143
|
+
q > 1 && (a += q);
|
|
144
144
|
return {
|
|
145
145
|
total: e,
|
|
146
146
|
slow: s,
|
|
147
|
-
duplicates:
|
|
148
|
-
avgDuration: x > 0 ?
|
|
147
|
+
duplicates: a,
|
|
148
|
+
avgDuration: x > 0 ? p / x : 0
|
|
149
149
|
};
|
|
150
|
-
}, [
|
|
150
|
+
}, [h, k]), Q = T(() => {
|
|
151
151
|
const e = /* @__PURE__ */ new Map();
|
|
152
|
-
for (const s of
|
|
153
|
-
const
|
|
154
|
-
e.set(
|
|
152
|
+
for (const s of h) {
|
|
153
|
+
const a = A(s);
|
|
154
|
+
e.set(a, (e.get(a) || 0) + 1);
|
|
155
155
|
}
|
|
156
156
|
return e;
|
|
157
|
-
}, [
|
|
158
|
-
if (
|
|
159
|
-
return `${
|
|
160
|
-
const e = [`${
|
|
161
|
-
return
|
|
162
|
-
}, [
|
|
163
|
-
return /* @__PURE__ */
|
|
157
|
+
}, [h]), G = T(() => {
|
|
158
|
+
if (l === "grouped")
|
|
159
|
+
return `${h.length} query patterns`;
|
|
160
|
+
const e = [`${b.total} queries`];
|
|
161
|
+
return b.slow > 0 && e.push(`${b.slow} slow`), b.duplicates > 0 && e.push(`${b.duplicates} dup`), e.push(`avg ${(b.avgDuration || 0).toFixed(1)}ms`), e.join(", ");
|
|
162
|
+
}, [l, h.length, b]);
|
|
163
|
+
return /* @__PURE__ */ r("div", { children: [
|
|
164
164
|
/* @__PURE__ */ t(
|
|
165
165
|
se,
|
|
166
166
|
{
|
|
167
167
|
search: u,
|
|
168
|
-
onSearchChange:
|
|
168
|
+
onSearchChange: S,
|
|
169
169
|
placeholder: "Filter queries...",
|
|
170
170
|
summary: G,
|
|
171
|
-
children: /* @__PURE__ */
|
|
171
|
+
children: /* @__PURE__ */ r("div", { className: "ss-dash-btn-group", children: [
|
|
172
172
|
/* @__PURE__ */ t(
|
|
173
173
|
"button",
|
|
174
174
|
{
|
|
175
175
|
type: "button",
|
|
176
|
-
className: `ss-dash-btn ${
|
|
176
|
+
className: `ss-dash-btn ${l === "list" ? "ss-dash-active" : ""}`,
|
|
177
177
|
onClick: () => I("list"),
|
|
178
178
|
children: "List"
|
|
179
179
|
}
|
|
@@ -182,7 +182,7 @@ function me({ options: a = {} }) {
|
|
|
182
182
|
"button",
|
|
183
183
|
{
|
|
184
184
|
type: "button",
|
|
185
|
-
className: `ss-dash-btn ${
|
|
185
|
+
className: `ss-dash-btn ${l === "grouped" ? "ss-dash-active" : ""}`,
|
|
186
186
|
onClick: () => I("grouped"),
|
|
187
187
|
children: "Grouped"
|
|
188
188
|
}
|
|
@@ -190,7 +190,7 @@ function me({ options: a = {} }) {
|
|
|
190
190
|
] })
|
|
191
191
|
}
|
|
192
192
|
),
|
|
193
|
-
J && !
|
|
193
|
+
J && !_ ? /* @__PURE__ */ t("div", { className: "ss-dash-empty", children: "Loading queries..." }) : l === "grouped" ? /* @__PURE__ */ t(y, { children: /* @__PURE__ */ t("div", { className: "ss-dash-table-wrap", children: /* @__PURE__ */ t(
|
|
194
194
|
U,
|
|
195
195
|
{
|
|
196
196
|
columns: [
|
|
@@ -198,23 +198,23 @@ function me({ options: a = {} }) {
|
|
|
198
198
|
key: "sqlNormalized",
|
|
199
199
|
label: "Pattern",
|
|
200
200
|
render: (e, s) => {
|
|
201
|
-
const
|
|
202
|
-
return /* @__PURE__ */
|
|
201
|
+
const a = e || "", p = (s.count || 0) >= 3;
|
|
202
|
+
return /* @__PURE__ */ r(y, { children: [
|
|
203
203
|
/* @__PURE__ */ t(
|
|
204
204
|
"span",
|
|
205
205
|
{
|
|
206
|
-
className: `ss-dash-sql ${
|
|
206
|
+
className: `ss-dash-sql ${v === a ? "ss-dash-expanded" : ""}`,
|
|
207
207
|
title: "Click to expand",
|
|
208
208
|
onClick: (x) => {
|
|
209
|
-
x.stopPropagation(), D(
|
|
209
|
+
x.stopPropagation(), D(v === a ? null : a);
|
|
210
210
|
},
|
|
211
211
|
role: "button",
|
|
212
212
|
tabIndex: 0,
|
|
213
|
-
onKeyDown: (x) => x.key === "Enter" && D(
|
|
214
|
-
children:
|
|
213
|
+
onKeyDown: (x) => x.key === "Enter" && D(v === a ? null : a),
|
|
214
|
+
children: a
|
|
215
215
|
}
|
|
216
216
|
),
|
|
217
|
-
|
|
217
|
+
p && /* @__PURE__ */ r(y, { children: [
|
|
218
218
|
" ",
|
|
219
219
|
/* @__PURE__ */ t("span", { className: "ss-dash-dup", children: "DUP" })
|
|
220
220
|
] })
|
|
@@ -291,14 +291,22 @@ function me({ options: a = {} }) {
|
|
|
291
291
|
)
|
|
292
292
|
}
|
|
293
293
|
],
|
|
294
|
-
data:
|
|
294
|
+
data: h,
|
|
295
295
|
keyField: "sqlNormalized",
|
|
296
296
|
sort: c,
|
|
297
297
|
sortDir: i,
|
|
298
298
|
onSort: K,
|
|
299
|
-
emptyMessage:
|
|
299
|
+
emptyMessage: /* @__PURE__ */ r(y, { children: [
|
|
300
|
+
"No queries recorded",
|
|
301
|
+
/* @__PURE__ */ r("span", { className: "ss-empty-hint", children: [
|
|
302
|
+
"Queries require ",
|
|
303
|
+
/* @__PURE__ */ t("code", { children: "debug: true" }),
|
|
304
|
+
" on your Lucid connections in ",
|
|
305
|
+
/* @__PURE__ */ t("code", { children: "config/database.ts" })
|
|
306
|
+
] })
|
|
307
|
+
] })
|
|
300
308
|
}
|
|
301
|
-
) }) }) : /* @__PURE__ */
|
|
309
|
+
) }) }) : /* @__PURE__ */ r(y, { children: [
|
|
302
310
|
/* @__PURE__ */ t("div", { className: "ss-dash-table-wrap", children: /* @__PURE__ */ t(
|
|
303
311
|
U,
|
|
304
312
|
{
|
|
@@ -313,29 +321,29 @@ function me({ options: a = {} }) {
|
|
|
313
321
|
key: "sql",
|
|
314
322
|
label: "SQL",
|
|
315
323
|
render: (e, s) => {
|
|
316
|
-
const
|
|
317
|
-
return /* @__PURE__ */
|
|
324
|
+
const a = s.sql || s.sql_text || "";
|
|
325
|
+
return /* @__PURE__ */ r("div", { children: [
|
|
318
326
|
/* @__PURE__ */ t(
|
|
319
327
|
"span",
|
|
320
328
|
{
|
|
321
|
-
className: `ss-dash-sql ${
|
|
329
|
+
className: `ss-dash-sql ${v === s.id ? "ss-dash-expanded" : ""}`,
|
|
322
330
|
title: "Click to expand",
|
|
323
|
-
onClick: (
|
|
324
|
-
|
|
325
|
-
|
|
331
|
+
onClick: (p) => {
|
|
332
|
+
p.stopPropagation(), D(
|
|
333
|
+
v === s.id ? null : s.id
|
|
326
334
|
);
|
|
327
335
|
},
|
|
328
336
|
role: "button",
|
|
329
337
|
tabIndex: 0,
|
|
330
|
-
onKeyDown: (
|
|
331
|
-
|
|
338
|
+
onKeyDown: (p) => p.key === "Enter" && D(
|
|
339
|
+
v === s.id ? null : s.id
|
|
332
340
|
),
|
|
333
|
-
children:
|
|
341
|
+
children: a
|
|
334
342
|
}
|
|
335
343
|
),
|
|
336
|
-
(
|
|
344
|
+
(Q.get(A(s)) ?? 0) > 1 && /* @__PURE__ */ r("span", { className: "ss-dash-dup", children: [
|
|
337
345
|
"×",
|
|
338
|
-
|
|
346
|
+
Q.get(A(s))
|
|
339
347
|
] })
|
|
340
348
|
] });
|
|
341
349
|
}
|
|
@@ -361,8 +369,8 @@ function me({ options: a = {} }) {
|
|
|
361
369
|
label: "Method",
|
|
362
370
|
width: "60px",
|
|
363
371
|
render: (e, s) => {
|
|
364
|
-
const
|
|
365
|
-
return /* @__PURE__ */ t("span", { className: `ss-dash-method ss-dash-method-${
|
|
372
|
+
const a = z(s);
|
|
373
|
+
return /* @__PURE__ */ t("span", { className: `ss-dash-method ss-dash-method-${a.toLowerCase()}`, children: a });
|
|
366
374
|
}
|
|
367
375
|
},
|
|
368
376
|
{
|
|
@@ -406,8 +414,8 @@ function me({ options: a = {} }) {
|
|
|
406
414
|
width: "90px",
|
|
407
415
|
sortable: !0,
|
|
408
416
|
render: (e, s) => {
|
|
409
|
-
const
|
|
410
|
-
return /* @__PURE__ */ t(te, { ts:
|
|
417
|
+
const a = e || (Y(s) ?? "");
|
|
418
|
+
return /* @__PURE__ */ t(te, { ts: a, className: "ss-dash-event-time" });
|
|
411
419
|
}
|
|
412
420
|
},
|
|
413
421
|
{
|
|
@@ -415,13 +423,13 @@ function me({ options: a = {} }) {
|
|
|
415
423
|
label: "",
|
|
416
424
|
width: "70px",
|
|
417
425
|
render: (e, s) => {
|
|
418
|
-
if (
|
|
419
|
-
const
|
|
426
|
+
if (z(s) !== "select") return null;
|
|
427
|
+
const p = o?.queryId === s.id && !o?.error;
|
|
420
428
|
return /* @__PURE__ */ t(
|
|
421
429
|
"button",
|
|
422
430
|
{
|
|
423
431
|
type: "button",
|
|
424
|
-
className: `ss-dash-explain-btn${
|
|
432
|
+
className: `ss-dash-explain-btn${p ? " ss-dash-explain-btn-active" : ""}`,
|
|
425
433
|
onClick: (x) => {
|
|
426
434
|
x.stopPropagation(), V(s.id);
|
|
427
435
|
},
|
|
@@ -432,16 +440,24 @@ function me({ options: a = {} }) {
|
|
|
432
440
|
}
|
|
433
441
|
}
|
|
434
442
|
],
|
|
435
|
-
data:
|
|
443
|
+
data: h,
|
|
436
444
|
sort: c,
|
|
437
445
|
sortDir: i,
|
|
438
446
|
onSort: K,
|
|
439
|
-
emptyMessage:
|
|
447
|
+
emptyMessage: /* @__PURE__ */ r(y, { children: [
|
|
448
|
+
"No queries recorded",
|
|
449
|
+
/* @__PURE__ */ r("span", { className: "ss-empty-hint", children: [
|
|
450
|
+
"Queries require ",
|
|
451
|
+
/* @__PURE__ */ t("code", { children: "debug: true" }),
|
|
452
|
+
" on your Lucid connections in ",
|
|
453
|
+
/* @__PURE__ */ t("code", { children: "config/database.ts" })
|
|
454
|
+
] })
|
|
455
|
+
] }),
|
|
440
456
|
renderAfterRow: B
|
|
441
457
|
}
|
|
442
458
|
) }),
|
|
443
459
|
k && /* @__PURE__ */ t(
|
|
444
|
-
|
|
460
|
+
ne,
|
|
445
461
|
{
|
|
446
462
|
page: k.page,
|
|
447
463
|
lastPage: k.lastPage,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t, Fragment as w } from "react/jsx-runtime";
|
|
2
|
-
import { useState as m, useMemo as
|
|
3
|
-
import { filterQueries as v, countDuplicateQueries as D, computeQuerySummary as
|
|
4
|
-
import { T
|
|
5
|
-
import { u as M, M as $ } from "./index-
|
|
2
|
+
import { useState as m, useMemo as l, useCallback as C } from "react";
|
|
3
|
+
import { filterQueries as v, countDuplicateQueries as D, computeQuerySummary as Q, formatDuration as p, durationClassName as S } from "adonisjs-server-stats/core";
|
|
4
|
+
import { T } from "./TimeAgoCell-o3KigGfM.js";
|
|
5
|
+
import { u as M, M as $ } from "./index-C4EMJrkH.js";
|
|
6
6
|
import { u as E } from "./useResizableTable-CNJmACdt.js";
|
|
7
7
|
import { F } from "./FilterBar-CQ7bD669.js";
|
|
8
8
|
function A({ options: g }) {
|
|
9
|
-
const { data: n, isLoading: b, error: u } = M("queries", g), [o,
|
|
10
|
-
() =>
|
|
9
|
+
const { data: n, isLoading: b, error: u } = M("queries", g), [o, y] = m(""), [f, x] = m(null), d = l(() => n?.queries || [], [n]), r = l(() => v(d, o), [d, o]), a = l(() => D(d), [d]), i = l(
|
|
10
|
+
() => Q(d, a),
|
|
11
11
|
[d, a]
|
|
12
12
|
), h = C((s) => {
|
|
13
13
|
x((c) => c === s ? null : s);
|
|
@@ -20,18 +20,27 @@ function A({ options: g }) {
|
|
|
20
20
|
F,
|
|
21
21
|
{
|
|
22
22
|
search: o,
|
|
23
|
-
onSearchChange:
|
|
23
|
+
onSearchChange: y,
|
|
24
24
|
placeholder: "Filter queries...",
|
|
25
25
|
summary: /* @__PURE__ */ t(w, { children: [
|
|
26
26
|
r.length,
|
|
27
27
|
" queries",
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
r.length > 0 && ` | avg ${p(
|
|
28
|
+
i.slowCount > 0 && ` | ${i.slowCount} slow`,
|
|
29
|
+
i.dupCount > 0 && ` | ${i.dupCount} dup`,
|
|
30
|
+
r.length > 0 && ` | avg ${p(i.avgDuration)}`
|
|
31
31
|
] })
|
|
32
32
|
}
|
|
33
33
|
),
|
|
34
|
-
r.length === 0 ? /* @__PURE__ */
|
|
34
|
+
r.length === 0 ? /* @__PURE__ */ t("div", { className: "ss-dbg-empty", children: [
|
|
35
|
+
/* @__PURE__ */ e("span", { children: "No queries captured" }),
|
|
36
|
+
/* @__PURE__ */ t("span", { className: "ss-empty-hint", children: [
|
|
37
|
+
"Queries require ",
|
|
38
|
+
/* @__PURE__ */ e("code", { children: "debug: true" }),
|
|
39
|
+
" on your Lucid connections in",
|
|
40
|
+
" ",
|
|
41
|
+
/* @__PURE__ */ e("code", { children: "config/database.ts" })
|
|
42
|
+
] })
|
|
43
|
+
] }) : /* @__PURE__ */ t("table", { ref: N, className: "ss-dbg-table", children: [
|
|
35
44
|
/* @__PURE__ */ t("colgroup", { children: [
|
|
36
45
|
/* @__PURE__ */ e("col", { style: { width: "50px" } }),
|
|
37
46
|
/* @__PURE__ */ e("col", {}),
|
|
@@ -54,7 +63,7 @@ function A({ options: g }) {
|
|
|
54
63
|
/* @__PURE__ */ e(
|
|
55
64
|
"span",
|
|
56
65
|
{
|
|
57
|
-
className: `ss-dbg-sql ${
|
|
66
|
+
className: `ss-dbg-sql ${f === s.id ? "ss-dbg-expanded" : ""}`,
|
|
58
67
|
onClick: () => h(s.id),
|
|
59
68
|
role: "button",
|
|
60
69
|
tabIndex: 0,
|
|
@@ -71,13 +80,13 @@ function A({ options: g }) {
|
|
|
71
80
|
/* @__PURE__ */ e(
|
|
72
81
|
"td",
|
|
73
82
|
{
|
|
74
|
-
className: `ss-dbg-duration ${
|
|
83
|
+
className: `ss-dbg-duration ${S(s.duration, "ss-dbg")}`,
|
|
75
84
|
children: p(s.duration)
|
|
76
85
|
}
|
|
77
86
|
),
|
|
78
87
|
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e($, { method: s.method, classPrefix: "ss-dbg" }) }),
|
|
79
88
|
/* @__PURE__ */ e("td", { className: "ss-dbg-c-muted", children: s.model || "-" }),
|
|
80
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
89
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(T, { ts: s.timestamp, className: "ss-dbg-event-time" }) })
|
|
81
90
|
] }, s.id)) })
|
|
82
91
|
] })
|
|
83
92
|
] });
|
|
@@ -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-C4EMJrkH.js";
|
|
7
|
+
import { S as H, R as J } from "./SplitPaneWrapper-B05Mg6Sg.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-C4EMJrkH.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-C4EMJrkH.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-DFI52ZEw.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-C4EMJrkH.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-B05Mg6Sg.js";
|
|
10
10
|
const S = {
|
|
11
11
|
request: "#1e3a5f",
|
|
12
12
|
middleware: "rgba(30, 58, 95, 0.7)",
|
|
@@ -15,7 +15,7 @@ interface DataTableProps<T> {
|
|
|
15
15
|
onSort?: (key: string) => void;
|
|
16
16
|
onRowClick?: (row: T) => void;
|
|
17
17
|
rowClassName?: string | ((row: T) => string);
|
|
18
|
-
emptyMessage?:
|
|
18
|
+
emptyMessage?: React.ReactNode;
|
|
19
19
|
className?: string;
|
|
20
20
|
renderAfterRow?: (row: T, index: number) => React.ReactNode;
|
|
21
21
|
}
|
|
@@ -435,7 +435,7 @@ function A({
|
|
|
435
435
|
}
|
|
436
436
|
);
|
|
437
437
|
}
|
|
438
|
-
const ge = L(() => import("./QueriesTab-
|
|
438
|
+
const ge = L(() => import("./QueriesTab-CQHa1ck3.js")), me = L(() => import("./EventsTab-BRRSW6RI.js")), ve = L(() => import("./EmailsTab-DKxK322z.js")), fe = L(() => import("./RoutesTab-RfhCUbkx.js")), we = L(() => import("./LogsTab-CV4Gf_yb.js")), ke = L(() => import("./TimelineTab-Dx4686Ti.js")), Ne = L(() => import("./CacheTab-D9o6bsPc.js")), ye = L(() => import("./JobsTab-CQXWCrl8.js")), Ce = L(() => import("./ConfigTab-CT-Tu-ct.js")), Se = L(() => import("./InternalsTab--RD-L1dX.js")), Le = L(() => import("./CustomPaneTab-CvIPe7NP.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-CxF9cabq.js")), Oe = L(() => import("./RequestsSection-Cb5YeqvI.js")), _e = L(() => import("./QueriesSection-CZJ-imAb.js")), je = L(() => import("./EventsSection-D3AK0mhw.js")), Pe = L(() => import("./RoutesSection-B43olD9v.js")), He = L(() => import("./LogsSection-CW2hQ976.js")), qe = L(() => import("./EmailsSection-B1LT7Nx3.js")), Ue = L(() => import("./CacheSection-DOUnyUrw.js")), Fe = L(() => import("./JobsSection-BMvj5886.js")), Ae = L(() => import("./ConfigSection-DzNC7pOJ.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-C4EMJrkH.js";
|
|
2
2
|
export {
|
|
3
3
|
s as Badge,
|
|
4
4
|
t as DashboardPage,
|