adonisjs-server-stats 1.6.14 → 1.9.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 (69) hide show
  1. package/README.md +24 -8
  2. package/dist/core/index.js +248 -245
  3. package/dist/core/log-utils.d.ts +14 -0
  4. package/dist/react/{CacheSection-DGxMDlWK.js → CacheSection-xH75hwXu.js} +1 -1
  5. package/dist/react/{CacheTab-CnVW5PLs.js → CacheTab-DYmsZJJ1.js} +1 -1
  6. package/dist/react/{ConfigSection-DPcrfqXY.js → ConfigSection-D8BO1Ry9.js} +1 -1
  7. package/dist/react/{ConfigTab-BSWq_o2p.js → ConfigTab-CcN-tfjv.js} +1 -1
  8. package/dist/react/{CustomPaneTab-xjkYwTvH.js → CustomPaneTab-D7_o3Ec6.js} +1 -1
  9. package/dist/react/{EmailsSection-CSyTg1aX.js → EmailsSection-BzlsTdPs.js} +1 -1
  10. package/dist/react/{EmailsTab-Dh2YSa_f.js → EmailsTab-Uh2CQY3o.js} +44 -22
  11. package/dist/react/{EventsSection-C1pbJDfW.js → EventsSection-CGQWiIdV.js} +1 -1
  12. package/dist/react/{EventsTab-eCh02cdd.js → EventsTab-CC6DQzEm.js} +1 -1
  13. package/dist/react/{JobsSection-CLAin5vU.js → JobsSection-D7AHQmZi.js} +1 -1
  14. package/dist/react/{JobsTab-Dl5nrj2z.js → JobsTab-B3Lfdqed.js} +1 -1
  15. package/dist/react/LogsSection-Cly1dpvS.js +227 -0
  16. package/dist/react/LogsTab-BbYK-iyh.js +103 -0
  17. package/dist/react/{OverviewSection-nm3xdACz.js → OverviewSection-CkBGFEWq.js} +1 -1
  18. package/dist/react/{QueriesSection-DB12HMfQ.js → QueriesSection-CfCpnNUD.js} +1 -1
  19. package/dist/react/{QueriesTab-fyBB1u_Y.js → QueriesTab-DbBmAqzO.js} +1 -1
  20. package/dist/react/{RequestsSection-DTqB81ac.js → RequestsSection-Cb5a6MlT.js} +1 -1
  21. package/dist/react/{RoutesSection-DJWa4NPV.js → RoutesSection-CRqF-cNM.js} +1 -1
  22. package/dist/react/{RoutesTab-D3l8TOpu.js → RoutesTab-Bwreij3e.js} +1 -1
  23. package/dist/react/{TimelineSection-C4d-jRX1.js → TimelineSection-B2y06kRE.js} +1 -1
  24. package/dist/react/{TimelineTab-C5TFaSmQ.js → TimelineTab-6hthfdBB.js} +1 -1
  25. package/dist/react/{index-UdTfSvtO.js → index-CecA4IdQ.js} +394 -393
  26. package/dist/react/index.js +1 -1
  27. package/dist/react/react/components/shared/JsonViewer.d.ts +2 -1
  28. package/dist/react/style.css +1 -1
  29. package/dist/src/controller/debug_controller.js +10 -9
  30. package/dist/src/dashboard/dashboard_store.js +10 -6
  31. package/dist/src/data/data_access.js +12 -1
  32. package/dist/src/debug/email_collector.d.ts +11 -1
  33. package/dist/src/debug/email_collector.js +31 -1
  34. package/dist/src/debug/types.d.ts +1 -1
  35. package/dist/src/edge/client/dashboard.js +2 -2
  36. package/dist/src/edge/client/debug-panel-deferred.js +1 -1
  37. package/dist/src/edge/client-vue/dashboard.js +4 -4
  38. package/dist/src/edge/client-vue/debug-panel-deferred.js +3 -3
  39. package/dist/src/provider/server_stats_provider.d.ts +31 -0
  40. package/dist/src/provider/server_stats_provider.js +244 -5
  41. package/dist/src/routes/register_routes.js +2 -2
  42. package/dist/src/styles/components.css +84 -0
  43. package/dist/vue/{CacheSection-C788Yfai.js → CacheSection-Cx-hj09X.js} +2 -2
  44. package/dist/vue/{ConfigSection-CRzYxqW2.js → ConfigSection-CMXyryf6.js} +1 -1
  45. package/dist/vue/{EmailsSection-C8JFMtW7.js → EmailsSection-DgKl9xGT.js} +1 -1
  46. package/dist/vue/EmailsTab-CNyEODVB.js +177 -0
  47. package/dist/vue/{EventsSection-C4wXUgxG.js → EventsSection-BNMCAim1.js} +2 -2
  48. package/dist/vue/{EventsTab-DQ4Nd6AK.js → EventsTab-BBM7olXF.js} +1 -1
  49. package/dist/vue/{JobsSection-CsKWTjgN.js → JobsSection-CCMgMlxd.js} +2 -2
  50. package/dist/vue/{JobsTab-BCvhOARO.js → JobsTab-WFnxPdN7.js} +1 -1
  51. package/dist/vue/{JsonViewer.vue_vue_type_script_setup_true_lang-Vsqar1zx.js → JsonViewer.vue_vue_type_script_setup_true_lang-Bid05zpm.js} +25 -23
  52. package/dist/vue/LogsSection-CvOnTxUu.js +252 -0
  53. package/dist/vue/LogsTab-Bg3o0Mm6.js +147 -0
  54. package/dist/vue/{OverviewSection-CbMdAido.js → OverviewSection-CHgaKtUR.js} +1 -1
  55. package/dist/vue/{QueriesSection-BPiv7u3r.js → QueriesSection-BnHRD98z.js} +1 -1
  56. package/dist/vue/{RequestsSection-LtImH4rD.js → RequestsSection-B-uSlM0f.js} +1 -1
  57. package/dist/vue/{RoutesSection-CrxOxmzx.js → RoutesSection-BrceOcKQ.js} +1 -1
  58. package/dist/vue/{TimelineSection-DLxMW2J_.js → TimelineSection-CfvnA2Oo.js} +1 -1
  59. package/dist/vue/components/DebugPanel/tabs/EmailsTab.vue.d.ts +2 -0
  60. package/dist/vue/components/shared/JsonViewer.vue.d.ts +3 -0
  61. package/dist/vue/{index-qCQpBftQ.js → index-oLxS08vN.js} +56 -54
  62. package/dist/vue/index.js +1 -1
  63. package/dist/vue/style.css +1 -1
  64. package/package.json +1 -1
  65. package/dist/react/LogsSection-C1p81fXO.js +0 -212
  66. package/dist/react/LogsTab-D-kR7PjX.js +0 -88
  67. package/dist/vue/EmailsTab-DhFhoNmU.js +0 -157
  68. package/dist/vue/LogsSection-BFVjSZ24.js +0 -227
  69. package/dist/vue/LogsTab-DpEQ7euu.js +0 -122
@@ -1,157 +0,0 @@
1
- import { defineComponent as L, ref as g, computed as p, openBlock as n, createElementBlock as i, createElementVNode as s, createTextVNode as u, toDisplayString as a, createCommentVNode as m, normalizeClass as h, Fragment as _, withDirectives as x, vModelText as A, renderList as j, unref as f } from "vue";
2
- import { formatTime as N, timeAgo as S } from "adonisjs-server-stats/core";
3
- import { u as E } from "./useResizableTable-BoivAevK.js";
4
- const F = { style: { position: "relative", height: "100%" } }, V = {
5
- key: 0,
6
- class: "ss-dbg-email-preview"
7
- }, q = { class: "ss-dbg-email-preview-header" }, M = { class: "ss-dbg-email-preview-meta" }, P = { key: 0 }, R = ["srcdoc"], z = {
8
- key: 1,
9
- class: "ss-dbg-empty"
10
- }, B = { class: "ss-dbg-search-bar" }, D = { class: "ss-dbg-summary" }, $ = {
11
- key: 0,
12
- class: "ss-dbg-empty"
13
- }, H = ["onClick"], U = {
14
- class: "ss-dbg-c-dim",
15
- style: { "white-space": "nowrap" }
16
- }, G = ["title"], I = ["title"], J = { class: "ss-dbg-c-sql" }, K = { class: "ss-dbg-c-muted" }, O = {
17
- class: "ss-dbg-c-dim",
18
- style: { "text-align": "center" }
19
- }, Q = ["title"], Z = /* @__PURE__ */ L({
20
- __name: "EmailsTab",
21
- props: {
22
- data: {},
23
- dashboardPath: {}
24
- },
25
- setup(y) {
26
- const v = y, d = g(""), o = g(null), c = p(() => {
27
- const l = v.data, e = l ? (Array.isArray(l) ? l : l.emails) || [] : [];
28
- if (!d.value.trim()) return e;
29
- const t = d.value.toLowerCase();
30
- return e.filter(
31
- (r) => r.subject.toLowerCase().includes(t) || r.from.toLowerCase().includes(t) || r.to.toLowerCase().includes(t) || r.mailer && r.mailer.toLowerCase().includes(t)
32
- );
33
- }), C = p(() => {
34
- const l = v.data;
35
- return `${(l ? (Array.isArray(l) ? l : l.emails) || [] : []).length} emails`;
36
- });
37
- function b(l) {
38
- return {
39
- sent: "ss-dbg-email-status-sent",
40
- sending: "ss-dbg-email-status-sending",
41
- queued: "ss-dbg-email-status-queued",
42
- failed: "ss-dbg-email-status-failed"
43
- }[l] || "";
44
- }
45
- function w(l) {
46
- o.value = l;
47
- }
48
- function k() {
49
- o.value = null;
50
- }
51
- const { tableRef: T } = E(() => c.value);
52
- return (l, e) => (n(), i("div", F, [
53
- o.value ? (n(), i("div", V, [
54
- s("div", q, [
55
- s("div", M, [
56
- s("div", null, [
57
- e[1] || (e[1] = s("strong", null, "From:", -1)),
58
- u(" " + a(o.value.from), 1)
59
- ]),
60
- s("div", null, [
61
- e[2] || (e[2] = s("strong", null, "To:", -1)),
62
- u(" " + a(o.value.to), 1)
63
- ]),
64
- o.value.cc ? (n(), i("div", P, [
65
- e[3] || (e[3] = s("strong", null, "CC:", -1)),
66
- u(" " + a(o.value.cc), 1)
67
- ])) : m("", !0),
68
- s("div", null, [
69
- e[4] || (e[4] = s("strong", null, "Subject:", -1)),
70
- u(" " + a(o.value.subject), 1)
71
- ]),
72
- s("div", null, [
73
- e[5] || (e[5] = s("strong", null, "Status:", -1)),
74
- s("span", {
75
- class: h(["ss-dbg-email-status", b(o.value.status)])
76
- }, a(o.value.status), 3)
77
- ])
78
- ]),
79
- s("button", {
80
- type: "button",
81
- class: "ss-dbg-btn-clear",
82
- onClick: k
83
- }, "×")
84
- ]),
85
- o.value.html ? (n(), i("iframe", {
86
- key: 0,
87
- class: "ss-dbg-email-iframe",
88
- srcdoc: o.value.html
89
- }, null, 8, R)) : (n(), i("div", z, "No HTML content"))
90
- ])) : m("", !0),
91
- o.value ? m("", !0) : (n(), i(_, { key: 1 }, [
92
- s("div", B, [
93
- x(s("input", {
94
- "onUpdate:modelValue": e[0] || (e[0] = (t) => d.value = t),
95
- class: "ss-dbg-search",
96
- placeholder: "Filter emails...",
97
- type: "text"
98
- }, null, 512), [
99
- [A, d.value]
100
- ]),
101
- s("span", D, a(C.value), 1)
102
- ]),
103
- c.value.length === 0 ? (n(), i("div", $, "No emails captured")) : (n(), i("table", {
104
- key: 1,
105
- ref_key: "tableRef",
106
- ref: T,
107
- class: "ss-dbg-table"
108
- }, [
109
- e[6] || (e[6] = s("thead", null, [
110
- s("tr", null, [
111
- s("th", null, "#"),
112
- s("th", null, "From"),
113
- s("th", null, "To"),
114
- s("th", null, "Subject"),
115
- s("th", null, "Status"),
116
- s("th", null, "Mailer"),
117
- s("th", { title: "Attachments" }, "📎"),
118
- s("th", null, "Time")
119
- ])
120
- ], -1)),
121
- s("tbody", null, [
122
- (n(!0), i(_, null, j(c.value, (t) => (n(), i("tr", {
123
- key: t.id,
124
- class: "ss-dbg-email-row",
125
- onClick: (r) => w(t)
126
- }, [
127
- s("td", U, a(t.id), 1),
128
- s("td", {
129
- class: "ss-dbg-c-secondary",
130
- title: t.from
131
- }, a(t.from), 9, G),
132
- s("td", {
133
- class: "ss-dbg-c-secondary",
134
- title: t.to
135
- }, a(t.to), 9, I),
136
- s("td", J, a(t.subject), 1),
137
- s("td", null, [
138
- s("span", {
139
- class: h(["ss-dbg-email-status", b(t.status)])
140
- }, a(t.status), 3)
141
- ]),
142
- s("td", K, a(t.mailer), 1),
143
- s("td", O, a(t.attachmentCount > 0 ? t.attachmentCount : "-"), 1),
144
- s("td", {
145
- class: "ss-dbg-event-time",
146
- title: f(N)(t.timestamp)
147
- }, a(f(S)(t.timestamp)), 9, Q)
148
- ], 8, H))), 128))
149
- ])
150
- ], 512))
151
- ], 64))
152
- ]));
153
- }
154
- });
155
- export {
156
- Z as default
157
- };
@@ -1,227 +0,0 @@
1
- import { defineComponent as se, inject as k, ref as u, computed as R, openBlock as a, createElementBlock as o, createVNode as le, unref as s, withCtx as ae, createElementVNode as n, Fragment as F, renderList as L, normalizeClass as x, toDisplayString as i, withKeys as $, createCommentVNode as f, createStaticVNode as oe, createTextVNode as S, createBlock as ne } from "vue";
2
- import { LOG_LEVELS as ie, getLogLevelCssClass as re, resolveLogLevel as A, resolveLogTimestamp as b, formatTime as ue, timeAgo as de, resolveLogRequestId as m, resolveLogMessage as ce } from "adonisjs-server-stats/core";
3
- import { u as ve } from "./index-qCQpBftQ.js";
4
- import { _ as pe } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
5
- import { _ as he } from "./PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js";
6
- const _e = { class: "ss-dash-log-filters" }, fe = ["onClick"], me = ["value"], ge = { class: "ss-dash-structured-search" }, ye = ["value"], ke = ["value"], be = ["value"], Ce = {
7
- key: 0,
8
- class: "ss-dash-filter-chips"
9
- }, qe = {
10
- key: 0,
11
- class: "ss-dash-filter-chip"
12
- }, Fe = {
13
- key: 1,
14
- class: "ss-dash-filter-chip"
15
- }, Le = ["onClick"], $e = {
16
- key: 1,
17
- class: "ss-dash-empty"
18
- }, Se = {
19
- key: 2,
20
- class: "ss-dash-empty"
21
- }, Ie = {
22
- key: 3,
23
- class: "ss-dash-empty"
24
- }, Ve = {
25
- key: 4,
26
- class: "ss-dash-log-entries"
27
- }, we = ["title"], Ee = ["title", "onClick", "onKeydown"], Ke = {
28
- key: 1,
29
- class: "ss-dash-log-reqid-empty"
30
- }, Ne = { class: "ss-dash-log-msg" }, Be = /* @__PURE__ */ se({
31
- __name: "LogsSection",
32
- setup(Pe) {
33
- const B = k("ss-refresh-key", u(0)), O = k("ss-dashboard-endpoint", "/__stats/api"), U = k("ss-auth-token", void 0), W = k("ss-base-url", ""), {
34
- data: g,
35
- loading: j,
36
- error: z,
37
- pagination: c,
38
- filter: G,
39
- goToPage: M,
40
- setSearch: H,
41
- setFilter: v,
42
- refresh: J
43
- } = ve(() => "logs", {
44
- baseUrl: W,
45
- dashboardEndpoint: O,
46
- authToken: U,
47
- refreshKey: B
48
- }), I = u(""), d = u("all"), r = u(""), p = u(""), h = u([]), C = u("level"), q = u("equals"), y = u(""), V = R(() => {
49
- if (!g.value) return [];
50
- const t = g.value;
51
- return t.data || t.logs || g.value || [];
52
- }), Q = R(
53
- () => d.value !== "all" || r.value !== "" || h.value.length > 0
54
- );
55
- function X(t) {
56
- I.value = t, H(t);
57
- }
58
- function Y(t) {
59
- d.value = t, t === "all" ? v("level", "") : v("level", t);
60
- }
61
- function w(t) {
62
- r.value = t, p.value = t, v("request_id", t);
63
- }
64
- function Z() {
65
- const t = p.value.trim();
66
- r.value = t, v("request_id", t);
67
- }
68
- function E() {
69
- r.value = "", p.value = "", v("request_id", "");
70
- }
71
- function ee() {
72
- d.value = "all", v("level", "");
73
- }
74
- function K() {
75
- const t = G;
76
- for (const l of Object.keys(t))
77
- (l.startsWith("filter_field_") || l.startsWith("filter_op_") || l.startsWith("filter_value_")) && delete t[l];
78
- h.value.forEach((l, e) => {
79
- t[`filter_field_${e}`] = l.field, t[`filter_op_${e}`] = l.operator, t[`filter_value_${e}`] = l.value;
80
- }), c.page = 1, J();
81
- }
82
- function N() {
83
- const t = y.value.trim();
84
- t && (h.value.push({
85
- field: C.value,
86
- operator: q.value,
87
- value: t
88
- }), y.value = "", K());
89
- }
90
- function te(t) {
91
- h.value.splice(t, 1), K();
92
- }
93
- function P(t) {
94
- return t.target.value;
95
- }
96
- function T(t) {
97
- return t.target.value;
98
- }
99
- return (t, l) => (a(), o("div", null, [
100
- le(pe, {
101
- "model-value": I.value,
102
- placeholder: "Search logs...",
103
- summary: `${s(c).total ?? 0} logs`,
104
- "onUpdate:modelValue": X
105
- }, {
106
- default: ae(() => [
107
- n("div", _e, [
108
- (a(!0), o(F, null, L(s(ie), (e) => (a(), o("button", {
109
- key: e,
110
- type: "button",
111
- class: x(`ss-dash-log-filter ${d.value === e ? "ss-dash-active" : ""}`),
112
- onClick: (_) => Y(e)
113
- }, i(e), 11, fe))), 128)),
114
- n("input", {
115
- type: "text",
116
- class: "ss-dash-filter-input ss-dash-reqid-input",
117
- placeholder: "Filter by request ID...",
118
- value: p.value,
119
- onInput: l[0] || (l[0] = (e) => p.value = P(e)),
120
- onKeydown: $(Z, ["enter"])
121
- }, null, 40, me),
122
- p.value || r.value ? (a(), o("button", {
123
- key: 0,
124
- type: "button",
125
- class: "ss-dash-btn ss-dash-reqid-clear",
126
- onClick: E
127
- }, " Clear ")) : f("", !0)
128
- ])
129
- ]),
130
- _: 1
131
- }, 8, ["model-value", "summary"]),
132
- n("div", ge, [
133
- n("select", {
134
- class: "ss-dash-filter-select",
135
- value: C.value,
136
- onChange: l[1] || (l[1] = (e) => C.value = T(e))
137
- }, [...l[4] || (l[4] = [
138
- oe('<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)
139
- ])], 40, ye),
140
- n("select", {
141
- class: "ss-dash-filter-select",
142
- value: q.value,
143
- onChange: l[2] || (l[2] = (e) => q.value = T(e))
144
- }, [...l[5] || (l[5] = [
145
- n("option", { value: "equals" }, "equals", -1),
146
- n("option", { value: "contains" }, "contains", -1),
147
- n("option", { value: "starts_with" }, "starts with", -1)
148
- ])], 40, ke),
149
- n("input", {
150
- class: "ss-dash-filter-input",
151
- placeholder: "Value...",
152
- value: y.value,
153
- onInput: l[3] || (l[3] = (e) => y.value = P(e)),
154
- onKeydown: $(N, ["enter"])
155
- }, null, 40, be),
156
- n("button", {
157
- type: "button",
158
- class: "ss-dash-btn",
159
- onClick: N
160
- }, "Add")
161
- ]),
162
- Q.value ? (a(), o("div", Ce, [
163
- d.value !== "all" ? (a(), o("span", qe, [
164
- S(" level: " + i(d.value) + " ", 1),
165
- n("button", {
166
- type: "button",
167
- class: "ss-dash-filter-chip-remove",
168
- onClick: ee
169
- }, " × ")
170
- ])) : f("", !0),
171
- r.value ? (a(), o("span", Fe, [
172
- S(" requestId: " + i(r.value.slice(0, 8)) + "... ", 1),
173
- n("button", {
174
- type: "button",
175
- class: "ss-dash-filter-chip-remove",
176
- onClick: E
177
- }, " × ")
178
- ])) : f("", !0),
179
- (a(!0), o(F, null, L(h.value, (e, _) => (a(), o("span", {
180
- key: _,
181
- class: "ss-dash-filter-chip"
182
- }, [
183
- S(i(e.field) + " " + i(e.operator) + ' "' + i(e.value) + '" ', 1),
184
- n("button", {
185
- type: "button",
186
- class: "ss-dash-filter-chip-remove",
187
- onClick: (D) => te(_)
188
- }, " × ", 8, Le)
189
- ]))), 128))
190
- ])) : f("", !0),
191
- s(z) ? (a(), o("div", $e, "Failed to load logs")) : s(j) && !s(g) ? (a(), o("div", Se, "Loading logs...")) : V.value.length === 0 ? (a(), o("div", Ie, " No log entries" + i(r.value ? ` matching request ${r.value}` : d.value !== "all" ? ` for ${d.value}` : ""), 1)) : (a(), o("div", Ve, [
192
- (a(!0), o(F, null, L(V.value, (e, _) => (a(), o("div", {
193
- key: String(e.id || _),
194
- class: "ss-dash-log-entry"
195
- }, [
196
- n("span", {
197
- class: x(`ss-dash-log-level ${s(re)(s(A)(e), "ss-dash-log-level")}`)
198
- }, i(s(A)(e).toUpperCase()), 3),
199
- n("span", {
200
- class: "ss-dash-log-time",
201
- title: s(b)(e) ? s(ue)(s(b)(e)) : ""
202
- }, i(s(b)(e) ? s(de)(s(b)(e)) : "-"), 9, we),
203
- s(m)(e) ? (a(), o("span", {
204
- key: 0,
205
- class: "ss-dash-log-reqid",
206
- title: s(m)(e),
207
- role: "button",
208
- tabindex: "0",
209
- onClick: (D) => w(s(m)(e)),
210
- onKeydown: $((D) => w(s(m)(e)), ["enter"])
211
- }, i(s(m)(e).slice(0, 8)), 41, Ee)) : (a(), o("span", Ke, "--")),
212
- n("span", Ne, i(s(ce)(e)), 1)
213
- ]))), 128))
214
- ])),
215
- s(c).totalPages > 1 ? (a(), ne(he, {
216
- key: 5,
217
- page: s(c).page,
218
- "last-page": s(c).totalPages,
219
- total: s(c).total,
220
- onPageChange: s(M)
221
- }, null, 8, ["page", "last-page", "total", "onPageChange"])) : f("", !0)
222
- ]));
223
- }
224
- });
225
- export {
226
- Be as default
227
- };
@@ -1,122 +0,0 @@
1
- import { defineComponent as E, ref as h, computed as _, openBlock as n, createElementBlock as l, createElementVNode as r, Fragment as L, renderList as k, unref as s, normalizeClass as C, toDisplayString as i, createCommentVNode as w, withDirectives as x, vModelText as q, withKeys as F } from "vue";
2
- import { filterLogsByLevel as M, resolveLogRequestId as d, resolveLogMessage as B, LOG_LEVELS as N, getLogLevelCssClass as R, resolveLogLevel as I, resolveLogTimestamp as m, formatTime as S, timeAgo as D, TAB_ICONS as $ } from "adonisjs-server-stats/core";
3
- const K = { class: "ss-dbg-log-filters" }, P = ["onClick"], U = {
4
- class: "ss-dbg-summary",
5
- style: { "margin-left": "auto" }
6
- }, H = { class: "ss-dbg-search-bar" }, O = { class: "ss-dbg-summary" }, j = {
7
- key: 0,
8
- class: "ss-dbg-empty"
9
- }, z = { key: 1 }, G = ["title"], J = ["title", "onClick", "onKeydown"], Q = {
10
- key: 1,
11
- class: "ss-dbg-log-reqid-empty"
12
- }, W = { class: "ss-dbg-log-msg" }, X = ["href"], Y = ["viewBox", "innerHTML"], se = /* @__PURE__ */ E({
13
- __name: "LogsTab",
14
- props: {
15
- data: {},
16
- dashboardPath: {}
17
- },
18
- emits: ["filterByRequestId"],
19
- setup(p, { emit: T }) {
20
- const y = p, A = T, b = h("all"), c = h(""), a = h(""), v = _(() => {
21
- const o = y.data;
22
- let t = o ? (Array.isArray(o) ? o : o.logs || o.entries) || [] : [];
23
- if (t = M(t, b.value), a.value.trim()) {
24
- const e = a.value.trim().toLowerCase();
25
- t = t.filter((u) => {
26
- const g = d(u);
27
- return g && g.toLowerCase().includes(e);
28
- });
29
- }
30
- if (c.value.trim()) {
31
- const e = c.value.trim().toLowerCase();
32
- t = t.filter((u) => B(u).toLowerCase().includes(e));
33
- }
34
- return t;
35
- }), V = _(() => {
36
- const o = y.data, t = o ? (Array.isArray(o) ? o : o.logs || o.entries) || [] : [];
37
- return `${v.value.length} of ${t.length} entries`;
38
- });
39
- function f(o) {
40
- a.value = o, A("filterByRequestId", o);
41
- }
42
- return (o, t) => (n(), l("div", null, [
43
- r("div", K, [
44
- (n(!0), l(L, null, k(s(N), (e) => (n(), l("button", {
45
- key: e,
46
- type: "button",
47
- class: C(["ss-dbg-log-filter", { "ss-dbg-active": b.value === e }]),
48
- onClick: (u) => b.value = e
49
- }, i(e), 11, P))), 128)),
50
- a.value ? (n(), l("button", {
51
- key: 0,
52
- type: "button",
53
- class: "ss-dbg-log-filter ss-dbg-active",
54
- onClick: t[0] || (t[0] = (e) => a.value = "")
55
- }, " req: " + i(a.value.slice(0, 8)) + " x ", 1)) : w("", !0),
56
- r("span", U, i(v.value.length) + " entries", 1)
57
- ]),
58
- r("div", H, [
59
- x(r("input", {
60
- "onUpdate:modelValue": t[1] || (t[1] = (e) => c.value = e),
61
- class: "ss-dbg-search",
62
- placeholder: "Filter log messages...",
63
- type: "text"
64
- }, null, 512), [
65
- [q, c.value]
66
- ]),
67
- x(r("input", {
68
- "onUpdate:modelValue": t[2] || (t[2] = (e) => a.value = e),
69
- class: "ss-dbg-search ss-dbg-reqid-input",
70
- placeholder: "Filter by request ID...",
71
- type: "text"
72
- }, null, 512), [
73
- [q, a.value]
74
- ]),
75
- r("span", O, i(V.value), 1)
76
- ]),
77
- v.value.length === 0 ? (n(), l("div", j, "No log entries")) : (n(), l("div", z, [
78
- (n(!0), l(L, null, k(v.value, (e, u) => (n(), l("div", {
79
- key: String(e.id || u),
80
- class: "ss-dbg-log-entry"
81
- }, [
82
- r("span", {
83
- class: C(["ss-dbg-log-level", s(R)(s(I)(e))])
84
- }, i(s(I)(e).toUpperCase()), 3),
85
- r("span", {
86
- class: "ss-dbg-log-time",
87
- title: s(m)(e) ? s(S)(s(m)(e)) : ""
88
- }, i(s(m)(e) ? s(D)(s(m)(e)) : "-"), 9, G),
89
- s(d)(e) ? (n(), l("span", {
90
- key: 0,
91
- class: "ss-dbg-log-reqid",
92
- role: "button",
93
- tabindex: "0",
94
- title: s(d)(e),
95
- onClick: (g) => f(s(d)(e)),
96
- onKeydown: F((g) => f(s(d)(e)), ["enter"])
97
- }, i(s(d)(e).slice(0, 8)), 41, J)) : (n(), l("span", Q, "-")),
98
- r("span", W, i(s(B)(e)), 1),
99
- p.dashboardPath && s(d)(e) ? (n(), l("a", {
100
- key: 2,
101
- href: `${p.dashboardPath}#logs?requestId=${s(d)(e)}`,
102
- target: "_blank",
103
- class: "ss-dbg-deeplink"
104
- }, [
105
- (n(), l("svg", {
106
- viewBox: s($)["open-external"].viewBox,
107
- width: "12",
108
- height: "12",
109
- fill: "none",
110
- stroke: "currentColor",
111
- "stroke-width": "2",
112
- innerHTML: s($)["open-external"].elements.join("")
113
- }, null, 8, Y))
114
- ], 8, X)) : w("", !0)
115
- ]))), 128))
116
- ]))
117
- ]));
118
- }
119
- });
120
- export {
121
- se as default
122
- };