adonisjs-server-stats 1.11.6 → 1.12.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 +13 -0
- package/dist/core/explain-utils.d.ts +77 -0
- package/dist/core/index.d.ts +8 -2
- package/dist/core/index.js +1089 -877
- package/dist/core/queries-columns.d.ts +42 -0
- package/dist/core/queries-controller.d.ts +94 -0
- package/dist/core/query-utils.d.ts +49 -0
- package/dist/core/types-diagnostics.d.ts +2 -0
- package/dist/react/{CacheSection-BYN53kYO.js → CacheSection-DZFOiOYH.js} +1 -1
- package/dist/react/{CacheTab-DOhuK05d.js → CacheTab-D8js5o69.js} +1 -1
- package/dist/react/{ConfigSection-B9EHh4Rp.js → ConfigSection-DoJmvNkF.js} +1 -1
- package/dist/react/{ConfigTab-C8kriE2b.js → ConfigTab-CDvljuBF.js} +1 -1
- package/dist/react/{CustomPaneTab-CvzQS_Wh.js → CustomPaneTab-Db9eIQ-9.js} +1 -1
- package/dist/react/{EmailsSection-BJyFJf7A.js → EmailsSection-D7oxvAjA.js} +1 -1
- package/dist/react/{EmailsTab-Ch8jp10B.js → EmailsTab-BITuGTQm.js} +1 -1
- package/dist/react/{EventsSection-DJPwHeT8.js → EventsSection-7mDZv70I.js} +1 -1
- package/dist/react/{EventsTab-B-FoehXC.js → EventsTab-DF13BChE.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-B_VJFWy6.js} +1 -1
- package/dist/react/{JobsTab-DqnifQXV.js → JobsTab-DK8Fl9nz.js} +1 -1
- package/dist/react/{LogEntryRow-CMMkqA9M.js → LogEntryRow-Bdie9SFe.js} +1 -1
- package/dist/react/{LogsSection-C1xC5aP4.js → LogsSection-CrWqxWRr.js} +2 -2
- package/dist/react/{LogsTab-CS4sLfLw.js → LogsTab-DYSpL637.js} +2 -2
- package/dist/react/{OverviewSection-CxvfOR0v.js → OverviewSection-CuaccMZt.js} +1 -1
- package/dist/react/QueriesContent-BDIx8zFn.js +288 -0
- package/dist/react/QueriesSection-CvGGh5Ij.js +117 -0
- package/dist/react/QueriesTab-C7CCwhVc.js +87 -0
- package/dist/react/{RequestsSection-DETN9oZb.js → RequestsSection-mENyeNsk.js} +2 -2
- package/dist/react/{RoutesSection-CmorkJeC.js → RoutesSection-DjovlaNS.js} +1 -1
- package/dist/react/{RoutesTab-CbzBOzpc.js → RoutesTab-CbQECiUc.js} +1 -1
- package/dist/react/{SplitPaneWrapper-BiIgT4ND.js → SplitPaneWrapper-DyRyH5Re.js} +1 -1
- package/dist/react/{TimelineTab-Ue9tUD_n.js → TimelineTab-BKTFbsPe.js} +2 -2
- package/dist/react/components/Dashboard/shared/DataTable.d.ts +1 -1
- package/dist/react/components/shared/QueriesContent.d.ts +33 -0
- package/dist/react/{index-DwDK-4oX.js → index-CAUHa8QX.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/dashboard/query_explain_handler.d.ts +11 -0
- package/dist/src/dashboard/query_explain_handler.js +64 -11
- package/dist/src/debug/query_collector.d.ts +1 -0
- package/dist/src/debug/query_collector.js +3 -0
- package/dist/src/edge/client/dashboard.js +2 -2
- package/dist/src/edge/client/debug-panel-deferred.js +1 -1
- package/dist/src/edge/client-vue/dashboard.js +4 -4
- package/dist/src/edge/client-vue/debug-panel-deferred.js +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 +38 -0
- package/dist/src/routes/debug_routes.d.ts +4 -0
- package/dist/src/routes/debug_routes.js +45 -0
- package/dist/src/routes/register_routes.d.ts +4 -0
- package/dist/src/routes/register_routes.js +2 -0
- package/dist/src/styles/components.css +254 -0
- package/dist/src/styles/dashboard.css +26 -185
- package/dist/src/styles/debug-panel.css +2 -24
- package/dist/vue/{CacheSection-DT2Mwf_s.js → CacheSection-Bx41lpfK.js} +1 -1
- package/dist/vue/{ConfigSection-BwKwS9lh.js → ConfigSection-fkfUdCmx.js} +1 -1
- package/dist/vue/{EmailsSection-B65g0FVS.js → EmailsSection-CbcDKF9Q.js} +1 -1
- package/dist/vue/{EventsSection-CxqtVF-o.js → EventsSection-CWbTYOBi.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-CGGO6rtS.js} +1 -1
- package/dist/vue/{LogsSection-DmmZVJ7D.js → LogsSection-BPB-C-XA.js} +1 -1
- package/dist/vue/{OverviewSection-BMabyqw-.js → OverviewSection-BTcnPeoM.js} +1 -1
- package/dist/vue/QueriesSection-2SE3igQJ.js +411 -0
- package/dist/vue/QueriesTab-DO5XwJ--.js +112 -0
- package/dist/vue/{RequestsSection-CTu4jPZ_.js → RequestsSection-DXcG5Zok.js} +1 -1
- package/dist/vue/{RoutesSection-zQZDedL7.js → RoutesSection-BkNGWdoP.js} +1 -1
- package/dist/vue/components/Dashboard/sections/QueriesSection.vue.d.ts +1 -41
- package/dist/vue/{index-CM3yNVUR.js → index-CptF6Qbp.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/react/QueriesSection-CrMdU5Ax.js +0 -458
- package/dist/react/QueriesTab-x85PjkyS.js +0 -88
- package/dist/vue/QueriesSection-BfDFwGqH.js +0 -428
- package/dist/vue/QueriesTab-DuTG7cpC.js +0 -106
package/dist/core/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
class
|
|
1
|
+
class w extends Error {
|
|
2
2
|
status;
|
|
3
|
-
constructor(
|
|
4
|
-
super(`Unauthorized (HTTP ${
|
|
3
|
+
constructor(e = 403) {
|
|
4
|
+
super(`Unauthorized (HTTP ${e})`), this.name = "UnauthorizedError", this.status = e;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
class
|
|
7
|
+
class j extends Error {
|
|
8
8
|
status;
|
|
9
9
|
body;
|
|
10
|
-
constructor(
|
|
11
|
-
super(`API error (HTTP ${
|
|
10
|
+
constructor(e, r) {
|
|
11
|
+
super(`API error (HTTP ${e})`), this.name = "ApiError", this.status = e, this.body = r;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
class
|
|
14
|
+
class T {
|
|
15
15
|
baseUrl;
|
|
16
16
|
authToken;
|
|
17
|
-
constructor(
|
|
18
|
-
this.baseUrl =
|
|
17
|
+
constructor(e) {
|
|
18
|
+
this.baseUrl = e.baseUrl.replace(/\/+$/, ""), this.authToken = e.authToken;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Perform a JSON fetch against the configured base URL.
|
|
@@ -24,27 +24,27 @@ class C {
|
|
|
24
24
|
* @param init - Optional `RequestInit` overrides. Headers are merged.
|
|
25
25
|
* @returns Parsed JSON response body typed as `T`.
|
|
26
26
|
*/
|
|
27
|
-
async fetch(
|
|
28
|
-
const
|
|
27
|
+
async fetch(e, r) {
|
|
28
|
+
const o = {
|
|
29
29
|
...{
|
|
30
30
|
Accept: "application/json",
|
|
31
31
|
...this.authToken ? { Authorization: `Bearer ${this.authToken}` } : {}
|
|
32
32
|
},
|
|
33
33
|
...r?.headers
|
|
34
|
-
},
|
|
34
|
+
}, s = await globalThis.fetch(`${this.baseUrl}${e}`, {
|
|
35
35
|
...r,
|
|
36
|
-
headers:
|
|
36
|
+
headers: o,
|
|
37
37
|
credentials: this.authToken ? "omit" : "include"
|
|
38
38
|
});
|
|
39
39
|
if (r?.signal?.aborted)
|
|
40
40
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
41
|
-
if (
|
|
42
|
-
throw new
|
|
43
|
-
if (!
|
|
44
|
-
const i = await
|
|
45
|
-
throw new
|
|
41
|
+
if (s.status === 401 || s.status === 403)
|
|
42
|
+
throw new w(s.status);
|
|
43
|
+
if (!s.ok) {
|
|
44
|
+
const i = await s.text().catch(() => "");
|
|
45
|
+
throw new j(s.status, i);
|
|
46
46
|
}
|
|
47
|
-
return
|
|
47
|
+
return s.json();
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
50
|
* Perform a GET request.
|
|
@@ -53,8 +53,8 @@ class C {
|
|
|
53
53
|
* @param query - Optional query string (without leading `?`).
|
|
54
54
|
* @returns Parsed JSON response body typed as `T`.
|
|
55
55
|
*/
|
|
56
|
-
async get(
|
|
57
|
-
const n = r ? `${
|
|
56
|
+
async get(e, r) {
|
|
57
|
+
const n = r ? `${e}?${r}` : e;
|
|
58
58
|
return this.fetch(n);
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
@@ -64,7 +64,7 @@ class C {
|
|
|
64
64
|
* @param body - Optional request body (will be JSON-serialized).
|
|
65
65
|
* @returns Parsed JSON response body typed as `T`.
|
|
66
66
|
*/
|
|
67
|
-
async post(
|
|
67
|
+
async post(e, r) {
|
|
68
68
|
const n = {
|
|
69
69
|
method: "POST",
|
|
70
70
|
...r !== void 0 ? {
|
|
@@ -72,7 +72,7 @@ class C {
|
|
|
72
72
|
headers: { "Content-Type": "application/json" }
|
|
73
73
|
} : {}
|
|
74
74
|
};
|
|
75
|
-
return this.fetch(
|
|
75
|
+
return this.fetch(e, n);
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
78
78
|
* Perform a DELETE request.
|
|
@@ -80,74 +80,74 @@ class C {
|
|
|
80
80
|
* @param path - URL path appended to `baseUrl`.
|
|
81
81
|
* @returns Parsed JSON response body typed as `T`.
|
|
82
82
|
*/
|
|
83
|
-
async delete(
|
|
84
|
-
return this.fetch(
|
|
83
|
+
async delete(e) {
|
|
84
|
+
return this.fetch(e, { method: "DELETE" });
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const r =
|
|
89
|
-
if (!
|
|
87
|
+
function W(t, e) {
|
|
88
|
+
const r = t || (typeof window < "u" ? window.location.origin : "");
|
|
89
|
+
if (!e)
|
|
90
90
|
return { baseUrl: r };
|
|
91
|
-
const n = { headers: { Authorization: `Bearer ${
|
|
91
|
+
const n = { headers: { Authorization: `Bearer ${e}` } };
|
|
92
92
|
return {
|
|
93
93
|
baseUrl: r,
|
|
94
|
-
beforeSubscribe(
|
|
94
|
+
beforeSubscribe(o) {
|
|
95
95
|
return n;
|
|
96
96
|
},
|
|
97
|
-
beforeUnsubscribe(
|
|
97
|
+
beforeUnsubscribe(o) {
|
|
98
98
|
return n;
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
async function
|
|
102
|
+
async function V() {
|
|
103
103
|
if (typeof window < "u" && window.Transmit && typeof window.Transmit == "function")
|
|
104
104
|
return window.Transmit;
|
|
105
105
|
try {
|
|
106
|
-
const
|
|
107
|
-
return
|
|
106
|
+
const t = await import("@adonisjs/transmit-client");
|
|
107
|
+
return t.Transmit ?? t.default ?? null;
|
|
108
108
|
} catch {
|
|
109
109
|
return null;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
let
|
|
112
|
+
function G(t) {
|
|
113
|
+
let e = null, r = null, n = !1;
|
|
114
114
|
return { subscribe: async () => {
|
|
115
115
|
try {
|
|
116
|
-
const i = await
|
|
116
|
+
const i = await V();
|
|
117
117
|
if (!i)
|
|
118
118
|
throw new Error(
|
|
119
119
|
"Transmit client not available (neither window.Transmit nor @adonisjs/transmit-client)"
|
|
120
120
|
);
|
|
121
121
|
if (n) return;
|
|
122
|
-
|
|
123
|
-
n ||
|
|
122
|
+
e = new i(W(t.baseUrl, t.authToken)), r = e.subscription(t.channelName), r.onMessage((l) => {
|
|
123
|
+
n || t.onMessage(l);
|
|
124
124
|
}), await r.create();
|
|
125
125
|
} catch (i) {
|
|
126
|
-
|
|
126
|
+
t.onError?.(i);
|
|
127
127
|
}
|
|
128
128
|
}, unsubscribe: async () => {
|
|
129
129
|
n = !0;
|
|
130
130
|
try {
|
|
131
|
-
await r?.delete(), r = null,
|
|
131
|
+
await r?.delete(), r = null, e = null;
|
|
132
132
|
} catch {
|
|
133
133
|
}
|
|
134
134
|
} };
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
let
|
|
138
|
-
const r =
|
|
139
|
-
baseUrl:
|
|
140
|
-
channelName:
|
|
141
|
-
authToken:
|
|
142
|
-
onMessage:
|
|
136
|
+
function Q(t) {
|
|
137
|
+
let e = !1;
|
|
138
|
+
const r = G({
|
|
139
|
+
baseUrl: t.baseUrl,
|
|
140
|
+
channelName: t.channelName,
|
|
141
|
+
authToken: t.authToken,
|
|
142
|
+
onMessage: t.onMessage,
|
|
143
143
|
onError: (n) => {
|
|
144
|
-
|
|
144
|
+
e = !0, t.onError?.(n), t.onDisconnect?.();
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
return r.subscribe().then(() => {
|
|
148
|
-
|
|
148
|
+
e || t.onConnect?.();
|
|
149
149
|
}).catch((n) => {
|
|
150
|
-
|
|
150
|
+
t.onError?.(n), t.onDisconnect?.();
|
|
151
151
|
}), {
|
|
152
152
|
unsubscribe: () => {
|
|
153
153
|
r.unsubscribe().catch(() => {
|
|
@@ -155,38 +155,38 @@ function V(e) {
|
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
const
|
|
159
|
-
function
|
|
158
|
+
const C = "ss-dash-theme", P = "ss-theme-change";
|
|
159
|
+
function O() {
|
|
160
160
|
if (typeof window > "u") return "light";
|
|
161
|
-
const
|
|
162
|
-
return
|
|
161
|
+
const t = localStorage.getItem(C);
|
|
162
|
+
return t === "dark" || t === "light" ? t : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
typeof window > "u" || (localStorage.setItem(
|
|
164
|
+
function J(t) {
|
|
165
|
+
typeof window > "u" || (localStorage.setItem(C, t), window.dispatchEvent(new CustomEvent(P, { detail: t })));
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
const
|
|
169
|
-
return
|
|
167
|
+
function te() {
|
|
168
|
+
const e = O() === "dark" ? "light" : "dark";
|
|
169
|
+
return J(e), e;
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function ee(t) {
|
|
172
172
|
if (typeof window > "u") return () => {
|
|
173
173
|
};
|
|
174
|
-
const
|
|
175
|
-
const i =
|
|
176
|
-
(i === "dark" || i === "light") &&
|
|
177
|
-
}, r = (
|
|
178
|
-
if (
|
|
179
|
-
const i =
|
|
180
|
-
|
|
174
|
+
const e = (s) => {
|
|
175
|
+
const i = s.detail;
|
|
176
|
+
(i === "dark" || i === "light") && t(i);
|
|
177
|
+
}, r = (s) => {
|
|
178
|
+
if (s.key === C) {
|
|
179
|
+
const i = s.newValue;
|
|
180
|
+
t(i === "dark" || i === "light" ? i : O());
|
|
181
181
|
}
|
|
182
|
-
}, n = window.matchMedia("(prefers-color-scheme: dark)"),
|
|
183
|
-
localStorage.getItem(
|
|
182
|
+
}, n = window.matchMedia("(prefers-color-scheme: dark)"), o = (s) => {
|
|
183
|
+
localStorage.getItem(C) || t(s.matches ? "dark" : "light");
|
|
184
184
|
};
|
|
185
|
-
return window.addEventListener(P,
|
|
186
|
-
window.removeEventListener(P,
|
|
185
|
+
return window.addEventListener(P, e), window.addEventListener("storage", r), n.addEventListener("change", o), () => {
|
|
186
|
+
window.removeEventListener(P, e), window.removeEventListener("storage", r), n.removeEventListener("change", o);
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
-
const
|
|
189
|
+
const x = {
|
|
190
190
|
color: "#34d399",
|
|
191
191
|
fillOpacityTop: 0.25,
|
|
192
192
|
fillOpacityBottom: 0.02,
|
|
@@ -195,211 +195,211 @@ const S = {
|
|
|
195
195
|
height: 32,
|
|
196
196
|
padding: 2
|
|
197
197
|
};
|
|
198
|
-
function
|
|
199
|
-
return { ...
|
|
200
|
-
}
|
|
201
|
-
function
|
|
202
|
-
if (
|
|
203
|
-
const
|
|
204
|
-
return
|
|
205
|
-
const p = n + f / (
|
|
198
|
+
function Y(t) {
|
|
199
|
+
return { ...x, ...t };
|
|
200
|
+
}
|
|
201
|
+
function re(t, e = x.width, r = x.height, n = x.padding) {
|
|
202
|
+
if (t.length < 2) return null;
|
|
203
|
+
const o = e - n * 2, s = r - n * 2, i = Math.min(...t), a = Math.max(...t) - i || 1;
|
|
204
|
+
return t.map((m, f) => {
|
|
205
|
+
const p = n + f / (t.length - 1) * o, d = n + s - (m - i) / a * s;
|
|
206
206
|
return `${p.toFixed(1)},${d.toFixed(1)}`;
|
|
207
207
|
}).join(" ");
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
if (
|
|
211
|
-
const
|
|
212
|
-
const
|
|
213
|
-
return `${
|
|
214
|
-
}),
|
|
215
|
-
return `M${
|
|
216
|
-
}
|
|
217
|
-
let
|
|
218
|
-
function
|
|
219
|
-
return `ss-grad-${
|
|
220
|
-
}
|
|
221
|
-
function
|
|
222
|
-
if (
|
|
223
|
-
let
|
|
224
|
-
for (let
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
return { min:
|
|
229
|
-
}
|
|
230
|
-
function
|
|
231
|
-
if (
|
|
232
|
-
const r =
|
|
233
|
-
for (let
|
|
234
|
-
const y =
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
const
|
|
209
|
+
function ne(t, e = x.width, r = x.height, n = x.padding) {
|
|
210
|
+
if (t.length < 2) return null;
|
|
211
|
+
const o = e - n * 2, s = r - n * 2, i = Math.min(...t), a = Math.max(...t) - i || 1, c = t.map((d, g) => {
|
|
212
|
+
const h = n + g / (t.length - 1) * o, y = n + s - (d - i) / a * s;
|
|
213
|
+
return `${h.toFixed(1)},${y.toFixed(1)}`;
|
|
214
|
+
}), m = (n + o).toFixed(1), f = (n + s).toFixed(1), p = n.toFixed(1);
|
|
215
|
+
return `M${c[0]} ` + c.slice(1).map((d) => `L${d}`).join(" ") + ` L${m},${f} L${p},${f} Z`;
|
|
216
|
+
}
|
|
217
|
+
let X = 0;
|
|
218
|
+
function Z() {
|
|
219
|
+
return `ss-grad-${X++}`;
|
|
220
|
+
}
|
|
221
|
+
function tt(t) {
|
|
222
|
+
if (t.length === 0) return null;
|
|
223
|
+
let e = t[0], r = t[0], n = t[0];
|
|
224
|
+
for (let o = 1; o < t.length; o++) {
|
|
225
|
+
const s = t[o];
|
|
226
|
+
s < e && (e = s), s > r && (r = s), n += s;
|
|
227
|
+
}
|
|
228
|
+
return { min: e, max: r, avg: n / t.length };
|
|
229
|
+
}
|
|
230
|
+
function se(t, e) {
|
|
231
|
+
if (t.length < 2) return null;
|
|
232
|
+
const r = Y(e), n = tt(t), o = n.max - n.min || 1, s = r.width - r.padding * 2, i = r.height - r.padding * 2, l = r.padding, a = t.length, c = Array.from({ length: a });
|
|
233
|
+
for (let h = 0; h < a; h++) {
|
|
234
|
+
const y = l + h / (a - 1) * s, S = l + i - (t[h] - n.min) / o * i;
|
|
235
|
+
c[h] = `${y.toFixed(1)},${S.toFixed(1)}`;
|
|
236
|
+
}
|
|
237
|
+
const m = c.join(" "), f = (l + s).toFixed(1), p = (l + i).toFixed(1), d = l.toFixed(1), g = `M${c[0]} ` + c.slice(1).map((h) => `L${h}`).join(" ") + ` L${f},${p} L${d},${p} Z`;
|
|
238
238
|
return {
|
|
239
|
-
points:
|
|
240
|
-
areaPath:
|
|
241
|
-
gradientId:
|
|
239
|
+
points: m,
|
|
240
|
+
areaPath: g,
|
|
241
|
+
gradientId: Z(),
|
|
242
242
|
options: r,
|
|
243
243
|
stats: n
|
|
244
244
|
};
|
|
245
245
|
}
|
|
246
|
-
const
|
|
247
|
-
function
|
|
248
|
-
return '"' + (
|
|
246
|
+
const et = 5e3, rt = 1e4, nt = 3e3, N = 100, st = 500, ot = 60, it = 1e4;
|
|
247
|
+
function at(t) {
|
|
248
|
+
return '"' + (t.length > 40 ? t.slice(0, 40) + "..." : t) + '"';
|
|
249
249
|
}
|
|
250
|
-
function
|
|
251
|
-
if (
|
|
252
|
-
const n =
|
|
253
|
-
return
|
|
250
|
+
function lt(t, e, r) {
|
|
251
|
+
if (t.length === 0) return "[]";
|
|
252
|
+
const n = t.slice(0, 3).map((i) => r(i, 30)), o = t.length > 3 ? ", ..." + t.length + " items" : "", s = "[" + n.join(", ") + o + "]";
|
|
253
|
+
return s.length > e ? "[" + t.length + " items]" : s;
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
const n = Object.keys(
|
|
255
|
+
function ct(t, e, r) {
|
|
256
|
+
const n = Object.keys(t);
|
|
257
257
|
if (n.length === 0) return "{}";
|
|
258
|
-
const
|
|
259
|
-
for (let
|
|
260
|
-
|
|
261
|
-
const
|
|
262
|
-
return i.length <=
|
|
258
|
+
const o = [];
|
|
259
|
+
for (let a = 0; a < Math.min(n.length, 4); a++)
|
|
260
|
+
o.push(n[a] + ": " + r(t[n[a]], 30));
|
|
261
|
+
const s = n.length > 4 ? ", ...+" + (n.length - 4) : "", i = "{ " + o.join(", ") + s + " }";
|
|
262
|
+
return i.length <= e ? i : "{ " + (n.slice(0, 6).join(", ") + (n.length > 6 ? ", ..." : "")) + " }";
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
if (!
|
|
266
|
-
const
|
|
267
|
-
return r > 0 ? `${r}d ${n}h` : n > 0 ? `${n}h ${
|
|
264
|
+
function ut(t) {
|
|
265
|
+
if (!t && t !== 0) return "-";
|
|
266
|
+
const e = Math.floor(t), r = Math.floor(e / 86400), n = Math.floor(e % 86400 / 3600), o = Math.floor(e % 3600 / 60);
|
|
267
|
+
return r > 0 ? `${r}d ${n}h` : n > 0 ? `${n}h ${o}m` : o > 0 ? `${o}m ${e % 60}s` : `${e}s`;
|
|
268
268
|
}
|
|
269
|
-
function A(
|
|
270
|
-
const
|
|
271
|
-
return
|
|
269
|
+
function A(t) {
|
|
270
|
+
const e = t / 1048576;
|
|
271
|
+
return e >= 1024 ? `${(e / 1024).toFixed(1)}G` : `${e.toFixed(0)}M`;
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
return
|
|
273
|
+
function D(t) {
|
|
274
|
+
return t >= 1024 ? `${(t / 1024).toFixed(1)}G` : `${t.toFixed(1)}M`;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
277
|
-
return
|
|
276
|
+
function ht(t) {
|
|
277
|
+
return t >= 1e6 ? `${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${(t / 1e3).toFixed(1)}K` : `${t}`;
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
return
|
|
279
|
+
function oe(t) {
|
|
280
|
+
return t >= 1e3 ? `${(t / 1e3).toFixed(2)}s` : t >= 1 ? `${t.toFixed(0)}ms` : `${t.toFixed(2)}ms`;
|
|
281
281
|
}
|
|
282
|
-
function H(
|
|
283
|
-
return /([+-]\d{2}:?\d{2}|Z)\s*$/.test(
|
|
282
|
+
function H(t) {
|
|
283
|
+
return /([+-]\d{2}:?\d{2}|Z)\s*$/.test(t) ? t : t + "Z";
|
|
284
284
|
}
|
|
285
|
-
function
|
|
286
|
-
if (!
|
|
287
|
-
const
|
|
288
|
-
return Number.isNaN(
|
|
285
|
+
function ie(t) {
|
|
286
|
+
if (!t) return "-";
|
|
287
|
+
const e = typeof t == "string" ? new Date(H(t)) : new Date(t);
|
|
288
|
+
return Number.isNaN(e.getTime()) ? "-" : e.toLocaleTimeString("en-US", {
|
|
289
289
|
hour12: !1,
|
|
290
290
|
hour: "2-digit",
|
|
291
291
|
minute: "2-digit",
|
|
292
292
|
second: "2-digit"
|
|
293
|
-
}) + "." + String(
|
|
293
|
+
}) + "." + String(e.getMilliseconds()).padStart(3, "0");
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
if (!
|
|
297
|
-
const
|
|
295
|
+
function ae(t) {
|
|
296
|
+
if (!t) return "-";
|
|
297
|
+
const e = typeof t == "string" ? new Date(H(t)).getTime() : t, r = Math.floor((Date.now() - e) / 1e3);
|
|
298
298
|
return r < 0 ? "just now" : r < 60 ? `${r}s ago` : r < 3600 ? `${Math.floor(r / 60)}m ago` : r < 86400 ? `${Math.floor(r / 3600)}h ago` : `${Math.floor(r / 86400)}d ago`;
|
|
299
299
|
}
|
|
300
|
-
function
|
|
301
|
-
switch (
|
|
300
|
+
function le(t, e) {
|
|
301
|
+
switch (e) {
|
|
302
302
|
case "%":
|
|
303
|
-
return `${
|
|
303
|
+
return `${t.toFixed(1)}%`;
|
|
304
304
|
case "ms":
|
|
305
|
-
return `${
|
|
305
|
+
return `${t.toFixed(0)}ms`;
|
|
306
306
|
case "MB":
|
|
307
|
-
return `${
|
|
307
|
+
return `${t.toFixed(1)}M`;
|
|
308
308
|
case "bytes":
|
|
309
|
-
return A(
|
|
309
|
+
return A(t);
|
|
310
310
|
case "/s":
|
|
311
311
|
case "/m":
|
|
312
|
-
return
|
|
312
|
+
return t.toFixed(1);
|
|
313
313
|
default:
|
|
314
|
-
return
|
|
314
|
+
return t.toFixed(1);
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
return
|
|
317
|
+
function v(t, e, r) {
|
|
318
|
+
return t > r ? "red" : t > e ? "amber" : "green";
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
return
|
|
320
|
+
function dt(t, e, r) {
|
|
321
|
+
return t < r ? "red" : t < e ? "amber" : "green";
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
if (
|
|
325
|
-
const r =
|
|
323
|
+
function F(t, e) {
|
|
324
|
+
if (e === 0) return "green";
|
|
325
|
+
const r = t / e;
|
|
326
326
|
return r > 0.8 ? "red" : r > 0.5 ? "amber" : "green";
|
|
327
327
|
}
|
|
328
|
-
const
|
|
328
|
+
const ft = {
|
|
329
329
|
green: "ss-green",
|
|
330
330
|
amber: "ss-amber",
|
|
331
331
|
red: "ss-red"
|
|
332
|
-
},
|
|
332
|
+
}, ce = {
|
|
333
333
|
green: "#34d399",
|
|
334
334
|
amber: "#fbbf24",
|
|
335
335
|
red: "#f87171"
|
|
336
|
-
},
|
|
336
|
+
}, ue = {
|
|
337
337
|
green: "--ss-accent",
|
|
338
338
|
amber: "--ss-amber-fg",
|
|
339
339
|
red: "--ss-red-fg"
|
|
340
340
|
};
|
|
341
|
-
function
|
|
342
|
-
return
|
|
341
|
+
function he(t) {
|
|
342
|
+
return t >= 500 ? "red" : t >= 400 ? "amber" : "green";
|
|
343
343
|
}
|
|
344
|
-
function
|
|
345
|
-
return
|
|
344
|
+
function pt(t) {
|
|
345
|
+
return t > st ? "very-slow" : t > N ? "slow" : "normal";
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
const r =
|
|
349
|
-
return r === "very-slow" ? `${
|
|
347
|
+
function de(t, e = "ss-dash") {
|
|
348
|
+
const r = pt(t);
|
|
349
|
+
return r === "very-slow" ? `${e}-very-slow` : r === "slow" ? `${e}-slow` : "";
|
|
350
350
|
}
|
|
351
|
-
function
|
|
352
|
-
return
|
|
351
|
+
function fe(t) {
|
|
352
|
+
return t ? t.length <= 8 ? t : t.slice(0, 8) + "…" : "--";
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
return
|
|
354
|
+
function U(t, e = 100) {
|
|
355
|
+
return t === null ? "null" : t === void 0 ? "-" : typeof t == "string" ? at(t) : typeof t == "number" || typeof t == "boolean" ? String(t) : Array.isArray(t) ? lt(t, e, U) : typeof t == "object" ? ct(t, e, U) : String(t);
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
return
|
|
357
|
+
function pe(t) {
|
|
358
|
+
return t < 0 ? "no expiry" : t < 60 ? `${t}s` : t < 3600 ? `${Math.floor(t / 60)}m` : t < 86400 ? `${Math.floor(t / 3600)}h` : `${Math.floor(t / 86400)}d`;
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
return
|
|
360
|
+
function me(t) {
|
|
361
|
+
return t < 1024 ? `${t}B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)}KB` : `${(t / (1024 * 1024)).toFixed(1)}MB`;
|
|
362
362
|
}
|
|
363
|
-
const
|
|
364
|
-
function
|
|
363
|
+
const q = 50;
|
|
364
|
+
function ge(t, e, r) {
|
|
365
365
|
const n = new URLSearchParams();
|
|
366
|
-
if (n.set("page", String(
|
|
367
|
-
|
|
368
|
-
for (const [
|
|
369
|
-
|
|
366
|
+
if (n.set("page", String(t.page)), n.set("perPage", String(t.perPage)), e) {
|
|
367
|
+
e.search && n.set("search", e.search);
|
|
368
|
+
for (const [o, s] of Object.entries(e.filters))
|
|
369
|
+
s && n.set(o, s);
|
|
370
370
|
}
|
|
371
371
|
return r && (n.set("sort", r.field), n.set("direction", r.direction)), n.toString();
|
|
372
372
|
}
|
|
373
|
-
function
|
|
374
|
-
const r =
|
|
373
|
+
function ye(t, e = q) {
|
|
374
|
+
const r = t.data ?? t.items ?? [], n = t.total ?? 0, o = t.page ?? 1, s = t.perPage ?? t.limit ?? e, i = t.totalPages ?? (Math.ceil(n / s) || 1);
|
|
375
375
|
return {
|
|
376
376
|
data: r,
|
|
377
377
|
pagination: {
|
|
378
|
-
page:
|
|
379
|
-
perPage:
|
|
378
|
+
page: o,
|
|
379
|
+
perPage: s,
|
|
380
380
|
total: n,
|
|
381
381
|
totalPages: i
|
|
382
382
|
}
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function be(t = q) {
|
|
386
386
|
return {
|
|
387
387
|
page: 1,
|
|
388
|
-
perPage:
|
|
388
|
+
perPage: t,
|
|
389
389
|
total: 0,
|
|
390
390
|
totalPages: 1
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function xe() {
|
|
394
394
|
return {
|
|
395
395
|
search: "",
|
|
396
396
|
filters: {}
|
|
397
397
|
};
|
|
398
398
|
}
|
|
399
|
-
function
|
|
400
|
-
return { field:
|
|
399
|
+
function Se(t = "id", e = "desc") {
|
|
400
|
+
return { field: t, direction: e };
|
|
401
401
|
}
|
|
402
|
-
const
|
|
402
|
+
const mt = [
|
|
403
403
|
{ key: "page", param: "page", isNumeric: !0 },
|
|
404
404
|
{ key: "perPage", param: "perPage", isNumeric: !0 },
|
|
405
405
|
{ key: "search", param: "search" },
|
|
@@ -407,39 +407,39 @@ const pe = [
|
|
|
407
407
|
{ key: "sortDir", param: "direction" },
|
|
408
408
|
{ key: "timeRange", param: "range" }
|
|
409
409
|
];
|
|
410
|
-
function
|
|
411
|
-
const
|
|
412
|
-
for (const { key: n, param:
|
|
410
|
+
function gt(t) {
|
|
411
|
+
const e = new URLSearchParams(), r = t;
|
|
412
|
+
for (const { key: n, param: o, isNumeric: s } of mt) {
|
|
413
413
|
const i = r[n];
|
|
414
|
-
(
|
|
414
|
+
(s ? i != null : i) && e.set(o, String(i));
|
|
415
415
|
}
|
|
416
|
-
if (
|
|
417
|
-
for (const [n,
|
|
418
|
-
|
|
419
|
-
return
|
|
416
|
+
if (t.filters)
|
|
417
|
+
for (const [n, o] of Object.entries(t.filters))
|
|
418
|
+
o && e.set(n, o);
|
|
419
|
+
return e.toString();
|
|
420
420
|
}
|
|
421
|
-
function
|
|
422
|
-
const
|
|
421
|
+
function we(t) {
|
|
422
|
+
const e = Math.max(1, Math.ceil(t.total / t.perPage)), r = Math.min(t.page, e), n = t.total === 0 ? 0 : (r - 1) * t.perPage + 1, o = Math.min(r * t.perPage, t.total);
|
|
423
423
|
return {
|
|
424
424
|
page: r,
|
|
425
|
-
perPage:
|
|
426
|
-
total:
|
|
427
|
-
lastPage:
|
|
425
|
+
perPage: t.perPage,
|
|
426
|
+
total: t.total,
|
|
427
|
+
lastPage: e,
|
|
428
428
|
from: n,
|
|
429
|
-
to:
|
|
429
|
+
to: o,
|
|
430
430
|
hasPrev: r > 1,
|
|
431
|
-
hasNext: r <
|
|
431
|
+
hasNext: r < e
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
|
-
function
|
|
435
|
-
if (
|
|
436
|
-
const n = [],
|
|
437
|
-
n.push(1),
|
|
438
|
-
for (let i =
|
|
434
|
+
function ve(t, e, r = 2) {
|
|
435
|
+
if (e <= 1) return [1];
|
|
436
|
+
const n = [], o = Math.max(2, t - r), s = Math.min(e - 1, t + r);
|
|
437
|
+
n.push(1), o > 2 && n.push("...");
|
|
438
|
+
for (let i = o; i <= s; i++)
|
|
439
439
|
n.push(i);
|
|
440
|
-
return
|
|
440
|
+
return s < e - 1 && n.push("..."), e > 1 && n.push(e), n;
|
|
441
441
|
}
|
|
442
|
-
const
|
|
442
|
+
const yt = [
|
|
443
443
|
"tracing",
|
|
444
444
|
"process",
|
|
445
445
|
"system",
|
|
@@ -452,7 +452,7 @@ const me = [
|
|
|
452
452
|
"log",
|
|
453
453
|
"emails",
|
|
454
454
|
"dashboard"
|
|
455
|
-
],
|
|
455
|
+
], bt = [
|
|
456
456
|
{ flag: "process", group: "process" },
|
|
457
457
|
{ flag: "process", group: "memory" },
|
|
458
458
|
{ flag: "system", group: "memory" },
|
|
@@ -462,7 +462,7 @@ const me = [
|
|
|
462
462
|
{ flag: "queues", group: "queue" },
|
|
463
463
|
{ flag: "app", group: "app" },
|
|
464
464
|
{ flag: "log", group: "log" }
|
|
465
|
-
],
|
|
465
|
+
], xt = [
|
|
466
466
|
{ group: "process", fields: ["cpuPercent", "uptime", "nodeVersion"] },
|
|
467
467
|
{
|
|
468
468
|
group: "memory",
|
|
@@ -477,10 +477,10 @@ const me = [
|
|
|
477
477
|
{ group: "app", fields: ["onlineUsers", "pendingWebhooks", "pendingEmails"] },
|
|
478
478
|
{ group: "log", fields: ["logErrorsLast5m", "logEntriesPerMinute"] }
|
|
479
479
|
];
|
|
480
|
-
function
|
|
481
|
-
return typeof
|
|
480
|
+
function k(t) {
|
|
481
|
+
return typeof t == "number" && !Number.isNaN(t);
|
|
482
482
|
}
|
|
483
|
-
const
|
|
483
|
+
const B = "/admin/api/debug", St = {
|
|
484
484
|
tracing: !1,
|
|
485
485
|
process: !1,
|
|
486
486
|
system: !1,
|
|
@@ -495,43 +495,43 @@ const N = "/admin/api/debug", Se = {
|
|
|
495
495
|
dashboard: !1,
|
|
496
496
|
customPanes: []
|
|
497
497
|
};
|
|
498
|
-
function
|
|
499
|
-
const
|
|
500
|
-
for (const n of
|
|
501
|
-
|
|
502
|
-
return
|
|
498
|
+
function wt(t) {
|
|
499
|
+
const e = { customPanes: t.customPanes ?? [] }, r = t.features;
|
|
500
|
+
for (const n of yt)
|
|
501
|
+
e[n] = r?.[n] ?? !1;
|
|
502
|
+
return e;
|
|
503
503
|
}
|
|
504
|
-
async function
|
|
505
|
-
const r = `${
|
|
506
|
-
return
|
|
504
|
+
async function vt(t, e = B) {
|
|
505
|
+
const r = `${e.replace(/\/+$/, "")}/config`;
|
|
506
|
+
return t.fetch(r);
|
|
507
507
|
}
|
|
508
|
-
async function
|
|
509
|
-
const { baseUrl:
|
|
508
|
+
async function Ce(t) {
|
|
509
|
+
const { baseUrl: e = "", debugEndpoint: r = B, authToken: n } = t, o = new T({ baseUrl: e, authToken: n });
|
|
510
510
|
try {
|
|
511
|
-
const
|
|
512
|
-
return
|
|
511
|
+
const s = await vt(o, r);
|
|
512
|
+
return wt(s);
|
|
513
513
|
} catch {
|
|
514
|
-
return
|
|
514
|
+
return St;
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
const
|
|
519
|
-
for (const { flag:
|
|
520
|
-
n[
|
|
521
|
-
return
|
|
517
|
+
function Ee(t) {
|
|
518
|
+
const e = /* @__PURE__ */ new Set(), n = "features" in t && typeof t.features == "object" && t.features !== null ? t.features : t;
|
|
519
|
+
for (const { flag: o, group: s } of bt)
|
|
520
|
+
n[o] && e.add(s);
|
|
521
|
+
return e;
|
|
522
522
|
}
|
|
523
|
-
function
|
|
524
|
-
const
|
|
525
|
-
(
|
|
526
|
-
for (const r of
|
|
527
|
-
r.fields.some((n) =>
|
|
528
|
-
return
|
|
523
|
+
function Te(t) {
|
|
524
|
+
const e = /* @__PURE__ */ new Set();
|
|
525
|
+
(k(t.cpuPercent) || k(t.uptime) || Ct(t)) && e.add("process");
|
|
526
|
+
for (const r of xt)
|
|
527
|
+
r.fields.some((n) => k(t[n])) && e.add(r.group);
|
|
528
|
+
return t.redisOk !== void 0 && t.redisOk !== null && e.add("redis"), e;
|
|
529
529
|
}
|
|
530
|
-
function
|
|
531
|
-
return typeof
|
|
530
|
+
function Ct(t) {
|
|
531
|
+
return typeof t.nodeVersion == "string" && t.nodeVersion.length > 0;
|
|
532
532
|
}
|
|
533
|
-
function b(
|
|
534
|
-
return
|
|
533
|
+
function b(t) {
|
|
534
|
+
return ft[t] || "";
|
|
535
535
|
}
|
|
536
536
|
const $ = [
|
|
537
537
|
// ── Process group ─────────────────────────────────────────────────────────
|
|
@@ -542,8 +542,8 @@ const $ = [
|
|
|
542
542
|
title: "Node.js Runtime",
|
|
543
543
|
unit: "",
|
|
544
544
|
group: "process",
|
|
545
|
-
extract: (
|
|
546
|
-
format: (
|
|
545
|
+
extract: (t) => 0,
|
|
546
|
+
format: (t) => t.nodeVersion,
|
|
547
547
|
color: () => ""
|
|
548
548
|
},
|
|
549
549
|
// -- Uptime ---------------------------------------------------------------
|
|
@@ -553,8 +553,8 @@ const $ = [
|
|
|
553
553
|
title: "Process Uptime",
|
|
554
554
|
unit: "",
|
|
555
555
|
group: "process",
|
|
556
|
-
extract: (
|
|
557
|
-
format: (
|
|
556
|
+
extract: (t) => t.uptime,
|
|
557
|
+
format: (t) => ut(t.uptime),
|
|
558
558
|
color: () => ""
|
|
559
559
|
},
|
|
560
560
|
// -- CPU ------------------------------------------------------------------
|
|
@@ -566,9 +566,9 @@ const $ = [
|
|
|
566
566
|
group: "process",
|
|
567
567
|
warnThreshold: 50,
|
|
568
568
|
critThreshold: 80,
|
|
569
|
-
extract: (
|
|
570
|
-
format: (
|
|
571
|
-
color: (
|
|
569
|
+
extract: (t) => t.cpuPercent,
|
|
570
|
+
format: (t) => `${t.cpuPercent.toFixed(1)}%`,
|
|
571
|
+
color: (t) => b(v(t.cpuPercent, 50, 80)),
|
|
572
572
|
historyKey: "cpuPercent"
|
|
573
573
|
},
|
|
574
574
|
// -- Event loop -----------------------------------------------------------
|
|
@@ -580,9 +580,9 @@ const $ = [
|
|
|
580
580
|
group: "process",
|
|
581
581
|
warnThreshold: 20,
|
|
582
582
|
critThreshold: 50,
|
|
583
|
-
extract: (
|
|
584
|
-
format: (
|
|
585
|
-
color: (
|
|
583
|
+
extract: (t) => t.eventLoopLag,
|
|
584
|
+
format: (t) => `${t.eventLoopLag.toFixed(1)}ms`,
|
|
585
|
+
color: (t) => b(v(t.eventLoopLag, 20, 50)),
|
|
586
586
|
historyKey: "eventLoopLag"
|
|
587
587
|
},
|
|
588
588
|
// ── Memory group ──────────────────────────────────────────────────────────
|
|
@@ -593,8 +593,8 @@ const $ = [
|
|
|
593
593
|
title: "V8 Heap Usage",
|
|
594
594
|
unit: "bytes",
|
|
595
595
|
group: "memory",
|
|
596
|
-
extract: (
|
|
597
|
-
format: (
|
|
596
|
+
extract: (t) => t.memHeapUsed,
|
|
597
|
+
format: (t) => A(t.memHeapUsed),
|
|
598
598
|
color: () => "",
|
|
599
599
|
historyKey: "memHeapUsed"
|
|
600
600
|
},
|
|
@@ -605,8 +605,8 @@ const $ = [
|
|
|
605
605
|
title: "Resident Set Size",
|
|
606
606
|
unit: "bytes",
|
|
607
607
|
group: "memory",
|
|
608
|
-
extract: (
|
|
609
|
-
format: (
|
|
608
|
+
extract: (t) => t.memRss,
|
|
609
|
+
format: (t) => A(t.memRss),
|
|
610
610
|
color: () => "",
|
|
611
611
|
historyKey: "memRss"
|
|
612
612
|
},
|
|
@@ -617,16 +617,16 @@ const $ = [
|
|
|
617
617
|
title: "System Memory",
|
|
618
618
|
unit: "MB",
|
|
619
619
|
group: "memory",
|
|
620
|
-
extract: (
|
|
621
|
-
format: (
|
|
622
|
-
color: (
|
|
623
|
-
const
|
|
624
|
-
if (
|
|
625
|
-
const r =
|
|
626
|
-
return b(
|
|
620
|
+
extract: (t) => t.systemMemoryTotalMb - t.systemMemoryFreeMb,
|
|
621
|
+
format: (t) => `${D(t.systemMemoryTotalMb - t.systemMemoryFreeMb)}/${D(t.systemMemoryTotalMb)}`,
|
|
622
|
+
color: (t) => {
|
|
623
|
+
const e = t.systemMemoryTotalMb;
|
|
624
|
+
if (e === 0) return "";
|
|
625
|
+
const r = e - t.systemMemoryFreeMb;
|
|
626
|
+
return b(F(r, e));
|
|
627
627
|
},
|
|
628
628
|
historyKey: "_sysMemUsed",
|
|
629
|
-
show: (
|
|
629
|
+
show: (t) => t.systemMemoryTotalMb !== null && t.systemMemoryTotalMb !== void 0
|
|
630
630
|
},
|
|
631
631
|
// ── HTTP group ────────────────────────────────────────────────────────────
|
|
632
632
|
// -- Requests per second --------------------------------------------------
|
|
@@ -636,8 +636,8 @@ const $ = [
|
|
|
636
636
|
title: "Requests per Second",
|
|
637
637
|
unit: "/s",
|
|
638
638
|
group: "http",
|
|
639
|
-
extract: (
|
|
640
|
-
format: (
|
|
639
|
+
extract: (t) => t.requestsPerSecond,
|
|
640
|
+
format: (t) => t.requestsPerSecond.toFixed(1),
|
|
641
641
|
color: () => "",
|
|
642
642
|
historyKey: "requestsPerSecond"
|
|
643
643
|
},
|
|
@@ -650,9 +650,9 @@ const $ = [
|
|
|
650
650
|
group: "http",
|
|
651
651
|
warnThreshold: 200,
|
|
652
652
|
critThreshold: 500,
|
|
653
|
-
extract: (
|
|
654
|
-
format: (
|
|
655
|
-
color: (
|
|
653
|
+
extract: (t) => t.avgResponseTimeMs,
|
|
654
|
+
format: (t) => `${t.avgResponseTimeMs.toFixed(0)}ms`,
|
|
655
|
+
color: (t) => b(v(t.avgResponseTimeMs, 200, 500)),
|
|
656
656
|
historyKey: "avgResponseTimeMs"
|
|
657
657
|
},
|
|
658
658
|
// -- Error rate -----------------------------------------------------------
|
|
@@ -664,9 +664,9 @@ const $ = [
|
|
|
664
664
|
group: "http",
|
|
665
665
|
warnThreshold: 1,
|
|
666
666
|
critThreshold: 5,
|
|
667
|
-
extract: (
|
|
668
|
-
format: (
|
|
669
|
-
color: (
|
|
667
|
+
extract: (t) => t.errorRate,
|
|
668
|
+
format: (t) => `${t.errorRate.toFixed(1)}%`,
|
|
669
|
+
color: (t) => b(v(t.errorRate, 1, 5)),
|
|
670
670
|
historyKey: "errorRate"
|
|
671
671
|
},
|
|
672
672
|
// -- Active connections ---------------------------------------------------
|
|
@@ -676,8 +676,8 @@ const $ = [
|
|
|
676
676
|
title: "Active Connections",
|
|
677
677
|
unit: "",
|
|
678
678
|
group: "http",
|
|
679
|
-
extract: (
|
|
680
|
-
format: (
|
|
679
|
+
extract: (t) => t.activeHttpConnections,
|
|
680
|
+
format: (t) => `${t.activeHttpConnections}`,
|
|
681
681
|
color: () => "",
|
|
682
682
|
historyKey: "activeHttpConnections"
|
|
683
683
|
},
|
|
@@ -689,9 +689,9 @@ const $ = [
|
|
|
689
689
|
title: "Database Pool",
|
|
690
690
|
unit: "",
|
|
691
691
|
group: "db",
|
|
692
|
-
extract: (
|
|
693
|
-
format: (
|
|
694
|
-
color: (
|
|
692
|
+
extract: (t) => t.dbPoolUsed,
|
|
693
|
+
format: (t) => `${t.dbPoolUsed}/${t.dbPoolFree}/${t.dbPoolMax}`,
|
|
694
|
+
color: (t) => b(F(t.dbPoolUsed, t.dbPoolMax)),
|
|
695
695
|
historyKey: "dbPoolUsed"
|
|
696
696
|
},
|
|
697
697
|
// ── Redis group ───────────────────────────────────────────────────────────
|
|
@@ -702,9 +702,9 @@ const $ = [
|
|
|
702
702
|
title: "Redis Status",
|
|
703
703
|
unit: "",
|
|
704
704
|
group: "redis",
|
|
705
|
-
extract: (
|
|
706
|
-
format: (
|
|
707
|
-
color: (
|
|
705
|
+
extract: (t) => t.redisOk ? 1 : 0,
|
|
706
|
+
format: (t) => t.redisOk ? "✓" : "✗",
|
|
707
|
+
color: (t) => t.redisOk ? "ss-green" : "ss-red"
|
|
708
708
|
},
|
|
709
709
|
// -- Redis memory ---------------------------------------------------------
|
|
710
710
|
{
|
|
@@ -713,11 +713,11 @@ const $ = [
|
|
|
713
713
|
title: "Redis Memory",
|
|
714
714
|
unit: "MB",
|
|
715
715
|
group: "redis",
|
|
716
|
-
extract: (
|
|
717
|
-
format: (
|
|
716
|
+
extract: (t) => t.redisMemoryUsedMb,
|
|
717
|
+
format: (t) => `${t.redisMemoryUsedMb.toFixed(1)}M`,
|
|
718
718
|
color: () => "",
|
|
719
719
|
historyKey: "redisMemoryUsedMb",
|
|
720
|
-
show: (
|
|
720
|
+
show: (t) => t.redisOk
|
|
721
721
|
},
|
|
722
722
|
// -- Redis keys -----------------------------------------------------------
|
|
723
723
|
{
|
|
@@ -726,11 +726,11 @@ const $ = [
|
|
|
726
726
|
title: "Redis Keys",
|
|
727
727
|
unit: "",
|
|
728
728
|
group: "redis",
|
|
729
|
-
extract: (
|
|
730
|
-
format: (
|
|
729
|
+
extract: (t) => t.redisKeysCount,
|
|
730
|
+
format: (t) => ht(t.redisKeysCount),
|
|
731
731
|
color: () => "",
|
|
732
732
|
historyKey: "redisKeysCount",
|
|
733
|
-
show: (
|
|
733
|
+
show: (t) => t.redisOk
|
|
734
734
|
},
|
|
735
735
|
// -- Redis hit rate -------------------------------------------------------
|
|
736
736
|
{
|
|
@@ -742,11 +742,11 @@ const $ = [
|
|
|
742
742
|
warnThreshold: 90,
|
|
743
743
|
critThreshold: 70,
|
|
744
744
|
inverseThreshold: !0,
|
|
745
|
-
extract: (
|
|
746
|
-
format: (
|
|
747
|
-
color: (
|
|
745
|
+
extract: (t) => t.redisHitRate,
|
|
746
|
+
format: (t) => `${t.redisHitRate.toFixed(0)}%`,
|
|
747
|
+
color: (t) => b(dt(t.redisHitRate, 90, 70)),
|
|
748
748
|
historyKey: "redisHitRate",
|
|
749
|
-
show: (
|
|
749
|
+
show: (t) => t.redisOk
|
|
750
750
|
},
|
|
751
751
|
// ── Queue group ───────────────────────────────────────────────────────────
|
|
752
752
|
// -- Queue ----------------------------------------------------------------
|
|
@@ -756,9 +756,9 @@ const $ = [
|
|
|
756
756
|
title: "Job Queue",
|
|
757
757
|
unit: "",
|
|
758
758
|
group: "queue",
|
|
759
|
-
extract: (
|
|
760
|
-
format: (
|
|
761
|
-
color: (
|
|
759
|
+
extract: (t) => t.queueActive,
|
|
760
|
+
format: (t) => `${t.queueActive}/${t.queueWaiting}/${t.queueDelayed}`,
|
|
761
|
+
color: (t) => t.queueFailed > 0 ? "ss-amber" : "ss-green",
|
|
762
762
|
historyKey: "queueActive"
|
|
763
763
|
},
|
|
764
764
|
// -- Queue workers --------------------------------------------------------
|
|
@@ -768,8 +768,8 @@ const $ = [
|
|
|
768
768
|
title: "Queue Workers",
|
|
769
769
|
unit: "",
|
|
770
770
|
group: "queue",
|
|
771
|
-
extract: (
|
|
772
|
-
format: (
|
|
771
|
+
extract: (t) => t.queueWorkerCount,
|
|
772
|
+
format: (t) => `${t.queueWorkerCount}`,
|
|
773
773
|
color: () => ""
|
|
774
774
|
},
|
|
775
775
|
// ── App group ─────────────────────────────────────────────────────────────
|
|
@@ -780,8 +780,8 @@ const $ = [
|
|
|
780
780
|
title: "Online Users",
|
|
781
781
|
unit: "",
|
|
782
782
|
group: "app",
|
|
783
|
-
extract: (
|
|
784
|
-
format: (
|
|
783
|
+
extract: (t) => t.onlineUsers,
|
|
784
|
+
format: (t) => `${t.onlineUsers}`,
|
|
785
785
|
color: () => "",
|
|
786
786
|
historyKey: "onlineUsers"
|
|
787
787
|
},
|
|
@@ -792,9 +792,9 @@ const $ = [
|
|
|
792
792
|
title: "Pending Webhooks",
|
|
793
793
|
unit: "",
|
|
794
794
|
group: "app",
|
|
795
|
-
extract: (
|
|
796
|
-
format: (
|
|
797
|
-
color: (
|
|
795
|
+
extract: (t) => t.pendingWebhooks,
|
|
796
|
+
format: (t) => `${t.pendingWebhooks}`,
|
|
797
|
+
color: (t) => t.pendingWebhooks > 0 ? "ss-amber" : "",
|
|
798
798
|
historyKey: "pendingWebhooks"
|
|
799
799
|
},
|
|
800
800
|
// -- Pending emails -------------------------------------------------------
|
|
@@ -804,9 +804,9 @@ const $ = [
|
|
|
804
804
|
title: "Pending Emails",
|
|
805
805
|
unit: "",
|
|
806
806
|
group: "app",
|
|
807
|
-
extract: (
|
|
808
|
-
format: (
|
|
809
|
-
color: (
|
|
807
|
+
extract: (t) => t.pendingEmails,
|
|
808
|
+
format: (t) => `${t.pendingEmails}`,
|
|
809
|
+
color: (t) => t.pendingEmails > 0 ? "ss-amber" : "",
|
|
810
810
|
historyKey: "pendingEmails"
|
|
811
811
|
},
|
|
812
812
|
// ── Logs group ────────────────────────────────────────────────────────────
|
|
@@ -817,9 +817,9 @@ const $ = [
|
|
|
817
817
|
title: "Log Errors (5m)",
|
|
818
818
|
unit: "",
|
|
819
819
|
group: "log",
|
|
820
|
-
extract: (
|
|
821
|
-
format: (
|
|
822
|
-
color: (
|
|
820
|
+
extract: (t) => t.logErrorsLast5m,
|
|
821
|
+
format: (t) => `${t.logErrorsLast5m}`,
|
|
822
|
+
color: (t) => t.logErrorsLast5m > 0 ? "ss-red" : t.logWarningsLast5m > 0 ? "ss-amber" : "",
|
|
823
823
|
historyKey: "logErrorsLast5m"
|
|
824
824
|
},
|
|
825
825
|
// -- Log rate -------------------------------------------------------------
|
|
@@ -829,24 +829,24 @@ const $ = [
|
|
|
829
829
|
title: "Log Entries / Minute",
|
|
830
830
|
unit: "/m",
|
|
831
831
|
group: "log",
|
|
832
|
-
extract: (
|
|
833
|
-
format: (
|
|
832
|
+
extract: (t) => t.logEntriesPerMinute,
|
|
833
|
+
format: (t) => `${t.logEntriesPerMinute}`,
|
|
834
834
|
color: () => "",
|
|
835
835
|
historyKey: "logEntriesPerMinute"
|
|
836
836
|
}
|
|
837
837
|
];
|
|
838
|
-
function
|
|
839
|
-
return $.find((
|
|
838
|
+
function ke(t) {
|
|
839
|
+
return $.find((e) => e.id === t);
|
|
840
840
|
}
|
|
841
|
-
function
|
|
842
|
-
const
|
|
843
|
-
for (const
|
|
844
|
-
const r =
|
|
845
|
-
|
|
841
|
+
function Me() {
|
|
842
|
+
const t = /* @__PURE__ */ new Map();
|
|
843
|
+
for (const e of $) {
|
|
844
|
+
const r = e.group || "core";
|
|
845
|
+
t.has(r) || t.set(r, []), t.get(r).push(e);
|
|
846
846
|
}
|
|
847
|
-
return
|
|
847
|
+
return t;
|
|
848
848
|
}
|
|
849
|
-
const
|
|
849
|
+
const Et = {
|
|
850
850
|
queries: "/queries",
|
|
851
851
|
events: "/events",
|
|
852
852
|
emails: "/emails",
|
|
@@ -858,10 +858,10 @@ const Ee = {
|
|
|
858
858
|
config: "/config",
|
|
859
859
|
internals: "/diagnostics"
|
|
860
860
|
};
|
|
861
|
-
function
|
|
862
|
-
return
|
|
861
|
+
function Tt(t) {
|
|
862
|
+
return Et[t] || `/${t}`;
|
|
863
863
|
}
|
|
864
|
-
const
|
|
864
|
+
const kt = {
|
|
865
865
|
overview: "/overview",
|
|
866
866
|
requests: "/requests",
|
|
867
867
|
queries: "/queries",
|
|
@@ -874,45 +874,45 @@ const Ce = {
|
|
|
874
874
|
jobs: "/jobs",
|
|
875
875
|
config: "/config"
|
|
876
876
|
};
|
|
877
|
-
function
|
|
878
|
-
return
|
|
877
|
+
function Mt(t) {
|
|
878
|
+
return kt[t] || `/${t}`;
|
|
879
879
|
}
|
|
880
|
-
function
|
|
881
|
-
const
|
|
880
|
+
function Pt(t = ot) {
|
|
881
|
+
const e = {}, r = {};
|
|
882
882
|
let n = !1;
|
|
883
|
-
function s
|
|
884
|
-
if (
|
|
885
|
-
const i = Array.from({ length:
|
|
886
|
-
for (let
|
|
887
|
-
i[
|
|
883
|
+
function o(s) {
|
|
884
|
+
if (s.count === 0) return [];
|
|
885
|
+
const i = Array.from({ length: s.count }), l = s.count < t ? 0 : s.head;
|
|
886
|
+
for (let a = 0; a < s.count; a++)
|
|
887
|
+
i[a] = s.data[(l + a) % t];
|
|
888
888
|
return i;
|
|
889
889
|
}
|
|
890
890
|
return {
|
|
891
|
-
push(
|
|
891
|
+
push(s) {
|
|
892
892
|
n = !1;
|
|
893
893
|
for (const i of $) {
|
|
894
|
-
const
|
|
895
|
-
if (!
|
|
896
|
-
const
|
|
897
|
-
if (typeof
|
|
898
|
-
|
|
899
|
-
const
|
|
900
|
-
|
|
894
|
+
const l = i.historyKey;
|
|
895
|
+
if (!l) continue;
|
|
896
|
+
const a = i.extract(s);
|
|
897
|
+
if (typeof a != "number") continue;
|
|
898
|
+
e[l] || (e[l] = { data: Array.from({ length: t }), head: 0, count: 0 });
|
|
899
|
+
const c = e[l];
|
|
900
|
+
c.data[c.head] = a, c.head = (c.head + 1) % t, c.count < t && c.count++;
|
|
901
901
|
}
|
|
902
902
|
},
|
|
903
|
-
get(
|
|
904
|
-
const i =
|
|
905
|
-
return i ?
|
|
903
|
+
get(s) {
|
|
904
|
+
const i = e[s];
|
|
905
|
+
return i ? o(i) : [];
|
|
906
906
|
},
|
|
907
907
|
getAll() {
|
|
908
908
|
if (n) return r;
|
|
909
|
-
for (const
|
|
910
|
-
r[
|
|
909
|
+
for (const s of Object.keys(e))
|
|
910
|
+
r[s] = o(e[s]);
|
|
911
911
|
return n = !0, r;
|
|
912
912
|
}
|
|
913
913
|
};
|
|
914
914
|
}
|
|
915
|
-
class
|
|
915
|
+
class Pe {
|
|
916
916
|
// -- Configuration --------------------------------------------------------
|
|
917
917
|
baseUrl;
|
|
918
918
|
endpoint;
|
|
@@ -940,8 +940,8 @@ class wt {
|
|
|
940
940
|
sseActive = !1;
|
|
941
941
|
isConnected = !1;
|
|
942
942
|
isStale = !1;
|
|
943
|
-
constructor(
|
|
944
|
-
this.baseUrl =
|
|
943
|
+
constructor(e = {}) {
|
|
944
|
+
this.baseUrl = e.baseUrl ?? "", this.endpoint = e.endpoint ?? "/admin/api/server-stats", this.channelName = e.channelName ?? "admin/server-stats", this.authToken = e.authToken, this.pollInterval = e.pollInterval ?? 3e3, this.onStatsUpdate = e.onStatsUpdate, this.onConnectionChange = e.onConnectionChange, this.onStaleChange = e.onStaleChange, this.onError = e.onError, this.onUnauthorizedChange = e.onUnauthorizedChange, this.onHistoryChange = e.onHistoryChange, this.onSseActiveChange = e.onSseActiveChange, this.onPollActiveChange = e.onPollActiveChange, this.historyBuffer = Pt();
|
|
945
945
|
}
|
|
946
946
|
// -- Public API -----------------------------------------------------------
|
|
947
947
|
/**
|
|
@@ -952,8 +952,8 @@ class wt {
|
|
|
952
952
|
start() {
|
|
953
953
|
if (this.unauthorized) return;
|
|
954
954
|
this.stopped = !1;
|
|
955
|
-
const
|
|
956
|
-
this.poll(),
|
|
955
|
+
const e = this.initSseSubscription();
|
|
956
|
+
this.poll(), e || !this.sseHandle ? this.startPollInterval() : this.setupSseFallbackTimer(), this.startStaleDetection();
|
|
957
957
|
}
|
|
958
958
|
/**
|
|
959
959
|
* Stop all timers and subscriptions. Call on unmount.
|
|
@@ -964,8 +964,8 @@ class wt {
|
|
|
964
964
|
/**
|
|
965
965
|
* Get the history array for a single metric key.
|
|
966
966
|
*/
|
|
967
|
-
getHistory(
|
|
968
|
-
return this.historyBuffer.get(
|
|
967
|
+
getHistory(e) {
|
|
968
|
+
return this.historyBuffer.get(e);
|
|
969
969
|
}
|
|
970
970
|
/**
|
|
971
971
|
* Get the entire history map (all keys).
|
|
@@ -982,9 +982,9 @@ class wt {
|
|
|
982
982
|
// -- Internal helpers -----------------------------------------------------
|
|
983
983
|
/** Initialize the SSE subscription. Returns true if SSE failed and polling should be used. */
|
|
984
984
|
initSseSubscription() {
|
|
985
|
-
let
|
|
985
|
+
let e = !1;
|
|
986
986
|
try {
|
|
987
|
-
this.sseHandle =
|
|
987
|
+
this.sseHandle = Q({
|
|
988
988
|
baseUrl: this.baseUrl,
|
|
989
989
|
channelName: this.channelName,
|
|
990
990
|
authToken: this.authToken,
|
|
@@ -998,42 +998,42 @@ class wt {
|
|
|
998
998
|
this.setSseActive(!1), this.setConnected(!1), !this.pollTimer && !this.unauthorized && !this.stopped && this.startPollInterval();
|
|
999
999
|
},
|
|
1000
1000
|
onError: () => {
|
|
1001
|
-
|
|
1001
|
+
e = !0;
|
|
1002
1002
|
}
|
|
1003
1003
|
});
|
|
1004
1004
|
} catch {
|
|
1005
|
-
|
|
1005
|
+
e = !0;
|
|
1006
1006
|
}
|
|
1007
|
-
return
|
|
1007
|
+
return e;
|
|
1008
1008
|
}
|
|
1009
1009
|
/** Set up a 3-second fallback timer to start polling if SSE hasn't connected. */
|
|
1010
1010
|
setupSseFallbackTimer() {
|
|
1011
|
-
const
|
|
1011
|
+
const e = setTimeout(() => {
|
|
1012
1012
|
!this.isConnected && !this.pollTimer && !this.stopped && this.startPollInterval();
|
|
1013
1013
|
}, 3e3), r = this.sseHandle?.unsubscribe;
|
|
1014
1014
|
this.sseHandle && (this.sseHandle.unsubscribe = () => {
|
|
1015
|
-
clearTimeout(
|
|
1015
|
+
clearTimeout(e), r?.();
|
|
1016
1016
|
});
|
|
1017
1017
|
}
|
|
1018
1018
|
/** Start the stale detection interval. */
|
|
1019
1019
|
startStaleDetection() {
|
|
1020
1020
|
this.staleTimer = setInterval(() => {
|
|
1021
|
-
this.lastSuccess > 0 && Date.now() - this.lastSuccess >
|
|
1021
|
+
this.lastSuccess > 0 && Date.now() - this.lastSuccess > it && this.setStale(!0);
|
|
1022
1022
|
}, 2e3);
|
|
1023
1023
|
}
|
|
1024
1024
|
/** Process incoming stats data from either SSE or polling. */
|
|
1025
|
-
processStats(
|
|
1026
|
-
this.onStatsUpdate?.(
|
|
1025
|
+
processStats(e) {
|
|
1026
|
+
this.onStatsUpdate?.(e), this.onError?.(null), this.lastSuccess = Date.now(), this.setStale(!1), this.historyBuffer.push(e), this.onHistoryChange?.(this.historyBuffer.getAll());
|
|
1027
1027
|
}
|
|
1028
1028
|
/** Poll the HTTP endpoint once. */
|
|
1029
1029
|
async poll() {
|
|
1030
1030
|
if (!this.unauthorized) {
|
|
1031
|
-
this.client || (this.client = new
|
|
1031
|
+
this.client || (this.client = new T({ baseUrl: this.baseUrl, authToken: this.authToken }));
|
|
1032
1032
|
try {
|
|
1033
|
-
const
|
|
1034
|
-
this.processStats(
|
|
1035
|
-
} catch (
|
|
1036
|
-
|
|
1033
|
+
const e = await this.client.get(this.endpoint);
|
|
1034
|
+
this.processStats(e);
|
|
1035
|
+
} catch (e) {
|
|
1036
|
+
e instanceof w && (this.unauthorized = !0, this.onUnauthorizedChange?.(!0), this.onError?.(e), this.stopPolling());
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
@@ -1046,21 +1046,21 @@ class wt {
|
|
|
1046
1046
|
this.pollTimer && (clearInterval(this.pollTimer), this.pollTimer = null, this.onPollActiveChange?.(!1));
|
|
1047
1047
|
}
|
|
1048
1048
|
/** Update SSE active state and notify. */
|
|
1049
|
-
setSseActive(
|
|
1050
|
-
this.sseActive !==
|
|
1049
|
+
setSseActive(e) {
|
|
1050
|
+
this.sseActive !== e && (this.sseActive = e, this.onSseActiveChange?.(e));
|
|
1051
1051
|
}
|
|
1052
1052
|
/** Update connected state and notify. */
|
|
1053
|
-
setConnected(
|
|
1054
|
-
this.isConnected !==
|
|
1053
|
+
setConnected(e) {
|
|
1054
|
+
this.isConnected !== e && (this.isConnected = e, this.onConnectionChange?.(e));
|
|
1055
1055
|
}
|
|
1056
1056
|
/** Update stale state and notify. */
|
|
1057
|
-
setStale(
|
|
1058
|
-
this.isStale !==
|
|
1057
|
+
setStale(e) {
|
|
1058
|
+
this.isStale !== e && (this.isStale = e, this.onStaleChange?.(e));
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
|
-
class
|
|
1062
|
-
constructor(
|
|
1063
|
-
this.client =
|
|
1061
|
+
class At {
|
|
1062
|
+
constructor(e, r) {
|
|
1063
|
+
this.client = e, this.basePath = r;
|
|
1064
1064
|
}
|
|
1065
1065
|
/**
|
|
1066
1066
|
* Fetch data for a dashboard section, optionally with a query string.
|
|
@@ -1069,18 +1069,18 @@ class Pe {
|
|
|
1069
1069
|
* @param queryString - Optional query string (without leading `?`).
|
|
1070
1070
|
* @param init - Optional `RequestInit` overrides (e.g. `{ signal }`).
|
|
1071
1071
|
*/
|
|
1072
|
-
async fetchSection(
|
|
1073
|
-
const
|
|
1074
|
-
return this.client.fetch(
|
|
1072
|
+
async fetchSection(e, r, n) {
|
|
1073
|
+
const o = Mt(e), s = r ? `${this.basePath}${o}?${r}` : `${this.basePath}${o}`;
|
|
1074
|
+
return this.client.fetch(s, n);
|
|
1075
1075
|
}
|
|
1076
1076
|
/**
|
|
1077
1077
|
* Fetch chart time-series data for the overview section.
|
|
1078
1078
|
*
|
|
1079
1079
|
* @param range - Time range identifier (e.g. `'1h'`, `'24h'`).
|
|
1080
1080
|
*/
|
|
1081
|
-
async fetchChart(
|
|
1081
|
+
async fetchChart(e) {
|
|
1082
1082
|
return this.client.fetch(
|
|
1083
|
-
`${this.basePath}/overview/chart?range=${
|
|
1083
|
+
`${this.basePath}/overview/chart?range=${e}`
|
|
1084
1084
|
);
|
|
1085
1085
|
}
|
|
1086
1086
|
/**
|
|
@@ -1094,16 +1094,16 @@ class Pe {
|
|
|
1094
1094
|
*
|
|
1095
1095
|
* @param id - Query record ID.
|
|
1096
1096
|
*/
|
|
1097
|
-
async explainQuery(
|
|
1098
|
-
return this.client.fetch(`${this.basePath}/queries/${
|
|
1097
|
+
async explainQuery(e) {
|
|
1098
|
+
return this.client.fetch(`${this.basePath}/queries/${e}/explain`);
|
|
1099
1099
|
}
|
|
1100
1100
|
/**
|
|
1101
1101
|
* Retry a failed job by ID.
|
|
1102
1102
|
*
|
|
1103
1103
|
* @param id - Job record ID.
|
|
1104
1104
|
*/
|
|
1105
|
-
async retryJob(
|
|
1106
|
-
return this.client.fetch(`${this.basePath}/jobs/${
|
|
1105
|
+
async retryJob(e) {
|
|
1106
|
+
return this.client.fetch(`${this.basePath}/jobs/${e}/retry`, {
|
|
1107
1107
|
method: "POST"
|
|
1108
1108
|
});
|
|
1109
1109
|
}
|
|
@@ -1112,9 +1112,9 @@ class Pe {
|
|
|
1112
1112
|
*
|
|
1113
1113
|
* @param key - Cache key (will be URI-encoded).
|
|
1114
1114
|
*/
|
|
1115
|
-
async fetchCacheKey(
|
|
1115
|
+
async fetchCacheKey(e) {
|
|
1116
1116
|
return this.client.fetch(
|
|
1117
|
-
`${this.basePath}/cache/${encodeURIComponent(
|
|
1117
|
+
`${this.basePath}/cache/${encodeURIComponent(e)}`
|
|
1118
1118
|
);
|
|
1119
1119
|
}
|
|
1120
1120
|
/**
|
|
@@ -1122,9 +1122,9 @@ class Pe {
|
|
|
1122
1122
|
*
|
|
1123
1123
|
* @param key - Cache key (will be URI-encoded).
|
|
1124
1124
|
*/
|
|
1125
|
-
async deleteCacheKey(
|
|
1125
|
+
async deleteCacheKey(e) {
|
|
1126
1126
|
return this.client.fetch(
|
|
1127
|
-
`${this.basePath}/cache/${encodeURIComponent(
|
|
1127
|
+
`${this.basePath}/cache/${encodeURIComponent(e)}`,
|
|
1128
1128
|
{
|
|
1129
1129
|
method: "DELETE"
|
|
1130
1130
|
}
|
|
@@ -1135,19 +1135,19 @@ class Pe {
|
|
|
1135
1135
|
*
|
|
1136
1136
|
* @param id - Email record ID.
|
|
1137
1137
|
*/
|
|
1138
|
-
async fetchEmailPreview(
|
|
1139
|
-
return this.client.fetch(`${this.basePath}/emails/${
|
|
1138
|
+
async fetchEmailPreview(e) {
|
|
1139
|
+
return this.client.fetch(`${this.basePath}/emails/${e}/preview`);
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
|
-
function
|
|
1143
|
-
if (!
|
|
1144
|
-
const
|
|
1145
|
-
return
|
|
1142
|
+
function $t(t) {
|
|
1143
|
+
if (!t || typeof t != "object") return !1;
|
|
1144
|
+
const e = t;
|
|
1145
|
+
return e.data !== void 0 && e.meta !== void 0;
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1148
|
-
return
|
|
1147
|
+
function Rt(t, e) {
|
|
1148
|
+
return e.aborted ? !0 : t instanceof DOMException && t.name === "AbortError";
|
|
1149
1149
|
}
|
|
1150
|
-
class
|
|
1150
|
+
class Ae {
|
|
1151
1151
|
// -- Dependencies ---------------------------------------------------------
|
|
1152
1152
|
client;
|
|
1153
1153
|
api;
|
|
@@ -1175,8 +1175,8 @@ class Et {
|
|
|
1175
1175
|
stopped = !1;
|
|
1176
1176
|
/** AbortController for the current in-flight fetch. */
|
|
1177
1177
|
abortController = null;
|
|
1178
|
-
constructor(
|
|
1179
|
-
this.client = new
|
|
1178
|
+
constructor(e) {
|
|
1179
|
+
this.client = new T({ baseUrl: e.baseUrl, authToken: e.authToken }), this.api = new At(this.client, e.endpoint), this.endpoint = e.endpoint, this.section = e.section, this.perPage = e.perPage, this.callbacks = e.callbacks;
|
|
1180
1180
|
}
|
|
1181
1181
|
// -- Public API -----------------------------------------------------------
|
|
1182
1182
|
/**
|
|
@@ -1198,70 +1198,70 @@ class Et {
|
|
|
1198
1198
|
* @param silent - When `true`, errors are swallowed (keeps stale data)
|
|
1199
1199
|
* and loading state is not modified.
|
|
1200
1200
|
*/
|
|
1201
|
-
async fetch(
|
|
1202
|
-
if (this.shouldSkipFetch(
|
|
1203
|
-
const { controller: r, myFetchId: n } = this.prepareFetch(
|
|
1201
|
+
async fetch(e = !0) {
|
|
1202
|
+
if (this.shouldSkipFetch(e)) return;
|
|
1203
|
+
const { controller: r, myFetchId: n } = this.prepareFetch(e);
|
|
1204
1204
|
try {
|
|
1205
|
-
const
|
|
1205
|
+
const o = await this.executeFetch(r);
|
|
1206
1206
|
if (this.isStaleResponse(n)) return;
|
|
1207
|
-
this.applyFetchResult(
|
|
1208
|
-
} catch (
|
|
1209
|
-
if (this.shouldIgnoreError(
|
|
1210
|
-
this.handleFetchError(
|
|
1207
|
+
this.applyFetchResult(o);
|
|
1208
|
+
} catch (o) {
|
|
1209
|
+
if (this.shouldIgnoreError(o, r.signal, n)) return;
|
|
1210
|
+
this.handleFetchError(o, e);
|
|
1211
1211
|
} finally {
|
|
1212
|
-
|
|
1212
|
+
e || (this.explicitFetchPending = !1);
|
|
1213
1213
|
}
|
|
1214
1214
|
}
|
|
1215
1215
|
/**
|
|
1216
1216
|
* Change the active section. Resets pagination, filters, sort, and
|
|
1217
1217
|
* performs a full (non-silent) fetch.
|
|
1218
1218
|
*/
|
|
1219
|
-
setSection(
|
|
1220
|
-
this.section !==
|
|
1219
|
+
setSection(e) {
|
|
1220
|
+
this.section !== e && (this.section = e, this.page = 1, this.search = void 0, this.sort = void 0, this.sortDir = void 0, this.filters = void 0, this.hasFetched = !1, this.callbacks.onData(null), this.callbacks.onPagination(null), this.callbacks.onLoading(!0), this.callbacks.onError(null), this.fetch(!1), this.startRefreshTimer());
|
|
1221
1221
|
}
|
|
1222
1222
|
/**
|
|
1223
1223
|
* Navigate to a specific page. Triggers a non-silent fetch.
|
|
1224
1224
|
*/
|
|
1225
|
-
setPage(
|
|
1226
|
-
this.page =
|
|
1225
|
+
setPage(e) {
|
|
1226
|
+
this.page = e, this.fetch(!1);
|
|
1227
1227
|
}
|
|
1228
1228
|
/**
|
|
1229
1229
|
* Update the search query. Resets to page 1. Triggers a non-silent fetch.
|
|
1230
1230
|
*/
|
|
1231
|
-
setSearch(
|
|
1232
|
-
this.search =
|
|
1231
|
+
setSearch(e) {
|
|
1232
|
+
this.search = e || void 0, this.page = 1, this.fetch(!1);
|
|
1233
1233
|
}
|
|
1234
1234
|
/**
|
|
1235
1235
|
* Set a filter key-value pair. Resets to page 1. Triggers a non-silent fetch.
|
|
1236
1236
|
*/
|
|
1237
|
-
setFilter(
|
|
1238
|
-
this.filters || (this.filters = {}), this.filters[
|
|
1237
|
+
setFilter(e, r) {
|
|
1238
|
+
this.filters || (this.filters = {}), this.filters[e] = String(r), this.page = 1, this.fetch(!1);
|
|
1239
1239
|
}
|
|
1240
1240
|
/**
|
|
1241
1241
|
* Update sort column and direction. Triggers a non-silent fetch.
|
|
1242
1242
|
*
|
|
1243
1243
|
* If the same column is passed without a direction, toggles asc/desc.
|
|
1244
1244
|
*/
|
|
1245
|
-
setSort(
|
|
1246
|
-
this.sort ===
|
|
1245
|
+
setSort(e, r) {
|
|
1246
|
+
this.sort === e && !r ? this.sortDir = this.sortDir === "asc" ? "desc" : "asc" : (this.sort = e, this.sortDir = r || "desc"), this.fetch(!1);
|
|
1247
1247
|
}
|
|
1248
1248
|
/**
|
|
1249
1249
|
* Update the time range. Triggers a non-silent fetch.
|
|
1250
1250
|
*/
|
|
1251
|
-
setTimeRange(
|
|
1252
|
-
this.timeRange =
|
|
1251
|
+
setTimeRange(e) {
|
|
1252
|
+
this.timeRange = e, this.fetch(!1);
|
|
1253
1253
|
}
|
|
1254
1254
|
/**
|
|
1255
1255
|
* Execute a mutation (POST/DELETE) against the dashboard API,
|
|
1256
1256
|
* then silently refresh the current data.
|
|
1257
1257
|
*/
|
|
1258
|
-
async mutate(
|
|
1259
|
-
const
|
|
1258
|
+
async mutate(e, r = "post", n) {
|
|
1259
|
+
const o = `${this.endpoint}/${e}`;
|
|
1260
1260
|
try {
|
|
1261
|
-
const
|
|
1262
|
-
return await this.fetch(!0),
|
|
1263
|
-
} catch (
|
|
1264
|
-
throw
|
|
1261
|
+
const s = r === "post" ? await this.client.post(o, n) : await this.client.delete(o);
|
|
1262
|
+
return await this.fetch(!0), s;
|
|
1263
|
+
} catch (s) {
|
|
1264
|
+
throw s instanceof Error ? s : new Error(String(s));
|
|
1265
1265
|
}
|
|
1266
1266
|
}
|
|
1267
1267
|
/**
|
|
@@ -1271,8 +1271,8 @@ class Et {
|
|
|
1271
1271
|
* controls pagination/search/sort state externally and passes it in
|
|
1272
1272
|
* as props on each render cycle.
|
|
1273
1273
|
*/
|
|
1274
|
-
configure(
|
|
1275
|
-
|
|
1274
|
+
configure(e) {
|
|
1275
|
+
e.page !== void 0 && (this.page = e.page), e.perPage !== void 0 && (this.perPage = e.perPage), this.search = e.search, this.sort = e.sort, this.sortDir = e.sortDir, this.filters = e.filters, this.timeRange = e.timeRange;
|
|
1276
1276
|
}
|
|
1277
1277
|
/**
|
|
1278
1278
|
* Whether data has been fetched at least once.
|
|
@@ -1301,68 +1301,68 @@ class Et {
|
|
|
1301
1301
|
}
|
|
1302
1302
|
// -- Fetch helpers (private) -----------------------------------------------
|
|
1303
1303
|
/** Whether this fetch call should be skipped entirely. */
|
|
1304
|
-
shouldSkipFetch(
|
|
1305
|
-
return
|
|
1304
|
+
shouldSkipFetch(e) {
|
|
1305
|
+
return e && this.explicitFetchPending ? !0 : !this.section;
|
|
1306
1306
|
}
|
|
1307
1307
|
/** Prepare abort controller, increment fetch ID, set loading state. */
|
|
1308
|
-
prepareFetch(
|
|
1308
|
+
prepareFetch(e) {
|
|
1309
1309
|
this.abortController?.abort();
|
|
1310
1310
|
const r = new AbortController();
|
|
1311
1311
|
this.abortController = r;
|
|
1312
1312
|
const n = ++this.fetchId;
|
|
1313
|
-
return
|
|
1313
|
+
return e || (this.callbacks.onLoading(!0), this.explicitFetchPending = !0), { controller: r, myFetchId: n };
|
|
1314
1314
|
}
|
|
1315
1315
|
/** Execute the actual API fetch for the current section. */
|
|
1316
|
-
async executeFetch(
|
|
1316
|
+
async executeFetch(e) {
|
|
1317
1317
|
const r = this.buildCurrentQueryString();
|
|
1318
1318
|
return this.api.fetchSection(this.section, r || void 0, {
|
|
1319
|
-
signal:
|
|
1319
|
+
signal: e.signal
|
|
1320
1320
|
});
|
|
1321
1321
|
}
|
|
1322
1322
|
/** Check if a response is stale (fetch ID mismatch or controller stopped). */
|
|
1323
|
-
isStaleResponse(
|
|
1324
|
-
return
|
|
1323
|
+
isStaleResponse(e) {
|
|
1324
|
+
return e !== this.fetchId || this.stopped;
|
|
1325
1325
|
}
|
|
1326
1326
|
/** Check if an error should be silently ignored (abort or stale). */
|
|
1327
|
-
shouldIgnoreError(
|
|
1328
|
-
return
|
|
1327
|
+
shouldIgnoreError(e, r, n) {
|
|
1328
|
+
return Rt(e, r) ? !0 : this.isStaleResponse(n);
|
|
1329
1329
|
}
|
|
1330
1330
|
/** Build query string from current controller state. */
|
|
1331
1331
|
buildCurrentQueryString() {
|
|
1332
|
-
const
|
|
1333
|
-
return
|
|
1332
|
+
const e = this.sort ? this.sort.replace(/[A-Z]/g, (n) => "_" + n.toLowerCase()) : void 0, r = this.filters;
|
|
1333
|
+
return gt({
|
|
1334
1334
|
page: this.page,
|
|
1335
1335
|
perPage: this.perPage,
|
|
1336
1336
|
search: this.search,
|
|
1337
|
-
sort:
|
|
1337
|
+
sort: e,
|
|
1338
1338
|
sortDir: this.sort ? this.sortDir : void 0,
|
|
1339
1339
|
filters: r && Object.keys(r).length > 0 ? r : void 0,
|
|
1340
1340
|
timeRange: this.section.startsWith("overview") ? this.timeRange : void 0
|
|
1341
1341
|
});
|
|
1342
1342
|
}
|
|
1343
1343
|
/** Apply a successful fetch result to the callbacks. */
|
|
1344
|
-
applyFetchResult(
|
|
1345
|
-
|
|
1344
|
+
applyFetchResult(e) {
|
|
1345
|
+
$t(e) ? (this.callbacks.onData(e.data), this.callbacks.onPagination(e.meta)) : (this.callbacks.onData(e), this.callbacks.onPagination(null)), this.callbacks.onError(null), this.callbacks.onLoading(!1), this.hasFetched = !0;
|
|
1346
1346
|
}
|
|
1347
1347
|
/** Handle a fetch error (unauthorized, network, etc.). */
|
|
1348
|
-
handleFetchError(
|
|
1349
|
-
if (
|
|
1350
|
-
this.callbacks.onError(
|
|
1348
|
+
handleFetchError(e, r) {
|
|
1349
|
+
if (e instanceof w) {
|
|
1350
|
+
this.callbacks.onError(e), this.callbacks.onLoading(!1), this.stopRefreshTimer(), this.callbacks.onUnauthorized();
|
|
1351
1351
|
return;
|
|
1352
1352
|
}
|
|
1353
|
-
r || (this.callbacks.onError(
|
|
1353
|
+
r || (this.callbacks.onError(e instanceof Error ? e : new Error(String(e))), this.callbacks.onLoading(!1));
|
|
1354
1354
|
}
|
|
1355
1355
|
// -- Timer management (private) -------------------------------------------
|
|
1356
1356
|
startRefreshTimer() {
|
|
1357
1357
|
this.stopRefreshTimer();
|
|
1358
|
-
const
|
|
1359
|
-
this.timer = setInterval(() => this.fetch(!0),
|
|
1358
|
+
const e = this.section === "overview" ? et : rt;
|
|
1359
|
+
this.timer = setInterval(() => this.fetch(!0), e);
|
|
1360
1360
|
}
|
|
1361
1361
|
stopRefreshTimer() {
|
|
1362
1362
|
this.timer && (clearInterval(this.timer), this.timer = null);
|
|
1363
1363
|
}
|
|
1364
1364
|
}
|
|
1365
|
-
const
|
|
1365
|
+
const $e = {
|
|
1366
1366
|
// ---------------------------------------------------------------------------
|
|
1367
1367
|
// Debug-panel tabs / Dashboard sidebar sections (shared)
|
|
1368
1368
|
// ---------------------------------------------------------------------------
|
|
@@ -1554,81 +1554,81 @@ const Tt = {
|
|
|
1554
1554
|
viewBox: "0 0 16 16",
|
|
1555
1555
|
elements: ['<path d="M6 3H3v10h10v-3M9 1h6v6M7 9L15 1"/>']
|
|
1556
1556
|
}
|
|
1557
|
-
},
|
|
1558
|
-
function
|
|
1559
|
-
const
|
|
1560
|
-
if (
|
|
1557
|
+
}, Lt = "ss-col-resize", _ = "ss-resizing";
|
|
1558
|
+
function Re(t) {
|
|
1559
|
+
const e = Array.from(t.querySelectorAll("thead th"));
|
|
1560
|
+
if (e.length === 0) return () => {
|
|
1561
1561
|
};
|
|
1562
1562
|
const r = [];
|
|
1563
1563
|
let n = !1;
|
|
1564
|
-
function
|
|
1564
|
+
function o() {
|
|
1565
1565
|
if (!n) {
|
|
1566
1566
|
n = !0;
|
|
1567
|
-
for (const
|
|
1568
|
-
|
|
1569
|
-
|
|
1567
|
+
for (const s of e)
|
|
1568
|
+
s.style.width = s.offsetWidth + "px";
|
|
1569
|
+
t.style.tableLayout = "fixed";
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
|
-
for (const
|
|
1573
|
-
let i = function(
|
|
1574
|
-
|
|
1575
|
-
const
|
|
1576
|
-
|
|
1572
|
+
for (const s of e) {
|
|
1573
|
+
let i = function(a) {
|
|
1574
|
+
a.preventDefault(), a.stopPropagation(), o();
|
|
1575
|
+
const c = a.clientX, m = s.offsetWidth;
|
|
1576
|
+
l.classList.add(_), l.setPointerCapture(a.pointerId);
|
|
1577
1577
|
function f(d) {
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1578
|
+
const g = d.clientX - c, h = Math.max(30, m + g);
|
|
1579
|
+
s.style.width = h + "px";
|
|
1580
1580
|
}
|
|
1581
1581
|
function p() {
|
|
1582
|
-
|
|
1582
|
+
l.classList.remove(_), l.removeEventListener("pointermove", f), l.removeEventListener("pointerup", p);
|
|
1583
1583
|
}
|
|
1584
|
-
|
|
1584
|
+
l.addEventListener("pointermove", f), l.addEventListener("pointerup", p);
|
|
1585
1585
|
};
|
|
1586
|
-
if (!
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1589
|
-
|
|
1586
|
+
if (!s.textContent?.trim()) continue;
|
|
1587
|
+
const l = document.createElement("div");
|
|
1588
|
+
l.className = Lt, s.appendChild(l), l.addEventListener("pointerdown", i), r.push(() => {
|
|
1589
|
+
l.removeEventListener("pointerdown", i), l.remove();
|
|
1590
1590
|
});
|
|
1591
1591
|
}
|
|
1592
1592
|
return () => {
|
|
1593
|
-
for (const
|
|
1593
|
+
for (const s of r) s();
|
|
1594
1594
|
};
|
|
1595
1595
|
}
|
|
1596
|
-
function
|
|
1597
|
-
const { container:
|
|
1598
|
-
if (
|
|
1599
|
-
const
|
|
1600
|
-
if (
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1596
|
+
function Le(t) {
|
|
1597
|
+
const { container: e, handle: r, topPane: n, bottomPane: o, storageKey: s, minHeight: i = 60 } = t;
|
|
1598
|
+
if (s) {
|
|
1599
|
+
const a = localStorage.getItem(s);
|
|
1600
|
+
if (a) {
|
|
1601
|
+
const c = parseFloat(a);
|
|
1602
|
+
c > 0 && c < 1 && (n.style.flex = `${c}`, o.style.flex = `${1 - c}`);
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
|
-
function a
|
|
1606
|
-
|
|
1607
|
-
const
|
|
1608
|
-
function d(
|
|
1609
|
-
const y =
|
|
1610
|
-
let
|
|
1611
|
-
const
|
|
1612
|
-
|
|
1613
|
-
const L =
|
|
1614
|
-
n.style.flex = `${L}`,
|
|
1605
|
+
function l(a) {
|
|
1606
|
+
a.preventDefault(), r.setPointerCapture(a.pointerId);
|
|
1607
|
+
const m = e.getBoundingClientRect().height, f = a.clientY, p = n.getBoundingClientRect().height;
|
|
1608
|
+
function d(h) {
|
|
1609
|
+
const y = h.clientY - f;
|
|
1610
|
+
let S = p + y;
|
|
1611
|
+
const z = m - i - r.offsetHeight;
|
|
1612
|
+
S = Math.max(i, Math.min(S, z));
|
|
1613
|
+
const L = S / (m - r.offsetHeight);
|
|
1614
|
+
n.style.flex = `${L}`, o.style.flex = `${1 - L}`;
|
|
1615
1615
|
}
|
|
1616
|
-
function
|
|
1617
|
-
if (r.removeEventListener("pointermove", d), r.removeEventListener("pointerup",
|
|
1618
|
-
const
|
|
1619
|
-
if (
|
|
1620
|
-
const y = n.getBoundingClientRect().height /
|
|
1621
|
-
localStorage.setItem(
|
|
1616
|
+
function g() {
|
|
1617
|
+
if (r.removeEventListener("pointermove", d), r.removeEventListener("pointerup", g), s) {
|
|
1618
|
+
const h = e.getBoundingClientRect().height - r.offsetHeight;
|
|
1619
|
+
if (h > 0) {
|
|
1620
|
+
const y = n.getBoundingClientRect().height / h;
|
|
1621
|
+
localStorage.setItem(s, String(y));
|
|
1622
1622
|
}
|
|
1623
1623
|
}
|
|
1624
1624
|
}
|
|
1625
|
-
r.addEventListener("pointermove", d), r.addEventListener("pointerup",
|
|
1625
|
+
r.addEventListener("pointermove", d), r.addEventListener("pointerup", g);
|
|
1626
1626
|
}
|
|
1627
|
-
return r.addEventListener("pointerdown",
|
|
1628
|
-
r.removeEventListener("pointerdown",
|
|
1627
|
+
return r.addEventListener("pointerdown", l), () => {
|
|
1628
|
+
r.removeEventListener("pointerdown", l);
|
|
1629
1629
|
};
|
|
1630
1630
|
}
|
|
1631
|
-
class
|
|
1631
|
+
class De {
|
|
1632
1632
|
client;
|
|
1633
1633
|
endpoint;
|
|
1634
1634
|
refreshInterval;
|
|
@@ -1637,15 +1637,15 @@ class kt {
|
|
|
1637
1637
|
currentTab = null;
|
|
1638
1638
|
fetchOnceCache = {};
|
|
1639
1639
|
abortController = null;
|
|
1640
|
-
constructor(
|
|
1641
|
-
this.client = new
|
|
1642
|
-
baseUrl:
|
|
1643
|
-
authToken:
|
|
1644
|
-
}), this.endpoint =
|
|
1645
|
-
onData:
|
|
1646
|
-
onLoading:
|
|
1647
|
-
onError:
|
|
1648
|
-
onUnauthorized:
|
|
1640
|
+
constructor(e) {
|
|
1641
|
+
this.client = new T({
|
|
1642
|
+
baseUrl: e.baseUrl,
|
|
1643
|
+
authToken: e.authToken
|
|
1644
|
+
}), this.endpoint = e.endpoint ?? "/admin/api/debug", this.refreshInterval = e.refreshInterval ?? nt, this.callbacks = {
|
|
1645
|
+
onData: e.onData,
|
|
1646
|
+
onLoading: e.onLoading,
|
|
1647
|
+
onError: e.onError,
|
|
1648
|
+
onUnauthorized: e.onUnauthorized
|
|
1649
1649
|
};
|
|
1650
1650
|
}
|
|
1651
1651
|
// -------------------------------------------------------------------------
|
|
@@ -1656,8 +1656,8 @@ class kt {
|
|
|
1656
1656
|
*
|
|
1657
1657
|
* If a timer is already running it will be stopped first.
|
|
1658
1658
|
*/
|
|
1659
|
-
start(
|
|
1660
|
-
this.stop(), this.currentTab =
|
|
1659
|
+
start(e) {
|
|
1660
|
+
this.stop(), this.currentTab = e, this.callbacks.onLoading(!0), this.callbacks.onError(null), this.fetchData(), this.timer = setInterval(() => this.fetchData(), this.refreshInterval);
|
|
1661
1661
|
}
|
|
1662
1662
|
/**
|
|
1663
1663
|
* Stop the auto-refresh timer.
|
|
@@ -1671,8 +1671,8 @@ class kt {
|
|
|
1671
1671
|
* Stops the current timer, resets loading/error state, and starts
|
|
1672
1672
|
* fetching for the new tab.
|
|
1673
1673
|
*/
|
|
1674
|
-
switchTab(
|
|
1675
|
-
this.start(
|
|
1674
|
+
switchTab(e) {
|
|
1675
|
+
this.start(e);
|
|
1676
1676
|
}
|
|
1677
1677
|
/**
|
|
1678
1678
|
* Force an immediate re-fetch of the current tab (ignoring the
|
|
@@ -1685,17 +1685,17 @@ class kt {
|
|
|
1685
1685
|
* Fetch a custom pane endpoint. Optionally honours the fetchOnce
|
|
1686
1686
|
* cache so a pane that has already been loaded is not re-requested.
|
|
1687
1687
|
*/
|
|
1688
|
-
async fetchCustomPane(
|
|
1689
|
-
if (r && this.fetchOnceCache[
|
|
1690
|
-
this.callbacks.onData(this.fetchOnceCache[
|
|
1688
|
+
async fetchCustomPane(e, r = !1) {
|
|
1689
|
+
if (r && this.fetchOnceCache[e] !== void 0) {
|
|
1690
|
+
this.callbacks.onData(this.fetchOnceCache[e]), this.callbacks.onLoading(!1);
|
|
1691
1691
|
return;
|
|
1692
1692
|
}
|
|
1693
1693
|
this.callbacks.onLoading(!0);
|
|
1694
1694
|
try {
|
|
1695
|
-
const n = await this.client.fetch(
|
|
1696
|
-
this.callbacks.onData(n), this.callbacks.onError(null), r && (this.fetchOnceCache[
|
|
1695
|
+
const n = await this.client.fetch(e);
|
|
1696
|
+
this.callbacks.onData(n), this.callbacks.onError(null), r && (this.fetchOnceCache[e] = n);
|
|
1697
1697
|
} catch (n) {
|
|
1698
|
-
if (n instanceof
|
|
1698
|
+
if (n instanceof w) {
|
|
1699
1699
|
this.callbacks.onUnauthorized(n);
|
|
1700
1700
|
return;
|
|
1701
1701
|
}
|
|
@@ -1709,8 +1709,8 @@ class kt {
|
|
|
1709
1709
|
* Subsequent `start()` / `switchTab()` calls for this tab will
|
|
1710
1710
|
* serve the cached value instead of hitting the network.
|
|
1711
1711
|
*/
|
|
1712
|
-
cacheForTab(
|
|
1713
|
-
this.fetchOnceCache[
|
|
1712
|
+
cacheForTab(e, r) {
|
|
1713
|
+
this.fetchOnceCache[e] = r;
|
|
1714
1714
|
}
|
|
1715
1715
|
/**
|
|
1716
1716
|
* Clear all cached fetchOnce data.
|
|
@@ -1722,87 +1722,87 @@ class kt {
|
|
|
1722
1722
|
// Internal
|
|
1723
1723
|
// -------------------------------------------------------------------------
|
|
1724
1724
|
async fetchData() {
|
|
1725
|
-
const
|
|
1726
|
-
if (!
|
|
1725
|
+
const e = this.currentTab;
|
|
1726
|
+
if (!e || this.serveFromCache(e)) return;
|
|
1727
1727
|
this.abortController?.abort();
|
|
1728
1728
|
const r = new AbortController();
|
|
1729
1729
|
this.abortController = r;
|
|
1730
1730
|
try {
|
|
1731
|
-
const n = `${this.endpoint}${
|
|
1731
|
+
const n = `${this.endpoint}${Tt(e)}`, o = await this.client.fetch(n, { signal: r.signal });
|
|
1732
1732
|
if (r.signal.aborted) return;
|
|
1733
|
-
this.callbacks.onData(
|
|
1733
|
+
this.callbacks.onData(o), this.callbacks.onError(null), this.callbacks.onLoading(!1);
|
|
1734
1734
|
} catch (n) {
|
|
1735
1735
|
this.handleFetchError(n, r);
|
|
1736
1736
|
}
|
|
1737
1737
|
}
|
|
1738
1738
|
/** Serve cached data if available. Returns true if cache hit. */
|
|
1739
|
-
serveFromCache(
|
|
1740
|
-
return this.fetchOnceCache[
|
|
1739
|
+
serveFromCache(e) {
|
|
1740
|
+
return this.fetchOnceCache[e] === void 0 ? !1 : (this.callbacks.onData(this.fetchOnceCache[e]), this.callbacks.onLoading(!1), !0);
|
|
1741
1741
|
}
|
|
1742
1742
|
/** Handle errors from fetchData. */
|
|
1743
|
-
handleFetchError(
|
|
1744
|
-
if (!(
|
|
1745
|
-
if (
|
|
1746
|
-
this.callbacks.onError(
|
|
1743
|
+
handleFetchError(e, r) {
|
|
1744
|
+
if (!(e instanceof DOMException && e.name === "AbortError") && !r.signal.aborted) {
|
|
1745
|
+
if (e instanceof w) {
|
|
1746
|
+
this.callbacks.onError(e), this.callbacks.onLoading(!1), this.stop(), this.callbacks.onUnauthorized(e);
|
|
1747
1747
|
return;
|
|
1748
1748
|
}
|
|
1749
|
-
this.callbacks.onError(
|
|
1749
|
+
this.callbacks.onError(e instanceof Error ? e : new Error(String(e))), this.callbacks.onLoading(!1);
|
|
1750
1750
|
}
|
|
1751
1751
|
}
|
|
1752
1752
|
}
|
|
1753
|
-
function
|
|
1754
|
-
if (typeof
|
|
1753
|
+
function Dt(t) {
|
|
1754
|
+
if (typeof t == "string")
|
|
1755
1755
|
try {
|
|
1756
|
-
return JSON.parse(
|
|
1756
|
+
return JSON.parse(t);
|
|
1757
1757
|
} catch {
|
|
1758
1758
|
return null;
|
|
1759
1759
|
}
|
|
1760
|
-
return typeof
|
|
1760
|
+
return typeof t == "object" && t !== null && !Array.isArray(t) ? t : null;
|
|
1761
1761
|
}
|
|
1762
|
-
function
|
|
1763
|
-
const
|
|
1764
|
-
for (const [r, n] of Object.entries(
|
|
1765
|
-
|
|
1766
|
-
return Object.keys(
|
|
1762
|
+
function I(t) {
|
|
1763
|
+
const e = {};
|
|
1764
|
+
for (const [r, n] of Object.entries(t))
|
|
1765
|
+
Ut.has(r) || (e[r] = n);
|
|
1766
|
+
return Object.keys(e).length > 0 ? e : null;
|
|
1767
1767
|
}
|
|
1768
|
-
const
|
|
1769
|
-
function
|
|
1770
|
-
return (
|
|
1768
|
+
const Fe = ["all", "error", "warn", "info", "debug"];
|
|
1769
|
+
function Ft(t) {
|
|
1770
|
+
return (t.levelName || t.level_name || (typeof t.level == "string" ? t.level : "") || "info").toLowerCase();
|
|
1771
1771
|
}
|
|
1772
|
-
function
|
|
1773
|
-
return
|
|
1772
|
+
function Ue(t) {
|
|
1773
|
+
return t.msg || t.message || JSON.stringify(t);
|
|
1774
1774
|
}
|
|
1775
|
-
function
|
|
1776
|
-
return
|
|
1775
|
+
function _e(t) {
|
|
1776
|
+
return t.createdAt || t.created_at || t.time || t.timestamp || 0;
|
|
1777
1777
|
}
|
|
1778
|
-
function
|
|
1779
|
-
const
|
|
1780
|
-
return
|
|
1778
|
+
function Ie(t) {
|
|
1779
|
+
const e = t.data || {};
|
|
1780
|
+
return t.requestId || t.request_id || t["x-request-id"] || e.requestId || e.request_id || e["x-request-id"] || "";
|
|
1781
1781
|
}
|
|
1782
|
-
function
|
|
1783
|
-
switch (
|
|
1782
|
+
function Oe(t, e = "ss-dbg-log-level") {
|
|
1783
|
+
switch (t) {
|
|
1784
1784
|
case "error":
|
|
1785
1785
|
case "fatal":
|
|
1786
|
-
return `${
|
|
1786
|
+
return `${e}-error`;
|
|
1787
1787
|
case "warn":
|
|
1788
|
-
return `${
|
|
1788
|
+
return `${e}-warn`;
|
|
1789
1789
|
case "info":
|
|
1790
|
-
return `${
|
|
1790
|
+
return `${e}-info`;
|
|
1791
1791
|
case "debug":
|
|
1792
|
-
return `${
|
|
1792
|
+
return `${e}-debug`;
|
|
1793
1793
|
case "trace":
|
|
1794
|
-
return `${
|
|
1794
|
+
return `${e}-trace`;
|
|
1795
1795
|
default:
|
|
1796
|
-
return `${
|
|
1796
|
+
return `${e}-info`;
|
|
1797
1797
|
}
|
|
1798
1798
|
}
|
|
1799
|
-
function
|
|
1800
|
-
return
|
|
1801
|
-
const n =
|
|
1802
|
-
return
|
|
1799
|
+
function Ne(t, e) {
|
|
1800
|
+
return e === "all" ? t : t.filter((r) => {
|
|
1801
|
+
const n = Ft(r);
|
|
1802
|
+
return e === "error" ? n === "error" || n === "fatal" : n === e;
|
|
1803
1803
|
});
|
|
1804
1804
|
}
|
|
1805
|
-
const
|
|
1805
|
+
const Ut = /* @__PURE__ */ new Set([
|
|
1806
1806
|
"level",
|
|
1807
1807
|
"time",
|
|
1808
1808
|
"pid",
|
|
@@ -1822,34 +1822,283 @@ const Ue = /* @__PURE__ */ new Set([
|
|
|
1822
1822
|
"id",
|
|
1823
1823
|
"data"
|
|
1824
1824
|
]);
|
|
1825
|
-
function
|
|
1826
|
-
if (
|
|
1827
|
-
const
|
|
1828
|
-
if (
|
|
1829
|
-
const r =
|
|
1825
|
+
function He(t) {
|
|
1826
|
+
if (t.data) {
|
|
1827
|
+
const e = Dt(t.data);
|
|
1828
|
+
if (e) {
|
|
1829
|
+
const r = I(e);
|
|
1830
1830
|
if (r) return r;
|
|
1831
1831
|
}
|
|
1832
1832
|
}
|
|
1833
|
-
return
|
|
1833
|
+
return I(t);
|
|
1834
|
+
}
|
|
1835
|
+
function u(t, ...e) {
|
|
1836
|
+
for (const r of e) {
|
|
1837
|
+
const n = t[r];
|
|
1838
|
+
if (n != null) return n;
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1841
|
+
function _t(t) {
|
|
1842
|
+
return u(t, "createdAt", "created_at", "timestamp");
|
|
1843
|
+
}
|
|
1844
|
+
function qe(t) {
|
|
1845
|
+
return u(t, "timestamp", "createdAt", "processedAt", "created_at");
|
|
1846
|
+
}
|
|
1847
|
+
function Be(t) {
|
|
1848
|
+
return u(t, "statusCode", "status_code");
|
|
1849
|
+
}
|
|
1850
|
+
function Ke(t) {
|
|
1851
|
+
return u(t, "total_duration", "totalDuration", "duration") ?? 0;
|
|
1852
|
+
}
|
|
1853
|
+
function ze(t) {
|
|
1854
|
+
return u(t, "span_count", "spanCount") ?? 0;
|
|
1855
|
+
}
|
|
1856
|
+
function je(t) {
|
|
1857
|
+
return u(t, "warning_count", "warningCount") ?? 0;
|
|
1858
|
+
}
|
|
1859
|
+
function We(t) {
|
|
1860
|
+
return u(t, "from_addr", "from") ?? "";
|
|
1834
1861
|
}
|
|
1835
|
-
function
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1862
|
+
function Ve(t) {
|
|
1863
|
+
return u(t, "to_addr", "to") ?? "";
|
|
1864
|
+
}
|
|
1865
|
+
function Ge(t) {
|
|
1866
|
+
return u(t, "cc", "cc_addr") ?? "";
|
|
1867
|
+
}
|
|
1868
|
+
function Qe(t) {
|
|
1869
|
+
return u(t, "attachment_count", "attachmentCount") ?? 0;
|
|
1870
|
+
}
|
|
1871
|
+
function Je(t) {
|
|
1872
|
+
return u(t, "event_name", "eventName", "event") ?? "";
|
|
1873
|
+
}
|
|
1874
|
+
function It(t) {
|
|
1875
|
+
return u(t, "method", "sql_method") ?? "";
|
|
1876
|
+
}
|
|
1877
|
+
function K(t) {
|
|
1878
|
+
return u(t, "sqlNormalized", "normalizedSql", "sql_normalized", "sql") ?? "";
|
|
1879
|
+
}
|
|
1880
|
+
function Ye(t, e, r) {
|
|
1881
|
+
const n = t[e];
|
|
1882
|
+
return n != null && n !== 0 ? Number(n) : Number(t[r]) || 0;
|
|
1883
|
+
}
|
|
1884
|
+
function Xe(t, e) {
|
|
1885
|
+
if (!e) return t;
|
|
1886
|
+
const r = e.toLowerCase();
|
|
1887
|
+
return t.filter(
|
|
1839
1888
|
(n) => n.sql.toLowerCase().includes(r) || n.model && n.model.toLowerCase().includes(r) || n.method.toLowerCase().includes(r)
|
|
1840
1889
|
);
|
|
1841
1890
|
}
|
|
1842
|
-
function
|
|
1843
|
-
const
|
|
1844
|
-
for (const r of
|
|
1845
|
-
|
|
1846
|
-
return
|
|
1891
|
+
function Ze(t) {
|
|
1892
|
+
const e = {};
|
|
1893
|
+
for (const r of t)
|
|
1894
|
+
e[r.sql] = (e[r.sql] || 0) + 1;
|
|
1895
|
+
return e;
|
|
1847
1896
|
}
|
|
1848
|
-
function
|
|
1849
|
-
const r =
|
|
1850
|
-
return { slowCount: r, dupCount: n, avgDuration:
|
|
1897
|
+
function tr(t, e) {
|
|
1898
|
+
const r = t.filter((s) => s.duration > 100).length, n = Object.values(e).filter((s) => s > 1).length, o = t.length > 0 ? t.reduce((s, i) => s + i.duration, 0) / t.length : 0;
|
|
1899
|
+
return { slowCount: r, dupCount: n, avgDuration: o, totalCount: t.length };
|
|
1900
|
+
}
|
|
1901
|
+
function er(t, e) {
|
|
1902
|
+
let r = 0, n = 0;
|
|
1903
|
+
for (const a of t) {
|
|
1904
|
+
const c = u(a, "duration") ?? 0;
|
|
1905
|
+
n += c, c > N && r++;
|
|
1906
|
+
}
|
|
1907
|
+
const o = Ot(t);
|
|
1908
|
+
let s = 0;
|
|
1909
|
+
for (const a of o.values())
|
|
1910
|
+
a > 1 && (s += a);
|
|
1911
|
+
const i = t.length > 0 ? n / t.length : 0, l = e?.total ?? t.length;
|
|
1912
|
+
return { slowCount: r, dupCount: s, avgDuration: i, totalCount: l };
|
|
1913
|
+
}
|
|
1914
|
+
function rr(t) {
|
|
1915
|
+
return {
|
|
1916
|
+
id: u(t, "id") ?? 0,
|
|
1917
|
+
sql: u(t, "sql", "sql_text") ?? "",
|
|
1918
|
+
sqlNormalized: K(t),
|
|
1919
|
+
duration: u(t, "duration") ?? 0,
|
|
1920
|
+
method: It(t),
|
|
1921
|
+
model: u(t, "model") ?? "",
|
|
1922
|
+
connection: u(t, "connection") ?? "",
|
|
1923
|
+
timestamp: _t(t) ?? 0,
|
|
1924
|
+
inTransaction: u(t, "inTransaction", "in_transaction") ?? !1
|
|
1925
|
+
};
|
|
1926
|
+
}
|
|
1927
|
+
function Ot(t) {
|
|
1928
|
+
const e = /* @__PURE__ */ new Map();
|
|
1929
|
+
for (const r of t) {
|
|
1930
|
+
const o = K(r);
|
|
1931
|
+
e.set(o, (e.get(o) || 0) + 1);
|
|
1932
|
+
}
|
|
1933
|
+
return e;
|
|
1934
|
+
}
|
|
1935
|
+
function Nt(t) {
|
|
1936
|
+
const e = [];
|
|
1937
|
+
if (t["Startup Cost"] !== null && t["Startup Cost"] !== void 0 && e.push(`cost=${t["Startup Cost"]}..${t["Total Cost"]}`), t["Plan Rows"] !== null && t["Plan Rows"] !== void 0 && e.push(`rows=${t["Plan Rows"]}`), t["Plan Width"] !== null && t["Plan Width"] !== void 0 && e.push(`width=${t["Plan Width"]}`), t.Filter && e.push(`filter: ${t.Filter}`), t["Index Cond"] && e.push(`cond: ${t["Index Cond"]}`), t["Hash Cond"] && e.push(`hash: ${t["Hash Cond"]}`), t["Join Type"] && e.push(`join: ${t["Join Type"]}`), t["Sort Key"]) {
|
|
1938
|
+
const r = Array.isArray(t["Sort Key"]) ? t["Sort Key"].join(", ") : t["Sort Key"];
|
|
1939
|
+
e.push(`sort: ${r}`);
|
|
1940
|
+
}
|
|
1941
|
+
return e;
|
|
1942
|
+
}
|
|
1943
|
+
function Ht(t, e = 0) {
|
|
1944
|
+
if (!t) return [];
|
|
1945
|
+
const n = [{
|
|
1946
|
+
depth: e,
|
|
1947
|
+
nodeType: t["Node Type"] || "Unknown",
|
|
1948
|
+
relationName: t["Relation Name"] || "",
|
|
1949
|
+
alias: t.Alias && t.Alias !== t["Relation Name"] ? t.Alias : "",
|
|
1950
|
+
indexName: t["Index Name"] || "",
|
|
1951
|
+
metrics: Nt(t),
|
|
1952
|
+
isRoot: e === 0
|
|
1953
|
+
}], o = t.Plans || [];
|
|
1954
|
+
for (const s of o)
|
|
1955
|
+
n.push(...Ht(s, e + 1));
|
|
1956
|
+
return n;
|
|
1957
|
+
}
|
|
1958
|
+
function nr(t) {
|
|
1959
|
+
return !t || typeof t != "object" ? !1 : "Plan" in t;
|
|
1960
|
+
}
|
|
1961
|
+
function sr(t) {
|
|
1962
|
+
if (!t || t.length === 0) return [];
|
|
1963
|
+
const e = t[0];
|
|
1964
|
+
return !e || typeof e != "object" ? [] : Object.keys(e);
|
|
1965
|
+
}
|
|
1966
|
+
function or(t) {
|
|
1967
|
+
return t == null ? "-" : String(t);
|
|
1968
|
+
}
|
|
1969
|
+
function ir() {
|
|
1970
|
+
return [
|
|
1971
|
+
{ key: "id", label: "#", width: "50px", type: "index" },
|
|
1972
|
+
{ key: "sql", label: "SQL", type: "sql" },
|
|
1973
|
+
{ key: "duration", label: "Duration", width: "80px", type: "duration" },
|
|
1974
|
+
{ key: "method", label: "Method", width: "70px", type: "method" },
|
|
1975
|
+
{ key: "model", label: "Model", width: "100px", type: "model" },
|
|
1976
|
+
{ key: "timestamp", label: "Time", width: "80px", type: "time" }
|
|
1977
|
+
];
|
|
1978
|
+
}
|
|
1979
|
+
function ar(t) {
|
|
1980
|
+
const e = t?.showExplain ?? !0, r = [
|
|
1981
|
+
{ key: "id", label: "#", width: "40px", type: "index" },
|
|
1982
|
+
{ key: "sql", label: "SQL", type: "sql" },
|
|
1983
|
+
{ key: "duration", label: "Duration", width: "70px", sortable: !0, type: "duration" },
|
|
1984
|
+
{ key: "method", label: "Method", width: "60px", type: "method" },
|
|
1985
|
+
{ key: "model", label: "Model", width: "90px", type: "model" },
|
|
1986
|
+
{ key: "connection", label: "Connection", width: "80px", type: "connection" },
|
|
1987
|
+
{ key: "createdAt", label: "Time", width: "90px", sortable: !0, type: "time" }
|
|
1988
|
+
];
|
|
1989
|
+
return e && r.push({ key: "id", label: "", width: "70px", type: "explain" }), r;
|
|
1990
|
+
}
|
|
1991
|
+
function lr() {
|
|
1992
|
+
return [
|
|
1993
|
+
{ key: "sqlNormalized", label: "Pattern", type: "sql" },
|
|
1994
|
+
{ key: "count", label: "Count", width: "60px", sortable: !0 },
|
|
1995
|
+
{ key: "avgDuration", label: "Avg", width: "70px", sortable: !0, type: "duration" },
|
|
1996
|
+
{ key: "minDuration", label: "Min", width: "70px", type: "duration" },
|
|
1997
|
+
{ key: "maxDuration", label: "Max", width: "70px", type: "duration" },
|
|
1998
|
+
{ key: "totalDuration", label: "Total", width: "70px", sortable: !0, type: "duration" },
|
|
1999
|
+
{ key: "percentOfTotal", label: "% Time", width: "60px" }
|
|
2000
|
+
];
|
|
2001
|
+
}
|
|
2002
|
+
class cr {
|
|
2003
|
+
state;
|
|
2004
|
+
constructor(e = "list") {
|
|
2005
|
+
this.state = {
|
|
2006
|
+
viewMode: e,
|
|
2007
|
+
sort: {
|
|
2008
|
+
key: e === "list" ? "createdAt" : "count",
|
|
2009
|
+
dir: "desc"
|
|
2010
|
+
},
|
|
2011
|
+
expandedIds: /* @__PURE__ */ new Set(),
|
|
2012
|
+
explainData: /* @__PURE__ */ new Map(),
|
|
2013
|
+
search: ""
|
|
2014
|
+
};
|
|
2015
|
+
}
|
|
2016
|
+
// -----------------------------------------------------------------------
|
|
2017
|
+
// View mode
|
|
2018
|
+
// -----------------------------------------------------------------------
|
|
2019
|
+
/**
|
|
2020
|
+
* Switch between list and grouped view.
|
|
2021
|
+
*
|
|
2022
|
+
* Resets sort, expanded IDs, EXPLAIN data, and search.
|
|
2023
|
+
*/
|
|
2024
|
+
setViewMode(e) {
|
|
2025
|
+
return this.state.viewMode = e, this.state.sort = {
|
|
2026
|
+
key: e === "list" ? "createdAt" : "count",
|
|
2027
|
+
dir: "desc"
|
|
2028
|
+
}, this.state.expandedIds = /* @__PURE__ */ new Set(), this.state.explainData = /* @__PURE__ */ new Map(), this.state;
|
|
2029
|
+
}
|
|
2030
|
+
// -----------------------------------------------------------------------
|
|
2031
|
+
// Sorting
|
|
2032
|
+
// -----------------------------------------------------------------------
|
|
2033
|
+
/**
|
|
2034
|
+
* Toggle sort on a column. If the column is already sorted, flips
|
|
2035
|
+
* direction; otherwise sorts descending on the new column.
|
|
2036
|
+
*/
|
|
2037
|
+
toggleSort(e) {
|
|
2038
|
+
return this.state.sort.key === e ? this.state.sort = {
|
|
2039
|
+
key: e,
|
|
2040
|
+
dir: this.state.sort.dir === "asc" ? "desc" : "asc"
|
|
2041
|
+
} : this.state.sort = { key: e, dir: "desc" }, this.state;
|
|
2042
|
+
}
|
|
2043
|
+
// -----------------------------------------------------------------------
|
|
2044
|
+
// Expand / collapse
|
|
2045
|
+
// -----------------------------------------------------------------------
|
|
2046
|
+
/**
|
|
2047
|
+
* Toggle the expanded state of a row by its ID.
|
|
2048
|
+
*/
|
|
2049
|
+
toggleExpand(e) {
|
|
2050
|
+
return this.state.expandedIds.has(e) ? this.state.expandedIds.delete(e) : this.state.expandedIds.add(e), this.state;
|
|
2051
|
+
}
|
|
2052
|
+
/**
|
|
2053
|
+
* Check whether a row is currently expanded.
|
|
2054
|
+
*/
|
|
2055
|
+
isExpanded(e) {
|
|
2056
|
+
return this.state.expandedIds.has(e);
|
|
2057
|
+
}
|
|
2058
|
+
// -----------------------------------------------------------------------
|
|
2059
|
+
// Search
|
|
2060
|
+
// -----------------------------------------------------------------------
|
|
2061
|
+
/**
|
|
2062
|
+
* Update the search string.
|
|
2063
|
+
*/
|
|
2064
|
+
setSearch(e) {
|
|
2065
|
+
return this.state.search = e, this.state;
|
|
2066
|
+
}
|
|
2067
|
+
// -----------------------------------------------------------------------
|
|
2068
|
+
// EXPLAIN lifecycle
|
|
2069
|
+
// -----------------------------------------------------------------------
|
|
2070
|
+
/**
|
|
2071
|
+
* Mark a query as loading its EXPLAIN plan.
|
|
2072
|
+
*/
|
|
2073
|
+
startExplain(e) {
|
|
2074
|
+
this.state.explainData.set(e, { loading: !0 });
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Store a successful EXPLAIN result for a query.
|
|
2078
|
+
*/
|
|
2079
|
+
completeExplain(e, r) {
|
|
2080
|
+
this.state.explainData.set(e, { loading: !1, result: r });
|
|
2081
|
+
}
|
|
2082
|
+
/**
|
|
2083
|
+
* Store an EXPLAIN error for a query.
|
|
2084
|
+
*/
|
|
2085
|
+
failExplain(e, r) {
|
|
2086
|
+
this.state.explainData.set(e, { loading: !1, error: r });
|
|
2087
|
+
}
|
|
2088
|
+
/**
|
|
2089
|
+
* Clear all EXPLAIN data.
|
|
2090
|
+
*/
|
|
2091
|
+
clearExplain() {
|
|
2092
|
+
this.state.explainData = /* @__PURE__ */ new Map();
|
|
2093
|
+
}
|
|
2094
|
+
/**
|
|
2095
|
+
* Get the current EXPLAIN state for a specific query.
|
|
2096
|
+
*/
|
|
2097
|
+
getExplainState(e) {
|
|
2098
|
+
return this.state.explainData.get(e);
|
|
2099
|
+
}
|
|
1851
2100
|
}
|
|
1852
|
-
const
|
|
2101
|
+
const ur = [
|
|
1853
2102
|
"all",
|
|
1854
2103
|
"active",
|
|
1855
2104
|
"waiting",
|
|
@@ -1857,20 +2106,20 @@ const It = [
|
|
|
1857
2106
|
"completed",
|
|
1858
2107
|
"failed"
|
|
1859
2108
|
];
|
|
1860
|
-
function
|
|
1861
|
-
switch (
|
|
2109
|
+
function hr(t, e = "ss-dbg-job-status") {
|
|
2110
|
+
switch (t) {
|
|
1862
2111
|
case "completed":
|
|
1863
2112
|
case "failed":
|
|
1864
2113
|
case "active":
|
|
1865
2114
|
case "waiting":
|
|
1866
2115
|
case "delayed":
|
|
1867
|
-
return `${
|
|
2116
|
+
return `${e}-${t}`;
|
|
1868
2117
|
default:
|
|
1869
2118
|
return "ss-dbg-badge-muted";
|
|
1870
2119
|
}
|
|
1871
2120
|
}
|
|
1872
|
-
function
|
|
1873
|
-
switch (
|
|
2121
|
+
function dr(t) {
|
|
2122
|
+
switch (t) {
|
|
1874
2123
|
case "active":
|
|
1875
2124
|
return "blue";
|
|
1876
2125
|
case "waiting":
|
|
@@ -1885,159 +2134,159 @@ function Bt(e) {
|
|
|
1885
2134
|
return "muted";
|
|
1886
2135
|
}
|
|
1887
2136
|
}
|
|
1888
|
-
function
|
|
1889
|
-
if (!
|
|
1890
|
-
if (Array.isArray(
|
|
1891
|
-
const
|
|
1892
|
-
return
|
|
2137
|
+
function fr(t) {
|
|
2138
|
+
if (!t) return [];
|
|
2139
|
+
if (Array.isArray(t)) return t;
|
|
2140
|
+
const e = t;
|
|
2141
|
+
return e.jobs || e.data || [];
|
|
1893
2142
|
}
|
|
1894
|
-
function
|
|
1895
|
-
if (!
|
|
1896
|
-
const
|
|
1897
|
-
return
|
|
2143
|
+
function pr(t) {
|
|
2144
|
+
if (!t || Array.isArray(t)) return null;
|
|
2145
|
+
const e = t;
|
|
2146
|
+
return e.stats || e.overview || null;
|
|
1898
2147
|
}
|
|
1899
|
-
function
|
|
1900
|
-
if (!
|
|
1901
|
-
if (typeof
|
|
2148
|
+
function qt(t) {
|
|
2149
|
+
if (!t) return [];
|
|
2150
|
+
if (typeof t == "string")
|
|
1902
2151
|
try {
|
|
1903
|
-
return JSON.parse(
|
|
2152
|
+
return JSON.parse(t);
|
|
1904
2153
|
} catch {
|
|
1905
2154
|
return [];
|
|
1906
2155
|
}
|
|
1907
|
-
return Array.isArray(
|
|
2156
|
+
return Array.isArray(t) ? t : [];
|
|
1908
2157
|
}
|
|
1909
|
-
function
|
|
1910
|
-
if (!
|
|
1911
|
-
if (typeof
|
|
2158
|
+
function Bt(t) {
|
|
2159
|
+
if (!t) return [];
|
|
2160
|
+
if (typeof t == "string")
|
|
1912
2161
|
try {
|
|
1913
|
-
return JSON.parse(
|
|
2162
|
+
return JSON.parse(t);
|
|
1914
2163
|
} catch {
|
|
1915
2164
|
return [];
|
|
1916
2165
|
}
|
|
1917
|
-
return Array.isArray(
|
|
2166
|
+
return Array.isArray(t) ? t : [];
|
|
1918
2167
|
}
|
|
1919
|
-
function
|
|
1920
|
-
return e
|
|
2168
|
+
function M(t, e, r, n = 0) {
|
|
2169
|
+
return t[e] ?? t[r] ?? n;
|
|
1921
2170
|
}
|
|
1922
|
-
function
|
|
2171
|
+
function mr(t) {
|
|
1923
2172
|
return {
|
|
1924
|
-
method:
|
|
1925
|
-
url:
|
|
1926
|
-
statusCode:
|
|
1927
|
-
totalDuration:
|
|
1928
|
-
spanCount:
|
|
1929
|
-
spans:
|
|
1930
|
-
warnings:
|
|
1931
|
-
logs:
|
|
1932
|
-
httpRequestId:
|
|
2173
|
+
method: t.method || "",
|
|
2174
|
+
url: t.url || "",
|
|
2175
|
+
statusCode: M(t, "status_code", "statusCode"),
|
|
2176
|
+
totalDuration: M(t, "total_duration", "totalDuration") || t.duration || 0,
|
|
2177
|
+
spanCount: M(t, "span_count", "spanCount"),
|
|
2178
|
+
spans: qt(t.spans),
|
|
2179
|
+
warnings: Bt(t.warnings),
|
|
2180
|
+
logs: t.logs || [],
|
|
2181
|
+
httpRequestId: t.httpRequestId || t.http_request_id || void 0
|
|
1933
2182
|
};
|
|
1934
2183
|
}
|
|
1935
|
-
const
|
|
1936
|
-
function
|
|
1937
|
-
const
|
|
1938
|
-
return
|
|
2184
|
+
const Kt = ["password", "secret", "token", "key", "credential", "auth"];
|
|
2185
|
+
function zt(t) {
|
|
2186
|
+
const e = t.toLowerCase();
|
|
2187
|
+
return Kt.some((r) => e.includes(r));
|
|
1939
2188
|
}
|
|
1940
|
-
function
|
|
1941
|
-
if (
|
|
1942
|
-
if (typeof
|
|
1943
|
-
return String(
|
|
1944
|
-
if (Array.isArray(
|
|
2189
|
+
function jt(t) {
|
|
2190
|
+
if (t == null) return "-";
|
|
2191
|
+
if (typeof t == "string" || typeof t == "number" || typeof t == "boolean")
|
|
2192
|
+
return String(t);
|
|
2193
|
+
if (Array.isArray(t)) return t.join(", ") || "-";
|
|
1945
2194
|
try {
|
|
1946
|
-
return JSON.stringify(
|
|
2195
|
+
return JSON.stringify(t);
|
|
1947
2196
|
} catch {
|
|
1948
|
-
return String(
|
|
2197
|
+
return String(t);
|
|
1949
2198
|
}
|
|
1950
2199
|
}
|
|
1951
|
-
const
|
|
2200
|
+
const Wt = {
|
|
1952
2201
|
collectionInterval: "Stats Collection",
|
|
1953
2202
|
dashboardBroadcast: "Dashboard Broadcast",
|
|
1954
2203
|
debugBroadcast: "Debug Broadcast",
|
|
1955
2204
|
persistFlush: "Persist Flush",
|
|
1956
2205
|
retentionCleanup: "Retention Cleanup"
|
|
1957
2206
|
};
|
|
1958
|
-
function
|
|
1959
|
-
return
|
|
2207
|
+
function gr(t) {
|
|
2208
|
+
return Wt[t] || t;
|
|
1960
2209
|
}
|
|
1961
|
-
const
|
|
2210
|
+
const Vt = {
|
|
1962
2211
|
prometheus: "Prometheus",
|
|
1963
2212
|
pinoHook: "Pino Log Hook",
|
|
1964
2213
|
edgePlugin: "Edge Plugin",
|
|
1965
2214
|
cacheInspector: "Cache Inspector",
|
|
1966
2215
|
queueInspector: "Queue Inspector"
|
|
1967
2216
|
};
|
|
1968
|
-
function
|
|
1969
|
-
return
|
|
2217
|
+
function yr(t) {
|
|
2218
|
+
return Vt[t] || t;
|
|
1970
2219
|
}
|
|
1971
|
-
function
|
|
1972
|
-
return "active" in
|
|
2220
|
+
function br(t) {
|
|
2221
|
+
return "active" in t ? t.active ? "active" : "inactive" : "available" in t ? t.available ? "available" : "unavailable" : "unknown";
|
|
1973
2222
|
}
|
|
1974
|
-
function
|
|
1975
|
-
return
|
|
2223
|
+
function xr(t, e) {
|
|
2224
|
+
return e.mode ? `Mode: ${e.mode}` : t === "edgePlugin" && e.active ? "@serverStats() tag registered" : t === "cacheInspector" ? e.available ? "Redis dependency detected" : "Redis not installed" : t === "queueInspector" ? e.available ? "Queue dependency detected" : "@rlanz/bull-queue not installed" : "-";
|
|
1976
2225
|
}
|
|
1977
|
-
function
|
|
1978
|
-
return Object.entries(
|
|
1979
|
-
key:
|
|
1980
|
-
value:
|
|
1981
|
-
secret:
|
|
2226
|
+
function Sr(t) {
|
|
2227
|
+
return Object.entries(t).map(([e, r]) => ({
|
|
2228
|
+
key: e,
|
|
2229
|
+
value: jt(r),
|
|
2230
|
+
secret: zt(e)
|
|
1982
2231
|
}));
|
|
1983
2232
|
}
|
|
1984
|
-
function
|
|
1985
|
-
return
|
|
2233
|
+
function wr(t, e) {
|
|
2234
|
+
return e ? Math.min(100, Math.round(t / e * 100)) : 0;
|
|
1986
2235
|
}
|
|
1987
|
-
const
|
|
1988
|
-
function
|
|
1989
|
-
return
|
|
2236
|
+
const Gt = ["healthy", "active", "connected", "available", "ready"], Qt = ["errored", "unavailable"];
|
|
2237
|
+
function vr(t) {
|
|
2238
|
+
return Gt.includes(t) ? "ok" : Qt.includes(t) ? "err" : "";
|
|
1990
2239
|
}
|
|
1991
|
-
function R(
|
|
1992
|
-
return
|
|
2240
|
+
function R(t) {
|
|
2241
|
+
return t !== null && typeof t == "object" && !Array.isArray(t) && t.__redacted === !0;
|
|
1993
2242
|
}
|
|
1994
|
-
function
|
|
1995
|
-
return
|
|
2243
|
+
function E(t) {
|
|
2244
|
+
return t != null && typeof t == "object" && !Array.isArray(t) && !R(t);
|
|
1996
2245
|
}
|
|
1997
|
-
function
|
|
1998
|
-
if (!
|
|
1999
|
-
return [{ path:
|
|
2246
|
+
function Jt(t, e = "") {
|
|
2247
|
+
if (!E(t))
|
|
2248
|
+
return [{ path: e, value: t }];
|
|
2000
2249
|
const r = [];
|
|
2001
|
-
for (const n of Object.keys(
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2250
|
+
for (const n of Object.keys(t)) {
|
|
2251
|
+
const o = e ? `${e}.${n}` : n, s = t[n];
|
|
2252
|
+
E(s) ? r.push(...Jt(s, o)) : r.push({ path: o, value: s });
|
|
2004
2253
|
}
|
|
2005
2254
|
return r;
|
|
2006
2255
|
}
|
|
2007
|
-
function
|
|
2008
|
-
return
|
|
2009
|
-
text: String(
|
|
2010
|
-
color:
|
|
2011
|
-
} : typeof
|
|
2256
|
+
function Cr(t) {
|
|
2257
|
+
return t == null ? { text: "null", color: "var(--ss-dim)" } : typeof t == "boolean" ? {
|
|
2258
|
+
text: String(t),
|
|
2259
|
+
color: t ? "var(--ss-green-fg)" : "var(--ss-red-fg)"
|
|
2260
|
+
} : typeof t == "number" ? { text: String(t), color: "var(--ss-amber-fg)" } : Array.isArray(t) ? { text: `[${t.map((r) => r == null ? "null" : typeof r == "object" ? JSON.stringify(r) : String(r)).join(", ")}]`, color: "var(--ss-purple-fg)" } : typeof t == "object" ? { text: JSON.stringify(t), color: "var(--ss-dim)" } : { text: String(t) };
|
|
2012
2261
|
}
|
|
2013
|
-
function
|
|
2014
|
-
if (
|
|
2262
|
+
function Yt(t) {
|
|
2263
|
+
if (t == null || typeof t != "object" || Array.isArray(t) || R(t))
|
|
2015
2264
|
return 1;
|
|
2016
|
-
let
|
|
2017
|
-
for (const r of Object.keys(
|
|
2018
|
-
|
|
2019
|
-
return
|
|
2265
|
+
let e = 0;
|
|
2266
|
+
for (const r of Object.keys(t))
|
|
2267
|
+
e += Yt(t[r]);
|
|
2268
|
+
return e;
|
|
2020
2269
|
}
|
|
2021
|
-
function
|
|
2022
|
-
if (!
|
|
2023
|
-
const
|
|
2024
|
-
for (const r of Object.keys(
|
|
2025
|
-
|
|
2026
|
-
return
|
|
2270
|
+
function Er(t) {
|
|
2271
|
+
if (!E(t)) return [];
|
|
2272
|
+
const e = [];
|
|
2273
|
+
for (const r of Object.keys(t))
|
|
2274
|
+
E(t[r]) && e.push(r);
|
|
2275
|
+
return e;
|
|
2027
2276
|
}
|
|
2028
|
-
function
|
|
2029
|
-
return !r ||
|
|
2277
|
+
function Tr(t, e, r) {
|
|
2278
|
+
return !r || t.toLowerCase().includes(r) ? !0 : (R(e) ? e.display : e == null ? "" : String(e)).toLowerCase().includes(r);
|
|
2030
2279
|
}
|
|
2031
|
-
function
|
|
2032
|
-
|
|
2033
|
-
const n =
|
|
2034
|
-
|
|
2035
|
-
|
|
2280
|
+
function kr(t, e, r) {
|
|
2281
|
+
e && navigator.clipboard.writeText(t).then(() => {
|
|
2282
|
+
const n = e.textContent;
|
|
2283
|
+
e.textContent = "✓", e.classList.add(`${r}-copy-row-ok`), setTimeout(() => {
|
|
2284
|
+
e.textContent = n, e.classList.remove(`${r}-copy-row-ok`);
|
|
2036
2285
|
}, 1200);
|
|
2037
2286
|
}).catch(() => {
|
|
2038
2287
|
});
|
|
2039
2288
|
}
|
|
2040
|
-
const
|
|
2289
|
+
const Xt = /* @__PURE__ */ new Set([
|
|
2041
2290
|
"secret",
|
|
2042
2291
|
"key",
|
|
2043
2292
|
"token",
|
|
@@ -2051,195 +2300,158 @@ const We = /* @__PURE__ */ new Set([
|
|
|
2051
2300
|
"private",
|
|
2052
2301
|
"encryption"
|
|
2053
2302
|
]);
|
|
2054
|
-
function
|
|
2055
|
-
const
|
|
2056
|
-
for (const n of
|
|
2057
|
-
const
|
|
2058
|
-
for (const
|
|
2059
|
-
|
|
2303
|
+
function Zt(t) {
|
|
2304
|
+
const e = t.split(/[._-]/), r = [];
|
|
2305
|
+
for (const n of e) {
|
|
2306
|
+
const o = n.split(new RegExp("(?<=[a-z])(?=[A-Z])"));
|
|
2307
|
+
for (const s of o)
|
|
2308
|
+
s && r.push(s);
|
|
2060
2309
|
}
|
|
2061
2310
|
return r;
|
|
2062
2311
|
}
|
|
2063
|
-
function
|
|
2064
|
-
return
|
|
2065
|
-
}
|
|
2066
|
-
const rr = new RegExp("secret|password|pass(?:word)?|pwd|token|(?:^|[._-])key(?:[._-]|$)|(?<=[a-z])Key|apikey|api_key|auth|credential|private|encryption", "i");
|
|
2067
|
-
function h(e, ...t) {
|
|
2068
|
-
for (const r of t) {
|
|
2069
|
-
const n = e[r];
|
|
2070
|
-
if (n != null) return n;
|
|
2071
|
-
}
|
|
2072
|
-
}
|
|
2073
|
-
function nr(e) {
|
|
2074
|
-
return h(e, "createdAt", "created_at", "timestamp");
|
|
2075
|
-
}
|
|
2076
|
-
function or(e) {
|
|
2077
|
-
return h(e, "timestamp", "createdAt", "processedAt", "created_at");
|
|
2078
|
-
}
|
|
2079
|
-
function sr(e) {
|
|
2080
|
-
return h(e, "statusCode", "status_code");
|
|
2081
|
-
}
|
|
2082
|
-
function ir(e) {
|
|
2083
|
-
return h(e, "total_duration", "totalDuration", "duration") ?? 0;
|
|
2084
|
-
}
|
|
2085
|
-
function ar(e) {
|
|
2086
|
-
return h(e, "span_count", "spanCount") ?? 0;
|
|
2087
|
-
}
|
|
2088
|
-
function cr(e) {
|
|
2089
|
-
return h(e, "warning_count", "warningCount") ?? 0;
|
|
2090
|
-
}
|
|
2091
|
-
function lr(e) {
|
|
2092
|
-
return h(e, "from_addr", "from") ?? "";
|
|
2093
|
-
}
|
|
2094
|
-
function ur(e) {
|
|
2095
|
-
return h(e, "to_addr", "to") ?? "";
|
|
2096
|
-
}
|
|
2097
|
-
function hr(e) {
|
|
2098
|
-
return h(e, "cc", "cc_addr") ?? "";
|
|
2099
|
-
}
|
|
2100
|
-
function dr(e) {
|
|
2101
|
-
return h(e, "attachment_count", "attachmentCount") ?? 0;
|
|
2102
|
-
}
|
|
2103
|
-
function fr(e) {
|
|
2104
|
-
return h(e, "event_name", "eventName", "event") ?? "";
|
|
2105
|
-
}
|
|
2106
|
-
function pr(e) {
|
|
2107
|
-
return h(e, "method", "sql_method") ?? "";
|
|
2108
|
-
}
|
|
2109
|
-
function gr(e) {
|
|
2110
|
-
return h(e, "sqlNormalized", "normalizedSql", "sql_normalized", "sql") ?? "";
|
|
2111
|
-
}
|
|
2112
|
-
function mr(e, t, r) {
|
|
2113
|
-
const n = e[t];
|
|
2114
|
-
return n != null && n !== 0 ? Number(n) : Number(e[r]) || 0;
|
|
2312
|
+
function Mr(t) {
|
|
2313
|
+
return Zt(t).some((r) => Xt.has(r.toLowerCase()));
|
|
2115
2314
|
}
|
|
2315
|
+
const Pr = new RegExp("secret|password|pass(?:word)?|pwd|token|(?:^|[._-])key(?:[._-]|$)|(?<=[a-z])Key|apikey|api_key|auth|credential|private|encryption", "i");
|
|
2116
2316
|
export {
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2317
|
+
T as ApiClient,
|
|
2318
|
+
j as ApiError,
|
|
2319
|
+
kt as DASHBOARD_SECTION_PATHS,
|
|
2320
|
+
nt as DEBUG_REFRESH_MS,
|
|
2321
|
+
Et as DEBUG_TAB_PATHS,
|
|
2322
|
+
St as DEFAULT_FEATURES,
|
|
2323
|
+
q as DEFAULT_PER_PAGE,
|
|
2324
|
+
At as DashboardApi,
|
|
2325
|
+
Ae as DashboardDataController,
|
|
2326
|
+
De as DebugDataController,
|
|
2327
|
+
Qt as ERROR_STATUSES,
|
|
2328
|
+
Vt as INTEGRATION_LABELS,
|
|
2329
|
+
ur as JOB_STATUS_FILTERS,
|
|
2330
|
+
Fe as LOG_LEVELS,
|
|
2331
|
+
ot as MAX_HISTORY,
|
|
2132
2332
|
$ as METRIC_DEFINITIONS,
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2333
|
+
Gt as OK_STATUSES,
|
|
2334
|
+
et as OVERVIEW_REFRESH_MS,
|
|
2335
|
+
cr as QueriesController,
|
|
2336
|
+
Pr as REDACT_PATTERN,
|
|
2337
|
+
rt as SECTION_REFRESH_MS,
|
|
2338
|
+
N as SLOW_DURATION_MS,
|
|
2339
|
+
it as STALE_MS,
|
|
2340
|
+
Pe as ServerStatsController,
|
|
2341
|
+
$e as TAB_ICONS,
|
|
2342
|
+
ft as THRESHOLD_CSS_CLASS,
|
|
2343
|
+
ue as THRESHOLD_CSS_VAR,
|
|
2344
|
+
ce as THRESHOLD_HEX_FALLBACK,
|
|
2345
|
+
Wt as TIMER_LABELS,
|
|
2346
|
+
w as UnauthorizedError,
|
|
2347
|
+
st as VERY_SLOW_DURATION_MS,
|
|
2348
|
+
gt as buildQueryParams,
|
|
2349
|
+
ge as buildQueryString,
|
|
2350
|
+
se as buildSparklineData,
|
|
2351
|
+
Ot as buildSqlCounts,
|
|
2352
|
+
vr as classifyStatus,
|
|
2353
|
+
Er as collectTopLevelObjectKeys,
|
|
2354
|
+
U as compactPreview,
|
|
2355
|
+
er as computeDashboardQuerySummary,
|
|
2356
|
+
we as computePagination,
|
|
2357
|
+
tr as computeQuerySummary,
|
|
2358
|
+
tt as computeStats,
|
|
2359
|
+
kr as copyWithFeedback,
|
|
2360
|
+
Ze as countDuplicateQueries,
|
|
2361
|
+
Yt as countLeaves,
|
|
2362
|
+
xe as createFilterState,
|
|
2363
|
+
Pt as createHistoryBuffer,
|
|
2364
|
+
be as createPaginationState,
|
|
2365
|
+
Se as createSortState,
|
|
2366
|
+
G as createTransmitSubscription,
|
|
2367
|
+
Ce as detectFeatures,
|
|
2368
|
+
Te as detectMetricGroupsFromStats,
|
|
2369
|
+
de as durationClassName,
|
|
2370
|
+
pt as durationSeverity,
|
|
2371
|
+
pr as extractJobStats,
|
|
2372
|
+
fr as extractJobs,
|
|
2373
|
+
vt as fetchFeatures,
|
|
2374
|
+
wr as fillPercent,
|
|
2375
|
+
Ne as filterLogsByLevel,
|
|
2376
|
+
Xe as filterQueries,
|
|
2377
|
+
Jt as flattenConfig,
|
|
2378
|
+
Ht as flattenPlanTree,
|
|
2175
2379
|
A as formatBytes,
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2380
|
+
me as formatCacheSize,
|
|
2381
|
+
or as formatCellValue,
|
|
2382
|
+
Sr as formatCollectorConfig,
|
|
2383
|
+
jt as formatConfigVal,
|
|
2384
|
+
ht as formatCount,
|
|
2385
|
+
oe as formatDuration,
|
|
2386
|
+
Cr as formatFlatValue,
|
|
2387
|
+
D as formatMb,
|
|
2388
|
+
Nt as formatPlanNodeMetrics,
|
|
2389
|
+
le as formatStatNum,
|
|
2390
|
+
ie as formatTime,
|
|
2391
|
+
pe as formatTtl,
|
|
2392
|
+
ut as formatUptime,
|
|
2393
|
+
Z as generateGradientId,
|
|
2394
|
+
ne as generateSparklinePath,
|
|
2395
|
+
re as generateSparklinePoints,
|
|
2396
|
+
lr as getDashboardGroupedColumns,
|
|
2397
|
+
ar as getDashboardListColumns,
|
|
2398
|
+
Mt as getDashboardSectionPath,
|
|
2399
|
+
ir as getDebugPaneColumns,
|
|
2400
|
+
Tt as getDebugTabPath,
|
|
2401
|
+
sr as getExplainColumns,
|
|
2402
|
+
xr as getIntegrationDetails,
|
|
2403
|
+
yr as getIntegrationLabel,
|
|
2404
|
+
br as getIntegrationStatus,
|
|
2405
|
+
dr as getJobStatusBadgeColor,
|
|
2406
|
+
hr as getJobStatusCssClass,
|
|
2407
|
+
Oe as getLogLevelCssClass,
|
|
2408
|
+
ke as getMetricById,
|
|
2409
|
+
Me as getMetricsByGroup,
|
|
2410
|
+
ve as getPageNumbers,
|
|
2411
|
+
F as getRatioColor,
|
|
2412
|
+
He as getStructuredData,
|
|
2413
|
+
O as getTheme,
|
|
2414
|
+
v as getThresholdColor,
|
|
2415
|
+
dt as getThresholdColorInverse,
|
|
2416
|
+
gr as getTimerLabel,
|
|
2417
|
+
Ee as getVisibleMetricGroups,
|
|
2418
|
+
nr as hasNestedPlan,
|
|
2419
|
+
Re as initResizableColumns,
|
|
2420
|
+
Le as initSplitPane,
|
|
2210
2421
|
R as isRedactedValue,
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2422
|
+
zt as isSecretKey,
|
|
2423
|
+
Tr as matchesConfigSearch,
|
|
2424
|
+
rr as normalizeDashboardQuery,
|
|
2425
|
+
mr as normalizeTraceFields,
|
|
2426
|
+
ee as onThemeChange,
|
|
2427
|
+
ye as parsePaginatedResponse,
|
|
2428
|
+
qt as parseTraceSpans,
|
|
2429
|
+
Bt as parseTraceWarnings,
|
|
2430
|
+
Qe as resolveAttachmentCount,
|
|
2431
|
+
Ge as resolveCcAddr,
|
|
2432
|
+
Ke as resolveDuration,
|
|
2433
|
+
Je as resolveEventName,
|
|
2434
|
+
u as resolveField,
|
|
2435
|
+
We as resolveFromAddr,
|
|
2436
|
+
qe as resolveJobTimestamp,
|
|
2437
|
+
Ft as resolveLogLevel,
|
|
2438
|
+
Ue as resolveLogMessage,
|
|
2439
|
+
Ie as resolveLogRequestId,
|
|
2440
|
+
_e as resolveLogTimestamp,
|
|
2441
|
+
Ye as resolveMetric,
|
|
2442
|
+
K as resolveNormalizedSql,
|
|
2443
|
+
ze as resolveSpanCount,
|
|
2444
|
+
It as resolveSqlMethod,
|
|
2445
|
+
Be as resolveStatusCode,
|
|
2446
|
+
_t as resolveTimestamp,
|
|
2447
|
+
Ve as resolveToAddr,
|
|
2448
|
+
M as resolveTraceField,
|
|
2449
|
+
je as resolveWarningCount,
|
|
2450
|
+
J as setTheme,
|
|
2451
|
+
fe as shortReqId,
|
|
2452
|
+
Mr as shouldRedact,
|
|
2453
|
+
he as statusColor,
|
|
2454
|
+
Q as subscribeToChannel,
|
|
2455
|
+
ae as timeAgo,
|
|
2456
|
+
te as toggleTheme
|
|
2245
2457
|
};
|