adonisjs-server-stats 1.10.0 → 1.11.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 (248) hide show
  1. package/README.md +23 -14
  2. package/dist/core/config-utils.d.ts +8 -0
  3. package/dist/core/constants.d.ts +4 -0
  4. package/dist/core/dashboard-data-controller.d.ts +16 -0
  5. package/dist/core/dashboard-data-helpers.d.ts +12 -0
  6. package/dist/core/debug-data-controller.d.ts +4 -0
  7. package/dist/core/define-config-helpers.d.ts +25 -0
  8. package/dist/core/feature-detect-helpers.d.ts +36 -0
  9. package/dist/core/field-resolvers.d.ts +64 -0
  10. package/dist/core/formatters-helpers.d.ts +23 -0
  11. package/dist/core/formatters.d.ts +15 -0
  12. package/dist/core/index.d.ts +1 -1
  13. package/dist/core/index.js +599 -509
  14. package/dist/core/log-utils-helpers.d.ts +13 -0
  15. package/dist/core/metrics.d.ts +3 -28
  16. package/dist/core/pagination.d.ts +0 -9
  17. package/dist/core/server-stats-controller.d.ts +6 -0
  18. package/dist/core/transmit-helpers.d.ts +7 -0
  19. package/dist/core/types-dashboard.d.ts +178 -0
  20. package/dist/core/types-diagnostics.d.ts +85 -0
  21. package/dist/core/types.d.ts +10 -442
  22. package/dist/react/CacheSection-BYN53kYO.js +135 -0
  23. package/dist/react/CacheStatsBar-CRodCOeP.js +27 -0
  24. package/dist/react/CacheTab-DOhuK05d.js +106 -0
  25. package/dist/react/{ConfigSection-DfFd-WRq.js → ConfigSection-B9EHh4Rp.js} +1 -1
  26. package/dist/react/{ConfigTab-Bdg8YMer.js → ConfigTab-C8kriE2b.js} +1 -1
  27. package/dist/react/CustomPaneTab-CvzQS_Wh.js +99 -0
  28. package/dist/react/EmailPreviewOverlay-BmXOAvqG.js +58 -0
  29. package/dist/react/EmailsSection-BJyFJf7A.js +226 -0
  30. package/dist/react/EmailsTab-Ch8jp10B.js +110 -0
  31. package/dist/react/{EventsSection-ByQ-9blq.js → EventsSection-DJPwHeT8.js} +28 -27
  32. package/dist/react/EventsTab-B-FoehXC.js +58 -0
  33. package/dist/react/{FilterBar-DQRXpWrb.js → FilterBar-CQ7bD669.js} +15 -15
  34. package/dist/react/{InternalsContent-DBzsI0CG.js → InternalsContent-O8ino9oM.js} +133 -109
  35. package/dist/react/InternalsSection-B6VlVx5f.js +22 -0
  36. package/dist/react/InternalsTab-CkEKpRMU.js +17 -0
  37. package/dist/react/JobStatsBar-C7RslAFE.js +30 -0
  38. package/dist/react/JobsSection-DWF4i1t_.js +167 -0
  39. package/dist/react/JobsTab-DqnifQXV.js +129 -0
  40. package/dist/react/LogEntryRow-CMMkqA9M.js +43 -0
  41. package/dist/react/LogsSection-C1xC5aP4.js +198 -0
  42. package/dist/react/LogsTab-CS4sLfLw.js +79 -0
  43. package/dist/react/{OverviewSection-C4T1ur51.js → OverviewSection-CxvfOR0v.js} +70 -80
  44. package/dist/react/QueriesSection-CrMdU5Ax.js +458 -0
  45. package/dist/react/{QueriesTab-osLUWd4L.js → QueriesTab-x85PjkyS.js} +38 -40
  46. package/dist/react/RequestsSection-DETN9oZb.js +321 -0
  47. package/dist/react/{RoutesSection-BUSkM6PY.js → RoutesSection-CmorkJeC.js} +2 -2
  48. package/dist/react/RoutesTab-CbzBOzpc.js +68 -0
  49. package/dist/react/SplitPaneWrapper-BiIgT4ND.js +49 -0
  50. package/dist/react/TimeAgoCell-o3KigGfM.js +8 -0
  51. package/dist/react/{TimelineTab-Covg5weo.js → TimelineTab-Ue9tUD_n.js} +76 -102
  52. package/dist/react/index-DwDK-4oX.js +1121 -0
  53. package/dist/react/index.js +6 -6
  54. package/dist/react/react/components/shared/CacheStatsBar.d.ts +13 -0
  55. package/dist/react/react/components/shared/EmailPreviewOverlay.d.ts +29 -0
  56. package/dist/react/react/components/{Dashboard/shared → shared}/FilterBar.d.ts +4 -3
  57. package/dist/react/react/components/shared/JobStatsBar.d.ts +12 -0
  58. package/dist/react/react/components/shared/LogEntryRow.d.ts +9 -0
  59. package/dist/react/react/components/shared/RelatedLogs.d.ts +2 -2
  60. package/dist/react/react/components/shared/SplitPaneWrapper.d.ts +7 -0
  61. package/dist/react/react/components/shared/TimeAgoCell.d.ts +17 -0
  62. package/dist/react/react/hooks/useDashboardData.d.ts +4 -8
  63. package/dist/react/react/hooks/useDiagnosticsData.d.ts +14 -0
  64. package/dist/react/style.css +1 -1
  65. package/dist/src/collectors/app_collector.d.ts +0 -8
  66. package/dist/src/collectors/app_collector.js +45 -52
  67. package/dist/src/collectors/auto_detect.d.ts +0 -23
  68. package/dist/src/collectors/auto_detect.js +33 -55
  69. package/dist/src/collectors/db_pool_collector.d.ts +14 -16
  70. package/dist/src/collectors/db_pool_collector.js +72 -57
  71. package/dist/src/collectors/log_collector.d.ts +0 -47
  72. package/dist/src/collectors/log_collector.js +36 -65
  73. package/dist/src/collectors/queue_collector.d.ts +0 -20
  74. package/dist/src/collectors/queue_collector.js +60 -76
  75. package/dist/src/collectors/redis_collector.d.ts +10 -10
  76. package/dist/src/collectors/redis_collector.js +69 -66
  77. package/dist/src/config/deprecation_migration.d.ts +7 -0
  78. package/dist/src/config/deprecation_migration.js +201 -0
  79. package/dist/src/controller/debug_controller.d.ts +1 -1
  80. package/dist/src/controller/debug_controller.js +87 -81
  81. package/dist/src/dashboard/cache_handlers.d.ts +14 -0
  82. package/dist/src/dashboard/cache_handlers.js +52 -0
  83. package/dist/src/dashboard/chart_aggregator.d.ts +0 -7
  84. package/dist/src/dashboard/chart_aggregator.js +68 -50
  85. package/dist/src/dashboard/coalesce_cache.d.ts +25 -0
  86. package/dist/src/dashboard/coalesce_cache.js +47 -0
  87. package/dist/src/dashboard/dashboard_controller.d.ts +11 -37
  88. package/dist/src/dashboard/dashboard_controller.js +51 -544
  89. package/dist/src/dashboard/dashboard_page_assets.d.ts +17 -0
  90. package/dist/src/dashboard/dashboard_page_assets.js +51 -0
  91. package/dist/src/dashboard/dashboard_store.d.ts +19 -218
  92. package/dist/src/dashboard/dashboard_store.js +115 -1116
  93. package/dist/src/dashboard/dashboard_types.d.ts +83 -0
  94. package/dist/src/dashboard/dashboard_types.js +4 -0
  95. package/dist/src/dashboard/detail_queries.d.ts +19 -0
  96. package/dist/src/dashboard/detail_queries.js +98 -0
  97. package/dist/src/dashboard/email_event_builder.d.ts +8 -0
  98. package/dist/src/dashboard/email_event_builder.js +65 -0
  99. package/dist/src/dashboard/explain_query.d.ts +8 -0
  100. package/dist/src/dashboard/explain_query.js +22 -0
  101. package/dist/src/dashboard/filter_handlers.d.ts +23 -0
  102. package/dist/src/dashboard/filter_handlers.js +56 -0
  103. package/dist/src/dashboard/filtered_queries.d.ts +15 -0
  104. package/dist/src/dashboard/filtered_queries.js +155 -0
  105. package/dist/src/dashboard/flush_manager.d.ts +25 -0
  106. package/dist/src/dashboard/flush_manager.js +107 -0
  107. package/dist/src/dashboard/format_helpers.d.ts +126 -0
  108. package/dist/src/dashboard/format_helpers.js +140 -0
  109. package/dist/src/dashboard/inspector_manager.d.ts +36 -0
  110. package/dist/src/dashboard/inspector_manager.js +102 -0
  111. package/dist/src/dashboard/integrations/config_inspector.js +11 -13
  112. package/dist/src/dashboard/integrations/queue_inspector.d.ts +3 -3
  113. package/dist/src/dashboard/integrations/queue_inspector.js +13 -10
  114. package/dist/src/dashboard/jobs_handlers.d.ts +14 -0
  115. package/dist/src/dashboard/jobs_handlers.js +61 -0
  116. package/dist/src/dashboard/knex_factory.d.ts +18 -0
  117. package/dist/src/dashboard/knex_factory.js +91 -0
  118. package/dist/src/dashboard/migrator.js +30 -159
  119. package/dist/src/dashboard/migrator_tables.d.ts +19 -0
  120. package/dist/src/dashboard/migrator_tables.js +153 -0
  121. package/dist/src/dashboard/overview_queries.d.ts +66 -0
  122. package/dist/src/dashboard/overview_queries.js +155 -0
  123. package/dist/src/dashboard/overview_query_runners.d.ts +25 -0
  124. package/dist/src/dashboard/overview_query_runners.js +84 -0
  125. package/dist/src/dashboard/overview_store_queries.d.ts +40 -0
  126. package/dist/src/dashboard/overview_store_queries.js +69 -0
  127. package/dist/src/dashboard/paginate_helper.d.ts +12 -0
  128. package/dist/src/dashboard/paginate_helper.js +33 -0
  129. package/dist/src/dashboard/query_explain_handler.d.ts +10 -0
  130. package/dist/src/dashboard/query_explain_handler.js +80 -0
  131. package/dist/src/dashboard/read_queries.d.ts +32 -0
  132. package/dist/src/dashboard/read_queries.js +107 -0
  133. package/dist/src/dashboard/saved_filter_queries.d.ts +10 -0
  134. package/dist/src/dashboard/saved_filter_queries.js +24 -0
  135. package/dist/src/dashboard/storage_stats.d.ts +41 -0
  136. package/dist/src/dashboard/storage_stats.js +81 -0
  137. package/dist/src/dashboard/write_queue.d.ts +106 -0
  138. package/dist/src/dashboard/write_queue.js +225 -0
  139. package/dist/src/data/data_access.d.ts +2 -39
  140. package/dist/src/data/data_access.js +17 -193
  141. package/dist/src/data/data_access_helpers.d.ts +130 -0
  142. package/dist/src/data/data_access_helpers.js +212 -0
  143. package/dist/src/debug/debug_store.js +37 -32
  144. package/dist/src/debug/email_collector.d.ts +1 -10
  145. package/dist/src/debug/email_collector.js +78 -81
  146. package/dist/src/debug/event_collector.d.ts +0 -9
  147. package/dist/src/debug/event_collector.js +79 -62
  148. package/dist/src/debug/query_collector.js +23 -19
  149. package/dist/src/debug/route_inspector.d.ts +1 -5
  150. package/dist/src/debug/route_inspector.js +50 -51
  151. package/dist/src/debug/trace_collector.d.ts +9 -1
  152. package/dist/src/debug/trace_collector.js +21 -15
  153. package/dist/src/debug/types.d.ts +1 -1
  154. package/dist/src/define_config.d.ts +0 -65
  155. package/dist/src/define_config.js +93 -333
  156. package/dist/src/edge/client/dashboard.js +2 -2
  157. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  158. package/dist/src/edge/client/stats-bar.js +1 -1
  159. package/dist/src/edge/client-vue/dashboard.js +5 -5
  160. package/dist/src/edge/client-vue/debug-panel-deferred.js +4 -4
  161. package/dist/src/edge/client-vue/stats-bar.js +3 -3
  162. package/dist/src/edge/plugin.d.ts +0 -16
  163. package/dist/src/edge/plugin.js +57 -64
  164. package/dist/src/engine/request_metrics.d.ts +1 -0
  165. package/dist/src/engine/request_metrics.js +32 -42
  166. package/dist/src/middleware/request_tracking_middleware.d.ts +2 -8
  167. package/dist/src/middleware/request_tracking_middleware.js +65 -93
  168. package/dist/src/provider/auth_middleware_detector.d.ts +16 -0
  169. package/dist/src/provider/auth_middleware_detector.js +97 -0
  170. package/dist/src/provider/boot_helpers.d.ts +20 -0
  171. package/dist/src/provider/boot_helpers.js +91 -0
  172. package/dist/src/provider/boot_initializer.d.ts +28 -0
  173. package/dist/src/provider/boot_initializer.js +35 -0
  174. package/dist/src/provider/dashboard_init.d.ts +30 -0
  175. package/dist/src/provider/dashboard_init.js +138 -0
  176. package/dist/src/provider/dashboard_setup.d.ts +25 -0
  177. package/dist/src/provider/dashboard_setup.js +78 -0
  178. package/dist/src/provider/diagnostics.d.ts +134 -0
  179. package/dist/src/provider/diagnostics.js +127 -0
  180. package/dist/src/provider/email_bridge.d.ts +43 -0
  181. package/dist/src/provider/email_bridge.js +80 -0
  182. package/dist/src/provider/email_helpers.d.ts +13 -0
  183. package/dist/src/provider/email_helpers.js +68 -0
  184. package/dist/src/provider/pino_hook.d.ts +17 -0
  185. package/dist/src/provider/pino_hook.js +35 -0
  186. package/dist/src/provider/provider_helpers_extra.d.ts +47 -0
  187. package/dist/src/provider/provider_helpers_extra.js +177 -0
  188. package/dist/src/provider/server_stats_provider.d.ts +39 -85
  189. package/dist/src/provider/server_stats_provider.js +132 -951
  190. package/dist/src/provider/shutdown_helpers.d.ts +43 -0
  191. package/dist/src/provider/shutdown_helpers.js +70 -0
  192. package/dist/src/provider/toolbar_setup.d.ts +57 -0
  193. package/dist/src/provider/toolbar_setup.js +141 -0
  194. package/dist/src/routes/dashboard_routes.d.ts +14 -0
  195. package/dist/src/routes/dashboard_routes.js +197 -0
  196. package/dist/src/routes/debug_routes.d.ts +14 -0
  197. package/dist/src/routes/debug_routes.js +101 -0
  198. package/dist/src/routes/register_routes.d.ts +0 -78
  199. package/dist/src/routes/register_routes.js +22 -352
  200. package/dist/src/routes/stats_routes.d.ts +5 -0
  201. package/dist/src/routes/stats_routes.js +14 -0
  202. package/dist/src/styles/components.css +163 -0
  203. package/dist/src/styles/dashboard.css +13 -105
  204. package/dist/src/styles/debug-panel.css +2 -53
  205. package/dist/src/styles/utilities.css +3 -1
  206. package/dist/src/types.d.ts +305 -14
  207. package/dist/vue/{CacheSection-oFAJL3mo.js → CacheSection-DT2Mwf_s.js} +1 -1
  208. package/dist/vue/{ConfigSection-BhfJ4KqL.js → ConfigSection-BwKwS9lh.js} +1 -1
  209. package/dist/vue/CustomPaneTab-Hr1IBHfz.js +172 -0
  210. package/dist/vue/{EmailsSection-BcNyhyHs.js → EmailsSection-B65g0FVS.js} +1 -1
  211. package/dist/vue/{EventsSection-r60Q5Lmu.js → EventsSection-CxqtVF-o.js} +1 -1
  212. package/dist/vue/{JobsSection-BHL-hkQw.js → JobsSection-rMIyMb-g.js} +1 -1
  213. package/dist/vue/{LogsSection-DRMGzJmg.js → LogsSection-DmmZVJ7D.js} +9 -3
  214. package/dist/vue/{LogsTab-Bg3o0Mm6.js → LogsTab-47zEK7jL.js} +4 -1
  215. package/dist/vue/{OverviewSection-CXh6Ja1B.js → OverviewSection-BMabyqw-.js} +49 -50
  216. package/dist/vue/{QueriesSection-IodIsCJ-.js → QueriesSection-BfDFwGqH.js} +44 -45
  217. package/dist/vue/{QueriesTab-C8_7oprC.js → QueriesTab-DuTG7cpC.js} +30 -31
  218. package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-Py1iu9GU.js +77 -0
  219. package/dist/vue/{RequestsSection-BPuMdmMc.js → RequestsSection-CTu4jPZ_.js} +143 -147
  220. package/dist/vue/{RoutesSection-NKo3Rbq3.js → RoutesSection-zQZDedL7.js} +1 -1
  221. package/dist/vue/TimelineTab-DHfXsX7t.js +334 -0
  222. package/dist/vue/components/shared/RelatedLogs.vue.d.ts +1 -4
  223. package/dist/vue/composables/useDashboardData.d.ts +12 -23
  224. package/dist/vue/index-CM3yNVUR.js +1232 -0
  225. package/dist/vue/index.js +1 -1
  226. package/dist/vue/style.css +1 -1
  227. package/package.json +1 -1
  228. package/dist/react/CacheSection-UCMptWyn.js +0 -146
  229. package/dist/react/CacheTab-CA8LB1J5.js +0 -123
  230. package/dist/react/CustomPaneTab-Bxtv_8Rw.js +0 -104
  231. package/dist/react/EmailsSection-CM7stSyh.js +0 -262
  232. package/dist/react/EmailsTab-BDhEiomM.js +0 -153
  233. package/dist/react/EventsTab-CMfY98Rl.js +0 -63
  234. package/dist/react/InternalsSection-t7ihcWO-.js +0 -32
  235. package/dist/react/InternalsTab-Oij0A2fN.js +0 -30
  236. package/dist/react/JobsSection-DF3qEv9O.js +0 -187
  237. package/dist/react/JobsTab-BbrBWIOb.js +0 -141
  238. package/dist/react/LogsSection-DcFTZY7b.js +0 -227
  239. package/dist/react/LogsTab-CicucmVk.js +0 -103
  240. package/dist/react/QueriesSection-PswteoF9.js +0 -461
  241. package/dist/react/RelatedLogs-DFDOyUMr.js +0 -40
  242. package/dist/react/RequestsSection-Nag30rEA.js +0 -341
  243. package/dist/react/RoutesTab-DgVzd2PZ.js +0 -74
  244. package/dist/react/index-Cflz9Ebj.js +0 -1069
  245. package/dist/vue/CustomPaneTab-BJxT5Dp7.js +0 -172
  246. package/dist/vue/RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js +0 -84
  247. package/dist/vue/TimelineTab-zj5Z5OdT.js +0 -338
  248. package/dist/vue/index-Dtgysd26.js +0 -1229
@@ -1,172 +0,0 @@
1
- import { defineComponent as F, ref as h, computed as K, onMounted as R, openBlock as a, createElementBlock as r, withDirectives as U, createElementVNode as m, vModelText as $, toDisplayString as l, createCommentVNode as v, Fragment as b, renderList as k, normalizeClass as y, createTextVNode as z } from "vue";
2
- import { compactPreview as B, formatDuration as E, timeAgo as S, formatTime as O, durationSeverity as P } from "adonisjs-server-stats/core";
3
- import { u as j } from "./useApiClient-BQQ9CF-q.js";
4
- import { u as w } from "./useResizableTable-BoivAevK.js";
5
- const J = {
6
- key: 0,
7
- class: "ss-dbg-search-bar"
8
- }, q = ["placeholder"], G = { class: "ss-dbg-summary" }, H = {
9
- key: 1,
10
- class: "ss-dbg-empty"
11
- }, I = {
12
- key: 2,
13
- class: "ss-dbg-empty"
14
- }, Q = ["onClick"], W = {
15
- key: 0,
16
- class: "ss-dbg-c-dim"
17
- }, X = ["title"], ne = /* @__PURE__ */ F({
18
- __name: "CustomPaneTab",
19
- props: {
20
- pane: {},
21
- baseUrl: {},
22
- authToken: {}
23
- },
24
- setup(d) {
25
- const o = d, u = h([]), p = h(!1), c = h(""), _ = j(o.baseUrl || "", o.authToken);
26
- let C = !1;
27
- async function N() {
28
- if (!(o.pane.fetchOnce && C)) {
29
- p.value = !0;
30
- try {
31
- const e = await _().fetch(o.pane.endpoint), s = (o.pane.dataKey || o.pane.id).split(".");
32
- let i = e;
33
- for (const t of s)
34
- i = i?.[t];
35
- u.value = Array.isArray(i) ? i : [], C = !0;
36
- } catch {
37
- u.value = [];
38
- } finally {
39
- p.value = !1;
40
- }
41
- }
42
- }
43
- const g = K(() => {
44
- if (!c.value.trim()) return u.value;
45
- const e = c.value.toLowerCase(), n = o.pane.columns.filter((s) => s.searchable).map((s) => s.key);
46
- return n.length === 0 ? u.value : u.value.filter(
47
- (s) => n.some((i) => {
48
- const t = s[i];
49
- return t == null ? !1 : String(t).toLowerCase().includes(e);
50
- })
51
- );
52
- });
53
- function f(e, n) {
54
- if (e == null) return "-";
55
- switch (n.format || "text") {
56
- case "time":
57
- return typeof e == "number" ? S(e) : String(e);
58
- case "timeAgo":
59
- return S(e);
60
- case "duration":
61
- return E(typeof e == "number" ? e : parseFloat(String(e)));
62
- case "method":
63
- return String(e);
64
- case "json": {
65
- let i = e;
66
- if (typeof e == "string")
67
- try {
68
- i = JSON.parse(e);
69
- } catch {
70
- }
71
- return B(i, 80);
72
- }
73
- case "badge":
74
- return String(e);
75
- default:
76
- return String(e);
77
- }
78
- }
79
- function T(e, n) {
80
- if (n.format === "time" || n.format === "timeAgo")
81
- return O(e);
82
- }
83
- function x(e) {
84
- return e == null;
85
- }
86
- function A(e) {
87
- const n = typeof e == "number" ? e : parseFloat(String(e));
88
- if (isNaN(n)) return "ss-dbg-duration";
89
- const s = P(n);
90
- return s === "very-slow" ? "ss-dbg-duration ss-dbg-very-slow" : s === "slow" ? "ss-dbg-duration ss-dbg-slow" : "ss-dbg-duration";
91
- }
92
- function L(e, n) {
93
- if (n.format === "badge" && n.badgeColorMap) {
94
- const s = String(e).toLowerCase();
95
- return n.badgeColorMap[s] || "muted";
96
- }
97
- return "";
98
- }
99
- function D(e) {
100
- return `ss-dbg-method ss-dbg-method-${String(e).toLowerCase()}`;
101
- }
102
- function M() {
103
- u.value = [];
104
- }
105
- const { tableRef: V } = w(() => g.value);
106
- return R(() => {
107
- N();
108
- }), (e, n) => (a(), r("div", null, [
109
- d.pane.search ? (a(), r("div", J, [
110
- U(m("input", {
111
- "onUpdate:modelValue": n[0] || (n[0] = (s) => c.value = s),
112
- class: "ss-dbg-search",
113
- placeholder: d.pane.search.placeholder,
114
- type: "text"
115
- }, null, 8, q), [
116
- [$, c.value]
117
- ]),
118
- m("span", G, l(g.value.length) + " items", 1),
119
- d.pane.clearable ? (a(), r("button", {
120
- key: 0,
121
- class: "ss-dbg-btn-clear",
122
- onClick: M
123
- }, "Clear")) : v("", !0)
124
- ])) : v("", !0),
125
- p.value ? (a(), r("div", H, "Loading...")) : g.value.length === 0 ? (a(), r("div", I, "No data")) : (a(), r("table", {
126
- key: 3,
127
- ref_key: "tableRef",
128
- ref: V,
129
- class: "ss-dbg-table"
130
- }, [
131
- m("thead", null, [
132
- m("tr", null, [
133
- (a(!0), r(b, null, k(d.pane.columns, (s) => (a(), r("th", {
134
- key: s.key
135
- }, l(s.label), 1))), 128))
136
- ])
137
- ]),
138
- m("tbody", null, [
139
- (a(!0), r(b, null, k(g.value, (s, i) => (a(), r("tr", {
140
- key: String(s.id ?? i)
141
- }, [
142
- (a(!0), r(b, null, k(d.pane.columns, (t) => (a(), r("td", {
143
- key: t.key,
144
- class: y({ "ss-dbg-filterable": t.filterable }),
145
- onClick: (Y) => t.filterable ? c.value = String(s[t.key]) : void 0
146
- }, [
147
- x(s[t.key]) ? (a(), r("span", W, "-")) : t.format === "time" || t.format === "timeAgo" ? (a(), r("span", {
148
- key: 1,
149
- class: "ss-dbg-event-time",
150
- title: T(s[t.key], t)
151
- }, l(f(s[t.key], t)), 9, X)) : t.format === "duration" ? (a(), r("span", {
152
- key: 2,
153
- class: y(A(s[t.key]))
154
- }, l(f(s[t.key], t)), 3)) : t.format === "method" ? (a(), r("span", {
155
- key: 3,
156
- class: y(D(s[t.key]))
157
- }, l(f(s[t.key], t)), 3)) : t.format === "badge" ? (a(), r("span", {
158
- key: 4,
159
- class: y(`ss-dbg-badge ss-dbg-badge-${L(s[t.key], t)}`)
160
- }, l(f(s[t.key], t)), 3)) : (a(), r(b, { key: 5 }, [
161
- z(l(f(s[t.key], t)), 1)
162
- ], 64))
163
- ], 10, Q))), 128))
164
- ]))), 128))
165
- ])
166
- ], 512))
167
- ]));
168
- }
169
- });
170
- export {
171
- ne as default
172
- };
@@ -1,84 +0,0 @@
1
- import { defineComponent as y, ref as k, openBlock as a, createElementBlock as n, createElementVNode as i, normalizeClass as t, createTextVNode as L, toDisplayString as c, Fragment as v, renderList as h, unref as e, createVNode as C, createCommentVNode as g } from "vue";
2
- import { getStructuredData as r, getLogLevelCssClass as N, resolveLogLevel as P, resolveLogTimestamp as u, formatTime as V, timeAgo as q, resolveLogRequestId as m, resolveLogMessage as E } from "adonisjs-server-stats/core";
3
- import { _ as R } from "./JsonViewer.vue_vue_type_script_setup_true_lang-Bid05zpm.js";
4
- const T = { key: 0 }, w = { style: { overflow: "auto" } }, B = ["onClick"], D = ["title"], I = ["title"], S = {
5
- key: 3,
6
- style: { width: "14px" }
7
- }, M = /* @__PURE__ */ y({
8
- __name: "RelatedLogs",
9
- props: {
10
- logs: {},
11
- classPrefix: { default: "ss-dash" }
12
- },
13
- setup(s) {
14
- const o = k(null);
15
- function $(x, d) {
16
- d && (o.value = o.value === x ? null : x);
17
- }
18
- return (x, d) => s.logs.length > 0 ? (a(), n("div", T, [
19
- i("div", {
20
- class: t(`${s.classPrefix}-related-logs-title`)
21
- }, [
22
- d[0] || (d[0] = L(" Related Logs ", -1)),
23
- i("span", {
24
- class: t(`${s.classPrefix}-related-logs-count`)
25
- }, "(" + c(s.logs.length) + ")", 3)
26
- ], 2),
27
- i("div", w, [
28
- (a(!0), n(v, null, h(s.logs, (l, f) => (a(), n(v, {
29
- key: l.id || f
30
- }, [
31
- i("div", {
32
- class: t([
33
- `${s.classPrefix}-log-entry`,
34
- e(r)(l) ? `${s.classPrefix}-log-entry-expandable` : ""
35
- ]),
36
- onClick: (b) => $(f, !!e(r)(l))
37
- }, [
38
- i("span", {
39
- class: t([
40
- `${s.classPrefix}-log-level`,
41
- e(N)(e(P)(l), `${s.classPrefix}-log-level`)
42
- ])
43
- }, c(e(P)(l).toUpperCase()), 3),
44
- i("span", {
45
- class: t(`${s.classPrefix}-log-time`),
46
- title: e(u)(l) ? e(V)(e(u)(l)) : ""
47
- }, c(e(u)(l) ? e(q)(e(u)(l)) : "-"), 11, D),
48
- e(m)(l) ? (a(), n("span", {
49
- key: 0,
50
- class: t(`${s.classPrefix}-log-reqid`),
51
- title: e(m)(l)
52
- }, c(e(m)(l).slice(0, 8)), 11, I)) : (a(), n("span", {
53
- key: 1,
54
- class: t(`${s.classPrefix}-log-reqid-empty`)
55
- }, "--", 2)),
56
- e(r)(l) ? (a(), n("span", {
57
- key: 2,
58
- class: t([
59
- `${s.classPrefix}-log-expand-icon`,
60
- o.value === f ? `${s.classPrefix}-log-expand-icon-open` : ""
61
- ])
62
- }, "▶", 2)) : (a(), n("span", S)),
63
- i("span", {
64
- class: t(`${s.classPrefix}-log-msg`)
65
- }, c(e(E)(l)), 3)
66
- ], 10, B),
67
- o.value === f && e(r)(l) ? (a(), n("div", {
68
- key: 0,
69
- class: t(`${s.classPrefix}-log-detail`)
70
- }, [
71
- C(R, {
72
- value: e(r)(l),
73
- "class-prefix": s.classPrefix,
74
- "default-expanded": !0
75
- }, null, 8, ["value", "class-prefix"])
76
- ], 2)) : g("", !0)
77
- ], 64))), 128))
78
- ])
79
- ])) : g("", !0);
80
- }
81
- });
82
- export {
83
- M as _
84
- };
@@ -1,338 +0,0 @@
1
- import { defineComponent as I, ref as c, computed as $, watch as Y, nextTick as j, onBeforeUnmount as K, openBlock as s, createElementBlock as l, Fragment as r, createElementVNode as t, toDisplayString as a, normalizeClass as g, unref as u, renderList as b, normalizeStyle as L, createTextVNode as N, createCommentVNode as p, createVNode as J, withDirectives as Q, vModelText as X, withModifiers as Z } from "vue";
2
- import { initSplitPane as ee, formatDuration as m, TAB_ICONS as V, formatTime as te, timeAgo as se, durationSeverity as le } from "adonisjs-server-stats/core";
3
- import { u as ae } from "./useApiClient-BQQ9CF-q.js";
4
- import { u as ne } from "./useResizableTable-BoivAevK.js";
5
- import { _ as oe } from "./RelatedLogs.vue_vue_type_script_setup_true_lang-CB2_TzYW.js";
6
- const de = {
7
- key: 0,
8
- class: "ss-dbg-empty"
9
- }, ie = { class: "ss-dbg-empty" }, re = {
10
- key: 2,
11
- class: "ss-dbg-tl-detail-wrapper"
12
- }, ue = { class: "ss-dbg-tl-detail-header" }, ce = { class: "ss-dbg-tl-detail-url" }, ge = { class: "ss-dbg-tl-meta" }, be = { class: "ss-dbg-tl-legend" }, ve = { id: "ss-dbg-tl-waterfall" }, he = {
13
- key: 0,
14
- class: "ss-dbg-empty"
15
- }, me = ["title"], fe = { class: "ss-dbg-tl-track" }, pe = ["title"], _e = { class: "ss-dbg-tl-dur" }, ye = {
16
- key: 0,
17
- class: "ss-dbg-tl-warnings"
18
- }, ke = { class: "ss-dbg-tl-legend" }, we = { id: "ss-dbg-tl-waterfall" }, Ce = {
19
- key: 0,
20
- class: "ss-dbg-empty"
21
- }, Te = ["title"], xe = { class: "ss-dbg-tl-track" }, $e = ["title"], Le = { class: "ss-dbg-tl-dur" }, Re = {
22
- key: 0,
23
- class: "ss-dbg-tl-warnings"
24
- }, Be = {
25
- key: 3,
26
- class: "ss-dbg-empty"
27
- }, De = { class: "ss-dbg-search-bar" }, Ee = { class: "ss-dbg-summary" }, Se = {
28
- key: 0,
29
- class: "ss-dbg-empty"
30
- }, Ae = ["onClick"], Me = {
31
- class: "ss-dbg-c-dim",
32
- style: { "white-space": "nowrap" }
33
- }, Ne = { class: "ss-dbg-c-text" }, qe = ["href"], Oe = ["viewBox", "innerHTML"], Pe = {
34
- class: "ss-dbg-c-muted",
35
- style: { "text-align": "center" }
36
- }, Ve = ["title"], Ge = /* @__PURE__ */ I({
37
- __name: "TimelineTab",
38
- props: {
39
- data: {},
40
- dashboardPath: {},
41
- baseUrl: {},
42
- debugEndpoint: {},
43
- authToken: {}
44
- },
45
- setup(R) {
46
- const _ = R, y = c(""), v = c(null), n = c(null), B = c(!1), h = c(null), U = ae(_.baseUrl || "", _.authToken), k = $(() => {
47
- const i = _.data;
48
- if (!i) return [];
49
- const o = Array.isArray(i) ? i : i.traces || [];
50
- if (!y.value.trim()) return o;
51
- const e = y.value.toLowerCase();
52
- return o.filter(
53
- (d) => d.url.toLowerCase().includes(e) || d.method.toLowerCase().includes(e) || String(d.statusCode).includes(e)
54
- );
55
- }), w = {
56
- request: "#1e3a5f",
57
- middleware: "rgba(30, 58, 95, 0.7)",
58
- db: "#6d28d9",
59
- view: "#0e7490",
60
- mail: "#059669",
61
- event: "#b45309",
62
- custom: "#525252"
63
- }, q = {
64
- request: "Request",
65
- middleware: "Middleware",
66
- db: "Database",
67
- view: "View",
68
- mail: "Mail",
69
- event: "Event",
70
- custom: "Custom"
71
- };
72
- function H(i) {
73
- v.value === i.id ? (v.value = null, n.value = null, h.value = null) : (v.value = i.id, z(i.id));
74
- }
75
- function O() {
76
- v.value = null, n.value = null, h.value = null;
77
- }
78
- let f = null;
79
- async function z(i) {
80
- f && f.abort(), f = new AbortController(), B.value = !0, h.value = null, n.value = null;
81
- const o = _.debugEndpoint || "/admin/api/debug";
82
- try {
83
- const d = await U().get(`${o}/traces/${i}`);
84
- n.value = d;
85
- } catch (e) {
86
- if (e instanceof Error && e.name === "AbortError") return;
87
- h.value = e instanceof Error ? e.message : "Failed to load trace";
88
- } finally {
89
- B.value = !1;
90
- }
91
- }
92
- const C = $(() => n.value?.spans || []), T = $(() => n.value?.warnings || []);
93
- function P(i, o) {
94
- const e = o || 1, d = e > 0 ? i.startOffset / e * 100 : 0, G = e > 0 ? Math.max(i.duration / e * 100, 0.5) : 0.5;
95
- return {
96
- left: `${d}%`,
97
- width: `${G}%`,
98
- background: w[i.category] || w.custom
99
- };
100
- }
101
- const { tableRef: F } = ne(() => k.value), D = c(null), E = c(null), S = c(null), A = c(null);
102
- let x = null;
103
- const M = $(() => n.value ? n.value.logs || [] : []);
104
- Y([v, n], async () => {
105
- x?.(), x = null, n.value && M.value.length > 0 && (await j(), D.value && E.value && S.value && A.value && (x = ee({
106
- container: D.value,
107
- handle: E.value,
108
- topPane: S.value,
109
- bottomPane: A.value,
110
- storageKey: "ss-dbg-timeline-split"
111
- })));
112
- }), K(() => {
113
- f && f.abort(), x?.();
114
- });
115
- function W(i) {
116
- const o = le(i);
117
- return o === "very-slow" ? "ss-dbg-very-slow" : o === "slow" ? "ss-dbg-slow" : "";
118
- }
119
- return (i, o) => (s(), l("div", null, [
120
- v.value !== null ? (s(), l(r, { key: 0 }, [
121
- B.value ? (s(), l("div", de, "Loading trace detail...")) : h.value ? (s(), l(r, { key: 1 }, [
122
- t("div", { class: "ss-dbg-tl-detail-header" }, [
123
- t("button", {
124
- type: "button",
125
- class: "ss-dbg-btn-clear",
126
- onClick: O
127
- }, "← Back")
128
- ]),
129
- t("div", ie, "Error: " + a(h.value), 1)
130
- ], 64)) : n.value ? (s(), l("div", re, [
131
- t("div", ue, [
132
- t("button", {
133
- type: "button",
134
- class: "ss-dbg-btn-clear",
135
- onClick: O
136
- }, "← Back"),
137
- t("span", {
138
- class: g(`ss-dbg-method ss-dbg-method-${n.value.method.toLowerCase()}`)
139
- }, a(n.value.method), 3),
140
- t("span", ce, a(n.value.url), 1),
141
- t("span", {
142
- class: g(`ss-dbg-status ss-dbg-status-${Math.floor(n.value.statusCode / 100)}xx`)
143
- }, a(n.value.statusCode), 3),
144
- t("span", ge, a(u(m)(n.value.totalDuration)) + " · " + a(n.value.spanCount) + " spans ", 1)
145
- ]),
146
- M.value.length > 0 ? (s(), l("div", {
147
- key: 0,
148
- ref_key: "splitContainerRef",
149
- ref: D,
150
- class: "ss-dbg-split-container"
151
- }, [
152
- t("div", {
153
- ref_key: "splitTopRef",
154
- ref: S,
155
- class: "ss-dbg-split-top"
156
- }, [
157
- t("div", be, [
158
- (s(), l(r, null, b(w, (e, d) => t("span", {
159
- key: d,
160
- class: "ss-dbg-tl-legend-item"
161
- }, [
162
- t("span", {
163
- class: "ss-dbg-tl-legend-dot",
164
- style: L({ background: e })
165
- }, null, 4),
166
- N(" " + a(q[d] || d), 1)
167
- ])), 64))
168
- ]),
169
- t("div", ve, [
170
- C.value.length === 0 ? (s(), l("div", he, " No spans captured for this request ")) : p("", !0),
171
- (s(!0), l(r, null, b(C.value, (e) => (s(), l("div", {
172
- key: e.id,
173
- class: "ss-dbg-tl-row"
174
- }, [
175
- t("span", {
176
- class: "ss-dbg-tl-label",
177
- title: e.label
178
- }, a(e.label), 9, me),
179
- t("span", fe, [
180
- t("span", {
181
- class: g(`ss-dbg-tl-bar ss-dbg-tl-bar-${e.category}`),
182
- style: L(P(e, n.value.totalDuration)),
183
- title: `${e.label}: ${u(m)(e.duration)}`
184
- }, null, 14, pe)
185
- ]),
186
- t("span", _e, a(u(m)(e.duration)), 1)
187
- ]))), 128))
188
- ]),
189
- T.value.length > 0 ? (s(), l("div", ye, [
190
- o[2] || (o[2] = t("div", { class: "ss-dbg-tl-warnings-title" }, "Warnings", -1)),
191
- (s(!0), l(r, null, b(T.value, (e, d) => (s(), l("div", {
192
- key: d,
193
- class: "ss-dbg-tl-warning"
194
- }, a(e), 1))), 128))
195
- ])) : p("", !0)
196
- ], 512),
197
- t("div", {
198
- ref_key: "splitHandleRef",
199
- ref: E,
200
- class: "ss-dbg-split-handle"
201
- }, null, 512),
202
- t("div", {
203
- ref_key: "splitBottomRef",
204
- ref: A,
205
- class: "ss-dbg-split-bottom"
206
- }, [
207
- J(oe, {
208
- logs: M.value,
209
- "class-prefix": "ss-dbg"
210
- }, null, 8, ["logs"])
211
- ], 512)
212
- ], 512)) : (s(), l(r, { key: 1 }, [
213
- t("div", ke, [
214
- (s(), l(r, null, b(w, (e, d) => t("span", {
215
- key: d,
216
- class: "ss-dbg-tl-legend-item"
217
- }, [
218
- t("span", {
219
- class: "ss-dbg-tl-legend-dot",
220
- style: L({ background: e })
221
- }, null, 4),
222
- N(" " + a(q[d] || d), 1)
223
- ])), 64))
224
- ]),
225
- t("div", we, [
226
- C.value.length === 0 ? (s(), l("div", Ce, " No spans captured for this request ")) : p("", !0),
227
- (s(!0), l(r, null, b(C.value, (e) => (s(), l("div", {
228
- key: e.id,
229
- class: "ss-dbg-tl-row"
230
- }, [
231
- t("span", {
232
- class: "ss-dbg-tl-label",
233
- title: e.label
234
- }, a(e.label), 9, Te),
235
- t("span", xe, [
236
- t("span", {
237
- class: g(`ss-dbg-tl-bar ss-dbg-tl-bar-${e.category}`),
238
- style: L(P(e, n.value.totalDuration)),
239
- title: `${e.label}: ${u(m)(e.duration)}`
240
- }, null, 14, $e)
241
- ]),
242
- t("span", Le, a(u(m)(e.duration)), 1)
243
- ]))), 128))
244
- ]),
245
- T.value.length > 0 ? (s(), l("div", Re, [
246
- o[3] || (o[3] = t("div", { class: "ss-dbg-tl-warnings-title" }, "Warnings", -1)),
247
- (s(!0), l(r, null, b(T.value, (e, d) => (s(), l("div", {
248
- key: d,
249
- class: "ss-dbg-tl-warning"
250
- }, a(e), 1))), 128))
251
- ])) : p("", !0)
252
- ], 64))
253
- ])) : (s(), l("div", Be, "Loading trace detail..."))
254
- ], 64)) : (s(), l(r, { key: 1 }, [
255
- t("div", De, [
256
- Q(t("input", {
257
- "onUpdate:modelValue": o[0] || (o[0] = (e) => y.value = e),
258
- class: "ss-dbg-search",
259
- placeholder: "Filter traces...",
260
- type: "text"
261
- }, null, 512), [
262
- [X, y.value]
263
- ]),
264
- t("span", Ee, a(k.value.length) + " traces", 1)
265
- ]),
266
- k.value.length === 0 ? (s(), l("div", Se, "No traces captured")) : (s(), l("table", {
267
- key: 1,
268
- ref_key: "tableRef",
269
- ref: F,
270
- class: "ss-dbg-table"
271
- }, [
272
- o[4] || (o[4] = t("thead", null, [
273
- t("tr", null, [
274
- t("th", null, "#"),
275
- t("th", null, "Method"),
276
- t("th", null, "URL"),
277
- t("th", null, "Status"),
278
- t("th", null, "Duration"),
279
- t("th", null, "Spans"),
280
- t("th", null, "Time")
281
- ])
282
- ], -1)),
283
- t("tbody", null, [
284
- (s(!0), l(r, null, b(k.value, (e) => (s(), l("tr", {
285
- key: e.id,
286
- class: "ss-dbg-email-row",
287
- onClick: (d) => H(e)
288
- }, [
289
- t("td", Me, a(e.id), 1),
290
- t("td", null, [
291
- t("span", {
292
- class: g(`ss-dbg-method ss-dbg-method-${e.method.toLowerCase()}`)
293
- }, a(e.method), 3)
294
- ]),
295
- t("td", Ne, [
296
- N(a(e.url) + " ", 1),
297
- R.dashboardPath ? (s(), l("a", {
298
- key: 0,
299
- href: `${R.dashboardPath}#requests?id=${e.id}`,
300
- target: "_blank",
301
- class: "ss-dbg-deeplink",
302
- onClick: o[1] || (o[1] = Z(() => {
303
- }, ["stop"]))
304
- }, [
305
- (s(), l("svg", {
306
- viewBox: u(V)["open-external"].viewBox,
307
- width: "12",
308
- height: "12",
309
- fill: "none",
310
- stroke: "currentColor",
311
- "stroke-width": "2",
312
- innerHTML: u(V)["open-external"].elements.join("")
313
- }, null, 8, Oe))
314
- ], 8, qe)) : p("", !0)
315
- ]),
316
- t("td", null, [
317
- t("span", {
318
- class: g(`ss-dbg-status ss-dbg-status-${Math.floor(e.statusCode / 100)}xx`)
319
- }, a(e.statusCode), 3)
320
- ]),
321
- t("td", {
322
- class: g(["ss-dbg-duration", W(e.totalDuration)])
323
- }, a(u(m)(e.totalDuration)), 3),
324
- t("td", Pe, a(e.spanCount), 1),
325
- t("td", {
326
- class: "ss-dbg-event-time",
327
- title: u(te)(e.timestamp)
328
- }, a(u(se)(e.timestamp)), 9, Ve)
329
- ], 8, Ae))), 128))
330
- ])
331
- ], 512))
332
- ], 64))
333
- ]));
334
- }
335
- });
336
- export {
337
- Ge as default
338
- };