adonisjs-server-stats 1.12.3 → 1.14.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 +11 -6
- package/dist/configure.js +6 -1
- package/dist/core/collectors/collector.d.ts +83 -0
- package/dist/core/core/types.d.ts +186 -0
- package/dist/core/debug/types.d.ts +467 -0
- package/dist/core/index.js +184 -169
- package/dist/core/types.d.ts +855 -167
- package/dist/react/{CacheSection-CX2duJuc.js → CacheSection-DkLtukWz.js} +1 -1
- package/dist/react/{CacheTab-CgT4t0oZ.js → CacheTab-DWeXnEBI.js} +51 -46
- package/dist/react/ConfigContent-Bwvfl_G7.js +350 -0
- package/dist/react/{ConfigSection-Dt0FyeaW.js → ConfigSection-DaVbFPDg.js} +2 -2
- package/dist/react/{ConfigTab-KtiTtsrj.js → ConfigTab-D4640WJZ.js} +2 -2
- package/dist/react/{CustomPaneTab-15QoEplP.js → CustomPaneTab-DglmAVMC.js} +1 -1
- package/dist/react/{EmailsSection-YcJYR5eA.js → EmailsSection-vYx6ExTb.js} +1 -1
- package/dist/react/{EmailsTab-CUjubln_.js → EmailsTab-DKDrRmRH.js} +54 -49
- package/dist/react/{EventsSection-GGPoYSNv.js → EventsSection-CapH5xut.js} +1 -1
- package/dist/react/{EventsTab-Wdwr0_ny.js → EventsTab-BNVEySAm.js} +1 -1
- package/dist/react/{InternalsContent-BNOnSoi9.js → InternalsContent-C9lIA92C.js} +1 -1
- package/dist/react/{InternalsSection-BwrTfpjA.js → InternalsSection-lOv_UcSV.js} +1 -1
- package/dist/react/{InternalsTab--RD-L1dX.js → InternalsTab-BygoSorC.js} +1 -1
- package/dist/react/{JobsSection-BqqIh_DR.js → JobsSection-ZIQsJWid.js} +1 -1
- package/dist/react/{JobsTab-CBrU-ryL.js → JobsTab-DXQzXrDt.js} +1 -1
- package/dist/react/{LogEntryRow-BOrRkhRU.js → LogEntryRow-BWkHE51-.js} +1 -1
- package/dist/react/{LogsSection-Cm_lphM6.js → LogsSection-ConXdBkL.js} +2 -2
- package/dist/react/LogsTab-CJM47LPn.js +82 -0
- package/dist/react/{OverviewSection-XF7bakyM.js → OverviewSection-DOMu2qvl.js} +131 -131
- package/dist/react/{QueriesSection-DsQBKrNK.js → QueriesSection-DFsaOSJI.js} +1 -1
- package/dist/react/{QueriesTab-CxCC1GVq.js → QueriesTab-CY9CG_7L.js} +1 -1
- package/dist/react/RequestsSection-CC-eVHsl.js +326 -0
- package/dist/react/{RoutesSection-D0y5JQP4.js → RoutesSection-p1DMq41y.js} +1 -1
- package/dist/react/{RoutesTab-Y_alJVMV.js → RoutesTab-Cnqy8UcK.js} +1 -1
- package/dist/react/{SplitPaneWrapper-CZl1ouIT.js → SplitPaneWrapper-XgkA0QxE.js} +1 -1
- package/dist/react/{TimelineTab-HyqZpfbp.js → TimelineTab-1YOERxe5.js} +3 -3
- package/dist/react/index-DOSlCpZ9.js +1159 -0
- package/dist/react/index.js +1 -1
- package/dist/react/useApiClient-CtEG7rHs.js +11 -0
- package/dist/src/collectors/adonisjs_queue_collector.d.ts +21 -0
- package/dist/src/collectors/adonisjs_queue_collector.js +61 -0
- package/dist/src/collectors/auto_detect.js +8 -2
- package/dist/src/collectors/index.d.ts +2 -0
- package/dist/src/collectors/index.js +1 -0
- package/dist/src/collectors/queue_collector.js +22 -6
- package/dist/src/config/deprecation_migration.js +11 -0
- package/dist/src/dashboard/cache_handlers.js +22 -2
- package/dist/src/dashboard/flush_manager.d.ts +2 -0
- package/dist/src/dashboard/flush_manager.js +17 -0
- package/dist/src/dashboard/inspector_manager.d.ts +4 -4
- package/dist/src/dashboard/inspector_manager.js +20 -10
- package/dist/src/dashboard/integrations/adonisjs_queue_inspector.d.ts +42 -0
- package/dist/src/dashboard/integrations/adonisjs_queue_inspector.js +135 -0
- package/dist/src/dashboard/integrations/adonisjs_queue_store.d.ts +166 -0
- package/dist/src/dashboard/integrations/adonisjs_queue_store.js +629 -0
- package/dist/src/dashboard/integrations/config_inspector.d.ts +0 -1
- package/dist/src/dashboard/integrations/config_inspector.js +4 -2
- package/dist/src/dashboard/integrations/index.d.ts +4 -1
- package/dist/src/dashboard/integrations/index.js +2 -0
- package/dist/src/dashboard/integrations/queue_inspector.d.ts +5 -61
- package/dist/src/dashboard/integrations/queue_inspector.js +5 -1
- package/dist/src/dashboard/integrations/queue_inspector_contract.d.ts +73 -0
- package/dist/src/dashboard/integrations/queue_inspector_contract.js +15 -0
- package/dist/src/dashboard/paginate_helper.d.ts +5 -0
- package/dist/src/dashboard/paginate_helper.js +16 -4
- package/dist/src/dashboard/query_explain_handler.d.ts +6 -1
- package/dist/src/dashboard/query_explain_handler.js +12 -2
- package/dist/src/dashboard/write_queue.d.ts +13 -0
- package/dist/src/dashboard/write_queue.js +34 -2
- package/dist/src/debug/debug_store.js +8 -1
- package/dist/src/debug/event_collector.js +4 -0
- package/dist/src/debug/query_collector.js +2 -0
- package/dist/src/debug/ring_buffer.js +8 -1
- package/dist/src/debug/trace_collector.js +34 -10
- package/dist/src/debug/types.d.ts +2 -0
- package/dist/src/define_config.js +1 -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/stats-bar.js +1 -1
- package/dist/src/edge/client-vue/dashboard.js +5 -5
- package/dist/src/edge/client-vue/debug-panel-deferred.js +2 -2
- package/dist/src/engine/request_metrics.js +8 -10
- package/dist/src/log_stream/log_stream_service.d.ts +1 -0
- package/dist/src/log_stream/log_stream_service.js +7 -5
- package/dist/src/prometheus/prometheus_collector.d.ts +9 -0
- package/dist/src/prometheus/prometheus_collector.js +11 -0
- package/dist/src/provider/dashboard_init.js +15 -0
- package/dist/src/provider/dashboard_setup.js +9 -2
- package/dist/src/provider/email_bridge.d.ts +14 -3
- package/dist/src/provider/email_bridge.js +25 -3
- package/dist/src/provider/email_helpers.d.ts +9 -1
- package/dist/src/provider/email_helpers.js +32 -4
- package/dist/src/provider/pino_hook.d.ts +8 -0
- package/dist/src/provider/pino_hook.js +19 -1
- package/dist/src/provider/provider_helpers_extra.d.ts +2 -0
- package/dist/src/provider/provider_helpers_extra.js +17 -2
- package/dist/src/provider/server_stats_provider.js +19 -1
- package/dist/src/provider/shutdown_helpers.js +2 -0
- package/dist/src/provider/toolbar_setup.js +32 -17
- package/dist/src/routes/dashboard_routes.js +96 -62
- package/dist/src/routes/debug_routes.js +45 -35
- package/dist/src/routes/no_session_middleware.d.ts +6 -3
- package/dist/src/routes/no_session_middleware.js +7 -3
- package/dist/src/routes/register_routes.d.ts +8 -0
- package/dist/src/routes/register_routes.js +19 -0
- package/dist/src/types.d.ts +31 -0
- package/dist/src/utils/app_import.js +12 -4
- package/dist/vue/CacheSection-CxEBVVkF.js +156 -0
- package/dist/vue/ConfigSection-BiRAiaHj.js +415 -0
- package/dist/vue/EmailsSection-Dl44qyqY.js +208 -0
- package/dist/vue/{EmailsTab-CwIF1fik.js → EmailsTab-Diya54CP.js} +6 -5
- package/dist/vue/{EventsSection-BpgkWIwM.js → EventsSection-CWjeitjU.js} +1 -1
- package/dist/vue/{InternalsTab-521fxYYj.js → InternalsTab-Z3c82glB.js} +15 -15
- package/dist/vue/{JobsSection-DrghFEKL.js → JobsSection-DOBb4LjZ.js} +1 -1
- package/dist/vue/LogsSection-CXx-HOWJ.js +260 -0
- package/dist/vue/{OverviewSection-BAgZTPjY.js → OverviewSection-CyfNQ8uV.js} +318 -302
- package/dist/vue/{QueriesSection-CUpwhp7u.js → QueriesSection-CXBsFp-y.js} +1 -1
- package/dist/vue/{RequestsSection-D8P2xpF2.js → RequestsSection-YTIaZGZd.js} +151 -145
- package/dist/vue/{RoutesSection-0qB81hTT.js → RoutesSection-CDKMey49.js} +1 -1
- package/dist/vue/composables/useApiClient.d.ts +8 -1
- package/dist/vue/index-14x39RI_.js +1239 -0
- package/dist/vue/index.js +1 -1
- package/dist/vue/style.css +1 -1
- package/package.json +16 -3
- package/dist/react/ConfigContent-CnsEI4j3.js +0 -397
- package/dist/react/LogsTab-jKwv9G7Q.js +0 -79
- package/dist/react/RequestsSection-D8cMbZU0.js +0 -321
- package/dist/react/index-CsprmgzI.js +0 -1121
- package/dist/react/useApiClient-BVtNCmnL.js +0 -9
- package/dist/vue/CacheSection-DRqV3YX2.js +0 -149
- package/dist/vue/ConfigSection-C6pQCHAL.js +0 -576
- package/dist/vue/EmailsSection-BTNw3ZU2.js +0 -206
- package/dist/vue/LogsSection-BDxx9Bfi.js +0 -258
- package/dist/vue/index-30jLw-_w.js +0 -1232
- /package/dist/core/{api-client.d.ts → core/api-client.d.ts} +0 -0
- /package/dist/core/{config-utils.d.ts → core/config-utils.d.ts} +0 -0
- /package/dist/core/{constants.d.ts → core/constants.d.ts} +0 -0
- /package/dist/core/{dashboard-api.d.ts → core/dashboard-api.d.ts} +0 -0
- /package/dist/core/{dashboard-data-controller.d.ts → core/dashboard-data-controller.d.ts} +0 -0
- /package/dist/core/{dashboard-data-helpers.d.ts → core/dashboard-data-helpers.d.ts} +0 -0
- /package/dist/core/{debug-data-controller.d.ts → core/debug-data-controller.d.ts} +0 -0
- /package/dist/core/{define-config-helpers.d.ts → core/define-config-helpers.d.ts} +0 -0
- /package/dist/core/{explain-utils.d.ts → core/explain-utils.d.ts} +0 -0
- /package/dist/core/{feature-detect-helpers.d.ts → core/feature-detect-helpers.d.ts} +0 -0
- /package/dist/core/{feature-detect.d.ts → core/feature-detect.d.ts} +0 -0
- /package/dist/core/{field-resolvers.d.ts → core/field-resolvers.d.ts} +0 -0
- /package/dist/core/{formatters-helpers.d.ts → core/formatters-helpers.d.ts} +0 -0
- /package/dist/core/{formatters.d.ts → core/formatters.d.ts} +0 -0
- /package/dist/core/{history-buffer.d.ts → core/history-buffer.d.ts} +0 -0
- /package/dist/core/{icons.d.ts → core/icons.d.ts} +0 -0
- /package/dist/core/{index.d.ts → core/index.d.ts} +0 -0
- /package/dist/core/{internals-utils.d.ts → core/internals-utils.d.ts} +0 -0
- /package/dist/core/{job-utils.d.ts → core/job-utils.d.ts} +0 -0
- /package/dist/core/{log-utils-helpers.d.ts → core/log-utils-helpers.d.ts} +0 -0
- /package/dist/core/{log-utils.d.ts → core/log-utils.d.ts} +0 -0
- /package/dist/core/{metrics.d.ts → core/metrics.d.ts} +0 -0
- /package/dist/core/{pagination.d.ts → core/pagination.d.ts} +0 -0
- /package/dist/core/{queries-columns.d.ts → core/queries-columns.d.ts} +0 -0
- /package/dist/core/{queries-controller.d.ts → core/queries-controller.d.ts} +0 -0
- /package/dist/core/{query-utils.d.ts → core/query-utils.d.ts} +0 -0
- /package/dist/core/{resizable-columns.d.ts → core/resizable-columns.d.ts} +0 -0
- /package/dist/core/{routes.d.ts → core/routes.d.ts} +0 -0
- /package/dist/core/{server-stats-controller.d.ts → core/server-stats-controller.d.ts} +0 -0
- /package/dist/core/{sparkline.d.ts → core/sparkline.d.ts} +0 -0
- /package/dist/core/{split-pane.d.ts → core/split-pane.d.ts} +0 -0
- /package/dist/core/{theme.d.ts → core/theme.d.ts} +0 -0
- /package/dist/core/{trace-utils.d.ts → core/trace-utils.d.ts} +0 -0
- /package/dist/core/{transmit-adapter.d.ts → core/transmit-adapter.d.ts} +0 -0
- /package/dist/core/{transmit-helpers.d.ts → core/transmit-helpers.d.ts} +0 -0
- /package/dist/core/{types-dashboard.d.ts → core/types-dashboard.d.ts} +0 -0
- /package/dist/core/{types-diagnostics.d.ts → core/types-diagnostics.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as he, inject as z, ref as T, computed as p, openBlock as a, createElementBlock as l, createVNode as me, withCtx as ve, createElementVNode as s, normalizeClass as f, unref as c, Fragment as d, renderList as x, createTextVNode as v, toDisplayString as o, createCommentVNode as h, withKeys as G, withModifiers as F, normalizeStyle as H, createBlock as ye } from "vue";
|
|
2
2
|
import { QueriesController as fe, getDashboardListColumns as _e, getDashboardGroupedColumns as xe, resolveField as b, normalizeDashboardQuery as ge, buildSqlCounts as be, computeDashboardQuerySummary as ke, formatTime as we, timeAgo as Ce, formatCellValue as $e, flattenPlanTree as De, getExplainColumns as Ee, hasNestedPlan as Se, durationClassName as Ne } from "adonisjs-server-stats/core";
|
|
3
|
-
import { u as ze } from "./index-
|
|
3
|
+
import { u as ze } from "./index-14x39RI_.js";
|
|
4
4
|
import { u as Pe } from "./useResizableTable-BoivAevK.js";
|
|
5
5
|
import { _ as Te } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
|
|
6
6
|
import { _ as Fe } from "./PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { initSplitPane as
|
|
3
|
-
import { u as
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { _ as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as Y, computed as q, openBlock as l, createElementBlock as o, normalizeClass as v, createElementVNode as t, Fragment as f, renderList as A, normalizeStyle as W, toDisplayString as i, createTextVNode as b, createCommentVNode as p, inject as T, ref as m, watch as at, nextTick as lt, onUnmounted as nt, createVNode as G, createBlock as I, unref as d } from "vue";
|
|
2
|
+
import { initSplitPane as ot, formatTime as rt, timeAgo as it, normalizeTraceFields as dt, durationClassName as ut } from "adonisjs-server-stats/core";
|
|
3
|
+
import { u as ct } from "./useApiClient-BQQ9CF-q.js";
|
|
4
|
+
import { u as ht } from "./index-14x39RI_.js";
|
|
5
|
+
import { u as mt } from "./useResizableTable-BoivAevK.js";
|
|
6
|
+
import { _ as pt } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
|
|
7
|
+
import { _ as vt } from "./PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js";
|
|
8
|
+
import { _ as ft } from "./RelatedLogs.vue_vue_type_script_setup_true_lang-Py1iu9GU.js";
|
|
9
|
+
const gt = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "ss-dash-empty"
|
|
12
|
-
},
|
|
12
|
+
}, yt = { class: "ss-dash-tl-legend" }, _t = ["title"], kt = { class: "ss-dash-tl-track" }, bt = ["title"], wt = { class: "ss-dash-tl-dur" }, Ct = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "ss-dash-tl-warnings"
|
|
15
|
-
},
|
|
15
|
+
}, $t = { class: "ss-dash-tl-warnings-title" }, K = /* @__PURE__ */ Y({
|
|
16
16
|
__name: "WaterfallChart",
|
|
17
17
|
props: {
|
|
18
18
|
spans: {},
|
|
@@ -21,7 +21,7 @@ const ft = {
|
|
|
21
21
|
warnings: {}
|
|
22
22
|
},
|
|
23
23
|
setup(g) {
|
|
24
|
-
const w = g,
|
|
24
|
+
const w = g, C = {
|
|
25
25
|
request: "#1e3a5f",
|
|
26
26
|
middleware: "rgba(30, 58, 95, 0.7)",
|
|
27
27
|
db: "#6d28d9",
|
|
@@ -29,7 +29,7 @@ const ft = {
|
|
|
29
29
|
mail: "#059669",
|
|
30
30
|
event: "#b45309",
|
|
31
31
|
custom: "var(--ss-dim)"
|
|
32
|
-
},
|
|
32
|
+
}, D = {
|
|
33
33
|
request: "Request",
|
|
34
34
|
middleware: "Middleware",
|
|
35
35
|
db: "DB",
|
|
@@ -37,15 +37,15 @@ const ft = {
|
|
|
37
37
|
event: "Event",
|
|
38
38
|
view: "View",
|
|
39
39
|
custom: "Custom"
|
|
40
|
-
},
|
|
41
|
-
() => [
|
|
42
|
-
),
|
|
40
|
+
}, $ = q(() => w.spans || []), y = q(
|
|
41
|
+
() => [...$.value].sort((a, u) => a.startOffset - u.startOffset)
|
|
42
|
+
), E = q(() => {
|
|
43
43
|
const a = {};
|
|
44
44
|
for (const u of y.value)
|
|
45
45
|
a[u.id] = u.parentId ? (a[u.parentId] || 0) + 1 : 0;
|
|
46
46
|
return a;
|
|
47
47
|
});
|
|
48
|
-
function
|
|
48
|
+
function F(a) {
|
|
49
49
|
const u = w.totalDuration || 1;
|
|
50
50
|
return `${a.startOffset / u * 100}%`;
|
|
51
51
|
}
|
|
@@ -56,82 +56,82 @@ const ft = {
|
|
|
56
56
|
function h(a) {
|
|
57
57
|
return a.length > 50 ? a.slice(0, 50) + "..." : a;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function N(a) {
|
|
60
60
|
return a === "db" ? "DB" : a;
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function O(a) {
|
|
63
63
|
return a === "db" ? "purple" : a === "mail" ? "green" : a === "event" ? "amber" : a === "view" ? "blue" : "muted";
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
const u = a.metadata ? Object.entries(a.metadata).filter(([,
|
|
65
|
+
function L(a) {
|
|
66
|
+
const u = a.metadata ? Object.entries(a.metadata).filter(([, r]) => r != null).map(([r, n]) => `${r}=${n}`).join(", ") : "";
|
|
67
67
|
return u ? `${a.label} (${a.duration.toFixed(2)}ms)
|
|
68
68
|
${u}` : `${a.label} (${a.duration.toFixed(2)}ms)`;
|
|
69
69
|
}
|
|
70
|
-
return (a, u) =>
|
|
70
|
+
return (a, u) => $.value.length === 0 ? (l(), o("div", gt, "No spans recorded")) : (l(), o("div", {
|
|
71
71
|
key: 1,
|
|
72
72
|
class: v(`ss-dash-tl-waterfall ${g.className || ""}`)
|
|
73
73
|
}, [
|
|
74
|
-
t("div",
|
|
75
|
-
(l(), o(f, null,
|
|
74
|
+
t("div", yt, [
|
|
75
|
+
(l(), o(f, null, A(D, (r, n) => t("div", {
|
|
76
76
|
key: n,
|
|
77
77
|
class: "ss-dash-tl-legend-item"
|
|
78
78
|
}, [
|
|
79
79
|
t("span", {
|
|
80
80
|
class: "ss-dash-tl-legend-dot",
|
|
81
|
-
style:
|
|
81
|
+
style: W({ background: C[n] || C.custom })
|
|
82
82
|
}, null, 4),
|
|
83
|
-
t("span", null,
|
|
83
|
+
t("span", null, i(r), 1)
|
|
84
84
|
])), 64))
|
|
85
85
|
]),
|
|
86
|
-
(l(!0), o(f, null,
|
|
87
|
-
key:
|
|
86
|
+
(l(!0), o(f, null, A(y.value, (r) => (l(), o("div", {
|
|
87
|
+
key: r.id,
|
|
88
88
|
class: "ss-dash-tl-row"
|
|
89
89
|
}, [
|
|
90
90
|
t("div", {
|
|
91
91
|
class: "ss-dash-tl-label",
|
|
92
|
-
title:
|
|
93
|
-
style:
|
|
92
|
+
title: L(r),
|
|
93
|
+
style: W({ paddingLeft: 8 + (E.value[r.id] || 0) * 16 + "px" })
|
|
94
94
|
}, [
|
|
95
95
|
t("span", {
|
|
96
|
-
class: v(`ss-dash-badge ss-dash-badge-${
|
|
96
|
+
class: v(`ss-dash-badge ss-dash-badge-${O(r.category)}`),
|
|
97
97
|
style: { "font-size": "9px", "margin-right": "4px" }
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
], 12,
|
|
101
|
-
t("div",
|
|
98
|
+
}, i(N(r.category)), 3),
|
|
99
|
+
b(" " + i(h(r.label)), 1)
|
|
100
|
+
], 12, _t),
|
|
101
|
+
t("div", kt, [
|
|
102
102
|
t("div", {
|
|
103
|
-
class: v(`ss-dash-tl-bar ss-dash-tl-bar-${
|
|
104
|
-
style:
|
|
105
|
-
left:
|
|
106
|
-
width: _(
|
|
103
|
+
class: v(`ss-dash-tl-bar ss-dash-tl-bar-${r.category || "custom"}`),
|
|
104
|
+
style: W({
|
|
105
|
+
left: F(r),
|
|
106
|
+
width: _(r)
|
|
107
107
|
}),
|
|
108
|
-
title:
|
|
109
|
-
}, null, 14,
|
|
108
|
+
title: L(r)
|
|
109
|
+
}, null, 14, bt)
|
|
110
110
|
]),
|
|
111
|
-
t("span", wt,
|
|
111
|
+
t("span", wt, i(r.duration.toFixed(2)) + "ms", 1)
|
|
112
112
|
]))), 128)),
|
|
113
|
-
g.warnings && g.warnings.length > 0 ? (l(), o("div",
|
|
114
|
-
t("div",
|
|
115
|
-
(l(!0), o(f, null,
|
|
113
|
+
g.warnings && g.warnings.length > 0 ? (l(), o("div", Ct, [
|
|
114
|
+
t("div", $t, "Warnings (" + i(g.warnings.length) + ")", 1),
|
|
115
|
+
(l(!0), o(f, null, A(g.warnings, (r, n) => (l(), o("div", {
|
|
116
116
|
key: n,
|
|
117
117
|
class: "ss-dash-tl-warning"
|
|
118
|
-
},
|
|
118
|
+
}, i(r), 1))), 128))
|
|
119
119
|
])) : p("", !0)
|
|
120
120
|
], 2));
|
|
121
121
|
}
|
|
122
|
-
}),
|
|
122
|
+
}), xt = { class: "ss-dash-tl-detail-header" }, Rt = { style: { color: "var(--ss-text)" } }, qt = { class: "ss-dash-tl-meta" }, Dt = { class: "ss-dash-tl-detail-header" }, Lt = {
|
|
123
123
|
key: 0,
|
|
124
124
|
class: "ss-dash-empty"
|
|
125
|
-
},
|
|
125
|
+
}, St = {
|
|
126
126
|
key: 1,
|
|
127
127
|
class: "ss-dash-empty"
|
|
128
|
-
},
|
|
128
|
+
}, Bt = { class: "ss-dash-table-wrap" }, Tt = {
|
|
129
129
|
key: 0,
|
|
130
130
|
class: "ss-dash-sort-arrow"
|
|
131
|
-
},
|
|
131
|
+
}, At = {
|
|
132
132
|
key: 0,
|
|
133
133
|
class: "ss-dash-sort-arrow"
|
|
134
|
-
},
|
|
134
|
+
}, Et = {
|
|
135
135
|
key: 0,
|
|
136
136
|
class: "ss-dash-sort-arrow"
|
|
137
137
|
}, Ft = {
|
|
@@ -140,96 +140,102 @@ ${u}` : `${a.label} (${a.duration.toFixed(2)}ms)`;
|
|
|
140
140
|
}, Nt = {
|
|
141
141
|
key: 0,
|
|
142
142
|
class: "ss-dash-sort-arrow"
|
|
143
|
-
}, Ot = ["onClick"], Pt = { style: { color: "var(--ss-dim)" } },
|
|
143
|
+
}, Ot = ["onClick"], Pt = { style: { color: "var(--ss-dim)" } }, Mt = ["title"], Vt = { style: { color: "var(--ss-muted)", "text-align": "center" } }, zt = {
|
|
144
144
|
key: 0,
|
|
145
145
|
style: { color: "var(--ss-amber-fg)", "text-align": "center", display: "block" }
|
|
146
|
-
},
|
|
146
|
+
}, Ut = {
|
|
147
147
|
key: 1,
|
|
148
148
|
style: { color: "var(--ss-dim)", "text-align": "center", display: "block" }
|
|
149
|
-
},
|
|
149
|
+
}, jt = ["title"], Wt = {
|
|
150
150
|
key: 1,
|
|
151
151
|
class: "ss-dash-empty"
|
|
152
|
-
},
|
|
152
|
+
}, ts = /* @__PURE__ */ Y({
|
|
153
153
|
__name: "RequestsSection",
|
|
154
154
|
setup(g) {
|
|
155
|
-
const w =
|
|
155
|
+
const w = T("ss-refresh-key", m(0)), C = T("ss-dashboard-endpoint", "/__stats/api"), D = T("ss-auth-token", void 0), $ = T("ss-base-url", ""), { data: y, loading: E, error: F, pagination: _, sort: h, goToPage: N, setSearch: O, setSort: L } = ht(
|
|
156
156
|
() => "requests",
|
|
157
157
|
{
|
|
158
|
-
baseUrl:
|
|
159
|
-
dashboardEndpoint:
|
|
160
|
-
authToken:
|
|
158
|
+
baseUrl: $,
|
|
159
|
+
dashboardEndpoint: C,
|
|
160
|
+
authToken: D,
|
|
161
161
|
refreshKey: w
|
|
162
162
|
}
|
|
163
|
-
), a = m(""), u = m(null),
|
|
163
|
+
), a = m(""), u = m(null), r = m(!1), n = m(null), P = q(() => {
|
|
164
164
|
if (!y.value) return [];
|
|
165
165
|
const c = y.value;
|
|
166
166
|
return c.data || c.requests || y.value || [];
|
|
167
|
-
}),
|
|
168
|
-
|
|
167
|
+
}), J = ct($, D);
|
|
168
|
+
let k = null;
|
|
169
|
+
async function Q(c) {
|
|
169
170
|
const e = c.id;
|
|
170
|
-
|
|
171
|
+
k && k.abort(), k = new AbortController();
|
|
172
|
+
const s = k;
|
|
173
|
+
r.value = !0;
|
|
171
174
|
try {
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
+
const R = C || "/__stats/api", B = await J().fetch(`${R}/requests/${e}`, {
|
|
176
|
+
signal: s.signal
|
|
177
|
+
}), H = B.trace, et = H ? { ...B, ...H, logs: B.logs } : B;
|
|
178
|
+
n.value = dt(et), u.value = c;
|
|
179
|
+
} catch (R) {
|
|
180
|
+
if (R instanceof Error && R.name === "AbortError") return;
|
|
175
181
|
} finally {
|
|
176
|
-
|
|
182
|
+
k === s && (r.value = !1);
|
|
177
183
|
}
|
|
178
184
|
}
|
|
179
|
-
function
|
|
185
|
+
function X() {
|
|
180
186
|
u.value = null, n.value = null;
|
|
181
187
|
}
|
|
182
|
-
function
|
|
183
|
-
a.value = c,
|
|
188
|
+
function Z(c) {
|
|
189
|
+
a.value = c, O(c);
|
|
184
190
|
}
|
|
185
|
-
function
|
|
186
|
-
|
|
191
|
+
function x(c) {
|
|
192
|
+
L(c);
|
|
187
193
|
}
|
|
188
|
-
function
|
|
189
|
-
return
|
|
194
|
+
function tt(c) {
|
|
195
|
+
return ut(c, "ss-dash");
|
|
190
196
|
}
|
|
191
|
-
const { tableRef:
|
|
192
|
-
let
|
|
193
|
-
const
|
|
194
|
-
return
|
|
195
|
-
|
|
196
|
-
container:
|
|
197
|
-
handle:
|
|
198
|
-
topPane:
|
|
199
|
-
bottomPane:
|
|
197
|
+
const { tableRef: st } = mt(() => P.value), M = m(null), V = m(null), z = m(null), U = m(null);
|
|
198
|
+
let S = null;
|
|
199
|
+
const j = q(() => n.value ? n.value.logs || [] : []);
|
|
200
|
+
return at([() => u.value, () => n.value], async () => {
|
|
201
|
+
S?.(), S = null, n.value && j.value.length > 0 && (await lt(), M.value && V.value && z.value && U.value && (S = ot({
|
|
202
|
+
container: M.value,
|
|
203
|
+
handle: V.value,
|
|
204
|
+
topPane: z.value,
|
|
205
|
+
bottomPane: U.value,
|
|
200
206
|
storageKey: "ss-requests-split"
|
|
201
207
|
})));
|
|
202
|
-
}),
|
|
203
|
-
|
|
208
|
+
}), nt(() => {
|
|
209
|
+
k && k.abort(), S?.();
|
|
204
210
|
}), (c, e) => (l(), o("div", null, [
|
|
205
211
|
n.value && u.value ? (l(), o(f, { key: 0 }, [
|
|
206
|
-
t("div",
|
|
212
|
+
t("div", xt, [
|
|
207
213
|
t("button", {
|
|
208
214
|
type: "button",
|
|
209
215
|
class: "ss-dash-btn",
|
|
210
|
-
onClick:
|
|
216
|
+
onClick: X
|
|
211
217
|
}, " ← Back to Requests "),
|
|
212
218
|
t("span", {
|
|
213
219
|
class: v(`ss-dash-method ss-dash-method-${(n.value.method || "").toLowerCase()}`)
|
|
214
|
-
},
|
|
215
|
-
t("span",
|
|
220
|
+
}, i(n.value.method), 3),
|
|
221
|
+
t("span", Rt, i(n.value.url), 1),
|
|
216
222
|
t("span", {
|
|
217
223
|
class: v(`ss-dash-status ss-dash-status-${Math.floor((n.value.statusCode || 200) / 100)}xx`)
|
|
218
|
-
},
|
|
219
|
-
t("span",
|
|
224
|
+
}, i(n.value.statusCode), 3),
|
|
225
|
+
t("span", qt, i(n.value.totalDuration.toFixed(1)) + "ms · " + i(n.value.spanCount) + " spans ", 1)
|
|
220
226
|
]),
|
|
221
|
-
|
|
227
|
+
j.value.length > 0 ? (l(), o("div", {
|
|
222
228
|
key: 0,
|
|
223
229
|
ref_key: "splitContainerRef",
|
|
224
|
-
ref:
|
|
230
|
+
ref: M,
|
|
225
231
|
class: "ss-dash-split-container"
|
|
226
232
|
}, [
|
|
227
233
|
t("div", {
|
|
228
234
|
ref_key: "splitTopRef",
|
|
229
|
-
ref:
|
|
235
|
+
ref: z,
|
|
230
236
|
class: "ss-dash-split-top"
|
|
231
237
|
}, [
|
|
232
|
-
|
|
238
|
+
G(K, {
|
|
233
239
|
spans: n.value.spans,
|
|
234
240
|
"total-duration": n.value.totalDuration,
|
|
235
241
|
warnings: n.value.warnings
|
|
@@ -237,45 +243,45 @@ ${u}` : `${a.label} (${a.duration.toFixed(2)}ms)`;
|
|
|
237
243
|
], 512),
|
|
238
244
|
t("div", {
|
|
239
245
|
ref_key: "splitHandleRef",
|
|
240
|
-
ref:
|
|
246
|
+
ref: V,
|
|
241
247
|
class: "ss-dash-split-handle"
|
|
242
248
|
}, null, 512),
|
|
243
249
|
t("div", {
|
|
244
250
|
ref_key: "splitBottomRef",
|
|
245
|
-
ref:
|
|
251
|
+
ref: U,
|
|
246
252
|
class: "ss-dash-split-bottom"
|
|
247
253
|
}, [
|
|
248
|
-
|
|
254
|
+
G(ft, { logs: j.value }, null, 8, ["logs"])
|
|
249
255
|
], 512)
|
|
250
|
-
], 512)) : (l(),
|
|
256
|
+
], 512)) : (l(), I(K, {
|
|
251
257
|
key: 1,
|
|
252
258
|
spans: n.value.spans,
|
|
253
259
|
"total-duration": n.value.totalDuration,
|
|
254
260
|
warnings: n.value.warnings
|
|
255
261
|
}, null, 8, ["spans", "total-duration", "warnings"]))
|
|
256
|
-
], 64)) :
|
|
257
|
-
t("div",
|
|
262
|
+
], 64)) : r.value ? (l(), o(f, { key: 1 }, [
|
|
263
|
+
t("div", Dt, [
|
|
258
264
|
t("button", {
|
|
259
265
|
type: "button",
|
|
260
266
|
class: "ss-dash-btn",
|
|
261
|
-
onClick: e[0] || (e[0] = (s) =>
|
|
267
|
+
onClick: e[0] || (e[0] = (s) => r.value = !1)
|
|
262
268
|
}, " ← Back to Requests ")
|
|
263
269
|
]),
|
|
264
270
|
e[6] || (e[6] = t("div", { class: "ss-dash-empty" }, "Loading request detail...", -1))
|
|
265
271
|
], 64)) : (l(), o(f, { key: 2 }, [
|
|
266
|
-
|
|
272
|
+
G(pt, {
|
|
267
273
|
"model-value": a.value,
|
|
268
274
|
placeholder: "Filter requests...",
|
|
269
|
-
summary: `${
|
|
270
|
-
"onUpdate:modelValue":
|
|
275
|
+
summary: `${d(_).total ?? 0} requests`,
|
|
276
|
+
"onUpdate:modelValue": Z
|
|
271
277
|
}, null, 8, ["model-value", "summary"]),
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
t("div",
|
|
275
|
-
|
|
278
|
+
d(F) ? (l(), o("div", Lt, "Failed to load requests")) : p("", !0),
|
|
279
|
+
d(E) && !d(y) ? (l(), o("div", St, "Loading requests...")) : (l(), o(f, { key: 2 }, [
|
|
280
|
+
t("div", Bt, [
|
|
281
|
+
P.value.length > 0 ? (l(), o("table", {
|
|
276
282
|
key: 0,
|
|
277
283
|
ref_key: "tableRef",
|
|
278
|
-
ref:
|
|
284
|
+
ref: st,
|
|
279
285
|
class: "ss-dash-table"
|
|
280
286
|
}, [
|
|
281
287
|
e[15] || (e[15] = t("colgroup", null, [
|
|
@@ -293,99 +299,99 @@ ${u}` : `${a.label} (${a.duration.toFixed(2)}ms)`;
|
|
|
293
299
|
e[12] || (e[12] = t("th", null, "#", -1)),
|
|
294
300
|
t("th", {
|
|
295
301
|
class: "ss-dash-sortable",
|
|
296
|
-
onClick: e[1] || (e[1] = (s) =>
|
|
302
|
+
onClick: e[1] || (e[1] = (s) => x("method"))
|
|
297
303
|
}, [
|
|
298
|
-
e[7] || (e[7] =
|
|
299
|
-
|
|
304
|
+
e[7] || (e[7] = b(" Method ", -1)),
|
|
305
|
+
d(h).column === "method" ? (l(), o("span", Tt, i(d(h).direction === "asc" ? " ▲" : " ▼"), 1)) : p("", !0)
|
|
300
306
|
]),
|
|
301
307
|
t("th", {
|
|
302
308
|
class: "ss-dash-sortable",
|
|
303
|
-
onClick: e[2] || (e[2] = (s) =>
|
|
309
|
+
onClick: e[2] || (e[2] = (s) => x("url"))
|
|
304
310
|
}, [
|
|
305
|
-
e[8] || (e[8] =
|
|
306
|
-
|
|
311
|
+
e[8] || (e[8] = b(" URL ", -1)),
|
|
312
|
+
d(h).column === "url" ? (l(), o("span", At, i(d(h).direction === "asc" ? " ▲" : " ▼"), 1)) : p("", !0)
|
|
307
313
|
]),
|
|
308
314
|
t("th", {
|
|
309
315
|
class: "ss-dash-sortable",
|
|
310
|
-
onClick: e[3] || (e[3] = (s) =>
|
|
316
|
+
onClick: e[3] || (e[3] = (s) => x("statusCode"))
|
|
311
317
|
}, [
|
|
312
|
-
e[9] || (e[9] =
|
|
313
|
-
|
|
318
|
+
e[9] || (e[9] = b(" Status ", -1)),
|
|
319
|
+
d(h).column === "statusCode" ? (l(), o("span", Et, i(d(h).direction === "asc" ? " ▲" : " ▼"), 1)) : p("", !0)
|
|
314
320
|
]),
|
|
315
321
|
t("th", {
|
|
316
322
|
class: "ss-dash-sortable",
|
|
317
|
-
onClick: e[4] || (e[4] = (s) =>
|
|
323
|
+
onClick: e[4] || (e[4] = (s) => x("duration"))
|
|
318
324
|
}, [
|
|
319
|
-
e[10] || (e[10] =
|
|
320
|
-
|
|
325
|
+
e[10] || (e[10] = b(" Duration ", -1)),
|
|
326
|
+
d(h).column === "duration" ? (l(), o("span", Ft, i(d(h).direction === "asc" ? " ▲" : " ▼"), 1)) : p("", !0)
|
|
321
327
|
]),
|
|
322
328
|
e[13] || (e[13] = t("th", null, "Spans", -1)),
|
|
323
329
|
e[14] || (e[14] = t("th", null, "⚠", -1)),
|
|
324
330
|
t("th", {
|
|
325
331
|
class: "ss-dash-sortable",
|
|
326
|
-
onClick: e[5] || (e[5] = (s) =>
|
|
332
|
+
onClick: e[5] || (e[5] = (s) => x("createdAt"))
|
|
327
333
|
}, [
|
|
328
|
-
e[11] || (e[11] =
|
|
329
|
-
|
|
334
|
+
e[11] || (e[11] = b(" Time ", -1)),
|
|
335
|
+
d(h).column === "createdAt" ? (l(), o("span", Nt, i(d(h).direction === "asc" ? " ▲" : " ▼"), 1)) : p("", !0)
|
|
330
336
|
])
|
|
331
337
|
])
|
|
332
338
|
]),
|
|
333
339
|
t("tbody", null, [
|
|
334
|
-
(l(!0), o(f, null,
|
|
340
|
+
(l(!0), o(f, null, A(P.value, (s) => (l(), o("tr", {
|
|
335
341
|
key: s.id,
|
|
336
342
|
class: "ss-dash-clickable",
|
|
337
|
-
onClick: (
|
|
343
|
+
onClick: (R) => Q(s)
|
|
338
344
|
}, [
|
|
339
345
|
t("td", null, [
|
|
340
|
-
t("span", Pt,
|
|
346
|
+
t("span", Pt, i(s.id), 1)
|
|
341
347
|
]),
|
|
342
348
|
t("td", null, [
|
|
343
349
|
t("span", {
|
|
344
350
|
class: v(`ss-dash-method ss-dash-method-${(s.method || "").toLowerCase()}`)
|
|
345
|
-
},
|
|
351
|
+
}, i(s.method), 3)
|
|
346
352
|
]),
|
|
347
353
|
t("td", null, [
|
|
348
354
|
t("span", {
|
|
349
355
|
style: { color: "var(--ss-text)", overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap" },
|
|
350
356
|
title: s.url
|
|
351
|
-
},
|
|
357
|
+
}, i(s.url), 9, Mt)
|
|
352
358
|
]),
|
|
353
359
|
t("td", null, [
|
|
354
360
|
t("span", {
|
|
355
361
|
class: v(`ss-dash-status ss-dash-status-${Math.floor((s.status_code || s.statusCode || 200) / 100)}xx`)
|
|
356
|
-
},
|
|
362
|
+
}, i(s.status_code || s.statusCode), 3)
|
|
357
363
|
]),
|
|
358
364
|
t("td", null, [
|
|
359
365
|
t("span", {
|
|
360
|
-
class: v(`ss-dash-duration ${
|
|
361
|
-
},
|
|
366
|
+
class: v(`ss-dash-duration ${tt(s.total_duration || s.totalDuration || s.duration || 0)}`)
|
|
367
|
+
}, i((s.total_duration || s.totalDuration || s.duration || 0).toFixed(1)) + "ms ", 3)
|
|
362
368
|
]),
|
|
363
369
|
t("td", null, [
|
|
364
|
-
t("span",
|
|
370
|
+
t("span", Vt, i(s.span_count || s.spanCount || 0), 1)
|
|
365
371
|
]),
|
|
366
372
|
t("td", null, [
|
|
367
|
-
(s.warning_count || s.warningCount || 0) > 0 ? (l(), o("span",
|
|
373
|
+
(s.warning_count || s.warningCount || 0) > 0 ? (l(), o("span", zt, i(s.warning_count || s.warningCount || 0), 1)) : (l(), o("span", Ut, "-"))
|
|
368
374
|
]),
|
|
369
375
|
t("td", null, [
|
|
370
376
|
t("span", {
|
|
371
377
|
class: "ss-dash-event-time",
|
|
372
|
-
title:
|
|
378
|
+
title: d(rt)(
|
|
373
379
|
s.createdAt || s.created_at || s.timestamp || ""
|
|
374
380
|
)
|
|
375
|
-
}, d(
|
|
381
|
+
}, i(d(it)(
|
|
376
382
|
s.createdAt || s.created_at || s.timestamp || ""
|
|
377
|
-
)), 9,
|
|
383
|
+
)), 9, jt)
|
|
378
384
|
])
|
|
379
385
|
], 8, Ot))), 128))
|
|
380
386
|
])
|
|
381
|
-
], 512)) : (l(), o("div",
|
|
387
|
+
], 512)) : (l(), o("div", Wt, "No requests recorded yet"))
|
|
382
388
|
]),
|
|
383
|
-
|
|
389
|
+
d(_).totalPages > 1 ? (l(), I(vt, {
|
|
384
390
|
key: 0,
|
|
385
|
-
page:
|
|
386
|
-
"last-page":
|
|
387
|
-
total:
|
|
388
|
-
onPageChange:
|
|
391
|
+
page: d(_).page,
|
|
392
|
+
"last-page": d(_).totalPages,
|
|
393
|
+
total: d(_).total,
|
|
394
|
+
onPageChange: d(N)
|
|
389
395
|
}, null, 8, ["page", "last-page", "total", "onPageChange"])) : p("", !0)
|
|
390
396
|
], 64))
|
|
391
397
|
], 64))
|
|
@@ -393,5 +399,5 @@ ${u}` : `${a.label} (${a.duration.toFixed(2)}ms)`;
|
|
|
393
399
|
}
|
|
394
400
|
});
|
|
395
401
|
export {
|
|
396
|
-
|
|
402
|
+
ts as default
|
|
397
403
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as g, inject as d, ref as c, computed as A, openBlock as l, createElementBlock as o, createVNode as N, unref as u, createElementVNode as e, Fragment as R, renderList as S, normalizeClass as j, toDisplayString as a } from "vue";
|
|
2
|
-
import { u as z } from "./index-
|
|
2
|
+
import { u as z } from "./index-14x39RI_.js";
|
|
3
3
|
import { u as C } from "./useResizableTable-BoivAevK.js";
|
|
4
4
|
import { _ as D } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
|
|
5
5
|
const E = {
|
|
@@ -3,6 +3,13 @@ import { ApiClient } from '../../core/api-client.js';
|
|
|
3
3
|
* Vue composable that lazily creates and memoizes an {@link ApiClient} instance.
|
|
4
4
|
*
|
|
5
5
|
* Returns a getter function that creates the client on first call
|
|
6
|
-
* and reuses it on subsequent calls.
|
|
6
|
+
* and reuses it on subsequent calls (memoized within the returned closure).
|
|
7
|
+
*
|
|
8
|
+
* IMPORTANT: call this inside a component's `setup()` / `<script setup>` scope
|
|
9
|
+
* (or an `onMounted` callback), never at module-evaluation time. The memoized
|
|
10
|
+
* client captures the `baseUrl`/`authToken` passed in; invoking it once at
|
|
11
|
+
* module scope would make the same client — and its stale config/credentials —
|
|
12
|
+
* shared across every component instance and hot-reload. Called per-setup, each
|
|
13
|
+
* instance gets its own client reflecting its own injected configuration.
|
|
7
14
|
*/
|
|
8
15
|
export declare function useApiClient(baseUrl?: string, authToken?: string): () => ApiClient;
|