adonisjs-server-stats 1.6.13 → 1.8.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 +24 -8
- package/dist/core/index.js +248 -245
- package/dist/react/{CacheSection-DGxMDlWK.js → CacheSection-D5J5moz7.js} +1 -1
- package/dist/react/{CacheTab-CnVW5PLs.js → CacheTab-F1MkWSZl.js} +1 -1
- package/dist/react/{ConfigSection-DPcrfqXY.js → ConfigSection-DerLBu4o.js} +1 -1
- package/dist/react/{ConfigTab-BSWq_o2p.js → ConfigTab-Bsj7v9JW.js} +1 -1
- package/dist/react/{CustomPaneTab-xjkYwTvH.js → CustomPaneTab-gzdtDEvz.js} +1 -1
- package/dist/react/{EmailsSection-CSyTg1aX.js → EmailsSection-ndH3cvJk.js} +1 -1
- package/dist/react/{EmailsTab-Dh2YSa_f.js → EmailsTab-DVPHRx0L.js} +44 -22
- package/dist/react/{EventsSection-C1pbJDfW.js → EventsSection-ClIByDSk.js} +1 -1
- package/dist/react/{EventsTab-eCh02cdd.js → EventsTab-CCzWEKrk.js} +1 -1
- package/dist/react/{JobsSection-CLAin5vU.js → JobsSection-CVMyAs7O.js} +1 -1
- package/dist/react/{JobsTab-Dl5nrj2z.js → JobsTab-CATUyb9V.js} +1 -1
- package/dist/react/{LogsSection-C1p81fXO.js → LogsSection-hAsLaKOC.js} +1 -1
- package/dist/react/{LogsTab-D-kR7PjX.js → LogsTab-QouH4NPQ.js} +1 -1
- package/dist/react/{OverviewSection-nm3xdACz.js → OverviewSection-ae5AO2RG.js} +1 -1
- package/dist/react/{QueriesSection-DB12HMfQ.js → QueriesSection-DFFr9Tbb.js} +1 -1
- package/dist/react/{QueriesTab-fyBB1u_Y.js → QueriesTab-GrHRAREt.js} +1 -1
- package/dist/react/{RequestsSection-DTqB81ac.js → RequestsSection-DtwnJOnM.js} +1 -1
- package/dist/react/{RoutesSection-DJWa4NPV.js → RoutesSection-F7nANhF0.js} +1 -1
- package/dist/react/{RoutesTab-D3l8TOpu.js → RoutesTab-rugjhCPH.js} +1 -1
- package/dist/react/{TimelineSection-C4d-jRX1.js → TimelineSection-F5ThmTdy.js} +1 -1
- package/dist/react/{TimelineTab-C5TFaSmQ.js → TimelineTab-Dvpf-I5C.js} +1 -1
- package/dist/react/{index-UdTfSvtO.js → index-DDzo1bZk.js} +2 -2
- package/dist/react/index.js +1 -1
- package/dist/react/style.css +1 -1
- package/dist/src/controller/debug_controller.js +10 -9
- package/dist/src/dashboard/dashboard_store.js +10 -6
- package/dist/src/data/data_access.js +14 -2
- package/dist/src/debug/email_collector.d.ts +11 -1
- package/dist/src/debug/email_collector.js +32 -2
- package/dist/src/debug/event_collector.js +1 -1
- package/dist/src/debug/query_collector.js +1 -1
- package/dist/src/debug/trace_collector.js +1 -1
- package/dist/src/debug/types.d.ts +1 -1
- package/dist/src/edge/client/dashboard.js +2 -2
- package/dist/src/edge/client/debug-panel-deferred.js +1 -1
- package/dist/src/edge/client-vue/dashboard.js +4 -4
- package/dist/src/edge/client-vue/debug-panel-deferred.js +3 -3
- package/dist/src/provider/server_stats_provider.d.ts +31 -0
- package/dist/src/provider/server_stats_provider.js +244 -5
- package/dist/src/routes/register_routes.js +2 -2
- package/dist/src/styles/components.css +3 -0
- package/dist/vue/{CacheSection-C788Yfai.js → CacheSection-DDvJ7bs2.js} +1 -1
- package/dist/vue/{ConfigSection-CRzYxqW2.js → ConfigSection-GTCrvsPr.js} +1 -1
- package/dist/vue/{EmailsSection-C8JFMtW7.js → EmailsSection-Ct5vsLCc.js} +1 -1
- package/dist/vue/EmailsTab-CNyEODVB.js +177 -0
- package/dist/vue/{EventsSection-C4wXUgxG.js → EventsSection-CRVhtagq.js} +1 -1
- package/dist/vue/{JobsSection-CsKWTjgN.js → JobsSection-B_wH2Co7.js} +1 -1
- package/dist/vue/{LogsSection-BFVjSZ24.js → LogsSection-C4NRFOpA.js} +1 -1
- package/dist/vue/{OverviewSection-CbMdAido.js → OverviewSection-BqSwuMKH.js} +1 -1
- package/dist/vue/{QueriesSection-BPiv7u3r.js → QueriesSection-D4Fs0YH6.js} +1 -1
- package/dist/vue/{RequestsSection-LtImH4rD.js → RequestsSection-B0A5SKcM.js} +1 -1
- package/dist/vue/{RoutesSection-CrxOxmzx.js → RoutesSection-Ys5dTzvF.js} +1 -1
- package/dist/vue/{TimelineSection-DLxMW2J_.js → TimelineSection-D38iHB08.js} +1 -1
- package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts +2 -0
- package/dist/vue/{index-qCQpBftQ.js → index-Bj6pm5g3.js} +56 -54
- package/dist/vue/index.js +1 -1
- package/dist/vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/vue/EmailsTab-DhFhoNmU.js +0 -157
package/dist/core/index.js
CHANGED
|
@@ -4,7 +4,7 @@ class w extends Error {
|
|
|
4
4
|
super(`Unauthorized (HTTP ${t})`), this.name = "UnauthorizedError", this.status = t;
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
|
-
class
|
|
7
|
+
class _ extends Error {
|
|
8
8
|
status;
|
|
9
9
|
body;
|
|
10
10
|
constructor(t, r) {
|
|
@@ -42,7 +42,7 @@ class T {
|
|
|
42
42
|
throw new w(s.status);
|
|
43
43
|
if (!s.ok) {
|
|
44
44
|
const o = await s.text().catch(() => "");
|
|
45
|
-
throw new
|
|
45
|
+
throw new _(s.status, o);
|
|
46
46
|
}
|
|
47
47
|
return s.json();
|
|
48
48
|
}
|
|
@@ -84,7 +84,7 @@ class T {
|
|
|
84
84
|
return this.fetch(t, { method: "DELETE" });
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
async function
|
|
87
|
+
async function B() {
|
|
88
88
|
if (typeof window < "u" && window.Transmit && typeof window.Transmit == "function")
|
|
89
89
|
return window.Transmit;
|
|
90
90
|
try {
|
|
@@ -94,11 +94,11 @@ async function _() {
|
|
|
94
94
|
return null;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function H(e) {
|
|
98
98
|
let t = null, r = null, n = !1;
|
|
99
99
|
return { subscribe: async () => {
|
|
100
100
|
try {
|
|
101
|
-
const o = await
|
|
101
|
+
const o = await B();
|
|
102
102
|
if (!o)
|
|
103
103
|
throw new Error(
|
|
104
104
|
"Transmit client not available (neither window.Transmit nor @adonisjs/transmit-client)"
|
|
@@ -136,9 +136,9 @@ function B(e) {
|
|
|
136
136
|
}
|
|
137
137
|
} };
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function N(e) {
|
|
140
140
|
let t = !1;
|
|
141
|
-
const r =
|
|
141
|
+
const r = H({
|
|
142
142
|
baseUrl: e.baseUrl,
|
|
143
143
|
channelName: e.channelName,
|
|
144
144
|
authToken: e.authToken,
|
|
@@ -164,14 +164,14 @@ function U() {
|
|
|
164
164
|
const e = localStorage.getItem(v);
|
|
165
165
|
return e === "dark" || e === "light" ? e : window.matchMedia?.("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function q(e) {
|
|
168
168
|
typeof window > "u" || (localStorage.setItem(v, e), window.dispatchEvent(new CustomEvent(M, { detail: e })));
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function Ae() {
|
|
171
171
|
const t = U() === "dark" ? "light" : "dark";
|
|
172
|
-
return
|
|
172
|
+
return q(t), t;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
174
|
+
function Le(e) {
|
|
175
175
|
if (typeof window > "u") return () => {
|
|
176
176
|
};
|
|
177
177
|
const t = (s) => {
|
|
@@ -198,10 +198,10 @@ const y = {
|
|
|
198
198
|
height: 32,
|
|
199
199
|
padding: 2
|
|
200
200
|
};
|
|
201
|
-
function
|
|
201
|
+
function K(e) {
|
|
202
202
|
return { ...y, ...e };
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function Re(e, t = y.width, r = y.height, n = y.padding) {
|
|
205
205
|
if (e.length < 2) return null;
|
|
206
206
|
const i = t - n * 2, s = r - n * 2, o = Math.min(...e), a = Math.max(...e) - o || 1;
|
|
207
207
|
return e.map((m, d) => {
|
|
@@ -209,7 +209,7 @@ function Le(e, t = y.width, r = y.height, n = y.padding) {
|
|
|
209
209
|
return `${f.toFixed(1)},${p.toFixed(1)}`;
|
|
210
210
|
}).join(" ");
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function Ue(e, t = y.width, r = y.height, n = y.padding) {
|
|
213
213
|
if (e.length < 2) return null;
|
|
214
214
|
const i = t - n * 2, s = r - n * 2, o = Math.min(...e), a = Math.max(...e) - o || 1, h = e.map((p, x) => {
|
|
215
215
|
const u = n + x / (e.length - 1) * i, E = n + s - (p - o) / a * s;
|
|
@@ -217,11 +217,11 @@ function Re(e, t = y.width, r = y.height, n = y.padding) {
|
|
|
217
217
|
}), m = (n + i).toFixed(1), d = (n + s).toFixed(1), f = n.toFixed(1);
|
|
218
218
|
return `M${h[0]} ` + h.slice(1).map((p) => `L${p}`).join(" ") + ` L${m},${d} L${f},${d} Z`;
|
|
219
219
|
}
|
|
220
|
-
let
|
|
221
|
-
function
|
|
222
|
-
return `ss-grad-${
|
|
220
|
+
let z = 0;
|
|
221
|
+
function W() {
|
|
222
|
+
return `ss-grad-${z++}`;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function V(e) {
|
|
225
225
|
if (e.length === 0) return null;
|
|
226
226
|
let t = e[0], r = e[0], n = e[0];
|
|
227
227
|
for (let i = 1; i < e.length; i++) {
|
|
@@ -230,24 +230,24 @@ function W(e) {
|
|
|
230
230
|
}
|
|
231
231
|
return { min: t, max: r, avg: n / e.length };
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function De(e, t) {
|
|
234
234
|
if (e.length < 2) return null;
|
|
235
|
-
const r =
|
|
235
|
+
const r = K(t), n = V(e), i = n.max - n.min || 1, s = r.width - r.padding * 2, o = r.height - r.padding * 2, l = r.padding, a = e.length, h = Array.from({ length: a });
|
|
236
236
|
for (let u = 0; u < a; u++) {
|
|
237
|
-
const E = l + u / (a - 1) * s,
|
|
238
|
-
h[u] = `${E.toFixed(1)},${
|
|
237
|
+
const E = l + u / (a - 1) * s, I = l + o - (e[u] - n.min) / i * o;
|
|
238
|
+
h[u] = `${E.toFixed(1)},${I.toFixed(1)}`;
|
|
239
239
|
}
|
|
240
240
|
const m = h.join(" "), d = (l + s).toFixed(1), f = (l + o).toFixed(1), p = l.toFixed(1), x = `M${h[0]} ` + h.slice(1).map((u) => `L${u}`).join(" ") + ` L${d},${f} L${p},${f} Z`;
|
|
241
241
|
return {
|
|
242
242
|
points: m,
|
|
243
243
|
areaPath: x,
|
|
244
|
-
gradientId:
|
|
244
|
+
gradientId: W(),
|
|
245
245
|
options: r,
|
|
246
246
|
stats: n
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
|
-
const
|
|
250
|
-
function
|
|
249
|
+
const j = 5e3, G = 1e4, J = 3e3, Q = 100, X = 500;
|
|
250
|
+
function Y(e) {
|
|
251
251
|
if (!e && e !== 0) return "-";
|
|
252
252
|
const t = Math.floor(e), r = Math.floor(t / 86400), n = Math.floor(t % 86400 / 3600), i = Math.floor(t % 3600 / 60);
|
|
253
253
|
return r > 0 ? `${r}d ${n}h` : n > 0 ? `${n}h ${i}m` : i > 0 ? `${i}m ${t % 60}s` : `${t}s`;
|
|
@@ -259,15 +259,18 @@ function P(e) {
|
|
|
259
259
|
function $(e) {
|
|
260
260
|
return e >= 1024 ? `${(e / 1024).toFixed(1)}G` : `${e.toFixed(1)}M`;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function Z(e) {
|
|
263
263
|
return e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}K` : `${e}`;
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function Fe(e) {
|
|
266
266
|
return e >= 1e3 ? `${(e / 1e3).toFixed(2)}s` : e >= 1 ? `${e.toFixed(0)}ms` : `${e.toFixed(2)}ms`;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function D(e) {
|
|
269
|
+
return /([+-]\d{2}:?\d{2}|Z)\s*$/.test(e) ? e : e + "Z";
|
|
270
|
+
}
|
|
271
|
+
function Oe(e) {
|
|
269
272
|
if (!e) return "-";
|
|
270
|
-
const t = typeof e == "string" ? new Date(e) : new Date(e);
|
|
273
|
+
const t = typeof e == "string" ? new Date(D(e)) : new Date(e);
|
|
271
274
|
return Number.isNaN(t.getTime()) ? "-" : t.toLocaleTimeString("en-US", {
|
|
272
275
|
hour12: !1,
|
|
273
276
|
hour: "2-digit",
|
|
@@ -275,12 +278,12 @@ function Fe(e) {
|
|
|
275
278
|
second: "2-digit"
|
|
276
279
|
}) + "." + String(t.getMilliseconds()).padStart(3, "0");
|
|
277
280
|
}
|
|
278
|
-
function
|
|
281
|
+
function Ie(e) {
|
|
279
282
|
if (!e) return "-";
|
|
280
|
-
const t = typeof e == "string" ? new Date(e).getTime() : e, r = Math.floor((Date.now() - t) / 1e3);
|
|
283
|
+
const t = typeof e == "string" ? new Date(D(e)).getTime() : e, r = Math.floor((Date.now() - t) / 1e3);
|
|
281
284
|
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`;
|
|
282
285
|
}
|
|
283
|
-
function
|
|
286
|
+
function _e(e, t) {
|
|
284
287
|
switch (t) {
|
|
285
288
|
case "%":
|
|
286
289
|
return `${e.toFixed(1)}%`;
|
|
@@ -300,7 +303,7 @@ function Ie(e, t) {
|
|
|
300
303
|
function S(e, t, r) {
|
|
301
304
|
return e > r ? "red" : e > t ? "amber" : "green";
|
|
302
305
|
}
|
|
303
|
-
function
|
|
306
|
+
function ee(e, t, r) {
|
|
304
307
|
return e < r ? "red" : e < t ? "amber" : "green";
|
|
305
308
|
}
|
|
306
309
|
function A(e, t) {
|
|
@@ -308,26 +311,26 @@ function A(e, t) {
|
|
|
308
311
|
const r = e / t;
|
|
309
312
|
return r > 0.8 ? "red" : r > 0.5 ? "amber" : "green";
|
|
310
313
|
}
|
|
311
|
-
const
|
|
314
|
+
const te = {
|
|
312
315
|
green: "ss-green",
|
|
313
316
|
amber: "ss-amber",
|
|
314
317
|
red: "ss-red"
|
|
315
|
-
},
|
|
318
|
+
}, Be = {
|
|
316
319
|
green: "#34d399",
|
|
317
320
|
amber: "#fbbf24",
|
|
318
321
|
red: "#f87171"
|
|
319
|
-
},
|
|
322
|
+
}, He = {
|
|
320
323
|
green: "--ss-accent",
|
|
321
324
|
amber: "--ss-amber-fg",
|
|
322
325
|
red: "--ss-red-fg"
|
|
323
326
|
};
|
|
324
|
-
function He(e) {
|
|
325
|
-
return e >= 500 ? "red" : e >= 400 ? "amber" : "green";
|
|
326
|
-
}
|
|
327
327
|
function Ne(e) {
|
|
328
|
-
return e
|
|
328
|
+
return e >= 500 ? "red" : e >= 400 ? "amber" : "green";
|
|
329
329
|
}
|
|
330
330
|
function qe(e) {
|
|
331
|
+
return e > X ? "very-slow" : e > Q ? "slow" : "normal";
|
|
332
|
+
}
|
|
333
|
+
function Ke(e) {
|
|
331
334
|
return e ? e.length <= 8 ? e : e.slice(0, 8) + "…" : "--";
|
|
332
335
|
}
|
|
333
336
|
function L(e, t = 100) {
|
|
@@ -352,14 +355,14 @@ function L(e, t = 100) {
|
|
|
352
355
|
}
|
|
353
356
|
return String(e);
|
|
354
357
|
}
|
|
355
|
-
function
|
|
358
|
+
function ze(e) {
|
|
356
359
|
return e < 0 ? "no expiry" : e < 60 ? `${e}s` : e < 3600 ? `${Math.floor(e / 60)}m` : e < 86400 ? `${Math.floor(e / 3600)}h` : `${Math.floor(e / 86400)}d`;
|
|
357
360
|
}
|
|
358
|
-
function
|
|
361
|
+
function We(e) {
|
|
359
362
|
return e < 1024 ? `${e}B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)}KB` : `${(e / (1024 * 1024)).toFixed(1)}MB`;
|
|
360
363
|
}
|
|
361
|
-
const
|
|
362
|
-
function
|
|
364
|
+
const F = 50;
|
|
365
|
+
function Ve(e, t, r) {
|
|
363
366
|
const n = new URLSearchParams();
|
|
364
367
|
if (n.set("page", String(e.page)), n.set("perPage", String(e.perPage)), t) {
|
|
365
368
|
t.search && n.set("search", t.search);
|
|
@@ -368,7 +371,7 @@ function We(e, t, r) {
|
|
|
368
371
|
}
|
|
369
372
|
return r && (n.set("sort", r.field), n.set("direction", r.direction)), n.toString();
|
|
370
373
|
}
|
|
371
|
-
function
|
|
374
|
+
function je(e, t = F) {
|
|
372
375
|
const r = e.data ?? e.items ?? [], n = e.total ?? 0, i = e.page ?? 1, s = e.perPage ?? e.limit ?? t, o = e.totalPages ?? (Math.ceil(n / s) || 1);
|
|
373
376
|
return {
|
|
374
377
|
data: r,
|
|
@@ -380,7 +383,7 @@ function Ve(e, t = D) {
|
|
|
380
383
|
}
|
|
381
384
|
};
|
|
382
385
|
}
|
|
383
|
-
function
|
|
386
|
+
function Ge(e = F) {
|
|
384
387
|
return {
|
|
385
388
|
page: 1,
|
|
386
389
|
perPage: e,
|
|
@@ -388,23 +391,23 @@ function je(e = D) {
|
|
|
388
391
|
totalPages: 1
|
|
389
392
|
};
|
|
390
393
|
}
|
|
391
|
-
function
|
|
394
|
+
function Je() {
|
|
392
395
|
return {
|
|
393
396
|
search: "",
|
|
394
397
|
filters: {}
|
|
395
398
|
};
|
|
396
399
|
}
|
|
397
|
-
function
|
|
400
|
+
function Qe(e = "id", t = "desc") {
|
|
398
401
|
return { field: e, direction: t };
|
|
399
402
|
}
|
|
400
|
-
function
|
|
403
|
+
function re(e) {
|
|
401
404
|
const t = new URLSearchParams();
|
|
402
405
|
if (e.page !== null && e.page !== void 0 && t.set("page", String(e.page)), e.perPage !== null && e.perPage !== void 0 && t.set("perPage", String(e.perPage)), e.search && t.set("search", e.search), e.sort && t.set("sort", e.sort), e.sortDir && t.set("direction", e.sortDir), e.timeRange && t.set("range", e.timeRange), e.filters)
|
|
403
406
|
for (const [r, n] of Object.entries(e.filters))
|
|
404
407
|
n && t.set(r, n);
|
|
405
408
|
return t.toString();
|
|
406
409
|
}
|
|
407
|
-
function
|
|
410
|
+
function Xe(e) {
|
|
408
411
|
const t = Math.max(1, Math.ceil(e.total / e.perPage)), r = Math.min(e.page, t), n = e.total === 0 ? 0 : (r - 1) * e.perPage + 1, i = Math.min(r * e.perPage, e.total);
|
|
409
412
|
return {
|
|
410
413
|
page: r,
|
|
@@ -417,7 +420,7 @@ function Qe(e) {
|
|
|
417
420
|
hasNext: r < t
|
|
418
421
|
};
|
|
419
422
|
}
|
|
420
|
-
function
|
|
423
|
+
function Ye(e, t, r = 2) {
|
|
421
424
|
if (t <= 1) return [1];
|
|
422
425
|
const n = [], i = Math.max(2, e - r), s = Math.min(t - 1, e + r);
|
|
423
426
|
n.push(1), i > 2 && n.push("...");
|
|
@@ -425,7 +428,7 @@ function Xe(e, t, r = 2) {
|
|
|
425
428
|
n.push(o);
|
|
426
429
|
return s < t - 1 && n.push("..."), t > 1 && n.push(t), n;
|
|
427
430
|
}
|
|
428
|
-
const
|
|
431
|
+
const O = "/admin/api/debug", ne = {
|
|
429
432
|
tracing: !1,
|
|
430
433
|
process: !1,
|
|
431
434
|
system: !1,
|
|
@@ -440,7 +443,7 @@ const F = "/admin/api/debug", re = {
|
|
|
440
443
|
dashboard: !1,
|
|
441
444
|
customPanes: []
|
|
442
445
|
};
|
|
443
|
-
function
|
|
446
|
+
function se(e) {
|
|
444
447
|
return {
|
|
445
448
|
tracing: e.features?.tracing ?? !1,
|
|
446
449
|
process: e.features?.process ?? !1,
|
|
@@ -457,35 +460,35 @@ function ne(e) {
|
|
|
457
460
|
customPanes: e.customPanes ?? []
|
|
458
461
|
};
|
|
459
462
|
}
|
|
460
|
-
async function
|
|
463
|
+
async function ie(e, t = O) {
|
|
461
464
|
const r = `${t.replace(/\/+$/, "")}/config`;
|
|
462
465
|
return e.fetch(r);
|
|
463
466
|
}
|
|
464
|
-
async function
|
|
465
|
-
const { baseUrl: t = "", debugEndpoint: r =
|
|
467
|
+
async function Ze(e) {
|
|
468
|
+
const { baseUrl: t = "", debugEndpoint: r = O, authToken: n } = e, i = new T({ baseUrl: t, authToken: n });
|
|
466
469
|
try {
|
|
467
|
-
const s = await
|
|
468
|
-
return
|
|
470
|
+
const s = await ie(i, r);
|
|
471
|
+
return se(s);
|
|
469
472
|
} catch {
|
|
470
|
-
return
|
|
473
|
+
return ne;
|
|
471
474
|
}
|
|
472
475
|
}
|
|
473
|
-
function
|
|
476
|
+
function et(e) {
|
|
474
477
|
const t = /* @__PURE__ */ new Set(), r = "features" in e && typeof e.features == "object" && e.features !== null ? e.features : e;
|
|
475
478
|
return "process" in r && r.process && t.add("process"), ("process" in r && r.process || "system" in r && r.system) && t.add("memory"), "http" in r && r.http && t.add("http"), "db" in r && r.db && t.add("db"), "redis" in r && r.redis && t.add("redis"), "queues" in r && r.queues && t.add("queue"), "app" in r && r.app && t.add("app"), "log" in r && r.log && t.add("log"), t;
|
|
476
479
|
}
|
|
477
|
-
function
|
|
480
|
+
function tt(e) {
|
|
478
481
|
const t = /* @__PURE__ */ new Set();
|
|
479
|
-
return (c(e.cpuPercent) || c(e.uptime) ||
|
|
482
|
+
return (c(e.cpuPercent) || c(e.uptime) || oe(e.nodeVersion)) && t.add("process"), (c(e.memHeapUsed) || c(e.memRss)) && t.add("memory"), (c(e.systemMemoryTotalMb) || c(e.systemMemoryFreeMb)) && t.add("memory"), (c(e.requestsPerSecond) || c(e.avgResponseTimeMs) || c(e.errorRate) || c(e.activeHttpConnections)) && t.add("http"), (c(e.dbPoolMax) || c(e.dbPoolUsed) || c(e.dbPoolFree) || c(e.dbPoolPending)) && t.add("db"), e.redisOk !== void 0 && e.redisOk !== null && t.add("redis"), (c(e.queueActive) || c(e.queueWaiting) || c(e.queueWorkerCount)) && t.add("queue"), (c(e.onlineUsers) || c(e.pendingWebhooks) || c(e.pendingEmails)) && t.add("app"), (c(e.logErrorsLast5m) || c(e.logEntriesPerMinute)) && t.add("log"), t;
|
|
480
483
|
}
|
|
481
484
|
function c(e) {
|
|
482
485
|
return typeof e == "number" && !Number.isNaN(e);
|
|
483
486
|
}
|
|
484
|
-
function
|
|
487
|
+
function oe(e) {
|
|
485
488
|
return typeof e == "string" && e.length > 0;
|
|
486
489
|
}
|
|
487
490
|
function g(e) {
|
|
488
|
-
return
|
|
491
|
+
return te[e] || "";
|
|
489
492
|
}
|
|
490
493
|
const k = [
|
|
491
494
|
// ── Process group ─────────────────────────────────────────────────────────
|
|
@@ -508,7 +511,7 @@ const k = [
|
|
|
508
511
|
unit: "",
|
|
509
512
|
group: "process",
|
|
510
513
|
extract: (e) => e.uptime,
|
|
511
|
-
format: (e) =>
|
|
514
|
+
format: (e) => Y(e.uptime),
|
|
512
515
|
color: () => ""
|
|
513
516
|
},
|
|
514
517
|
// -- CPU ------------------------------------------------------------------
|
|
@@ -681,7 +684,7 @@ const k = [
|
|
|
681
684
|
unit: "",
|
|
682
685
|
group: "redis",
|
|
683
686
|
extract: (e) => e.redisKeysCount,
|
|
684
|
-
format: (e) =>
|
|
687
|
+
format: (e) => Z(e.redisKeysCount),
|
|
685
688
|
color: () => "",
|
|
686
689
|
historyKey: "redisKeysCount",
|
|
687
690
|
show: (e) => e.redisOk
|
|
@@ -698,7 +701,7 @@ const k = [
|
|
|
698
701
|
inverseThreshold: !0,
|
|
699
702
|
extract: (e) => e.redisHitRate,
|
|
700
703
|
format: (e) => `${e.redisHitRate.toFixed(0)}%`,
|
|
701
|
-
color: (e) => g(
|
|
704
|
+
color: (e) => g(ee(e.redisHitRate, 90, 70)),
|
|
702
705
|
historyKey: "redisHitRate",
|
|
703
706
|
show: (e) => e.redisOk
|
|
704
707
|
},
|
|
@@ -789,10 +792,10 @@ const k = [
|
|
|
789
792
|
historyKey: "logEntriesPerMinute"
|
|
790
793
|
}
|
|
791
794
|
];
|
|
792
|
-
function
|
|
795
|
+
function rt(e) {
|
|
793
796
|
return k.find((t) => t.id === e);
|
|
794
797
|
}
|
|
795
|
-
function
|
|
798
|
+
function nt() {
|
|
796
799
|
const e = /* @__PURE__ */ new Map();
|
|
797
800
|
for (const t of k) {
|
|
798
801
|
const r = t.group || "core";
|
|
@@ -800,7 +803,7 @@ function rt() {
|
|
|
800
803
|
}
|
|
801
804
|
return e;
|
|
802
805
|
}
|
|
803
|
-
const
|
|
806
|
+
const ae = 60, le = 1e4, ce = {
|
|
804
807
|
queries: "/queries",
|
|
805
808
|
events: "/events",
|
|
806
809
|
emails: "/emails",
|
|
@@ -812,10 +815,10 @@ const oe = 60, ae = 1e4, le = {
|
|
|
812
815
|
config: "/config",
|
|
813
816
|
internals: "/diagnostics"
|
|
814
817
|
};
|
|
815
|
-
function
|
|
816
|
-
return
|
|
818
|
+
function he(e) {
|
|
819
|
+
return ce[e] || `/${e}`;
|
|
817
820
|
}
|
|
818
|
-
const
|
|
821
|
+
const ue = {
|
|
819
822
|
overview: "/overview",
|
|
820
823
|
requests: "/requests",
|
|
821
824
|
queries: "/queries",
|
|
@@ -828,10 +831,10 @@ const he = {
|
|
|
828
831
|
jobs: "/jobs",
|
|
829
832
|
config: "/config"
|
|
830
833
|
};
|
|
831
|
-
function
|
|
832
|
-
return
|
|
834
|
+
function de(e) {
|
|
835
|
+
return ue[e] || `/${e}`;
|
|
833
836
|
}
|
|
834
|
-
function
|
|
837
|
+
function fe(e = ae) {
|
|
835
838
|
const t = {}, r = {};
|
|
836
839
|
let n = !1;
|
|
837
840
|
function i(s) {
|
|
@@ -866,7 +869,7 @@ function de(e = oe) {
|
|
|
866
869
|
}
|
|
867
870
|
};
|
|
868
871
|
}
|
|
869
|
-
class
|
|
872
|
+
class st {
|
|
870
873
|
// -- Configuration --------------------------------------------------------
|
|
871
874
|
baseUrl;
|
|
872
875
|
endpoint;
|
|
@@ -895,7 +898,7 @@ class nt {
|
|
|
895
898
|
isConnected = !1;
|
|
896
899
|
isStale = !1;
|
|
897
900
|
constructor(t = {}) {
|
|
898
|
-
this.baseUrl = t.baseUrl ?? "", this.endpoint = t.endpoint ?? "/admin/api/server-stats", this.channelName = t.channelName ?? "admin/server-stats", this.authToken = t.authToken, this.pollInterval = t.pollInterval ?? 3e3, this.onStatsUpdate = t.onStatsUpdate, this.onConnectionChange = t.onConnectionChange, this.onStaleChange = t.onStaleChange, this.onError = t.onError, this.onUnauthorizedChange = t.onUnauthorizedChange, this.onHistoryChange = t.onHistoryChange, this.onSseActiveChange = t.onSseActiveChange, this.onPollActiveChange = t.onPollActiveChange, this.historyBuffer =
|
|
901
|
+
this.baseUrl = t.baseUrl ?? "", this.endpoint = t.endpoint ?? "/admin/api/server-stats", this.channelName = t.channelName ?? "admin/server-stats", this.authToken = t.authToken, this.pollInterval = t.pollInterval ?? 3e3, this.onStatsUpdate = t.onStatsUpdate, this.onConnectionChange = t.onConnectionChange, this.onStaleChange = t.onStaleChange, this.onError = t.onError, this.onUnauthorizedChange = t.onUnauthorizedChange, this.onHistoryChange = t.onHistoryChange, this.onSseActiveChange = t.onSseActiveChange, this.onPollActiveChange = t.onPollActiveChange, this.historyBuffer = fe();
|
|
899
902
|
}
|
|
900
903
|
// -- Public API -----------------------------------------------------------
|
|
901
904
|
/**
|
|
@@ -908,7 +911,7 @@ class nt {
|
|
|
908
911
|
this.stopped = !1;
|
|
909
912
|
let t = !1;
|
|
910
913
|
try {
|
|
911
|
-
const r =
|
|
914
|
+
const r = N({
|
|
912
915
|
baseUrl: this.baseUrl,
|
|
913
916
|
channelName: this.channelName,
|
|
914
917
|
authToken: this.authToken,
|
|
@@ -940,7 +943,7 @@ class nt {
|
|
|
940
943
|
});
|
|
941
944
|
}
|
|
942
945
|
this.staleTimer = setInterval(() => {
|
|
943
|
-
this.lastSuccess > 0 && Date.now() - this.lastSuccess >
|
|
946
|
+
this.lastSuccess > 0 && Date.now() - this.lastSuccess > le && this.setStale(!0);
|
|
944
947
|
}, 2e3);
|
|
945
948
|
}
|
|
946
949
|
/**
|
|
@@ -1005,7 +1008,7 @@ class nt {
|
|
|
1005
1008
|
this.isStale !== t && (this.isStale = t, this.onStaleChange?.(t));
|
|
1006
1009
|
}
|
|
1007
1010
|
}
|
|
1008
|
-
class
|
|
1011
|
+
class pe {
|
|
1009
1012
|
constructor(t, r) {
|
|
1010
1013
|
this.client = t, this.basePath = r;
|
|
1011
1014
|
}
|
|
@@ -1017,7 +1020,7 @@ class fe {
|
|
|
1017
1020
|
* @param init - Optional `RequestInit` overrides (e.g. `{ signal }`).
|
|
1018
1021
|
*/
|
|
1019
1022
|
async fetchSection(t, r, n) {
|
|
1020
|
-
const i =
|
|
1023
|
+
const i = de(t), s = r ? `${this.basePath}${i}?${r}` : `${this.basePath}${i}`;
|
|
1021
1024
|
return this.client.fetch(s, n);
|
|
1022
1025
|
}
|
|
1023
1026
|
/**
|
|
@@ -1086,7 +1089,7 @@ class fe {
|
|
|
1086
1089
|
return this.client.fetch(`${this.basePath}/emails/${t}/preview`);
|
|
1087
1090
|
}
|
|
1088
1091
|
}
|
|
1089
|
-
class
|
|
1092
|
+
class it {
|
|
1090
1093
|
// -- Dependencies ---------------------------------------------------------
|
|
1091
1094
|
client;
|
|
1092
1095
|
api;
|
|
@@ -1115,7 +1118,7 @@ class st {
|
|
|
1115
1118
|
/** AbortController for the current in-flight fetch. */
|
|
1116
1119
|
abortController = null;
|
|
1117
1120
|
constructor(t) {
|
|
1118
|
-
this.client = new T({ baseUrl: t.baseUrl, authToken: t.authToken }), this.api = new
|
|
1121
|
+
this.client = new T({ baseUrl: t.baseUrl, authToken: t.authToken }), this.api = new pe(this.client, t.endpoint), this.endpoint = t.endpoint, this.section = t.section, this.perPage = t.perPage, this.callbacks = t.callbacks;
|
|
1119
1122
|
}
|
|
1120
1123
|
// -- Public API -----------------------------------------------------------
|
|
1121
1124
|
/**
|
|
@@ -1144,7 +1147,7 @@ class st {
|
|
|
1144
1147
|
this.abortController = r;
|
|
1145
1148
|
const n = ++this.fetchId, i = this.section;
|
|
1146
1149
|
if (!i) return;
|
|
1147
|
-
const s = this.filters, o = this.sort ? this.sort.replace(/[A-Z]/g, (a) => "_" + a.toLowerCase()) : void 0, l =
|
|
1150
|
+
const s = this.filters, o = this.sort ? this.sort.replace(/[A-Z]/g, (a) => "_" + a.toLowerCase()) : void 0, l = re({
|
|
1148
1151
|
page: this.page,
|
|
1149
1152
|
perPage: this.perPage,
|
|
1150
1153
|
search: this.search,
|
|
@@ -1266,14 +1269,14 @@ class st {
|
|
|
1266
1269
|
// -- Timer management (private) -------------------------------------------
|
|
1267
1270
|
startRefreshTimer() {
|
|
1268
1271
|
this.stopRefreshTimer();
|
|
1269
|
-
const t = this.section === "overview" ?
|
|
1272
|
+
const t = this.section === "overview" ? j : G;
|
|
1270
1273
|
this.timer = setInterval(() => this.fetch(!0), t);
|
|
1271
1274
|
}
|
|
1272
1275
|
stopRefreshTimer() {
|
|
1273
1276
|
this.timer && (clearInterval(this.timer), this.timer = null);
|
|
1274
1277
|
}
|
|
1275
1278
|
}
|
|
1276
|
-
const
|
|
1279
|
+
const ot = {
|
|
1277
1280
|
// ---------------------------------------------------------------------------
|
|
1278
1281
|
// Debug-panel tabs / Dashboard sidebar sections (shared)
|
|
1279
1282
|
// ---------------------------------------------------------------------------
|
|
@@ -1465,8 +1468,8 @@ const it = {
|
|
|
1465
1468
|
viewBox: "0 0 16 16",
|
|
1466
1469
|
elements: ['<path d="M6 3H3v10h10v-3M9 1h6v6M7 9L15 1"/>']
|
|
1467
1470
|
}
|
|
1468
|
-
},
|
|
1469
|
-
function
|
|
1471
|
+
}, me = "ss-col-resize", R = "ss-resizing";
|
|
1472
|
+
function at(e) {
|
|
1470
1473
|
const t = Array.from(e.querySelectorAll("thead th"));
|
|
1471
1474
|
if (t.length === 0) return () => {
|
|
1472
1475
|
};
|
|
@@ -1496,7 +1499,7 @@ function ot(e) {
|
|
|
1496
1499
|
};
|
|
1497
1500
|
if (!s.textContent?.trim()) continue;
|
|
1498
1501
|
const l = document.createElement("div");
|
|
1499
|
-
l.className =
|
|
1502
|
+
l.className = me, s.appendChild(l), l.addEventListener("pointerdown", o), r.push(() => {
|
|
1500
1503
|
l.removeEventListener("pointerdown", o), l.remove();
|
|
1501
1504
|
});
|
|
1502
1505
|
}
|
|
@@ -1504,7 +1507,7 @@ function ot(e) {
|
|
|
1504
1507
|
for (const s of r) s();
|
|
1505
1508
|
};
|
|
1506
1509
|
}
|
|
1507
|
-
class
|
|
1510
|
+
class lt {
|
|
1508
1511
|
client;
|
|
1509
1512
|
endpoint;
|
|
1510
1513
|
refreshInterval;
|
|
@@ -1517,7 +1520,7 @@ class at {
|
|
|
1517
1520
|
this.client = new T({
|
|
1518
1521
|
baseUrl: t.baseUrl,
|
|
1519
1522
|
authToken: t.authToken
|
|
1520
|
-
}), this.endpoint = t.endpoint ?? "/admin/api/debug", this.refreshInterval = t.refreshInterval ??
|
|
1523
|
+
}), this.endpoint = t.endpoint ?? "/admin/api/debug", this.refreshInterval = t.refreshInterval ?? J, this.callbacks = {
|
|
1521
1524
|
onData: t.onData,
|
|
1522
1525
|
onLoading: t.onLoading,
|
|
1523
1526
|
onError: t.onError,
|
|
@@ -1608,7 +1611,7 @@ class at {
|
|
|
1608
1611
|
const r = new AbortController();
|
|
1609
1612
|
this.abortController = r;
|
|
1610
1613
|
try {
|
|
1611
|
-
const n = `${this.endpoint}${
|
|
1614
|
+
const n = `${this.endpoint}${he(t)}`, i = await this.client.fetch(n, { signal: r.signal });
|
|
1612
1615
|
if (r.signal.aborted) return;
|
|
1613
1616
|
this.callbacks.onData(i), this.callbacks.onError(null), this.callbacks.onLoading(!1);
|
|
1614
1617
|
} catch (n) {
|
|
@@ -1621,21 +1624,21 @@ class at {
|
|
|
1621
1624
|
}
|
|
1622
1625
|
}
|
|
1623
1626
|
}
|
|
1624
|
-
const
|
|
1625
|
-
function
|
|
1627
|
+
const ct = ["all", "error", "warn", "info", "debug"];
|
|
1628
|
+
function ge(e) {
|
|
1626
1629
|
return (e.levelName || e.level_name || (typeof e.level == "string" ? e.level : "") || "info").toLowerCase();
|
|
1627
1630
|
}
|
|
1628
|
-
function
|
|
1631
|
+
function ht(e) {
|
|
1629
1632
|
return e.msg || e.message || JSON.stringify(e);
|
|
1630
1633
|
}
|
|
1631
|
-
function
|
|
1634
|
+
function ut(e) {
|
|
1632
1635
|
return e.createdAt || e.created_at || e.time || e.timestamp || 0;
|
|
1633
1636
|
}
|
|
1634
|
-
function
|
|
1637
|
+
function dt(e) {
|
|
1635
1638
|
const t = e.data || {};
|
|
1636
1639
|
return e.requestId || e.request_id || e["x-request-id"] || t.requestId || t.request_id || t["x-request-id"] || "";
|
|
1637
1640
|
}
|
|
1638
|
-
function
|
|
1641
|
+
function ft(e, t = "ss-dbg-log-level") {
|
|
1639
1642
|
switch (e) {
|
|
1640
1643
|
case "error":
|
|
1641
1644
|
case "fatal":
|
|
@@ -1652,30 +1655,30 @@ function dt(e, t = "ss-dbg-log-level") {
|
|
|
1652
1655
|
return `${t}-info`;
|
|
1653
1656
|
}
|
|
1654
1657
|
}
|
|
1655
|
-
function
|
|
1658
|
+
function pt(e, t) {
|
|
1656
1659
|
return t === "all" ? e : e.filter((r) => {
|
|
1657
|
-
const n =
|
|
1660
|
+
const n = ge(r);
|
|
1658
1661
|
return t === "error" ? n === "error" || n === "fatal" : n === t;
|
|
1659
1662
|
});
|
|
1660
1663
|
}
|
|
1661
|
-
function
|
|
1664
|
+
function mt(e, t) {
|
|
1662
1665
|
if (!t) return e;
|
|
1663
1666
|
const r = t.toLowerCase();
|
|
1664
1667
|
return e.filter(
|
|
1665
1668
|
(n) => n.sql.toLowerCase().includes(r) || n.model && n.model.toLowerCase().includes(r) || n.method.toLowerCase().includes(r)
|
|
1666
1669
|
);
|
|
1667
1670
|
}
|
|
1668
|
-
function
|
|
1671
|
+
function gt(e) {
|
|
1669
1672
|
const t = {};
|
|
1670
1673
|
for (const r of e)
|
|
1671
1674
|
t[r.sql] = (t[r.sql] || 0) + 1;
|
|
1672
1675
|
return t;
|
|
1673
1676
|
}
|
|
1674
|
-
function
|
|
1677
|
+
function yt(e, t) {
|
|
1675
1678
|
const r = e.filter((s) => s.duration > 100).length, n = Object.values(t).filter((s) => s > 1).length, i = e.length > 0 ? e.reduce((s, o) => s + o.duration, 0) / e.length : 0;
|
|
1676
1679
|
return { slowCount: r, dupCount: n, avgDuration: i, totalCount: e.length };
|
|
1677
1680
|
}
|
|
1678
|
-
const
|
|
1681
|
+
const bt = [
|
|
1679
1682
|
"all",
|
|
1680
1683
|
"active",
|
|
1681
1684
|
"waiting",
|
|
@@ -1683,7 +1686,7 @@ const yt = [
|
|
|
1683
1686
|
"completed",
|
|
1684
1687
|
"failed"
|
|
1685
1688
|
];
|
|
1686
|
-
function
|
|
1689
|
+
function xt(e, t = "ss-dbg-job-status") {
|
|
1687
1690
|
switch (e) {
|
|
1688
1691
|
case "completed":
|
|
1689
1692
|
case "failed":
|
|
@@ -1695,7 +1698,7 @@ function bt(e, t = "ss-dbg-job-status") {
|
|
|
1695
1698
|
return "ss-dbg-badge-muted";
|
|
1696
1699
|
}
|
|
1697
1700
|
}
|
|
1698
|
-
function
|
|
1701
|
+
function wt(e) {
|
|
1699
1702
|
switch (e) {
|
|
1700
1703
|
case "active":
|
|
1701
1704
|
return "blue";
|
|
@@ -1711,18 +1714,18 @@ function xt(e) {
|
|
|
1711
1714
|
return "muted";
|
|
1712
1715
|
}
|
|
1713
1716
|
}
|
|
1714
|
-
function
|
|
1717
|
+
function St(e) {
|
|
1715
1718
|
if (!e) return [];
|
|
1716
1719
|
if (Array.isArray(e)) return e;
|
|
1717
1720
|
const t = e;
|
|
1718
1721
|
return t.jobs || t.data || [];
|
|
1719
1722
|
}
|
|
1720
|
-
function
|
|
1723
|
+
function vt(e) {
|
|
1721
1724
|
if (!e || Array.isArray(e)) return null;
|
|
1722
1725
|
const t = e;
|
|
1723
1726
|
return t.stats || t.overview || null;
|
|
1724
1727
|
}
|
|
1725
|
-
function
|
|
1728
|
+
function ye(e) {
|
|
1726
1729
|
if (!e) return [];
|
|
1727
1730
|
if (typeof e == "string")
|
|
1728
1731
|
try {
|
|
@@ -1732,7 +1735,7 @@ function ge(e) {
|
|
|
1732
1735
|
}
|
|
1733
1736
|
return Array.isArray(e) ? e : [];
|
|
1734
1737
|
}
|
|
1735
|
-
function
|
|
1738
|
+
function be(e) {
|
|
1736
1739
|
if (!e) return [];
|
|
1737
1740
|
if (typeof e == "string")
|
|
1738
1741
|
try {
|
|
@@ -1745,23 +1748,23 @@ function ye(e) {
|
|
|
1745
1748
|
function C(e, t, r, n = 0) {
|
|
1746
1749
|
return e[t] ?? e[r] ?? n;
|
|
1747
1750
|
}
|
|
1748
|
-
function
|
|
1751
|
+
function Tt(e) {
|
|
1749
1752
|
return {
|
|
1750
1753
|
method: e.method || "",
|
|
1751
1754
|
url: e.url || "",
|
|
1752
1755
|
statusCode: C(e, "status_code", "statusCode"),
|
|
1753
1756
|
totalDuration: C(e, "total_duration", "totalDuration") || e.duration || 0,
|
|
1754
1757
|
spanCount: C(e, "span_count", "spanCount"),
|
|
1755
|
-
spans:
|
|
1756
|
-
warnings:
|
|
1758
|
+
spans: ye(e.spans),
|
|
1759
|
+
warnings: be(e.warnings)
|
|
1757
1760
|
};
|
|
1758
1761
|
}
|
|
1759
|
-
const
|
|
1760
|
-
function
|
|
1762
|
+
const xe = ["password", "secret", "token", "key", "credential", "auth"];
|
|
1763
|
+
function we(e) {
|
|
1761
1764
|
const t = e.toLowerCase();
|
|
1762
|
-
return
|
|
1765
|
+
return xe.some((r) => t.includes(r));
|
|
1763
1766
|
}
|
|
1764
|
-
function
|
|
1767
|
+
function Se(e) {
|
|
1765
1768
|
if (e == null) return "-";
|
|
1766
1769
|
if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
|
|
1767
1770
|
return String(e);
|
|
@@ -1772,50 +1775,50 @@ function we(e) {
|
|
|
1772
1775
|
return String(e);
|
|
1773
1776
|
}
|
|
1774
1777
|
}
|
|
1775
|
-
const
|
|
1778
|
+
const ve = {
|
|
1776
1779
|
collectionInterval: "Stats Collection",
|
|
1777
1780
|
dashboardBroadcast: "Dashboard Broadcast",
|
|
1778
1781
|
debugBroadcast: "Debug Broadcast",
|
|
1779
1782
|
persistFlush: "Persist Flush",
|
|
1780
1783
|
retentionCleanup: "Retention Cleanup"
|
|
1781
1784
|
};
|
|
1782
|
-
function
|
|
1783
|
-
return
|
|
1785
|
+
function Et(e) {
|
|
1786
|
+
return ve[e] || e;
|
|
1784
1787
|
}
|
|
1785
|
-
const
|
|
1788
|
+
const Te = {
|
|
1786
1789
|
prometheus: "Prometheus",
|
|
1787
1790
|
pinoHook: "Pino Log Hook",
|
|
1788
1791
|
edgePlugin: "Edge Plugin",
|
|
1789
1792
|
cacheInspector: "Cache Inspector",
|
|
1790
1793
|
queueInspector: "Queue Inspector"
|
|
1791
1794
|
};
|
|
1792
|
-
function Et(e) {
|
|
1793
|
-
return ve[e] || e;
|
|
1794
|
-
}
|
|
1795
1795
|
function Ct(e) {
|
|
1796
|
+
return Te[e] || e;
|
|
1797
|
+
}
|
|
1798
|
+
function Mt(e) {
|
|
1796
1799
|
return "active" in e ? e.active ? "active" : "inactive" : "available" in e ? e.available ? "available" : "unavailable" : "unknown";
|
|
1797
1800
|
}
|
|
1798
|
-
function
|
|
1801
|
+
function Pt(e, t) {
|
|
1799
1802
|
return t.mode ? `Mode: ${t.mode}` : e === "edgePlugin" && t.active ? "@serverStats() tag registered" : e === "cacheInspector" ? t.available ? "Redis dependency detected" : "Redis not installed" : e === "queueInspector" ? t.available ? "Queue dependency detected" : "@rlanz/bull-queue not installed" : "-";
|
|
1800
1803
|
}
|
|
1801
|
-
function
|
|
1804
|
+
function kt(e) {
|
|
1802
1805
|
return Object.entries(e).map(([t, r]) => ({
|
|
1803
1806
|
key: t,
|
|
1804
|
-
value:
|
|
1805
|
-
secret:
|
|
1807
|
+
value: Se(r),
|
|
1808
|
+
secret: we(t)
|
|
1806
1809
|
}));
|
|
1807
1810
|
}
|
|
1808
|
-
function
|
|
1811
|
+
function $t(e, t) {
|
|
1809
1812
|
return t ? Math.min(100, Math.round(e / t * 100)) : 0;
|
|
1810
1813
|
}
|
|
1811
|
-
const
|
|
1812
|
-
function
|
|
1813
|
-
return
|
|
1814
|
+
const Ee = ["healthy", "active", "connected", "available", "ready"], Ce = ["errored", "unavailable"];
|
|
1815
|
+
function At(e) {
|
|
1816
|
+
return Ee.includes(e) ? "ok" : Ce.includes(e) ? "err" : "";
|
|
1814
1817
|
}
|
|
1815
1818
|
function b(e) {
|
|
1816
1819
|
return e !== null && typeof e == "object" && !Array.isArray(e) && e.__redacted === !0;
|
|
1817
1820
|
}
|
|
1818
|
-
function
|
|
1821
|
+
function Me(e, t = "") {
|
|
1819
1822
|
if (typeof e != "object" || e === null || e === void 0)
|
|
1820
1823
|
return [{ path: t, value: e }];
|
|
1821
1824
|
if (Array.isArray(e) || b(e))
|
|
@@ -1823,25 +1826,25 @@ function Ce(e, t = "") {
|
|
|
1823
1826
|
const r = [];
|
|
1824
1827
|
for (const n of Object.keys(e)) {
|
|
1825
1828
|
const i = t ? `${t}.${n}` : n, s = e[n];
|
|
1826
|
-
typeof s == "object" && s !== null && !Array.isArray(s) && !b(s) ? r.push(...
|
|
1829
|
+
typeof s == "object" && s !== null && !Array.isArray(s) && !b(s) ? r.push(...Me(s, i)) : r.push({ path: i, value: s });
|
|
1827
1830
|
}
|
|
1828
1831
|
return r;
|
|
1829
1832
|
}
|
|
1830
|
-
function
|
|
1833
|
+
function Lt(e) {
|
|
1831
1834
|
return e == null ? { text: "null", color: "var(--ss-dim)" } : typeof e == "boolean" ? {
|
|
1832
1835
|
text: String(e),
|
|
1833
1836
|
color: e ? "var(--ss-green-fg)" : "var(--ss-red-fg)"
|
|
1834
1837
|
} : typeof e == "number" ? { text: String(e), color: "var(--ss-amber-fg)" } : Array.isArray(e) ? { text: `[${e.map((r) => r == null ? "null" : typeof r == "object" ? JSON.stringify(r) : String(r)).join(", ")}]`, color: "var(--ss-purple-fg)" } : typeof e == "object" ? { text: JSON.stringify(e), color: "var(--ss-dim)" } : { text: String(e) };
|
|
1835
1838
|
}
|
|
1836
|
-
function
|
|
1839
|
+
function Pe(e) {
|
|
1837
1840
|
if (e == null || typeof e != "object" || Array.isArray(e) || b(e))
|
|
1838
1841
|
return 1;
|
|
1839
1842
|
let t = 0;
|
|
1840
1843
|
for (const r of Object.keys(e))
|
|
1841
|
-
t +=
|
|
1844
|
+
t += Pe(e[r]);
|
|
1842
1845
|
return t;
|
|
1843
1846
|
}
|
|
1844
|
-
function
|
|
1847
|
+
function Rt(e) {
|
|
1845
1848
|
if (e == null || typeof e != "object" || Array.isArray(e) || b(e))
|
|
1846
1849
|
return [];
|
|
1847
1850
|
const t = [];
|
|
@@ -1851,10 +1854,10 @@ function Lt(e) {
|
|
|
1851
1854
|
}
|
|
1852
1855
|
return t;
|
|
1853
1856
|
}
|
|
1854
|
-
function
|
|
1857
|
+
function Ut(e, t, r) {
|
|
1855
1858
|
return !r || e.toLowerCase().includes(r) ? !0 : (b(t) ? t.display : t == null ? "" : String(t)).toLowerCase().includes(r);
|
|
1856
1859
|
}
|
|
1857
|
-
function
|
|
1860
|
+
function Dt(e, t, r) {
|
|
1858
1861
|
t && navigator.clipboard.writeText(e).then(() => {
|
|
1859
1862
|
const n = t.textContent;
|
|
1860
1863
|
t.textContent = "✓", t.classList.add(`${r}-copy-row-ok`), setTimeout(() => {
|
|
@@ -1863,7 +1866,7 @@ function Ut(e, t, r) {
|
|
|
1863
1866
|
}).catch(() => {
|
|
1864
1867
|
});
|
|
1865
1868
|
}
|
|
1866
|
-
const
|
|
1869
|
+
const ke = /* @__PURE__ */ new Set([
|
|
1867
1870
|
"secret",
|
|
1868
1871
|
"key",
|
|
1869
1872
|
"token",
|
|
@@ -1877,7 +1880,7 @@ const Pe = /* @__PURE__ */ new Set([
|
|
|
1877
1880
|
"private",
|
|
1878
1881
|
"encryption"
|
|
1879
1882
|
]);
|
|
1880
|
-
function
|
|
1883
|
+
function $e(e) {
|
|
1881
1884
|
const t = e.split(/[._-]/), r = [];
|
|
1882
1885
|
for (const n of t) {
|
|
1883
1886
|
const i = n.split(new RegExp("(?<=[a-z])(?=[A-Z])"));
|
|
@@ -1886,119 +1889,119 @@ function ke(e) {
|
|
|
1886
1889
|
}
|
|
1887
1890
|
return r;
|
|
1888
1891
|
}
|
|
1889
|
-
function
|
|
1890
|
-
return
|
|
1892
|
+
function Ft(e) {
|
|
1893
|
+
return $e(e).some((r) => ke.has(r.toLowerCase()));
|
|
1891
1894
|
}
|
|
1892
|
-
const
|
|
1895
|
+
const Ot = new RegExp("secret|password|pass(?:word)?|pwd|token|(?:^|[._-])key(?:[._-]|$)|(?<=[a-z])Key|apikey|api_key|auth|credential|private|encryption", "i");
|
|
1893
1896
|
export {
|
|
1894
1897
|
T as ApiClient,
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1898
|
+
_ as ApiError,
|
|
1899
|
+
ue as DASHBOARD_SECTION_PATHS,
|
|
1900
|
+
J as DEBUG_REFRESH_MS,
|
|
1901
|
+
ce as DEBUG_TAB_PATHS,
|
|
1902
|
+
ne as DEFAULT_FEATURES,
|
|
1903
|
+
F as DEFAULT_PER_PAGE,
|
|
1904
|
+
pe as DashboardApi,
|
|
1905
|
+
it as DashboardDataController,
|
|
1906
|
+
lt as DebugDataController,
|
|
1907
|
+
Ce as ERROR_STATUSES,
|
|
1908
|
+
Te as INTEGRATION_LABELS,
|
|
1909
|
+
bt as JOB_STATUS_FILTERS,
|
|
1910
|
+
ct as LOG_LEVELS,
|
|
1911
|
+
ae as MAX_HISTORY,
|
|
1909
1912
|
k as METRIC_DEFINITIONS,
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1913
|
+
Ee as OK_STATUSES,
|
|
1914
|
+
j as OVERVIEW_REFRESH_MS,
|
|
1915
|
+
Ot as REDACT_PATTERN,
|
|
1916
|
+
G as SECTION_REFRESH_MS,
|
|
1917
|
+
Q as SLOW_DURATION_MS,
|
|
1918
|
+
le as STALE_MS,
|
|
1919
|
+
st as ServerStatsController,
|
|
1920
|
+
ot as TAB_ICONS,
|
|
1921
|
+
te as THRESHOLD_CSS_CLASS,
|
|
1922
|
+
He as THRESHOLD_CSS_VAR,
|
|
1923
|
+
Be as THRESHOLD_HEX_FALLBACK,
|
|
1924
|
+
ve as TIMER_LABELS,
|
|
1922
1925
|
w as UnauthorizedError,
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1926
|
+
X as VERY_SLOW_DURATION_MS,
|
|
1927
|
+
re as buildQueryParams,
|
|
1928
|
+
Ve as buildQueryString,
|
|
1929
|
+
De as buildSparklineData,
|
|
1930
|
+
At as classifyStatus,
|
|
1931
|
+
Rt as collectTopLevelObjectKeys,
|
|
1929
1932
|
L as compactPreview,
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1933
|
+
Xe as computePagination,
|
|
1934
|
+
yt as computeQuerySummary,
|
|
1935
|
+
V as computeStats,
|
|
1936
|
+
Dt as copyWithFeedback,
|
|
1937
|
+
gt as countDuplicateQueries,
|
|
1938
|
+
Pe as countLeaves,
|
|
1939
|
+
Je as createFilterState,
|
|
1940
|
+
fe as createHistoryBuffer,
|
|
1941
|
+
Ge as createPaginationState,
|
|
1942
|
+
Qe as createSortState,
|
|
1943
|
+
H as createTransmitSubscription,
|
|
1944
|
+
Ze as detectFeatures,
|
|
1945
|
+
tt as detectMetricGroupsFromStats,
|
|
1946
|
+
qe as durationSeverity,
|
|
1947
|
+
vt as extractJobStats,
|
|
1948
|
+
St as extractJobs,
|
|
1949
|
+
ie as fetchFeatures,
|
|
1950
|
+
$t as fillPercent,
|
|
1951
|
+
pt as filterLogsByLevel,
|
|
1952
|
+
mt as filterQueries,
|
|
1953
|
+
Me as flattenConfig,
|
|
1951
1954
|
P as formatBytes,
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1955
|
+
We as formatCacheSize,
|
|
1956
|
+
kt as formatCollectorConfig,
|
|
1957
|
+
Se as formatConfigVal,
|
|
1958
|
+
Z as formatCount,
|
|
1959
|
+
Fe as formatDuration,
|
|
1960
|
+
Lt as formatFlatValue,
|
|
1958
1961
|
$ as formatMb,
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1962
|
+
_e as formatStatNum,
|
|
1963
|
+
Oe as formatTime,
|
|
1964
|
+
ze as formatTtl,
|
|
1965
|
+
Y as formatUptime,
|
|
1966
|
+
W as generateGradientId,
|
|
1967
|
+
Ue as generateSparklinePath,
|
|
1968
|
+
Re as generateSparklinePoints,
|
|
1969
|
+
de as getDashboardSectionPath,
|
|
1970
|
+
he as getDebugTabPath,
|
|
1971
|
+
Pt as getIntegrationDetails,
|
|
1972
|
+
Ct as getIntegrationLabel,
|
|
1973
|
+
Mt as getIntegrationStatus,
|
|
1974
|
+
wt as getJobStatusBadgeColor,
|
|
1975
|
+
xt as getJobStatusCssClass,
|
|
1976
|
+
ft as getLogLevelCssClass,
|
|
1977
|
+
rt as getMetricById,
|
|
1978
|
+
nt as getMetricsByGroup,
|
|
1979
|
+
Ye as getPageNumbers,
|
|
1977
1980
|
A as getRatioColor,
|
|
1978
1981
|
U as getTheme,
|
|
1979
1982
|
S as getThresholdColor,
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1983
|
+
ee as getThresholdColorInverse,
|
|
1984
|
+
Et as getTimerLabel,
|
|
1985
|
+
et as getVisibleMetricGroups,
|
|
1986
|
+
at as initResizableColumns,
|
|
1984
1987
|
b as isRedactedValue,
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1988
|
+
we as isSecretKey,
|
|
1989
|
+
Ut as matchesConfigSearch,
|
|
1990
|
+
Tt as normalizeTraceFields,
|
|
1991
|
+
Le as onThemeChange,
|
|
1992
|
+
je as parsePaginatedResponse,
|
|
1993
|
+
ye as parseTraceSpans,
|
|
1994
|
+
be as parseTraceWarnings,
|
|
1995
|
+
ge as resolveLogLevel,
|
|
1996
|
+
ht as resolveLogMessage,
|
|
1997
|
+
dt as resolveLogRequestId,
|
|
1998
|
+
ut as resolveLogTimestamp,
|
|
1996
1999
|
C as resolveTraceField,
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2000
|
+
q as setTheme,
|
|
2001
|
+
Ke as shortReqId,
|
|
2002
|
+
Ft as shouldRedact,
|
|
2003
|
+
Ne as statusColor,
|
|
2004
|
+
N as subscribeToChannel,
|
|
2005
|
+
Ie as timeAgo,
|
|
2006
|
+
Ae as toggleTheme
|
|
2004
2007
|
};
|