adonisjs-server-stats 1.13.0 → 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.
Files changed (150) hide show
  1. package/README.md +3 -2
  2. package/dist/configure.js +6 -1
  3. package/dist/core/collectors/collector.d.ts +83 -0
  4. package/dist/core/core/types.d.ts +186 -0
  5. package/dist/core/debug/types.d.ts +467 -0
  6. package/dist/core/index.js +184 -169
  7. package/dist/core/types.d.ts +855 -167
  8. package/dist/react/{CacheSection-CX2duJuc.js → CacheSection-DkLtukWz.js} +1 -1
  9. package/dist/react/{CacheTab-CgT4t0oZ.js → CacheTab-DWeXnEBI.js} +51 -46
  10. package/dist/react/ConfigContent-Bwvfl_G7.js +350 -0
  11. package/dist/react/{ConfigSection-Dt0FyeaW.js → ConfigSection-DaVbFPDg.js} +2 -2
  12. package/dist/react/{ConfigTab-KtiTtsrj.js → ConfigTab-D4640WJZ.js} +2 -2
  13. package/dist/react/{CustomPaneTab-15QoEplP.js → CustomPaneTab-DglmAVMC.js} +1 -1
  14. package/dist/react/{EmailsSection-YcJYR5eA.js → EmailsSection-vYx6ExTb.js} +1 -1
  15. package/dist/react/{EmailsTab-CUjubln_.js → EmailsTab-DKDrRmRH.js} +54 -49
  16. package/dist/react/{EventsSection-GGPoYSNv.js → EventsSection-CapH5xut.js} +1 -1
  17. package/dist/react/{EventsTab-Wdwr0_ny.js → EventsTab-BNVEySAm.js} +1 -1
  18. package/dist/react/{InternalsContent-BNOnSoi9.js → InternalsContent-C9lIA92C.js} +1 -1
  19. package/dist/react/{InternalsSection-BwrTfpjA.js → InternalsSection-lOv_UcSV.js} +1 -1
  20. package/dist/react/{InternalsTab--RD-L1dX.js → InternalsTab-BygoSorC.js} +1 -1
  21. package/dist/react/{JobsSection-BqqIh_DR.js → JobsSection-ZIQsJWid.js} +1 -1
  22. package/dist/react/{JobsTab-CBrU-ryL.js → JobsTab-DXQzXrDt.js} +1 -1
  23. package/dist/react/{LogEntryRow-BOrRkhRU.js → LogEntryRow-BWkHE51-.js} +1 -1
  24. package/dist/react/{LogsSection-Cm_lphM6.js → LogsSection-ConXdBkL.js} +2 -2
  25. package/dist/react/LogsTab-CJM47LPn.js +82 -0
  26. package/dist/react/{OverviewSection-XF7bakyM.js → OverviewSection-DOMu2qvl.js} +131 -131
  27. package/dist/react/{QueriesSection-DsQBKrNK.js → QueriesSection-DFsaOSJI.js} +1 -1
  28. package/dist/react/{QueriesTab-CxCC1GVq.js → QueriesTab-CY9CG_7L.js} +1 -1
  29. package/dist/react/RequestsSection-CC-eVHsl.js +326 -0
  30. package/dist/react/{RoutesSection-D0y5JQP4.js → RoutesSection-p1DMq41y.js} +1 -1
  31. package/dist/react/{RoutesTab-Y_alJVMV.js → RoutesTab-Cnqy8UcK.js} +1 -1
  32. package/dist/react/{SplitPaneWrapper-CZl1ouIT.js → SplitPaneWrapper-XgkA0QxE.js} +1 -1
  33. package/dist/react/{TimelineTab-HyqZpfbp.js → TimelineTab-1YOERxe5.js} +3 -3
  34. package/dist/react/index-DOSlCpZ9.js +1159 -0
  35. package/dist/react/index.js +1 -1
  36. package/dist/react/useApiClient-CtEG7rHs.js +11 -0
  37. package/dist/src/collectors/queue_collector.js +22 -6
  38. package/dist/src/config/deprecation_migration.js +11 -0
  39. package/dist/src/dashboard/cache_handlers.js +22 -2
  40. package/dist/src/dashboard/flush_manager.d.ts +2 -0
  41. package/dist/src/dashboard/flush_manager.js +17 -0
  42. package/dist/src/dashboard/integrations/config_inspector.d.ts +0 -1
  43. package/dist/src/dashboard/integrations/config_inspector.js +4 -2
  44. package/dist/src/dashboard/paginate_helper.d.ts +5 -0
  45. package/dist/src/dashboard/paginate_helper.js +16 -4
  46. package/dist/src/dashboard/query_explain_handler.d.ts +6 -1
  47. package/dist/src/dashboard/query_explain_handler.js +12 -2
  48. package/dist/src/dashboard/write_queue.d.ts +13 -0
  49. package/dist/src/dashboard/write_queue.js +34 -2
  50. package/dist/src/debug/debug_store.js +8 -1
  51. package/dist/src/debug/event_collector.js +4 -0
  52. package/dist/src/debug/query_collector.js +2 -0
  53. package/dist/src/debug/ring_buffer.js +8 -1
  54. package/dist/src/debug/trace_collector.js +34 -10
  55. package/dist/src/debug/types.d.ts +2 -0
  56. package/dist/src/define_config.js +1 -0
  57. package/dist/src/edge/client/dashboard.js +2 -2
  58. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  59. package/dist/src/edge/client/stats-bar.js +1 -1
  60. package/dist/src/edge/client-vue/dashboard.js +5 -5
  61. package/dist/src/edge/client-vue/debug-panel-deferred.js +2 -2
  62. package/dist/src/engine/request_metrics.js +8 -10
  63. package/dist/src/log_stream/log_stream_service.d.ts +1 -0
  64. package/dist/src/log_stream/log_stream_service.js +7 -5
  65. package/dist/src/prometheus/prometheus_collector.d.ts +9 -0
  66. package/dist/src/prometheus/prometheus_collector.js +11 -0
  67. package/dist/src/provider/dashboard_init.js +15 -0
  68. package/dist/src/provider/dashboard_setup.js +9 -2
  69. package/dist/src/provider/email_bridge.js +6 -2
  70. package/dist/src/provider/email_helpers.d.ts +9 -1
  71. package/dist/src/provider/email_helpers.js +32 -4
  72. package/dist/src/provider/pino_hook.d.ts +8 -0
  73. package/dist/src/provider/pino_hook.js +19 -1
  74. package/dist/src/provider/provider_helpers_extra.d.ts +2 -0
  75. package/dist/src/provider/provider_helpers_extra.js +17 -2
  76. package/dist/src/provider/server_stats_provider.js +19 -1
  77. package/dist/src/provider/shutdown_helpers.js +2 -0
  78. package/dist/src/provider/toolbar_setup.js +17 -14
  79. package/dist/src/routes/dashboard_routes.js +96 -62
  80. package/dist/src/routes/debug_routes.js +45 -35
  81. package/dist/src/routes/no_session_middleware.d.ts +6 -3
  82. package/dist/src/routes/no_session_middleware.js +7 -3
  83. package/dist/src/routes/register_routes.d.ts +8 -0
  84. package/dist/src/routes/register_routes.js +19 -0
  85. package/dist/src/types.d.ts +31 -0
  86. package/dist/src/utils/app_import.js +12 -4
  87. package/dist/vue/CacheSection-CxEBVVkF.js +156 -0
  88. package/dist/vue/ConfigSection-BiRAiaHj.js +415 -0
  89. package/dist/vue/EmailsSection-Dl44qyqY.js +208 -0
  90. package/dist/vue/{EmailsTab-CwIF1fik.js → EmailsTab-Diya54CP.js} +6 -5
  91. package/dist/vue/{EventsSection-BpgkWIwM.js → EventsSection-CWjeitjU.js} +1 -1
  92. package/dist/vue/{InternalsTab-521fxYYj.js → InternalsTab-Z3c82glB.js} +15 -15
  93. package/dist/vue/{JobsSection-DrghFEKL.js → JobsSection-DOBb4LjZ.js} +1 -1
  94. package/dist/vue/LogsSection-CXx-HOWJ.js +260 -0
  95. package/dist/vue/{OverviewSection-BAgZTPjY.js → OverviewSection-CyfNQ8uV.js} +318 -302
  96. package/dist/vue/{QueriesSection-CUpwhp7u.js → QueriesSection-CXBsFp-y.js} +1 -1
  97. package/dist/vue/{RequestsSection-D8P2xpF2.js → RequestsSection-YTIaZGZd.js} +151 -145
  98. package/dist/vue/{RoutesSection-0qB81hTT.js → RoutesSection-CDKMey49.js} +1 -1
  99. package/dist/vue/composables/useApiClient.d.ts +8 -1
  100. package/dist/vue/index-14x39RI_.js +1239 -0
  101. package/dist/vue/index.js +1 -1
  102. package/dist/vue/style.css +1 -1
  103. package/package.json +6 -3
  104. package/dist/react/ConfigContent-CnsEI4j3.js +0 -397
  105. package/dist/react/LogsTab-jKwv9G7Q.js +0 -79
  106. package/dist/react/RequestsSection-D8cMbZU0.js +0 -321
  107. package/dist/react/index-CsprmgzI.js +0 -1121
  108. package/dist/react/useApiClient-BVtNCmnL.js +0 -9
  109. package/dist/vue/CacheSection-DRqV3YX2.js +0 -149
  110. package/dist/vue/ConfigSection-C6pQCHAL.js +0 -576
  111. package/dist/vue/EmailsSection-BTNw3ZU2.js +0 -206
  112. package/dist/vue/LogsSection-BDxx9Bfi.js +0 -258
  113. package/dist/vue/index-30jLw-_w.js +0 -1232
  114. /package/dist/core/{api-client.d.ts → core/api-client.d.ts} +0 -0
  115. /package/dist/core/{config-utils.d.ts → core/config-utils.d.ts} +0 -0
  116. /package/dist/core/{constants.d.ts → core/constants.d.ts} +0 -0
  117. /package/dist/core/{dashboard-api.d.ts → core/dashboard-api.d.ts} +0 -0
  118. /package/dist/core/{dashboard-data-controller.d.ts → core/dashboard-data-controller.d.ts} +0 -0
  119. /package/dist/core/{dashboard-data-helpers.d.ts → core/dashboard-data-helpers.d.ts} +0 -0
  120. /package/dist/core/{debug-data-controller.d.ts → core/debug-data-controller.d.ts} +0 -0
  121. /package/dist/core/{define-config-helpers.d.ts → core/define-config-helpers.d.ts} +0 -0
  122. /package/dist/core/{explain-utils.d.ts → core/explain-utils.d.ts} +0 -0
  123. /package/dist/core/{feature-detect-helpers.d.ts → core/feature-detect-helpers.d.ts} +0 -0
  124. /package/dist/core/{feature-detect.d.ts → core/feature-detect.d.ts} +0 -0
  125. /package/dist/core/{field-resolvers.d.ts → core/field-resolvers.d.ts} +0 -0
  126. /package/dist/core/{formatters-helpers.d.ts → core/formatters-helpers.d.ts} +0 -0
  127. /package/dist/core/{formatters.d.ts → core/formatters.d.ts} +0 -0
  128. /package/dist/core/{history-buffer.d.ts → core/history-buffer.d.ts} +0 -0
  129. /package/dist/core/{icons.d.ts → core/icons.d.ts} +0 -0
  130. /package/dist/core/{index.d.ts → core/index.d.ts} +0 -0
  131. /package/dist/core/{internals-utils.d.ts → core/internals-utils.d.ts} +0 -0
  132. /package/dist/core/{job-utils.d.ts → core/job-utils.d.ts} +0 -0
  133. /package/dist/core/{log-utils-helpers.d.ts → core/log-utils-helpers.d.ts} +0 -0
  134. /package/dist/core/{log-utils.d.ts → core/log-utils.d.ts} +0 -0
  135. /package/dist/core/{metrics.d.ts → core/metrics.d.ts} +0 -0
  136. /package/dist/core/{pagination.d.ts → core/pagination.d.ts} +0 -0
  137. /package/dist/core/{queries-columns.d.ts → core/queries-columns.d.ts} +0 -0
  138. /package/dist/core/{queries-controller.d.ts → core/queries-controller.d.ts} +0 -0
  139. /package/dist/core/{query-utils.d.ts → core/query-utils.d.ts} +0 -0
  140. /package/dist/core/{resizable-columns.d.ts → core/resizable-columns.d.ts} +0 -0
  141. /package/dist/core/{routes.d.ts → core/routes.d.ts} +0 -0
  142. /package/dist/core/{server-stats-controller.d.ts → core/server-stats-controller.d.ts} +0 -0
  143. /package/dist/core/{sparkline.d.ts → core/sparkline.d.ts} +0 -0
  144. /package/dist/core/{split-pane.d.ts → core/split-pane.d.ts} +0 -0
  145. /package/dist/core/{theme.d.ts → core/theme.d.ts} +0 -0
  146. /package/dist/core/{trace-utils.d.ts → core/trace-utils.d.ts} +0 -0
  147. /package/dist/core/{transmit-adapter.d.ts → core/transmit-adapter.d.ts} +0 -0
  148. /package/dist/core/{transmit-helpers.d.ts → core/transmit-helpers.d.ts} +0 -0
  149. /package/dist/core/{types-dashboard.d.ts → core/types-dashboard.d.ts} +0 -0
  150. /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-30jLw-_w.js";
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 I, computed as x, openBlock as l, createElementBlock as o, normalizeClass as v, createElementVNode as t, Fragment as f, renderList as B, normalizeStyle as U, toDisplayString as d, createTextVNode as k, createCommentVNode as p, inject as S, ref as m, watch as et, nextTick as at, onUnmounted as lt, createVNode as j, createBlock as G, unref as r } from "vue";
2
- import { initSplitPane as nt, formatTime as ot, timeAgo as it, normalizeTraceFields as dt, durationClassName as rt } from "adonisjs-server-stats/core";
3
- import { u as ut } from "./useApiClient-BQQ9CF-q.js";
4
- import { u as ct } from "./index-30jLw-_w.js";
5
- import { u as ht } from "./useResizableTable-BoivAevK.js";
6
- import { _ as mt } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
7
- import { _ as pt } from "./PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js";
8
- import { _ as vt } from "./RelatedLogs.vue_vue_type_script_setup_true_lang-Py1iu9GU.js";
9
- const ft = {
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
- }, gt = { class: "ss-dash-tl-legend" }, yt = ["title"], _t = { class: "ss-dash-tl-track" }, kt = ["title"], wt = { class: "ss-dash-tl-dur" }, bt = {
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
- }, Ct = { class: "ss-dash-tl-warnings-title" }, H = /* @__PURE__ */ I({
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, b = {
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
- }, R = {
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
- }, C = x(() => w.spans || []), y = x(
41
- () => [...C.value].sort((a, u) => a.startOffset - u.startOffset)
42
- ), T = x(() => {
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 A(a) {
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 F(a) {
59
+ function N(a) {
60
60
  return a === "db" ? "DB" : a;
61
61
  }
62
- function N(a) {
62
+ function O(a) {
63
63
  return a === "db" ? "purple" : a === "mail" ? "green" : a === "event" ? "amber" : a === "view" ? "blue" : "muted";
64
64
  }
65
- function q(a) {
66
- const u = a.metadata ? Object.entries(a.metadata).filter(([, i]) => i != null).map(([i, n]) => `${i}=${n}`).join(", ") : "";
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) => C.value.length === 0 ? (l(), o("div", ft, "No spans recorded")) : (l(), o("div", {
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", gt, [
75
- (l(), o(f, null, B(R, (i, n) => t("div", {
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: U({ background: b[n] || b.custom })
81
+ style: W({ background: C[n] || C.custom })
82
82
  }, null, 4),
83
- t("span", null, d(i), 1)
83
+ t("span", null, i(r), 1)
84
84
  ])), 64))
85
85
  ]),
86
- (l(!0), o(f, null, B(y.value, (i) => (l(), o("div", {
87
- key: i.id,
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: q(i),
93
- style: U({ paddingLeft: 8 + (T.value[i.id] || 0) * 16 + "px" })
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-${N(i.category)}`),
96
+ class: v(`ss-dash-badge ss-dash-badge-${O(r.category)}`),
97
97
  style: { "font-size": "9px", "margin-right": "4px" }
98
- }, d(F(i.category)), 3),
99
- k(" " + d(h(i.label)), 1)
100
- ], 12, yt),
101
- t("div", _t, [
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-${i.category || "custom"}`),
104
- style: U({
105
- left: A(i),
106
- width: _(i)
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: q(i)
109
- }, null, 14, kt)
108
+ title: L(r)
109
+ }, null, 14, bt)
110
110
  ]),
111
- t("span", wt, d(i.duration.toFixed(2)) + "ms", 1)
111
+ t("span", wt, i(r.duration.toFixed(2)) + "ms", 1)
112
112
  ]))), 128)),
113
- g.warnings && g.warnings.length > 0 ? (l(), o("div", bt, [
114
- t("div", Ct, "Warnings (" + d(g.warnings.length) + ")", 1),
115
- (l(!0), o(f, null, B(g.warnings, (i, n) => (l(), o("div", {
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
- }, d(i), 1))), 128))
118
+ }, i(r), 1))), 128))
119
119
  ])) : p("", !0)
120
120
  ], 2));
121
121
  }
122
- }), $t = { class: "ss-dash-tl-detail-header" }, xt = { style: { color: "var(--ss-text)" } }, Rt = { class: "ss-dash-tl-meta" }, qt = { class: "ss-dash-tl-detail-header" }, Dt = {
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
- }, Lt = {
125
+ }, St = {
126
126
  key: 1,
127
127
  class: "ss-dash-empty"
128
- }, St = { class: "ss-dash-table-wrap" }, Bt = {
128
+ }, Bt = { class: "ss-dash-table-wrap" }, Tt = {
129
129
  key: 0,
130
130
  class: "ss-dash-sort-arrow"
131
- }, Tt = {
131
+ }, At = {
132
132
  key: 0,
133
133
  class: "ss-dash-sort-arrow"
134
- }, At = {
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)" } }, Et = ["title"], Mt = { style: { color: "var(--ss-muted)", "text-align": "center" } }, Vt = {
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
- }, zt = {
146
+ }, Ut = {
147
147
  key: 1,
148
148
  style: { color: "var(--ss-dim)", "text-align": "center", display: "block" }
149
- }, Ut = ["title"], jt = {
149
+ }, jt = ["title"], Wt = {
150
150
  key: 1,
151
151
  class: "ss-dash-empty"
152
- }, Xt = /* @__PURE__ */ I({
152
+ }, ts = /* @__PURE__ */ Y({
153
153
  __name: "RequestsSection",
154
154
  setup(g) {
155
- const w = S("ss-refresh-key", m(0)), b = S("ss-dashboard-endpoint", "/__stats/api"), R = S("ss-auth-token", void 0), C = S("ss-base-url", ""), { data: y, loading: T, error: A, pagination: _, sort: h, goToPage: F, setSearch: N, setSort: q } = ct(
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: C,
159
- dashboardEndpoint: b,
160
- authToken: R,
158
+ baseUrl: $,
159
+ dashboardEndpoint: C,
160
+ authToken: D,
161
161
  refreshKey: w
162
162
  }
163
- ), a = m(""), u = m(null), i = m(!1), n = m(null), O = x(() => {
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
- }), K = ut(C, R);
168
- async function Y(c) {
167
+ }), J = ct($, D);
168
+ let k = null;
169
+ async function Q(c) {
169
170
  const e = c.id;
170
- i.value = !0;
171
+ k && k.abort(), k = new AbortController();
172
+ const s = k;
173
+ r.value = !0;
171
174
  try {
172
- const s = b || "/__stats/api", L = await K().fetch(`${s}/requests/${e}`), W = L.trace, st = W ? { ...L, ...W, logs: L.logs } : L;
173
- n.value = dt(st), u.value = c;
174
- } catch {
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
- i.value = !1;
182
+ k === s && (r.value = !1);
177
183
  }
178
184
  }
179
- function J() {
185
+ function X() {
180
186
  u.value = null, n.value = null;
181
187
  }
182
- function Q(c) {
183
- a.value = c, N(c);
188
+ function Z(c) {
189
+ a.value = c, O(c);
184
190
  }
185
- function $(c) {
186
- q(c);
191
+ function x(c) {
192
+ L(c);
187
193
  }
188
- function X(c) {
189
- return rt(c, "ss-dash");
194
+ function tt(c) {
195
+ return ut(c, "ss-dash");
190
196
  }
191
- const { tableRef: Z } = ht(() => O.value), P = m(null), E = m(null), M = m(null), V = m(null);
192
- let D = null;
193
- const z = x(() => n.value ? n.value.logs || [] : []);
194
- return et([() => u.value, () => n.value], async () => {
195
- D?.(), D = null, n.value && z.value.length > 0 && (await at(), P.value && E.value && M.value && V.value && (D = nt({
196
- container: P.value,
197
- handle: E.value,
198
- topPane: M.value,
199
- bottomPane: V.value,
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
- }), lt(() => {
203
- D?.();
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", $t, [
212
+ t("div", xt, [
207
213
  t("button", {
208
214
  type: "button",
209
215
  class: "ss-dash-btn",
210
- onClick: J
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
- }, d(n.value.method), 3),
215
- t("span", xt, d(n.value.url), 1),
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
- }, d(n.value.statusCode), 3),
219
- t("span", Rt, d(n.value.totalDuration.toFixed(1)) + "ms · " + d(n.value.spanCount) + " spans ", 1)
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
- z.value.length > 0 ? (l(), o("div", {
227
+ j.value.length > 0 ? (l(), o("div", {
222
228
  key: 0,
223
229
  ref_key: "splitContainerRef",
224
- ref: P,
230
+ ref: M,
225
231
  class: "ss-dash-split-container"
226
232
  }, [
227
233
  t("div", {
228
234
  ref_key: "splitTopRef",
229
- ref: M,
235
+ ref: z,
230
236
  class: "ss-dash-split-top"
231
237
  }, [
232
- j(H, {
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: E,
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: V,
251
+ ref: U,
246
252
  class: "ss-dash-split-bottom"
247
253
  }, [
248
- j(vt, { logs: z.value }, null, 8, ["logs"])
254
+ G(ft, { logs: j.value }, null, 8, ["logs"])
249
255
  ], 512)
250
- ], 512)) : (l(), G(H, {
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)) : i.value ? (l(), o(f, { key: 1 }, [
257
- t("div", qt, [
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) => i.value = !1)
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
- j(mt, {
272
+ G(pt, {
267
273
  "model-value": a.value,
268
274
  placeholder: "Filter requests...",
269
- summary: `${r(_).total ?? 0} requests`,
270
- "onUpdate:modelValue": Q
275
+ summary: `${d(_).total ?? 0} requests`,
276
+ "onUpdate:modelValue": Z
271
277
  }, null, 8, ["model-value", "summary"]),
272
- r(A) ? (l(), o("div", Dt, "Failed to load requests")) : p("", !0),
273
- r(T) && !r(y) ? (l(), o("div", Lt, "Loading requests...")) : (l(), o(f, { key: 2 }, [
274
- t("div", St, [
275
- O.value.length > 0 ? (l(), o("table", {
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: Z,
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) => $("method"))
302
+ onClick: e[1] || (e[1] = (s) => x("method"))
297
303
  }, [
298
- e[7] || (e[7] = k(" Method ", -1)),
299
- r(h).column === "method" ? (l(), o("span", Bt, d(r(h).direction === "asc" ? " ▲" : " ▼"), 1)) : p("", !0)
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) => $("url"))
309
+ onClick: e[2] || (e[2] = (s) => x("url"))
304
310
  }, [
305
- e[8] || (e[8] = k(" URL ", -1)),
306
- r(h).column === "url" ? (l(), o("span", Tt, d(r(h).direction === "asc" ? " ▲" : " ▼"), 1)) : p("", !0)
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) => $("statusCode"))
316
+ onClick: e[3] || (e[3] = (s) => x("statusCode"))
311
317
  }, [
312
- e[9] || (e[9] = k(" Status ", -1)),
313
- r(h).column === "statusCode" ? (l(), o("span", At, d(r(h).direction === "asc" ? " ▲" : " ▼"), 1)) : p("", !0)
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) => $("duration"))
323
+ onClick: e[4] || (e[4] = (s) => x("duration"))
318
324
  }, [
319
- e[10] || (e[10] = k(" Duration ", -1)),
320
- r(h).column === "duration" ? (l(), o("span", Ft, d(r(h).direction === "asc" ? " ▲" : " ▼"), 1)) : p("", !0)
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) => $("createdAt"))
332
+ onClick: e[5] || (e[5] = (s) => x("createdAt"))
327
333
  }, [
328
- e[11] || (e[11] = k(" Time ", -1)),
329
- r(h).column === "createdAt" ? (l(), o("span", Nt, d(r(h).direction === "asc" ? " ▲" : " ▼"), 1)) : p("", !0)
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, B(O.value, (s) => (l(), o("tr", {
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: (tt) => Y(s)
343
+ onClick: (R) => Q(s)
338
344
  }, [
339
345
  t("td", null, [
340
- t("span", Pt, d(s.id), 1)
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
- }, d(s.method), 3)
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
- }, d(s.url), 9, Et)
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
- }, d(s.status_code || s.statusCode), 3)
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 ${X(s.total_duration || s.totalDuration || s.duration || 0)}`)
361
- }, d((s.total_duration || s.totalDuration || s.duration || 0).toFixed(1)) + "ms ", 3)
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", Mt, d(s.span_count || s.spanCount || 0), 1)
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", Vt, d(s.warning_count || s.warningCount || 0), 1)) : (l(), o("span", zt, "-"))
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: r(ot)(
378
+ title: d(rt)(
373
379
  s.createdAt || s.created_at || s.timestamp || ""
374
380
  )
375
- }, d(r(it)(
381
+ }, i(d(it)(
376
382
  s.createdAt || s.created_at || s.timestamp || ""
377
- )), 9, Ut)
383
+ )), 9, jt)
378
384
  ])
379
385
  ], 8, Ot))), 128))
380
386
  ])
381
- ], 512)) : (l(), o("div", jt, "No requests recorded yet"))
387
+ ], 512)) : (l(), o("div", Wt, "No requests recorded yet"))
382
388
  ]),
383
- r(_).totalPages > 1 ? (l(), G(pt, {
389
+ d(_).totalPages > 1 ? (l(), I(vt, {
384
390
  key: 0,
385
- page: r(_).page,
386
- "last-page": r(_).totalPages,
387
- total: r(_).total,
388
- onPageChange: r(F)
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
- Xt as default
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-30jLw-_w.js";
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;