@nivaro/react 0.3.95 → 0.3.96
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/shared/components/chat/ChatMessageToast.js +248 -0
- package/dist/shared/components/chat/chat-core.js +415 -381
- package/dist/shared/components/ops-report/SettingsPanel.js +44 -41
- package/dist/shared/components/ops-report/drill.js +263 -177
- package/dist/shared/components/panels/PipelinePanel.js +391 -425
- package/package.json +1 -1
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import { jsxs as d, jsx as e, Fragment as y } from "react/jsx-runtime";
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import { ArrowLeft as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useNavigation as
|
|
6
|
-
import { get as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { QueryErrorState as
|
|
9
|
-
import { Sheet as
|
|
10
|
-
import { Skeleton as
|
|
11
|
-
import { Chip as
|
|
12
|
-
import { num as S, ms as
|
|
13
|
-
const
|
|
14
|
-
() => import("../RecordDrilldownSheet.js").then((
|
|
15
|
-
),
|
|
16
|
-
function
|
|
17
|
-
return
|
|
2
|
+
import { useQuery as Q } from "@tanstack/react-query";
|
|
3
|
+
import { ArrowLeft as z, ChevronRight as B, ExternalLink as j } from "lucide-react";
|
|
4
|
+
import { useState as A, useCallback as U, useMemo as X, Suspense as V, createContext as W, useEffect as Y, lazy as Z, useContext as ee } from "react";
|
|
5
|
+
import { useNavigation as te, useNivaroClient as re } from "../../context.js";
|
|
6
|
+
import { get as ne } from "../../lib/commands.js";
|
|
7
|
+
import { cn as k } from "../../lib/utils.js";
|
|
8
|
+
import { QueryErrorState as ae } from "../QueryErrorState.js";
|
|
9
|
+
import { Sheet as le, SheetContent as ie, SheetTitle as oe, SheetDescription as de } from "../ui/sheet.js";
|
|
10
|
+
import { Skeleton as q } from "../ui/skeleton.js";
|
|
11
|
+
import { Chip as se } from "./chip.js";
|
|
12
|
+
import { num as S, ms as H } from "./format.js";
|
|
13
|
+
const ce = Z(
|
|
14
|
+
() => import("../RecordDrilldownSheet.js").then((a) => ({ default: a.RecordDrilldownSheet }))
|
|
15
|
+
), M = W(null);
|
|
16
|
+
function me() {
|
|
17
|
+
return ee(M);
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
target:
|
|
21
|
-
children:
|
|
22
|
-
className:
|
|
23
|
-
tip:
|
|
19
|
+
function Pe({
|
|
20
|
+
target: a,
|
|
21
|
+
children: r,
|
|
22
|
+
className: l,
|
|
23
|
+
tip: c
|
|
24
24
|
}) {
|
|
25
|
-
const
|
|
26
|
-
return !
|
|
25
|
+
const n = me();
|
|
26
|
+
return !n || !a ? /* @__PURE__ */ e(y, { children: r }) : /* @__PURE__ */ e(
|
|
27
27
|
"button",
|
|
28
28
|
{
|
|
29
29
|
type: "button",
|
|
30
|
-
"data-ops-drill":
|
|
31
|
-
"data-tip":
|
|
32
|
-
onClick: () =>
|
|
33
|
-
className:
|
|
30
|
+
"data-ops-drill": a.metric,
|
|
31
|
+
"data-tip": c ?? "Show the rows behind this",
|
|
32
|
+
onClick: () => n.open(a),
|
|
33
|
+
className: k(
|
|
34
34
|
"cursor-pointer text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50",
|
|
35
|
-
|
|
35
|
+
l
|
|
36
36
|
),
|
|
37
|
-
children:
|
|
37
|
+
children: r
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const ue = [
|
|
42
42
|
[
|
|
43
43
|
/^(failed|error|bad|breached|open|refused|rejected|critical|high)/i,
|
|
44
44
|
"border-red-200 bg-red-50 text-red-800 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300"
|
|
@@ -51,278 +51,364 @@ const ae = [
|
|
|
51
51
|
/^(ok|done|sent|accepted|ready|success|healthy|closed|fixed)/i,
|
|
52
52
|
"border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-300"
|
|
53
53
|
]
|
|
54
|
-
];
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
], T = /* @__PURE__ */ new Set(["number", "ms", "usd"]), pe = /^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+(\S.*)$/, xe = 90;
|
|
55
|
+
function be(a) {
|
|
56
|
+
return a >= 500 ? "border-red-200 bg-red-50 text-red-800 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300" : a >= 400 ? "border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-300" : "border-slate-200 bg-slate-50 text-slate-600 dark:border-border dark:bg-muted dark:text-muted-foreground";
|
|
57
|
+
}
|
|
58
|
+
function he({ col: a, value: r }) {
|
|
59
|
+
var c;
|
|
60
|
+
if (r == null || r === "" || r === "–" || r === "-")
|
|
61
|
+
return /* @__PURE__ */ e("span", { className: "text-slate-300 dark:text-muted-foreground/50", children: "–" });
|
|
62
|
+
const l = typeof r == "number" ? r : Number(r);
|
|
63
|
+
switch (a.type) {
|
|
60
64
|
case "number":
|
|
61
|
-
return /* @__PURE__ */ e(y, { children: Number.isFinite(
|
|
65
|
+
return /* @__PURE__ */ e(y, { children: Number.isFinite(l) ? S(l, Number.isInteger(l) ? 0 : 1) : String(r) });
|
|
62
66
|
case "ms":
|
|
63
|
-
return /* @__PURE__ */ e(
|
|
67
|
+
return Number.isFinite(l) ? /* @__PURE__ */ e("span", { className: k(l >= 5e3 && "font-medium text-amber-700 dark:text-amber-400"), children: H(l) }) : /* @__PURE__ */ e(y, { children: String(r) });
|
|
64
68
|
case "usd":
|
|
65
|
-
return /* @__PURE__ */ e(y, { children: Number.isFinite(
|
|
69
|
+
return /* @__PURE__ */ e(y, { children: Number.isFinite(l) ? `$${l.toLocaleString("en-US", { maximumFractionDigits: l < 10 ? 2 : 0 })}` : String(r) });
|
|
66
70
|
case "status": {
|
|
67
|
-
const
|
|
71
|
+
const n = String(r), s = /^\d{3}$/.test(n) ? be(Number(n)) : (c = ue.find(([h]) => h.test(n))) == null ? void 0 : c[1];
|
|
68
72
|
return /* @__PURE__ */ e(
|
|
69
|
-
|
|
73
|
+
se,
|
|
70
74
|
{
|
|
71
|
-
className:
|
|
72
|
-
|
|
75
|
+
className: k(
|
|
76
|
+
"tabular-nums",
|
|
77
|
+
s ?? "border-slate-200 bg-slate-50 text-slate-700 dark:border-border dark:bg-muted dark:text-muted-foreground"
|
|
78
|
+
),
|
|
79
|
+
children: n
|
|
73
80
|
}
|
|
74
81
|
);
|
|
75
82
|
}
|
|
76
|
-
|
|
77
|
-
return /* @__PURE__ */ e(y, { children: String(
|
|
83
|
+
case "time":
|
|
84
|
+
return /* @__PURE__ */ e(y, { children: String(r) });
|
|
85
|
+
default: {
|
|
86
|
+
const n = String(r), s = n.match(pe);
|
|
87
|
+
return s ? /* @__PURE__ */ d("span", { className: "inline-flex min-w-0 items-baseline gap-1.5", children: [
|
|
88
|
+
/* @__PURE__ */ e("span", { className: "w-[42px] shrink-0 font-mono text-[10px] font-semibold tracking-wide text-slate-500 dark:text-muted-foreground", children: s[1] }),
|
|
89
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 break-all font-mono text-[11.5px] text-slate-800 dark:text-foreground", children: s[2] })
|
|
90
|
+
] }) : n.length > xe ? /* @__PURE__ */ e("span", { className: "line-clamp-2", "data-tip": n, children: n }) : /* @__PURE__ */ e(y, { children: n });
|
|
91
|
+
}
|
|
78
92
|
}
|
|
79
93
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
94
|
+
function ge(a, r, l, c) {
|
|
95
|
+
const n = a._drill_metric, s = a._drill_key, h = r[0] ? a[r[0].key] : null, b = h == null ? void 0 : String(h), g = a._record_collection, o = a._record_id;
|
|
96
|
+
if (typeof g == "string" && g !== "" && o != null && o !== "")
|
|
97
|
+
return () => c(g, String(o), b);
|
|
98
|
+
if (n) return () => l({ metric: n, key: s == null ? null : String(s), label: b });
|
|
99
|
+
}
|
|
100
|
+
function fe({ stats: a }) {
|
|
101
|
+
const r = a.length === 6 ? "grid-cols-3 sm:grid-cols-6" : a.length === 4 ? "grid-cols-2 sm:grid-cols-4" : a.length <= 3 ? "grid-cols-3" : "grid-cols-2 sm:grid-cols-3";
|
|
102
|
+
return /* @__PURE__ */ e(
|
|
103
|
+
"dl",
|
|
104
|
+
{
|
|
105
|
+
"data-ops-drill-stats": "",
|
|
106
|
+
className: k(
|
|
107
|
+
"grid gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border",
|
|
108
|
+
r
|
|
109
|
+
),
|
|
110
|
+
children: a.map((l) => {
|
|
111
|
+
const c = typeof l.value == "number" ? l.value : Number(l.value), n = l.value != null && l.value !== "" && Number.isFinite(c), s = n ? l.format === "ms" ? H(c) : S(c, Number.isInteger(c) ? 0 : 1) : l.value ?? "–";
|
|
112
|
+
return /* @__PURE__ */ d("div", { className: "bg-white px-3 py-2.5 dark:bg-card", children: [
|
|
113
|
+
/* @__PURE__ */ e("dt", { className: "truncate text-[11px] text-slate-500 dark:text-muted-foreground", children: l.label }),
|
|
114
|
+
/* @__PURE__ */ e(
|
|
115
|
+
"dd",
|
|
116
|
+
{
|
|
117
|
+
className: k(
|
|
118
|
+
"mt-0.5 text-[17px] font-semibold leading-tight tabular-nums",
|
|
119
|
+
l.tone && n && c === 0 ? "text-slate-400 dark:text-muted-foreground" : l.tone === "bad" && n ? "text-red-600 dark:text-red-400" : l.tone === "warn" && n ? "text-amber-600 dark:text-amber-400" : "text-slate-900 dark:text-foreground"
|
|
120
|
+
),
|
|
121
|
+
children: s
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] }, l.label);
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
function ke(a, r) {
|
|
130
|
+
if (r !== "json") return a;
|
|
82
131
|
try {
|
|
83
|
-
return JSON.stringify(JSON.parse(
|
|
132
|
+
return JSON.stringify(JSON.parse(a), null, 2);
|
|
84
133
|
} catch {
|
|
85
|
-
return
|
|
134
|
+
return a;
|
|
86
135
|
}
|
|
87
136
|
}
|
|
88
|
-
function
|
|
89
|
-
reportId:
|
|
90
|
-
target:
|
|
91
|
-
onTitle:
|
|
92
|
-
onDrill:
|
|
93
|
-
onLink:
|
|
94
|
-
onRecord:
|
|
137
|
+
function Ne({
|
|
138
|
+
reportId: a,
|
|
139
|
+
target: r,
|
|
140
|
+
onTitle: l,
|
|
141
|
+
onDrill: c,
|
|
142
|
+
onLink: n,
|
|
143
|
+
onRecord: s
|
|
95
144
|
}) {
|
|
96
|
-
var
|
|
97
|
-
const
|
|
98
|
-
queryKey: ["ops-drill",
|
|
99
|
-
queryFn: () =>
|
|
100
|
-
|
|
101
|
-
metric:
|
|
102
|
-
...
|
|
145
|
+
var L, P, R;
|
|
146
|
+
const h = re(), b = Q({
|
|
147
|
+
queryKey: ["ops-drill", a, r.metric, r.key ?? null],
|
|
148
|
+
queryFn: () => h.request(
|
|
149
|
+
ne(`/ops-reports/${a}/drill`, {
|
|
150
|
+
metric: r.metric,
|
|
151
|
+
...r.key ? { key: r.key } : {},
|
|
103
152
|
limit: 200
|
|
104
153
|
})
|
|
105
154
|
).then((t) => t.data),
|
|
106
155
|
staleTime: 6e4
|
|
107
|
-
}),
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
}, [
|
|
156
|
+
}), g = (L = b.data) == null ? void 0 : L.title;
|
|
157
|
+
if (Y(() => {
|
|
158
|
+
g && l(g);
|
|
159
|
+
}, [g]), b.isLoading)
|
|
111
160
|
return /* @__PURE__ */ d("div", { className: "space-y-2 p-5", "aria-busy": "true", children: [
|
|
112
|
-
/* @__PURE__ */ e(
|
|
113
|
-
/* @__PURE__ */ e(
|
|
161
|
+
/* @__PURE__ */ e(q, { className: "h-4 w-2/3" }),
|
|
162
|
+
/* @__PURE__ */ e(q, { className: "h-32 w-full" })
|
|
114
163
|
] });
|
|
115
164
|
if (b.error || !b.data)
|
|
116
|
-
return /* @__PURE__ */ e("div", { className: "p-5", children: /* @__PURE__ */ e(
|
|
117
|
-
const o = b.data,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
165
|
+
return /* @__PURE__ */ e("div", { className: "p-5", children: /* @__PURE__ */ e(ae, { error: b.error, what: "these rows", onRetry: () => void b.refetch() }) });
|
|
166
|
+
const o = b.data, x = o.columns ?? [], f = o.rows ?? [], i = f.map((t) => ge(t, x, c, s)), u = f.some((t) => typeof t._link == "string" && t._link) || i.some(Boolean), w = ((P = o.detail) == null ? void 0 : P.fields) ?? [], _ = w.filter((t) => t.kind === "meta" && t.value != null && t.value !== ""), G = _.filter((t) => !t.link), D = _.filter((t) => t.link), C = w.filter((t) => t.kind === "stat"), $ = w.filter((t) => !t.kind), E = o.truncated ? `Showing the first ${S(f.length)} of ${S(o.total)}` : `${S(o.total || f.length)} ${(o.total || f.length) === 1 ? "row" : "rows"}`, O = (t) => /* @__PURE__ */ d(
|
|
167
|
+
"button",
|
|
168
|
+
{
|
|
169
|
+
type: "button",
|
|
170
|
+
onClick: () => n(t.link),
|
|
171
|
+
className: "inline-flex items-center gap-1 rounded font-medium text-sky-700 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:text-nvr-cyan",
|
|
172
|
+
children: [
|
|
173
|
+
t.value ?? "Open",
|
|
174
|
+
/* @__PURE__ */ e(j, { className: "h-3 w-3", "aria-hidden": !0 })
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
return /* @__PURE__ */ d("div", { className: "space-y-5 p-5", "data-ops-drill-level": o.metric, children: [
|
|
179
|
+
_.length > 0 && /* @__PURE__ */ d(
|
|
180
|
+
"div",
|
|
181
|
+
{
|
|
182
|
+
"data-ops-drill-meta": "",
|
|
183
|
+
className: "-mt-1 flex flex-wrap items-center justify-between gap-x-4 gap-y-1.5 text-[12.5px]",
|
|
184
|
+
children: [
|
|
185
|
+
/* @__PURE__ */ e("p", { className: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-slate-600 dark:text-muted-foreground", children: G.map((t, v) => /* @__PURE__ */ d("span", { className: "inline-flex items-center gap-2", children: [
|
|
186
|
+
v > 0 && /* @__PURE__ */ e("span", { "aria-hidden": !0, className: "text-slate-300 dark:text-muted-foreground/40", children: "·" }),
|
|
187
|
+
/* @__PURE__ */ e("span", { className: k(v === 0 && "text-slate-800 dark:text-foreground"), children: t.value })
|
|
188
|
+
] }, t.label)) }),
|
|
189
|
+
D.length > 0 && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center gap-3", children: D.map((t) => /* @__PURE__ */ e("span", { children: O(t) }, t.label)) })
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
o.description && /* @__PURE__ */ e(de, { className: "max-w-[70ch] text-[12.5px] leading-relaxed text-slate-600 dark:text-muted-foreground", children: o.description }),
|
|
194
|
+
C.length > 0 && /* @__PURE__ */ e(fe, { stats: C }),
|
|
195
|
+
$.length > 0 && /* @__PURE__ */ e(
|
|
196
|
+
"dl",
|
|
197
|
+
{
|
|
198
|
+
className: k(
|
|
199
|
+
"grid grid-cols-[minmax(96px,max-content)_1fr] gap-x-6 gap-y-1.5 text-[12.5px]",
|
|
200
|
+
C.length === 0 && "rounded-lg border border-slate-200 px-3.5 py-3 dark:border-border"
|
|
201
|
+
),
|
|
202
|
+
children: $.map((t) => /* @__PURE__ */ d("div", { className: "contents", children: [
|
|
203
|
+
/* @__PURE__ */ e("dt", { className: "text-slate-500 dark:text-muted-foreground", children: t.label }),
|
|
204
|
+
/* @__PURE__ */ e("dd", { className: "min-w-0 break-words text-slate-900 dark:text-foreground", children: t.link ? O(t) : t.value ?? "–" })
|
|
205
|
+
] }, t.label))
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
(((R = o.detail) == null ? void 0 : R.blocks) ?? []).map((t) => /* @__PURE__ */ d("div", { children: [
|
|
136
209
|
/* @__PURE__ */ e("h4", { className: "mb-1 text-[10.5px] font-semibold uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: t.title }),
|
|
137
210
|
t.kind === "text" ? /* @__PURE__ */ e("p", { className: "whitespace-pre-wrap text-[12px] text-slate-800 dark:text-foreground", children: t.text }) : /* @__PURE__ */ e(
|
|
138
211
|
"pre",
|
|
139
212
|
{
|
|
140
213
|
"data-ops-block": t.kind ?? "code",
|
|
141
214
|
className: "max-h-72 overflow-auto rounded-md bg-[#0f172a] p-3 font-mono text-[11.5px] leading-relaxed text-slate-100",
|
|
142
|
-
children:
|
|
215
|
+
children: ke(t.text, t.kind)
|
|
143
216
|
}
|
|
144
217
|
)
|
|
145
218
|
] }, t.title)),
|
|
146
|
-
|
|
147
|
-
/* @__PURE__ */
|
|
219
|
+
f.length > 0 && /* @__PURE__ */ d("section", { "aria-label": o.rows_title ?? void 0, children: [
|
|
220
|
+
o.rows_title && /* @__PURE__ */ d("div", { className: "mb-2 flex flex-wrap items-baseline justify-between gap-x-3", children: [
|
|
221
|
+
/* @__PURE__ */ e("h3", { className: "text-[13px] font-semibold text-slate-900 dark:text-foreground", children: o.rows_title }),
|
|
222
|
+
/* @__PURE__ */ e(
|
|
223
|
+
"span",
|
|
224
|
+
{
|
|
225
|
+
className: "text-[11.5px] tabular-nums text-slate-500 dark:text-muted-foreground",
|
|
226
|
+
"data-ops-drill-total": "",
|
|
227
|
+
children: E
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
] }),
|
|
231
|
+
/* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-lg border border-slate-200 dark:border-border", children: /* @__PURE__ */ d("table", { className: "w-full text-[12.5px]", children: [
|
|
148
232
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ d("tr", { className: "border-b border-slate-200 bg-slate-50 text-left text-[10.5px] uppercase tracking-wide text-slate-500 dark:border-border dark:bg-muted/40 dark:text-muted-foreground", children: [
|
|
149
|
-
|
|
233
|
+
x.map((t) => /* @__PURE__ */ e(
|
|
150
234
|
"th",
|
|
151
235
|
{
|
|
152
|
-
className:
|
|
153
|
-
"px-
|
|
154
|
-
(t.type
|
|
236
|
+
className: k(
|
|
237
|
+
"whitespace-nowrap px-3 py-2 font-medium",
|
|
238
|
+
T.has(t.type ?? "") && "text-right"
|
|
155
239
|
),
|
|
156
240
|
children: t.label
|
|
157
241
|
},
|
|
158
242
|
t.key
|
|
159
243
|
)),
|
|
160
|
-
|
|
244
|
+
u && /* @__PURE__ */ e("th", { className: "w-8", children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Open" }) })
|
|
161
245
|
] }) }),
|
|
162
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
163
|
-
const
|
|
164
|
-
metric: C,
|
|
165
|
-
key: D == null ? null : String(D),
|
|
166
|
-
label: v == null ? void 0 : String(v)
|
|
167
|
-
}) : void 0;
|
|
246
|
+
/* @__PURE__ */ e("tbody", { children: f.map((t, v) => {
|
|
247
|
+
const J = t._drill_metric, F = typeof t._link == "string" && t._link ? t._link : null, I = t._record_collection, K = typeof I == "string" && I !== "", N = i[v];
|
|
168
248
|
return /* @__PURE__ */ d(
|
|
169
249
|
"tr",
|
|
170
250
|
{
|
|
171
|
-
"data-ops-drill-row":
|
|
172
|
-
tabIndex:
|
|
173
|
-
onClick:
|
|
174
|
-
onKeyDown:
|
|
175
|
-
(
|
|
251
|
+
"data-ops-drill-row": K ? "record" : J ?? void 0,
|
|
252
|
+
tabIndex: N ? 0 : void 0,
|
|
253
|
+
onClick: N,
|
|
254
|
+
onKeyDown: N ? (p) => {
|
|
255
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), N());
|
|
176
256
|
} : void 0,
|
|
177
|
-
className:
|
|
178
|
-
"border-b border-slate-100 last:border-0 dark:border-border/60",
|
|
179
|
-
|
|
257
|
+
className: k(
|
|
258
|
+
"group border-b border-slate-100 last:border-0 dark:border-border/60",
|
|
259
|
+
N && "cursor-pointer hover:bg-slate-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan/50 dark:hover:bg-muted/60"
|
|
180
260
|
),
|
|
181
261
|
children: [
|
|
182
|
-
|
|
262
|
+
x.map((p) => /* @__PURE__ */ e(
|
|
183
263
|
"td",
|
|
184
264
|
{
|
|
185
|
-
className:
|
|
186
|
-
"px-
|
|
187
|
-
(
|
|
265
|
+
className: k(
|
|
266
|
+
"px-3 py-2 align-top text-slate-700 dark:text-foreground",
|
|
267
|
+
T.has(p.type ?? "") && "text-right tabular-nums",
|
|
268
|
+
(T.has(p.type ?? "") || p.type === "time" || p.type === "status") && "whitespace-nowrap",
|
|
269
|
+
p.type === "time" && "tabular-nums text-slate-500 dark:text-muted-foreground",
|
|
270
|
+
p.key === "message" && "min-w-[200px] text-slate-600 dark:text-muted-foreground"
|
|
188
271
|
),
|
|
189
|
-
children: /* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */ e(oe, { col: u, value: t[u.key] }),
|
|
191
|
-
k && P === 0 && /* @__PURE__ */ e(j, { className: "h-3 w-3 text-slate-400", "aria-hidden": !0 })
|
|
192
|
-
] })
|
|
272
|
+
children: /* @__PURE__ */ e(he, { col: p, value: t[p.key] })
|
|
193
273
|
},
|
|
194
|
-
|
|
274
|
+
p.key
|
|
195
275
|
)),
|
|
196
|
-
|
|
276
|
+
u && /* @__PURE__ */ e("td", { className: "w-8 px-1 py-1.5 text-right align-top", children: F ? /* @__PURE__ */ e(
|
|
197
277
|
"button",
|
|
198
278
|
{
|
|
199
279
|
type: "button",
|
|
200
280
|
"aria-label": "Open in the app",
|
|
201
281
|
"data-tip": "Open in the app",
|
|
202
|
-
onClick: (
|
|
203
|
-
|
|
282
|
+
onClick: (p) => {
|
|
283
|
+
p.stopPropagation(), n(F);
|
|
204
284
|
},
|
|
205
|
-
className: "rounded p-1 text-slate-400 hover:bg-muted hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50",
|
|
206
|
-
children: /* @__PURE__ */ e(
|
|
285
|
+
className: "rounded p-1 text-slate-400 hover:bg-muted hover:text-slate-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 dark:hover:text-foreground",
|
|
286
|
+
children: /* @__PURE__ */ e(j, { className: "h-3.5 w-3.5" })
|
|
287
|
+
}
|
|
288
|
+
) : N ? /* @__PURE__ */ e(
|
|
289
|
+
B,
|
|
290
|
+
{
|
|
291
|
+
className: "ml-auto mr-1 mt-0.5 h-3.5 w-3.5 text-slate-300 transition-colors group-hover:text-slate-500 dark:text-muted-foreground/50 dark:group-hover:text-muted-foreground",
|
|
292
|
+
"aria-hidden": !0
|
|
207
293
|
}
|
|
208
|
-
) })
|
|
294
|
+
) : null })
|
|
209
295
|
]
|
|
210
296
|
},
|
|
211
|
-
|
|
297
|
+
v
|
|
212
298
|
);
|
|
213
299
|
}) })
|
|
214
300
|
] }) }),
|
|
215
|
-
/* @__PURE__ */ e(
|
|
301
|
+
!o.rows_title && /* @__PURE__ */ e(
|
|
216
302
|
"p",
|
|
217
303
|
{
|
|
218
304
|
className: "mt-1.5 text-[11px] text-slate-500 dark:text-muted-foreground",
|
|
219
305
|
"data-ops-drill-total": "",
|
|
220
|
-
children:
|
|
306
|
+
children: E
|
|
221
307
|
}
|
|
222
308
|
)
|
|
223
309
|
] }),
|
|
224
|
-
|
|
310
|
+
f.length === 0 && !o.detail && /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12.5px] text-slate-500 dark:text-muted-foreground", children: "Nothing behind this number." })
|
|
225
311
|
] });
|
|
226
312
|
}
|
|
227
|
-
function
|
|
228
|
-
reportId:
|
|
229
|
-
linkTo:
|
|
230
|
-
children:
|
|
313
|
+
function Re({
|
|
314
|
+
reportId: a,
|
|
315
|
+
linkTo: r,
|
|
316
|
+
children: l
|
|
231
317
|
}) {
|
|
232
|
-
const
|
|
233
|
-
(
|
|
234
|
-
let
|
|
235
|
-
const
|
|
236
|
-
|
|
318
|
+
const c = te(), [n, s] = A([]), [h, b] = A(null), g = U((i) => s([i]), []), o = X(() => ({ open: g }), [g]), x = n[n.length - 1], f = U(
|
|
319
|
+
(i) => {
|
|
320
|
+
let m = i;
|
|
321
|
+
const u = i.match(/^\/collections\/([^/?#]+)\/([^/?#]+)/);
|
|
322
|
+
u && c.itemUrl && (m = c.itemUrl({ collection: u[1], itemId: u[2] })), r && (m = r(i) ?? (u ? m : null)), m && window.open(m, "_blank", "noopener");
|
|
237
323
|
},
|
|
238
|
-
[
|
|
324
|
+
[c, r]
|
|
239
325
|
);
|
|
240
|
-
return /* @__PURE__ */ d(
|
|
241
|
-
|
|
242
|
-
/* @__PURE__ */ e(
|
|
243
|
-
|
|
326
|
+
return /* @__PURE__ */ d(M.Provider, { value: o, children: [
|
|
327
|
+
l,
|
|
328
|
+
/* @__PURE__ */ e(le, { open: n.length > 0, onOpenChange: (i) => !i && s([]), children: /* @__PURE__ */ d(
|
|
329
|
+
ie,
|
|
244
330
|
{
|
|
245
331
|
side: "right",
|
|
246
332
|
"data-ops-drill-panel": "",
|
|
247
333
|
"aria-describedby": void 0,
|
|
248
334
|
className: "flex w-[94vw] flex-col gap-0 p-0 sm:max-w-[760px]",
|
|
249
335
|
children: [
|
|
250
|
-
/* @__PURE__ */ d("div", { className: "shrink-0 border-b border-slate-200 px-5 pb-3 pt-
|
|
251
|
-
/* @__PURE__ */ d(
|
|
336
|
+
/* @__PURE__ */ d("div", { className: "shrink-0 border-b border-slate-200 px-5 pb-3.5 pt-4 pr-12 dark:border-border", children: [
|
|
337
|
+
n.length > 1 && /* @__PURE__ */ d(
|
|
252
338
|
"nav",
|
|
253
339
|
{
|
|
254
340
|
"aria-label": "Drill path",
|
|
255
|
-
className: "mb-1 flex min-h-[20px] flex-wrap items-center gap-1 text-[11.5px] text-slate-500 dark:text-muted-foreground",
|
|
341
|
+
className: "mb-1.5 flex min-h-[20px] flex-wrap items-center gap-1 text-[11.5px] text-slate-500 dark:text-muted-foreground",
|
|
256
342
|
children: [
|
|
257
|
-
|
|
343
|
+
/* @__PURE__ */ d(
|
|
258
344
|
"button",
|
|
259
345
|
{
|
|
260
346
|
type: "button",
|
|
261
347
|
"data-ops-drill-back": "",
|
|
262
|
-
onClick: () =>
|
|
348
|
+
onClick: () => s((i) => i.slice(0, -1)),
|
|
263
349
|
className: "mr-1 inline-flex items-center gap-1 rounded px-1 py-0.5 font-medium text-sky-700 hover:bg-muted dark:text-nvr-cyan",
|
|
264
350
|
children: [
|
|
265
|
-
/* @__PURE__ */ e(
|
|
351
|
+
/* @__PURE__ */ e(z, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
266
352
|
"Back"
|
|
267
353
|
]
|
|
268
354
|
}
|
|
269
355
|
),
|
|
270
|
-
|
|
356
|
+
n.map((i, m) => /* @__PURE__ */ d(
|
|
271
357
|
"span",
|
|
272
358
|
{
|
|
273
359
|
className: "inline-flex items-center gap-1",
|
|
274
360
|
children: [
|
|
275
|
-
|
|
276
|
-
|
|
361
|
+
m > 0 && /* @__PURE__ */ e(B, { className: "h-3 w-3", "aria-hidden": !0 }),
|
|
362
|
+
m < n.length - 1 ? /* @__PURE__ */ e(
|
|
277
363
|
"button",
|
|
278
364
|
{
|
|
279
365
|
type: "button",
|
|
280
|
-
onClick: () =>
|
|
366
|
+
onClick: () => s((u) => u.slice(0, m + 1)),
|
|
281
367
|
className: "max-w-[160px] truncate hover:text-slate-800 hover:underline dark:hover:text-foreground",
|
|
282
|
-
children:
|
|
368
|
+
children: i.title ?? i.label ?? i.metric
|
|
283
369
|
}
|
|
284
|
-
) : /* @__PURE__ */ e("span", { className: "max-w-[220px] truncate font-medium text-slate-700 dark:text-foreground", children:
|
|
370
|
+
) : /* @__PURE__ */ e("span", { className: "max-w-[220px] truncate font-medium text-slate-700 dark:text-foreground", children: i.title ?? i.label ?? i.metric })
|
|
285
371
|
]
|
|
286
372
|
},
|
|
287
|
-
`${
|
|
373
|
+
`${i.metric}:${i.key ?? ""}:${m}`
|
|
288
374
|
))
|
|
289
375
|
]
|
|
290
376
|
}
|
|
291
377
|
),
|
|
292
|
-
/* @__PURE__ */ e(
|
|
378
|
+
/* @__PURE__ */ e(oe, { className: "truncate text-[16px] font-semibold tracking-[-0.01em]", children: (x == null ? void 0 : x.title) ?? (x == null ? void 0 : x.label) ?? "Loading…" })
|
|
293
379
|
] }),
|
|
294
|
-
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto bg-white dark:bg-background", children:
|
|
295
|
-
|
|
380
|
+
/* @__PURE__ */ e("div", { className: "min-h-0 flex-1 overflow-y-auto bg-white dark:bg-background", children: x && /* @__PURE__ */ e(
|
|
381
|
+
Ne,
|
|
296
382
|
{
|
|
297
|
-
reportId:
|
|
298
|
-
target:
|
|
299
|
-
onTitle: (
|
|
300
|
-
(
|
|
301
|
-
(
|
|
383
|
+
reportId: a,
|
|
384
|
+
target: x,
|
|
385
|
+
onTitle: (i) => s(
|
|
386
|
+
(m) => m.map(
|
|
387
|
+
(u, w) => w === m.length - 1 && u.title !== i ? { ...u, title: i } : u
|
|
302
388
|
)
|
|
303
389
|
),
|
|
304
|
-
onDrill: (
|
|
305
|
-
onLink:
|
|
306
|
-
onRecord: (
|
|
390
|
+
onDrill: (i) => s((m) => [...m, i]),
|
|
391
|
+
onLink: f,
|
|
392
|
+
onRecord: (i, m, u) => b({ collection: i, itemId: m, title: u })
|
|
307
393
|
},
|
|
308
|
-
`${
|
|
394
|
+
`${x.metric}:${x.key ?? ""}:${n.length}`
|
|
309
395
|
) })
|
|
310
396
|
]
|
|
311
397
|
}
|
|
312
398
|
) }),
|
|
313
|
-
|
|
314
|
-
|
|
399
|
+
h && /* @__PURE__ */ e(V, { fallback: null, children: /* @__PURE__ */ e(
|
|
400
|
+
ce,
|
|
315
401
|
{
|
|
316
|
-
collection:
|
|
317
|
-
itemId:
|
|
318
|
-
title:
|
|
402
|
+
collection: h.collection,
|
|
403
|
+
itemId: h.itemId,
|
|
404
|
+
title: h.title,
|
|
319
405
|
onClose: () => b(null)
|
|
320
406
|
}
|
|
321
407
|
) })
|
|
322
408
|
] });
|
|
323
409
|
}
|
|
324
410
|
export {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
411
|
+
Re as DrillProvider,
|
|
412
|
+
Pe as Drillable,
|
|
413
|
+
me as useDrill
|
|
328
414
|
};
|