adonisjs-server-stats 1.12.3 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/README.md +11 -6
  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/adonisjs_queue_collector.d.ts +21 -0
  38. package/dist/src/collectors/adonisjs_queue_collector.js +61 -0
  39. package/dist/src/collectors/auto_detect.js +8 -2
  40. package/dist/src/collectors/index.d.ts +2 -0
  41. package/dist/src/collectors/index.js +1 -0
  42. package/dist/src/collectors/queue_collector.js +22 -6
  43. package/dist/src/config/deprecation_migration.js +11 -0
  44. package/dist/src/dashboard/cache_handlers.js +22 -2
  45. package/dist/src/dashboard/flush_manager.d.ts +2 -0
  46. package/dist/src/dashboard/flush_manager.js +17 -0
  47. package/dist/src/dashboard/inspector_manager.d.ts +4 -4
  48. package/dist/src/dashboard/inspector_manager.js +20 -10
  49. package/dist/src/dashboard/integrations/adonisjs_queue_inspector.d.ts +42 -0
  50. package/dist/src/dashboard/integrations/adonisjs_queue_inspector.js +135 -0
  51. package/dist/src/dashboard/integrations/adonisjs_queue_store.d.ts +166 -0
  52. package/dist/src/dashboard/integrations/adonisjs_queue_store.js +629 -0
  53. package/dist/src/dashboard/integrations/config_inspector.d.ts +0 -1
  54. package/dist/src/dashboard/integrations/config_inspector.js +4 -2
  55. package/dist/src/dashboard/integrations/index.d.ts +4 -1
  56. package/dist/src/dashboard/integrations/index.js +2 -0
  57. package/dist/src/dashboard/integrations/queue_inspector.d.ts +5 -61
  58. package/dist/src/dashboard/integrations/queue_inspector.js +5 -1
  59. package/dist/src/dashboard/integrations/queue_inspector_contract.d.ts +73 -0
  60. package/dist/src/dashboard/integrations/queue_inspector_contract.js +15 -0
  61. package/dist/src/dashboard/paginate_helper.d.ts +5 -0
  62. package/dist/src/dashboard/paginate_helper.js +16 -4
  63. package/dist/src/dashboard/query_explain_handler.d.ts +6 -1
  64. package/dist/src/dashboard/query_explain_handler.js +12 -2
  65. package/dist/src/dashboard/write_queue.d.ts +13 -0
  66. package/dist/src/dashboard/write_queue.js +34 -2
  67. package/dist/src/debug/debug_store.js +8 -1
  68. package/dist/src/debug/event_collector.js +4 -0
  69. package/dist/src/debug/query_collector.js +2 -0
  70. package/dist/src/debug/ring_buffer.js +8 -1
  71. package/dist/src/debug/trace_collector.js +34 -10
  72. package/dist/src/debug/types.d.ts +2 -0
  73. package/dist/src/define_config.js +1 -0
  74. package/dist/src/edge/client/dashboard.js +2 -2
  75. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  76. package/dist/src/edge/client/stats-bar.js +1 -1
  77. package/dist/src/edge/client-vue/dashboard.js +5 -5
  78. package/dist/src/edge/client-vue/debug-panel-deferred.js +2 -2
  79. package/dist/src/engine/request_metrics.js +8 -10
  80. package/dist/src/log_stream/log_stream_service.d.ts +1 -0
  81. package/dist/src/log_stream/log_stream_service.js +7 -5
  82. package/dist/src/prometheus/prometheus_collector.d.ts +9 -0
  83. package/dist/src/prometheus/prometheus_collector.js +11 -0
  84. package/dist/src/provider/dashboard_init.js +15 -0
  85. package/dist/src/provider/dashboard_setup.js +9 -2
  86. package/dist/src/provider/email_bridge.d.ts +14 -3
  87. package/dist/src/provider/email_bridge.js +25 -3
  88. package/dist/src/provider/email_helpers.d.ts +9 -1
  89. package/dist/src/provider/email_helpers.js +32 -4
  90. package/dist/src/provider/pino_hook.d.ts +8 -0
  91. package/dist/src/provider/pino_hook.js +19 -1
  92. package/dist/src/provider/provider_helpers_extra.d.ts +2 -0
  93. package/dist/src/provider/provider_helpers_extra.js +17 -2
  94. package/dist/src/provider/server_stats_provider.js +19 -1
  95. package/dist/src/provider/shutdown_helpers.js +2 -0
  96. package/dist/src/provider/toolbar_setup.js +32 -17
  97. package/dist/src/routes/dashboard_routes.js +96 -62
  98. package/dist/src/routes/debug_routes.js +45 -35
  99. package/dist/src/routes/no_session_middleware.d.ts +6 -3
  100. package/dist/src/routes/no_session_middleware.js +7 -3
  101. package/dist/src/routes/register_routes.d.ts +8 -0
  102. package/dist/src/routes/register_routes.js +19 -0
  103. package/dist/src/types.d.ts +31 -0
  104. package/dist/src/utils/app_import.js +12 -4
  105. package/dist/vue/CacheSection-CxEBVVkF.js +156 -0
  106. package/dist/vue/ConfigSection-BiRAiaHj.js +415 -0
  107. package/dist/vue/EmailsSection-Dl44qyqY.js +208 -0
  108. package/dist/vue/{EmailsTab-CwIF1fik.js → EmailsTab-Diya54CP.js} +6 -5
  109. package/dist/vue/{EventsSection-BpgkWIwM.js → EventsSection-CWjeitjU.js} +1 -1
  110. package/dist/vue/{InternalsTab-521fxYYj.js → InternalsTab-Z3c82glB.js} +15 -15
  111. package/dist/vue/{JobsSection-DrghFEKL.js → JobsSection-DOBb4LjZ.js} +1 -1
  112. package/dist/vue/LogsSection-CXx-HOWJ.js +260 -0
  113. package/dist/vue/{OverviewSection-BAgZTPjY.js → OverviewSection-CyfNQ8uV.js} +318 -302
  114. package/dist/vue/{QueriesSection-CUpwhp7u.js → QueriesSection-CXBsFp-y.js} +1 -1
  115. package/dist/vue/{RequestsSection-D8P2xpF2.js → RequestsSection-YTIaZGZd.js} +151 -145
  116. package/dist/vue/{RoutesSection-0qB81hTT.js → RoutesSection-CDKMey49.js} +1 -1
  117. package/dist/vue/composables/useApiClient.d.ts +8 -1
  118. package/dist/vue/index-14x39RI_.js +1239 -0
  119. package/dist/vue/index.js +1 -1
  120. package/dist/vue/style.css +1 -1
  121. package/package.json +16 -3
  122. package/dist/react/ConfigContent-CnsEI4j3.js +0 -397
  123. package/dist/react/LogsTab-jKwv9G7Q.js +0 -79
  124. package/dist/react/RequestsSection-D8cMbZU0.js +0 -321
  125. package/dist/react/index-CsprmgzI.js +0 -1121
  126. package/dist/react/useApiClient-BVtNCmnL.js +0 -9
  127. package/dist/vue/CacheSection-DRqV3YX2.js +0 -149
  128. package/dist/vue/ConfigSection-C6pQCHAL.js +0 -576
  129. package/dist/vue/EmailsSection-BTNw3ZU2.js +0 -206
  130. package/dist/vue/LogsSection-BDxx9Bfi.js +0 -258
  131. package/dist/vue/index-30jLw-_w.js +0 -1232
  132. /package/dist/core/{api-client.d.ts → core/api-client.d.ts} +0 -0
  133. /package/dist/core/{config-utils.d.ts → core/config-utils.d.ts} +0 -0
  134. /package/dist/core/{constants.d.ts → core/constants.d.ts} +0 -0
  135. /package/dist/core/{dashboard-api.d.ts → core/dashboard-api.d.ts} +0 -0
  136. /package/dist/core/{dashboard-data-controller.d.ts → core/dashboard-data-controller.d.ts} +0 -0
  137. /package/dist/core/{dashboard-data-helpers.d.ts → core/dashboard-data-helpers.d.ts} +0 -0
  138. /package/dist/core/{debug-data-controller.d.ts → core/debug-data-controller.d.ts} +0 -0
  139. /package/dist/core/{define-config-helpers.d.ts → core/define-config-helpers.d.ts} +0 -0
  140. /package/dist/core/{explain-utils.d.ts → core/explain-utils.d.ts} +0 -0
  141. /package/dist/core/{feature-detect-helpers.d.ts → core/feature-detect-helpers.d.ts} +0 -0
  142. /package/dist/core/{feature-detect.d.ts → core/feature-detect.d.ts} +0 -0
  143. /package/dist/core/{field-resolvers.d.ts → core/field-resolvers.d.ts} +0 -0
  144. /package/dist/core/{formatters-helpers.d.ts → core/formatters-helpers.d.ts} +0 -0
  145. /package/dist/core/{formatters.d.ts → core/formatters.d.ts} +0 -0
  146. /package/dist/core/{history-buffer.d.ts → core/history-buffer.d.ts} +0 -0
  147. /package/dist/core/{icons.d.ts → core/icons.d.ts} +0 -0
  148. /package/dist/core/{index.d.ts → core/index.d.ts} +0 -0
  149. /package/dist/core/{internals-utils.d.ts → core/internals-utils.d.ts} +0 -0
  150. /package/dist/core/{job-utils.d.ts → core/job-utils.d.ts} +0 -0
  151. /package/dist/core/{log-utils-helpers.d.ts → core/log-utils-helpers.d.ts} +0 -0
  152. /package/dist/core/{log-utils.d.ts → core/log-utils.d.ts} +0 -0
  153. /package/dist/core/{metrics.d.ts → core/metrics.d.ts} +0 -0
  154. /package/dist/core/{pagination.d.ts → core/pagination.d.ts} +0 -0
  155. /package/dist/core/{queries-columns.d.ts → core/queries-columns.d.ts} +0 -0
  156. /package/dist/core/{queries-controller.d.ts → core/queries-controller.d.ts} +0 -0
  157. /package/dist/core/{query-utils.d.ts → core/query-utils.d.ts} +0 -0
  158. /package/dist/core/{resizable-columns.d.ts → core/resizable-columns.d.ts} +0 -0
  159. /package/dist/core/{routes.d.ts → core/routes.d.ts} +0 -0
  160. /package/dist/core/{server-stats-controller.d.ts → core/server-stats-controller.d.ts} +0 -0
  161. /package/dist/core/{sparkline.d.ts → core/sparkline.d.ts} +0 -0
  162. /package/dist/core/{split-pane.d.ts → core/split-pane.d.ts} +0 -0
  163. /package/dist/core/{theme.d.ts → core/theme.d.ts} +0 -0
  164. /package/dist/core/{trace-utils.d.ts → core/trace-utils.d.ts} +0 -0
  165. /package/dist/core/{transmit-adapter.d.ts → core/transmit-adapter.d.ts} +0 -0
  166. /package/dist/core/{transmit-helpers.d.ts → core/transmit-helpers.d.ts} +0 -0
  167. /package/dist/core/{types-dashboard.d.ts → core/types-dashboard.d.ts} +0 -0
  168. /package/dist/core/{types-diagnostics.d.ts → core/types-diagnostics.d.ts} +0 -0
@@ -1,206 +0,0 @@
1
- import { defineComponent as V, inject as h, ref as f, computed as A, openBlock as o, createElementBlock as i, createElementVNode as e, Fragment as c, createTextVNode as u, toDisplayString as n, createCommentVNode as y, normalizeClass as _, createVNode as F, unref as r, renderList as B, createBlock as D } from "vue";
2
- import { formatTime as R, timeAgo as z } from "adonisjs-server-stats/core";
3
- import { u as L } from "./index-30jLw-_w.js";
4
- import { u as M } from "./useResizableTable-BoivAevK.js";
5
- import { _ as U } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
6
- import { _ as q } from "./PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js";
7
- const H = {
8
- key: 0,
9
- class: "ss-dash-email-preview",
10
- id: "ss-dash-email-preview"
11
- }, I = { class: "ss-dash-email-preview-header" }, K = {
12
- class: "ss-dash-email-preview-meta",
13
- id: "ss-dash-email-preview-meta"
14
- }, G = ["srcdoc"], J = {
15
- key: 0,
16
- class: "ss-dash-empty"
17
- }, O = { class: "ss-dash-table-wrap" }, Q = ["onClick"], W = { style: { color: "var(--ss-dim)" } }, X = ["title"], Y = ["title"], Z = ["title"], tt = {
18
- key: 0,
19
- style: { color: "var(--ss-dim)", "text-align": "center", display: "block" }
20
- }, et = {
21
- key: 1,
22
- style: { color: "var(--ss-dim)", "text-align": "center", display: "block" }
23
- }, lt = ["title"], st = ["title"], at = {
24
- key: 1,
25
- class: "ss-dash-empty"
26
- }, vt = /* @__PURE__ */ V({
27
- __name: "EmailsSection",
28
- setup(ot) {
29
- const b = h("ss-refresh-key", f(0)), g = h("ss-dashboard-endpoint", "/__stats/api"), k = h("ss-auth-token", void 0), x = h("ss-base-url", ""), { data: p, loading: C, pagination: m, goToPage: T, setSearch: P, fetchEmailPreview: S } = L(
30
- () => "emails",
31
- {
32
- baseUrl: x,
33
- dashboardEndpoint: g,
34
- authToken: k,
35
- refreshKey: b
36
- }
37
- ), w = f(""), s = f(null), v = f(null), a = A(() => {
38
- if (!p.value) return [];
39
- const d = p.value;
40
- return d.data || d.emails || p.value || [];
41
- });
42
- function j(d) {
43
- w.value = d, P(d);
44
- }
45
- async function E(d) {
46
- if (d.html) {
47
- s.value = d.id, v.value = d.html;
48
- return;
49
- }
50
- const l = await S(d.id);
51
- s.value = d.id, v.value = l;
52
- }
53
- function $() {
54
- s.value = null, v.value = null;
55
- }
56
- const { tableRef: N } = M(() => a.value);
57
- return (d, l) => (o(), i("div", null, [
58
- s.value && v.value ? (o(), i("div", H, [
59
- e("div", I, [
60
- e("div", K, [
61
- a.value.find((t) => t.id === s.value) ? (o(), i(c, { key: 0 }, [
62
- l[4] || (l[4] = e("strong", null, "Subject:", -1)),
63
- u(" " + n(a.value.find((t) => t.id === s.value)?.subject) + "   |  ", 1),
64
- l[5] || (l[5] = e("strong", null, "From:", -1)),
65
- u(" " + n(a.value.find((t) => t.id === s.value)?.from_addr || a.value.find((t) => t.id === s.value)?.from) + "   |  ", 1),
66
- l[6] || (l[6] = e("strong", null, "To:", -1)),
67
- u(" " + n(a.value.find((t) => t.id === s.value)?.to_addr || a.value.find((t) => t.id === s.value)?.to) + " ", 1),
68
- a.value.find((t) => t.id === s.value)?.cc || a.value.find((t) => t.id === s.value)?.cc_addr ? (o(), i(c, { key: 0 }, [
69
- l[0] || (l[0] = u("   |  ", -1)),
70
- l[1] || (l[1] = e("strong", null, "CC:", -1)),
71
- u(" " + n(a.value.find((t) => t.id === s.value)?.cc || a.value.find((t) => t.id === s.value)?.cc_addr), 1)
72
- ], 64)) : y("", !0),
73
- l[7] || (l[7] = u("   |  ", -1)),
74
- l[8] || (l[8] = e("strong", null, "Status:", -1)),
75
- e("span", {
76
- class: _(`ss-dash-badge ss-dash-email-status-${a.value.find((t) => t.id === s.value)?.status}`)
77
- }, n(a.value.find((t) => t.id === s.value)?.status), 3),
78
- a.value.find((t) => t.id === s.value)?.mailer ? (o(), i(c, { key: 1 }, [
79
- l[2] || (l[2] = u("   |  ", -1)),
80
- l[3] || (l[3] = e("strong", null, "Mailer:", -1)),
81
- u(" " + n(a.value.find((t) => t.id === s.value)?.mailer), 1)
82
- ], 64)) : y("", !0)
83
- ], 64)) : y("", !0)
84
- ]),
85
- e("button", {
86
- type: "button",
87
- class: "ss-dash-btn",
88
- id: "ss-dash-email-preview-close",
89
- onClick: $
90
- }, " Close ")
91
- ]),
92
- e("iframe", {
93
- class: "ss-dash-email-iframe",
94
- id: "ss-dash-email-iframe",
95
- srcdoc: v.value,
96
- title: "Email preview",
97
- sandbox: ""
98
- }, null, 8, G)
99
- ])) : (o(), i(c, { key: 1 }, [
100
- F(U, {
101
- "model-value": w.value,
102
- placeholder: "Filter emails...",
103
- summary: `${r(m).total ?? 0} emails`,
104
- "onUpdate:modelValue": j
105
- }, null, 8, ["model-value", "summary"]),
106
- r(C) && !r(p) ? (o(), i("div", J, "Loading emails...")) : (o(), i(c, { key: 1 }, [
107
- e("div", O, [
108
- a.value.length > 0 ? (o(), i("table", {
109
- key: 0,
110
- ref_key: "tableRef",
111
- ref: N,
112
- class: "ss-dash-table"
113
- }, [
114
- l[9] || (l[9] = e("colgroup", null, [
115
- e("col", { style: { width: "40px" } }),
116
- e("col", { style: { width: "150px" } }),
117
- e("col", { style: { width: "150px" } }),
118
- e("col"),
119
- e("col", { style: { width: "80px" } }),
120
- e("col", { style: { width: "40px" } }),
121
- e("col", { style: { width: "70px" } }),
122
- e("col", { style: { width: "80px" } })
123
- ], -1)),
124
- l[10] || (l[10] = e("thead", null, [
125
- e("tr", null, [
126
- e("th", null, "#"),
127
- e("th", null, "From"),
128
- e("th", null, "To"),
129
- e("th", null, "Subject"),
130
- e("th", null, "Status"),
131
- e("th", null, "ATT"),
132
- e("th", null, "Mailer"),
133
- e("th", null, "Time")
134
- ])
135
- ], -1)),
136
- e("tbody", null, [
137
- (o(!0), i(c, null, B(a.value, (t) => (o(), i("tr", {
138
- key: t.id,
139
- class: "ss-dash-clickable ss-dash-email-row",
140
- onClick: (it) => E(t)
141
- }, [
142
- e("td", null, [
143
- e("span", W, n(t.id), 1)
144
- ]),
145
- e("td", null, [
146
- e("span", {
147
- title: t.from_addr || t.from || "",
148
- style: { color: "var(--ss-text-secondary)", overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap", display: "block" }
149
- }, n(t.from_addr || t.from || ""), 9, X)
150
- ]),
151
- e("td", null, [
152
- e("span", {
153
- title: t.to_addr || t.to || "",
154
- style: { color: "var(--ss-text-secondary)", overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap", display: "block" }
155
- }, n(t.to_addr || t.to || ""), 9, Y)
156
- ]),
157
- e("td", null, [
158
- e("span", {
159
- title: t.subject || "",
160
- style: { color: "var(--ss-sql-color)", overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap", display: "block" }
161
- }, n(t.subject || ""), 9, Z)
162
- ]),
163
- e("td", null, [
164
- e("span", {
165
- class: _(`ss-dash-badge ss-dash-email-status-${t.status || ""}`)
166
- }, n(t.status), 3)
167
- ]),
168
- e("td", null, [
169
- (t.attachment_count || t.attachmentCount || 0) > 0 ? (o(), i("span", tt, n(t.attachment_count || t.attachmentCount || 0), 1)) : (o(), i("span", et, "-"))
170
- ]),
171
- e("td", null, [
172
- e("span", {
173
- title: t.mailer || "",
174
- style: { color: "var(--ss-muted)", overflow: "hidden", "text-overflow": "ellipsis", "white-space": "nowrap", display: "block" }
175
- }, n(t.mailer || ""), 9, lt)
176
- ]),
177
- e("td", null, [
178
- e("span", {
179
- class: "ss-dash-event-time",
180
- style: { "white-space": "nowrap" },
181
- title: r(R)(
182
- t.createdAt || t.created_at || t.timestamp
183
- )
184
- }, n(r(z)(
185
- t.createdAt || t.created_at || t.timestamp
186
- )), 9, st)
187
- ])
188
- ], 8, Q))), 128))
189
- ])
190
- ], 512)) : (o(), i("div", at, "No emails captured yet"))
191
- ]),
192
- r(m).totalPages > 1 ? (o(), D(q, {
193
- key: 0,
194
- page: r(m).page,
195
- "last-page": r(m).totalPages,
196
- total: r(m).total,
197
- onPageChange: r(T)
198
- }, null, 8, ["page", "last-page", "total", "onPageChange"])) : y("", !0)
199
- ], 64))
200
- ], 64))
201
- ]));
202
- }
203
- });
204
- export {
205
- vt as default
206
- };
@@ -1,258 +0,0 @@
1
- import { defineComponent as ie, inject as C, ref as u, computed as B, openBlock as a, createElementBlock as o, createVNode as O, unref as s, withCtx as ue, createElementVNode as n, Fragment as q, renderList as x, normalizeClass as $, toDisplayString as i, withKeys as V, createCommentVNode as _, createStaticVNode as re, createTextVNode as w, withModifiers as U, createBlock as de } from "vue";
2
- import { LOG_LEVELS as ce, getStructuredData as m, getLogLevelCssClass as ve, resolveLogLevel as W, resolveLogTimestamp as F, formatTime as pe, timeAgo as he, resolveLogRequestId as g, resolveLogMessage as _e } from "adonisjs-server-stats/core";
3
- import { _ as fe } from "./JsonViewer.vue_vue_type_script_setup_true_lang-Bid05zpm.js";
4
- import { u as me } from "./index-30jLw-_w.js";
5
- import { _ as ge } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
6
- import { _ as ye } from "./PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js";
7
- const ke = { class: "ss-dash-log-filters" }, be = ["onClick"], Ce = ["value"], qe = { class: "ss-dash-structured-search" }, $e = ["value"], Fe = ["value"], Le = ["value"], Se = {
8
- key: 0,
9
- class: "ss-dash-filter-chips"
10
- }, Ie = {
11
- key: 0,
12
- class: "ss-dash-filter-chip"
13
- }, xe = {
14
- key: 1,
15
- class: "ss-dash-filter-chip"
16
- }, Ve = ["onClick"], we = {
17
- key: 1,
18
- class: "ss-dash-empty"
19
- }, Ee = {
20
- key: 2,
21
- class: "ss-dash-empty"
22
- }, Ke = {
23
- key: 3,
24
- class: "ss-dash-empty"
25
- }, Ne = {
26
- key: 4,
27
- class: "ss-dash-log-entries"
28
- }, De = ["onClick"], Pe = ["title"], Te = ["title", "onClick", "onKeydown"], Re = {
29
- key: 1,
30
- class: "ss-dash-log-reqid-empty"
31
- }, Ae = {
32
- key: 3,
33
- style: { width: "14px" }
34
- }, Be = { class: "ss-dash-log-msg" }, Oe = {
35
- key: 0,
36
- class: "ss-dash-log-detail"
37
- }, Je = /* @__PURE__ */ ie({
38
- __name: "LogsSection",
39
- setup(Ue) {
40
- const j = C("ss-refresh-key", u(0)), M = C("ss-dashboard-endpoint", "/__stats/api"), z = C("ss-auth-token", void 0), G = C("ss-base-url", ""), {
41
- data: y,
42
- loading: H,
43
- error: J,
44
- pagination: v,
45
- filter: Q,
46
- goToPage: X,
47
- setSearch: Y,
48
- setFilter: p,
49
- refresh: Z
50
- } = me(() => "logs", {
51
- baseUrl: G,
52
- dashboardEndpoint: M,
53
- authToken: z,
54
- refreshKey: j
55
- }), E = u(""), d = u("all"), r = u(""), h = u(""), k = u(null), f = u([]), L = u("level"), S = u("equals"), b = u(""), K = B(() => {
56
- if (!y.value) return [];
57
- const t = y.value;
58
- return t.data || t.logs || y.value || [];
59
- }), ee = B(
60
- () => d.value !== "all" || r.value !== "" || f.value.length > 0
61
- );
62
- function te(t, l) {
63
- l && (k.value = k.value === t ? null : t);
64
- }
65
- function se(t) {
66
- E.value = t, Y(t);
67
- }
68
- function le(t) {
69
- d.value = t, t === "all" ? p("level", "") : p("level", t);
70
- }
71
- function N(t) {
72
- r.value = t, h.value = t, p("request_id", t);
73
- }
74
- function ae() {
75
- const t = h.value.trim();
76
- r.value = t, p("request_id", t);
77
- }
78
- function D() {
79
- r.value = "", h.value = "", p("request_id", "");
80
- }
81
- function oe() {
82
- d.value = "all", p("level", "");
83
- }
84
- function P() {
85
- const t = Q;
86
- for (const l of Object.keys(t))
87
- (l.startsWith("filter_field_") || l.startsWith("filter_op_") || l.startsWith("filter_value_")) && delete t[l];
88
- f.value.forEach((l, e) => {
89
- t[`filter_field_${e}`] = l.field, t[`filter_op_${e}`] = l.operator, t[`filter_value_${e}`] = l.value;
90
- }), v.page = 1, Z();
91
- }
92
- function T() {
93
- const t = b.value.trim();
94
- t && (f.value.push({
95
- field: L.value,
96
- operator: S.value,
97
- value: t
98
- }), b.value = "", P());
99
- }
100
- function ne(t) {
101
- f.value.splice(t, 1), P();
102
- }
103
- function R(t) {
104
- return t.target.value;
105
- }
106
- function A(t) {
107
- return t.target.value;
108
- }
109
- return (t, l) => (a(), o("div", null, [
110
- O(ge, {
111
- "model-value": E.value,
112
- placeholder: "Search logs...",
113
- summary: `${s(v).total ?? 0} logs`,
114
- "onUpdate:modelValue": se
115
- }, {
116
- default: ue(() => [
117
- n("div", ke, [
118
- (a(!0), o(q, null, x(s(ce), (e) => (a(), o("button", {
119
- key: e,
120
- type: "button",
121
- class: $(`ss-dash-log-filter ${d.value === e ? "ss-dash-active" : ""}`),
122
- onClick: (c) => le(e)
123
- }, i(e), 11, be))), 128)),
124
- n("input", {
125
- type: "text",
126
- class: "ss-dash-filter-input ss-dash-reqid-input",
127
- placeholder: "Filter by request ID...",
128
- value: h.value,
129
- onInput: l[0] || (l[0] = (e) => h.value = R(e)),
130
- onKeydown: V(ae, ["enter"])
131
- }, null, 40, Ce),
132
- h.value || r.value ? (a(), o("button", {
133
- key: 0,
134
- type: "button",
135
- class: "ss-dash-btn ss-dash-reqid-clear",
136
- onClick: D
137
- }, " Clear ")) : _("", !0)
138
- ])
139
- ]),
140
- _: 1
141
- }, 8, ["model-value", "summary"]),
142
- n("div", qe, [
143
- n("select", {
144
- class: "ss-dash-filter-select",
145
- value: L.value,
146
- onChange: l[1] || (l[1] = (e) => L.value = A(e))
147
- }, [...l[4] || (l[4] = [
148
- re('<option value="level">level</option><option value="message">message</option><option value="request_id">request_id</option><option value="userId">userId</option><option value="email">email</option><option value="path">path</option>', 6)
149
- ])], 40, $e),
150
- n("select", {
151
- class: "ss-dash-filter-select",
152
- value: S.value,
153
- onChange: l[2] || (l[2] = (e) => S.value = A(e))
154
- }, [...l[5] || (l[5] = [
155
- n("option", { value: "equals" }, "equals", -1),
156
- n("option", { value: "contains" }, "contains", -1),
157
- n("option", { value: "starts_with" }, "starts with", -1)
158
- ])], 40, Fe),
159
- n("input", {
160
- class: "ss-dash-filter-input",
161
- placeholder: "Value...",
162
- value: b.value,
163
- onInput: l[3] || (l[3] = (e) => b.value = R(e)),
164
- onKeydown: V(T, ["enter"])
165
- }, null, 40, Le),
166
- n("button", {
167
- type: "button",
168
- class: "ss-dash-btn",
169
- onClick: T
170
- }, "Add")
171
- ]),
172
- ee.value ? (a(), o("div", Se, [
173
- d.value !== "all" ? (a(), o("span", Ie, [
174
- w(" level: " + i(d.value) + " ", 1),
175
- n("button", {
176
- type: "button",
177
- class: "ss-dash-filter-chip-remove",
178
- onClick: oe
179
- }, " × ")
180
- ])) : _("", !0),
181
- r.value ? (a(), o("span", xe, [
182
- w(" requestId: " + i(r.value.slice(0, 8)) + "... ", 1),
183
- n("button", {
184
- type: "button",
185
- class: "ss-dash-filter-chip-remove",
186
- onClick: D
187
- }, " × ")
188
- ])) : _("", !0),
189
- (a(!0), o(q, null, x(f.value, (e, c) => (a(), o("span", {
190
- key: c,
191
- class: "ss-dash-filter-chip"
192
- }, [
193
- w(i(e.field) + " " + i(e.operator) + ' "' + i(e.value) + '" ', 1),
194
- n("button", {
195
- type: "button",
196
- class: "ss-dash-filter-chip-remove",
197
- onClick: (I) => ne(c)
198
- }, " × ", 8, Ve)
199
- ]))), 128))
200
- ])) : _("", !0),
201
- s(J) ? (a(), o("div", we, "Failed to load logs")) : s(H) && !s(y) ? (a(), o("div", Ee, "Loading logs...")) : K.value.length === 0 ? (a(), o("div", Ke, " No log entries" + i(r.value ? ` matching request ${r.value}` : d.value !== "all" ? ` for ${d.value}` : ""), 1)) : (a(), o("div", Ne, [
202
- (a(!0), o(q, null, x(K.value, (e, c) => (a(), o(q, {
203
- key: String(e.id || c)
204
- }, [
205
- n("div", {
206
- class: $([
207
- "ss-dash-log-entry",
208
- { "ss-dash-log-entry-expandable": !!s(m)(e) }
209
- ]),
210
- onClick: (I) => te(c, !!s(m)(e))
211
- }, [
212
- n("span", {
213
- class: $(`ss-dash-log-level ${s(ve)(s(W)(e), "ss-dash-log-level")}`)
214
- }, i(s(W)(e).toUpperCase()), 3),
215
- n("span", {
216
- class: "ss-dash-log-time",
217
- title: s(F)(e) ? s(pe)(s(F)(e)) : ""
218
- }, i(s(F)(e) ? s(he)(s(F)(e)) : "-"), 9, Pe),
219
- s(g)(e) ? (a(), o("span", {
220
- key: 0,
221
- class: "ss-dash-log-reqid",
222
- title: s(g)(e),
223
- role: "button",
224
- tabindex: "0",
225
- onClick: U((I) => N(s(g)(e)), ["stop"]),
226
- onKeydown: V(U((I) => N(s(g)(e)), ["stop"]), ["enter"])
227
- }, i(s(g)(e).slice(0, 8)), 41, Te)) : (a(), o("span", Re, "--")),
228
- s(m)(e) ? (a(), o("span", {
229
- key: 2,
230
- class: $([
231
- "ss-dash-log-expand-icon",
232
- { "ss-dash-log-expand-icon-open": k.value === c }
233
- ])
234
- }, "▶", 2)) : (a(), o("span", Ae)),
235
- n("span", Be, i(s(_e)(e)), 1)
236
- ], 10, De),
237
- k.value === c && s(m)(e) ? (a(), o("div", Oe, [
238
- O(fe, {
239
- value: s(m)(e),
240
- "class-prefix": "ss-dash",
241
- "default-expanded": ""
242
- }, null, 8, ["value"])
243
- ])) : _("", !0)
244
- ], 64))), 128))
245
- ])),
246
- s(v).totalPages > 1 ? (a(), de(ye, {
247
- key: 5,
248
- page: s(v).page,
249
- "last-page": s(v).totalPages,
250
- total: s(v).total,
251
- onPageChange: s(X)
252
- }, null, 8, ["page", "last-page", "total", "onPageChange"])) : _("", !0)
253
- ]));
254
- }
255
- });
256
- export {
257
- Je as default
258
- };