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,10 +1,10 @@
1
1
  import { defineComponent as E, inject as i, ref as p, computed as P, openBlock as s, createElementBlock as l, createVNode as v, unref as a, Fragment as h, createElementVNode as e, renderList as T, toDisplayString as c, createBlock as C, createCommentVNode as D } from "vue";
2
2
  import { formatTime as S, timeAgo as V } from "adonisjs-server-stats/core";
3
- import { u as $ } from "./index-qCQpBftQ.js";
3
+ import { u as $ } from "./index-oLxS08vN.js";
4
4
  import { u as A } from "./useResizableTable-BoivAevK.js";
5
5
  import { _ as B } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
6
6
  import { _ as R } from "./PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js";
7
- import { _ as F } from "./JsonViewer.vue_vue_type_script_setup_true_lang-Vsqar1zx.js";
7
+ import { _ as F } from "./JsonViewer.vue_vue_type_script_setup_true_lang-Bid05zpm.js";
8
8
  const L = {
9
9
  key: 0,
10
10
  class: "ss-dash-empty"
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as _, ref as f, computed as v, openBlock as n, createElementBlock as r, createElementVNode as e, withDirectives as g, vModelText as y, toDisplayString as o, Fragment as k, renderList as w, createTextVNode as x, unref as d, createCommentVNode as T, createVNode as C } from "vue";
2
2
  import { TAB_ICONS as h, formatTime as A, timeAgo as B } from "adonisjs-server-stats/core";
3
3
  import { u as L } from "./useResizableTable-BoivAevK.js";
4
- import { _ as N } from "./JsonViewer.vue_vue_type_script_setup_true_lang-Vsqar1zx.js";
4
+ import { _ as N } from "./JsonViewer.vue_vue_type_script_setup_true_lang-Bid05zpm.js";
5
5
  const V = { class: "ss-dbg-search-bar" }, E = { class: "ss-dbg-summary" }, $ = {
6
6
  key: 0,
7
7
  class: "ss-dbg-empty"
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as L, inject as h, ref as p, computed as g, openBlock as o, createElementBlock as d, createElementVNode as s, toDisplayString as n, createCommentVNode as v, createVNode as k, unref as a, withCtx as z, Fragment as _, renderList as x, normalizeClass as w, withModifiers as K, createBlock as M } from "vue";
2
2
  import { extractJobs as O, extractJobStats as Q, JOB_STATUS_FILTERS as W, getJobStatusBadgeColor as q, formatDuration as G, formatTime as H, timeAgo as X } from "adonisjs-server-stats/core";
3
- import { u as Y } from "./index-qCQpBftQ.js";
3
+ import { u as Y } from "./index-oLxS08vN.js";
4
4
  import { u as Z } from "./useResizableTable-BoivAevK.js";
5
- import { _ as I } from "./JsonViewer.vue_vue_type_script_setup_true_lang-Vsqar1zx.js";
5
+ import { _ as I } from "./JsonViewer.vue_vue_type_script_setup_true_lang-Bid05zpm.js";
6
6
  import { _ as j } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
7
7
  import { _ as ss } from "./PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js";
8
8
  const ts = {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as T, ref as j, computed as c, openBlock as l, createElementBlock as o, createElementVNode as s, toDisplayString as a, Fragment as _, renderList as g, unref as i, normalizeClass as m, createVNode as D, createCommentVNode as R } from "vue";
2
2
  import { JOB_STATUS_FILTERS as S, getJobStatusCssClass as x, formatDuration as A, formatTime as J, timeAgo as N } from "adonisjs-server-stats/core";
3
3
  import { u as F } from "./useResizableTable-BoivAevK.js";
4
- import { _ as $ } from "./JsonViewer.vue_vue_type_script_setup_true_lang-Vsqar1zx.js";
4
+ import { _ as $ } from "./JsonViewer.vue_vue_type_script_setup_true_lang-Bid05zpm.js";
5
5
  const B = { class: "ss-dbg-job-stats-area" }, E = { class: "ss-dbg-job-stats" }, V = { class: "ss-dbg-job-stat" }, w = { class: "ss-dbg-job-stat-value" }, z = { class: "ss-dbg-job-stat" }, I = { class: "ss-dbg-job-stat-value" }, L = { class: "ss-dbg-job-stat" }, q = { class: "ss-dbg-job-stat-value" }, O = { class: "ss-dbg-job-stat" }, P = { class: "ss-dbg-job-stat-value" }, U = { class: "ss-dbg-job-stat" }, W = { class: "ss-dbg-job-stat-value ss-dbg-c-red" }, G = { class: "ss-dbg-log-filters" }, H = ["onClick"], K = {
6
6
  key: 0,
7
7
  class: "ss-dbg-empty"
@@ -1,14 +1,15 @@
1
- import { defineComponent as y, ref as x, computed as c, openBlock as r, createElementBlock as o, normalizeClass as l, createElementVNode as s, toDisplayString as v, withModifiers as g, createCommentVNode as k } from "vue";
1
+ import { defineComponent as x, ref as k, computed as i, openBlock as t, createElementBlock as n, normalizeClass as l, toDisplayString as c, createCommentVNode as v, createElementVNode as d, withModifiers as g } from "vue";
2
2
  import { compactPreview as p } from "adonisjs-server-stats/core";
3
- const P = /* @__PURE__ */ y({
3
+ const P = /* @__PURE__ */ x({
4
4
  __name: "JsonViewer",
5
5
  props: {
6
6
  value: {},
7
7
  maxLen: {},
8
- classPrefix: { default: "ss-dash" }
8
+ classPrefix: { default: "ss-dash" },
9
+ defaultExpanded: { type: Boolean, default: !1 }
9
10
  },
10
- setup(a) {
11
- const e = a, t = x(!1), f = c(() => {
11
+ setup(r) {
12
+ const e = r, a = k(e.defaultExpanded), f = i(() => {
12
13
  if (e.value === null || e.value === void 0) return "-";
13
14
  if (typeof e.value == "string")
14
15
  try {
@@ -17,7 +18,7 @@ const P = /* @__PURE__ */ y({
17
18
  return e.value.length > 100 ? e.value.slice(0, 100) + "..." : e.value;
18
19
  }
19
20
  return p(e.value, e.maxLen || 100);
20
- }), i = c(() => {
21
+ }), u = i(() => {
21
22
  if (e.value === null || e.value === void 0) return "";
22
23
  if (typeof e.value == "string")
23
24
  try {
@@ -27,38 +28,39 @@ const P = /* @__PURE__ */ y({
27
28
  }
28
29
  return JSON.stringify(e.value, null, 2);
29
30
  });
30
- function n() {
31
- t.value = !t.value;
31
+ function o() {
32
+ a.value = !a.value;
32
33
  }
33
- function d() {
34
- navigator.clipboard?.writeText(i.value);
34
+ function m() {
35
+ navigator.clipboard?.writeText(u.value);
35
36
  }
36
- return (C, u) => a.value === null || a.value === void 0 ? (r(), o("span", {
37
+ return (C, s) => r.value === null || r.value === void 0 ? (t(), n("span", {
37
38
  key: 0,
38
39
  class: l(`ss-dim ${e.classPrefix}-c-dim`)
39
- }, "-", 2)) : (r(), o("div", {
40
+ }, "-", 2)) : (t(), n("div", {
40
41
  key: 1,
41
42
  class: l(`${e.classPrefix}-data-cell`)
42
43
  }, [
43
- s("span", {
44
+ a.value ? v("", !0) : (t(), n("span", {
45
+ key: 0,
44
46
  class: l(`${e.classPrefix}-data-preview`),
45
47
  role: "button",
46
48
  tabindex: 0,
47
- onClick: n,
48
- onKeydown: u[0] || (u[0] = (m) => m.key === "Enter" && n())
49
- }, v(f.value), 35),
50
- t.value ? (r(), o("div", {
51
- key: 0,
49
+ onClick: o,
50
+ onKeydown: s[0] || (s[0] = (y) => y.key === "Enter" && o())
51
+ }, c(f.value), 35)),
52
+ a.value ? (t(), n("div", {
53
+ key: 1,
52
54
  class: l(`${e.classPrefix}-data-full`),
53
- onClick: n
55
+ onClick: o
54
56
  }, [
55
- s("button", {
57
+ d("button", {
56
58
  class: l(`${e.classPrefix}-copy-btn`),
57
59
  title: "Copy to clipboard",
58
- onClick: g(d, ["stop"])
60
+ onClick: g(m, ["stop"])
59
61
  }, " Copy ", 2),
60
- s("pre", null, v(i.value), 1)
61
- ], 2)) : k("", !0)
62
+ d("pre", null, c(u.value), 1)
63
+ ], 2)) : v("", !0)
62
64
  ], 2));
63
65
  }
64
66
  });
@@ -0,0 +1,252 @@
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-oLxS08vN.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: $(["ss-dash-log-entry", { "ss-dash-log-entry-expandable": !!s(m)(e) }]),
207
+ onClick: (I) => te(c, !!s(m)(e))
208
+ }, [
209
+ n("span", {
210
+ class: $(`ss-dash-log-level ${s(ve)(s(W)(e), "ss-dash-log-level")}`)
211
+ }, i(s(W)(e).toUpperCase()), 3),
212
+ n("span", {
213
+ class: "ss-dash-log-time",
214
+ title: s(F)(e) ? s(pe)(s(F)(e)) : ""
215
+ }, i(s(F)(e) ? s(he)(s(F)(e)) : "-"), 9, Pe),
216
+ s(g)(e) ? (a(), o("span", {
217
+ key: 0,
218
+ class: "ss-dash-log-reqid",
219
+ title: s(g)(e),
220
+ role: "button",
221
+ tabindex: "0",
222
+ onClick: U((I) => N(s(g)(e)), ["stop"]),
223
+ onKeydown: V(U((I) => N(s(g)(e)), ["stop"]), ["enter"])
224
+ }, i(s(g)(e).slice(0, 8)), 41, Te)) : (a(), o("span", Re, "--")),
225
+ s(m)(e) ? (a(), o("span", {
226
+ key: 2,
227
+ class: $(["ss-dash-log-expand-icon", { "ss-dash-log-expand-icon-open": k.value === c }])
228
+ }, "▶", 2)) : (a(), o("span", Ae)),
229
+ n("span", Be, i(s(_e)(e)), 1)
230
+ ], 10, De),
231
+ k.value === c && s(m)(e) ? (a(), o("div", Oe, [
232
+ O(fe, {
233
+ value: s(m)(e),
234
+ "class-prefix": "ss-dash",
235
+ "default-expanded": ""
236
+ }, null, 8, ["value"])
237
+ ])) : _("", !0)
238
+ ], 64))), 128))
239
+ ])),
240
+ s(v).totalPages > 1 ? (a(), de(ye, {
241
+ key: 5,
242
+ page: s(v).page,
243
+ "last-page": s(v).totalPages,
244
+ total: s(v).total,
245
+ onPageChange: s(X)
246
+ }, null, 8, ["page", "last-page", "total", "onPageChange"])) : _("", !0)
247
+ ]));
248
+ }
249
+ });
250
+ export {
251
+ Je as default
252
+ };
@@ -0,0 +1,147 @@
1
+ import { defineComponent as D, ref as b, computed as q, openBlock as o, createElementBlock as l, createElementVNode as a, Fragment as k, renderList as B, unref as s, normalizeClass as y, toDisplayString as d, createCommentVNode as x, withDirectives as $, vModelText as I, withKeys as F, withModifiers as L, createVNode as R } from "vue";
2
+ import { filterLogsByLevel as K, resolveLogRequestId as u, resolveLogMessage as T, LOG_LEVELS as P, getStructuredData as v, getLogLevelCssClass as U, resolveLogLevel as A, resolveLogTimestamp as h, formatTime as H, timeAgo as O, TAB_ICONS as V } from "adonisjs-server-stats/core";
3
+ import { _ as j } from "./JsonViewer.vue_vue_type_script_setup_true_lang-Bid05zpm.js";
4
+ const z = { class: "ss-dbg-log-filters" }, G = ["onClick"], J = {
5
+ class: "ss-dbg-summary",
6
+ style: { "margin-left": "auto" }
7
+ }, Q = { class: "ss-dbg-search-bar" }, W = { class: "ss-dbg-summary" }, X = {
8
+ key: 0,
9
+ class: "ss-dbg-empty"
10
+ }, Y = ["onClick"], Z = ["title"], ee = ["title", "onClick", "onKeydown"], se = {
11
+ key: 1,
12
+ class: "ss-dbg-log-reqid-empty"
13
+ }, te = {
14
+ key: 3,
15
+ style: { width: "14px" }
16
+ }, ne = { class: "ss-dbg-log-msg" }, oe = ["href"], le = ["viewBox", "innerHTML"], ae = {
17
+ key: 0,
18
+ class: "ss-dbg-log-detail"
19
+ }, ue = /* @__PURE__ */ D({
20
+ __name: "LogsTab",
21
+ props: {
22
+ data: {},
23
+ dashboardPath: {}
24
+ },
25
+ emits: ["filterByRequestId"],
26
+ setup(f, { emit: E }) {
27
+ const C = f, M = E, _ = b("all"), g = b(""), i = b(""), p = b(null), m = q(() => {
28
+ const n = C.data;
29
+ let t = n ? (Array.isArray(n) ? n : n.logs || n.entries) || [] : [];
30
+ if (t = K(t, _.value), i.value.trim()) {
31
+ const e = i.value.trim().toLowerCase();
32
+ t = t.filter((r) => {
33
+ const c = u(r);
34
+ return c && c.toLowerCase().includes(e);
35
+ });
36
+ }
37
+ if (g.value.trim()) {
38
+ const e = g.value.trim().toLowerCase();
39
+ t = t.filter((r) => T(r).toLowerCase().includes(e));
40
+ }
41
+ return t;
42
+ }), N = q(() => {
43
+ const n = C.data, t = n ? (Array.isArray(n) ? n : n.logs || n.entries) || [] : [];
44
+ return `${m.value.length} of ${t.length} entries`;
45
+ });
46
+ function S(n, t) {
47
+ t && (p.value = p.value === n ? null : n);
48
+ }
49
+ function w(n) {
50
+ i.value = n, M("filterByRequestId", n);
51
+ }
52
+ return (n, t) => (o(), l("div", null, [
53
+ a("div", z, [
54
+ (o(!0), l(k, null, B(s(P), (e) => (o(), l("button", {
55
+ key: e,
56
+ type: "button",
57
+ class: y(["ss-dbg-log-filter", { "ss-dbg-active": _.value === e }]),
58
+ onClick: (r) => _.value = e
59
+ }, d(e), 11, G))), 128)),
60
+ i.value ? (o(), l("button", {
61
+ key: 0,
62
+ type: "button",
63
+ class: "ss-dbg-log-filter ss-dbg-active",
64
+ onClick: t[0] || (t[0] = (e) => i.value = "")
65
+ }, " req: " + d(i.value.slice(0, 8)) + " x ", 1)) : x("", !0),
66
+ a("span", J, d(m.value.length) + " entries", 1)
67
+ ]),
68
+ a("div", Q, [
69
+ $(a("input", {
70
+ "onUpdate:modelValue": t[1] || (t[1] = (e) => g.value = e),
71
+ class: "ss-dbg-search",
72
+ placeholder: "Filter log messages...",
73
+ type: "text"
74
+ }, null, 512), [
75
+ [I, g.value]
76
+ ]),
77
+ $(a("input", {
78
+ "onUpdate:modelValue": t[2] || (t[2] = (e) => i.value = e),
79
+ class: "ss-dbg-search ss-dbg-reqid-input",
80
+ placeholder: "Filter by request ID...",
81
+ type: "text"
82
+ }, null, 512), [
83
+ [I, i.value]
84
+ ]),
85
+ a("span", W, d(N.value), 1)
86
+ ]),
87
+ m.value.length === 0 ? (o(), l("div", X, "No log entries")) : (o(!0), l(k, { key: 1 }, B(m.value, (e, r) => (o(), l(k, {
88
+ key: String(e.id || r)
89
+ }, [
90
+ a("div", {
91
+ class: y(["ss-dbg-log-entry", { "ss-dbg-log-entry-expandable": !!s(v)(e) }]),
92
+ onClick: (c) => S(r, !!s(v)(e))
93
+ }, [
94
+ a("span", {
95
+ class: y(["ss-dbg-log-level", s(U)(s(A)(e))])
96
+ }, d(s(A)(e).toUpperCase()), 3),
97
+ a("span", {
98
+ class: "ss-dbg-log-time",
99
+ title: s(h)(e) ? s(H)(s(h)(e)) : ""
100
+ }, d(s(h)(e) ? s(O)(s(h)(e)) : "-"), 9, Z),
101
+ s(u)(e) ? (o(), l("span", {
102
+ key: 0,
103
+ class: "ss-dbg-log-reqid",
104
+ role: "button",
105
+ tabindex: "0",
106
+ title: s(u)(e),
107
+ onClick: L((c) => w(s(u)(e)), ["stop"]),
108
+ onKeydown: F(L((c) => w(s(u)(e)), ["stop"]), ["enter"])
109
+ }, d(s(u)(e).slice(0, 8)), 41, ee)) : (o(), l("span", se, "-")),
110
+ s(v)(e) ? (o(), l("span", {
111
+ key: 2,
112
+ class: y(["ss-dbg-log-expand-icon", { "ss-dbg-log-expand-icon-open": p.value === r }])
113
+ }, "▶", 2)) : (o(), l("span", te)),
114
+ a("span", ne, d(s(T)(e)), 1),
115
+ f.dashboardPath && s(u)(e) ? (o(), l("a", {
116
+ key: 4,
117
+ href: `${f.dashboardPath}#logs?requestId=${s(u)(e)}`,
118
+ target: "_blank",
119
+ class: "ss-dbg-deeplink",
120
+ onClick: t[3] || (t[3] = L(() => {
121
+ }, ["stop"]))
122
+ }, [
123
+ (o(), l("svg", {
124
+ viewBox: s(V)["open-external"].viewBox,
125
+ width: "12",
126
+ height: "12",
127
+ fill: "none",
128
+ stroke: "currentColor",
129
+ "stroke-width": "2",
130
+ innerHTML: s(V)["open-external"].elements.join("")
131
+ }, null, 8, le))
132
+ ], 8, oe)) : x("", !0)
133
+ ], 10, Y),
134
+ p.value === r && s(v)(e) ? (o(), l("div", ae, [
135
+ R(j, {
136
+ value: s(v)(e),
137
+ "class-prefix": "ss-dbg",
138
+ "default-expanded": ""
139
+ }, null, 8, ["value"])
140
+ ])) : x("", !0)
141
+ ], 64))), 128))
142
+ ]));
143
+ }
144
+ });
145
+ export {
146
+ ue as default
147
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as ws, openBlock as o, createElementBlock as n, Fragment as _, renderList as k, createElementVNode as s, normalizeClass as b, toDisplayString as r, inject as P, ref as D, watch as ms, computed as d, onUnmounted as Ws, unref as x, createVNode as F, createCommentVNode as v, normalizeStyle as ts, createTextVNode as gs } from "vue";
2
2
  import { formatDuration as N, formatTime as Os, timeAgo as Hs, durationSeverity as Ks } from "adonisjs-server-stats/core";
3
- import { u as xs, _ as U } from "./index-qCQpBftQ.js";
3
+ import { u as xs, _ as U } from "./index-oLxS08vN.js";
4
4
  const Gs = { class: "ss-dash-btn-group" }, Xs = ["onClick"], Ys = /* @__PURE__ */ ws({
5
5
  __name: "TimeRangeSelector",
6
6
  props: {
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as H, inject as A, ref as C, computed as g, openBlock as o, createElementBlock as i, createVNode as W, withCtx as it, createElementVNode as e, normalizeClass as f, unref as u, createTextVNode as b, toDisplayString as r, createCommentVNode as v, Fragment as k, renderList as T, withKeys as B, withModifiers as L, createBlock as rt, h as D } from "vue";
2
2
  import { formatTime as ut, timeAgo as dt, SLOW_DURATION_MS as pt, durationSeverity as ct } from "adonisjs-server-stats/core";
3
- import { u as vt } from "./index-qCQpBftQ.js";
3
+ import { u as vt } from "./index-oLxS08vN.js";
4
4
  import { u as ht } from "./useResizableTable-BoivAevK.js";
5
5
  import { _ as mt } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
6
6
  import { _ as ft } from "./PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js";
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as M, inject as _, ref as h, computed as U, openBlock as o, createElementBlock as l, Fragment as m, createElementVNode as s, normalizeClass as v, toDisplayString as n, createVNode as D, unref as a, createCommentVNode as u, createTextVNode as y, renderList as j, createBlock as K } from "vue";
2
2
  import { formatTime as G, timeAgo as H, normalizeTraceFields as I, durationSeverity as J } from "adonisjs-server-stats/core";
3
3
  import { u as O } from "./useApiClient-BQQ9CF-q.js";
4
- import { u as Q } from "./index-qCQpBftQ.js";
4
+ import { u as Q } from "./index-oLxS08vN.js";
5
5
  import { u as W } from "./useResizableTable-BoivAevK.js";
6
6
  import { _ as X } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
7
7
  import { _ as Y } from "./PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as g, inject as d, ref as c, computed as A, openBlock as l, createElementBlock as o, createVNode as N, unref as u, createElementVNode as e, Fragment as R, renderList as S, normalizeClass as j, toDisplayString as a } from "vue";
2
- import { u as z } from "./index-qCQpBftQ.js";
2
+ import { u as z } from "./index-oLxS08vN.js";
3
3
  import { u as C } from "./useResizableTable-BoivAevK.js";
4
4
  import { _ as D } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
5
5
  const E = {
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as M, inject as v, ref as i, computed as U, openBlock as l, createElementBlock as o, Fragment as c, createElementVNode as s, normalizeClass as h, toDisplayString as n, unref as a, createVNode as C, createCommentVNode as x, renderList as z, createBlock as j } from "vue";
2
2
  import { parseTraceSpans as $, parseTraceWarnings as I, formatTime as K, timeAgo as W, durationSeverity as q } from "adonisjs-server-stats/core";
3
3
  import { u as G } from "./useApiClient-BQQ9CF-q.js";
4
- import { u as H } from "./index-qCQpBftQ.js";
4
+ import { u as H } from "./index-oLxS08vN.js";
5
5
  import { u as J } from "./useResizableTable-BoivAevK.js";
6
6
  import { _ as O } from "./FilterBar.vue_vue_type_script_setup_true_lang-ClJ37hhT.js";
7
7
  import { _ as Q } from "./PaginationControls.vue_vue_type_script_setup_true_lang-CuN7g_8Z.js";
@@ -4,6 +4,8 @@ type __VLS_Props = {
4
4
  emails?: EmailRecord[];
5
5
  } | EmailRecord[] | null;
6
6
  dashboardPath?: string;
7
+ debugEndpoint?: string;
8
+ authToken?: string;
7
9
  };
8
10
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
9
11
  tableRef: HTMLTableElement;
@@ -5,8 +5,11 @@ type __VLS_Props = {
5
5
  maxLen?: number;
6
6
  /** CSS class prefix: 'ss-dash' for dashboard, 'ss-dbg' for debug panel. */
7
7
  classPrefix?: 'ss-dash' | 'ss-dbg';
8
+ /** Start in expanded state. */
9
+ defaultExpanded?: boolean;
8
10
  };
9
11
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
10
12
  classPrefix: "ss-dash" | "ss-dbg";
13
+ defaultExpanded: boolean;
11
14
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
15
  export default _default;