adonisjs-server-stats 1.13.0 → 1.14.1

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 +13 -9
  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,7 +1,7 @@
1
1
  import { jsxs as o, jsx as t } from "react/jsx-runtime";
2
2
  import { useState as c, useCallback as k } from "react";
3
3
  import { formatCacheSize as x, formatTtl as D } from "adonisjs-server-stats/core";
4
- import { a as N, J as V } from "./index-CsprmgzI.js";
4
+ import { a as N, J as V } from "./index-DOSlCpZ9.js";
5
5
  import { C as L } from "./CacheStatsBar-CRodCOeP.js";
6
6
  import { D as F } from "./DataTable-YyShr5B-.js";
7
7
  import { F as T } from "./FilterBar-CQ7bD669.js";
@@ -1,76 +1,81 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- import { useState as u, useMemo as T, useCallback as z } from "react";
3
- import { formatTtl as K, formatCacheSize as L } from "adonisjs-server-stats/core";
4
- import { u as R } from "./useDashboardApiBase-Bi36pJ2L.js";
5
- import { u as $, J as j } from "./index-CsprmgzI.js";
6
- import { u as A } from "./useResizableTable-CNJmACdt.js";
7
- import { C as F } from "./CacheStatsBar-CRodCOeP.js";
8
- import { F as D } from "./FilterBar-CQ7bD669.js";
9
- function G({ options: l, dashboardPath: y }) {
10
- const { dashApiBase: p, resolvedOptions: k } = R(y, l), { data: a, isLoading: C, error: b } = $("cache", k), [r, N] = u(""), [i, n] = u(null), [f, h] = u(null), o = T(() => {
2
+ import { useState as p, useRef as z, useMemo as A, useCallback as K, useEffect as L } from "react";
3
+ import { formatTtl as $, formatCacheSize as j } from "adonisjs-server-stats/core";
4
+ import { u as F } from "./useDashboardApiBase-Bi36pJ2L.js";
5
+ import { u as D, J as E } from "./index-DOSlCpZ9.js";
6
+ import { u as V } from "./useResizableTable-CNJmACdt.js";
7
+ import { C as J } from "./CacheStatsBar-CRodCOeP.js";
8
+ import { F as M } from "./FilterBar-CQ7bD669.js";
9
+ function Y({ options: c, dashboardPath: C }) {
10
+ const { dashApiBase: f, resolvedOptions: N } = F(C, c), { data: a, isLoading: w, error: g } = D("cache", N), [l, v] = p(""), [i, d] = p(null), [y, h] = p(null), m = z(null), o = A(() => {
11
11
  const s = a?.keys || [];
12
- if (!r) return s;
13
- const m = r.toLowerCase();
14
- return s.filter((c) => c.key.toLowerCase().includes(m));
15
- }, [a, r]), v = z(
12
+ if (!l) return s;
13
+ const r = l.toLowerCase();
14
+ return s.filter((u) => u.key.toLowerCase().includes(r));
15
+ }, [a, l]), x = K(
16
16
  async (s) => {
17
- if (i === s) {
18
- n(null), h(null);
17
+ if (m.current?.abort(), i === s) {
18
+ d(null), h(null);
19
19
  return;
20
20
  }
21
- n(s);
21
+ d(s);
22
+ const r = new AbortController();
23
+ m.current = r;
22
24
  try {
23
- const { baseUrl: m = "", authToken: c } = l || {}, x = p || l?.debugEndpoint || "/admin/api/debug", B = `${m}${x}/cache/${encodeURIComponent(s)}`, g = { Accept: "application/json" };
24
- c && (g.Authorization = `Bearer ${c}`);
25
- const S = await (await fetch(B, {
26
- headers: g,
27
- credentials: c ? "omit" : "same-origin"
25
+ const { baseUrl: u = "", authToken: b } = c || {}, R = f || c?.debugEndpoint || "/admin/api/debug", S = `${u}${R}/cache/${encodeURIComponent(s)}`, k = { Accept: "application/json" };
26
+ b && (k.Authorization = `Bearer ${b}`);
27
+ const T = await (await fetch(S, {
28
+ headers: k,
29
+ credentials: b ? "omit" : "same-origin",
30
+ signal: r.signal
28
31
  })).json();
29
- h(S);
32
+ h(T);
30
33
  } catch {
31
- h({ error: "Failed to fetch key value" });
34
+ r.signal.aborted || h({ error: "Failed to fetch key value" });
32
35
  }
33
36
  },
34
- [i, l, p]
35
- ), w = A([o]);
36
- if (C && !a)
37
+ [i, c, f]
38
+ );
39
+ L(() => () => m.current?.abort(), []);
40
+ const B = V([o]);
41
+ if (w && !a)
37
42
  return /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Loading cache data..." });
38
- if (b)
43
+ if (g)
39
44
  return /* @__PURE__ */ t("div", { className: "ss-dbg-empty", children: [
40
45
  "Error: ",
41
- b.message
46
+ g.message
42
47
  ] });
43
48
  if (!a)
44
49
  return /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "Cache inspector not available" });
45
- const d = a.stats || a;
50
+ const n = a.stats || a;
46
51
  return /* @__PURE__ */ t("div", { children: [
47
52
  /* @__PURE__ */ e(
48
- F,
53
+ J,
49
54
  {
50
- hitRate: d.hitRate ?? 0,
51
- hits: d.totalHits ?? 0,
52
- misses: d.totalMisses ?? 0,
53
- keys: d.keyCount ?? 0
55
+ hitRate: n.hitRate ?? 0,
56
+ hits: n.totalHits ?? 0,
57
+ misses: n.totalMisses ?? 0,
58
+ keys: n.keyCount ?? 0
54
59
  }
55
60
  ),
56
61
  /* @__PURE__ */ e(
57
- D,
62
+ M,
58
63
  {
59
- search: r,
60
- onSearchChange: N,
64
+ search: l,
65
+ onSearchChange: v,
61
66
  placeholder: "Filter keys...",
62
67
  summary: `${o.length} keys`
63
68
  }
64
69
  ),
65
- i && !!f && /* @__PURE__ */ t("div", { className: "ss-dbg-cache-detail", children: [
70
+ i && !!y && /* @__PURE__ */ t("div", { className: "ss-dbg-cache-detail", children: [
66
71
  /* @__PURE__ */ e("strong", { children: i }),
67
- /* @__PURE__ */ t("button", { type: "button", className: "ss-dbg-btn-clear", onClick: () => n(null), children: [
72
+ /* @__PURE__ */ t("button", { type: "button", className: "ss-dbg-btn-clear", onClick: () => d(null), children: [
68
73
  "←",
69
74
  " Back"
70
75
  ] }),
71
- /* @__PURE__ */ e(j, { data: f, classPrefix: "ss-dbg" })
76
+ /* @__PURE__ */ e(E, { data: y, classPrefix: "ss-dbg" })
72
77
  ] }),
73
- o.length === 0 ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "No cache keys found" }) : /* @__PURE__ */ t("table", { ref: w, className: "ss-dbg-table", children: [
78
+ o.length === 0 ? /* @__PURE__ */ e("div", { className: "ss-dbg-empty", children: "No cache keys found" }) : /* @__PURE__ */ t("table", { ref: B, className: "ss-dbg-table", children: [
74
79
  /* @__PURE__ */ t("colgroup", { children: [
75
80
  /* @__PURE__ */ e("col", {}),
76
81
  /* @__PURE__ */ e("col", { style: { width: "80px" } }),
@@ -87,12 +92,12 @@ function G({ options: l, dashboardPath: y }) {
87
92
  "tr",
88
93
  {
89
94
  className: "ss-dbg-email-row",
90
- onClick: () => v(s.key),
95
+ onClick: () => x(s.key),
91
96
  children: [
92
97
  /* @__PURE__ */ e("td", { className: "ss-dbg-c-sql", children: s.key }),
93
98
  /* @__PURE__ */ e("td", { className: "ss-dbg-c-muted", children: s.type }),
94
- /* @__PURE__ */ e("td", { className: "ss-dbg-c-muted", children: s.ttl > 0 ? K(s.ttl) : "-" }),
95
- /* @__PURE__ */ e("td", { className: "ss-dbg-c-dim", children: s.size > 0 ? L(s.size) : "-" })
99
+ /* @__PURE__ */ e("td", { className: "ss-dbg-c-muted", children: s.ttl > 0 ? $(s.ttl) : "-" }),
100
+ /* @__PURE__ */ e("td", { className: "ss-dbg-c-dim", children: s.size > 0 ? j(s.size) : "-" })
96
101
  ]
97
102
  },
98
103
  s.key
@@ -101,6 +106,6 @@ function G({ options: l, dashboardPath: y }) {
101
106
  ] });
102
107
  }
103
108
  export {
104
- G as CacheTab,
105
- G as default
109
+ Y as CacheTab,
110
+ Y as default
106
111
  };
@@ -0,0 +1,350 @@
1
+ import { jsxs as o, jsx as e, Fragment as T } from "react/jsx-runtime";
2
+ import { useState as v, useEffect as j, useCallback as m, useRef as N } from "react";
3
+ import { collectTopLevelObjectKeys as E, isRedactedValue as y, copyWithFeedback as C, flattenConfig as L, formatFlatValue as S, countLeaves as R } from "adonisjs-server-stats/core";
4
+ function x({ redacted: l, p: i }) {
5
+ return /* @__PURE__ */ e(
6
+ "span",
7
+ {
8
+ className: `${i}-config-redacted`,
9
+ style: { display: "inline-flex", alignItems: "center", gap: "4px" },
10
+ children: /* @__PURE__ */ e("span", { children: l.display })
11
+ }
12
+ );
13
+ }
14
+ function F({
15
+ env: l,
16
+ search: i,
17
+ p: a
18
+ }) {
19
+ const t = N(/* @__PURE__ */ new Map()), h = i.toLowerCase(), s = Object.entries(l).filter(([r, n]) => {
20
+ if (!h) return !0;
21
+ const c = y(n) ? n.display : n == null ? "" : String(n);
22
+ return r.toLowerCase().includes(h) || c.toLowerCase().includes(h);
23
+ });
24
+ return /* @__PURE__ */ e("div", { className: `${a}-config-table-wrap`, children: /* @__PURE__ */ o("table", { className: `${a}-table ${a}-config-env-table`, children: [
25
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { children: [
26
+ /* @__PURE__ */ e("th", { children: "Variable" }),
27
+ /* @__PURE__ */ e("th", { children: "Value" }),
28
+ /* @__PURE__ */ e("th", { style: { width: 36 } })
29
+ ] }) }),
30
+ /* @__PURE__ */ o("tbody", { children: [
31
+ s.map(([r, n]) => {
32
+ const c = y(n), p = c ? n.display : n == null ? "null" : String(n), g = `${r}=${p}`;
33
+ return /* @__PURE__ */ o("tr", { children: [
34
+ /* @__PURE__ */ e("td", { className: `${a}-env-key`, children: /* @__PURE__ */ e("span", { className: `${a}-config-key`, children: r }) }),
35
+ /* @__PURE__ */ e("td", { className: `${a}-env-val`, children: c ? /* @__PURE__ */ e(x, { redacted: n, p: a }) : /* @__PURE__ */ e("span", { className: `${a}-config-val`, children: p }) }),
36
+ /* @__PURE__ */ e("td", { children: !c && /* @__PURE__ */ e(
37
+ "button",
38
+ {
39
+ type: "button",
40
+ className: `${a}-copy-row-btn`,
41
+ title: "Copy",
42
+ ref: (d) => {
43
+ t.current.set(r, d);
44
+ },
45
+ onClick: (d) => {
46
+ d.stopPropagation(), C(g, t.current.get(r) ?? null, a);
47
+ },
48
+ children: "⎘"
49
+ }
50
+ ) })
51
+ ] }, r);
52
+ }),
53
+ s.length === 0 && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 3, style: { textAlign: "center", color: "var(--ss-dim)" }, children: "No matching variables" }) })
54
+ ] })
55
+ ] }) });
56
+ }
57
+ function I({
58
+ source: l,
59
+ search: i,
60
+ p: a
61
+ }) {
62
+ const t = N(/* @__PURE__ */ new Map()), h = i.toLowerCase(), s = L(l, ""), r = s.filter((n) => {
63
+ const c = y(n.value) ? n.value.display : n.value === null || n.value === void 0 ? "" : String(n.value);
64
+ return n.path.toLowerCase().includes(h) || c.toLowerCase().includes(h);
65
+ });
66
+ return /* @__PURE__ */ o("div", { className: `${a}-config-table-wrap`, children: [
67
+ /* @__PURE__ */ o("table", { className: `${a}-table`, children: [
68
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { children: [
69
+ /* @__PURE__ */ e("th", { children: "Path" }),
70
+ /* @__PURE__ */ e("th", { children: "Value" }),
71
+ /* @__PURE__ */ e("th", { style: { width: 36 } })
72
+ ] }) }),
73
+ /* @__PURE__ */ o("tbody", { children: [
74
+ r.map((n) => {
75
+ const c = y(n.value), p = c ? null : S(n.value), g = c ? n.value.display : p.text, d = `${n.path}: ${g}`;
76
+ return /* @__PURE__ */ o("tr", { children: [
77
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: `${a}-config-key`, style: { whiteSpace: "nowrap" }, children: n.path }) }),
78
+ /* @__PURE__ */ e("td", { children: c ? /* @__PURE__ */ e(x, { redacted: n.value, p: a }) : /* @__PURE__ */ e(
79
+ "span",
80
+ {
81
+ className: `${a}-config-val`,
82
+ style: { wordBreak: "break-all", color: p.color },
83
+ children: p.text
84
+ }
85
+ ) }),
86
+ /* @__PURE__ */ e("td", { children: !c && /* @__PURE__ */ e(
87
+ "button",
88
+ {
89
+ type: "button",
90
+ className: `${a}-copy-row-btn`,
91
+ title: "Copy",
92
+ ref: (b) => {
93
+ t.current.set(n.path, b);
94
+ },
95
+ onClick: (b) => {
96
+ b.stopPropagation(), C(d, t.current.get(n.path) ?? null, a);
97
+ },
98
+ children: "⎘"
99
+ }
100
+ ) })
101
+ ] }, n.path);
102
+ }),
103
+ r.length === 0 && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 3, style: { textAlign: "center", color: "var(--ss-dim)" }, children: "No matching entries" }) })
104
+ ] })
105
+ ] }),
106
+ /* @__PURE__ */ o(
107
+ "div",
108
+ {
109
+ style: {
110
+ padding: "4px 16px",
111
+ fontSize: "10px",
112
+ color: "var(--ss-muted)"
113
+ },
114
+ children: [
115
+ r.length,
116
+ " of ",
117
+ s.length,
118
+ " entries"
119
+ ]
120
+ }
121
+ )
122
+ ] });
123
+ }
124
+ function J({ obj: l, prefix: i, p: a }) {
125
+ const t = N(/* @__PURE__ */ new Map()), h = L(l, i);
126
+ return /* @__PURE__ */ o("table", { className: `${a}-table ${a}-config-inner-table`, children: [
127
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { children: [
128
+ /* @__PURE__ */ e("th", { style: { width: "35%" }, children: "Key" }),
129
+ /* @__PURE__ */ e("th", { children: "Value" }),
130
+ /* @__PURE__ */ e("th", { style: { width: 36 } })
131
+ ] }) }),
132
+ /* @__PURE__ */ e("tbody", { children: h.map((s) => {
133
+ const r = s.path.indexOf(i + ".") === 0 ? s.path.slice(i.length + 1) : s.path, n = y(s.value), c = n ? null : S(s.value), p = n ? s.value.display : c.text, g = `${s.path}: ${p}`;
134
+ return /* @__PURE__ */ o("tr", { children: [
135
+ /* @__PURE__ */ e("td", { title: r, children: /* @__PURE__ */ e("span", { className: `${a}-config-key`, children: r }) }),
136
+ /* @__PURE__ */ e("td", { title: p, children: n ? /* @__PURE__ */ e(x, { redacted: s.value, p: a }) : /* @__PURE__ */ e("span", { className: `${a}-config-val`, style: { color: c.color }, children: c.text }) }),
137
+ /* @__PURE__ */ e("td", { children: !n && /* @__PURE__ */ e(
138
+ "button",
139
+ {
140
+ type: "button",
141
+ className: `${a}-copy-row-btn`,
142
+ title: "Copy",
143
+ ref: (d) => {
144
+ t.current.set(s.path, d);
145
+ },
146
+ onClick: (d) => {
147
+ d.stopPropagation(), C(g, t.current.get(s.path) ?? null, a);
148
+ },
149
+ children: "⎘"
150
+ }
151
+ ) })
152
+ ] }, s.path);
153
+ }) })
154
+ ] });
155
+ }
156
+ function M({ value: l, p: i }) {
157
+ if (l == null)
158
+ return /* @__PURE__ */ e("span", { className: `${i}-config-val`, style: { color: "var(--ss-dim)" }, children: "null" });
159
+ if (y(l))
160
+ return /* @__PURE__ */ e(x, { redacted: l, p: i });
161
+ if (typeof l == "boolean")
162
+ return /* @__PURE__ */ e(
163
+ "span",
164
+ {
165
+ className: `${i}-config-val`,
166
+ style: { color: l ? "var(--ss-green-fg)" : "var(--ss-red-fg)" },
167
+ children: String(l)
168
+ }
169
+ );
170
+ if (typeof l == "number")
171
+ return /* @__PURE__ */ e("span", { className: `${i}-config-val`, style: { color: "var(--ss-amber-fg)" }, children: String(l) });
172
+ if (Array.isArray(l)) {
173
+ const a = l.map((t) => t == null ? "null" : typeof t == "object" ? JSON.stringify(t) : String(t));
174
+ return /* @__PURE__ */ o("span", { className: `${i}-config-val`, style: { color: "var(--ss-purple-fg)" }, children: [
175
+ "[",
176
+ a.join(", "),
177
+ "]"
178
+ ] });
179
+ }
180
+ return typeof l == "object" ? /* @__PURE__ */ e("span", { className: `${i}-config-val`, style: { color: "var(--ss-dim)" }, children: JSON.stringify(l) }) : /* @__PURE__ */ e("span", { className: `${i}-config-val`, children: String(l) });
181
+ }
182
+ function K({
183
+ obj: l,
184
+ expandedPaths: i,
185
+ onToggle: a,
186
+ p: t
187
+ }) {
188
+ if (l == null || typeof l != "object" || Array.isArray(l) || y(l))
189
+ return null;
190
+ const h = Object.keys(l), s = N(/* @__PURE__ */ new Map());
191
+ return /* @__PURE__ */ e("div", { className: `${t}-config-sections`, children: h.map((r) => {
192
+ const n = l[r], c = n !== null && typeof n == "object" && !Array.isArray(n) && !y(n), p = i.has(r), g = y(n);
193
+ return /* @__PURE__ */ o("div", { className: `${t}-config-section`, children: [
194
+ /* @__PURE__ */ o(
195
+ "div",
196
+ {
197
+ className: `${t}-config-section-header${c ? "" : ` ${t}-config-leaf`}`,
198
+ onClick: c ? () => a(r) : void 0,
199
+ style: { cursor: c ? "pointer" : "default" },
200
+ children: [
201
+ c ? /* @__PURE__ */ e("span", { className: `${t}-config-toggle`, children: p ? "▼" : "▶" }) : /* @__PURE__ */ e("span", { className: `${t}-config-toggle`, style: { visibility: "hidden" }, children: "•" }),
202
+ /* @__PURE__ */ e("span", { className: `${t}-config-key`, children: r }),
203
+ c ? /* @__PURE__ */ o("span", { className: `${t}-config-count`, children: [
204
+ R(n),
205
+ " entries"
206
+ ] }) : /* @__PURE__ */ o(T, { children: [
207
+ /* @__PURE__ */ e("span", { className: `${t}-config-val`, style: { marginLeft: "8px" }, children: /* @__PURE__ */ e(M, { value: n, p: t }) }),
208
+ !g && /* @__PURE__ */ e(
209
+ "button",
210
+ {
211
+ type: "button",
212
+ className: `${t}-copy-row-btn`,
213
+ style: { marginLeft: "4px" },
214
+ title: "Copy",
215
+ ref: (d) => {
216
+ s.current.set(r, d);
217
+ },
218
+ onClick: (d) => {
219
+ d.stopPropagation();
220
+ const b = S(n);
221
+ C(
222
+ `${r}: ${b.text}`,
223
+ s.current.get(r) ?? null,
224
+ t
225
+ );
226
+ },
227
+ children: "⎘"
228
+ }
229
+ )
230
+ ] })
231
+ ]
232
+ }
233
+ ),
234
+ c && p && /* @__PURE__ */ e("div", { className: `${t}-config-section-body`, children: /* @__PURE__ */ e(J, { obj: n, prefix: r, p: t }) })
235
+ ] }, r);
236
+ }) });
237
+ }
238
+ function W({ data: l, isLoading: i, classPrefix: a }) {
239
+ const t = a, [h, s] = v(""), [r, n] = v(""), [c, p] = v("app"), [g, d] = v(/* @__PURE__ */ new Set()), [b, A] = v("Copy JSON");
240
+ j(() => {
241
+ const f = setTimeout(() => n(h), 200);
242
+ return () => clearTimeout(f);
243
+ }, [h]);
244
+ const u = l, V = m((f) => {
245
+ d((w) => {
246
+ const $ = new Set(w);
247
+ return $.has(f) ? $.delete(f) : $.add(f), $;
248
+ });
249
+ }, []), k = m(() => {
250
+ if (!u) return;
251
+ const f = c === "app" ? u.app : u.env;
252
+ if (!f) return;
253
+ const w = E(f);
254
+ d(new Set(w));
255
+ }, [u, c]), O = m(() => {
256
+ d(/* @__PURE__ */ new Set());
257
+ }, []), P = m(async () => {
258
+ if (u)
259
+ try {
260
+ const f = c === "app" ? u.app : u.env;
261
+ await navigator.clipboard.writeText(JSON.stringify(f, null, 2)), A("Copied!"), setTimeout(() => A("Copy JSON"), 1500);
262
+ } catch {
263
+ }
264
+ }, [u, c]);
265
+ return /* @__PURE__ */ o("div", { children: [
266
+ /* @__PURE__ */ o(
267
+ "div",
268
+ {
269
+ className: `${t}-config-toolbar`,
270
+ style: {
271
+ display: "flex",
272
+ alignItems: "center",
273
+ gap: "8px",
274
+ padding: "8px 12px"
275
+ },
276
+ children: [
277
+ /* @__PURE__ */ e(
278
+ "button",
279
+ {
280
+ type: "button",
281
+ className: `${t}-config-tab${c === "app" ? ` ${t}-active` : ""}`,
282
+ onClick: () => p("app"),
283
+ children: "App Config"
284
+ }
285
+ ),
286
+ /* @__PURE__ */ e(
287
+ "button",
288
+ {
289
+ type: "button",
290
+ className: `${t}-config-tab${c === "env" ? ` ${t}-active` : ""}`,
291
+ onClick: () => p("env"),
292
+ children: "Env"
293
+ }
294
+ ),
295
+ /* @__PURE__ */ o("div", { style: { position: "relative", flex: 1 }, children: [
296
+ /* @__PURE__ */ e(
297
+ "input",
298
+ {
299
+ type: "text",
300
+ className: `${t}-search`,
301
+ placeholder: "Search keys and values...",
302
+ value: h,
303
+ onChange: (f) => s(f.target.value),
304
+ style: { width: "100%" }
305
+ }
306
+ ),
307
+ h && /* @__PURE__ */ e(
308
+ "button",
309
+ {
310
+ type: "button",
311
+ onClick: () => s(""),
312
+ style: {
313
+ position: "absolute",
314
+ right: "6px",
315
+ top: "50%",
316
+ transform: "translateY(-50%)",
317
+ background: "none",
318
+ border: "none",
319
+ cursor: "pointer",
320
+ fontSize: "14px",
321
+ color: "var(--ss-dim)",
322
+ padding: "0 2px",
323
+ lineHeight: 1
324
+ },
325
+ children: "×"
326
+ }
327
+ )
328
+ ] }),
329
+ c === "app" && !r && /* @__PURE__ */ o(T, { children: [
330
+ /* @__PURE__ */ e("button", { type: "button", className: `${t}-btn`, onClick: k, children: "Expand All" }),
331
+ /* @__PURE__ */ e("button", { type: "button", className: `${t}-btn`, onClick: O, children: "Collapse All" })
332
+ ] }),
333
+ /* @__PURE__ */ e("button", { type: "button", className: `${t}-btn`, onClick: P, children: b })
334
+ ]
335
+ }
336
+ ),
337
+ i && !l ? /* @__PURE__ */ e("div", { className: `${t}-empty`, children: "Loading config..." }) : u ? c === "env" ? /* @__PURE__ */ e(F, { env: u.env ?? {}, search: r, p: t }) : r ? /* @__PURE__ */ e(I, { source: u.app ?? {}, search: r, p: t }) : /* @__PURE__ */ e("div", { className: `${t}-config-table-wrap`, children: /* @__PURE__ */ e(
338
+ K,
339
+ {
340
+ obj: u.app,
341
+ expandedPaths: g,
342
+ onToggle: V,
343
+ p: t
344
+ }
345
+ ) }) : /* @__PURE__ */ e("div", { className: `${t}-empty`, children: "Config not available" })
346
+ ] });
347
+ }
348
+ export {
349
+ W as C
350
+ };
@@ -1,6 +1,6 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import { a as i } from "./index-CsprmgzI.js";
3
- import { C as n } from "./ConfigContent-CnsEI4j3.js";
2
+ import { a as i } from "./index-DOSlCpZ9.js";
3
+ import { C as n } from "./ConfigContent-Bwvfl_G7.js";
4
4
  function m({ options: o = {} }) {
5
5
  const { data: a, isLoading: s } = i("config", o);
6
6
  return /* @__PURE__ */ t(n, { data: a, isLoading: s, classPrefix: "ss-dash" });
@@ -1,7 +1,7 @@
1
1
  import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
2
  import { u as f } from "./useDashboardApiBase-Bi36pJ2L.js";
3
- import { u as m } from "./index-CsprmgzI.js";
4
- import { C as d } from "./ConfigContent-CnsEI4j3.js";
3
+ import { u as m } from "./index-DOSlCpZ9.js";
4
+ import { C as d } from "./ConfigContent-Bwvfl_G7.js";
5
5
  function b({ options: r, dashboardPath: o }) {
6
6
  const { resolvedOptions: a } = f(o, r), { data: e, isLoading: t, error: s } = m("config", a);
7
7
  return s ? /* @__PURE__ */ i("div", { className: "ss-dbg-empty", children: [
@@ -1,7 +1,7 @@
1
1
  import { jsxs as l, jsx as r } from "react/jsx-runtime";
2
2
  import { useState as w, useMemo as f } from "react";
3
3
  import { compactPreview as k, formatDuration as x, durationClassName as M } from "adonisjs-server-stats/core";
4
- import { u as L, B as A, M as B } from "./index-CsprmgzI.js";
4
+ import { u as L, B as A, M as B } from "./index-DOSlCpZ9.js";
5
5
  import { T as b } from "./TimeAgoCell-o3KigGfM.js";
6
6
  import { u as D } from "./useResizableTable-CNJmACdt.js";
7
7
  import { F as P } from "./FilterBar-CQ7bD669.js";
@@ -2,7 +2,7 @@ import { jsx as s, jsxs as y, Fragment as P } from "react/jsx-runtime";
2
2
  import { useState as l, useEffect as T, useCallback as j } from "react";
3
3
  import { resolveCcAddr as N, resolveToAddr as f, resolveFromAddr as b, resolveAttachmentCount as F, resolveTimestamp as _ } from "adonisjs-server-stats/core";
4
4
  import { T as $ } from "./TimeAgoCell-o3KigGfM.js";
5
- import { a as D } from "./index-CsprmgzI.js";
5
+ import { a as D } from "./index-DOSlCpZ9.js";
6
6
  import { D as E } from "./DataTable-YyShr5B-.js";
7
7
  import { F as O } from "./FilterBar-CQ7bD669.js";
8
8
  import { E as B } from "./EmailPreviewOverlay-BmXOAvqG.js";