adonisjs-server-stats 1.8.0 → 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.
- package/dist/core/log-utils.d.ts +14 -0
- package/dist/react/{CacheSection-D5J5moz7.js → CacheSection-xH75hwXu.js} +1 -1
- package/dist/react/{CacheTab-F1MkWSZl.js → CacheTab-DYmsZJJ1.js} +1 -1
- package/dist/react/{ConfigSection-DerLBu4o.js → ConfigSection-D8BO1Ry9.js} +1 -1
- package/dist/react/{ConfigTab-Bsj7v9JW.js → ConfigTab-CcN-tfjv.js} +1 -1
- package/dist/react/{CustomPaneTab-gzdtDEvz.js → CustomPaneTab-D7_o3Ec6.js} +1 -1
- package/dist/react/{EmailsSection-ndH3cvJk.js → EmailsSection-BzlsTdPs.js} +1 -1
- package/dist/react/{EmailsTab-DVPHRx0L.js → EmailsTab-Uh2CQY3o.js} +1 -1
- package/dist/react/{EventsSection-ClIByDSk.js → EventsSection-CGQWiIdV.js} +1 -1
- package/dist/react/{EventsTab-CCzWEKrk.js → EventsTab-CC6DQzEm.js} +1 -1
- package/dist/react/{JobsSection-CVMyAs7O.js → JobsSection-D7AHQmZi.js} +1 -1
- package/dist/react/{JobsTab-CATUyb9V.js → JobsTab-B3Lfdqed.js} +1 -1
- package/dist/react/LogsSection-Cly1dpvS.js +227 -0
- package/dist/react/LogsTab-BbYK-iyh.js +103 -0
- package/dist/react/{OverviewSection-ae5AO2RG.js → OverviewSection-CkBGFEWq.js} +1 -1
- package/dist/react/{QueriesSection-DFFr9Tbb.js → QueriesSection-CfCpnNUD.js} +1 -1
- package/dist/react/{QueriesTab-GrHRAREt.js → QueriesTab-DbBmAqzO.js} +1 -1
- package/dist/react/{RequestsSection-DtwnJOnM.js → RequestsSection-Cb5a6MlT.js} +1 -1
- package/dist/react/{RoutesSection-F7nANhF0.js → RoutesSection-CRqF-cNM.js} +1 -1
- package/dist/react/{RoutesTab-rugjhCPH.js → RoutesTab-Bwreij3e.js} +1 -1
- package/dist/react/{TimelineSection-F5ThmTdy.js → TimelineSection-B2y06kRE.js} +1 -1
- package/dist/react/{TimelineTab-Dvpf-I5C.js → TimelineTab-6hthfdBB.js} +1 -1
- package/dist/react/{index-DDzo1bZk.js → index-CecA4IdQ.js} +394 -393
- package/dist/react/index.js +1 -1
- package/dist/react/react/components/shared/JsonViewer.d.ts +2 -1
- package/dist/react/style.css +1 -1
- package/dist/src/edge/client/dashboard.js +2 -2
- package/dist/src/edge/client/debug-panel-deferred.js +1 -1
- package/dist/src/edge/client-vue/dashboard.js +4 -4
- package/dist/src/edge/client-vue/debug-panel-deferred.js +3 -3
- package/dist/src/styles/components.css +81 -0
- package/dist/vue/{CacheSection-DDvJ7bs2.js → CacheSection-Cx-hj09X.js} +2 -2
- package/dist/vue/{ConfigSection-GTCrvsPr.js → ConfigSection-CMXyryf6.js} +1 -1
- package/dist/vue/{EmailsSection-Ct5vsLCc.js → EmailsSection-DgKl9xGT.js} +1 -1
- package/dist/vue/{EventsSection-CRVhtagq.js → EventsSection-BNMCAim1.js} +2 -2
- package/dist/vue/{EventsTab-DQ4Nd6AK.js → EventsTab-BBM7olXF.js} +1 -1
- package/dist/vue/{JobsSection-B_wH2Co7.js → JobsSection-CCMgMlxd.js} +2 -2
- package/dist/vue/{JobsTab-BCvhOARO.js → JobsTab-WFnxPdN7.js} +1 -1
- 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
- package/dist/vue/LogsSection-CvOnTxUu.js +252 -0
- package/dist/vue/LogsTab-Bg3o0Mm6.js +147 -0
- package/dist/vue/{OverviewSection-BqSwuMKH.js → OverviewSection-CHgaKtUR.js} +1 -1
- package/dist/vue/{QueriesSection-D4Fs0YH6.js → QueriesSection-BnHRD98z.js} +1 -1
- package/dist/vue/{RequestsSection-B0A5SKcM.js → RequestsSection-B-uSlM0f.js} +1 -1
- package/dist/vue/{RoutesSection-Ys5dTzvF.js → RoutesSection-BrceOcKQ.js} +1 -1
- package/dist/vue/{TimelineSection-D38iHB08.js → TimelineSection-CfvnA2Oo.js} +1 -1
- package/dist/vue/components/shared/JsonViewer.vue.d.ts +3 -0
- package/dist/vue/{index-Bj6pm5g3.js → index-oLxS08vN.js} +2 -2
- package/dist/vue/index.js +1 -1
- package/dist/vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/react/LogsSection-hAsLaKOC.js +0 -212
- package/dist/react/LogsTab-QouH4NPQ.js +0 -88
- package/dist/vue/LogsSection-C4NRFOpA.js +0 -227
- package/dist/vue/LogsTab-DpEQ7euu.js +0 -122
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { jsx as s, jsxs as a } from "react/jsx-runtime";
|
|
2
|
-
import { useState as m, useMemo as x, useCallback as k } from "react";
|
|
3
|
-
import { filterLogsByLevel as w, resolveLogRequestId as v, resolveLogMessage as f, LOG_LEVELS as F, resolveLogLevel as I, resolveLogTimestamp as E, getLogLevelCssClass as A, timeAgo as D, formatTime as R } from "adonisjs-server-stats/core";
|
|
4
|
-
import { u as S } from "./index-DDzo1bZk.js";
|
|
5
|
-
function B({ options: L }) {
|
|
6
|
-
const { data: l, isLoading: y, error: u } = S("logs", L), [d, N] = m("all"), [n, C] = m(""), [o, b] = m(""), g = x(() => {
|
|
7
|
-
let e = Array.isArray(l) ? l : l?.logs || l?.entries || [];
|
|
8
|
-
if (e = w(e, d), o) {
|
|
9
|
-
const t = o.toLowerCase();
|
|
10
|
-
e = e.filter((r) => v(r).toLowerCase().includes(t));
|
|
11
|
-
}
|
|
12
|
-
if (n) {
|
|
13
|
-
const t = n.toLowerCase();
|
|
14
|
-
e = e.filter((r) => f(r).toLowerCase().includes(t));
|
|
15
|
-
}
|
|
16
|
-
return e;
|
|
17
|
-
}, [l, d, n, o]), h = k((e) => {
|
|
18
|
-
b((t) => t === e ? "" : e);
|
|
19
|
-
}, []);
|
|
20
|
-
return y && !l ? /* @__PURE__ */ s("div", { className: "ss-dbg-empty", children: "Loading logs..." }) : u ? /* @__PURE__ */ a("div", { className: "ss-dbg-empty", children: [
|
|
21
|
-
"Error: ",
|
|
22
|
-
u.message
|
|
23
|
-
] }) : /* @__PURE__ */ a("div", { children: [
|
|
24
|
-
/* @__PURE__ */ a("div", { className: "ss-dbg-log-filters", children: [
|
|
25
|
-
F.map((e) => /* @__PURE__ */ s(
|
|
26
|
-
"button",
|
|
27
|
-
{
|
|
28
|
-
type: "button",
|
|
29
|
-
className: `ss-dbg-log-filter ${d === e ? "ss-dbg-active" : ""}`,
|
|
30
|
-
onClick: () => N(e),
|
|
31
|
-
children: e
|
|
32
|
-
},
|
|
33
|
-
e
|
|
34
|
-
)),
|
|
35
|
-
o && /* @__PURE__ */ a(
|
|
36
|
-
"button",
|
|
37
|
-
{
|
|
38
|
-
type: "button",
|
|
39
|
-
className: "ss-dbg-log-filter ss-dbg-active",
|
|
40
|
-
onClick: () => b(""),
|
|
41
|
-
children: [
|
|
42
|
-
"req: ",
|
|
43
|
-
o.slice(0, 8),
|
|
44
|
-
" x"
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
),
|
|
48
|
-
/* @__PURE__ */ a("span", { className: "ss-dbg-summary", style: { marginLeft: "auto" }, children: [
|
|
49
|
-
g.length,
|
|
50
|
-
" entries"
|
|
51
|
-
] })
|
|
52
|
-
] }),
|
|
53
|
-
/* @__PURE__ */ s("div", { className: "ss-dbg-search-bar", children: /* @__PURE__ */ s(
|
|
54
|
-
"input",
|
|
55
|
-
{
|
|
56
|
-
type: "text",
|
|
57
|
-
className: "ss-dbg-search",
|
|
58
|
-
placeholder: "Filter log messages...",
|
|
59
|
-
value: n,
|
|
60
|
-
onChange: (e) => C(e.target.value)
|
|
61
|
-
}
|
|
62
|
-
) }),
|
|
63
|
-
/* @__PURE__ */ s("div", { style: { overflow: "auto", flex: 1 }, children: g.length === 0 ? /* @__PURE__ */ s("div", { className: "ss-dbg-empty", children: "No log entries" }) : g.slice(-200).reverse().map((e, t) => {
|
|
64
|
-
const r = I(e), p = f(e), c = E(e), i = v(e);
|
|
65
|
-
return /* @__PURE__ */ a("div", { className: "ss-dbg-log-entry", children: [
|
|
66
|
-
/* @__PURE__ */ s("span", { className: `ss-dbg-log-level ${A(r)}`, children: r.toUpperCase() }),
|
|
67
|
-
/* @__PURE__ */ s("span", { className: "ss-dbg-log-time", title: c ? R(c) : "", children: c ? D(c) : "-" }),
|
|
68
|
-
i ? /* @__PURE__ */ s(
|
|
69
|
-
"span",
|
|
70
|
-
{
|
|
71
|
-
className: "ss-dbg-log-reqid",
|
|
72
|
-
onClick: () => h(i),
|
|
73
|
-
role: "button",
|
|
74
|
-
tabIndex: 0,
|
|
75
|
-
title: i,
|
|
76
|
-
onKeyDown: (q) => q.key === "Enter" && h(i),
|
|
77
|
-
children: i.slice(0, 8)
|
|
78
|
-
}
|
|
79
|
-
) : /* @__PURE__ */ s("span", { className: "ss-dbg-log-reqid-empty", children: "-" }),
|
|
80
|
-
/* @__PURE__ */ s("span", { className: "ss-dbg-log-msg", children: p })
|
|
81
|
-
] }, t);
|
|
82
|
-
}) })
|
|
83
|
-
] });
|
|
84
|
-
}
|
|
85
|
-
export {
|
|
86
|
-
B as LogsTab,
|
|
87
|
-
B as default
|
|
88
|
-
};
|
|
@@ -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-Bj6pm5g3.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
|
-
};
|