@gravitee/gamma-lib-observability 1.18.0 → 1.19.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/USAGE_GUIDE.md +78 -1
- package/dist/hooks/query-keys.d.ts +1 -0
- package/dist/hooks/query-keys.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1088 -878
- package/dist/routing/ObservabilityRoutes.d.ts +3 -1
- package/dist/routing/ObservabilityRoutes.d.ts.map +1 -1
- package/dist/routing/TracesRouteElement.d.ts +13 -6
- package/dist/routing/TracesRouteElement.d.ts.map +1 -1
- package/dist/routing/TracingScreen.d.ts +22 -0
- package/dist/routing/TracingScreen.d.ts.map +1 -0
- package/dist/routing/define-observability-features.d.ts.map +1 -1
- package/dist/routing/index.d.ts +2 -0
- package/dist/routing/index.d.ts.map +1 -1
- package/dist/routing/types.d.ts +12 -2
- package/dist/routing/types.d.ts.map +1 -1
- package/dist/styles/observability.css +1 -1
- package/dist/testing/graphene-core-icons-mock.d.ts +2 -0
- package/dist/testing/graphene-core-icons-mock.d.ts.map +1 -1
- package/dist/testing/graphene-filter-mocks.d.ts +1 -1
- package/dist/testing/graphene-filter-mocks.d.ts.map +1 -1
- package/dist/traces/TraceExplorerPage.d.ts +7 -1
- package/dist/traces/TraceExplorerPage.d.ts.map +1 -1
- package/dist/traces/TraceTable.d.ts +9 -1
- package/dist/traces/TraceTable.d.ts.map +1 -1
- package/dist/traces/TracingApiSelector.d.ts +19 -0
- package/dist/traces/TracingApiSelector.d.ts.map +1 -0
- package/dist/traces/detail/SpanDetailPanel.d.ts +11 -3
- package/dist/traces/detail/SpanDetailPanel.d.ts.map +1 -1
- package/dist/traces/detail/TraceDetailDrawer.d.ts +5 -1
- package/dist/traces/detail/TraceDetailDrawer.d.ts.map +1 -1
- package/dist/traces/detail/TraceDetailShell.d.ts.map +1 -1
- package/dist/traces/index.d.ts +4 -1
- package/dist/traces/index.d.ts.map +1 -1
- package/dist/traces/tracing-api.d.ts +23 -0
- package/dist/traces/tracing-api.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g, v as _, y as v } from "./filter-providers-context.js";
|
|
2
2
|
import { Component as y, Fragment as b, Suspense as x, createContext as S, createElement as ee, forwardRef as te, lazy as ne, memo as re, useCallback as C, useContext as w, useEffect as T, useId as ie, useMemo as E, useRef as D, useState as O } from "react";
|
|
3
3
|
import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
4
|
-
import { keepPreviousData as
|
|
5
|
-
import { Accordion as
|
|
4
|
+
import { keepPreviousData as M, useQueries as ae, useQuery as N } from "@tanstack/react-query";
|
|
5
|
+
import { Accordion as P, AccordionContent as F, AccordionItem as oe, AccordionTrigger as se, Badge as I, Button as L, Calendar as ce, Card as le, Combobox as ue, ComboboxChip as de, ComboboxChips as fe, ComboboxChipsInput as pe, ComboboxContent as me, ComboboxEmpty as he, ComboboxInput as ge, ComboboxItem as _e, ComboboxList as ve, ComboboxValue as ye, DataTable as be, DataTablePagination as xe, Empty as Se, EmptyDescription as Ce, EmptyHeader as we, EmptyMedia as Te, EmptyTitle as Ee, Field as De, FieldError as Oe, FieldLabel as ke, Input as Ae, Label as je, Popover as Me, PopoverAnchor as Ne, PopoverContent as Pe, PopoverTrigger as Fe, ScrollArea as Ie, Select as Le, SelectContent as Re, SelectItem as ze, SelectTrigger as Be, SelectValue as Ve, Separator as He, Sheet as Ue, SheetContent as We, SheetDescription as Ge, SheetTitle as Ke, Skeleton as R, Spinner as qe, Tabs as Je, TabsContent as Ye, TabsList as Xe, TabsTrigger as Ze, ToggleGroup as Qe, ToggleGroupItem as $e, Tooltip as z, TooltipContent as B, TooltipProvider as V, TooltipTrigger as H, cn as U, toast as W, useComboboxAnchor as et } from "@gravitee/graphene-core";
|
|
6
6
|
import { AlertCircleIcon as tt, ArrowLeftIcon as nt, ArrowRightIcon as rt, BrainCircuitIcon as it, CableIcon as at, CalendarIcon as ot, ChartLineIcon as st, ChevronDownIcon as ct, ChevronRightIcon as lt, CircleHelpIcon as ut, CopyIcon as dt, ExpandIcon as ft, FileTextIcon as pt, FilterIcon as mt, FunnelXIcon as ht, GlobeIcon as gt, MessageSquareIcon as _t, PanelLeftIcon as vt, PlusIcon as yt, RefreshCwIcon as bt, SearchIcon as xt, WaypointsIcon as St, WebhookIcon as Ct, XIcon as wt } from "@gravitee/graphene-core/icons";
|
|
7
7
|
import { DashboardGrid as Tt, DashboardWidget as Et } from "@gravitee/graphene-charts/dashboard-grid";
|
|
8
8
|
import { AreaSeries as Dt, BarChart as Ot, BarSeries as kt, CartesianChart as At, ChartContainer as jt, ChartLegend as Mt, ChartLegendContent as Nt, ChartTooltip as Pt, ChartTooltipContent as Ft, DoughnutChart as It, Grid as Lt, LineSeries as Rt, Metric as zt, MetricGroup as Bt, ReferenceLine as Vt, TraceWaterfall as Ht, XAxis as Ut, YAxis as Wt } from "@gravitee/graphene-charts";
|
|
9
|
-
import { Link as Gt, Navigate as Kt, Route as
|
|
9
|
+
import { Link as Gt, Navigate as Kt, Route as G, Routes as qt, useLocation as Jt, useNavigate as Yt, useParams as Xt, useSearchParams as Zt } from "react-router-dom";
|
|
10
10
|
//#region src/types/guards.ts
|
|
11
11
|
function Qt(e) {
|
|
12
12
|
return e.type === "cartesian";
|
|
@@ -26,7 +26,7 @@ function nn(e) {
|
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/types/widget-defaults.ts
|
|
28
28
|
var rn = "COUNT";
|
|
29
|
-
function
|
|
29
|
+
function K(e) {
|
|
30
30
|
return e ?? "COUNT";
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
@@ -84,7 +84,7 @@ function hn() {
|
|
|
84
84
|
}
|
|
85
85
|
//#endregion
|
|
86
86
|
//#region src/hooks/constants.ts
|
|
87
|
-
var
|
|
87
|
+
var q = 3e4;
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region src/hooks/query-keys.ts
|
|
90
90
|
function gn(e) {
|
|
@@ -97,7 +97,7 @@ function _n(e) {
|
|
|
97
97
|
function vn(e) {
|
|
98
98
|
return !e || e.length === 0 ? e : e.slice().sort((e, t) => e.field.localeCompare(t.field) || e.operator.localeCompare(t.operator));
|
|
99
99
|
}
|
|
100
|
-
var
|
|
100
|
+
var J = {
|
|
101
101
|
all: ["observability"],
|
|
102
102
|
timeSeries: (e, t, n, r, i, a, o) => [
|
|
103
103
|
"observability",
|
|
@@ -165,6 +165,7 @@ var K = {
|
|
|
165
165
|
traceId: t
|
|
166
166
|
}
|
|
167
167
|
],
|
|
168
|
+
tracingApis: () => ["observability", "tracingApis"],
|
|
168
169
|
dashboard: (e) => [
|
|
169
170
|
"observability",
|
|
170
171
|
"dashboard",
|
|
@@ -178,7 +179,7 @@ var K = {
|
|
|
178
179
|
};
|
|
179
180
|
//#endregion
|
|
180
181
|
//#region src/dashboards/merge-filters.ts
|
|
181
|
-
function
|
|
182
|
+
function Y(...e) {
|
|
182
183
|
let t = /* @__PURE__ */ new Map();
|
|
183
184
|
for (let n of e) if (n) for (let e of n) t.set(e.field, e);
|
|
184
185
|
return Array.from(t.values());
|
|
@@ -193,7 +194,7 @@ function bn({ filters: e, children: t }) {
|
|
|
193
194
|
children: t
|
|
194
195
|
});
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
+
function X() {
|
|
197
198
|
return w(yn);
|
|
198
199
|
}
|
|
199
200
|
//#endregion
|
|
@@ -202,14 +203,14 @@ function xn(e) {
|
|
|
202
203
|
if (!e.metric) return;
|
|
203
204
|
let t = {
|
|
204
205
|
name: e.metric,
|
|
205
|
-
measures: [
|
|
206
|
+
measures: [K(e.measure)]
|
|
206
207
|
};
|
|
207
208
|
return e.sorts?.length && (t.sorts = e.sorts), [t];
|
|
208
209
|
}
|
|
209
210
|
function Sn(e, t) {
|
|
210
|
-
let r = n(), i =
|
|
211
|
+
let r = n(), i = Y(X(), e.filters), a = xn(e);
|
|
211
212
|
return N({
|
|
212
|
-
queryKey:
|
|
213
|
+
queryKey: J.facets(e.by, e.timeRange, i, {
|
|
213
214
|
metrics: a,
|
|
214
215
|
ranges: e.ranges,
|
|
215
216
|
limit: e.limit,
|
|
@@ -225,7 +226,7 @@ function Sn(e, t) {
|
|
|
225
226
|
search: e.search,
|
|
226
227
|
signal: t
|
|
227
228
|
}),
|
|
228
|
-
staleTime:
|
|
229
|
+
staleTime: q,
|
|
229
230
|
enabled: e.enabled,
|
|
230
231
|
...t
|
|
231
232
|
});
|
|
@@ -234,9 +235,9 @@ function Sn(e, t) {
|
|
|
234
235
|
//#region src/hooks/use-log-detail-query.ts
|
|
235
236
|
function Cn(e) {
|
|
236
237
|
let t = r(), n = typeof t.getById == "function", i = N({
|
|
237
|
-
queryKey:
|
|
238
|
+
queryKey: J.logDetail(e.id ?? ""),
|
|
238
239
|
queryFn: ({ signal: n }) => t.getById(e.id, n),
|
|
239
|
-
staleTime:
|
|
240
|
+
staleTime: q,
|
|
240
241
|
enabled: n && !!e.id && e.enabled !== !1
|
|
241
242
|
});
|
|
242
243
|
return {
|
|
@@ -252,16 +253,16 @@ function Cn(e) {
|
|
|
252
253
|
//#endregion
|
|
253
254
|
//#region src/hooks/use-logs-query.ts
|
|
254
255
|
function wn(e, t) {
|
|
255
|
-
let n = r(), i =
|
|
256
|
+
let n = r(), i = Y(X(), e.filters);
|
|
256
257
|
return N({
|
|
257
|
-
queryKey:
|
|
258
|
+
queryKey: J.logs(e.timeRange, i, e.search),
|
|
258
259
|
queryFn: ({ signal: t }) => n.fetchLogs({
|
|
259
260
|
timeRange: e.timeRange,
|
|
260
261
|
filters: i,
|
|
261
262
|
search: e.search,
|
|
262
263
|
signal: t
|
|
263
264
|
}),
|
|
264
|
-
staleTime:
|
|
265
|
+
staleTime: q,
|
|
265
266
|
enabled: e.enabled,
|
|
266
267
|
...t
|
|
267
268
|
});
|
|
@@ -270,7 +271,7 @@ function wn(e, t) {
|
|
|
270
271
|
//#region src/hooks/use-logs-paged-query.ts
|
|
271
272
|
var Tn = 25, En = [];
|
|
272
273
|
function Dn(e) {
|
|
273
|
-
let { timeRange: t, filters: n, search: i, pageSize: a = Tn, enabled: o } = e, s = r(), c =
|
|
274
|
+
let { timeRange: t, filters: n, search: i, pageSize: a = Tn, enabled: o } = e, s = r(), c = Y(X(), n), [l, u] = O(1), [d, f] = O(a), p = J.logs(t, c, i), m = JSON.stringify(p), h = D(m);
|
|
274
275
|
T(() => {
|
|
275
276
|
h.current !== m && (h.current = m, u(1));
|
|
276
277
|
}, [m]);
|
|
@@ -287,7 +288,7 @@ function Dn(e) {
|
|
|
287
288
|
perPage: d,
|
|
288
289
|
signal: e
|
|
289
290
|
}),
|
|
290
|
-
staleTime:
|
|
291
|
+
staleTime: q,
|
|
291
292
|
placeholderData: (e) => e,
|
|
292
293
|
enabled: o
|
|
293
294
|
}), _ = g.data?.totalCount ?? 0, v = g.data?.pageCount ?? (_ > 0 ? Math.ceil(_ / d) : 0), y = v > 0 ? Math.min(l, v) : l;
|
|
@@ -311,17 +312,17 @@ function Dn(e) {
|
|
|
311
312
|
//#endregion
|
|
312
313
|
//#region src/hooks/use-measures-query.ts
|
|
313
314
|
function On(e, t) {
|
|
314
|
-
let r = n(), i =
|
|
315
|
+
let r = n(), i = Y(X(), e.filters);
|
|
315
316
|
return N({
|
|
316
|
-
queryKey:
|
|
317
|
+
queryKey: J.measures(e.metrics, e.timeRange, i),
|
|
317
318
|
queryFn: ({ signal: t }) => r.fetchMeasures({
|
|
318
319
|
metrics: e.metrics,
|
|
319
320
|
timeRange: e.timeRange,
|
|
320
321
|
filters: i,
|
|
321
322
|
signal: t
|
|
322
323
|
}),
|
|
323
|
-
staleTime:
|
|
324
|
-
placeholderData:
|
|
324
|
+
staleTime: q,
|
|
325
|
+
placeholderData: M,
|
|
325
326
|
enabled: e.enabled,
|
|
326
327
|
...t
|
|
327
328
|
});
|
|
@@ -333,7 +334,7 @@ function kn(e, t) {
|
|
|
333
334
|
filterName: e.field,
|
|
334
335
|
ids: e.value
|
|
335
336
|
})), [n]), i = E(() => JSON.stringify(r), [r]), { data: a } = N({
|
|
336
|
-
queryKey:
|
|
337
|
+
queryKey: J.filterLabels(i),
|
|
337
338
|
queryFn: ({ signal: e }) => t.resolveLabels(r, e),
|
|
338
339
|
enabled: !!t && r.length > 0,
|
|
339
340
|
staleTime: 300 * 1e3
|
|
@@ -356,9 +357,9 @@ function kn(e, t) {
|
|
|
356
357
|
//#endregion
|
|
357
358
|
//#region src/hooks/use-time-series-query.ts
|
|
358
359
|
function An(e, t) {
|
|
359
|
-
let r = n(), i =
|
|
360
|
+
let r = n(), i = Y(X(), e.filters);
|
|
360
361
|
return N({
|
|
361
|
-
queryKey:
|
|
362
|
+
queryKey: J.timeSeries(e.metrics, e.timeRange, e.interval, i, e.by, e.limit, e.ranges),
|
|
362
363
|
queryFn: ({ signal: t }) => r.fetchTimeSeries({
|
|
363
364
|
metrics: e.metrics,
|
|
364
365
|
timeRange: e.timeRange,
|
|
@@ -369,8 +370,8 @@ function An(e, t) {
|
|
|
369
370
|
limit: e.limit,
|
|
370
371
|
signal: t
|
|
371
372
|
}),
|
|
372
|
-
staleTime:
|
|
373
|
-
placeholderData:
|
|
373
|
+
staleTime: q,
|
|
374
|
+
placeholderData: M,
|
|
374
375
|
enabled: e.enabled,
|
|
375
376
|
...t
|
|
376
377
|
});
|
|
@@ -379,7 +380,7 @@ function An(e, t) {
|
|
|
379
380
|
//#region src/hooks/use-trace-detail-query.ts
|
|
380
381
|
function jn(e) {
|
|
381
382
|
let { apiId: t, traceId: n, enabled: r, keepPreviousData: i } = e, a = d(), o = N({
|
|
382
|
-
queryKey:
|
|
383
|
+
queryKey: J.traceDetail(t, n ?? ""),
|
|
383
384
|
queryFn: ({ signal: e }) => {
|
|
384
385
|
if (!n) throw Error("traceId is required but was called with a falsy value");
|
|
385
386
|
return a.fetchTraceById({
|
|
@@ -388,9 +389,9 @@ function jn(e) {
|
|
|
388
389
|
signal: e
|
|
389
390
|
});
|
|
390
391
|
},
|
|
391
|
-
staleTime:
|
|
392
|
+
staleTime: q,
|
|
392
393
|
enabled: !!n && r !== !1,
|
|
393
|
-
placeholderData: i ?
|
|
394
|
+
placeholderData: i ? M : void 0
|
|
394
395
|
});
|
|
395
396
|
return {
|
|
396
397
|
data: o.data,
|
|
@@ -405,7 +406,7 @@ function jn(e) {
|
|
|
405
406
|
//#region src/hooks/use-traces-paged-query.ts
|
|
406
407
|
var Mn = 25, Nn = [];
|
|
407
408
|
function Pn(e) {
|
|
408
|
-
let { apiId: t, timeRange: n, filters: r, pageSize: i = Mn, enabled: a } = e, o = d(), [s, c] = O(1), [l, u] = O(i), f =
|
|
409
|
+
let { apiId: t, timeRange: n, filters: r, pageSize: i = Mn, enabled: a } = e, o = d(), [s, c] = O(1), [l, u] = O(i), f = J.traces(t, n, r), p = JSON.stringify(f), m = D(p);
|
|
409
410
|
T(() => {
|
|
410
411
|
m.current !== p && (m.current = p, c(1));
|
|
411
412
|
}, [p]);
|
|
@@ -422,7 +423,7 @@ function Pn(e) {
|
|
|
422
423
|
perPage: l,
|
|
423
424
|
signal: e
|
|
424
425
|
}),
|
|
425
|
-
staleTime:
|
|
426
|
+
staleTime: q,
|
|
426
427
|
placeholderData: (e) => e,
|
|
427
428
|
enabled: a
|
|
428
429
|
}), g = h.data?.totalCount ?? 0, _ = h.data?.pageCount ?? (g > 0 ? Math.ceil(g / l) : 0);
|
|
@@ -650,13 +651,13 @@ function rr({ value: e, onChange: t, disabled: n = !1, showTimezone: r = !1, cla
|
|
|
650
651
|
onOpenChange: S,
|
|
651
652
|
children: [/* @__PURE__ */ A(Fe, {
|
|
652
653
|
asChild: !0,
|
|
653
|
-
children: /* @__PURE__ */ j(
|
|
654
|
+
children: /* @__PURE__ */ j(L, {
|
|
654
655
|
variant: "outline",
|
|
655
656
|
disabled: n,
|
|
656
657
|
"aria-label": "Time range picker",
|
|
657
658
|
"aria-haspopup": "dialog",
|
|
658
659
|
"aria-expanded": c,
|
|
659
|
-
className:
|
|
660
|
+
className: U("justify-between gap-2 font-normal", i),
|
|
660
661
|
children: [er(e, r), /* @__PURE__ */ A(ot, {
|
|
661
662
|
"aria-hidden": "true",
|
|
662
663
|
className: "size-4 shrink-0"
|
|
@@ -695,13 +696,13 @@ function rr({ value: e, onChange: t, disabled: n = !1, showTimezone: r = !1, cla
|
|
|
695
696
|
children: t.label
|
|
696
697
|
}), /* @__PURE__ */ A("div", {
|
|
697
698
|
className: "grid grid-cols-3 gap-2",
|
|
698
|
-
children: t.periods.map((t) => /* @__PURE__ */ A(
|
|
699
|
+
children: t.periods.map((t) => /* @__PURE__ */ A(L, {
|
|
699
700
|
variant: "outline",
|
|
700
701
|
size: "sm",
|
|
701
702
|
role: "option",
|
|
702
703
|
"aria-label": zn[t],
|
|
703
704
|
"aria-selected": e.type === "relative" && e.period === t,
|
|
704
|
-
className:
|
|
705
|
+
className: U(e.type === "relative" && e.period === t && "bg-primary text-primary-foreground hover:bg-primary/90"),
|
|
705
706
|
disabled: n,
|
|
706
707
|
onClick: () => ee(t),
|
|
707
708
|
children: Rn[t]
|
|
@@ -712,7 +713,7 @@ function rr({ value: e, onChange: t, disabled: n = !1, showTimezone: r = !1, cla
|
|
|
712
713
|
u === "custom" && /* @__PURE__ */ j("div", {
|
|
713
714
|
className: "flex flex-col gap-3",
|
|
714
715
|
children: [
|
|
715
|
-
/* @__PURE__ */ A(
|
|
716
|
+
/* @__PURE__ */ A(ce, {
|
|
716
717
|
mode: "range",
|
|
717
718
|
selected: f,
|
|
718
719
|
onSelect: te,
|
|
@@ -724,18 +725,18 @@ function rr({ value: e, onChange: t, disabled: n = !1, showTimezone: r = !1, cla
|
|
|
724
725
|
/* @__PURE__ */ j("div", {
|
|
725
726
|
className: "flex items-end gap-2",
|
|
726
727
|
children: [
|
|
727
|
-
/* @__PURE__ */ j(
|
|
728
|
+
/* @__PURE__ */ j(De, {
|
|
728
729
|
className: "flex-1",
|
|
729
|
-
children: [/* @__PURE__ */ A(
|
|
730
|
+
children: [/* @__PURE__ */ A(ke, {
|
|
730
731
|
htmlFor: o,
|
|
731
732
|
children: tr(f?.from)
|
|
732
|
-
}), /* @__PURE__ */ A(
|
|
733
|
+
}), /* @__PURE__ */ A(Ae, {
|
|
733
734
|
id: o,
|
|
734
735
|
type: "time",
|
|
735
736
|
value: m,
|
|
736
737
|
disabled: n,
|
|
737
738
|
"aria-invalid": b,
|
|
738
|
-
className:
|
|
739
|
+
className: U("bg-background [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none", b && "border-destructive"),
|
|
739
740
|
onChange: (e) => h(e.target.value)
|
|
740
741
|
})]
|
|
741
742
|
}),
|
|
@@ -743,18 +744,18 @@ function rr({ value: e, onChange: t, disabled: n = !1, showTimezone: r = !1, cla
|
|
|
743
744
|
className: "pb-2 text-muted-foreground",
|
|
744
745
|
children: "-"
|
|
745
746
|
}),
|
|
746
|
-
/* @__PURE__ */ j(
|
|
747
|
+
/* @__PURE__ */ j(De, {
|
|
747
748
|
className: "flex-1",
|
|
748
|
-
children: [/* @__PURE__ */ A(
|
|
749
|
+
children: [/* @__PURE__ */ A(ke, {
|
|
749
750
|
htmlFor: s,
|
|
750
751
|
children: tr(f?.to)
|
|
751
|
-
}), /* @__PURE__ */ A(
|
|
752
|
+
}), /* @__PURE__ */ A(Ae, {
|
|
752
753
|
id: s,
|
|
753
754
|
type: "time",
|
|
754
755
|
value: g,
|
|
755
756
|
disabled: n,
|
|
756
757
|
"aria-invalid": b,
|
|
757
|
-
className:
|
|
758
|
+
className: U("bg-background [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none", b && "border-destructive"),
|
|
758
759
|
onChange: (e) => _(e.target.value)
|
|
759
760
|
})]
|
|
760
761
|
})
|
|
@@ -765,7 +766,7 @@ function rr({ value: e, onChange: t, disabled: n = !1, showTimezone: r = !1, cla
|
|
|
765
766
|
role: "alert",
|
|
766
767
|
children: "Start must be before end"
|
|
767
768
|
}),
|
|
768
|
-
/* @__PURE__ */ A(
|
|
769
|
+
/* @__PURE__ */ A(L, {
|
|
769
770
|
size: "sm",
|
|
770
771
|
disabled: !x || n,
|
|
771
772
|
onClick: ne,
|
|
@@ -893,7 +894,7 @@ function fr(e) {
|
|
|
893
894
|
//#endregion
|
|
894
895
|
//#region src/filters/use-scoped-filter-providers.ts
|
|
895
896
|
function pr(e) {
|
|
896
|
-
let t = p(), n =
|
|
897
|
+
let t = p(), n = X();
|
|
897
898
|
return E(() => {
|
|
898
899
|
if (!e) return t;
|
|
899
900
|
let r = n.find((t) => t.field === e);
|
|
@@ -952,24 +953,24 @@ function yr({ options: e, selected: t, onSelectedChange: n, multiple: r, onSearc
|
|
|
952
953
|
...a && { filter: null },
|
|
953
954
|
...i && { onInputValueChange: (e) => i(String(e)) }
|
|
954
955
|
}, v = /* @__PURE__ */ j(k, { children: [
|
|
955
|
-
/* @__PURE__ */ A(
|
|
956
|
-
/* @__PURE__ */ A(
|
|
956
|
+
/* @__PURE__ */ A(he, { children: s }),
|
|
957
|
+
/* @__PURE__ */ A(ve, { children: (e) => /* @__PURE__ */ A(_e, {
|
|
957
958
|
value: e,
|
|
958
959
|
children: e.label
|
|
959
960
|
}, e.value) }),
|
|
960
961
|
c
|
|
961
|
-
] }), y = r ? /* @__PURE__ */ j(
|
|
962
|
+
] }), y = r ? /* @__PURE__ */ j(ue, {
|
|
962
963
|
..._,
|
|
963
964
|
multiple: !0,
|
|
964
965
|
autoHighlight: !0,
|
|
965
966
|
value: t,
|
|
966
967
|
onValueChange: (e) => n(Array.isArray(e) ? e : []),
|
|
967
|
-
children: [/* @__PURE__ */ A(
|
|
968
|
+
children: [/* @__PURE__ */ A(fe, {
|
|
968
969
|
ref: u,
|
|
969
|
-
children: /* @__PURE__ */ A(
|
|
970
|
+
children: /* @__PURE__ */ A(ye, { children: (e) => /* @__PURE__ */ j(b, { children: [e.map((e) => /* @__PURE__ */ A(de, {
|
|
970
971
|
removeAriaLabel: `Remove ${e.label}`,
|
|
971
972
|
children: e.label
|
|
972
|
-
}, e.value)), /* @__PURE__ */ A(
|
|
973
|
+
}, e.value)), /* @__PURE__ */ A(pe, {
|
|
973
974
|
"aria-label": "Filter values",
|
|
974
975
|
"aria-invalid": g || void 0,
|
|
975
976
|
"aria-describedby": g ? h : void 0,
|
|
@@ -977,18 +978,18 @@ function yr({ options: e, selected: t, onSelectedChange: n, multiple: r, onSearc
|
|
|
977
978
|
onFocus: p,
|
|
978
979
|
onKeyDown: m
|
|
979
980
|
})] }) })
|
|
980
|
-
}), /* @__PURE__ */ A(
|
|
981
|
+
}), /* @__PURE__ */ A(me, {
|
|
981
982
|
anchor: u,
|
|
982
983
|
children: v
|
|
983
984
|
})]
|
|
984
|
-
}) : /* @__PURE__ */ j(
|
|
985
|
+
}) : /* @__PURE__ */ j(ue, {
|
|
985
986
|
..._,
|
|
986
987
|
value: t[0] ?? null,
|
|
987
988
|
onValueChange: (e) => n(e ? [e] : []),
|
|
988
989
|
openOnInputClick: !0,
|
|
989
|
-
children: [/* @__PURE__ */ A(
|
|
990
|
+
children: [/* @__PURE__ */ A(fe, {
|
|
990
991
|
ref: u,
|
|
991
|
-
children: /* @__PURE__ */ A(
|
|
992
|
+
children: /* @__PURE__ */ A(pe, {
|
|
992
993
|
"aria-label": "Filter values",
|
|
993
994
|
"aria-invalid": g || void 0,
|
|
994
995
|
"aria-describedby": g ? h : void 0,
|
|
@@ -996,12 +997,12 @@ function yr({ options: e, selected: t, onSelectedChange: n, multiple: r, onSearc
|
|
|
996
997
|
onFocus: p,
|
|
997
998
|
onKeyDown: m
|
|
998
999
|
})
|
|
999
|
-
}), /* @__PURE__ */ A(
|
|
1000
|
+
}), /* @__PURE__ */ A(me, {
|
|
1000
1001
|
anchor: u,
|
|
1001
1002
|
children: v
|
|
1002
1003
|
})]
|
|
1003
1004
|
});
|
|
1004
|
-
return l ? /* @__PURE__ */ j(k, { children: [y, /* @__PURE__ */ A(
|
|
1005
|
+
return l ? /* @__PURE__ */ j(k, { children: [y, /* @__PURE__ */ A(Oe, {
|
|
1005
1006
|
id: h,
|
|
1006
1007
|
children: l
|
|
1007
1008
|
})] }) : y;
|
|
@@ -1143,13 +1144,13 @@ function Or(e) {
|
|
|
1143
1144
|
var kr = re(function({ provider: e, showScopes: t = !1, className: n }) {
|
|
1144
1145
|
let r = t && e.scopes && e.scopes.length > 0;
|
|
1145
1146
|
return /* @__PURE__ */ j("div", {
|
|
1146
|
-
className:
|
|
1147
|
+
className: U("flex min-w-0 flex-1 items-center justify-between gap-3", n),
|
|
1147
1148
|
children: [/* @__PURE__ */ A("span", {
|
|
1148
1149
|
className: "truncate font-medium",
|
|
1149
1150
|
children: e.label
|
|
1150
1151
|
}), r ? /* @__PURE__ */ A("span", {
|
|
1151
1152
|
className: "flex shrink-0 flex-wrap items-center justify-end gap-1",
|
|
1152
|
-
children: e.scopes?.map((e) => /* @__PURE__ */ A(
|
|
1153
|
+
children: e.scopes?.map((e) => /* @__PURE__ */ A(I, {
|
|
1153
1154
|
variant: "secondary",
|
|
1154
1155
|
className: "max-w-28 truncate text-xs font-normal",
|
|
1155
1156
|
children: Or(e)
|
|
@@ -1161,7 +1162,7 @@ var kr = re(function({ provider: e, showScopes: t = !1, className: n }) {
|
|
|
1161
1162
|
//#region src/filters/FilterPropertyField.tsx
|
|
1162
1163
|
function Ar({ providers: e, selectedField: t, onFieldChange: n, showScopes: r }) {
|
|
1163
1164
|
let i = et(), { open: a, handleOpenChange: o, handleInputFocus: s, handleInputKeyDown: c } = gr();
|
|
1164
|
-
return /* @__PURE__ */ j(
|
|
1165
|
+
return /* @__PURE__ */ j(ue, {
|
|
1165
1166
|
open: a,
|
|
1166
1167
|
onOpenChange: o,
|
|
1167
1168
|
items: e,
|
|
@@ -1170,17 +1171,17 @@ function Ar({ providers: e, selectedField: t, onFieldChange: n, showScopes: r })
|
|
|
1170
1171
|
itemToStringLabel: (e) => e.label,
|
|
1171
1172
|
itemToStringValue: (e) => e.field,
|
|
1172
1173
|
isItemEqualToValue: (e, t) => e.field === t.field,
|
|
1173
|
-
children: [/* @__PURE__ */ A(
|
|
1174
|
+
children: [/* @__PURE__ */ A(fe, {
|
|
1174
1175
|
ref: i,
|
|
1175
|
-
children: /* @__PURE__ */ A(
|
|
1176
|
+
children: /* @__PURE__ */ A(pe, {
|
|
1176
1177
|
"aria-label": "Filter property",
|
|
1177
1178
|
placeholder: "Search property…",
|
|
1178
1179
|
onFocus: s,
|
|
1179
1180
|
onKeyDown: c
|
|
1180
1181
|
})
|
|
1181
|
-
}), /* @__PURE__ */ j(
|
|
1182
|
+
}), /* @__PURE__ */ j(me, {
|
|
1182
1183
|
anchor: i,
|
|
1183
|
-
children: [/* @__PURE__ */ A(
|
|
1184
|
+
children: [/* @__PURE__ */ A(he, { children: "No results." }), /* @__PURE__ */ A(ve, { children: (e) => /* @__PURE__ */ A(_e, {
|
|
1184
1185
|
value: e,
|
|
1185
1186
|
children: /* @__PURE__ */ A(kr, {
|
|
1186
1187
|
provider: e,
|
|
@@ -1354,7 +1355,7 @@ function Gr({ existingCondition: e, onApply: t, onCancel: n, showScopes: r = !1
|
|
|
1354
1355
|
}));
|
|
1355
1356
|
}
|
|
1356
1357
|
function ee() {
|
|
1357
|
-
return !m || !s ? /* @__PURE__ */ A(
|
|
1358
|
+
return !m || !s ? /* @__PURE__ */ A(Ae, {
|
|
1358
1359
|
disabled: !0,
|
|
1359
1360
|
placeholder: "Search value…",
|
|
1360
1361
|
"aria-label": "Filter value"
|
|
@@ -1368,7 +1369,7 @@ function Gr({ existingCondition: e, onApply: t, onCancel: n, showScopes: r = !1
|
|
|
1368
1369
|
selected: l,
|
|
1369
1370
|
onSelectedChange: x,
|
|
1370
1371
|
multiple: h
|
|
1371
|
-
}, m.field) : m.allowFreeText ? /* @__PURE__ */ A(
|
|
1372
|
+
}, m.field) : m.allowFreeText ? /* @__PURE__ */ A(Ae, {
|
|
1372
1373
|
value: d,
|
|
1373
1374
|
onChange: (e) => f(e.target.value),
|
|
1374
1375
|
placeholder: "Enter value(s), comma-separated",
|
|
@@ -1381,13 +1382,13 @@ function Gr({ existingCondition: e, onApply: t, onCancel: n, showScopes: r = !1
|
|
|
1381
1382
|
return /* @__PURE__ */ j("div", {
|
|
1382
1383
|
className: "flex w-[340px] flex-col gap-4 p-4",
|
|
1383
1384
|
children: [
|
|
1384
|
-
/* @__PURE__ */ j(
|
|
1385
|
+
/* @__PURE__ */ j(De, { children: [/* @__PURE__ */ A(ke, { children: "Filter by" }), /* @__PURE__ */ A(Ar, {
|
|
1385
1386
|
providers: i,
|
|
1386
1387
|
selectedField: a,
|
|
1387
1388
|
onFieldChange: y,
|
|
1388
1389
|
showScopes: r
|
|
1389
1390
|
})] }),
|
|
1390
|
-
/* @__PURE__ */ j(
|
|
1391
|
+
/* @__PURE__ */ j(De, { children: [/* @__PURE__ */ A(ke, { children: "Choose operator" }), /* @__PURE__ */ j(Le, {
|
|
1391
1392
|
value: s ?? void 0,
|
|
1392
1393
|
onValueChange: b,
|
|
1393
1394
|
disabled: !m,
|
|
@@ -1400,16 +1401,16 @@ function Gr({ existingCondition: e, onApply: t, onCancel: n, showScopes: r = !1
|
|
|
1400
1401
|
children: Pr(e)
|
|
1401
1402
|
}, e)) })]
|
|
1402
1403
|
})] }),
|
|
1403
|
-
_ ? /* @__PURE__ */ j(
|
|
1404
|
+
_ ? /* @__PURE__ */ j(De, { children: [/* @__PURE__ */ A(ke, { children: "Filter value" }), ee()] }) : null,
|
|
1404
1405
|
/* @__PURE__ */ j("div", {
|
|
1405
1406
|
className: "flex items-center justify-end gap-2",
|
|
1406
|
-
children: [/* @__PURE__ */ A(
|
|
1407
|
+
children: [/* @__PURE__ */ A(L, {
|
|
1407
1408
|
type: "button",
|
|
1408
1409
|
variant: "ghost",
|
|
1409
1410
|
size: "sm",
|
|
1410
1411
|
onClick: n,
|
|
1411
1412
|
children: "Cancel"
|
|
1412
|
-
}), /* @__PURE__ */ A(
|
|
1413
|
+
}), /* @__PURE__ */ A(L, {
|
|
1413
1414
|
type: "button",
|
|
1414
1415
|
size: "sm",
|
|
1415
1416
|
disabled: !v,
|
|
@@ -1495,12 +1496,12 @@ var $r = re(te(function({ condition: e, onEdit: t, onRemove: n, editable: r = !0
|
|
|
1495
1496
|
className: "truncate",
|
|
1496
1497
|
children: l.value
|
|
1497
1498
|
}) : null] });
|
|
1498
|
-
return /* @__PURE__ */ j(
|
|
1499
|
+
return /* @__PURE__ */ j(z, { children: [/* @__PURE__ */ A(H, {
|
|
1499
1500
|
asChild: !0,
|
|
1500
1501
|
children: /* @__PURE__ */ j("span", {
|
|
1501
1502
|
ref: c,
|
|
1502
1503
|
"data-chip-index": s,
|
|
1503
|
-
className:
|
|
1504
|
+
className: U("inline-flex items-center gap-1.5", f && r && "border-dashed border-highlight/40", f && !r && "border-dashed", i && "pointer-events-none opacity-50", o),
|
|
1504
1505
|
"aria-label": Qr(r, i, u),
|
|
1505
1506
|
"aria-disabled": i || void 0,
|
|
1506
1507
|
"data-active": a || void 0,
|
|
@@ -1508,9 +1509,9 @@ var $r = re(te(function({ condition: e, onEdit: t, onRemove: n, editable: r = !0
|
|
|
1508
1509
|
onMouseLeave: () => m(!1),
|
|
1509
1510
|
onFocus: () => d && m(!0),
|
|
1510
1511
|
onBlur: () => m(!1),
|
|
1511
|
-
children: [/* @__PURE__ */ A(
|
|
1512
|
+
children: [/* @__PURE__ */ A(I, {
|
|
1512
1513
|
variant: r ? "highlight" : "secondary",
|
|
1513
|
-
className:
|
|
1514
|
+
className: U("h-auto max-w-xs gap-1.5 py-1 font-normal transition-all", d ? "cursor-pointer hover:bg-highlight/20" : "pr-2", d && !p && "pr-2", d && p && "pr-1"),
|
|
1514
1515
|
role: d ? "button" : void 0,
|
|
1515
1516
|
tabIndex: d ? 0 : void 0,
|
|
1516
1517
|
"aria-hidden": d ? void 0 : "true",
|
|
@@ -1519,7 +1520,7 @@ var $r = re(te(function({ condition: e, onEdit: t, onRemove: n, editable: r = !0
|
|
|
1519
1520
|
d && ((e.key === "Enter" || e.key === " ") && (e.preventDefault(), t?.()), (e.key === "Delete" || e.key === "Backspace") && (e.preventDefault(), n?.()));
|
|
1520
1521
|
},
|
|
1521
1522
|
children: g
|
|
1522
|
-
}), d && n && p ? /* @__PURE__ */ A(
|
|
1523
|
+
}), d && n && p ? /* @__PURE__ */ A(L, {
|
|
1523
1524
|
type: "button",
|
|
1524
1525
|
variant: "ghost",
|
|
1525
1526
|
size: "sm",
|
|
@@ -1533,7 +1534,7 @@ var $r = re(te(function({ condition: e, onEdit: t, onRemove: n, editable: r = !0
|
|
|
1533
1534
|
})
|
|
1534
1535
|
}) : null]
|
|
1535
1536
|
})
|
|
1536
|
-
}), /* @__PURE__ */ A(
|
|
1537
|
+
}), /* @__PURE__ */ A(B, { children: u })] });
|
|
1537
1538
|
}));
|
|
1538
1539
|
$r.displayName = "FilterChip";
|
|
1539
1540
|
//#endregion
|
|
@@ -1626,18 +1627,18 @@ function ci({ filters: e, onFiltersChange: t, editable: n = !0, showScopes: r =
|
|
|
1626
1627
|
e && (e.querySelector("[data-autofocus]") ?? e.querySelector("input:not([disabled])"))?.focus();
|
|
1627
1628
|
});
|
|
1628
1629
|
}
|
|
1629
|
-
return /* @__PURE__ */ A(
|
|
1630
|
+
return /* @__PURE__ */ A(V, { children: /* @__PURE__ */ j(Me, {
|
|
1630
1631
|
open: m,
|
|
1631
1632
|
onOpenChange: x,
|
|
1632
1633
|
children: [
|
|
1633
1634
|
/* @__PURE__ */ j("div", {
|
|
1634
|
-
className:
|
|
1635
|
+
className: U("flex flex-wrap items-center gap-2", a),
|
|
1635
1636
|
children: [
|
|
1636
1637
|
/* @__PURE__ */ A("span", {
|
|
1637
1638
|
className: "shrink-0 text-sm font-medium text-muted-foreground",
|
|
1638
1639
|
children: "Filters:"
|
|
1639
1640
|
}),
|
|
1640
|
-
n ? /* @__PURE__ */ j(
|
|
1641
|
+
n ? /* @__PURE__ */ j(L, {
|
|
1641
1642
|
ref: l,
|
|
1642
1643
|
type: "button",
|
|
1643
1644
|
variant: "outline",
|
|
@@ -1712,7 +1713,7 @@ function mi(e) {
|
|
|
1712
1713
|
function hi(e) {
|
|
1713
1714
|
return Math.floor(Date.now() / e);
|
|
1714
1715
|
}
|
|
1715
|
-
function
|
|
1716
|
+
function gi(e) {
|
|
1716
1717
|
let t = ln(), n = t?.intervalMs ?? 6e4, r = t?.isLive ?? !0, [i, a] = O(() => hi(n));
|
|
1717
1718
|
return T(() => {
|
|
1718
1719
|
if (e.type === "absolute" || !r) return;
|
|
@@ -1738,44 +1739,44 @@ function Y(e) {
|
|
|
1738
1739
|
}
|
|
1739
1740
|
//#endregion
|
|
1740
1741
|
//#region src/dashboards/adapters/facets-adapter.ts
|
|
1741
|
-
var
|
|
1742
|
-
function _i(e) {
|
|
1743
|
-
return e.length <= gi ? e : `${e.slice(0, gi - 1)}…`;
|
|
1744
|
-
}
|
|
1742
|
+
var _i = 20;
|
|
1745
1743
|
function vi(e) {
|
|
1744
|
+
return e.length <= _i ? e : `${e.slice(0, _i - 1)}…`;
|
|
1745
|
+
}
|
|
1746
|
+
function yi(e) {
|
|
1746
1747
|
return e.map((e) => ({
|
|
1747
1748
|
category: e.value,
|
|
1748
1749
|
value: e.count
|
|
1749
1750
|
}));
|
|
1750
1751
|
}
|
|
1751
|
-
function
|
|
1752
|
+
function bi(e) {
|
|
1752
1753
|
return e.map((e) => ({
|
|
1753
|
-
category:
|
|
1754
|
+
category: vi(e.label || e.value),
|
|
1754
1755
|
count: e.count
|
|
1755
1756
|
}));
|
|
1756
1757
|
}
|
|
1757
1758
|
//#endregion
|
|
1758
1759
|
//#region src/dashboards/use-merged-widget-filters.ts
|
|
1759
|
-
function
|
|
1760
|
-
return
|
|
1760
|
+
function xi(e, t) {
|
|
1761
|
+
return Y(X(), t, e);
|
|
1761
1762
|
}
|
|
1762
1763
|
//#endregion
|
|
1763
1764
|
//#region src/dashboards/renderers/facet-value-format.ts
|
|
1764
|
-
var
|
|
1765
|
-
function Si(e) {
|
|
1766
|
-
return e.toLowerCase().split(/[_\s]+/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
1767
|
-
}
|
|
1765
|
+
var Si = new Intl.NumberFormat("en-US");
|
|
1768
1766
|
function Ci(e) {
|
|
1769
|
-
return e.
|
|
1767
|
+
return e.toLowerCase().split(/[_\s]+/).filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
1770
1768
|
}
|
|
1771
1769
|
function wi(e) {
|
|
1772
|
-
return e.
|
|
1770
|
+
return e.valueLabel?.trim() || (e.metric ? Ci(e.metric) : Ci(K(e.measure)));
|
|
1773
1771
|
}
|
|
1774
1772
|
function Ti(e) {
|
|
1773
|
+
return e.reduce((e, t) => e + (Number.isFinite(t) ? t : 0), 0);
|
|
1774
|
+
}
|
|
1775
|
+
function Ei(e) {
|
|
1775
1776
|
return (t) => {
|
|
1776
1777
|
let n = typeof t == "number" ? t : Number(t);
|
|
1777
1778
|
if (!Number.isFinite(n)) return String(t);
|
|
1778
|
-
let r =
|
|
1779
|
+
let r = Si.format(n);
|
|
1779
1780
|
if (e <= 0) return r;
|
|
1780
1781
|
let i = n / e * 100;
|
|
1781
1782
|
return `${r} (${i > 0 && i < .5 ? "<1" : Math.round(i)}%)`;
|
|
@@ -1783,17 +1784,17 @@ function Ti(e) {
|
|
|
1783
1784
|
}
|
|
1784
1785
|
//#endregion
|
|
1785
1786
|
//#region src/dashboards/renderers/BarPresentation.tsx
|
|
1786
|
-
var
|
|
1787
|
-
function
|
|
1787
|
+
var Di = 160, Oi = 72, ki = 7, Ai = 20;
|
|
1788
|
+
function ji({ data: e, config: t, state: n, layout: r = "vertical", showShare: i = !0, valueFormatter: a }) {
|
|
1788
1789
|
let o = E(() => {
|
|
1789
1790
|
if (a) return a;
|
|
1790
|
-
if (i) return Ti(
|
|
1791
|
+
if (i) return Ei(Ti(e.map((e) => e.count)));
|
|
1791
1792
|
}, [
|
|
1792
1793
|
e,
|
|
1793
1794
|
i,
|
|
1794
1795
|
a
|
|
1795
1796
|
]), s = E(() => {
|
|
1796
|
-
if (!(r !== "horizontal" || e.length === 0)) return { left: Math.min(
|
|
1797
|
+
if (!(r !== "horizontal" || e.length === 0)) return { left: Math.min(Di, Math.max(Oi, e.reduce((e, t) => Math.max(e, t.category.length), 0) * ki + Ai)) };
|
|
1797
1798
|
}, [e, r]);
|
|
1798
1799
|
return /* @__PURE__ */ A(jt, {
|
|
1799
1800
|
config: t,
|
|
@@ -1809,8 +1810,8 @@ function Ai({ data: e, config: t, state: n, layout: r = "vertical", showShare: i
|
|
|
1809
1810
|
}
|
|
1810
1811
|
//#endregion
|
|
1811
1812
|
//#region src/dashboards/renderers/BarWidgetRenderer.tsx
|
|
1812
|
-
function
|
|
1813
|
-
let r =
|
|
1813
|
+
function Mi({ widget: e, timeRange: t, filters: n }) {
|
|
1814
|
+
let r = xi(e.filters, n), i = gi(t), { data: a, isLoading: o, isError: s } = Sn({
|
|
1814
1815
|
by: [...e.by],
|
|
1815
1816
|
metric: e.metric,
|
|
1816
1817
|
measure: e.measure,
|
|
@@ -1823,14 +1824,14 @@ function ji({ widget: e, timeRange: t, filters: n }) {
|
|
|
1823
1824
|
T(() => {
|
|
1824
1825
|
s && console.error(`[BarWidgetRenderer] Failed to fetch facets for widget "${e.title}"`);
|
|
1825
1826
|
}, [s, e.title]);
|
|
1826
|
-
let c =
|
|
1827
|
-
data:
|
|
1827
|
+
let c = wi(e), { data: l, config: u } = E(() => a ? {
|
|
1828
|
+
data: bi(a),
|
|
1828
1829
|
config: { count: { label: c } }
|
|
1829
1830
|
} : {
|
|
1830
1831
|
data: [],
|
|
1831
1832
|
config: {}
|
|
1832
1833
|
}, [a, c]);
|
|
1833
|
-
return /* @__PURE__ */ A(
|
|
1834
|
+
return /* @__PURE__ */ A(ji, {
|
|
1834
1835
|
data: l,
|
|
1835
1836
|
config: u,
|
|
1836
1837
|
state: o ? "loading" : s ? "empty" : "ready",
|
|
@@ -1839,36 +1840,36 @@ function ji({ widget: e, timeRange: t, filters: n }) {
|
|
|
1839
1840
|
}
|
|
1840
1841
|
//#endregion
|
|
1841
1842
|
//#region src/dashboards/adapters/status-palette.ts
|
|
1842
|
-
var
|
|
1843
|
+
var Ni = {
|
|
1843
1844
|
"1XX": "var(--chart-5)",
|
|
1844
1845
|
"2XX": "var(--success)",
|
|
1845
1846
|
"3XX": "var(--chart-4)",
|
|
1846
1847
|
"4XX": "var(--warning)",
|
|
1847
1848
|
"5XX": "var(--destructive)"
|
|
1848
|
-
},
|
|
1849
|
+
}, Pi = new Set([
|
|
1849
1850
|
"HTTP_STATUS_CODE_GROUP",
|
|
1850
1851
|
"http_status_code_group",
|
|
1851
1852
|
"status_code_group"
|
|
1852
1853
|
]);
|
|
1853
|
-
function
|
|
1854
|
+
function Fi(e, t, n) {
|
|
1854
1855
|
if (n?.[e]) return n[e];
|
|
1855
|
-
if (t &&
|
|
1856
|
+
if (t && Pi.has(t)) return Ni[e.toUpperCase()];
|
|
1856
1857
|
}
|
|
1857
1858
|
//#endregion
|
|
1858
1859
|
//#region src/dashboards/adapters/time-series-adapter.ts
|
|
1859
|
-
function
|
|
1860
|
+
function Ii(e) {
|
|
1860
1861
|
return e.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
1861
1862
|
}
|
|
1862
|
-
function
|
|
1863
|
+
function Li(e, t) {
|
|
1863
1864
|
let n = [], r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
1864
1865
|
for (let t of e) i.set(t.metric, (i.get(t.metric) ?? 0) + 1);
|
|
1865
1866
|
return e.forEach((e, a) => {
|
|
1866
|
-
let o = t[a] ?? [], s =
|
|
1867
|
+
let o = t[a] ?? [], s = K(e.measure), c = `${Ii(e.metric)}__${Ii(s)}__${Ii(e.representation)}`, l = e.by?.[0];
|
|
1867
1868
|
if (l) {
|
|
1868
1869
|
for (let t of o) {
|
|
1869
|
-
let i = `${c}__${
|
|
1870
|
+
let i = `${c}__${Ii(t.key)}`;
|
|
1870
1871
|
if (r.has(i)) continue;
|
|
1871
|
-
let a =
|
|
1872
|
+
let a = Fi(t.key, l, e.colorByGroup);
|
|
1872
1873
|
n.push({
|
|
1873
1874
|
dataKey: i,
|
|
1874
1875
|
label: t.label,
|
|
@@ -1901,10 +1902,10 @@ function Ii(e, t) {
|
|
|
1901
1902
|
seriesMap: r
|
|
1902
1903
|
};
|
|
1903
1904
|
}
|
|
1904
|
-
function
|
|
1905
|
+
function Ri(e) {
|
|
1905
1906
|
let t = /* @__PURE__ */ new Map(), n = Infinity, r = -Infinity;
|
|
1906
1907
|
for (let t of e.values()) for (let e of t) for (let t of e.points) t.timestamp < n && (n = t.timestamp), t.timestamp > r && (r = t.timestamp);
|
|
1907
|
-
let i = r - n >
|
|
1908
|
+
let i = r - n > zi ? Hi : Vi;
|
|
1908
1909
|
for (let n of e.values()) for (let e of n) for (let n of e.points) {
|
|
1909
1910
|
let e = i(n.timestamp), r = t.get(e);
|
|
1910
1911
|
(r === void 0 || n.timestamp < r) && t.set(e, n.timestamp);
|
|
@@ -1920,7 +1921,7 @@ function Li(e) {
|
|
|
1920
1921
|
}
|
|
1921
1922
|
return o;
|
|
1922
1923
|
}
|
|
1923
|
-
var
|
|
1924
|
+
var zi = 1440 * 6e4, Bi = [
|
|
1924
1925
|
"Jan",
|
|
1925
1926
|
"Feb",
|
|
1926
1927
|
"Mar",
|
|
@@ -1934,25 +1935,25 @@ var Ri = 1440 * 6e4, zi = [
|
|
|
1934
1935
|
"Nov",
|
|
1935
1936
|
"Dec"
|
|
1936
1937
|
];
|
|
1937
|
-
function
|
|
1938
|
+
function Vi(e) {
|
|
1938
1939
|
let t = new Date(e);
|
|
1939
1940
|
return `${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
|
|
1940
1941
|
}
|
|
1941
|
-
function
|
|
1942
|
+
function Hi(e) {
|
|
1942
1943
|
let t = new Date(e);
|
|
1943
|
-
return `${
|
|
1944
|
+
return `${Bi[t.getMonth()]} ${String(t.getDate()).padStart(2, "0")} ${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
|
|
1944
1945
|
}
|
|
1945
1946
|
//#endregion
|
|
1946
1947
|
//#region src/dashboards/compute-bucket-interval.ts
|
|
1947
|
-
var
|
|
1948
|
-
function
|
|
1949
|
-
if (t <= 0) return
|
|
1948
|
+
var Ui = 6e4, Wi = 48;
|
|
1949
|
+
function Gi(e, t) {
|
|
1950
|
+
if (t <= 0) return Ui;
|
|
1950
1951
|
let n = e.to - e.from, r = Math.floor(n / t);
|
|
1951
|
-
return Math.max(
|
|
1952
|
+
return Math.max(Ui, r);
|
|
1952
1953
|
}
|
|
1953
1954
|
//#endregion
|
|
1954
1955
|
//#region src/dashboards/renderers/CartesianPresentation.tsx
|
|
1955
|
-
function
|
|
1956
|
+
function Ki({ data: e, config: t, series: n, seriesByKey: r, state: i, showTotal: a, totalLabel: o }) {
|
|
1956
1957
|
let s = Object.keys(t), c = n.some((e) => e.representation === "bar") ? "band" : "point";
|
|
1957
1958
|
return /* @__PURE__ */ A(jt, {
|
|
1958
1959
|
config: t,
|
|
@@ -1965,8 +1966,8 @@ function Gi({ data: e, config: t, series: n, seriesByKey: r, state: i, showTotal
|
|
|
1965
1966
|
children: [
|
|
1966
1967
|
/* @__PURE__ */ A(Lt, {}),
|
|
1967
1968
|
s.map((e) => {
|
|
1968
|
-
let t = r?.[e] ??
|
|
1969
|
-
return t ?
|
|
1969
|
+
let t = r?.[e] ?? qi(e, n);
|
|
1970
|
+
return t ? Ji(e, t) : null;
|
|
1970
1971
|
}),
|
|
1971
1972
|
/* @__PURE__ */ A(Ut, {}),
|
|
1972
1973
|
/* @__PURE__ */ A(Wt, {}),
|
|
@@ -1979,10 +1980,10 @@ function Gi({ data: e, config: t, series: n, seriesByKey: r, state: i, showTotal
|
|
|
1979
1980
|
})
|
|
1980
1981
|
});
|
|
1981
1982
|
}
|
|
1982
|
-
function
|
|
1983
|
+
function qi(e, t) {
|
|
1983
1984
|
return t.find((t) => e === t.metric || e.startsWith(`${t.metric}_`));
|
|
1984
1985
|
}
|
|
1985
|
-
function
|
|
1986
|
+
function Ji(e, t) {
|
|
1986
1987
|
switch (t.representation) {
|
|
1987
1988
|
case "line": return /* @__PURE__ */ A(Rt, {
|
|
1988
1989
|
dataKey: e,
|
|
@@ -2003,15 +2004,15 @@ function qi(e, t) {
|
|
|
2003
2004
|
}
|
|
2004
2005
|
//#endregion
|
|
2005
2006
|
//#region src/dashboards/renderers/CartesianWidgetRenderer.tsx
|
|
2006
|
-
function
|
|
2007
|
-
let i =
|
|
2008
|
-
let t =
|
|
2007
|
+
function Yi({ widget: e, timeRange: t, filters: r }) {
|
|
2008
|
+
let i = xi(e.filters, r), a = n(), o = gi(t), s = E(() => Gi(o, 48), [o]), c = ae({ queries: e.series.map((e) => {
|
|
2009
|
+
let t = Y(i, e.filters), n = [{
|
|
2009
2010
|
name: e.metric,
|
|
2010
|
-
measures: [
|
|
2011
|
+
measures: [K(e.measure)],
|
|
2011
2012
|
...e.sorts?.length ? { sorts: [...e.sorts] } : {}
|
|
2012
2013
|
}], r = e.by?.length ? [...e.by] : void 0, c = e.ranges?.length ? [...e.ranges] : void 0;
|
|
2013
2014
|
return {
|
|
2014
|
-
queryKey:
|
|
2015
|
+
queryKey: J.timeSeries(n, o, s, t, r, e.limit, c),
|
|
2015
2016
|
queryFn: ({ signal: i }) => a.fetchTimeSeries({
|
|
2016
2017
|
metrics: n,
|
|
2017
2018
|
timeRange: o,
|
|
@@ -2022,25 +2023,25 @@ function Ji({ widget: e, timeRange: t, filters: r }) {
|
|
|
2022
2023
|
limit: e.limit,
|
|
2023
2024
|
signal: i
|
|
2024
2025
|
}),
|
|
2025
|
-
staleTime:
|
|
2026
|
+
staleTime: q
|
|
2026
2027
|
};
|
|
2027
2028
|
}) }), l = c.some((e) => e.isLoading), u = c.some((e) => e.isError);
|
|
2028
2029
|
T(() => {
|
|
2029
2030
|
u && console.error(`[CartesianWidgetRenderer] One or more series queries failed for widget "${e.title}"`);
|
|
2030
2031
|
}, [u, e.title]);
|
|
2031
2032
|
let d = c.map((e) => e.dataUpdatedAt).join(","), { data: f, config: p, seriesByKey: m } = E(() => {
|
|
2032
|
-
let { elements: t, seriesMap: n } =
|
|
2033
|
+
let { elements: t, seriesMap: n } = Li(e.series, c.map((e) => e?.data)), r = {}, i = {};
|
|
2033
2034
|
for (let e of t) {
|
|
2034
2035
|
let t = { label: e.label };
|
|
2035
2036
|
e.color && (t.color = e.color), r[e.dataKey] = t, i[e.dataKey] = e.series;
|
|
2036
2037
|
}
|
|
2037
2038
|
return {
|
|
2038
|
-
data:
|
|
2039
|
+
data: Ri(n),
|
|
2039
2040
|
config: r,
|
|
2040
2041
|
seriesByKey: i
|
|
2041
2042
|
};
|
|
2042
2043
|
}, [e.series, d]), h = l ? "loading" : u ? "empty" : "ready";
|
|
2043
|
-
return /* @__PURE__ */ A(
|
|
2044
|
+
return /* @__PURE__ */ A(Ki, {
|
|
2044
2045
|
data: f,
|
|
2045
2046
|
config: p,
|
|
2046
2047
|
series: [...e.series],
|
|
@@ -2052,10 +2053,10 @@ function Ji({ widget: e, timeRange: t, filters: r }) {
|
|
|
2052
2053
|
}
|
|
2053
2054
|
//#endregion
|
|
2054
2055
|
//#region src/dashboards/renderers/DoughnutPresentation.tsx
|
|
2055
|
-
function
|
|
2056
|
+
function Xi({ data: e, config: t, state: n, showShare: r = !0, valueFormatter: i }) {
|
|
2056
2057
|
let a = E(() => {
|
|
2057
2058
|
if (i) return i;
|
|
2058
|
-
if (r) return Ti(
|
|
2059
|
+
if (r) return Ei(Ti(e.map((e) => e.value)));
|
|
2059
2060
|
}, [
|
|
2060
2061
|
e,
|
|
2061
2062
|
r,
|
|
@@ -2073,8 +2074,8 @@ function Yi({ data: e, config: t, state: n, showShare: r = !0, valueFormatter: i
|
|
|
2073
2074
|
}
|
|
2074
2075
|
//#endregion
|
|
2075
2076
|
//#region src/dashboards/renderers/DoughnutWidgetRenderer.tsx
|
|
2076
|
-
function
|
|
2077
|
-
let r =
|
|
2077
|
+
function Zi({ widget: e, timeRange: t, filters: n }) {
|
|
2078
|
+
let r = xi(e.filters, n), i = gi(t), { data: a, isLoading: o, isError: s } = Sn({
|
|
2078
2079
|
by: [...e.by],
|
|
2079
2080
|
metric: e.metric,
|
|
2080
2081
|
measure: e.measure,
|
|
@@ -2092,14 +2093,14 @@ function Xi({ widget: e, timeRange: t, filters: n }) {
|
|
|
2092
2093
|
data: [],
|
|
2093
2094
|
config: {}
|
|
2094
2095
|
};
|
|
2095
|
-
let e =
|
|
2096
|
+
let e = yi(a), t = {};
|
|
2096
2097
|
for (let e of a) t[e.value] = { label: e.label || e.value };
|
|
2097
2098
|
return {
|
|
2098
2099
|
data: e,
|
|
2099
2100
|
config: t
|
|
2100
2101
|
};
|
|
2101
2102
|
}, [a]);
|
|
2102
|
-
return /* @__PURE__ */ A(
|
|
2103
|
+
return /* @__PURE__ */ A(Xi, {
|
|
2103
2104
|
data: c,
|
|
2104
2105
|
config: l,
|
|
2105
2106
|
state: o ? "loading" : s ? "empty" : "ready"
|
|
@@ -2107,18 +2108,18 @@ function Xi({ widget: e, timeRange: t, filters: n }) {
|
|
|
2107
2108
|
}
|
|
2108
2109
|
//#endregion
|
|
2109
2110
|
//#region src/dashboards/adapters/measures-adapter.ts
|
|
2110
|
-
function
|
|
2111
|
+
function Qi(e, t) {
|
|
2111
2112
|
if (e.measures.length !== 0) return t ? e.measures.find((e) => e.name === t)?.value : e.measures[0].value;
|
|
2112
2113
|
}
|
|
2113
|
-
function
|
|
2114
|
-
let n =
|
|
2114
|
+
function $i(e, t) {
|
|
2115
|
+
let n = Qi(e, t);
|
|
2115
2116
|
return {
|
|
2116
|
-
value: n === void 0 ? "—" :
|
|
2117
|
+
value: n === void 0 ? "—" : aa(n, e.unit),
|
|
2117
2118
|
label: e.name,
|
|
2118
2119
|
unit: e.unit
|
|
2119
2120
|
};
|
|
2120
2121
|
}
|
|
2121
|
-
function
|
|
2122
|
+
function ea(e, t) {
|
|
2122
2123
|
if (t === void 0) return;
|
|
2123
2124
|
if (t === 0) return {
|
|
2124
2125
|
value: 0,
|
|
@@ -2133,17 +2134,17 @@ function $i(e, t) {
|
|
|
2133
2134
|
direction: n > 0 ? "up" : "down"
|
|
2134
2135
|
};
|
|
2135
2136
|
}
|
|
2136
|
-
function
|
|
2137
|
+
function ta(e, t) {
|
|
2137
2138
|
if (!e || e.length === 0) return;
|
|
2138
2139
|
let n = t ? e.find((e) => e.key === t) : e[0];
|
|
2139
2140
|
if (!(!n || n.points.length < 2)) return n.points.slice().sort((e, t) => e.timestamp - t.timestamp).map((e) => e.value);
|
|
2140
2141
|
}
|
|
2141
|
-
var
|
|
2142
|
+
var na = new Set([
|
|
2142
2143
|
"B",
|
|
2143
2144
|
"KB",
|
|
2144
2145
|
"MB",
|
|
2145
2146
|
"GB"
|
|
2146
|
-
]),
|
|
2147
|
+
]), ra = {
|
|
2147
2148
|
PERCENT: { suffix: "%" },
|
|
2148
2149
|
MILLISECONDS: { suffix: "ms" },
|
|
2149
2150
|
SECONDS: { suffix: "s" },
|
|
@@ -2153,17 +2154,17 @@ var ta = new Set([
|
|
|
2153
2154
|
GIGABYTES: { suffix: "GB" },
|
|
2154
2155
|
COUNT: { suffix: "" },
|
|
2155
2156
|
COUNT_PER_SECOND: { suffix: "/s" }
|
|
2156
|
-
},
|
|
2157
|
-
function
|
|
2158
|
-
let n = t ?
|
|
2159
|
-
if (t && !n && !
|
|
2157
|
+
}, ia = /* @__PURE__ */ new Set();
|
|
2158
|
+
function aa(e, t) {
|
|
2159
|
+
let n = t ? ra[t] : void 0;
|
|
2160
|
+
if (t && !n && !ia.has(t) && (ia.add(t), console.warn(`[formatMeasureValue] Unknown unit "${t}" — value will be displayed without unit`)), n?.suffix === "%") return `${(Math.round(e * 10) / 10).toLocaleString()}%`;
|
|
2160
2161
|
if (n?.suffix === "ms" && e >= 1e3) return `${(e / 1e3).toFixed(2)} s`;
|
|
2161
|
-
let r = n !== void 0 &&
|
|
2162
|
+
let r = n !== void 0 && na.has(n.suffix) ? e.toLocaleString() : e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}k` : e.toLocaleString(), i = n?.suffix;
|
|
2162
2163
|
return i ? `${r}${i === "" ? "" : ` ${i}`}` : r;
|
|
2163
2164
|
}
|
|
2164
2165
|
//#endregion
|
|
2165
2166
|
//#region src/dashboards/compute-previous-time-range.ts
|
|
2166
|
-
function
|
|
2167
|
+
function oa(e) {
|
|
2167
2168
|
let t = e.to - e.from;
|
|
2168
2169
|
return {
|
|
2169
2170
|
type: "absolute",
|
|
@@ -2173,7 +2174,7 @@ function aa(e) {
|
|
|
2173
2174
|
}
|
|
2174
2175
|
//#endregion
|
|
2175
2176
|
//#region src/dashboards/renderers/MetricGroupPresentation.tsx
|
|
2176
|
-
function
|
|
2177
|
+
function sa({ items: e, state: t, skeletonCount: n }) {
|
|
2177
2178
|
return /* @__PURE__ */ A(Bt, {
|
|
2178
2179
|
items: e,
|
|
2179
2180
|
state: t,
|
|
@@ -2182,14 +2183,14 @@ function oa({ items: e, state: t, skeletonCount: n }) {
|
|
|
2182
2183
|
}
|
|
2183
2184
|
//#endregion
|
|
2184
2185
|
//#region src/dashboards/renderers/MetricGroupWidgetRenderer.tsx
|
|
2185
|
-
function
|
|
2186
|
+
function ca(e) {
|
|
2186
2187
|
let t = e.filters?.length ? e.filters.map((e) => `${e.field}:${e.operator}:${e.value.join(",")}`).sort().join("|") : "";
|
|
2187
2188
|
return `${e.name}::${t}`;
|
|
2188
2189
|
}
|
|
2189
|
-
function
|
|
2190
|
+
function la(e) {
|
|
2190
2191
|
let t = /* @__PURE__ */ new Map();
|
|
2191
2192
|
for (let n of e) {
|
|
2192
|
-
let e =
|
|
2193
|
+
let e = ca(n), r = t.get(e), i = n.measures ?? [];
|
|
2193
2194
|
if (r) for (let e of i) r.measures.add(e);
|
|
2194
2195
|
else t.set(e, {
|
|
2195
2196
|
name: n.name,
|
|
@@ -2203,15 +2204,15 @@ function ca(e) {
|
|
|
2203
2204
|
...n?.length ? { filters: n } : {}
|
|
2204
2205
|
}));
|
|
2205
2206
|
}
|
|
2206
|
-
function
|
|
2207
|
+
function ua(e) {
|
|
2207
2208
|
return {
|
|
2208
2209
|
name: e.metric,
|
|
2209
|
-
measures: [
|
|
2210
|
+
measures: [K(e.measure)],
|
|
2210
2211
|
...e.filters?.length ? { filters: [...e.filters] } : {}
|
|
2211
2212
|
};
|
|
2212
2213
|
}
|
|
2213
|
-
function
|
|
2214
|
-
let r =
|
|
2214
|
+
function da({ widget: e, timeRange: t, filters: n }) {
|
|
2215
|
+
let r = xi(e.filters, n), i = e.items.some((e) => e.showTrend !== !1), a = gi(t), o = E(() => la(e.items.map(ua)), [e.items]), s = E(() => la(e.items.filter((e) => e.showTrend !== !1).map(ua)), [e.items]), c = E(() => oa(a), [a]), { data: l, isLoading: u, isError: d } = On({
|
|
2215
2216
|
metrics: o,
|
|
2216
2217
|
timeRange: a,
|
|
2217
2218
|
filters: r
|
|
@@ -2225,7 +2226,7 @@ function ua({ widget: e, timeRange: t, filters: n }) {
|
|
|
2225
2226
|
d && console.error(`[MetricGroupWidgetRenderer] Failed to fetch measures for "${e.title}"`);
|
|
2226
2227
|
}, [d, e.title]), T(() => {
|
|
2227
2228
|
p && console.error(`[MetricGroupWidgetRenderer] Failed to fetch previous-period measures for "${e.title}"`);
|
|
2228
|
-
}, [p, e.title]), /* @__PURE__ */ A(
|
|
2229
|
+
}, [p, e.title]), /* @__PURE__ */ A(sa, {
|
|
2229
2230
|
items: E(() => {
|
|
2230
2231
|
let t = new Map(l?.map((e) => [e.name, e]) ?? []), n = new Map(f?.map((e) => [e.name, e]) ?? []);
|
|
2231
2232
|
return e.items.map((e) => {
|
|
@@ -2234,11 +2235,11 @@ function ua({ widget: e, timeRange: t, filters: n }) {
|
|
|
2234
2235
|
value: "—",
|
|
2235
2236
|
label: e.label ?? e.metric
|
|
2236
2237
|
};
|
|
2237
|
-
let i =
|
|
2238
|
+
let i = K(e.measure), a = $i(r, i), o = e.showTrend !== !1, s = Qi(r, i), c = n.get(e.metric), l = c ? Qi(c, i) : void 0;
|
|
2238
2239
|
return {
|
|
2239
2240
|
value: a.value,
|
|
2240
2241
|
label: e.label ?? r.name,
|
|
2241
|
-
trend: o && s !== void 0 ?
|
|
2242
|
+
trend: o && s !== void 0 ? ea(s, l) : void 0,
|
|
2242
2243
|
trendSentiment: e.sentiment
|
|
2243
2244
|
};
|
|
2244
2245
|
});
|
|
@@ -2253,7 +2254,7 @@ function ua({ widget: e, timeRange: t, filters: n }) {
|
|
|
2253
2254
|
}
|
|
2254
2255
|
//#endregion
|
|
2255
2256
|
//#region src/dashboards/renderers/MetricPresentation.tsx
|
|
2256
|
-
function
|
|
2257
|
+
function fa({ value: e, label: t, state: n, trend: r, trendSentiment: i, sparklineData: a }) {
|
|
2257
2258
|
return /* @__PURE__ */ A(zt, {
|
|
2258
2259
|
value: e,
|
|
2259
2260
|
label: t,
|
|
@@ -2265,11 +2266,11 @@ function da({ value: e, label: t, state: n, trend: r, trendSentiment: i, sparkli
|
|
|
2265
2266
|
}
|
|
2266
2267
|
//#endregion
|
|
2267
2268
|
//#region src/dashboards/renderers/MetricWidgetRenderer.tsx
|
|
2268
|
-
function
|
|
2269
|
-
let r =
|
|
2269
|
+
function pa({ widget: e, timeRange: t, filters: n }) {
|
|
2270
|
+
let r = xi(e.filters, n), i = e.showTrend === !0, a = e.showSparkline === !0, o = gi(t), s = K(e.measure), c = E(() => [{
|
|
2270
2271
|
name: e.metric,
|
|
2271
2272
|
measures: [s]
|
|
2272
|
-
}], [e.metric, s]), l = E(() =>
|
|
2273
|
+
}], [e.metric, s]), l = E(() => oa(o), [o]), u = E(() => Gi(o, 48), [o]), { data: d, isLoading: f, isError: p } = On({
|
|
2273
2274
|
metrics: c,
|
|
2274
2275
|
timeRange: o,
|
|
2275
2276
|
filters: r
|
|
@@ -2292,8 +2293,8 @@ function fa({ widget: e, timeRange: t, filters: n }) {
|
|
|
2292
2293
|
}, [h, e.metric]), T(() => {
|
|
2293
2294
|
_ && console.error(`[MetricWidgetRenderer] Failed to fetch sparkline data for "${e.metric}"`);
|
|
2294
2295
|
}, [_, e.metric]);
|
|
2295
|
-
let v = d?.[0], y = m?.[0], b = v ?
|
|
2296
|
-
return /* @__PURE__ */ A(
|
|
2296
|
+
let v = d?.[0], y = m?.[0], b = v ? $i(v, s) : void 0, x = v ? Qi(v, s) : void 0, S = y ? Qi(y, s) : void 0, ee = i && x !== void 0 ? ea(x, S) : void 0, te = a ? ta(g, e.metric) : void 0, ne = f ? "loading" : p || !f && !v ? "empty" : "ready";
|
|
2297
|
+
return /* @__PURE__ */ A(fa, {
|
|
2297
2298
|
value: b?.value ?? "—",
|
|
2298
2299
|
label: e.title,
|
|
2299
2300
|
state: ne,
|
|
@@ -2304,25 +2305,25 @@ function fa({ widget: e, timeRange: t, filters: n }) {
|
|
|
2304
2305
|
}
|
|
2305
2306
|
//#endregion
|
|
2306
2307
|
//#region src/dashboards/widget-renderer-registry.ts
|
|
2307
|
-
var
|
|
2308
|
-
function
|
|
2309
|
-
|
|
2308
|
+
var ma = /* @__PURE__ */ new Map();
|
|
2309
|
+
function ha(e, t) {
|
|
2310
|
+
ma.set(e, t);
|
|
2310
2311
|
}
|
|
2311
|
-
function
|
|
2312
|
-
return
|
|
2312
|
+
function ga(e) {
|
|
2313
|
+
return ma.get(e);
|
|
2313
2314
|
}
|
|
2314
|
-
function
|
|
2315
|
-
|
|
2315
|
+
function _a() {
|
|
2316
|
+
ma.clear();
|
|
2316
2317
|
}
|
|
2317
2318
|
//#endregion
|
|
2318
2319
|
//#region src/dashboards/register-default-renderers.ts
|
|
2319
|
-
var
|
|
2320
|
-
function
|
|
2321
|
-
|
|
2320
|
+
var va = !1;
|
|
2321
|
+
function ya() {
|
|
2322
|
+
va || (va = !0, ha("cartesian", Yi), ha("doughnut", Zi), ha("bar", Mi), ha("metric", pa), ha("metric-group", da));
|
|
2322
2323
|
}
|
|
2323
2324
|
//#endregion
|
|
2324
2325
|
//#region src/dashboards/renderers/UnknownWidgetFallback.tsx
|
|
2325
|
-
function
|
|
2326
|
+
function ba({ widget: e }) {
|
|
2326
2327
|
return /* @__PURE__ */ j("div", {
|
|
2327
2328
|
role: "alert",
|
|
2328
2329
|
className: "flex h-full flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-destructive/30 bg-destructive/5 p-4 text-center",
|
|
@@ -2341,28 +2342,28 @@ function ya({ widget: e }) {
|
|
|
2341
2342
|
}
|
|
2342
2343
|
//#endregion
|
|
2343
2344
|
//#region src/dashboards/WidgetItem.tsx
|
|
2344
|
-
|
|
2345
|
-
function
|
|
2346
|
-
return e.data ?
|
|
2345
|
+
ya();
|
|
2346
|
+
function xa(e) {
|
|
2347
|
+
return e.data ? Ca(e.widget, e.data) : /* @__PURE__ */ A(Sa, {
|
|
2347
2348
|
widget: e.widget,
|
|
2348
2349
|
timeRange: e.timeRange,
|
|
2349
2350
|
filters: e.filters
|
|
2350
2351
|
});
|
|
2351
2352
|
}
|
|
2352
|
-
function
|
|
2353
|
+
function Sa({ widget: e, timeRange: t, filters: n }) {
|
|
2353
2354
|
let r = fi(), i = t ?? r?.timeRange, a = n ?? r?.filters ?? li;
|
|
2354
2355
|
if (!i) throw Error("[gamma-lib-observability] <WidgetItem> requires a timeRange. Provide it as a prop or wrap the component in a <WidgetGroup>.");
|
|
2355
|
-
let o =
|
|
2356
|
+
let o = ga(e.type);
|
|
2356
2357
|
return o ? ee(o, {
|
|
2357
2358
|
widget: e,
|
|
2358
2359
|
timeRange: i,
|
|
2359
2360
|
filters: a
|
|
2360
|
-
}) : /* @__PURE__ */ A(
|
|
2361
|
+
}) : /* @__PURE__ */ A(ba, { widget: e });
|
|
2361
2362
|
}
|
|
2362
|
-
function
|
|
2363
|
+
function Ca(e, t) {
|
|
2363
2364
|
if (t.type !== e.type) throw Error(`[gamma-lib-observability] <WidgetItem> data.type "${t.type}" does not match widget.type "${e.type}". The data.type must match the widget definition type.`);
|
|
2364
2365
|
switch (t.type) {
|
|
2365
|
-
case "metric": return /* @__PURE__ */ A(
|
|
2366
|
+
case "metric": return /* @__PURE__ */ A(fa, {
|
|
2366
2367
|
value: t.value,
|
|
2367
2368
|
label: t.label,
|
|
2368
2369
|
state: t.state,
|
|
@@ -2370,12 +2371,12 @@ function Sa(e, t) {
|
|
|
2370
2371
|
trendSentiment: t.trendSentiment,
|
|
2371
2372
|
sparklineData: t.sparklineData
|
|
2372
2373
|
});
|
|
2373
|
-
case "metric-group": return /* @__PURE__ */ A(
|
|
2374
|
+
case "metric-group": return /* @__PURE__ */ A(sa, {
|
|
2374
2375
|
items: t.items,
|
|
2375
2376
|
state: t.state,
|
|
2376
2377
|
skeletonCount: t.skeletonCount
|
|
2377
2378
|
});
|
|
2378
|
-
case "cartesian": return /* @__PURE__ */ A(
|
|
2379
|
+
case "cartesian": return /* @__PURE__ */ A(Ki, {
|
|
2379
2380
|
data: t.data,
|
|
2380
2381
|
config: t.config,
|
|
2381
2382
|
series: t.series,
|
|
@@ -2383,32 +2384,32 @@ function Sa(e, t) {
|
|
|
2383
2384
|
showTotal: t.showTotal,
|
|
2384
2385
|
totalLabel: t.totalLabel
|
|
2385
2386
|
});
|
|
2386
|
-
case "bar": return /* @__PURE__ */ A(
|
|
2387
|
+
case "bar": return /* @__PURE__ */ A(ji, {
|
|
2387
2388
|
data: t.data,
|
|
2388
2389
|
config: t.config,
|
|
2389
2390
|
state: t.state,
|
|
2390
2391
|
layout: t.layout,
|
|
2391
2392
|
showShare: t.showShare
|
|
2392
2393
|
});
|
|
2393
|
-
case "doughnut": return /* @__PURE__ */ A(
|
|
2394
|
+
case "doughnut": return /* @__PURE__ */ A(Xi, {
|
|
2394
2395
|
data: t.data,
|
|
2395
2396
|
config: t.config,
|
|
2396
2397
|
state: t.state,
|
|
2397
2398
|
showShare: t.showShare
|
|
2398
2399
|
});
|
|
2399
|
-
default: return /* @__PURE__ */ A(
|
|
2400
|
+
default: return /* @__PURE__ */ A(ba, { widget: e });
|
|
2400
2401
|
}
|
|
2401
2402
|
}
|
|
2402
2403
|
//#endregion
|
|
2403
2404
|
//#region src/dashboards/DashboardView.tsx
|
|
2404
|
-
var
|
|
2405
|
+
var wa = {
|
|
2405
2406
|
lg: 12,
|
|
2406
2407
|
md: 12,
|
|
2407
2408
|
sm: 12,
|
|
2408
2409
|
xs: 12,
|
|
2409
2410
|
xxs: 12
|
|
2410
2411
|
};
|
|
2411
|
-
function
|
|
2412
|
+
function Ta({ dashboard: t, timeRange: n, filters: r = li, editable: i = !1, rowHeight: a, breakpointCols: o = wa, onLayoutChange: s }) {
|
|
2412
2413
|
let c = e("observability.dashboards.write"), l = i && c, u = E(() => t.widgets.map((e) => ({
|
|
2413
2414
|
id: e.id,
|
|
2414
2415
|
x: e.layout.x,
|
|
@@ -2433,8 +2434,8 @@ function wa({ dashboard: t, timeRange: n, filters: r = li, editable: i = !1, row
|
|
|
2433
2434
|
return t ? /* @__PURE__ */ A(Et, {
|
|
2434
2435
|
title: t.title,
|
|
2435
2436
|
subtitle: t.description,
|
|
2436
|
-
noPadding:
|
|
2437
|
-
children: /* @__PURE__ */ A(
|
|
2437
|
+
noPadding: Ea(t),
|
|
2438
|
+
children: /* @__PURE__ */ A(xa, {
|
|
2438
2439
|
widget: t,
|
|
2439
2440
|
timeRange: n,
|
|
2440
2441
|
filters: r
|
|
@@ -2444,32 +2445,32 @@ function wa({ dashboard: t, timeRange: n, filters: r = li, editable: i = !1, row
|
|
|
2444
2445
|
})
|
|
2445
2446
|
});
|
|
2446
2447
|
}
|
|
2447
|
-
function
|
|
2448
|
+
function Ea(e) {
|
|
2448
2449
|
return e.type === "cartesian" || e.type === "doughnut" || e.type === "bar";
|
|
2449
2450
|
}
|
|
2450
2451
|
//#endregion
|
|
2451
2452
|
//#region src/dashboards/WidgetGroup.tsx
|
|
2452
|
-
var
|
|
2453
|
+
var Da = {
|
|
2453
2454
|
stretch: "items-stretch",
|
|
2454
2455
|
center: "items-center",
|
|
2455
2456
|
start: "items-start",
|
|
2456
2457
|
end: "items-end"
|
|
2457
2458
|
};
|
|
2458
|
-
function
|
|
2459
|
+
function Oa({ timeRange: e, filters: t = li, align: n = "stretch", children: r }) {
|
|
2459
2460
|
return /* @__PURE__ */ A(di, {
|
|
2460
2461
|
value: E(() => ({
|
|
2461
2462
|
timeRange: e,
|
|
2462
2463
|
filters: t
|
|
2463
2464
|
}), [e, t]),
|
|
2464
2465
|
children: /* @__PURE__ */ A("div", {
|
|
2465
|
-
className: `flex flex-wrap gap-4 ${
|
|
2466
|
+
className: `flex flex-wrap gap-4 ${Da[n]} *:min-w-48 *:flex-1`,
|
|
2466
2467
|
children: r
|
|
2467
2468
|
})
|
|
2468
2469
|
});
|
|
2469
2470
|
}
|
|
2470
2471
|
//#endregion
|
|
2471
2472
|
//#region src/dashboards/templates/dashboard-template.ts
|
|
2472
|
-
function
|
|
2473
|
+
function ka(e) {
|
|
2473
2474
|
if (!e.id) throw Error("[gamma-lib-observability] DashboardTemplate must have a non-empty id.");
|
|
2474
2475
|
if (!e.label) throw Error(`[gamma-lib-observability] DashboardTemplate "${e.id}" must have a non-empty label.`);
|
|
2475
2476
|
if (!e.dashboard) throw Error(`[gamma-lib-observability] DashboardTemplate "${e.id}" must define a dashboard or a factory function.`);
|
|
@@ -2481,58 +2482,58 @@ function Oa(e) {
|
|
|
2481
2482
|
dashboard: e.dashboard
|
|
2482
2483
|
};
|
|
2483
2484
|
}
|
|
2484
|
-
function
|
|
2485
|
+
function Aa(e, t) {
|
|
2485
2486
|
return typeof e.dashboard == "function" ? e.dashboard(t) : e.dashboard;
|
|
2486
2487
|
}
|
|
2487
|
-
function
|
|
2488
|
+
function ja(e, t) {
|
|
2488
2489
|
return e.filter((e) => e.requiredCapabilities?.length ? e.requiredCapabilities.every((e) => t[e]) : !0);
|
|
2489
2490
|
}
|
|
2490
2491
|
//#endregion
|
|
2491
2492
|
//#region src/dashboards/templates/DashboardTemplatesProvider.tsx
|
|
2492
|
-
var
|
|
2493
|
-
function
|
|
2493
|
+
var Ma = S(null);
|
|
2494
|
+
function Na({ templates: e, children: t }) {
|
|
2494
2495
|
let n = E(() => e, [e]);
|
|
2495
|
-
return /* @__PURE__ */ A(
|
|
2496
|
+
return /* @__PURE__ */ A(Ma.Provider, {
|
|
2496
2497
|
value: n,
|
|
2497
2498
|
children: t
|
|
2498
2499
|
});
|
|
2499
2500
|
}
|
|
2500
|
-
function
|
|
2501
|
-
let e = w(
|
|
2501
|
+
function Pa() {
|
|
2502
|
+
let e = w(Ma), t = a();
|
|
2502
2503
|
if (!e) throw Error("[gamma-lib-observability] useDashboardTemplates must be used within a <DashboardTemplatesProvider>. Wrap your component tree with <DashboardTemplatesProvider templates={[...]}>.");
|
|
2503
|
-
return E(() =>
|
|
2504
|
+
return E(() => ja(e, t), [e, t]);
|
|
2504
2505
|
}
|
|
2505
|
-
function
|
|
2506
|
-
return
|
|
2506
|
+
function Fa(e) {
|
|
2507
|
+
return Pa().find((t) => t.id === e);
|
|
2507
2508
|
}
|
|
2508
2509
|
//#endregion
|
|
2509
2510
|
//#region src/live/LiveIndicator.tsx
|
|
2510
|
-
function
|
|
2511
|
+
function Ia(e) {
|
|
2511
2512
|
return e < 6e4 ? `${Math.round(e / 1e3)}s` : `${Math.round(e / 6e4)}min`;
|
|
2512
2513
|
}
|
|
2513
|
-
function
|
|
2514
|
-
let n = ln(), [r, i] = O(!0), a = C(() => i((e) => !e), []), o = n?.isLive ?? r, s = n?.intervalMs ?? 6e4, c = n?.toggle ?? a, l = e ?? n?.isFetching ?? !1, u = o ? `Live — refreshing every ${
|
|
2515
|
-
return /* @__PURE__ */ j(
|
|
2514
|
+
function La({ isFetching: e, className: t }) {
|
|
2515
|
+
let n = ln(), [r, i] = O(!0), a = C(() => i((e) => !e), []), o = n?.isLive ?? r, s = n?.intervalMs ?? 6e4, c = n?.toggle ?? a, l = e ?? n?.isFetching ?? !1, u = o ? `Live — refreshing every ${Ia(s)}` : "Paused — click to resume";
|
|
2516
|
+
return /* @__PURE__ */ j(z, { children: [/* @__PURE__ */ A(H, {
|
|
2516
2517
|
asChild: !0,
|
|
2517
2518
|
children: /* @__PURE__ */ j("button", {
|
|
2518
2519
|
type: "button",
|
|
2519
2520
|
onClick: c,
|
|
2520
|
-
className:
|
|
2521
|
+
className: U("inline-flex cursor-pointer items-center gap-1.5 rounded-md border px-2.5 py-1 text-xs font-medium transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", o ? "border-success/30 bg-success/5 text-success hover:bg-success/10" : "border-border bg-muted text-muted-foreground hover:bg-accent", t),
|
|
2521
2522
|
"aria-label": u,
|
|
2522
2523
|
"aria-pressed": o,
|
|
2523
2524
|
children: [/* @__PURE__ */ j("span", {
|
|
2524
2525
|
className: "relative flex size-2",
|
|
2525
|
-
children: [o && /* @__PURE__ */ A("span", { className:
|
|
2526
|
+
children: [o && /* @__PURE__ */ A("span", { className: U("absolute inset-0 rounded-full bg-success", l ? "animate-ping" : "animate-pulse") }), /* @__PURE__ */ A("span", { className: U("relative inline-flex size-2 rounded-full", o ? "bg-success" : "bg-muted-foreground/50") })]
|
|
2526
2527
|
}), o ? "Live" : "Paused"]
|
|
2527
2528
|
})
|
|
2528
|
-
}), /* @__PURE__ */ A(
|
|
2529
|
+
}), /* @__PURE__ */ A(B, {
|
|
2529
2530
|
side: "bottom",
|
|
2530
2531
|
children: /* @__PURE__ */ A("p", { children: u })
|
|
2531
2532
|
})] });
|
|
2532
2533
|
}
|
|
2533
2534
|
//#endregion
|
|
2534
2535
|
//#region src/routing/use-observability-url-state.ts
|
|
2535
|
-
function
|
|
2536
|
+
function Ra() {
|
|
2536
2537
|
let [e, t] = Zt(), n = E(() => Jn(e.get("q"), e.get("v")), [e]), r = C((e, n) => {
|
|
2537
2538
|
let r = qn({
|
|
2538
2539
|
conditions: n,
|
|
@@ -2552,7 +2553,7 @@ function La() {
|
|
|
2552
2553
|
}
|
|
2553
2554
|
//#endregion
|
|
2554
2555
|
//#region src/logs/LogSeverityBadge.tsx
|
|
2555
|
-
var
|
|
2556
|
+
var za = {
|
|
2556
2557
|
trace: "outline",
|
|
2557
2558
|
debug: "secondary",
|
|
2558
2559
|
info: "highlight",
|
|
@@ -2560,19 +2561,19 @@ var Ra = {
|
|
|
2560
2561
|
error: "destructive",
|
|
2561
2562
|
fatal: "destructive"
|
|
2562
2563
|
};
|
|
2563
|
-
function
|
|
2564
|
-
return e in
|
|
2564
|
+
function Ba(e) {
|
|
2565
|
+
return e in za;
|
|
2565
2566
|
}
|
|
2566
|
-
function
|
|
2567
|
+
function Va({ level: e }) {
|
|
2567
2568
|
let t = e.toLowerCase();
|
|
2568
|
-
return /* @__PURE__ */ A(
|
|
2569
|
-
variant:
|
|
2569
|
+
return /* @__PURE__ */ A(I, {
|
|
2570
|
+
variant: Ba(t) ? za[t] : "secondary",
|
|
2570
2571
|
children: e.toUpperCase()
|
|
2571
2572
|
});
|
|
2572
2573
|
}
|
|
2573
2574
|
//#endregion
|
|
2574
2575
|
//#region src/logs/map-log-columns.tsx
|
|
2575
|
-
var
|
|
2576
|
+
var Ha = {
|
|
2576
2577
|
GET: "success",
|
|
2577
2578
|
POST: "default",
|
|
2578
2579
|
PUT: "warning",
|
|
@@ -2581,7 +2582,7 @@ var Va = {
|
|
|
2581
2582
|
HEAD: "secondary",
|
|
2582
2583
|
OPTIONS: "secondary"
|
|
2583
2584
|
};
|
|
2584
|
-
function
|
|
2585
|
+
function Ua(e) {
|
|
2585
2586
|
let t = typeof e == "number" ? new Date(e) : new Date(String(e));
|
|
2586
2587
|
return Number.isNaN(t.getTime()) ? String(e) : new Intl.DateTimeFormat("en-US", {
|
|
2587
2588
|
year: "numeric",
|
|
@@ -2594,19 +2595,19 @@ function Ha(e) {
|
|
|
2594
2595
|
hour12: !1
|
|
2595
2596
|
}).format(t);
|
|
2596
2597
|
}
|
|
2597
|
-
function
|
|
2598
|
+
function Wa(e) {
|
|
2598
2599
|
let t = typeof e == "number" ? e : Number(e);
|
|
2599
2600
|
return Number.isNaN(t) ? String(e) : t < 1e3 ? `${Math.round(t)}ms` : `${(t / 1e3).toFixed(2)}s`;
|
|
2600
2601
|
}
|
|
2601
|
-
var
|
|
2602
|
-
function
|
|
2602
|
+
var Ga = ["unknown"];
|
|
2603
|
+
function Ka(e, t) {
|
|
2603
2604
|
if (t.length === 0) return !1;
|
|
2604
2605
|
let n = String(e).trim().toLowerCase();
|
|
2605
2606
|
return t.some((e) => e.trim().toLowerCase() === n);
|
|
2606
2607
|
}
|
|
2607
|
-
function
|
|
2608
|
+
function qa(e, t, n, r) {
|
|
2608
2609
|
let i = e.href?.(t);
|
|
2609
|
-
return !i ||
|
|
2610
|
+
return !i || Ka(r, e.linkSentinels ?? Ga) ? n : /* @__PURE__ */ A("a", {
|
|
2610
2611
|
href: i,
|
|
2611
2612
|
target: "_blank",
|
|
2612
2613
|
rel: "noopener noreferrer",
|
|
@@ -2615,7 +2616,7 @@ function Ka(e, t, n, r) {
|
|
|
2615
2616
|
children: n
|
|
2616
2617
|
});
|
|
2617
2618
|
}
|
|
2618
|
-
function
|
|
2619
|
+
function Ja(e, t) {
|
|
2619
2620
|
if (e.render) return e.render(t);
|
|
2620
2621
|
let n = e.value(t);
|
|
2621
2622
|
if (n == null) return /* @__PURE__ */ A("span", {
|
|
@@ -2624,17 +2625,17 @@ function qa(e, t) {
|
|
|
2624
2625
|
});
|
|
2625
2626
|
let r;
|
|
2626
2627
|
switch (e.variant) {
|
|
2627
|
-
case "badge": return /* @__PURE__ */ A(
|
|
2628
|
+
case "badge": return /* @__PURE__ */ A(Va, { level: String(n) });
|
|
2628
2629
|
case "datetime":
|
|
2629
2630
|
r = /* @__PURE__ */ A("span", {
|
|
2630
2631
|
className: "font-mono text-xs",
|
|
2631
|
-
children:
|
|
2632
|
+
children: Ua(n)
|
|
2632
2633
|
});
|
|
2633
2634
|
break;
|
|
2634
2635
|
case "duration":
|
|
2635
2636
|
r = /* @__PURE__ */ A("span", {
|
|
2636
2637
|
className: "font-mono text-xs",
|
|
2637
|
-
children:
|
|
2638
|
+
children: Wa(n)
|
|
2638
2639
|
});
|
|
2639
2640
|
break;
|
|
2640
2641
|
case "status-code": {
|
|
@@ -2647,8 +2648,8 @@ function qa(e, t) {
|
|
|
2647
2648
|
}
|
|
2648
2649
|
case "http-method": {
|
|
2649
2650
|
let e = String(n).toUpperCase();
|
|
2650
|
-
r = /* @__PURE__ */ A(
|
|
2651
|
-
variant:
|
|
2651
|
+
r = /* @__PURE__ */ A(I, {
|
|
2652
|
+
variant: Ha[e] ?? "secondary",
|
|
2652
2653
|
children: e
|
|
2653
2654
|
});
|
|
2654
2655
|
break;
|
|
@@ -2658,26 +2659,26 @@ function qa(e, t) {
|
|
|
2658
2659
|
children: String(n)
|
|
2659
2660
|
});
|
|
2660
2661
|
}
|
|
2661
|
-
return
|
|
2662
|
+
return qa(e, t, r, n);
|
|
2662
2663
|
}
|
|
2663
|
-
function
|
|
2664
|
+
function Ya(e) {
|
|
2664
2665
|
return e.map((e) => ({
|
|
2665
2666
|
id: e.key,
|
|
2666
2667
|
accessorFn: (t) => e.value(t),
|
|
2667
2668
|
header: e.label,
|
|
2668
|
-
cell: ({ row: t }) =>
|
|
2669
|
+
cell: ({ row: t }) => Ja(e, t.original),
|
|
2669
2670
|
enableSorting: !1,
|
|
2670
2671
|
enableHiding: !0
|
|
2671
2672
|
}));
|
|
2672
2673
|
}
|
|
2673
|
-
function
|
|
2674
|
+
function Xa(e) {
|
|
2674
2675
|
let t = {};
|
|
2675
2676
|
for (let n of e) n.defaultVisible === !1 && (t[n.key] = !1);
|
|
2676
2677
|
return t;
|
|
2677
2678
|
}
|
|
2678
2679
|
//#endregion
|
|
2679
2680
|
//#region src/logs/LogTable.tsx
|
|
2680
|
-
function
|
|
2681
|
+
function Za(e, t) {
|
|
2681
2682
|
try {
|
|
2682
2683
|
let n = localStorage.getItem(e);
|
|
2683
2684
|
return n ? {
|
|
@@ -2688,23 +2689,23 @@ function Xa(e, t) {
|
|
|
2688
2689
|
return typeof console < "u" && console.warn("[LogTable] Failed to read column visibility:", e), t;
|
|
2689
2690
|
}
|
|
2690
2691
|
}
|
|
2691
|
-
function
|
|
2692
|
+
function Qa(e, t) {
|
|
2692
2693
|
try {
|
|
2693
2694
|
localStorage.setItem(e, JSON.stringify(t));
|
|
2694
2695
|
} catch (e) {
|
|
2695
2696
|
typeof console < "u" && console.warn("[LogTable] Failed to persist column visibility:", e);
|
|
2696
2697
|
}
|
|
2697
2698
|
}
|
|
2698
|
-
function
|
|
2699
|
+
function $a({ columns: e, data: t, loading: n, totalCount: r, page: i, pageSize: a, onPageChange: o, onPageSizeChange: s, pageSizeOptions: c = [
|
|
2699
2700
|
10,
|
|
2700
2701
|
25,
|
|
2701
2702
|
50,
|
|
2702
2703
|
100
|
|
2703
2704
|
], onRowClick: l, toolbar: u, getRowId: d, columnVisibilityStorageKey: f }) {
|
|
2704
|
-
let p = E(() =>
|
|
2705
|
+
let p = E(() => Ya(e), [e]), m = E(() => Xa(e), [e]), [h, g] = O(() => f ? Za(f, m) : m), _ = C((e) => {
|
|
2705
2706
|
g((t) => {
|
|
2706
2707
|
let n = typeof e == "function" ? e(t) : e;
|
|
2707
|
-
return f &&
|
|
2708
|
+
return f && Qa(f, n), n;
|
|
2708
2709
|
});
|
|
2709
2710
|
}, [f]), v = C((e) => {
|
|
2710
2711
|
if (!l) return;
|
|
@@ -2731,7 +2732,7 @@ function Qa({ columns: e, data: t, loading: n, totalCount: r, page: i, pageSize:
|
|
|
2731
2732
|
onClick: v,
|
|
2732
2733
|
onKeyDown: y,
|
|
2733
2734
|
className: l ? "[&_tbody_tr]:cursor-pointer" : void 0,
|
|
2734
|
-
children: /* @__PURE__ */ A(
|
|
2735
|
+
children: /* @__PURE__ */ A(be, {
|
|
2735
2736
|
columns: p,
|
|
2736
2737
|
data: t,
|
|
2737
2738
|
loading: n,
|
|
@@ -2746,15 +2747,15 @@ function Qa({ columns: e, data: t, loading: n, totalCount: r, page: i, pageSize:
|
|
|
2746
2747
|
state: { columnVisibility: h },
|
|
2747
2748
|
onColumnVisibilityChange: _
|
|
2748
2749
|
},
|
|
2749
|
-
emptyMessage: /* @__PURE__ */ A(
|
|
2750
|
-
/* @__PURE__ */ A(
|
|
2750
|
+
emptyMessage: /* @__PURE__ */ A(Se, { children: /* @__PURE__ */ j(we, { children: [
|
|
2751
|
+
/* @__PURE__ */ A(Te, {
|
|
2751
2752
|
variant: "icon",
|
|
2752
2753
|
children: /* @__PURE__ */ A(pt, {})
|
|
2753
2754
|
}),
|
|
2754
|
-
/* @__PURE__ */ A(
|
|
2755
|
-
/* @__PURE__ */ A(
|
|
2755
|
+
/* @__PURE__ */ A(Ee, { children: "No logs found" }),
|
|
2756
|
+
/* @__PURE__ */ A(Ce, { children: "Try adjusting your filters or time range to see log entries." })
|
|
2756
2757
|
] }) }),
|
|
2757
|
-
footer: r > 0 ? /* @__PURE__ */ A(
|
|
2758
|
+
footer: r > 0 ? /* @__PURE__ */ A(xe, {
|
|
2758
2759
|
page: i,
|
|
2759
2760
|
pageSize: a,
|
|
2760
2761
|
totalCount: r,
|
|
@@ -2767,7 +2768,7 @@ function Qa({ columns: e, data: t, loading: n, totalCount: r, page: i, pageSize:
|
|
|
2767
2768
|
}
|
|
2768
2769
|
//#endregion
|
|
2769
2770
|
//#region src/logs/analytics-filter-mapping.ts
|
|
2770
|
-
function
|
|
2771
|
+
function eo(e, t) {
|
|
2771
2772
|
if (!e?.length) return [];
|
|
2772
2773
|
if (!t) return e.slice();
|
|
2773
2774
|
let n = t.dropFields ? new Set(t.dropFields) : void 0, r = [];
|
|
@@ -2785,26 +2786,26 @@ function $a(e, t) {
|
|
|
2785
2786
|
}
|
|
2786
2787
|
//#endregion
|
|
2787
2788
|
//#region src/hooks/use-logs-histogram-query.ts
|
|
2788
|
-
var
|
|
2789
|
+
var to = 40, no = "HTTP_REQUESTS", ro = "COUNT", io = {
|
|
2789
2790
|
from: 100,
|
|
2790
2791
|
to: 399
|
|
2791
|
-
},
|
|
2792
|
+
}, ao = {
|
|
2792
2793
|
from: 400,
|
|
2793
2794
|
to: 499
|
|
2794
|
-
},
|
|
2795
|
+
}, oo = {
|
|
2795
2796
|
from: 500,
|
|
2796
2797
|
to: 599
|
|
2797
2798
|
};
|
|
2798
|
-
function
|
|
2799
|
-
let { timeRange: t, filters: n, enabled: r = !0, analyticsFilterMapping: i } = e, a = c(), o =
|
|
2800
|
-
name:
|
|
2801
|
-
measures: [
|
|
2799
|
+
function so(e) {
|
|
2800
|
+
let { timeRange: t, filters: n, enabled: r = !0, analyticsFilterMapping: i } = e, a = c(), o = eo(Y(X(), n), i), s = gi(t), l = E(() => Gi(s, to), [s]), u = E(() => [{
|
|
2801
|
+
name: no,
|
|
2802
|
+
measures: [ro]
|
|
2802
2803
|
}], []), d = E(() => ["HTTP_STATUS"], []), f = E(() => [
|
|
2803
|
-
ro,
|
|
2804
2804
|
io,
|
|
2805
|
-
ao
|
|
2805
|
+
ao,
|
|
2806
|
+
oo
|
|
2806
2807
|
], []), p = N({
|
|
2807
|
-
queryKey: [...
|
|
2808
|
+
queryKey: [...J.timeSeries(u, s, l, o, d), "histogram"],
|
|
2808
2809
|
queryFn: ({ signal: e }) => a.fetchTimeSeries({
|
|
2809
2810
|
metrics: u,
|
|
2810
2811
|
timeRange: s,
|
|
@@ -2814,8 +2815,8 @@ function oo(e) {
|
|
|
2814
2815
|
ranges: f,
|
|
2815
2816
|
signal: e
|
|
2816
2817
|
}),
|
|
2817
|
-
staleTime:
|
|
2818
|
-
placeholderData:
|
|
2818
|
+
staleTime: q,
|
|
2819
|
+
placeholderData: M,
|
|
2819
2820
|
enabled: r && a !== null
|
|
2820
2821
|
});
|
|
2821
2822
|
return {
|
|
@@ -2830,7 +2831,7 @@ function oo(e) {
|
|
|
2830
2831
|
}
|
|
2831
2832
|
//#endregion
|
|
2832
2833
|
//#region src/logs/LogsHistogram.tsx
|
|
2833
|
-
var
|
|
2834
|
+
var co = {
|
|
2834
2835
|
"100-399": {
|
|
2835
2836
|
label: "1xx–3xx",
|
|
2836
2837
|
color: "var(--success)"
|
|
@@ -2843,9 +2844,9 @@ var so = {
|
|
|
2843
2844
|
label: "5xx",
|
|
2844
2845
|
color: "var(--destructive)"
|
|
2845
2846
|
}
|
|
2846
|
-
},
|
|
2847
|
-
function
|
|
2848
|
-
let { data: t, isLoading: n, available: r } =
|
|
2847
|
+
}, lo = "100-399", uo = "400-499", fo = "500-599";
|
|
2848
|
+
function po(e) {
|
|
2849
|
+
let { data: t, isLoading: n, available: r } = so(e), i = E(() => mo(t), [t]);
|
|
2849
2850
|
if (!r) return null;
|
|
2850
2851
|
let a = !n && i.length === 0;
|
|
2851
2852
|
return /* @__PURE__ */ j("div", {
|
|
@@ -2855,7 +2856,7 @@ function fo(e) {
|
|
|
2855
2856
|
className: "mb-1 text-xs text-muted-foreground",
|
|
2856
2857
|
children: "Requests over time"
|
|
2857
2858
|
}), /* @__PURE__ */ A(jt, {
|
|
2858
|
-
config:
|
|
2859
|
+
config: co,
|
|
2859
2860
|
className: "h-[120px] w-full",
|
|
2860
2861
|
children: /* @__PURE__ */ j(At, {
|
|
2861
2862
|
data: i,
|
|
@@ -2865,15 +2866,15 @@ function fo(e) {
|
|
|
2865
2866
|
children: [
|
|
2866
2867
|
/* @__PURE__ */ A(Lt, { orientation: "horizontal" }),
|
|
2867
2868
|
/* @__PURE__ */ A(kt, {
|
|
2868
|
-
dataKey:
|
|
2869
|
+
dataKey: lo,
|
|
2869
2870
|
stackId: "volume"
|
|
2870
2871
|
}),
|
|
2871
2872
|
/* @__PURE__ */ A(kt, {
|
|
2872
|
-
dataKey:
|
|
2873
|
+
dataKey: uo,
|
|
2873
2874
|
stackId: "volume"
|
|
2874
2875
|
}),
|
|
2875
2876
|
/* @__PURE__ */ A(kt, {
|
|
2876
|
-
dataKey:
|
|
2877
|
+
dataKey: fo,
|
|
2877
2878
|
stackId: "volume"
|
|
2878
2879
|
}),
|
|
2879
2880
|
/* @__PURE__ */ A(Ut, {}),
|
|
@@ -2884,19 +2885,19 @@ function fo(e) {
|
|
|
2884
2885
|
})]
|
|
2885
2886
|
});
|
|
2886
2887
|
}
|
|
2887
|
-
function
|
|
2888
|
+
function mo(e) {
|
|
2888
2889
|
let t = /* @__PURE__ */ new Map();
|
|
2889
2890
|
for (let n of e) t.set(n.key, [n]);
|
|
2890
|
-
return
|
|
2891
|
+
return Ri(t);
|
|
2891
2892
|
}
|
|
2892
2893
|
//#endregion
|
|
2893
2894
|
//#region src/logs/LogsExplorerPage.tsx
|
|
2894
|
-
var
|
|
2895
|
-
function
|
|
2896
|
-
let { timeRange: c, filters: l, setTimeRange: u, setFilters: d } =
|
|
2895
|
+
var ho = 300, go = "observability-logs-columns";
|
|
2896
|
+
function _o({ columns: e, onRowClick: t, pageSize: n = 25, getRowId: r, scopeFilterField: i, columnVisibilityStorageKey: a = go, analyticsFilterMapping: o, onPageDataChange: s }) {
|
|
2897
|
+
let { timeRange: c, filters: l, setTimeRange: u, setFilters: d } = Ra(), f = kn(l, fn()), [p, m] = O(""), h = Dn({
|
|
2897
2898
|
timeRange: c,
|
|
2898
2899
|
filters: l,
|
|
2899
|
-
search: br(p,
|
|
2900
|
+
search: br(p, ho) || void 0,
|
|
2900
2901
|
pageSize: n
|
|
2901
2902
|
}), g = D(s);
|
|
2902
2903
|
T(() => {
|
|
@@ -2906,7 +2907,7 @@ function go({ columns: e, onRowClick: t, pageSize: n = 25, getRowId: r, scopeFil
|
|
|
2906
2907
|
}, [h.data]);
|
|
2907
2908
|
let _ = /* @__PURE__ */ j("div", {
|
|
2908
2909
|
className: "relative flex-1",
|
|
2909
|
-
children: [/* @__PURE__ */ A(xt, { className: "absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ A(
|
|
2910
|
+
children: [/* @__PURE__ */ A(xt, { className: "absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ A(Ae, {
|
|
2910
2911
|
type: "search",
|
|
2911
2912
|
placeholder: "Search logs…",
|
|
2912
2913
|
value: p,
|
|
@@ -2933,14 +2934,14 @@ function go({ columns: e, onRowClick: t, pageSize: n = 25, getRowId: r, scopeFil
|
|
|
2933
2934
|
scopeFilterField: i
|
|
2934
2935
|
})
|
|
2935
2936
|
}),
|
|
2936
|
-
/* @__PURE__ */ A(
|
|
2937
|
+
/* @__PURE__ */ A(V, { children: /* @__PURE__ */ A(La, { isFetching: h.isFetching }) }),
|
|
2937
2938
|
/* @__PURE__ */ A(rr, {
|
|
2938
2939
|
value: c,
|
|
2939
2940
|
onChange: u
|
|
2940
2941
|
})
|
|
2941
2942
|
]
|
|
2942
2943
|
}),
|
|
2943
|
-
/* @__PURE__ */ A(
|
|
2944
|
+
/* @__PURE__ */ A(po, {
|
|
2944
2945
|
timeRange: c,
|
|
2945
2946
|
filters: l,
|
|
2946
2947
|
analyticsFilterMapping: o
|
|
@@ -2953,7 +2954,7 @@ function go({ columns: e, onRowClick: t, pageSize: n = 25, getRowId: r, scopeFil
|
|
|
2953
2954
|
className: "flex-1 text-sm text-destructive",
|
|
2954
2955
|
children: h.error?.message ?? "Failed to load logs."
|
|
2955
2956
|
}),
|
|
2956
|
-
/* @__PURE__ */ j(
|
|
2957
|
+
/* @__PURE__ */ j(L, {
|
|
2957
2958
|
variant: "outline",
|
|
2958
2959
|
size: "sm",
|
|
2959
2960
|
onClick: h.refetch,
|
|
@@ -2961,7 +2962,7 @@ function go({ columns: e, onRowClick: t, pageSize: n = 25, getRowId: r, scopeFil
|
|
|
2961
2962
|
})
|
|
2962
2963
|
]
|
|
2963
2964
|
}),
|
|
2964
|
-
/* @__PURE__ */ A(
|
|
2965
|
+
/* @__PURE__ */ A($a, {
|
|
2965
2966
|
columns: e,
|
|
2966
2967
|
data: h.data,
|
|
2967
2968
|
loading: h.isLoading,
|
|
@@ -2980,7 +2981,7 @@ function go({ columns: e, onRowClick: t, pageSize: n = 25, getRowId: r, scopeFil
|
|
|
2980
2981
|
}
|
|
2981
2982
|
//#endregion
|
|
2982
2983
|
//#region src/logs/build-logs-deep-link.ts
|
|
2983
|
-
function
|
|
2984
|
+
function vo({ basePath: e, timeRange: t, filters: n = [] }) {
|
|
2984
2985
|
let r = qn({
|
|
2985
2986
|
conditions: n,
|
|
2986
2987
|
timeRange: t
|
|
@@ -2991,7 +2992,7 @@ function _o({ basePath: e, timeRange: t, filters: n = [] }) {
|
|
|
2991
2992
|
}
|
|
2992
2993
|
//#endregion
|
|
2993
2994
|
//#region src/logs/default-connection-log-columns.tsx
|
|
2994
|
-
var
|
|
2995
|
+
var yo = {
|
|
2995
2996
|
HTTP_PROXY: {
|
|
2996
2997
|
icon: gt,
|
|
2997
2998
|
label: "HTTP"
|
|
@@ -3013,8 +3014,8 @@ var vo = {
|
|
|
3013
3014
|
label: "Webhook"
|
|
3014
3015
|
}
|
|
3015
3016
|
};
|
|
3016
|
-
function
|
|
3017
|
-
let t =
|
|
3017
|
+
function bo(e) {
|
|
3018
|
+
let t = yo[e.apiType];
|
|
3018
3019
|
if (t) {
|
|
3019
3020
|
let e = t.icon;
|
|
3020
3021
|
return /* @__PURE__ */ j("span", {
|
|
@@ -3027,11 +3028,11 @@ function yo(e) {
|
|
|
3027
3028
|
children: [/* @__PURE__ */ A(ut, { className: "size-3.5" }), e.apiType]
|
|
3028
3029
|
});
|
|
3029
3030
|
}
|
|
3030
|
-
var
|
|
3031
|
-
function
|
|
3032
|
-
if (t.apiId) return `${e}/${n?.byApiType?.[t.apiType] ?? n?.defaultSegment ??
|
|
3031
|
+
var xo = "apis";
|
|
3032
|
+
function So(e, t, n) {
|
|
3033
|
+
if (t.apiId) return `${e}/${n?.byApiType?.[t.apiType] ?? n?.defaultSegment ?? xo}/${t.apiId}`;
|
|
3033
3034
|
}
|
|
3034
|
-
function
|
|
3035
|
+
function Co(e, t) {
|
|
3035
3036
|
let n = e.replace(/\/$/, ""), r = t?.apiLink, i = [
|
|
3036
3037
|
{
|
|
3037
3038
|
key: "timestamp",
|
|
@@ -3058,7 +3059,7 @@ function So(e, t) {
|
|
|
3058
3059
|
key: "apiName",
|
|
3059
3060
|
label: "API",
|
|
3060
3061
|
value: (e) => e.apiName,
|
|
3061
|
-
href: (e) =>
|
|
3062
|
+
href: (e) => So(n, e, r),
|
|
3062
3063
|
defaultVisible: !0
|
|
3063
3064
|
},
|
|
3064
3065
|
{
|
|
@@ -3092,7 +3093,7 @@ function So(e, t) {
|
|
|
3092
3093
|
key: "apiType",
|
|
3093
3094
|
label: "API Type",
|
|
3094
3095
|
value: (e) => e.apiType,
|
|
3095
|
-
render:
|
|
3096
|
+
render: bo,
|
|
3096
3097
|
defaultVisible: !1
|
|
3097
3098
|
},
|
|
3098
3099
|
{
|
|
@@ -3166,32 +3167,32 @@ function So(e, t) {
|
|
|
3166
3167
|
}
|
|
3167
3168
|
//#endregion
|
|
3168
3169
|
//#region src/logs/detail/components/LogDetailCodeBlock.tsx
|
|
3169
|
-
var
|
|
3170
|
-
function
|
|
3170
|
+
var wo = 240;
|
|
3171
|
+
function Z({ code: e, language: t = "json", maxHeight: n = wo }) {
|
|
3171
3172
|
let [r, i] = O(!1);
|
|
3172
3173
|
if (!e) return /* @__PURE__ */ A("p", {
|
|
3173
3174
|
className: "text-xs text-muted-foreground/70 py-3 italic",
|
|
3174
3175
|
children: "No body captured"
|
|
3175
3176
|
});
|
|
3176
|
-
let a =
|
|
3177
|
+
let a = To(e), o = a.split("\n").length > 12;
|
|
3177
3178
|
return /* @__PURE__ */ j("div", {
|
|
3178
3179
|
className: "relative rounded-lg border",
|
|
3179
3180
|
children: [
|
|
3180
3181
|
/* @__PURE__ */ A("div", {
|
|
3181
3182
|
className: "absolute right-2 top-2 z-10",
|
|
3182
|
-
children: /* @__PURE__ */ A(
|
|
3183
|
+
children: /* @__PURE__ */ A(V, { children: /* @__PURE__ */ j(z, { children: [/* @__PURE__ */ A(H, {
|
|
3183
3184
|
asChild: !0,
|
|
3184
|
-
children: /* @__PURE__ */ A(
|
|
3185
|
+
children: /* @__PURE__ */ A(L, {
|
|
3185
3186
|
variant: "ghost",
|
|
3186
3187
|
size: "icon",
|
|
3187
3188
|
className: "size-7",
|
|
3188
3189
|
onClick: () => {
|
|
3189
|
-
navigator.clipboard.writeText(a).then(() =>
|
|
3190
|
+
navigator.clipboard.writeText(a).then(() => W.success("Copied to clipboard"), () => W.error("Failed to copy to clipboard"));
|
|
3190
3191
|
},
|
|
3191
3192
|
"aria-label": "Copy body",
|
|
3192
3193
|
children: /* @__PURE__ */ A(dt, { className: "size-3.5" })
|
|
3193
3194
|
})
|
|
3194
|
-
}), /* @__PURE__ */ A(
|
|
3195
|
+
}), /* @__PURE__ */ A(B, { children: "Copy" })] }) })
|
|
3195
3196
|
}),
|
|
3196
3197
|
/* @__PURE__ */ A("pre", {
|
|
3197
3198
|
className: "overflow-auto p-4 text-[13px] font-mono leading-relaxed text-foreground/90",
|
|
@@ -3206,7 +3207,7 @@ function X({ code: e, language: t = "json", maxHeight: n = Co }) {
|
|
|
3206
3207
|
]
|
|
3207
3208
|
});
|
|
3208
3209
|
}
|
|
3209
|
-
function
|
|
3210
|
+
function To(e) {
|
|
3210
3211
|
try {
|
|
3211
3212
|
let t = JSON.parse(e);
|
|
3212
3213
|
return JSON.stringify(t, null, 2);
|
|
@@ -3216,7 +3217,7 @@ function wo(e) {
|
|
|
3216
3217
|
}
|
|
3217
3218
|
//#endregion
|
|
3218
3219
|
//#region src/logs/detail/components/LogDetailEmptyField.tsx
|
|
3219
|
-
function
|
|
3220
|
+
function Eo({ message: e = "Not captured" }) {
|
|
3220
3221
|
return /* @__PURE__ */ A("p", {
|
|
3221
3222
|
className: "text-xs italic text-muted-foreground py-2",
|
|
3222
3223
|
children: e
|
|
@@ -3225,7 +3226,7 @@ function Z({ message: e = "Not captured" }) {
|
|
|
3225
3226
|
//#endregion
|
|
3226
3227
|
//#region src/logs/detail/components/LogDetailHeadersTable.tsx
|
|
3227
3228
|
function Q({ headers: e }) {
|
|
3228
|
-
return !e || Object.keys(e).length === 0 ? /* @__PURE__ */ A(
|
|
3229
|
+
return !e || Object.keys(e).length === 0 ? /* @__PURE__ */ A(Eo, { message: "No headers captured" }) : /* @__PURE__ */ A("div", {
|
|
3229
3230
|
className: "rounded-lg border overflow-hidden",
|
|
3230
3231
|
children: /* @__PURE__ */ A("table", {
|
|
3231
3232
|
className: "w-full text-[13px]",
|
|
@@ -3247,12 +3248,12 @@ function Q({ headers: e }) {
|
|
|
3247
3248
|
}
|
|
3248
3249
|
//#endregion
|
|
3249
3250
|
//#region src/logs/detail/components/LogDetailJsonTree.tsx
|
|
3250
|
-
function
|
|
3251
|
+
function Do({ data: e, onCopyAll: t }) {
|
|
3251
3252
|
let n = D(null), r = () => {
|
|
3252
3253
|
let n = JSON.stringify(e, null, 2);
|
|
3253
3254
|
navigator.clipboard.writeText(n).then(() => {
|
|
3254
|
-
|
|
3255
|
-
}, () =>
|
|
3255
|
+
W.success("Full JSON copied to clipboard"), t?.();
|
|
3256
|
+
}, () => W.error("Failed to copy to clipboard"));
|
|
3256
3257
|
}, i = C((e) => {
|
|
3257
3258
|
let t = e.target, r = n.current?.querySelectorAll("[role=\"treeitem\"]");
|
|
3258
3259
|
if (!r) return;
|
|
@@ -3270,9 +3271,9 @@ function To({ data: e, onCopyAll: t }) {
|
|
|
3270
3271
|
className: "space-y-2",
|
|
3271
3272
|
children: [/* @__PURE__ */ A("div", {
|
|
3272
3273
|
className: "flex justify-end",
|
|
3273
|
-
children: /* @__PURE__ */ A(
|
|
3274
|
+
children: /* @__PURE__ */ A(V, { children: /* @__PURE__ */ j(z, { children: [/* @__PURE__ */ A(H, {
|
|
3274
3275
|
asChild: !0,
|
|
3275
|
-
children: /* @__PURE__ */ A(
|
|
3276
|
+
children: /* @__PURE__ */ A(L, {
|
|
3276
3277
|
variant: "ghost",
|
|
3277
3278
|
size: "icon",
|
|
3278
3279
|
className: "size-7",
|
|
@@ -3280,7 +3281,7 @@ function To({ data: e, onCopyAll: t }) {
|
|
|
3280
3281
|
"aria-label": "Copy JSON",
|
|
3281
3282
|
children: /* @__PURE__ */ A(dt, { className: "size-3.5" })
|
|
3282
3283
|
})
|
|
3283
|
-
}), /* @__PURE__ */ A(
|
|
3284
|
+
}), /* @__PURE__ */ A(B, { children: "Copy full JSON" })] }) })
|
|
3284
3285
|
}), /* @__PURE__ */ A("div", {
|
|
3285
3286
|
ref: n,
|
|
3286
3287
|
role: "tree",
|
|
@@ -3288,7 +3289,7 @@ function To({ data: e, onCopyAll: t }) {
|
|
|
3288
3289
|
"aria-label": "Log attributes",
|
|
3289
3290
|
className: "rounded-md border p-3 text-xs font-mono",
|
|
3290
3291
|
onKeyDown: i,
|
|
3291
|
-
children: /* @__PURE__ */ A(
|
|
3292
|
+
children: /* @__PURE__ */ A(Oo, {
|
|
3292
3293
|
value: e,
|
|
3293
3294
|
depth: 0,
|
|
3294
3295
|
isRoot: !0
|
|
@@ -3296,9 +3297,9 @@ function To({ data: e, onCopyAll: t }) {
|
|
|
3296
3297
|
})]
|
|
3297
3298
|
});
|
|
3298
3299
|
}
|
|
3299
|
-
function
|
|
3300
|
+
function Oo({ name: e, value: t, depth: n, isRoot: r, isLast: i }) {
|
|
3300
3301
|
let [a, o] = O(n < 2);
|
|
3301
|
-
if (t === null) return /* @__PURE__ */ A(
|
|
3302
|
+
if (t === null) return /* @__PURE__ */ A(ko, {
|
|
3302
3303
|
name: e,
|
|
3303
3304
|
value: "null",
|
|
3304
3305
|
className: "text-muted-foreground",
|
|
@@ -3371,7 +3372,7 @@ function Eo({ name: e, value: t, depth: n, isRoot: r, isLast: i }) {
|
|
|
3371
3372
|
a && /* @__PURE__ */ A("div", {
|
|
3372
3373
|
className: "ml-4 border-l border-muted pl-2",
|
|
3373
3374
|
role: "group",
|
|
3374
|
-
children: c.map(([e, t], r) => /* @__PURE__ */ A(
|
|
3375
|
+
children: c.map(([e, t], r) => /* @__PURE__ */ A(Oo, {
|
|
3375
3376
|
name: s ? void 0 : e,
|
|
3376
3377
|
value: t,
|
|
3377
3378
|
depth: n + 1,
|
|
@@ -3385,29 +3386,29 @@ function Eo({ name: e, value: t, depth: n, isRoot: r, isLast: i }) {
|
|
|
3385
3386
|
]
|
|
3386
3387
|
});
|
|
3387
3388
|
}
|
|
3388
|
-
return typeof t == "string" ? /* @__PURE__ */ A(
|
|
3389
|
+
return typeof t == "string" ? /* @__PURE__ */ A(ko, {
|
|
3389
3390
|
name: e,
|
|
3390
3391
|
value: `"${t}"`,
|
|
3391
3392
|
className: "text-green-600 dark:text-green-400",
|
|
3392
3393
|
isLast: i
|
|
3393
|
-
}) : typeof t == "number" ? /* @__PURE__ */ A(
|
|
3394
|
+
}) : typeof t == "number" ? /* @__PURE__ */ A(ko, {
|
|
3394
3395
|
name: e,
|
|
3395
3396
|
value: String(t),
|
|
3396
3397
|
className: "text-blue-600 dark:text-blue-400",
|
|
3397
3398
|
isLast: i
|
|
3398
|
-
}) : typeof t == "boolean" ? /* @__PURE__ */ A(
|
|
3399
|
+
}) : typeof t == "boolean" ? /* @__PURE__ */ A(ko, {
|
|
3399
3400
|
name: e,
|
|
3400
3401
|
value: String(t),
|
|
3401
3402
|
className: "text-amber-600 dark:text-amber-400",
|
|
3402
3403
|
isLast: i
|
|
3403
|
-
}) : /* @__PURE__ */ A(
|
|
3404
|
+
}) : /* @__PURE__ */ A(ko, {
|
|
3404
3405
|
name: e,
|
|
3405
3406
|
value: String(t),
|
|
3406
3407
|
className: "text-foreground",
|
|
3407
3408
|
isLast: i
|
|
3408
3409
|
});
|
|
3409
3410
|
}
|
|
3410
|
-
function
|
|
3411
|
+
function ko({ name: e, value: t, className: n, isLast: r }) {
|
|
3411
3412
|
return /* @__PURE__ */ j("div", {
|
|
3412
3413
|
className: "flex items-center py-px",
|
|
3413
3414
|
role: "treeitem",
|
|
@@ -3439,14 +3440,14 @@ function $({ items: e, onFilter: t, wrap: n = !1 }) {
|
|
|
3439
3440
|
let r = e.filter((e) => e.value !== void 0 && e.value !== null && e.value !== "");
|
|
3440
3441
|
return r.length === 0 ? null : /* @__PURE__ */ A("dl", {
|
|
3441
3442
|
className: "space-y-0 divide-y divide-border/50",
|
|
3442
|
-
children: r.map((e) => /* @__PURE__ */ A(
|
|
3443
|
+
children: r.map((e) => /* @__PURE__ */ A(Ao, {
|
|
3443
3444
|
item: e,
|
|
3444
3445
|
onFilter: t,
|
|
3445
3446
|
wrap: n
|
|
3446
3447
|
}, e.label))
|
|
3447
3448
|
});
|
|
3448
3449
|
}
|
|
3449
|
-
function
|
|
3450
|
+
function Ao({ item: e, onFilter: t, wrap: n }) {
|
|
3450
3451
|
let r = String(e.value), i = n ? "break-words whitespace-pre-wrap" : "truncate";
|
|
3451
3452
|
return /* @__PURE__ */ j("div", {
|
|
3452
3453
|
className: "group flex items-baseline gap-4 py-2.5",
|
|
@@ -3464,21 +3465,21 @@ function Oo({ item: e, onFilter: t, wrap: n }) {
|
|
|
3464
3465
|
children: r
|
|
3465
3466
|
}), /* @__PURE__ */ j("span", {
|
|
3466
3467
|
className: "flex shrink-0 items-center gap-0.5 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-150",
|
|
3467
|
-
children: [e.copyable !== !1 && /* @__PURE__ */ A(
|
|
3468
|
+
children: [e.copyable !== !1 && /* @__PURE__ */ A(V, { children: /* @__PURE__ */ j(z, { children: [/* @__PURE__ */ A(H, {
|
|
3468
3469
|
asChild: !0,
|
|
3469
|
-
children: /* @__PURE__ */ A(
|
|
3470
|
+
children: /* @__PURE__ */ A(L, {
|
|
3470
3471
|
variant: "ghost",
|
|
3471
3472
|
size: "icon",
|
|
3472
3473
|
className: "size-6",
|
|
3473
3474
|
onClick: () => {
|
|
3474
|
-
navigator.clipboard.writeText(r).then(() =>
|
|
3475
|
+
navigator.clipboard.writeText(r).then(() => W.success("Copied to clipboard"), () => W.error("Failed to copy to clipboard"));
|
|
3475
3476
|
},
|
|
3476
3477
|
"aria-label": "Copy value",
|
|
3477
3478
|
children: /* @__PURE__ */ A(dt, { className: "size-3" })
|
|
3478
3479
|
})
|
|
3479
|
-
}), /* @__PURE__ */ A(
|
|
3480
|
+
}), /* @__PURE__ */ A(B, { children: "Copy" })] }) }), e.filterable && e.filterField && t && /* @__PURE__ */ A(V, { children: /* @__PURE__ */ j(z, { children: [/* @__PURE__ */ A(H, {
|
|
3480
3481
|
asChild: !0,
|
|
3481
|
-
children: /* @__PURE__ */ A(
|
|
3482
|
+
children: /* @__PURE__ */ A(L, {
|
|
3482
3483
|
variant: "ghost",
|
|
3483
3484
|
size: "icon",
|
|
3484
3485
|
className: "size-6",
|
|
@@ -3488,14 +3489,14 @@ function Oo({ item: e, onFilter: t, wrap: n }) {
|
|
|
3488
3489
|
"aria-label": "Filter by this value",
|
|
3489
3490
|
children: /* @__PURE__ */ A(mt, { className: "size-3" })
|
|
3490
3491
|
})
|
|
3491
|
-
}), /* @__PURE__ */ A(
|
|
3492
|
+
}), /* @__PURE__ */ A(B, { children: "Filter" })] }) })]
|
|
3492
3493
|
})]
|
|
3493
3494
|
})]
|
|
3494
3495
|
});
|
|
3495
3496
|
}
|
|
3496
3497
|
//#endregion
|
|
3497
3498
|
//#region src/logs/detail/presets/connection-log-preset.tsx
|
|
3498
|
-
function
|
|
3499
|
+
function jo(e) {
|
|
3499
3500
|
return {
|
|
3500
3501
|
type: "preset",
|
|
3501
3502
|
resolve: (t) => {
|
|
@@ -3529,7 +3530,7 @@ function ko(e) {
|
|
|
3529
3530
|
key: "overview",
|
|
3530
3531
|
title: "Overview",
|
|
3531
3532
|
defaultOpen: !0,
|
|
3532
|
-
render: (t, r) => /* @__PURE__ */ A(
|
|
3533
|
+
render: (t, r) => /* @__PURE__ */ A(Mo, {
|
|
3533
3534
|
log: n,
|
|
3534
3535
|
basePath: e?.basePath,
|
|
3535
3536
|
extraFields: e?.extraFields,
|
|
@@ -3539,23 +3540,23 @@ function ko(e) {
|
|
|
3539
3540
|
key: "request",
|
|
3540
3541
|
title: "Request",
|
|
3541
3542
|
defaultOpen: !1,
|
|
3542
|
-
render: () => /* @__PURE__ */ A(
|
|
3543
|
+
render: () => /* @__PURE__ */ A(No, { log: n })
|
|
3543
3544
|
}), i.has("response") || a.push({
|
|
3544
3545
|
key: "response",
|
|
3545
3546
|
title: "Response",
|
|
3546
3547
|
defaultOpen: !1,
|
|
3547
|
-
render: () => /* @__PURE__ */ A(
|
|
3548
|
+
render: () => /* @__PURE__ */ A(Po, { log: n })
|
|
3548
3549
|
}), !i.has("errors") && (n.errorKey || n.warnings && n.warnings.length > 0) && a.push({
|
|
3549
3550
|
key: "errors",
|
|
3550
3551
|
title: "Issues",
|
|
3551
3552
|
defaultOpen: !0,
|
|
3552
3553
|
badge: () => (n.warnings?.length ?? 0) + +!!n.errorKey,
|
|
3553
|
-
render: () => /* @__PURE__ */ A(
|
|
3554
|
+
render: () => /* @__PURE__ */ A(Fo, { log: n })
|
|
3554
3555
|
}), i.has("raw") || a.push({
|
|
3555
3556
|
key: "raw",
|
|
3556
3557
|
title: "Raw JSON",
|
|
3557
3558
|
defaultOpen: !1,
|
|
3558
|
-
render: () => /* @__PURE__ */ A(
|
|
3559
|
+
render: () => /* @__PURE__ */ A(Do, { data: n })
|
|
3559
3560
|
}), {
|
|
3560
3561
|
header: {
|
|
3561
3562
|
method: () => n.method,
|
|
@@ -3569,7 +3570,7 @@ function ko(e) {
|
|
|
3569
3570
|
}
|
|
3570
3571
|
};
|
|
3571
3572
|
}
|
|
3572
|
-
function
|
|
3573
|
+
function Mo({ log: e, basePath: t, extraFields: n, onFilter: r }) {
|
|
3573
3574
|
let i = t?.replace(/\/$/, "") ?? "";
|
|
3574
3575
|
return /* @__PURE__ */ A($, {
|
|
3575
3576
|
items: [
|
|
@@ -3642,9 +3643,9 @@ function Ao({ log: e, basePath: t, extraFields: n, onFilter: r }) {
|
|
|
3642
3643
|
onFilter: r
|
|
3643
3644
|
});
|
|
3644
3645
|
}
|
|
3645
|
-
function
|
|
3646
|
+
function No({ log: e }) {
|
|
3646
3647
|
let t = e.entrypointRequest, n = e.endpointRequest;
|
|
3647
|
-
return !t && !n ? /* @__PURE__ */ A(
|
|
3648
|
+
return !t && !n ? /* @__PURE__ */ A(Eo, { message: "No request details captured" }) : /* @__PURE__ */ j("div", {
|
|
3648
3649
|
className: "space-y-4",
|
|
3649
3650
|
children: [t && /* @__PURE__ */ j("div", {
|
|
3650
3651
|
className: "space-y-2",
|
|
@@ -3661,7 +3662,7 @@ function jo({ log: e }) {
|
|
|
3661
3662
|
value: e.entrypointRequest.uri
|
|
3662
3663
|
}] : []] }),
|
|
3663
3664
|
/* @__PURE__ */ A(Q, { headers: e.entrypointRequest.headers }),
|
|
3664
|
-
/* @__PURE__ */ A(
|
|
3665
|
+
/* @__PURE__ */ A(Z, { code: e.entrypointRequest.body })
|
|
3665
3666
|
]
|
|
3666
3667
|
}), n && /* @__PURE__ */ j("div", {
|
|
3667
3668
|
className: "space-y-2",
|
|
@@ -3678,14 +3679,14 @@ function jo({ log: e }) {
|
|
|
3678
3679
|
value: e.endpointRequest.uri
|
|
3679
3680
|
}] : []] }),
|
|
3680
3681
|
/* @__PURE__ */ A(Q, { headers: e.endpointRequest.headers }),
|
|
3681
|
-
/* @__PURE__ */ A(
|
|
3682
|
+
/* @__PURE__ */ A(Z, { code: e.endpointRequest.body })
|
|
3682
3683
|
]
|
|
3683
3684
|
})]
|
|
3684
3685
|
});
|
|
3685
3686
|
}
|
|
3686
|
-
function
|
|
3687
|
+
function Po({ log: e }) {
|
|
3687
3688
|
let t = e.endpointResponse, n = e.entrypointResponse;
|
|
3688
|
-
return !t && !n ? /* @__PURE__ */ A(
|
|
3689
|
+
return !t && !n ? /* @__PURE__ */ A(Eo, { message: "No response details captured" }) : /* @__PURE__ */ j("div", {
|
|
3689
3690
|
className: "space-y-4",
|
|
3690
3691
|
children: [t && /* @__PURE__ */ j("div", {
|
|
3691
3692
|
className: "space-y-2",
|
|
@@ -3699,7 +3700,7 @@ function Mo({ log: e }) {
|
|
|
3699
3700
|
value: e.endpointResponse.status
|
|
3700
3701
|
}] }),
|
|
3701
3702
|
/* @__PURE__ */ A(Q, { headers: e.endpointResponse.headers }),
|
|
3702
|
-
/* @__PURE__ */ A(
|
|
3703
|
+
/* @__PURE__ */ A(Z, { code: e.endpointResponse.body })
|
|
3703
3704
|
]
|
|
3704
3705
|
}), n && /* @__PURE__ */ j("div", {
|
|
3705
3706
|
className: "space-y-2",
|
|
@@ -3713,12 +3714,12 @@ function Mo({ log: e }) {
|
|
|
3713
3714
|
value: e.entrypointResponse.status
|
|
3714
3715
|
}] }),
|
|
3715
3716
|
/* @__PURE__ */ A(Q, { headers: e.entrypointResponse.headers }),
|
|
3716
|
-
/* @__PURE__ */ A(
|
|
3717
|
+
/* @__PURE__ */ A(Z, { code: e.entrypointResponse.body })
|
|
3717
3718
|
]
|
|
3718
3719
|
})]
|
|
3719
3720
|
});
|
|
3720
3721
|
}
|
|
3721
|
-
function
|
|
3722
|
+
function Fo({ log: e }) {
|
|
3722
3723
|
return /* @__PURE__ */ j("div", {
|
|
3723
3724
|
className: "space-y-3",
|
|
3724
3725
|
children: [e.errorKey && /* @__PURE__ */ j("div", {
|
|
@@ -3768,9 +3769,9 @@ function No({ log: e }) {
|
|
|
3768
3769
|
}
|
|
3769
3770
|
//#endregion
|
|
3770
3771
|
//#region src/logs/detail/presets/message-log-preset.tsx
|
|
3771
|
-
var
|
|
3772
|
-
function
|
|
3773
|
-
let t = e?.messagesPageSize ??
|
|
3772
|
+
var Io = 5;
|
|
3773
|
+
function Lo(e) {
|
|
3774
|
+
let t = e?.messagesPageSize ?? Io;
|
|
3774
3775
|
return {
|
|
3775
3776
|
type: "preset",
|
|
3776
3777
|
resolve: (e) => {
|
|
@@ -3778,7 +3779,7 @@ function Fo(e) {
|
|
|
3778
3779
|
key: "overview",
|
|
3779
3780
|
title: "Overview",
|
|
3780
3781
|
defaultOpen: !0,
|
|
3781
|
-
render: (e, t) => /* @__PURE__ */ A(
|
|
3782
|
+
render: (e, t) => /* @__PURE__ */ A(Ro, {
|
|
3782
3783
|
log: n,
|
|
3783
3784
|
onFilter: t
|
|
3784
3785
|
})
|
|
@@ -3786,14 +3787,14 @@ function Fo(e) {
|
|
|
3786
3787
|
key: "connection",
|
|
3787
3788
|
title: "Connection Logs",
|
|
3788
3789
|
defaultOpen: !1,
|
|
3789
|
-
render: () => /* @__PURE__ */ A(
|
|
3790
|
+
render: () => /* @__PURE__ */ A(zo, { log: n })
|
|
3790
3791
|
}];
|
|
3791
3792
|
return n.messages && n.messages.length > 0 && r.push({
|
|
3792
3793
|
key: "messages",
|
|
3793
3794
|
title: "Messages",
|
|
3794
3795
|
defaultOpen: !0,
|
|
3795
3796
|
badge: () => n.messages?.length,
|
|
3796
|
-
render: () => /* @__PURE__ */ A(
|
|
3797
|
+
render: () => /* @__PURE__ */ A(Bo, {
|
|
3797
3798
|
messages: n.messages,
|
|
3798
3799
|
pageSize: t
|
|
3799
3800
|
})
|
|
@@ -3801,7 +3802,7 @@ function Fo(e) {
|
|
|
3801
3802
|
key: "raw",
|
|
3802
3803
|
title: "Raw JSON",
|
|
3803
3804
|
defaultOpen: !1,
|
|
3804
|
-
render: () => /* @__PURE__ */ A(
|
|
3805
|
+
render: () => /* @__PURE__ */ A(Do, { data: n })
|
|
3805
3806
|
}), {
|
|
3806
3807
|
header: {
|
|
3807
3808
|
method: () => void 0,
|
|
@@ -3815,7 +3816,7 @@ function Fo(e) {
|
|
|
3815
3816
|
}
|
|
3816
3817
|
};
|
|
3817
3818
|
}
|
|
3818
|
-
function
|
|
3819
|
+
function Ro({ log: e, onFilter: t }) {
|
|
3819
3820
|
return /* @__PURE__ */ A($, {
|
|
3820
3821
|
items: [
|
|
3821
3822
|
{
|
|
@@ -3860,7 +3861,7 @@ function Io({ log: e, onFilter: t }) {
|
|
|
3860
3861
|
onFilter: t
|
|
3861
3862
|
});
|
|
3862
3863
|
}
|
|
3863
|
-
function
|
|
3864
|
+
function zo({ log: e }) {
|
|
3864
3865
|
return e.entrypointRequest || e.endpointRequest || e.entrypointResponse || e.endpointResponse ? /* @__PURE__ */ j("div", {
|
|
3865
3866
|
className: "space-y-4",
|
|
3866
3867
|
children: [
|
|
@@ -3879,7 +3880,7 @@ function Lo({ log: e }) {
|
|
|
3879
3880
|
value: e.entrypointRequest.uri
|
|
3880
3881
|
}] : []] }),
|
|
3881
3882
|
/* @__PURE__ */ A(Q, { headers: e.entrypointRequest.headers }),
|
|
3882
|
-
/* @__PURE__ */ A(
|
|
3883
|
+
/* @__PURE__ */ A(Z, { code: e.entrypointRequest.body })
|
|
3883
3884
|
]
|
|
3884
3885
|
}),
|
|
3885
3886
|
e.endpointRequest && /* @__PURE__ */ j("div", {
|
|
@@ -3897,7 +3898,7 @@ function Lo({ log: e }) {
|
|
|
3897
3898
|
value: e.endpointRequest.uri
|
|
3898
3899
|
}] : []] }),
|
|
3899
3900
|
/* @__PURE__ */ A(Q, { headers: e.endpointRequest.headers }),
|
|
3900
|
-
/* @__PURE__ */ A(
|
|
3901
|
+
/* @__PURE__ */ A(Z, { code: e.endpointRequest.body })
|
|
3901
3902
|
]
|
|
3902
3903
|
}),
|
|
3903
3904
|
e.endpointResponse && /* @__PURE__ */ j("div", {
|
|
@@ -3912,7 +3913,7 @@ function Lo({ log: e }) {
|
|
|
3912
3913
|
value: e.endpointResponse.status
|
|
3913
3914
|
}]] }),
|
|
3914
3915
|
/* @__PURE__ */ A(Q, { headers: e.endpointResponse.headers }),
|
|
3915
|
-
/* @__PURE__ */ A(
|
|
3916
|
+
/* @__PURE__ */ A(Z, { code: e.endpointResponse.body })
|
|
3916
3917
|
]
|
|
3917
3918
|
}),
|
|
3918
3919
|
e.entrypointResponse && /* @__PURE__ */ j("div", {
|
|
@@ -3927,17 +3928,17 @@ function Lo({ log: e }) {
|
|
|
3927
3928
|
value: e.entrypointResponse.status
|
|
3928
3929
|
}]] }),
|
|
3929
3930
|
/* @__PURE__ */ A(Q, { headers: e.entrypointResponse.headers }),
|
|
3930
|
-
/* @__PURE__ */ A(
|
|
3931
|
+
/* @__PURE__ */ A(Z, { code: e.entrypointResponse.body })
|
|
3931
3932
|
]
|
|
3932
3933
|
})
|
|
3933
3934
|
]
|
|
3934
|
-
}) : /* @__PURE__ */ A(
|
|
3935
|
+
}) : /* @__PURE__ */ A(Eo, { message: "No connection log details captured" });
|
|
3935
3936
|
}
|
|
3936
|
-
function
|
|
3937
|
+
function Bo({ messages: e, pageSize: t }) {
|
|
3937
3938
|
let [n, r] = O(t), i = e.slice(0, n), a = n < e.length;
|
|
3938
3939
|
return /* @__PURE__ */ j("div", {
|
|
3939
3940
|
className: "space-y-3",
|
|
3940
|
-
children: [i.map((e, t) => /* @__PURE__ */ A(
|
|
3941
|
+
children: [i.map((e, t) => /* @__PURE__ */ A(Vo, { message: e }, e.id ?? t)), a && /* @__PURE__ */ j("button", {
|
|
3941
3942
|
onClick: () => r((e) => e + t),
|
|
3942
3943
|
className: "w-full rounded-md border py-2 text-xs text-muted-foreground hover:bg-muted/50 transition-colors",
|
|
3943
3944
|
children: [
|
|
@@ -3948,19 +3949,19 @@ function Ro({ messages: e, pageSize: t }) {
|
|
|
3948
3949
|
})]
|
|
3949
3950
|
});
|
|
3950
3951
|
}
|
|
3951
|
-
function
|
|
3952
|
+
function Vo({ message: e }) {
|
|
3952
3953
|
return /* @__PURE__ */ j("div", {
|
|
3953
3954
|
className: "rounded-md border p-3 space-y-2",
|
|
3954
3955
|
children: [
|
|
3955
3956
|
/* @__PURE__ */ j("div", {
|
|
3956
3957
|
className: "flex items-center gap-2 flex-wrap",
|
|
3957
3958
|
children: [
|
|
3958
|
-
/* @__PURE__ */ A(
|
|
3959
|
+
/* @__PURE__ */ A(I, {
|
|
3959
3960
|
variant: "secondary",
|
|
3960
3961
|
className: "text-[10px]",
|
|
3961
3962
|
children: new Date(e.timestamp).toLocaleTimeString()
|
|
3962
3963
|
}),
|
|
3963
|
-
/* @__PURE__ */ A(
|
|
3964
|
+
/* @__PURE__ */ A(I, {
|
|
3964
3965
|
variant: e.operation === "PUBLISH" ? "default" : "outline",
|
|
3965
3966
|
className: "text-[10px]",
|
|
3966
3967
|
children: e.operation
|
|
@@ -3976,7 +3977,7 @@ function zo({ message: e }) {
|
|
|
3976
3977
|
children: [/* @__PURE__ */ j("p", {
|
|
3977
3978
|
className: "text-[10px] uppercase tracking-wider text-muted-foreground",
|
|
3978
3979
|
children: ["Entrypoint", e.entrypoint.connectorId ? ` (${e.entrypoint.connectorId})` : ""]
|
|
3979
|
-
}), e.entrypoint.payload && /* @__PURE__ */ A(
|
|
3980
|
+
}), e.entrypoint.payload && /* @__PURE__ */ A(Z, {
|
|
3980
3981
|
code: e.entrypoint.payload,
|
|
3981
3982
|
maxHeight: 100
|
|
3982
3983
|
})]
|
|
@@ -3986,7 +3987,7 @@ function zo({ message: e }) {
|
|
|
3986
3987
|
children: [/* @__PURE__ */ j("p", {
|
|
3987
3988
|
className: "text-[10px] uppercase tracking-wider text-muted-foreground",
|
|
3988
3989
|
children: ["Endpoint", e.endpoint.connectorId ? ` (${e.endpoint.connectorId})` : ""]
|
|
3989
|
-
}), e.endpoint.payload && /* @__PURE__ */ A(
|
|
3990
|
+
}), e.endpoint.payload && /* @__PURE__ */ A(Z, {
|
|
3990
3991
|
code: e.endpoint.payload,
|
|
3991
3992
|
maxHeight: 100
|
|
3992
3993
|
})]
|
|
@@ -3996,7 +3997,7 @@ function zo({ message: e }) {
|
|
|
3996
3997
|
}
|
|
3997
3998
|
//#endregion
|
|
3998
3999
|
//#region src/logs/detail/presets/webhook-log-preset.tsx
|
|
3999
|
-
function
|
|
4000
|
+
function Ho(e) {
|
|
4000
4001
|
return {
|
|
4001
4002
|
type: "preset",
|
|
4002
4003
|
resolve: (t) => {
|
|
@@ -4021,7 +4022,7 @@ function Bo(e) {
|
|
|
4021
4022
|
key: "overview",
|
|
4022
4023
|
title: "Overview",
|
|
4023
4024
|
defaultOpen: !0,
|
|
4024
|
-
render: () => /* @__PURE__ */ A(
|
|
4025
|
+
render: () => /* @__PURE__ */ A(Uo, {
|
|
4025
4026
|
log: n,
|
|
4026
4027
|
basePath: e?.basePath
|
|
4027
4028
|
})
|
|
@@ -4031,22 +4032,22 @@ function Bo(e) {
|
|
|
4031
4032
|
title: "Delivery Attempts",
|
|
4032
4033
|
defaultOpen: !0,
|
|
4033
4034
|
badge: () => n.retryTimeline?.length,
|
|
4034
|
-
render: () => /* @__PURE__ */ A(
|
|
4035
|
+
render: () => /* @__PURE__ */ A(Wo, { attempts: n.retryTimeline })
|
|
4035
4036
|
}), i.push({
|
|
4036
4037
|
key: "request",
|
|
4037
4038
|
title: "Request Sent by Gateway",
|
|
4038
4039
|
defaultOpen: !1,
|
|
4039
|
-
render: () => /* @__PURE__ */ A(
|
|
4040
|
+
render: () => /* @__PURE__ */ A(Go, { log: n })
|
|
4040
4041
|
}), i.push({
|
|
4041
4042
|
key: "response",
|
|
4042
4043
|
title: "Response from Callback",
|
|
4043
4044
|
defaultOpen: !1,
|
|
4044
|
-
render: () => /* @__PURE__ */ A(
|
|
4045
|
+
render: () => /* @__PURE__ */ A(Ko, { log: n })
|
|
4045
4046
|
}), i.push({
|
|
4046
4047
|
key: "raw",
|
|
4047
4048
|
title: "Raw JSON",
|
|
4048
4049
|
defaultOpen: !1,
|
|
4049
|
-
render: () => /* @__PURE__ */ A(
|
|
4050
|
+
render: () => /* @__PURE__ */ A(Do, { data: n })
|
|
4050
4051
|
}), {
|
|
4051
4052
|
header: {
|
|
4052
4053
|
method: () => n.method,
|
|
@@ -4060,7 +4061,7 @@ function Bo(e) {
|
|
|
4060
4061
|
}
|
|
4061
4062
|
};
|
|
4062
4063
|
}
|
|
4063
|
-
function
|
|
4064
|
+
function Uo({ log: e, basePath: t }) {
|
|
4064
4065
|
let n = t?.replace(/\/$/, "") ?? "";
|
|
4065
4066
|
return /* @__PURE__ */ A($, { items: [
|
|
4066
4067
|
{
|
|
@@ -4097,7 +4098,7 @@ function Vo({ log: e, basePath: t }) {
|
|
|
4097
4098
|
}] : []
|
|
4098
4099
|
] });
|
|
4099
4100
|
}
|
|
4100
|
-
function
|
|
4101
|
+
function Wo({ attempts: e }) {
|
|
4101
4102
|
return /* @__PURE__ */ A("div", {
|
|
4102
4103
|
className: "rounded-md border",
|
|
4103
4104
|
children: /* @__PURE__ */ j("table", {
|
|
@@ -4139,7 +4140,7 @@ function Ho({ attempts: e }) {
|
|
|
4139
4140
|
}),
|
|
4140
4141
|
/* @__PURE__ */ A("td", {
|
|
4141
4142
|
className: "px-3 py-2",
|
|
4142
|
-
children: /* @__PURE__ */ A(
|
|
4143
|
+
children: /* @__PURE__ */ A(I, {
|
|
4143
4144
|
variant: e.status >= 200 && e.status < 300 ? "default" : "destructive",
|
|
4144
4145
|
children: e.status
|
|
4145
4146
|
})
|
|
@@ -4149,30 +4150,30 @@ function Ho({ attempts: e }) {
|
|
|
4149
4150
|
})
|
|
4150
4151
|
});
|
|
4151
4152
|
}
|
|
4152
|
-
function
|
|
4153
|
-
return !e.requestHeaders && !e.requestBody ? /* @__PURE__ */ A(
|
|
4153
|
+
function Go({ log: e }) {
|
|
4154
|
+
return !e.requestHeaders && !e.requestBody ? /* @__PURE__ */ A(Eo, { message: "No request details captured" }) : /* @__PURE__ */ j("div", {
|
|
4154
4155
|
className: "space-y-2",
|
|
4155
|
-
children: [/* @__PURE__ */ A(Q, { headers: e.requestHeaders }), /* @__PURE__ */ A(
|
|
4156
|
+
children: [/* @__PURE__ */ A(Q, { headers: e.requestHeaders }), /* @__PURE__ */ A(Z, { code: e.requestBody })]
|
|
4156
4157
|
});
|
|
4157
4158
|
}
|
|
4158
|
-
function
|
|
4159
|
-
return !e.responseHeaders && !e.responseBody ? /* @__PURE__ */ A(
|
|
4159
|
+
function Ko({ log: e }) {
|
|
4160
|
+
return !e.responseHeaders && !e.responseBody ? /* @__PURE__ */ A(Eo, { message: "No response details captured" }) : /* @__PURE__ */ j("div", {
|
|
4160
4161
|
className: "space-y-2",
|
|
4161
|
-
children: [/* @__PURE__ */ A(Q, { headers: e.responseHeaders }), /* @__PURE__ */ A(
|
|
4162
|
+
children: [/* @__PURE__ */ A(Q, { headers: e.responseHeaders }), /* @__PURE__ */ A(Z, { code: e.responseBody })]
|
|
4162
4163
|
});
|
|
4163
4164
|
}
|
|
4164
4165
|
//#endregion
|
|
4165
4166
|
//#region src/logs/detail/types.ts
|
|
4166
|
-
function
|
|
4167
|
+
function qo(e) {
|
|
4167
4168
|
return "discriminant" in e;
|
|
4168
4169
|
}
|
|
4169
4170
|
//#endregion
|
|
4170
4171
|
//#region src/logs/detail/define-log-detail.ts
|
|
4171
|
-
function
|
|
4172
|
+
function Jo(e) {
|
|
4172
4173
|
return "preset" in e;
|
|
4173
4174
|
}
|
|
4174
|
-
function
|
|
4175
|
-
return
|
|
4175
|
+
function Yo(e) {
|
|
4176
|
+
return Jo(e) ? {
|
|
4176
4177
|
preset: e.preset,
|
|
4177
4178
|
contextChart: e.contextChart
|
|
4178
4179
|
} : {
|
|
@@ -4182,32 +4183,32 @@ function qo(e) {
|
|
|
4182
4183
|
contextChart: e.contextChart
|
|
4183
4184
|
};
|
|
4184
4185
|
}
|
|
4185
|
-
function
|
|
4186
|
-
if (
|
|
4186
|
+
function Xo(e, t) {
|
|
4187
|
+
if (qo(e)) {
|
|
4187
4188
|
let n = e.discriminant(t);
|
|
4188
4189
|
return e.variants[n] ?? e.fallback ?? null;
|
|
4189
4190
|
}
|
|
4190
4191
|
return e.preset;
|
|
4191
4192
|
}
|
|
4192
|
-
function
|
|
4193
|
+
function Zo(e, t) {
|
|
4193
4194
|
return e.type === "preset" ? e.resolve(t) : null;
|
|
4194
4195
|
}
|
|
4195
|
-
function
|
|
4196
|
-
let { basePath: t, connectionLog: n, messageLog: r, webhookLog: i, extraVariants: a, contextChart: o, fallback: s, discriminant: c } = e, l = t.replace(/\/$/, ""), u =
|
|
4196
|
+
function Qo(e) {
|
|
4197
|
+
let { basePath: t, connectionLog: n, messageLog: r, webhookLog: i, extraVariants: a, contextChart: o, fallback: s, discriminant: c } = e, l = t.replace(/\/$/, ""), u = jo({
|
|
4197
4198
|
...n,
|
|
4198
4199
|
basePath: l
|
|
4199
|
-
}), d =
|
|
4200
|
+
}), d = Ho({
|
|
4200
4201
|
...i,
|
|
4201
4202
|
basePath: l
|
|
4202
4203
|
}), f = {
|
|
4203
4204
|
HTTP_PROXY: u,
|
|
4204
4205
|
LLM_PROXY: u,
|
|
4205
4206
|
MCP_PROXY: u,
|
|
4206
|
-
MESSAGE:
|
|
4207
|
+
MESSAGE: Lo(r),
|
|
4207
4208
|
WEBHOOK: d,
|
|
4208
4209
|
...a
|
|
4209
4210
|
};
|
|
4210
|
-
return
|
|
4211
|
+
return Yo({
|
|
4211
4212
|
discriminant: c ?? ((e) => e.apiType ?? ""),
|
|
4212
4213
|
variants: f,
|
|
4213
4214
|
fallback: s ?? u,
|
|
@@ -4220,16 +4221,16 @@ function Xo(e) {
|
|
|
4220
4221
|
}
|
|
4221
4222
|
//#endregion
|
|
4222
4223
|
//#region src/logs/detail/components/LogDetailContextChart.tsx
|
|
4223
|
-
var
|
|
4224
|
-
function
|
|
4224
|
+
var $o = 900 * 1e3, es = "HTTP_GATEWAY_RESPONSE_TIME", ts = "AVG", ns = "API";
|
|
4225
|
+
function rs({ apiId: e, timestamp: t, metric: n = es, measure: r = ts, filterField: i = ns, analyticsFilterMapping: a }) {
|
|
4225
4226
|
let o = c(), s = E(() => {
|
|
4226
4227
|
let e = new Date(t).getTime();
|
|
4227
4228
|
return {
|
|
4228
4229
|
type: "absolute",
|
|
4229
|
-
from: e -
|
|
4230
|
-
to: e +
|
|
4230
|
+
from: e - $o,
|
|
4231
|
+
to: e + $o
|
|
4231
4232
|
};
|
|
4232
|
-
}, [t]), l = E(() =>
|
|
4233
|
+
}, [t]), l = E(() => Gi(s, 30), [s]), u = E(() => eo([{
|
|
4233
4234
|
field: i,
|
|
4234
4235
|
operator: "eq",
|
|
4235
4236
|
value: [e],
|
|
@@ -4242,7 +4243,7 @@ function ts({ apiId: e, timestamp: t, metric: n = Qo, measure: r = $o, filterFie
|
|
|
4242
4243
|
name: n,
|
|
4243
4244
|
measures: [r]
|
|
4244
4245
|
}], [n, r]), { data: f, isLoading: p } = N({
|
|
4245
|
-
queryKey:
|
|
4246
|
+
queryKey: J.timeSeries(d, s, l, u),
|
|
4246
4247
|
queryFn: ({ signal: e }) => o.fetchTimeSeries({
|
|
4247
4248
|
metrics: d,
|
|
4248
4249
|
timeRange: s,
|
|
@@ -4250,7 +4251,7 @@ function ts({ apiId: e, timestamp: t, metric: n = Qo, measure: r = $o, filterFie
|
|
|
4250
4251
|
filters: u,
|
|
4251
4252
|
signal: e
|
|
4252
4253
|
}),
|
|
4253
|
-
staleTime:
|
|
4254
|
+
staleTime: q,
|
|
4254
4255
|
enabled: !!o
|
|
4255
4256
|
}), m = f?.[0]?.key ?? n, h = E(() => ({ [m]: {
|
|
4256
4257
|
label: "Response Time",
|
|
@@ -4258,7 +4259,7 @@ function ts({ apiId: e, timestamp: t, metric: n = Qo, measure: r = $o, filterFie
|
|
|
4258
4259
|
} }), [m]), g = E(() => {
|
|
4259
4260
|
if (!f) return [];
|
|
4260
4261
|
let e = /* @__PURE__ */ new Map();
|
|
4261
|
-
return e.set(m, f),
|
|
4262
|
+
return e.set(m, f), Ri(e);
|
|
4262
4263
|
}, [f, m]), _ = E(() => {
|
|
4263
4264
|
let e = new Date(t).getTime(), n = f?.[0]?.points;
|
|
4264
4265
|
if (g.length === 0 || !n?.length) return;
|
|
@@ -4313,18 +4314,18 @@ function ts({ apiId: e, timestamp: t, metric: n = Qo, measure: r = $o, filterFie
|
|
|
4313
4314
|
}
|
|
4314
4315
|
//#endregion
|
|
4315
4316
|
//#region src/logs/detail/components/LogDetailDrawerShell.tsx
|
|
4316
|
-
var
|
|
4317
|
+
var is = S({
|
|
4317
4318
|
expanded: !1,
|
|
4318
4319
|
setExpanded: () => {}
|
|
4319
4320
|
});
|
|
4320
|
-
function
|
|
4321
|
-
return w(
|
|
4321
|
+
function as() {
|
|
4322
|
+
return w(is);
|
|
4322
4323
|
}
|
|
4323
|
-
var
|
|
4324
|
-
function
|
|
4325
|
-
return e === document.body ? !0 : e.closest(
|
|
4324
|
+
var os = "[role=\"tree\"], [role=\"treeitem\"], input, textarea, select, [contenteditable]";
|
|
4325
|
+
function ss(e) {
|
|
4326
|
+
return e === document.body ? !0 : e.closest(os) ? !1 : !!e.closest("[data-log-detail-shell]");
|
|
4326
4327
|
}
|
|
4327
|
-
function
|
|
4328
|
+
function cs({ open: e, onClose: t, onNavigatePrev: n, onNavigateNext: r, children: i }) {
|
|
4328
4329
|
let [a, o] = O(!1), s = C(() => {
|
|
4329
4330
|
o(!1), t();
|
|
4330
4331
|
}, [t]), c = C((e) => {
|
|
@@ -4335,10 +4336,10 @@ function os({ open: e, onClose: t, onNavigatePrev: n, onNavigateNext: r, childre
|
|
|
4335
4336
|
t.preventDefault(), a ? o(!1) : s();
|
|
4336
4337
|
break;
|
|
4337
4338
|
case "ArrowUp":
|
|
4338
|
-
|
|
4339
|
+
ss(t.target) && (t.preventDefault(), n?.());
|
|
4339
4340
|
break;
|
|
4340
4341
|
case "ArrowDown":
|
|
4341
|
-
|
|
4342
|
+
ss(t.target) && (t.preventDefault(), r?.());
|
|
4342
4343
|
break;
|
|
4343
4344
|
}
|
|
4344
4345
|
}, [
|
|
@@ -4353,7 +4354,7 @@ function os({ open: e, onClose: t, onNavigatePrev: n, onNavigateNext: r, childre
|
|
|
4353
4354
|
expanded: a,
|
|
4354
4355
|
setExpanded: o
|
|
4355
4356
|
}), [a]);
|
|
4356
|
-
return /* @__PURE__ */ A(
|
|
4357
|
+
return /* @__PURE__ */ A(is.Provider, {
|
|
4357
4358
|
value: f,
|
|
4358
4359
|
children: /* @__PURE__ */ A(Ue, {
|
|
4359
4360
|
open: e,
|
|
@@ -4389,7 +4390,7 @@ function os({ open: e, onClose: t, onNavigatePrev: n, onNavigateNext: r, childre
|
|
|
4389
4390
|
}
|
|
4390
4391
|
//#endregion
|
|
4391
4392
|
//#region src/logs/detail/components/LogDetailHeader.tsx
|
|
4392
|
-
var
|
|
4393
|
+
var ls = {
|
|
4393
4394
|
GET: "success",
|
|
4394
4395
|
POST: "default",
|
|
4395
4396
|
PUT: "warning",
|
|
@@ -4398,10 +4399,10 @@ var ss = {
|
|
|
4398
4399
|
HEAD: "secondary",
|
|
4399
4400
|
OPTIONS: "secondary"
|
|
4400
4401
|
};
|
|
4401
|
-
function
|
|
4402
|
+
function us(e) {
|
|
4402
4403
|
return e >= 500 ? "text-destructive" : e >= 400 ? "text-warning" : "text-success";
|
|
4403
4404
|
}
|
|
4404
|
-
function
|
|
4405
|
+
function ds(e) {
|
|
4405
4406
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 1e3), i;
|
|
4406
4407
|
i = r < 60 ? `${r}s ago` : r < 3600 ? `${Math.floor(r / 60)}m ago` : r < 86400 ? `${Math.floor(r / 3600)}h ago` : t.toLocaleDateString(void 0, {
|
|
4407
4408
|
month: "short",
|
|
@@ -4421,10 +4422,10 @@ function ls(e) {
|
|
|
4421
4422
|
full: a
|
|
4422
4423
|
};
|
|
4423
4424
|
}
|
|
4424
|
-
function
|
|
4425
|
-
let { expanded: d, setExpanded: f } =
|
|
4425
|
+
function fs({ method: e, status: t, uri: n, timestamp: r, onClose: i, onNavigatePrev: a, onNavigateNext: o, onCopyJson: s, hasPrev: c = !0, hasNext: l = !0, showExpandToggle: u = !0 }) {
|
|
4426
|
+
let { expanded: d, setExpanded: f } = as(), p = C((e) => {
|
|
4426
4427
|
e.key === "Escape" && i?.();
|
|
4427
|
-
}, [i]), m = r ?
|
|
4428
|
+
}, [i]), m = r ? ds(r) : null;
|
|
4428
4429
|
return /* @__PURE__ */ j("div", {
|
|
4429
4430
|
className: "sticky top-0 z-10 border-b bg-background/95 backdrop-blur-sm",
|
|
4430
4431
|
role: "toolbar",
|
|
@@ -4434,14 +4435,14 @@ function us({ method: e, status: t, uri: n, timestamp: r, onClose: i, onNavigate
|
|
|
4434
4435
|
className: "flex items-center justify-between px-5 pt-4 pb-2",
|
|
4435
4436
|
children: [/* @__PURE__ */ A("div", {
|
|
4436
4437
|
className: "flex items-center gap-0.5",
|
|
4437
|
-
children: (a ?? o) && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(
|
|
4438
|
+
children: (a ?? o) && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(L, {
|
|
4438
4439
|
variant: "ghost",
|
|
4439
4440
|
size: "icon",
|
|
4440
4441
|
onClick: a,
|
|
4441
4442
|
disabled: !c,
|
|
4442
4443
|
"aria-label": "Previous log",
|
|
4443
4444
|
children: /* @__PURE__ */ A(nt, { className: "size-4" })
|
|
4444
|
-
}), /* @__PURE__ */ A(
|
|
4445
|
+
}), /* @__PURE__ */ A(L, {
|
|
4445
4446
|
variant: "ghost",
|
|
4446
4447
|
size: "icon",
|
|
4447
4448
|
onClick: o,
|
|
@@ -4452,30 +4453,30 @@ function us({ method: e, status: t, uri: n, timestamp: r, onClose: i, onNavigate
|
|
|
4452
4453
|
}), /* @__PURE__ */ j("div", {
|
|
4453
4454
|
className: "flex items-center gap-0.5",
|
|
4454
4455
|
children: [
|
|
4455
|
-
s && /* @__PURE__ */ A(
|
|
4456
|
+
s && /* @__PURE__ */ A(V, { children: /* @__PURE__ */ j(z, { children: [/* @__PURE__ */ A(H, {
|
|
4456
4457
|
asChild: !0,
|
|
4457
|
-
children: /* @__PURE__ */ A(
|
|
4458
|
+
children: /* @__PURE__ */ A(L, {
|
|
4458
4459
|
variant: "ghost",
|
|
4459
4460
|
size: "icon",
|
|
4460
4461
|
onClick: s,
|
|
4461
4462
|
"aria-label": "Copy JSON",
|
|
4462
4463
|
children: /* @__PURE__ */ A(dt, { className: "size-4" })
|
|
4463
4464
|
})
|
|
4464
|
-
}), /* @__PURE__ */ A(
|
|
4465
|
-
u && /* @__PURE__ */ A(
|
|
4465
|
+
}), /* @__PURE__ */ A(B, { children: "Copy as JSON" })] }) }),
|
|
4466
|
+
u && /* @__PURE__ */ A(V, { children: /* @__PURE__ */ j(z, { children: [/* @__PURE__ */ A(H, {
|
|
4466
4467
|
asChild: !0,
|
|
4467
|
-
children: /* @__PURE__ */ A(
|
|
4468
|
+
children: /* @__PURE__ */ A(L, {
|
|
4468
4469
|
variant: "ghost",
|
|
4469
4470
|
size: "icon",
|
|
4470
4471
|
onClick: () => f(!d),
|
|
4471
4472
|
"aria-label": d ? "Exit full screen" : "Full screen",
|
|
4472
4473
|
children: A(d ? vt : ft, { className: "size-4" })
|
|
4473
4474
|
})
|
|
4474
|
-
}), /* @__PURE__ */ A(
|
|
4475
|
+
}), /* @__PURE__ */ A(B, { children: d ? "Exit full screen" : "Full screen" })] }) }),
|
|
4475
4476
|
i && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(He, {
|
|
4476
4477
|
orientation: "vertical",
|
|
4477
4478
|
className: "mx-1.5 h-4"
|
|
4478
|
-
}), /* @__PURE__ */ A(
|
|
4479
|
+
}), /* @__PURE__ */ A(L, {
|
|
4479
4480
|
variant: "ghost",
|
|
4480
4481
|
size: "icon",
|
|
4481
4482
|
onClick: i,
|
|
@@ -4489,33 +4490,33 @@ function us({ method: e, status: t, uri: n, timestamp: r, onClose: i, onNavigate
|
|
|
4489
4490
|
children: [/* @__PURE__ */ j("div", {
|
|
4490
4491
|
className: "flex items-center gap-3",
|
|
4491
4492
|
children: [
|
|
4492
|
-
e && /* @__PURE__ */ A(
|
|
4493
|
-
variant:
|
|
4493
|
+
e && /* @__PURE__ */ A(I, {
|
|
4494
|
+
variant: ls[e] ?? "secondary",
|
|
4494
4495
|
children: e
|
|
4495
4496
|
}),
|
|
4496
4497
|
t !== void 0 && /* @__PURE__ */ A("span", {
|
|
4497
|
-
className: `font-mono text-sm font-semibold tabular-nums ${
|
|
4498
|
+
className: `font-mono text-sm font-semibold tabular-nums ${us(t)}`,
|
|
4498
4499
|
children: t
|
|
4499
4500
|
}),
|
|
4500
|
-
m && /* @__PURE__ */ A(
|
|
4501
|
+
m && /* @__PURE__ */ A(V, { children: /* @__PURE__ */ j(z, { children: [/* @__PURE__ */ A(H, {
|
|
4501
4502
|
asChild: !0,
|
|
4502
4503
|
children: /* @__PURE__ */ A("span", {
|
|
4503
4504
|
className: "ml-auto text-xs text-muted-foreground",
|
|
4504
4505
|
children: m.relative
|
|
4505
4506
|
})
|
|
4506
|
-
}), /* @__PURE__ */ A(
|
|
4507
|
+
}), /* @__PURE__ */ A(B, {
|
|
4507
4508
|
side: "bottom",
|
|
4508
4509
|
className: "text-xs",
|
|
4509
4510
|
children: m.full
|
|
4510
4511
|
})] }) })
|
|
4511
4512
|
]
|
|
4512
|
-
}), n && /* @__PURE__ */ A(
|
|
4513
|
+
}), n && /* @__PURE__ */ A(V, { children: /* @__PURE__ */ j(z, { children: [/* @__PURE__ */ A(H, {
|
|
4513
4514
|
asChild: !0,
|
|
4514
4515
|
children: /* @__PURE__ */ A("p", {
|
|
4515
4516
|
className: "font-mono text-sm text-muted-foreground truncate leading-relaxed",
|
|
4516
4517
|
children: n
|
|
4517
4518
|
})
|
|
4518
|
-
}), /* @__PURE__ */ A(
|
|
4519
|
+
}), /* @__PURE__ */ A(B, {
|
|
4519
4520
|
side: "bottom",
|
|
4520
4521
|
align: "start",
|
|
4521
4522
|
className: "max-w-[500px] break-all text-xs font-mono",
|
|
@@ -4526,9 +4527,9 @@ function us({ method: e, status: t, uri: n, timestamp: r, onClose: i, onNavigate
|
|
|
4526
4527
|
}
|
|
4527
4528
|
//#endregion
|
|
4528
4529
|
//#region src/logs/detail/components/LogDetailMetrics.tsx
|
|
4529
|
-
function
|
|
4530
|
+
function ps({ items: e }) {
|
|
4530
4531
|
let t = e.filter((e) => e.value !== void 0 && e.value !== null), n = E(() => t.map((e) => ({
|
|
4531
|
-
value:
|
|
4532
|
+
value: ms(e.value, e.unit),
|
|
4532
4533
|
label: e.label
|
|
4533
4534
|
})), [t]);
|
|
4534
4535
|
return n.length === 0 ? null : /* @__PURE__ */ A("div", {
|
|
@@ -4541,14 +4542,14 @@ function ds({ items: e }) {
|
|
|
4541
4542
|
})
|
|
4542
4543
|
});
|
|
4543
4544
|
}
|
|
4544
|
-
function
|
|
4545
|
+
function ms(e, t) {
|
|
4545
4546
|
return t === "ms" || !t ? e >= 1e4 ? `${(e / 1e3).toFixed(1)}s` : e >= 1e3 ? `${(e / 1e3).toFixed(2)}s` : `${Math.round(e)}ms` : t === "B" ? e >= 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(1)} MB` : e >= 1024 ? `${(e / 1024).toFixed(1)} KB` : `${e} B` : t === "" ? String(e) : `${e}${t}`;
|
|
4546
4547
|
}
|
|
4547
4548
|
//#endregion
|
|
4548
4549
|
//#region src/logs/detail/components/LogDetailSection.tsx
|
|
4549
|
-
function
|
|
4550
|
+
function hs({ children: e, defaultValue: t }) {
|
|
4550
4551
|
let [n, r] = O(t ?? "");
|
|
4551
|
-
return /* @__PURE__ */ A(
|
|
4552
|
+
return /* @__PURE__ */ A(P, {
|
|
4552
4553
|
type: "single",
|
|
4553
4554
|
collapsible: !0,
|
|
4554
4555
|
value: n,
|
|
@@ -4556,21 +4557,21 @@ function ps({ children: e, defaultValue: t }) {
|
|
|
4556
4557
|
children: e
|
|
4557
4558
|
});
|
|
4558
4559
|
}
|
|
4559
|
-
function
|
|
4560
|
-
return /* @__PURE__ */ j(
|
|
4560
|
+
function gs({ title: e, badge: t, children: n }) {
|
|
4561
|
+
return /* @__PURE__ */ j(oe, {
|
|
4561
4562
|
value: e,
|
|
4562
4563
|
className: "border-b last:border-b-0",
|
|
4563
|
-
children: [/* @__PURE__ */ A(
|
|
4564
|
+
children: [/* @__PURE__ */ A(se, {
|
|
4564
4565
|
className: "px-5 py-4 text-sm font-medium tracking-tight hover:bg-muted/30 transition-colors duration-150",
|
|
4565
4566
|
children: /* @__PURE__ */ j("span", {
|
|
4566
4567
|
className: "flex items-center gap-3",
|
|
4567
|
-
children: [e, t != null && /* @__PURE__ */ A(
|
|
4568
|
+
children: [e, t != null && /* @__PURE__ */ A(I, {
|
|
4568
4569
|
variant: "secondary",
|
|
4569
4570
|
className: "text-[10px] font-semibold",
|
|
4570
4571
|
children: t
|
|
4571
4572
|
})]
|
|
4572
4573
|
})
|
|
4573
|
-
}), /* @__PURE__ */ A(
|
|
4574
|
+
}), /* @__PURE__ */ A(F, { children: /* @__PURE__ */ A("div", {
|
|
4574
4575
|
className: "px-5 pb-5 pt-1",
|
|
4575
4576
|
children: n
|
|
4576
4577
|
}) })]
|
|
@@ -4578,26 +4579,26 @@ function ms({ title: e, badge: t, children: n }) {
|
|
|
4578
4579
|
}
|
|
4579
4580
|
//#endregion
|
|
4580
4581
|
//#region src/logs/detail/components/LogDetailContent.tsx
|
|
4581
|
-
var
|
|
4582
|
-
Header:
|
|
4583
|
-
Section:
|
|
4582
|
+
var _s = {
|
|
4583
|
+
Header: fs,
|
|
4584
|
+
Section: gs,
|
|
4584
4585
|
KeyValueGrid: $,
|
|
4585
4586
|
HeadersTable: Q,
|
|
4586
|
-
CodeBlock:
|
|
4587
|
-
Metrics:
|
|
4587
|
+
CodeBlock: Z,
|
|
4588
|
+
Metrics: ps
|
|
4588
4589
|
};
|
|
4589
|
-
function
|
|
4590
|
-
let f =
|
|
4590
|
+
function vs({ config: e, log: t, logId: n, onClose: r, onCopyJson: i, onNavigatePrev: a, onNavigateNext: o, onFilter: s, hasPrev: c, hasNext: l, showExpandToggle: u = !0, showNavigation: d = !0 }) {
|
|
4591
|
+
let f = Xo(e, t);
|
|
4591
4592
|
if (!f) return /* @__PURE__ */ A("div", {
|
|
4592
4593
|
className: "flex items-center justify-center p-8 text-sm text-muted-foreground",
|
|
4593
4594
|
children: "No detail view configured for this log type."
|
|
4594
4595
|
});
|
|
4595
|
-
if (f.type === "custom") return /* @__PURE__ */ A(k, { children: f.render(t,
|
|
4596
|
-
let p =
|
|
4596
|
+
if (f.type === "custom") return /* @__PURE__ */ A(k, { children: f.render(t, _s) });
|
|
4597
|
+
let p = Zo(f, t);
|
|
4597
4598
|
if (!p) return null;
|
|
4598
4599
|
let m = e.contextChart;
|
|
4599
4600
|
return /* @__PURE__ */ j(k, { children: [
|
|
4600
|
-
/* @__PURE__ */ A(
|
|
4601
|
+
/* @__PURE__ */ A(fs, {
|
|
4601
4602
|
method: p.header.method(t),
|
|
4602
4603
|
status: p.header.status(t),
|
|
4603
4604
|
uri: p.header.uri(t),
|
|
@@ -4610,7 +4611,7 @@ function gs({ config: e, log: t, logId: n, onClose: r, onCopyJson: i, onNavigate
|
|
|
4610
4611
|
hasNext: d ? l : !1,
|
|
4611
4612
|
showExpandToggle: u
|
|
4612
4613
|
}),
|
|
4613
|
-
m && /* @__PURE__ */ A(
|
|
4614
|
+
m && /* @__PURE__ */ A(rs, {
|
|
4614
4615
|
apiId: m.extractApiId(t),
|
|
4615
4616
|
timestamp: m.extractTimestamp?.(t) ?? p.header.timestamp(t),
|
|
4616
4617
|
metric: m.metric,
|
|
@@ -4618,14 +4619,14 @@ function gs({ config: e, log: t, logId: n, onClose: r, onCopyJson: i, onNavigate
|
|
|
4618
4619
|
filterField: m.filterField,
|
|
4619
4620
|
analyticsFilterMapping: m.analyticsFilterMapping
|
|
4620
4621
|
}),
|
|
4621
|
-
p.metrics && p.metrics.length > 0 && /* @__PURE__ */ A(
|
|
4622
|
+
p.metrics && p.metrics.length > 0 && /* @__PURE__ */ A(ps, { items: p.metrics.map((e) => ({
|
|
4622
4623
|
label: e.label,
|
|
4623
4624
|
value: e.value(t),
|
|
4624
4625
|
unit: e.unit
|
|
4625
4626
|
})) }),
|
|
4626
|
-
/* @__PURE__ */ A(
|
|
4627
|
+
/* @__PURE__ */ A(hs, {
|
|
4627
4628
|
defaultValue: p.sections.find((e) => e.defaultOpen)?.title,
|
|
4628
|
-
children: p.sections.map((e) => /* @__PURE__ */ A(
|
|
4629
|
+
children: p.sections.map((e) => /* @__PURE__ */ A(gs, {
|
|
4629
4630
|
title: e.title,
|
|
4630
4631
|
badge: e.badge?.(t),
|
|
4631
4632
|
children: e.render(t, s)
|
|
@@ -4635,20 +4636,20 @@ function gs({ config: e, log: t, logId: n, onClose: r, onCopyJson: i, onNavigate
|
|
|
4635
4636
|
}
|
|
4636
4637
|
//#endregion
|
|
4637
4638
|
//#region src/logs/detail/utils/clipboard.ts
|
|
4638
|
-
function
|
|
4639
|
-
navigator.clipboard.writeText(JSON.stringify(e, null, 2)).then(() =>
|
|
4639
|
+
function ys(e) {
|
|
4640
|
+
navigator.clipboard.writeText(JSON.stringify(e, null, 2)).then(() => W.success("Full JSON copied to clipboard"), () => W.error("Failed to copy to clipboard"));
|
|
4640
4641
|
}
|
|
4641
4642
|
//#endregion
|
|
4642
4643
|
//#region src/logs/detail/components/LogDetailDrawer.tsx
|
|
4643
|
-
function
|
|
4644
|
+
function bs({ config: e, logId: t, onClose: n, onNavigatePrev: r, onNavigateNext: i, onFilter: a, hasPrev: o, hasNext: s }) {
|
|
4644
4645
|
let { data: c, isLoading: l, isError: u, isNotFound: d, isUnsupported: f, refetch: p } = Cn({ id: t });
|
|
4645
|
-
return /* @__PURE__ */ j(
|
|
4646
|
+
return /* @__PURE__ */ j(cs, {
|
|
4646
4647
|
open: !!t,
|
|
4647
4648
|
onClose: n,
|
|
4648
4649
|
onNavigatePrev: r,
|
|
4649
4650
|
onNavigateNext: i,
|
|
4650
4651
|
children: [
|
|
4651
|
-
l && /* @__PURE__ */ A(
|
|
4652
|
+
l && /* @__PURE__ */ A(xs, {}),
|
|
4652
4653
|
f && /* @__PURE__ */ j("div", {
|
|
4653
4654
|
className: "flex flex-col items-center justify-center gap-2 p-8 text-center text-muted-foreground",
|
|
4654
4655
|
children: [/* @__PURE__ */ A("p", {
|
|
@@ -4677,7 +4678,7 @@ function vs({ config: e, logId: t, onClose: n, onNavigatePrev: r, onNavigateNext
|
|
|
4677
4678
|
className: "text-sm text-destructive",
|
|
4678
4679
|
children: "Failed to load log details"
|
|
4679
4680
|
}),
|
|
4680
|
-
/* @__PURE__ */ A(
|
|
4681
|
+
/* @__PURE__ */ A(L, {
|
|
4681
4682
|
variant: "outline",
|
|
4682
4683
|
size: "sm",
|
|
4683
4684
|
onClick: () => p(),
|
|
@@ -4685,13 +4686,13 @@ function vs({ config: e, logId: t, onClose: n, onNavigatePrev: r, onNavigateNext
|
|
|
4685
4686
|
})
|
|
4686
4687
|
]
|
|
4687
4688
|
}),
|
|
4688
|
-
c != null && /* @__PURE__ */ A(
|
|
4689
|
+
c != null && /* @__PURE__ */ A(vs, {
|
|
4689
4690
|
config: e,
|
|
4690
4691
|
log: c,
|
|
4691
4692
|
logId: t,
|
|
4692
4693
|
onClose: n,
|
|
4693
4694
|
onCopyJson: () => {
|
|
4694
|
-
c &&
|
|
4695
|
+
c && ys(c);
|
|
4695
4696
|
},
|
|
4696
4697
|
onNavigatePrev: r,
|
|
4697
4698
|
onNavigateNext: i,
|
|
@@ -4702,50 +4703,50 @@ function vs({ config: e, logId: t, onClose: n, onNavigatePrev: r, onNavigateNext
|
|
|
4702
4703
|
]
|
|
4703
4704
|
});
|
|
4704
4705
|
}
|
|
4705
|
-
function
|
|
4706
|
+
function xs() {
|
|
4706
4707
|
return /* @__PURE__ */ j("div", {
|
|
4707
4708
|
className: "space-y-4 p-4",
|
|
4708
4709
|
children: [
|
|
4709
4710
|
/* @__PURE__ */ j("div", {
|
|
4710
4711
|
className: "flex items-center gap-2",
|
|
4711
4712
|
children: [
|
|
4712
|
-
/* @__PURE__ */ A(
|
|
4713
|
-
/* @__PURE__ */ A(
|
|
4714
|
-
/* @__PURE__ */ A(
|
|
4713
|
+
/* @__PURE__ */ A(R, { className: "h-6 w-12" }),
|
|
4714
|
+
/* @__PURE__ */ A(R, { className: "h-6 w-10" }),
|
|
4715
|
+
/* @__PURE__ */ A(R, { className: "h-6 w-48" })
|
|
4715
4716
|
]
|
|
4716
4717
|
}),
|
|
4717
|
-
/* @__PURE__ */ A(
|
|
4718
|
+
/* @__PURE__ */ A(R, { className: "h-[80px] w-full" }),
|
|
4718
4719
|
/* @__PURE__ */ j("div", {
|
|
4719
4720
|
className: "flex gap-3",
|
|
4720
4721
|
children: [
|
|
4721
|
-
/* @__PURE__ */ A(
|
|
4722
|
-
/* @__PURE__ */ A(
|
|
4723
|
-
/* @__PURE__ */ A(
|
|
4722
|
+
/* @__PURE__ */ A(R, { className: "h-14 flex-1" }),
|
|
4723
|
+
/* @__PURE__ */ A(R, { className: "h-14 flex-1" }),
|
|
4724
|
+
/* @__PURE__ */ A(R, { className: "h-14 flex-1" })
|
|
4724
4725
|
]
|
|
4725
4726
|
}),
|
|
4726
|
-
/* @__PURE__ */ A(
|
|
4727
|
-
/* @__PURE__ */ A(
|
|
4727
|
+
/* @__PURE__ */ A(R, { className: "h-8 w-full" }),
|
|
4728
|
+
/* @__PURE__ */ A(R, { className: "h-32 w-full" })
|
|
4728
4729
|
]
|
|
4729
4730
|
});
|
|
4730
4731
|
}
|
|
4731
4732
|
//#endregion
|
|
4732
4733
|
//#region src/logs/detail/components/LogDetailPage.tsx
|
|
4733
|
-
function
|
|
4734
|
+
function Ss({ config: e, onFilter: t }) {
|
|
4734
4735
|
let { logId: n } = Xt(), r = Yt(), { data: i, isLoading: a, isError: o, isNotFound: s, isUnsupported: c, refetch: l } = Cn({ id: n }), u = () => r(-1);
|
|
4735
4736
|
return a ? /* @__PURE__ */ j("div", {
|
|
4736
4737
|
className: "space-y-4 p-6",
|
|
4737
4738
|
children: [
|
|
4738
|
-
/* @__PURE__ */ A(
|
|
4739
|
-
/* @__PURE__ */ A(
|
|
4739
|
+
/* @__PURE__ */ A(R, { className: "h-8 w-48" }),
|
|
4740
|
+
/* @__PURE__ */ A(R, { className: "h-[80px] w-full" }),
|
|
4740
4741
|
/* @__PURE__ */ j("div", {
|
|
4741
4742
|
className: "flex gap-3",
|
|
4742
4743
|
children: [
|
|
4743
|
-
/* @__PURE__ */ A(
|
|
4744
|
-
/* @__PURE__ */ A(
|
|
4745
|
-
/* @__PURE__ */ A(
|
|
4744
|
+
/* @__PURE__ */ A(R, { className: "h-14 flex-1" }),
|
|
4745
|
+
/* @__PURE__ */ A(R, { className: "h-14 flex-1" }),
|
|
4746
|
+
/* @__PURE__ */ A(R, { className: "h-14 flex-1" })
|
|
4746
4747
|
]
|
|
4747
4748
|
}),
|
|
4748
|
-
/* @__PURE__ */ A(
|
|
4749
|
+
/* @__PURE__ */ A(R, { className: "h-64 w-full" })
|
|
4749
4750
|
]
|
|
4750
4751
|
}) : c ? /* @__PURE__ */ A("div", {
|
|
4751
4752
|
className: "flex flex-col items-center justify-center gap-2 p-12 text-center text-muted-foreground",
|
|
@@ -4758,7 +4759,7 @@ function bs({ config: e, onFilter: t }) {
|
|
|
4758
4759
|
children: [/* @__PURE__ */ A("p", {
|
|
4759
4760
|
className: "text-sm font-medium text-muted-foreground",
|
|
4760
4761
|
children: "Log not found"
|
|
4761
|
-
}), /* @__PURE__ */ j(
|
|
4762
|
+
}), /* @__PURE__ */ j(L, {
|
|
4762
4763
|
variant: "outline",
|
|
4763
4764
|
size: "sm",
|
|
4764
4765
|
onClick: u,
|
|
@@ -4772,7 +4773,7 @@ function bs({ config: e, onFilter: t }) {
|
|
|
4772
4773
|
className: "text-sm text-destructive",
|
|
4773
4774
|
children: "Failed to load log details"
|
|
4774
4775
|
}),
|
|
4775
|
-
/* @__PURE__ */ A(
|
|
4776
|
+
/* @__PURE__ */ A(L, {
|
|
4776
4777
|
variant: "outline",
|
|
4777
4778
|
size: "sm",
|
|
4778
4779
|
onClick: () => l(),
|
|
@@ -4783,21 +4784,21 @@ function bs({ config: e, onFilter: t }) {
|
|
|
4783
4784
|
className: "space-y-0",
|
|
4784
4785
|
children: [/* @__PURE__ */ A("div", {
|
|
4785
4786
|
className: "border-b px-6 py-3",
|
|
4786
|
-
children: /* @__PURE__ */ j(
|
|
4787
|
+
children: /* @__PURE__ */ j(L, {
|
|
4787
4788
|
variant: "ghost",
|
|
4788
4789
|
size: "sm",
|
|
4789
4790
|
onClick: u,
|
|
4790
4791
|
children: [/* @__PURE__ */ A(nt, { className: "size-4 mr-1.5" }), "Back to logs"]
|
|
4791
4792
|
})
|
|
4792
|
-
}), /* @__PURE__ */ A(
|
|
4793
|
+
}), /* @__PURE__ */ A(le, {
|
|
4793
4794
|
className: "mx-6 mt-4 overflow-hidden",
|
|
4794
|
-
children: /* @__PURE__ */ A(
|
|
4795
|
+
children: /* @__PURE__ */ A(vs, {
|
|
4795
4796
|
config: e,
|
|
4796
4797
|
log: i,
|
|
4797
4798
|
logId: n,
|
|
4798
4799
|
onClose: u,
|
|
4799
4800
|
onCopyJson: () => {
|
|
4800
|
-
i &&
|
|
4801
|
+
i && ys(i);
|
|
4801
4802
|
},
|
|
4802
4803
|
onFilter: t,
|
|
4803
4804
|
showExpandToggle: !1,
|
|
@@ -4808,7 +4809,7 @@ function bs({ config: e, onFilter: t }) {
|
|
|
4808
4809
|
}
|
|
4809
4810
|
//#endregion
|
|
4810
4811
|
//#region src/traces/TraceStatusBadge.tsx
|
|
4811
|
-
var
|
|
4812
|
+
var Cs = {
|
|
4812
4813
|
ok: {
|
|
4813
4814
|
label: "OK",
|
|
4814
4815
|
variant: "success"
|
|
@@ -4822,16 +4823,16 @@ var xs = {
|
|
|
4822
4823
|
variant: "default"
|
|
4823
4824
|
}
|
|
4824
4825
|
};
|
|
4825
|
-
function
|
|
4826
|
-
let t =
|
|
4827
|
-
return /* @__PURE__ */ A(
|
|
4826
|
+
function ws({ status: e }) {
|
|
4827
|
+
let t = Cs[e];
|
|
4828
|
+
return /* @__PURE__ */ A(I, {
|
|
4828
4829
|
variant: t.variant,
|
|
4829
4830
|
children: t.label
|
|
4830
4831
|
});
|
|
4831
4832
|
}
|
|
4832
4833
|
//#endregion
|
|
4833
4834
|
//#region src/traces/format-utils.ts
|
|
4834
|
-
function
|
|
4835
|
+
function Ts(e) {
|
|
4835
4836
|
return new Date(e).toLocaleString(void 0, {
|
|
4836
4837
|
year: "numeric",
|
|
4837
4838
|
month: "2-digit",
|
|
@@ -4842,60 +4843,73 @@ function Cs(e) {
|
|
|
4842
4843
|
hour12: !1
|
|
4843
4844
|
});
|
|
4844
4845
|
}
|
|
4845
|
-
function
|
|
4846
|
+
function Es(e) {
|
|
4846
4847
|
return e < 1 ? `${(e * 1e3).toFixed(0)} µs` : e < 1e3 ? `${e.toFixed(+(e < 10))} ms` : e < 6e4 ? `${(e / 1e3).toFixed(2)} s` : `${Math.floor(e / 6e4)}m ${(e % 6e4 / 1e3).toFixed(1)}s`;
|
|
4847
4848
|
}
|
|
4848
4849
|
//#endregion
|
|
4849
4850
|
//#region src/traces/TraceTable.tsx
|
|
4850
|
-
var
|
|
4851
|
+
var Ds = {
|
|
4852
|
+
"no-traces": {
|
|
4853
|
+
title: "No traces found",
|
|
4854
|
+
description: "No traces in this time range for this API."
|
|
4855
|
+
},
|
|
4856
|
+
"no-api-selected": {
|
|
4857
|
+
title: "No API selected",
|
|
4858
|
+
description: "Select an API above to view its traces."
|
|
4859
|
+
},
|
|
4860
|
+
"no-api-loader": {
|
|
4861
|
+
title: "No API selected",
|
|
4862
|
+
description: "Open tracing from an API to view its traces."
|
|
4863
|
+
}
|
|
4864
|
+
}, Os = "observability-traces-columns", ks = {
|
|
4851
4865
|
startTime: !0,
|
|
4852
4866
|
rootServiceName: !0,
|
|
4853
4867
|
rootOperationName: !0,
|
|
4854
4868
|
duration: !0,
|
|
4855
4869
|
status: !0
|
|
4856
4870
|
};
|
|
4857
|
-
function
|
|
4871
|
+
function As(e) {
|
|
4858
4872
|
try {
|
|
4859
4873
|
let t = localStorage.getItem(e);
|
|
4860
4874
|
return t ? {
|
|
4861
|
-
...
|
|
4875
|
+
...ks,
|
|
4862
4876
|
...JSON.parse(t)
|
|
4863
|
-
} :
|
|
4877
|
+
} : ks;
|
|
4864
4878
|
} catch {
|
|
4865
|
-
return
|
|
4879
|
+
return ks;
|
|
4866
4880
|
}
|
|
4867
4881
|
}
|
|
4868
|
-
function
|
|
4882
|
+
function js(e, t) {
|
|
4869
4883
|
try {
|
|
4870
4884
|
localStorage.setItem(e, JSON.stringify(t));
|
|
4871
4885
|
} catch {}
|
|
4872
4886
|
}
|
|
4873
|
-
function
|
|
4887
|
+
function Ms({ data: e, loading: t, totalCount: n, page: r, pageSize: i, onPageChange: a, onPageSizeChange: o, pageSizeOptions: s = [
|
|
4874
4888
|
10,
|
|
4875
4889
|
25,
|
|
4876
4890
|
50,
|
|
4877
4891
|
100
|
|
4878
|
-
], onRowClick: c, columnVisibilityStorageKey: l }) {
|
|
4879
|
-
let
|
|
4880
|
-
|
|
4892
|
+
], onRowClick: c, columnVisibilityStorageKey: l, emptyVariant: u = "no-traces" }) {
|
|
4893
|
+
let d = l ?? Os, f = Ds[u], [p, m] = O(() => As(d)), h = C((e) => {
|
|
4894
|
+
m((t) => {
|
|
4881
4895
|
let n = typeof e == "function" ? e(t) : e;
|
|
4882
|
-
return
|
|
4896
|
+
return js(d, n), n;
|
|
4883
4897
|
});
|
|
4884
|
-
}, [
|
|
4898
|
+
}, [d]), g = E(() => [
|
|
4885
4899
|
{
|
|
4886
4900
|
id: "startTime",
|
|
4887
4901
|
header: "Start Time",
|
|
4888
4902
|
accessorFn: (e) => e.startTime,
|
|
4889
4903
|
cell: ({ getValue: e }) => /* @__PURE__ */ A("span", {
|
|
4890
4904
|
className: "whitespace-nowrap text-sm tabular-nums",
|
|
4891
|
-
children:
|
|
4905
|
+
children: Ts(e())
|
|
4892
4906
|
})
|
|
4893
4907
|
},
|
|
4894
4908
|
{
|
|
4895
4909
|
id: "status",
|
|
4896
4910
|
header: "Status",
|
|
4897
4911
|
accessorFn: (e) => e.status,
|
|
4898
|
-
cell: ({ row: e }) => /* @__PURE__ */ A(
|
|
4912
|
+
cell: ({ row: e }) => /* @__PURE__ */ A(ws, { status: e.original.status })
|
|
4899
4913
|
},
|
|
4900
4914
|
{
|
|
4901
4915
|
id: "rootServiceName",
|
|
@@ -4921,10 +4935,10 @@ function ks({ data: e, loading: t, totalCount: n, page: r, pageSize: i, onPageCh
|
|
|
4921
4935
|
accessorFn: (e) => e.duration,
|
|
4922
4936
|
cell: ({ getValue: e }) => /* @__PURE__ */ A("span", {
|
|
4923
4937
|
className: "whitespace-nowrap text-sm tabular-nums",
|
|
4924
|
-
children:
|
|
4938
|
+
children: Es(e())
|
|
4925
4939
|
})
|
|
4926
4940
|
}
|
|
4927
|
-
], []),
|
|
4941
|
+
], []), _ = C((n) => {
|
|
4928
4942
|
if (!c || t) return;
|
|
4929
4943
|
let r = n.target;
|
|
4930
4944
|
if (r.closest("button, a, input, [role=\"checkbox\"]")) return;
|
|
@@ -4938,7 +4952,7 @@ function ks({ data: e, loading: t, totalCount: n, page: r, pageSize: i, onPageCh
|
|
|
4938
4952
|
c,
|
|
4939
4953
|
t,
|
|
4940
4954
|
e
|
|
4941
|
-
]),
|
|
4955
|
+
]), v = C((n) => {
|
|
4942
4956
|
if (!c || t || n.key !== "Enter" && n.key !== " ") return;
|
|
4943
4957
|
let r = n.target.closest("tbody tr");
|
|
4944
4958
|
if (!r) return;
|
|
@@ -4954,11 +4968,11 @@ function ks({ data: e, loading: t, totalCount: n, page: r, pageSize: i, onPageCh
|
|
|
4954
4968
|
]);
|
|
4955
4969
|
return /* @__PURE__ */ A("div", {
|
|
4956
4970
|
role: c ? "grid" : void 0,
|
|
4957
|
-
onClick:
|
|
4958
|
-
onKeyDown:
|
|
4971
|
+
onClick: _,
|
|
4972
|
+
onKeyDown: v,
|
|
4959
4973
|
className: c ? "[&_tbody_tr]:cursor-pointer" : void 0,
|
|
4960
|
-
children: /* @__PURE__ */ A(
|
|
4961
|
-
columns:
|
|
4974
|
+
children: /* @__PURE__ */ A(be, {
|
|
4975
|
+
columns: g,
|
|
4962
4976
|
data: e,
|
|
4963
4977
|
loading: t,
|
|
4964
4978
|
skeletonCount: i,
|
|
@@ -4968,18 +4982,18 @@ function ks({ data: e, loading: t, totalCount: n, page: r, pageSize: i, onPageCh
|
|
|
4968
4982
|
className: "**:data-[slot=table-container]:max-h-[calc(100vh-20rem)]",
|
|
4969
4983
|
tableOptions: {
|
|
4970
4984
|
getRowId: (e) => e.traceId,
|
|
4971
|
-
state: { columnVisibility:
|
|
4972
|
-
onColumnVisibilityChange:
|
|
4985
|
+
state: { columnVisibility: p },
|
|
4986
|
+
onColumnVisibilityChange: h
|
|
4973
4987
|
},
|
|
4974
|
-
emptyMessage: /* @__PURE__ */ A(
|
|
4975
|
-
/* @__PURE__ */ A(
|
|
4988
|
+
emptyMessage: /* @__PURE__ */ A(Se, { children: /* @__PURE__ */ j(we, { children: [
|
|
4989
|
+
/* @__PURE__ */ A(Te, {
|
|
4976
4990
|
variant: "icon",
|
|
4977
4991
|
children: /* @__PURE__ */ A(St, {})
|
|
4978
4992
|
}),
|
|
4979
|
-
/* @__PURE__ */ A(
|
|
4980
|
-
/* @__PURE__ */ A(
|
|
4993
|
+
/* @__PURE__ */ A(Ee, { children: f.title }),
|
|
4994
|
+
/* @__PURE__ */ A(Ce, { children: f.description })
|
|
4981
4995
|
] }) }),
|
|
4982
|
-
footer: n > 0 ? /* @__PURE__ */ A(
|
|
4996
|
+
footer: n > 0 ? /* @__PURE__ */ A(xe, {
|
|
4983
4997
|
page: r,
|
|
4984
4998
|
pageSize: i,
|
|
4985
4999
|
totalCount: n,
|
|
@@ -4992,62 +5006,66 @@ function ks({ data: e, loading: t, totalCount: n, page: r, pageSize: i, onPageCh
|
|
|
4992
5006
|
}
|
|
4993
5007
|
//#endregion
|
|
4994
5008
|
//#region src/traces/TraceExplorerPage.tsx
|
|
4995
|
-
function
|
|
4996
|
-
let { apiId:
|
|
4997
|
-
apiId:
|
|
4998
|
-
timeRange:
|
|
5009
|
+
function Ns({ onRowClick: e, pageSize: t = 25, columnVisibilityStorageKey: n, onPageDataChange: r, toolbarStart: i, emptyVariant: a }) {
|
|
5010
|
+
let { apiId: o } = Xt(), { timeRange: s, setTimeRange: c } = Ra(), l = Pn({
|
|
5011
|
+
apiId: o ?? "",
|
|
5012
|
+
timeRange: s,
|
|
4999
5013
|
pageSize: t,
|
|
5000
|
-
enabled: !!
|
|
5014
|
+
enabled: !!o
|
|
5001
5015
|
});
|
|
5002
|
-
return
|
|
5016
|
+
return Ps(l.data, r), /* @__PURE__ */ j("div", {
|
|
5003
5017
|
className: "space-y-4 p-4",
|
|
5004
5018
|
children: [
|
|
5005
5019
|
/* @__PURE__ */ A("h1", {
|
|
5006
5020
|
className: "text-lg font-semibold",
|
|
5007
|
-
children: "
|
|
5021
|
+
children: "Tracing"
|
|
5008
5022
|
}),
|
|
5009
5023
|
/* @__PURE__ */ j("div", {
|
|
5010
5024
|
className: "flex flex-wrap items-center gap-3",
|
|
5011
5025
|
children: [
|
|
5012
|
-
/* @__PURE__ */ A("div", {
|
|
5013
|
-
|
|
5026
|
+
/* @__PURE__ */ A("div", {
|
|
5027
|
+
className: "flex flex-1 items-center gap-2",
|
|
5028
|
+
children: i
|
|
5029
|
+
}),
|
|
5030
|
+
/* @__PURE__ */ A(V, { children: /* @__PURE__ */ A(La, { isFetching: l.isFetching }) }),
|
|
5014
5031
|
/* @__PURE__ */ A(rr, {
|
|
5015
|
-
value:
|
|
5016
|
-
onChange:
|
|
5032
|
+
value: s,
|
|
5033
|
+
onChange: c
|
|
5017
5034
|
})
|
|
5018
5035
|
]
|
|
5019
5036
|
}),
|
|
5020
|
-
|
|
5037
|
+
l.isError && /* @__PURE__ */ j("div", {
|
|
5021
5038
|
className: "flex items-center gap-3 rounded-lg border border-destructive/20 bg-destructive/5 px-4 py-3",
|
|
5022
5039
|
children: [
|
|
5023
5040
|
/* @__PURE__ */ A(tt, { className: "size-5 shrink-0 text-destructive" }),
|
|
5024
5041
|
/* @__PURE__ */ A("p", {
|
|
5025
5042
|
className: "flex-1 text-sm text-destructive",
|
|
5026
|
-
children:
|
|
5043
|
+
children: l.error?.message ?? "Failed to load traces."
|
|
5027
5044
|
}),
|
|
5028
|
-
/* @__PURE__ */ j(
|
|
5045
|
+
/* @__PURE__ */ j(L, {
|
|
5029
5046
|
variant: "outline",
|
|
5030
5047
|
size: "sm",
|
|
5031
|
-
onClick:
|
|
5048
|
+
onClick: l.refetch,
|
|
5032
5049
|
children: [/* @__PURE__ */ A(bt, { className: "size-3.5" }), "Retry"]
|
|
5033
5050
|
})
|
|
5034
5051
|
]
|
|
5035
5052
|
}),
|
|
5036
|
-
/* @__PURE__ */ A(
|
|
5037
|
-
data:
|
|
5038
|
-
loading:
|
|
5039
|
-
totalCount:
|
|
5040
|
-
page:
|
|
5041
|
-
pageSize:
|
|
5042
|
-
onPageChange:
|
|
5043
|
-
onPageSizeChange:
|
|
5053
|
+
/* @__PURE__ */ A(Ms, {
|
|
5054
|
+
data: l.data,
|
|
5055
|
+
loading: l.isLoading,
|
|
5056
|
+
totalCount: l.totalCount,
|
|
5057
|
+
page: l.page,
|
|
5058
|
+
pageSize: l.pageSize,
|
|
5059
|
+
onPageChange: l.goToPage,
|
|
5060
|
+
onPageSizeChange: l.setPageSize,
|
|
5044
5061
|
onRowClick: e,
|
|
5045
|
-
columnVisibilityStorageKey: n
|
|
5062
|
+
columnVisibilityStorageKey: n,
|
|
5063
|
+
emptyVariant: a
|
|
5046
5064
|
})
|
|
5047
5065
|
]
|
|
5048
5066
|
});
|
|
5049
5067
|
}
|
|
5050
|
-
function
|
|
5068
|
+
function Ps(e, t) {
|
|
5051
5069
|
let n = D(t);
|
|
5052
5070
|
T(() => {
|
|
5053
5071
|
n.current = t;
|
|
@@ -5056,8 +5074,81 @@ function js(e, t) {
|
|
|
5056
5074
|
}, [e]);
|
|
5057
5075
|
}
|
|
5058
5076
|
//#endregion
|
|
5077
|
+
//#region src/traces/TracingApiSelector.tsx
|
|
5078
|
+
function Fs({ options: e, value: t, onSelect: n, loading: r, error: i, onRetry: a }) {
|
|
5079
|
+
let { open: o, handleOpenChange: s, handleInputFocus: c, handleInputKeyDown: l } = gr(), u = ie(), d = E(() => e.find((e) => e.id === t) ?? null, [e, t]);
|
|
5080
|
+
return i ? /* @__PURE__ */ j("div", {
|
|
5081
|
+
className: "flex flex-1 items-center gap-3 rounded-lg border border-destructive/20 bg-destructive/5 px-3 py-2",
|
|
5082
|
+
children: [
|
|
5083
|
+
/* @__PURE__ */ A(tt, { className: "size-4 shrink-0 text-destructive" }),
|
|
5084
|
+
/* @__PURE__ */ A("p", {
|
|
5085
|
+
className: "flex-1 text-sm text-destructive",
|
|
5086
|
+
children: "Failed to load the API list."
|
|
5087
|
+
}),
|
|
5088
|
+
a && /* @__PURE__ */ j(L, {
|
|
5089
|
+
variant: "outline",
|
|
5090
|
+
size: "sm",
|
|
5091
|
+
onClick: a,
|
|
5092
|
+
children: [/* @__PURE__ */ A(bt, { className: "size-3.5" }), "Retry"]
|
|
5093
|
+
})
|
|
5094
|
+
]
|
|
5095
|
+
}) : /* @__PURE__ */ j("div", {
|
|
5096
|
+
className: "flex items-center gap-2",
|
|
5097
|
+
children: [/* @__PURE__ */ j(je, {
|
|
5098
|
+
htmlFor: u,
|
|
5099
|
+
className: "shrink-0 text-sm font-medium",
|
|
5100
|
+
children: [
|
|
5101
|
+
"API",
|
|
5102
|
+
" ",
|
|
5103
|
+
/* @__PURE__ */ A("span", {
|
|
5104
|
+
"aria-hidden": "true",
|
|
5105
|
+
className: "text-destructive",
|
|
5106
|
+
children: "*"
|
|
5107
|
+
})
|
|
5108
|
+
]
|
|
5109
|
+
}), /* @__PURE__ */ j(ue, {
|
|
5110
|
+
open: o,
|
|
5111
|
+
onOpenChange: s,
|
|
5112
|
+
items: e,
|
|
5113
|
+
value: d,
|
|
5114
|
+
onValueChange: (e) => {
|
|
5115
|
+
let t = e;
|
|
5116
|
+
t && n(t.id);
|
|
5117
|
+
},
|
|
5118
|
+
itemToStringLabel: (e) => e.label,
|
|
5119
|
+
itemToStringValue: (e) => e.id,
|
|
5120
|
+
isItemEqualToValue: (e, t) => e.id === t.id,
|
|
5121
|
+
disabled: r,
|
|
5122
|
+
openOnInputClick: !0,
|
|
5123
|
+
children: [/* @__PURE__ */ A(ge, {
|
|
5124
|
+
id: u,
|
|
5125
|
+
"aria-label": "API",
|
|
5126
|
+
"aria-required": "true",
|
|
5127
|
+
showTrigger: !0,
|
|
5128
|
+
showClear: !1,
|
|
5129
|
+
placeholder: r ? "Loading APIs…" : "Select an API…",
|
|
5130
|
+
className: "w-72 max-w-full",
|
|
5131
|
+
onFocus: c,
|
|
5132
|
+
onKeyDown: l
|
|
5133
|
+
}), /* @__PURE__ */ j(me, { children: [/* @__PURE__ */ A(he, { children: "No API found." }), /* @__PURE__ */ A(ve, { children: (e) => /* @__PURE__ */ A(_e, {
|
|
5134
|
+
value: e,
|
|
5135
|
+
children: /* @__PURE__ */ j("span", {
|
|
5136
|
+
className: "flex flex-col",
|
|
5137
|
+
children: [/* @__PURE__ */ A("span", {
|
|
5138
|
+
className: "text-sm",
|
|
5139
|
+
children: e.label
|
|
5140
|
+
}), e.description && /* @__PURE__ */ A("span", {
|
|
5141
|
+
className: "text-xs text-muted-foreground",
|
|
5142
|
+
children: e.description
|
|
5143
|
+
})]
|
|
5144
|
+
})
|
|
5145
|
+
}, e.id) })] })]
|
|
5146
|
+
})]
|
|
5147
|
+
});
|
|
5148
|
+
}
|
|
5149
|
+
//#endregion
|
|
5059
5150
|
//#region src/traces/build-traces-deep-link.ts
|
|
5060
|
-
function
|
|
5151
|
+
function Is({ basePath: e, apiId: t, timeRange: n = Un, filters: r = [] }) {
|
|
5061
5152
|
let i = qn({
|
|
5062
5153
|
conditions: r,
|
|
5063
5154
|
timeRange: n
|
|
@@ -5068,46 +5159,22 @@ function Ms({ basePath: e, apiId: t, timeRange: n = Un, filters: r = [] }) {
|
|
|
5068
5159
|
}
|
|
5069
5160
|
//#endregion
|
|
5070
5161
|
//#region src/traces/detail/SpanDetailPanel.tsx
|
|
5071
|
-
function
|
|
5162
|
+
function Ls(e) {
|
|
5072
5163
|
return Array.isArray(e) ? e.join(", ") : typeof e == "boolean" ? String(e) : e;
|
|
5073
5164
|
}
|
|
5074
|
-
function
|
|
5165
|
+
function Rs(e) {
|
|
5075
5166
|
return Object.entries(e).map(([e, t]) => ({
|
|
5076
5167
|
label: e,
|
|
5077
|
-
value:
|
|
5168
|
+
value: Ls(t)
|
|
5078
5169
|
}));
|
|
5079
5170
|
}
|
|
5080
|
-
function
|
|
5081
|
-
return /* @__PURE__ */ A(
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
children: /* @__PURE__ */ j(We, {
|
|
5086
|
-
side: "right",
|
|
5087
|
-
className: "gap-0 p-0 w-[480px] max-w-[80vw]",
|
|
5088
|
-
showCloseButton: !1,
|
|
5089
|
-
"aria-describedby": void 0,
|
|
5090
|
-
children: [
|
|
5091
|
-
/* @__PURE__ */ A(Ke, {
|
|
5092
|
-
className: "sr-only",
|
|
5093
|
-
children: "Span Detail"
|
|
5094
|
-
}),
|
|
5095
|
-
/* @__PURE__ */ A(Ge, {
|
|
5096
|
-
className: "sr-only",
|
|
5097
|
-
children: "Detailed view of a span"
|
|
5098
|
-
}),
|
|
5099
|
-
/* @__PURE__ */ A(Ie, {
|
|
5100
|
-
className: "h-full",
|
|
5101
|
-
children: e && /* @__PURE__ */ A(Is, {
|
|
5102
|
-
span: e,
|
|
5103
|
-
onClose: n
|
|
5104
|
-
})
|
|
5105
|
-
})
|
|
5106
|
-
]
|
|
5107
|
-
})
|
|
5108
|
-
});
|
|
5171
|
+
function zs({ span: e, onClose: t }) {
|
|
5172
|
+
return e ? /* @__PURE__ */ A(Bs, {
|
|
5173
|
+
span: e,
|
|
5174
|
+
onClose: t
|
|
5175
|
+
}) : null;
|
|
5109
5176
|
}
|
|
5110
|
-
function
|
|
5177
|
+
function Bs({ span: e, onClose: t }) {
|
|
5111
5178
|
let n = [
|
|
5112
5179
|
{
|
|
5113
5180
|
label: "Service",
|
|
@@ -5135,22 +5202,24 @@ function Is({ span: e, onClose: t }) {
|
|
|
5135
5202
|
},
|
|
5136
5203
|
{
|
|
5137
5204
|
label: "Start",
|
|
5138
|
-
value:
|
|
5205
|
+
value: Ts(e.startTime)
|
|
5139
5206
|
},
|
|
5140
5207
|
{
|
|
5141
5208
|
label: "Duration",
|
|
5142
|
-
value:
|
|
5209
|
+
value: Es(e.duration)
|
|
5143
5210
|
}
|
|
5144
5211
|
], r = Object.entries(e.attributes);
|
|
5145
|
-
return /* @__PURE__ */ j("
|
|
5146
|
-
|
|
5212
|
+
return /* @__PURE__ */ j("section", {
|
|
5213
|
+
"aria-label": "Span detail",
|
|
5214
|
+
className: "@container flex flex-col overflow-hidden rounded-lg border bg-card",
|
|
5215
|
+
"data-testid": "span-detail-panel",
|
|
5147
5216
|
children: [/* @__PURE__ */ j("div", {
|
|
5148
5217
|
className: "flex items-start justify-between gap-3 border-b px-5 py-4",
|
|
5149
5218
|
children: [/* @__PURE__ */ j("div", {
|
|
5150
5219
|
className: "flex min-w-0 flex-col gap-1.5",
|
|
5151
5220
|
children: [/* @__PURE__ */ j("div", {
|
|
5152
5221
|
className: "flex items-center gap-2",
|
|
5153
|
-
children: [/* @__PURE__ */ A(
|
|
5222
|
+
children: [/* @__PURE__ */ A(ws, { status: e.status }), /* @__PURE__ */ A("span", {
|
|
5154
5223
|
className: "text-[11px] font-medium uppercase tracking-wide text-muted-foreground/70",
|
|
5155
5224
|
children: e.serviceName
|
|
5156
5225
|
})]
|
|
@@ -5158,7 +5227,7 @@ function Is({ span: e, onClose: t }) {
|
|
|
5158
5227
|
className: "truncate text-sm font-semibold tracking-tight",
|
|
5159
5228
|
children: e.operationName
|
|
5160
5229
|
})]
|
|
5161
|
-
}), /* @__PURE__ */ A(
|
|
5230
|
+
}), t && /* @__PURE__ */ A(L, {
|
|
5162
5231
|
variant: "ghost",
|
|
5163
5232
|
size: "icon",
|
|
5164
5233
|
className: "size-7 shrink-0",
|
|
@@ -5166,22 +5235,22 @@ function Is({ span: e, onClose: t }) {
|
|
|
5166
5235
|
"aria-label": "Close span detail",
|
|
5167
5236
|
children: /* @__PURE__ */ A(wt, { className: "size-4" })
|
|
5168
5237
|
})]
|
|
5169
|
-
}), /* @__PURE__ */ j(
|
|
5170
|
-
|
|
5238
|
+
}), /* @__PURE__ */ j("div", {
|
|
5239
|
+
className: "grid gap-x-8 gap-y-6 p-5 @2xl:grid-cols-2 @2xl:items-start",
|
|
5171
5240
|
children: [
|
|
5172
|
-
/* @__PURE__ */ A(
|
|
5241
|
+
/* @__PURE__ */ A(Vs, {
|
|
5173
5242
|
title: "Overview",
|
|
5174
5243
|
children: /* @__PURE__ */ A($, { items: n })
|
|
5175
5244
|
}),
|
|
5176
|
-
r.length > 0 && /* @__PURE__ */ A(
|
|
5245
|
+
r.length > 0 && /* @__PURE__ */ A(Vs, {
|
|
5177
5246
|
title: "Attributes",
|
|
5178
5247
|
badge: r.length,
|
|
5179
5248
|
children: /* @__PURE__ */ A($, {
|
|
5180
5249
|
wrap: !0,
|
|
5181
|
-
items:
|
|
5250
|
+
items: Rs(e.attributes)
|
|
5182
5251
|
})
|
|
5183
5252
|
}),
|
|
5184
|
-
e.events.length > 0 && /* @__PURE__ */ A(
|
|
5253
|
+
e.events.length > 0 && /* @__PURE__ */ A(Vs, {
|
|
5185
5254
|
title: "Events",
|
|
5186
5255
|
badge: e.events.length,
|
|
5187
5256
|
children: /* @__PURE__ */ A("div", {
|
|
@@ -5195,16 +5264,16 @@ function Is({ span: e, onClose: t }) {
|
|
|
5195
5264
|
children: e.name
|
|
5196
5265
|
}), /* @__PURE__ */ A("span", {
|
|
5197
5266
|
className: "text-xs text-muted-foreground",
|
|
5198
|
-
children:
|
|
5267
|
+
children: Ts(e.timestampEpochMs)
|
|
5199
5268
|
})]
|
|
5200
5269
|
}), e.attributes && Object.keys(e.attributes).length > 0 && /* @__PURE__ */ A($, {
|
|
5201
5270
|
wrap: !0,
|
|
5202
|
-
items:
|
|
5271
|
+
items: Rs(e.attributes)
|
|
5203
5272
|
})]
|
|
5204
5273
|
}, `${e.name}-${t}`))
|
|
5205
5274
|
})
|
|
5206
5275
|
}),
|
|
5207
|
-
e.payloadLogs.length > 0 && /* @__PURE__ */ A(
|
|
5276
|
+
e.payloadLogs.length > 0 && /* @__PURE__ */ A(Vs, {
|
|
5208
5277
|
title: "Payload Logs",
|
|
5209
5278
|
badge: e.payloadLogs.length,
|
|
5210
5279
|
children: /* @__PURE__ */ A("div", {
|
|
@@ -5214,9 +5283,9 @@ function Is({ span: e, onClose: t }) {
|
|
|
5214
5283
|
children: [
|
|
5215
5284
|
/* @__PURE__ */ j("div", {
|
|
5216
5285
|
className: "flex items-baseline gap-2",
|
|
5217
|
-
children: [/* @__PURE__ */ A(
|
|
5286
|
+
children: [/* @__PURE__ */ A(Va, { level: e.severity }), /* @__PURE__ */ A("span", {
|
|
5218
5287
|
className: "text-xs text-muted-foreground",
|
|
5219
|
-
children:
|
|
5288
|
+
children: Ts(e.timestampEpochMs)
|
|
5220
5289
|
})]
|
|
5221
5290
|
}),
|
|
5222
5291
|
/* @__PURE__ */ A("pre", {
|
|
@@ -5225,7 +5294,7 @@ function Is({ span: e, onClose: t }) {
|
|
|
5225
5294
|
}),
|
|
5226
5295
|
e.attributes && Object.keys(e.attributes).length > 0 && /* @__PURE__ */ A($, {
|
|
5227
5296
|
wrap: !0,
|
|
5228
|
-
items:
|
|
5297
|
+
items: Rs(e.attributes)
|
|
5229
5298
|
})
|
|
5230
5299
|
]
|
|
5231
5300
|
}, `${e.timestampEpochMs}-${t}`))
|
|
@@ -5235,15 +5304,31 @@ function Is({ span: e, onClose: t }) {
|
|
|
5235
5304
|
})]
|
|
5236
5305
|
});
|
|
5237
5306
|
}
|
|
5307
|
+
function Vs({ title: e, badge: t, children: n }) {
|
|
5308
|
+
return /* @__PURE__ */ j("section", {
|
|
5309
|
+
className: "flex min-w-0 flex-col gap-2",
|
|
5310
|
+
children: [/* @__PURE__ */ j("div", {
|
|
5311
|
+
className: "flex items-center gap-2",
|
|
5312
|
+
children: [/* @__PURE__ */ A("h4", {
|
|
5313
|
+
className: "text-[11px] font-medium uppercase tracking-wide text-muted-foreground/70",
|
|
5314
|
+
children: e
|
|
5315
|
+
}), t !== void 0 && /* @__PURE__ */ A(I, {
|
|
5316
|
+
variant: "secondary",
|
|
5317
|
+
className: "text-[10px] font-semibold",
|
|
5318
|
+
children: t
|
|
5319
|
+
})]
|
|
5320
|
+
}), n]
|
|
5321
|
+
});
|
|
5322
|
+
}
|
|
5238
5323
|
//#endregion
|
|
5239
5324
|
//#region src/traces/detail/build-span-tree.ts
|
|
5240
|
-
var
|
|
5241
|
-
function
|
|
5325
|
+
var Hs = (e, t) => e.startTime - t.startTime;
|
|
5326
|
+
function Us(e) {
|
|
5242
5327
|
let t = /* @__PURE__ */ new Map();
|
|
5243
5328
|
for (let n of e) t.set(n.spanId, n);
|
|
5244
5329
|
return t;
|
|
5245
5330
|
}
|
|
5246
|
-
function
|
|
5331
|
+
function Ws(e) {
|
|
5247
5332
|
if (e.length === 0) return [];
|
|
5248
5333
|
let t = new Set(e.map((e) => e.spanId)), n = /* @__PURE__ */ new Map(), r = [];
|
|
5249
5334
|
for (let i of e) if (i.parentSpanId && t.has(i.parentSpanId)) {
|
|
@@ -5252,11 +5337,11 @@ function zs(e) {
|
|
|
5252
5337
|
} else r.push(i);
|
|
5253
5338
|
let i = (e) => ({
|
|
5254
5339
|
span: e,
|
|
5255
|
-
children: [...n.get(e.spanId) ?? []].sort(
|
|
5340
|
+
children: [...n.get(e.spanId) ?? []].sort(Hs).map(i)
|
|
5256
5341
|
});
|
|
5257
|
-
return [...r].sort(
|
|
5342
|
+
return [...r].sort(Hs).map(i);
|
|
5258
5343
|
}
|
|
5259
|
-
function
|
|
5344
|
+
function Gs(e) {
|
|
5260
5345
|
let t = [];
|
|
5261
5346
|
function n(e, r) {
|
|
5262
5347
|
t.push({
|
|
@@ -5270,12 +5355,12 @@ function Bs(e) {
|
|
|
5270
5355
|
}
|
|
5271
5356
|
//#endregion
|
|
5272
5357
|
//#region src/traces/detail/TraceLineage.tsx
|
|
5273
|
-
var
|
|
5358
|
+
var Ks = ne(() => import("./TraceLineageGraph.js")), qs = {
|
|
5274
5359
|
ok: "healthy",
|
|
5275
5360
|
error: "error",
|
|
5276
5361
|
unset: "inactive"
|
|
5277
5362
|
};
|
|
5278
|
-
function
|
|
5363
|
+
function Js(e) {
|
|
5279
5364
|
let t = new Set(e.spans.map((e) => e.spanId));
|
|
5280
5365
|
return {
|
|
5281
5366
|
nodes: e.spans.map((e) => ({
|
|
@@ -5283,8 +5368,8 @@ function Us(e) {
|
|
|
5283
5368
|
data: {
|
|
5284
5369
|
label: e.operationName,
|
|
5285
5370
|
description: e.serviceName,
|
|
5286
|
-
badge:
|
|
5287
|
-
status:
|
|
5371
|
+
badge: Es(e.duration),
|
|
5372
|
+
status: qs[e.status]
|
|
5288
5373
|
}
|
|
5289
5374
|
})),
|
|
5290
5375
|
edges: e.spans.filter((e) => !!e.parentSpanId && t.has(e.parentSpanId)).map((e) => ({
|
|
@@ -5295,20 +5380,20 @@ function Us(e) {
|
|
|
5295
5380
|
}))
|
|
5296
5381
|
};
|
|
5297
5382
|
}
|
|
5298
|
-
function
|
|
5299
|
-
let { nodes: o, edges: s } = E(() => e ?
|
|
5383
|
+
function Ys({ trace: e, onSpanClick: t, selectedSpanId: n, state: r, edgeAnimation: i = "flow", className: a }) {
|
|
5384
|
+
let { nodes: o, edges: s } = E(() => e ? Js(e) : {
|
|
5300
5385
|
nodes: [],
|
|
5301
5386
|
edges: []
|
|
5302
|
-
}, [e]), c = E(() =>
|
|
5387
|
+
}, [e]), c = E(() => Us(e?.spans ?? []), [e?.spans]), l = C((e) => {
|
|
5303
5388
|
if (!e) return;
|
|
5304
5389
|
let n = c.get(e.id);
|
|
5305
5390
|
n && t?.(n);
|
|
5306
5391
|
}, [c, t]), u = a ?? "h-[28rem]";
|
|
5307
|
-
return /* @__PURE__ */ A(
|
|
5308
|
-
fallback: /* @__PURE__ */ A(
|
|
5392
|
+
return /* @__PURE__ */ A(Qs, {
|
|
5393
|
+
fallback: /* @__PURE__ */ A(Zs, { className: u }),
|
|
5309
5394
|
children: /* @__PURE__ */ A(x, {
|
|
5310
|
-
fallback: /* @__PURE__ */ A(
|
|
5311
|
-
children: /* @__PURE__ */ A(
|
|
5395
|
+
fallback: /* @__PURE__ */ A(Xs, { className: u }),
|
|
5396
|
+
children: /* @__PURE__ */ A(Ks, {
|
|
5312
5397
|
nodes: o,
|
|
5313
5398
|
edges: s,
|
|
5314
5399
|
state: r,
|
|
@@ -5320,7 +5405,7 @@ function Ws({ trace: e, onSpanClick: t, selectedSpanId: n, state: r, edgeAnimati
|
|
|
5320
5405
|
})
|
|
5321
5406
|
});
|
|
5322
5407
|
}
|
|
5323
|
-
function
|
|
5408
|
+
function Xs({ className: e }) {
|
|
5324
5409
|
return /* @__PURE__ */ A("div", {
|
|
5325
5410
|
className: `flex animate-pulse items-center justify-center rounded-lg border border-border bg-card ${e}`,
|
|
5326
5411
|
role: "status",
|
|
@@ -5331,7 +5416,7 @@ function Gs({ className: e }) {
|
|
|
5331
5416
|
})
|
|
5332
5417
|
});
|
|
5333
5418
|
}
|
|
5334
|
-
function
|
|
5419
|
+
function Zs({ className: e }) {
|
|
5335
5420
|
return /* @__PURE__ */ j("div", {
|
|
5336
5421
|
className: `flex flex-col items-center justify-center gap-1 rounded-lg border border-border bg-card p-6 text-center ${e}`,
|
|
5337
5422
|
role: "alert",
|
|
@@ -5348,7 +5433,7 @@ function Ks({ className: e }) {
|
|
|
5348
5433
|
})]
|
|
5349
5434
|
});
|
|
5350
5435
|
}
|
|
5351
|
-
var
|
|
5436
|
+
var Qs = class extends y {
|
|
5352
5437
|
state = { hasError: !1 };
|
|
5353
5438
|
static getDerivedStateFromError() {
|
|
5354
5439
|
return { hasError: !0 };
|
|
@@ -5359,9 +5444,9 @@ var qs = class extends y {
|
|
|
5359
5444
|
render() {
|
|
5360
5445
|
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
5361
5446
|
}
|
|
5362
|
-
},
|
|
5363
|
-
function
|
|
5364
|
-
let t =
|
|
5447
|
+
}, $s = 1e6;
|
|
5448
|
+
function ec(e) {
|
|
5449
|
+
let t = Gs(Ws(e.spans)), n = e.startTime;
|
|
5365
5450
|
return t.map((e) => ({
|
|
5366
5451
|
spanId: e.span.spanId,
|
|
5367
5452
|
parentSpanId: e.span.parentSpanId,
|
|
@@ -5369,13 +5454,13 @@ function Ys(e) {
|
|
|
5369
5454
|
serviceName: e.span.serviceName,
|
|
5370
5455
|
kind: e.span.kind,
|
|
5371
5456
|
status: e.span.status,
|
|
5372
|
-
startOffsetNs: (e.span.startTime - n) *
|
|
5373
|
-
durationNs: e.span.duration *
|
|
5457
|
+
startOffsetNs: (e.span.startTime - n) * $s,
|
|
5458
|
+
durationNs: e.span.duration * $s,
|
|
5374
5459
|
depth: e.depth
|
|
5375
5460
|
}));
|
|
5376
5461
|
}
|
|
5377
|
-
function
|
|
5378
|
-
let a = E(() => e ?
|
|
5462
|
+
function tc({ trace: e, onSpanClick: t, selectedSpanId: n, state: r, className: i }) {
|
|
5463
|
+
let a = E(() => e ? ec(e) : [], [e]), o = E(() => Us(e?.spans ?? []), [e?.spans]);
|
|
5379
5464
|
return /* @__PURE__ */ A(Ht, {
|
|
5380
5465
|
spans: a,
|
|
5381
5466
|
state: r,
|
|
@@ -5390,19 +5475,19 @@ function Xs({ trace: e, onSpanClick: t, selectedSpanId: n, state: r, className:
|
|
|
5390
5475
|
}
|
|
5391
5476
|
//#endregion
|
|
5392
5477
|
//#region src/traces/detail/TraceDetailShell.tsx
|
|
5393
|
-
var
|
|
5478
|
+
var nc = [{
|
|
5394
5479
|
key: "timeline",
|
|
5395
5480
|
label: "Timeline"
|
|
5396
5481
|
}, {
|
|
5397
5482
|
key: "lineage",
|
|
5398
5483
|
label: "Lineage"
|
|
5399
5484
|
}];
|
|
5400
|
-
function
|
|
5485
|
+
function rc({ trace: e }) {
|
|
5401
5486
|
let [t, n] = O("timeline"), [r, i] = O(void 0), a = C((e) => i(e), []), o = C(() => i(void 0), []), s = r && e.spans.includes(r) ? r : void 0;
|
|
5402
5487
|
return /* @__PURE__ */ j("div", {
|
|
5403
5488
|
className: "flex flex-col gap-5 p-6",
|
|
5404
5489
|
children: [
|
|
5405
|
-
/* @__PURE__ */ A(
|
|
5490
|
+
/* @__PURE__ */ A(ic, { trace: e }),
|
|
5406
5491
|
/* @__PURE__ */ j(Je, {
|
|
5407
5492
|
value: t,
|
|
5408
5493
|
onValueChange: (e) => n(e),
|
|
@@ -5411,14 +5496,14 @@ function Qs({ trace: e }) {
|
|
|
5411
5496
|
/* @__PURE__ */ A(Xe, {
|
|
5412
5497
|
variant: "line",
|
|
5413
5498
|
"aria-label": "Trace view",
|
|
5414
|
-
children:
|
|
5499
|
+
children: nc.map((e) => /* @__PURE__ */ A(Ze, {
|
|
5415
5500
|
value: e.key,
|
|
5416
5501
|
children: e.label
|
|
5417
5502
|
}, e.key))
|
|
5418
5503
|
}),
|
|
5419
5504
|
/* @__PURE__ */ A(Ye, {
|
|
5420
5505
|
value: "timeline",
|
|
5421
|
-
children: /* @__PURE__ */ A(
|
|
5506
|
+
children: /* @__PURE__ */ A(tc, {
|
|
5422
5507
|
trace: e,
|
|
5423
5508
|
onSpanClick: a,
|
|
5424
5509
|
selectedSpanId: s?.spanId
|
|
@@ -5426,7 +5511,7 @@ function Qs({ trace: e }) {
|
|
|
5426
5511
|
}),
|
|
5427
5512
|
/* @__PURE__ */ A(Ye, {
|
|
5428
5513
|
value: "lineage",
|
|
5429
|
-
children: /* @__PURE__ */ A(
|
|
5514
|
+
children: /* @__PURE__ */ A(Ys, {
|
|
5430
5515
|
trace: e,
|
|
5431
5516
|
onSpanClick: a,
|
|
5432
5517
|
selectedSpanId: s?.spanId
|
|
@@ -5434,15 +5519,14 @@ function Qs({ trace: e }) {
|
|
|
5434
5519
|
})
|
|
5435
5520
|
]
|
|
5436
5521
|
}),
|
|
5437
|
-
/* @__PURE__ */ A(
|
|
5522
|
+
s && /* @__PURE__ */ A(zs, {
|
|
5438
5523
|
span: s,
|
|
5439
|
-
open: !!s,
|
|
5440
5524
|
onClose: o
|
|
5441
5525
|
})
|
|
5442
5526
|
]
|
|
5443
5527
|
});
|
|
5444
5528
|
}
|
|
5445
|
-
function
|
|
5529
|
+
function ic({ trace: e }) {
|
|
5446
5530
|
let t = [
|
|
5447
5531
|
{
|
|
5448
5532
|
label: "Service",
|
|
@@ -5450,7 +5534,7 @@ function $s({ trace: e }) {
|
|
|
5450
5534
|
},
|
|
5451
5535
|
{
|
|
5452
5536
|
label: "Duration",
|
|
5453
|
-
value:
|
|
5537
|
+
value: Es(e.duration)
|
|
5454
5538
|
},
|
|
5455
5539
|
{
|
|
5456
5540
|
label: "Spans",
|
|
@@ -5458,7 +5542,7 @@ function $s({ trace: e }) {
|
|
|
5458
5542
|
},
|
|
5459
5543
|
{
|
|
5460
5544
|
label: "Started",
|
|
5461
|
-
value:
|
|
5545
|
+
value: Ts(e.startTime)
|
|
5462
5546
|
}
|
|
5463
5547
|
];
|
|
5464
5548
|
return /* @__PURE__ */ j("header", {
|
|
@@ -5466,7 +5550,7 @@ function $s({ trace: e }) {
|
|
|
5466
5550
|
children: [
|
|
5467
5551
|
/* @__PURE__ */ j("div", {
|
|
5468
5552
|
className: "flex items-center gap-3",
|
|
5469
|
-
children: [/* @__PURE__ */ A(
|
|
5553
|
+
children: [/* @__PURE__ */ A(ws, { status: e.status }), /* @__PURE__ */ A("h2", {
|
|
5470
5554
|
className: "truncate text-lg font-semibold tracking-tight",
|
|
5471
5555
|
children: e.rootOperationName
|
|
5472
5556
|
})]
|
|
@@ -5493,13 +5577,13 @@ function $s({ trace: e }) {
|
|
|
5493
5577
|
}
|
|
5494
5578
|
//#endregion
|
|
5495
5579
|
//#region src/traces/detail/TraceDetailStates.tsx
|
|
5496
|
-
function
|
|
5580
|
+
function ac() {
|
|
5497
5581
|
return /* @__PURE__ */ A("div", {
|
|
5498
5582
|
className: "p-6",
|
|
5499
|
-
children: /* @__PURE__ */ A(
|
|
5583
|
+
children: /* @__PURE__ */ A(tc, { state: "loading" })
|
|
5500
5584
|
});
|
|
5501
5585
|
}
|
|
5502
|
-
function
|
|
5586
|
+
function oc({ onRetry: e }) {
|
|
5503
5587
|
return /* @__PURE__ */ j("div", {
|
|
5504
5588
|
className: "flex flex-col items-center gap-3 p-12",
|
|
5505
5589
|
children: [
|
|
@@ -5508,7 +5592,7 @@ function tc({ onRetry: e }) {
|
|
|
5508
5592
|
className: "text-sm text-destructive",
|
|
5509
5593
|
children: "Failed to load trace details"
|
|
5510
5594
|
}),
|
|
5511
|
-
/* @__PURE__ */ A(
|
|
5595
|
+
/* @__PURE__ */ A(L, {
|
|
5512
5596
|
variant: "outline",
|
|
5513
5597
|
size: "sm",
|
|
5514
5598
|
onClick: e,
|
|
@@ -5517,13 +5601,13 @@ function tc({ onRetry: e }) {
|
|
|
5517
5601
|
]
|
|
5518
5602
|
});
|
|
5519
5603
|
}
|
|
5520
|
-
function
|
|
5604
|
+
function sc({ onBack: e }) {
|
|
5521
5605
|
return /* @__PURE__ */ j("div", {
|
|
5522
5606
|
className: "flex flex-col items-center justify-center gap-4 p-12 text-center",
|
|
5523
5607
|
children: [/* @__PURE__ */ A("p", {
|
|
5524
5608
|
className: "text-sm font-medium text-muted-foreground",
|
|
5525
5609
|
children: "Trace not found"
|
|
5526
|
-
}), /* @__PURE__ */ j(
|
|
5610
|
+
}), /* @__PURE__ */ j(L, {
|
|
5527
5611
|
variant: "outline",
|
|
5528
5612
|
size: "sm",
|
|
5529
5613
|
onClick: e,
|
|
@@ -5533,7 +5617,7 @@ function nc({ onBack: e }) {
|
|
|
5533
5617
|
}
|
|
5534
5618
|
//#endregion
|
|
5535
5619
|
//#region src/traces/detail/TraceDetailPage.tsx
|
|
5536
|
-
function
|
|
5620
|
+
function cc({ apiId: e }) {
|
|
5537
5621
|
let t = Xt(), n = Yt(), r = e ?? t.apiId ?? "", i = t.traceId, { data: a, isLoading: o, isError: s, refetch: c } = jn({
|
|
5538
5622
|
apiId: r,
|
|
5539
5623
|
traceId: i
|
|
@@ -5542,54 +5626,108 @@ function rc({ apiId: e }) {
|
|
|
5542
5626
|
className: "flex flex-col",
|
|
5543
5627
|
children: [/* @__PURE__ */ A("div", {
|
|
5544
5628
|
className: "border-b px-6 py-3",
|
|
5545
|
-
children: /* @__PURE__ */ j(
|
|
5629
|
+
children: /* @__PURE__ */ j(L, {
|
|
5546
5630
|
variant: "ghost",
|
|
5547
5631
|
size: "sm",
|
|
5548
5632
|
onClick: l,
|
|
5549
5633
|
children: [/* @__PURE__ */ A(nt, { className: "mr-1.5 size-4" }), "Back to traces"]
|
|
5550
5634
|
})
|
|
5551
|
-
}), o ? /* @__PURE__ */ A(
|
|
5635
|
+
}), o ? /* @__PURE__ */ A(ac, {}) : s ? /* @__PURE__ */ A(oc, { onRetry: () => c() }) : a ? /* @__PURE__ */ A(rc, { trace: a }) : /* @__PURE__ */ A(sc, { onBack: l })]
|
|
5552
5636
|
});
|
|
5553
5637
|
}
|
|
5554
5638
|
//#endregion
|
|
5555
5639
|
//#region src/traces/detail/TraceDetailDrawer.tsx
|
|
5556
|
-
function
|
|
5557
|
-
let { data:
|
|
5640
|
+
function lc({ apiId: e, traceId: t, onClose: n, onNavigatePrev: r, onNavigateNext: i, hasPrev: a = !0, hasNext: o = !0 }) {
|
|
5641
|
+
let { data: s, isLoading: c, isError: l, refetch: u } = jn({
|
|
5558
5642
|
apiId: e,
|
|
5559
5643
|
traceId: t,
|
|
5560
5644
|
keepPreviousData: !0
|
|
5561
5645
|
});
|
|
5562
|
-
return /* @__PURE__ */
|
|
5646
|
+
return /* @__PURE__ */ j(cs, {
|
|
5563
5647
|
open: !!t,
|
|
5564
5648
|
onClose: n,
|
|
5565
5649
|
onNavigatePrev: r,
|
|
5566
5650
|
onNavigateNext: i,
|
|
5567
|
-
children:
|
|
5651
|
+
children: [/* @__PURE__ */ A(uc, {
|
|
5652
|
+
onClose: n,
|
|
5653
|
+
onNavigatePrev: r,
|
|
5654
|
+
onNavigateNext: i,
|
|
5655
|
+
hasPrev: a,
|
|
5656
|
+
hasNext: o
|
|
5657
|
+
}), t ? l ? /* @__PURE__ */ A(oc, { onRetry: () => u() }) : s ? /* @__PURE__ */ A(rc, { trace: s }) : c ? /* @__PURE__ */ A(ac, {}) : null : s ? /* @__PURE__ */ A(rc, { trace: s }) : null]
|
|
5658
|
+
});
|
|
5659
|
+
}
|
|
5660
|
+
function uc({ onClose: e, onNavigatePrev: t, onNavigateNext: n, hasPrev: r, hasNext: i }) {
|
|
5661
|
+
let { expanded: a, setExpanded: o } = as();
|
|
5662
|
+
return /* @__PURE__ */ j("div", {
|
|
5663
|
+
className: "sticky top-0 z-10 flex items-center justify-between gap-1 border-b bg-background/95 px-3 py-2 backdrop-blur",
|
|
5664
|
+
role: "toolbar",
|
|
5665
|
+
"aria-label": "Trace detail toolbar",
|
|
5666
|
+
children: [/* @__PURE__ */ A("div", {
|
|
5667
|
+
className: "flex items-center gap-0.5",
|
|
5668
|
+
children: !!(t ?? n) && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(L, {
|
|
5669
|
+
variant: "ghost",
|
|
5670
|
+
size: "icon",
|
|
5671
|
+
className: "size-7",
|
|
5672
|
+
onClick: t,
|
|
5673
|
+
disabled: !r,
|
|
5674
|
+
"aria-label": "Previous trace",
|
|
5675
|
+
children: /* @__PURE__ */ A(nt, { className: "size-4" })
|
|
5676
|
+
}), /* @__PURE__ */ A(L, {
|
|
5677
|
+
variant: "ghost",
|
|
5678
|
+
size: "icon",
|
|
5679
|
+
className: "size-7",
|
|
5680
|
+
onClick: n,
|
|
5681
|
+
disabled: !i,
|
|
5682
|
+
"aria-label": "Next trace",
|
|
5683
|
+
children: /* @__PURE__ */ A(rt, { className: "size-4" })
|
|
5684
|
+
})] })
|
|
5685
|
+
}), /* @__PURE__ */ j("div", {
|
|
5686
|
+
className: "flex items-center gap-0.5",
|
|
5687
|
+
children: [/* @__PURE__ */ A(V, { children: /* @__PURE__ */ j(z, { children: [/* @__PURE__ */ A(H, {
|
|
5688
|
+
asChild: !0,
|
|
5689
|
+
children: /* @__PURE__ */ A(L, {
|
|
5690
|
+
variant: "ghost",
|
|
5691
|
+
size: "icon",
|
|
5692
|
+
className: "size-7",
|
|
5693
|
+
onClick: () => o(!a),
|
|
5694
|
+
"aria-label": a ? "Exit full screen" : "Full screen",
|
|
5695
|
+
children: A(a ? vt : ft, { className: "size-4" })
|
|
5696
|
+
})
|
|
5697
|
+
}), /* @__PURE__ */ A(B, { children: a ? "Exit full screen" : "Full screen" })] }) }), /* @__PURE__ */ A(L, {
|
|
5698
|
+
variant: "ghost",
|
|
5699
|
+
size: "icon",
|
|
5700
|
+
className: "size-7",
|
|
5701
|
+
onClick: e,
|
|
5702
|
+
"aria-label": "Close trace detail",
|
|
5703
|
+
children: /* @__PURE__ */ A(wt, { className: "size-4" })
|
|
5704
|
+
})]
|
|
5705
|
+
})]
|
|
5568
5706
|
});
|
|
5569
5707
|
}
|
|
5570
5708
|
//#endregion
|
|
5571
5709
|
//#region src/data-sources/filter-serialization.ts
|
|
5572
|
-
var
|
|
5710
|
+
var dc = [
|
|
5573
5711
|
"eq",
|
|
5574
5712
|
"in",
|
|
5575
5713
|
"lte",
|
|
5576
5714
|
"gte"
|
|
5577
5715
|
];
|
|
5578
|
-
function
|
|
5579
|
-
return
|
|
5716
|
+
function fc(e) {
|
|
5717
|
+
return dc.includes(e);
|
|
5580
5718
|
}
|
|
5581
|
-
var
|
|
5719
|
+
var pc = {
|
|
5582
5720
|
eq: "EQ",
|
|
5583
5721
|
in: "IN",
|
|
5584
5722
|
lte: "LTE",
|
|
5585
5723
|
gte: "GTE"
|
|
5586
5724
|
};
|
|
5587
|
-
function
|
|
5588
|
-
if (!
|
|
5725
|
+
function mc(e) {
|
|
5726
|
+
if (!fc(e.operator)) throw Error(`[gamma-lib-observability] Filter operator "${e.operator}" on field "${e.field}" is not supported by the Gravitee Management v2 API. Supported operators: ${dc.join(", ")}.`);
|
|
5589
5727
|
let t = e.value[0];
|
|
5590
5728
|
if (t === void 0) throw Error(`[gamma-lib-observability] Filter on field "${e.field}" with operator "${e.operator}" has no value — every supported operator requires at least one value.`);
|
|
5591
5729
|
switch (e.operator) {
|
|
5592
|
-
case "eq": return
|
|
5730
|
+
case "eq": return hc(e, "eq", "in"), {
|
|
5593
5731
|
name: e.field,
|
|
5594
5732
|
operator: "EQ",
|
|
5595
5733
|
value: t
|
|
@@ -5601,11 +5739,11 @@ function cc(e) {
|
|
|
5601
5739
|
};
|
|
5602
5740
|
case "lte":
|
|
5603
5741
|
case "gte": {
|
|
5604
|
-
|
|
5605
|
-
let n =
|
|
5742
|
+
hc(e, e.operator);
|
|
5743
|
+
let n = gc(e, t);
|
|
5606
5744
|
return {
|
|
5607
5745
|
name: e.field,
|
|
5608
|
-
operator:
|
|
5746
|
+
operator: pc[e.operator],
|
|
5609
5747
|
value: n
|
|
5610
5748
|
};
|
|
5611
5749
|
}
|
|
@@ -5615,50 +5753,50 @@ function cc(e) {
|
|
|
5615
5753
|
}
|
|
5616
5754
|
}
|
|
5617
5755
|
}
|
|
5618
|
-
function
|
|
5756
|
+
function hc(e, t, n) {
|
|
5619
5757
|
if (e.value.length <= 1) return;
|
|
5620
5758
|
let r = n ? ` Use "${n}" for multi-value membership.` : "";
|
|
5621
5759
|
throw Error(`[gamma-lib-observability] Filter on field "${e.field}" with operator "${t}" received ${e.value.length} values; "${t}" expects a single value.${r}`);
|
|
5622
5760
|
}
|
|
5623
|
-
function
|
|
5761
|
+
function gc(e, t) {
|
|
5624
5762
|
let n = t.trim();
|
|
5625
5763
|
if (n === "") throw Error(`[gamma-lib-observability] Filter on field "${e.field}" with operator "${e.operator}" expects a numeric value but received an empty string.`);
|
|
5626
5764
|
let r = Number(n);
|
|
5627
5765
|
if (Number.isNaN(r)) throw Error(`[gamma-lib-observability] Filter on field "${e.field}" with operator "${e.operator}" expects a numeric value but received "${t}".`);
|
|
5628
5766
|
return r;
|
|
5629
5767
|
}
|
|
5630
|
-
function
|
|
5631
|
-
if (e?.length) return e.map(
|
|
5768
|
+
function _c(e) {
|
|
5769
|
+
if (e?.length) return e.map(mc);
|
|
5632
5770
|
}
|
|
5633
5771
|
//#endregion
|
|
5634
5772
|
//#region src/data-sources/http-utils.ts
|
|
5635
|
-
function
|
|
5773
|
+
function vc(e) {
|
|
5636
5774
|
if (e) return typeof e == "function" ? e() : e;
|
|
5637
5775
|
}
|
|
5638
|
-
function
|
|
5776
|
+
function yc(...e) {
|
|
5639
5777
|
let t = new Headers();
|
|
5640
5778
|
for (let n of e) n && new Headers(n).forEach((e, n) => t.set(n, e));
|
|
5641
5779
|
return t;
|
|
5642
5780
|
}
|
|
5643
5781
|
//#endregion
|
|
5644
5782
|
//#region src/data-sources/http-data-source.ts
|
|
5645
|
-
var
|
|
5783
|
+
var bc = {
|
|
5646
5784
|
name: "HTTP_REQUESTS",
|
|
5647
5785
|
measures: [rn]
|
|
5648
5786
|
};
|
|
5649
|
-
function
|
|
5787
|
+
function xc(e) {
|
|
5650
5788
|
return e.metrics.map((e) => ({
|
|
5651
5789
|
name: e.name,
|
|
5652
5790
|
unit: e.unit,
|
|
5653
5791
|
measures: e.measures ?? []
|
|
5654
5792
|
}));
|
|
5655
5793
|
}
|
|
5656
|
-
function
|
|
5794
|
+
function Sc(e, t = "", n = "") {
|
|
5657
5795
|
let r = [];
|
|
5658
5796
|
for (let i of e) {
|
|
5659
5797
|
let e = t ? `${t} / ${i.key}` : i.key, a = n ? `${n} › ${i.name ?? i.key}` : i.name ?? i.key;
|
|
5660
5798
|
if (i.type === "GROUP" && i.buckets?.length) {
|
|
5661
|
-
r.push(...
|
|
5799
|
+
r.push(...Sc(i.buckets, e, a));
|
|
5662
5800
|
continue;
|
|
5663
5801
|
}
|
|
5664
5802
|
r.push({
|
|
@@ -5669,12 +5807,12 @@ function gc(e, t = "", n = "") {
|
|
|
5669
5807
|
}
|
|
5670
5808
|
return r;
|
|
5671
5809
|
}
|
|
5672
|
-
function
|
|
5810
|
+
function Cc(e) {
|
|
5673
5811
|
let t = [];
|
|
5674
|
-
for (let n of e.metrics) n.buckets && t.push(...
|
|
5812
|
+
for (let n of e.metrics) n.buckets && t.push(...Sc(n.buckets));
|
|
5675
5813
|
return t;
|
|
5676
5814
|
}
|
|
5677
|
-
function
|
|
5815
|
+
function wc(e) {
|
|
5678
5816
|
let t = [];
|
|
5679
5817
|
for (let n of e.metrics) if (n.buckets) if (n.buckets.some((e) => e.type === "GROUP" && e.buckets?.length)) {
|
|
5680
5818
|
let e = /* @__PURE__ */ new Map();
|
|
@@ -5711,47 +5849,47 @@ function vc(e) {
|
|
|
5711
5849
|
}
|
|
5712
5850
|
return t;
|
|
5713
5851
|
}
|
|
5714
|
-
function
|
|
5852
|
+
function Tc(e) {
|
|
5715
5853
|
return {
|
|
5716
5854
|
...e,
|
|
5717
5855
|
measures: e.measures?.length ? e.measures : [rn]
|
|
5718
5856
|
};
|
|
5719
5857
|
}
|
|
5720
|
-
function
|
|
5721
|
-
let t =
|
|
5722
|
-
return t.metrics = e.metrics.map(
|
|
5858
|
+
function Ec(e) {
|
|
5859
|
+
let t = kc(e);
|
|
5860
|
+
return t.metrics = e.metrics.map(Ac), t;
|
|
5723
5861
|
}
|
|
5724
|
-
function
|
|
5725
|
-
let t =
|
|
5726
|
-
return t.interval = e.interval, t.metrics = e.metrics.map(
|
|
5862
|
+
function Dc(e) {
|
|
5863
|
+
let t = kc(e);
|
|
5864
|
+
return t.interval = e.interval, t.metrics = e.metrics.map(Ac), e.by?.length && (t.by = e.by), e.ranges?.length && (t.ranges = e.ranges), e.limit !== void 0 && (t.limit = e.limit), t;
|
|
5727
5865
|
}
|
|
5728
|
-
function
|
|
5729
|
-
let n =
|
|
5730
|
-
return n.by = e.by, n.metrics = (e.metrics?.length ? e.metrics : [t]).map(
|
|
5866
|
+
function Oc(e, t) {
|
|
5867
|
+
let n = kc(e);
|
|
5868
|
+
return n.by = e.by, n.metrics = (e.metrics?.length ? e.metrics : [t]).map(Ac), e.ranges?.length && (n.ranges = e.ranges), e.limit !== void 0 && (n.limit = e.limit), n;
|
|
5731
5869
|
}
|
|
5732
|
-
function
|
|
5870
|
+
function kc(e) {
|
|
5733
5871
|
let t = mi(e.timeRange), n = { timeRange: {
|
|
5734
5872
|
from: new Date(t.from).toISOString(),
|
|
5735
5873
|
to: new Date(t.to).toISOString()
|
|
5736
|
-
} }, r =
|
|
5874
|
+
} }, r = _c(e.filters);
|
|
5737
5875
|
return r && (n.filters = r), n;
|
|
5738
5876
|
}
|
|
5739
|
-
function
|
|
5740
|
-
let t =
|
|
5877
|
+
function Ac(e) {
|
|
5878
|
+
let t = Tc(e), n = {
|
|
5741
5879
|
name: t.name,
|
|
5742
5880
|
measures: t.measures
|
|
5743
|
-
}, r =
|
|
5881
|
+
}, r = _c(e.filters);
|
|
5744
5882
|
return r && (n.filters = r), "sorts" in e && e.sorts?.length && (n.sorts = e.sorts), n;
|
|
5745
5883
|
}
|
|
5746
|
-
function
|
|
5884
|
+
function jc(e, t) {
|
|
5747
5885
|
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = {
|
|
5748
|
-
name: t?.defaultFacetMetric?.name ??
|
|
5749
|
-
measures: t?.defaultFacetMetric?.measures?.length ? [...t.defaultFacetMetric.measures] : [...
|
|
5886
|
+
name: t?.defaultFacetMetric?.name ?? bc.name,
|
|
5887
|
+
measures: t?.defaultFacetMetric?.measures?.length ? [...t.defaultFacetMetric.measures] : [...bc.measures]
|
|
5750
5888
|
};
|
|
5751
5889
|
async function a(i, a, o) {
|
|
5752
5890
|
let s = {
|
|
5753
5891
|
method: "POST",
|
|
5754
|
-
headers:
|
|
5892
|
+
headers: yc({ "Content-Type": "application/json" }, vc(t?.headers)),
|
|
5755
5893
|
body: JSON.stringify(a),
|
|
5756
5894
|
signal: o
|
|
5757
5895
|
};
|
|
@@ -5762,19 +5900,19 @@ function Tc(e, t) {
|
|
|
5762
5900
|
}
|
|
5763
5901
|
return {
|
|
5764
5902
|
async fetchTimeSeries(e) {
|
|
5765
|
-
return
|
|
5903
|
+
return wc(await a("/analytics/time-series", Dc(e), e.signal));
|
|
5766
5904
|
},
|
|
5767
5905
|
async fetchFacets(e) {
|
|
5768
|
-
return
|
|
5906
|
+
return Cc(await a("/analytics/facets", Oc(e, i), e.signal));
|
|
5769
5907
|
},
|
|
5770
5908
|
async fetchMeasures(e) {
|
|
5771
|
-
return
|
|
5909
|
+
return xc(await a("/analytics/measures", Ec(e), e.signal));
|
|
5772
5910
|
}
|
|
5773
5911
|
};
|
|
5774
5912
|
}
|
|
5775
5913
|
//#endregion
|
|
5776
5914
|
//#region src/data-sources/http-filter-source.ts
|
|
5777
|
-
function
|
|
5915
|
+
function Mc(e) {
|
|
5778
5916
|
return {
|
|
5779
5917
|
EQ: "eq",
|
|
5780
5918
|
IN: "in",
|
|
@@ -5787,14 +5925,14 @@ function Ec(e) {
|
|
|
5787
5925
|
CONTAINS: "contains"
|
|
5788
5926
|
}[e] ?? e.toLowerCase();
|
|
5789
5927
|
}
|
|
5790
|
-
function
|
|
5928
|
+
function Nc(e) {
|
|
5791
5929
|
return e === "ENUM" ? "enum" : "async";
|
|
5792
5930
|
}
|
|
5793
|
-
function
|
|
5931
|
+
function Pc(e, t) {
|
|
5794
5932
|
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials;
|
|
5795
5933
|
function i(e) {
|
|
5796
|
-
let n = { ...e }, i =
|
|
5797
|
-
return (e?.headers || i) && (n.headers =
|
|
5934
|
+
let n = { ...e }, i = vc(t?.headers);
|
|
5935
|
+
return (e?.headers || i) && (n.headers = yc(e?.headers, i)), r && (n.credentials = r), n;
|
|
5798
5936
|
}
|
|
5799
5937
|
function a(t) {
|
|
5800
5938
|
return async (r) => {
|
|
@@ -5820,7 +5958,7 @@ function Oc(e, t) {
|
|
|
5820
5958
|
let r = await n(`${e}/observability/filters/definition`, i({ signal: t }));
|
|
5821
5959
|
if (!r.ok) throw Error(`[gamma-lib-observability] HTTP ${r.status} on GET filters/definition`);
|
|
5822
5960
|
return (await r.json()).data.map((e) => {
|
|
5823
|
-
let t =
|
|
5961
|
+
let t = Nc(e.type), n = e.operators.map(Mc), r = e.apiTypes;
|
|
5824
5962
|
if (t === "enum") {
|
|
5825
5963
|
let i = (e.enumValues ?? []).map((e) => ({
|
|
5826
5964
|
value: e,
|
|
@@ -5861,13 +5999,13 @@ function Oc(e, t) {
|
|
|
5861
5999
|
}
|
|
5862
6000
|
//#endregion
|
|
5863
6001
|
//#region src/data-sources/http-logs-source.ts
|
|
5864
|
-
var
|
|
5865
|
-
function
|
|
5866
|
-
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.searchPath ??
|
|
6002
|
+
var Fc = "/logs/search", Ic = 10 * 365.25 * 864e5;
|
|
6003
|
+
function Lc(e, t) {
|
|
6004
|
+
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.searchPath ?? Fc, a;
|
|
5867
6005
|
function o(e) {
|
|
5868
6006
|
let n = {
|
|
5869
6007
|
method: "POST",
|
|
5870
|
-
headers:
|
|
6008
|
+
headers: yc({ "Content-Type": "application/json" }, e, vc(t?.headers))
|
|
5871
6009
|
};
|
|
5872
6010
|
return r && (n.credentials = r), n;
|
|
5873
6011
|
}
|
|
@@ -5887,7 +6025,7 @@ function jc(e, t) {
|
|
|
5887
6025
|
let r = {
|
|
5888
6026
|
timeRange: c(a ?? {
|
|
5889
6027
|
type: "absolute",
|
|
5890
|
-
from: Date.now() -
|
|
6028
|
+
from: Date.now() - Ic,
|
|
5891
6029
|
to: Date.now()
|
|
5892
6030
|
}),
|
|
5893
6031
|
filters: [{
|
|
@@ -5905,7 +6043,7 @@ function jc(e, t) {
|
|
|
5905
6043
|
async fetchLogs(e) {
|
|
5906
6044
|
let t = mi(e.timeRange);
|
|
5907
6045
|
a = t;
|
|
5908
|
-
let r =
|
|
6046
|
+
let r = _c(e.filters), l = { timeRange: c(t) };
|
|
5909
6047
|
r && (l.filters = r);
|
|
5910
6048
|
let u = o();
|
|
5911
6049
|
u.body = JSON.stringify(l), e.signal && (u.signal = e.signal);
|
|
@@ -5924,30 +6062,30 @@ function jc(e, t) {
|
|
|
5924
6062
|
}
|
|
5925
6063
|
//#endregion
|
|
5926
6064
|
//#region src/data-sources/http-traces-source.ts
|
|
5927
|
-
var
|
|
5928
|
-
function
|
|
6065
|
+
var Rc = "/observability/traces/search";
|
|
6066
|
+
function zc(e) {
|
|
5929
6067
|
return e / 1e6;
|
|
5930
6068
|
}
|
|
5931
|
-
function
|
|
6069
|
+
function Bc(e) {
|
|
5932
6070
|
return e;
|
|
5933
6071
|
}
|
|
5934
|
-
function
|
|
6072
|
+
function Vc(e) {
|
|
5935
6073
|
return {
|
|
5936
6074
|
name: e.name,
|
|
5937
6075
|
timestampEpochMs: e.timestampEpochMs,
|
|
5938
|
-
attributes:
|
|
6076
|
+
attributes: Bc(e.attributes)
|
|
5939
6077
|
};
|
|
5940
6078
|
}
|
|
5941
|
-
function
|
|
6079
|
+
function Hc(e) {
|
|
5942
6080
|
return {
|
|
5943
6081
|
timestampEpochMs: e.timestampEpochMs,
|
|
5944
6082
|
body: e.body,
|
|
5945
6083
|
severity: e.severity,
|
|
5946
|
-
attributes:
|
|
6084
|
+
attributes: Bc(e.attributes)
|
|
5947
6085
|
};
|
|
5948
6086
|
}
|
|
5949
|
-
function
|
|
5950
|
-
let t =
|
|
6087
|
+
function Uc(e) {
|
|
6088
|
+
let t = zc(e.durationNanos);
|
|
5951
6089
|
return {
|
|
5952
6090
|
traceId: e.traceId,
|
|
5953
6091
|
rootOperationName: e.rootOperationName,
|
|
@@ -5958,8 +6096,8 @@ function Lc(e) {
|
|
|
5958
6096
|
status: e.status
|
|
5959
6097
|
};
|
|
5960
6098
|
}
|
|
5961
|
-
function
|
|
5962
|
-
let t = e.startTimeEpochMs, n =
|
|
6099
|
+
function Wc(e) {
|
|
6100
|
+
let t = e.startTimeEpochMs, n = zc(e.durationNanos);
|
|
5963
6101
|
return {
|
|
5964
6102
|
traceId: e.traceId,
|
|
5965
6103
|
spanId: e.spanId,
|
|
@@ -5972,27 +6110,27 @@ function Rc(e) {
|
|
|
5972
6110
|
status: e.status,
|
|
5973
6111
|
kind: e.kind,
|
|
5974
6112
|
attributes: e.attributes,
|
|
5975
|
-
events: e.events.map(
|
|
5976
|
-
payloadLogs: e.payloadLogs.map(
|
|
6113
|
+
events: e.events.map(Vc),
|
|
6114
|
+
payloadLogs: e.payloadLogs.map(Hc)
|
|
5977
6115
|
};
|
|
5978
6116
|
}
|
|
5979
|
-
function
|
|
5980
|
-
let t = e.spans.map(
|
|
6117
|
+
function Gc(e) {
|
|
6118
|
+
let t = e.spans.map(Wc);
|
|
5981
6119
|
return {
|
|
5982
|
-
...
|
|
6120
|
+
...Uc(e),
|
|
5983
6121
|
spanCount: t.length,
|
|
5984
6122
|
spans: t
|
|
5985
6123
|
};
|
|
5986
6124
|
}
|
|
5987
|
-
function
|
|
6125
|
+
function Kc(e) {
|
|
5988
6126
|
return e.endsWith("/search") ? e.slice(0, -7) : e;
|
|
5989
6127
|
}
|
|
5990
|
-
function
|
|
5991
|
-
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.searchPath ??
|
|
6128
|
+
function qc(e, t) {
|
|
6129
|
+
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.searchPath ?? Rc, a = Kc(i);
|
|
5992
6130
|
function o(e) {
|
|
5993
6131
|
let n = {
|
|
5994
6132
|
method: e,
|
|
5995
|
-
headers:
|
|
6133
|
+
headers: yc(e === "GET" ? void 0 : { "Content-Type": "application/json" }, vc(t?.headers))
|
|
5996
6134
|
};
|
|
5997
6135
|
return r && (n.credentials = r), n;
|
|
5998
6136
|
}
|
|
@@ -6010,7 +6148,7 @@ function Vc(e, t) {
|
|
|
6010
6148
|
}
|
|
6011
6149
|
return {
|
|
6012
6150
|
async fetchTraces(e) {
|
|
6013
|
-
let t = mi(e.timeRange), r =
|
|
6151
|
+
let t = mi(e.timeRange), r = _c(e.filters), a = {
|
|
6014
6152
|
apiId: e.apiId,
|
|
6015
6153
|
timeRange: c(t)
|
|
6016
6154
|
};
|
|
@@ -6021,7 +6159,7 @@ function Vc(e, t) {
|
|
|
6021
6159
|
if (!u.ok) throw Error(`[gamma-lib-observability] HTTP ${u.status} on POST ${i}`);
|
|
6022
6160
|
let d = await u.json();
|
|
6023
6161
|
return {
|
|
6024
|
-
entries: (d.data ?? []).map(
|
|
6162
|
+
entries: (d.data ?? []).map(Uc),
|
|
6025
6163
|
totalCount: d.pagination?.totalCount,
|
|
6026
6164
|
page: d.pagination?.page,
|
|
6027
6165
|
pageCount: d.pagination?.pageCount
|
|
@@ -6032,14 +6170,14 @@ function Vc(e, t) {
|
|
|
6032
6170
|
t.signal && (i.signal = t.signal);
|
|
6033
6171
|
let s = await n(r, i);
|
|
6034
6172
|
if (!s.ok) throw Error(`[gamma-lib-observability] HTTP ${s.status} on GET ${a}/${t.traceId}`);
|
|
6035
|
-
return
|
|
6173
|
+
return Gc(await s.json());
|
|
6036
6174
|
}
|
|
6037
6175
|
};
|
|
6038
6176
|
}
|
|
6039
6177
|
//#endregion
|
|
6040
6178
|
//#region src/routing/DashboardListPage.tsx
|
|
6041
|
-
function
|
|
6042
|
-
let t = a(), n = E(() =>
|
|
6179
|
+
function Jc({ templates: e }) {
|
|
6180
|
+
let t = a(), n = E(() => ja(e, t), [e, t]), r = E(() => [{
|
|
6043
6181
|
id: "name",
|
|
6044
6182
|
accessorKey: "label",
|
|
6045
6183
|
header: "Name",
|
|
@@ -6062,7 +6200,7 @@ function Hc({ templates: e }) {
|
|
|
6062
6200
|
children: [/* @__PURE__ */ A("h1", {
|
|
6063
6201
|
className: "text-lg font-semibold",
|
|
6064
6202
|
children: "Dashboards"
|
|
6065
|
-
}), /* @__PURE__ */ A(
|
|
6203
|
+
}), /* @__PURE__ */ A(be, {
|
|
6066
6204
|
columns: r,
|
|
6067
6205
|
data: n,
|
|
6068
6206
|
emptyMessage: "No dashboards available.",
|
|
@@ -6072,7 +6210,7 @@ function Hc({ templates: e }) {
|
|
|
6072
6210
|
}
|
|
6073
6211
|
//#endregion
|
|
6074
6212
|
//#region src/routing/detail-filter.ts
|
|
6075
|
-
function
|
|
6213
|
+
function Yc(e, t, n) {
|
|
6076
6214
|
let r = e.filter((e) => e.field !== t);
|
|
6077
6215
|
return r.push({
|
|
6078
6216
|
field: t,
|
|
@@ -6081,7 +6219,7 @@ function Uc(e, t, n) {
|
|
|
6081
6219
|
value: [n]
|
|
6082
6220
|
}), r;
|
|
6083
6221
|
}
|
|
6084
|
-
function
|
|
6222
|
+
function Xc(e, t) {
|
|
6085
6223
|
let n = qn({
|
|
6086
6224
|
conditions: [...e],
|
|
6087
6225
|
timeRange: t
|
|
@@ -6090,9 +6228,9 @@ function Wc(e, t) {
|
|
|
6090
6228
|
}
|
|
6091
6229
|
//#endregion
|
|
6092
6230
|
//#region src/routing/LogsRouteElement.tsx
|
|
6093
|
-
function
|
|
6231
|
+
function Zc({ columns: e, getRowId: t, onRowClickOverride: n, detailConfig: r, detailMode: i, pageSize: a, scopeFilterField: o, columnVisibilityStorageKey: s, analyticsFilterMapping: c }) {
|
|
6094
6232
|
let l = !n && !!r && !!t;
|
|
6095
|
-
return l && i === "drawer" && r && t ? /* @__PURE__ */ A(
|
|
6233
|
+
return l && i === "drawer" && r && t ? /* @__PURE__ */ A(Qc, {
|
|
6096
6234
|
columns: e,
|
|
6097
6235
|
getRowId: t,
|
|
6098
6236
|
detailConfig: r,
|
|
@@ -6100,7 +6238,7 @@ function Gc({ columns: e, getRowId: t, onRowClickOverride: n, detailConfig: r, d
|
|
|
6100
6238
|
scopeFilterField: o,
|
|
6101
6239
|
columnVisibilityStorageKey: s,
|
|
6102
6240
|
analyticsFilterMapping: c
|
|
6103
|
-
}) : /* @__PURE__ */ A(
|
|
6241
|
+
}) : /* @__PURE__ */ A($c, {
|
|
6104
6242
|
columns: e,
|
|
6105
6243
|
getRowId: t,
|
|
6106
6244
|
onRowClickOverride: n,
|
|
@@ -6111,13 +6249,13 @@ function Gc({ columns: e, getRowId: t, onRowClickOverride: n, detailConfig: r, d
|
|
|
6111
6249
|
analyticsFilterMapping: c
|
|
6112
6250
|
});
|
|
6113
6251
|
}
|
|
6114
|
-
function
|
|
6115
|
-
let [s, c] = O(void 0), [l, u] = O([]), { filters: d, setFilters: f } =
|
|
6252
|
+
function Qc({ columns: e, getRowId: t, detailConfig: n, pageSize: r, scopeFilterField: i, columnVisibilityStorageKey: a, analyticsFilterMapping: o }) {
|
|
6253
|
+
let [s, c] = O(void 0), [l, u] = O([]), { filters: d, setFilters: f } = Ra(), p = E(() => s ? l.findIndex((e) => t(e) === s) : -1, [
|
|
6116
6254
|
s,
|
|
6117
6255
|
l,
|
|
6118
6256
|
t
|
|
6119
6257
|
]), m = C((e) => c(t(e)), [t]), h = C((e, t) => {
|
|
6120
|
-
f(
|
|
6258
|
+
f(Yc(d, e, t)), c(void 0);
|
|
6121
6259
|
}, [d, f]), g = C(() => {
|
|
6122
6260
|
let e = l[p - 1];
|
|
6123
6261
|
e && c(t(e));
|
|
@@ -6133,7 +6271,7 @@ function Kc({ columns: e, getRowId: t, detailConfig: n, pageSize: r, scopeFilter
|
|
|
6133
6271
|
p,
|
|
6134
6272
|
t
|
|
6135
6273
|
]);
|
|
6136
|
-
return /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(
|
|
6274
|
+
return /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(_o, {
|
|
6137
6275
|
columns: e,
|
|
6138
6276
|
onRowClick: m,
|
|
6139
6277
|
getRowId: t,
|
|
@@ -6142,7 +6280,7 @@ function Kc({ columns: e, getRowId: t, detailConfig: n, pageSize: r, scopeFilter
|
|
|
6142
6280
|
scopeFilterField: i,
|
|
6143
6281
|
columnVisibilityStorageKey: a,
|
|
6144
6282
|
analyticsFilterMapping: o
|
|
6145
|
-
}), /* @__PURE__ */ A(
|
|
6283
|
+
}), /* @__PURE__ */ A(bs, {
|
|
6146
6284
|
config: n,
|
|
6147
6285
|
logId: s,
|
|
6148
6286
|
onClose: () => c(void 0),
|
|
@@ -6153,9 +6291,9 @@ function Kc({ columns: e, getRowId: t, detailConfig: n, pageSize: r, scopeFilter
|
|
|
6153
6291
|
hasNext: p >= 0 && p < l.length - 1
|
|
6154
6292
|
})] });
|
|
6155
6293
|
}
|
|
6156
|
-
function
|
|
6294
|
+
function $c({ columns: e, getRowId: t, onRowClickOverride: n, builtInDetailEnabled: r, pageSize: i, scopeFilterField: a, columnVisibilityStorageKey: o, analyticsFilterMapping: s }) {
|
|
6157
6295
|
let c = Yt(), { pathname: l } = Jt();
|
|
6158
|
-
return /* @__PURE__ */ A(
|
|
6296
|
+
return /* @__PURE__ */ A(_o, {
|
|
6159
6297
|
columns: e,
|
|
6160
6298
|
onRowClick: E(() => {
|
|
6161
6299
|
if (n) return n;
|
|
@@ -6179,15 +6317,15 @@ function qc({ columns: e, getRowId: t, onRowClickOverride: n, builtInDetailEnabl
|
|
|
6179
6317
|
}
|
|
6180
6318
|
//#endregion
|
|
6181
6319
|
//#region src/routing/ObservabilityDashboardPage.tsx
|
|
6182
|
-
function
|
|
6320
|
+
function el(e) {
|
|
6183
6321
|
let [t] = Zt(), n = t.get("live");
|
|
6184
6322
|
return /* @__PURE__ */ A(sn, {
|
|
6185
6323
|
config: { defaultEnabled: n === "1" || n === "true" },
|
|
6186
|
-
children: /* @__PURE__ */ A(
|
|
6324
|
+
children: /* @__PURE__ */ A(tl, { ...e })
|
|
6187
6325
|
});
|
|
6188
6326
|
}
|
|
6189
|
-
function
|
|
6190
|
-
let { dashboardId: r } = Xt(), i = a(), o = ln(), [, s] = Zt(), c = E(() =>
|
|
6327
|
+
function tl({ templates: e, scopeFilterField: t, externalLinks: n }) {
|
|
6328
|
+
let { dashboardId: r } = Xt(), i = a(), o = ln(), [, s] = Zt(), c = E(() => ja(e, i), [e, i]).find((e) => e.id === r), { timeRange: l, filters: u, setTimeRange: d, setFilters: f } = Ra(), p = kn(u, fn()), m = o?.isLive ?? !1;
|
|
6191
6329
|
T(() => {
|
|
6192
6330
|
s((e) => {
|
|
6193
6331
|
let t = e.has("live");
|
|
@@ -6204,7 +6342,7 @@ function Yc({ templates: e, scopeFilterField: t, externalLinks: n }) {
|
|
|
6204
6342
|
}, [m, s]);
|
|
6205
6343
|
let h = C((e) => {
|
|
6206
6344
|
e.type === "absolute" && o?.isLive && o.toggle(), d(e);
|
|
6207
|
-
}, [d, o]), g = E(() => c ?
|
|
6345
|
+
}, [d, o]), g = E(() => c ? Aa(c, { capabilities: i }) : null, [c, i]);
|
|
6208
6346
|
return !c || !g ? /* @__PURE__ */ A("div", {
|
|
6209
6347
|
className: "flex items-center justify-center p-8 text-muted-foreground",
|
|
6210
6348
|
children: r ? `Dashboard "${r}" not found.` : "No dashboard available."
|
|
@@ -6231,14 +6369,14 @@ function Yc({ templates: e, scopeFilterField: t, externalLinks: n }) {
|
|
|
6231
6369
|
className: "text-sm text-muted-foreground transition-colors hover:text-foreground",
|
|
6232
6370
|
children: [e.label, " →"]
|
|
6233
6371
|
}, e.label)),
|
|
6234
|
-
/* @__PURE__ */ A(
|
|
6372
|
+
/* @__PURE__ */ A(V, { children: /* @__PURE__ */ A(La, {}) }),
|
|
6235
6373
|
/* @__PURE__ */ A(rr, {
|
|
6236
6374
|
value: l,
|
|
6237
6375
|
onChange: h
|
|
6238
6376
|
})
|
|
6239
6377
|
]
|
|
6240
6378
|
}),
|
|
6241
|
-
/* @__PURE__ */ A(
|
|
6379
|
+
/* @__PURE__ */ A(Ta, {
|
|
6242
6380
|
dashboard: g,
|
|
6243
6381
|
timeRange: l,
|
|
6244
6382
|
filters: u
|
|
@@ -6248,74 +6386,130 @@ function Yc({ templates: e, scopeFilterField: t, externalLinks: n }) {
|
|
|
6248
6386
|
}
|
|
6249
6387
|
//#endregion
|
|
6250
6388
|
//#region src/routing/TracesRouteElement.tsx
|
|
6251
|
-
function
|
|
6252
|
-
return A(e === "drawer" ?
|
|
6389
|
+
function nl({ detailMode: e, pageSize: t, columnVisibilityStorageKey: n, toolbarStart: r, emptyVariant: i }) {
|
|
6390
|
+
return A(e === "drawer" ? rl : il, {
|
|
6253
6391
|
pageSize: t,
|
|
6254
|
-
columnVisibilityStorageKey: n
|
|
6392
|
+
columnVisibilityStorageKey: n,
|
|
6393
|
+
toolbarStart: r,
|
|
6394
|
+
emptyVariant: i
|
|
6255
6395
|
});
|
|
6256
6396
|
}
|
|
6257
|
-
function
|
|
6258
|
-
let { apiId:
|
|
6259
|
-
let e =
|
|
6260
|
-
e &&
|
|
6261
|
-
}, [
|
|
6262
|
-
let e =
|
|
6263
|
-
e &&
|
|
6264
|
-
}, [
|
|
6265
|
-
return /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(
|
|
6266
|
-
onRowClick:
|
|
6267
|
-
onPageDataChange:
|
|
6397
|
+
function rl({ pageSize: e, columnVisibilityStorageKey: t, toolbarStart: n, emptyVariant: r }) {
|
|
6398
|
+
let { apiId: i } = Xt(), [a, o] = O(void 0), [s, c] = O([]), l = E(() => a ? s.findIndex((e) => e.traceId === a) : -1, [a, s]), u = C((e) => o(e.traceId), []), d = C(() => o(void 0), []), f = C(() => {
|
|
6399
|
+
let e = s[l - 1];
|
|
6400
|
+
e && o(e.traceId);
|
|
6401
|
+
}, [s, l]), p = C(() => {
|
|
6402
|
+
let e = s[l + 1];
|
|
6403
|
+
e && o(e.traceId);
|
|
6404
|
+
}, [s, l]);
|
|
6405
|
+
return /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(Ns, {
|
|
6406
|
+
onRowClick: u,
|
|
6407
|
+
onPageDataChange: c,
|
|
6268
6408
|
pageSize: e,
|
|
6269
|
-
columnVisibilityStorageKey: t
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6409
|
+
columnVisibilityStorageKey: t,
|
|
6410
|
+
toolbarStart: n,
|
|
6411
|
+
emptyVariant: r
|
|
6412
|
+
}), /* @__PURE__ */ A(lc, {
|
|
6413
|
+
apiId: i ?? "",
|
|
6414
|
+
traceId: a,
|
|
6415
|
+
onClose: d,
|
|
6416
|
+
onNavigatePrev: f,
|
|
6417
|
+
onNavigateNext: p,
|
|
6418
|
+
hasPrev: l > 0,
|
|
6419
|
+
hasNext: l >= 0 && l < s.length - 1
|
|
6276
6420
|
})] });
|
|
6277
6421
|
}
|
|
6278
|
-
function
|
|
6279
|
-
let
|
|
6280
|
-
return /* @__PURE__ */ A(
|
|
6422
|
+
function il({ pageSize: e, columnVisibilityStorageKey: t, toolbarStart: n, emptyVariant: r }) {
|
|
6423
|
+
let i = Yt(), { pathname: a } = Jt(), { apiId: o } = Xt();
|
|
6424
|
+
return /* @__PURE__ */ A(Ns, {
|
|
6281
6425
|
onRowClick: E(() => {
|
|
6282
|
-
if (!
|
|
6283
|
-
let e =
|
|
6284
|
-
return (t) =>
|
|
6426
|
+
if (!o) return;
|
|
6427
|
+
let e = a.replace(/\/$/, "");
|
|
6428
|
+
return (t) => i(`${e}/${t.traceId}`);
|
|
6285
6429
|
}, [
|
|
6430
|
+
o,
|
|
6286
6431
|
i,
|
|
6287
|
-
|
|
6288
|
-
r
|
|
6432
|
+
a
|
|
6289
6433
|
]),
|
|
6290
6434
|
pageSize: e,
|
|
6291
|
-
columnVisibilityStorageKey: t
|
|
6435
|
+
columnVisibilityStorageKey: t,
|
|
6436
|
+
toolbarStart: n,
|
|
6437
|
+
emptyVariant: r
|
|
6438
|
+
});
|
|
6439
|
+
}
|
|
6440
|
+
//#endregion
|
|
6441
|
+
//#region src/routing/TracingScreen.tsx
|
|
6442
|
+
function al(e) {
|
|
6443
|
+
let t = typeof e == "function", n = N({
|
|
6444
|
+
queryKey: J.tracingApis(),
|
|
6445
|
+
queryFn: ({ signal: t }) => e(t),
|
|
6446
|
+
enabled: t,
|
|
6447
|
+
staleTime: 300 * 1e3
|
|
6448
|
+
});
|
|
6449
|
+
return e === void 0 ? {
|
|
6450
|
+
options: void 0,
|
|
6451
|
+
loading: !1,
|
|
6452
|
+
error: !1,
|
|
6453
|
+
refetch: () => {}
|
|
6454
|
+
} : t ? {
|
|
6455
|
+
options: n.data,
|
|
6456
|
+
loading: n.isLoading,
|
|
6457
|
+
error: n.isError,
|
|
6458
|
+
refetch: () => n.refetch()
|
|
6459
|
+
} : {
|
|
6460
|
+
options: e,
|
|
6461
|
+
loading: !1,
|
|
6462
|
+
error: !1,
|
|
6463
|
+
refetch: () => {}
|
|
6464
|
+
};
|
|
6465
|
+
}
|
|
6466
|
+
function ol({ loadTracingApis: e, detailMode: t = "drawer", pageSize: n, columnVisibilityStorageKey: r }) {
|
|
6467
|
+
let { apiId: i } = Xt(), a = Yt(), { pathname: o } = Jt(), { options: s, loading: c, error: l, refetch: u } = al(e), d = e !== void 0, f = E(() => {
|
|
6468
|
+
let e = o.replace(/\/+$/, "");
|
|
6469
|
+
if (!i) return e;
|
|
6470
|
+
let t = e.lastIndexOf("/");
|
|
6471
|
+
return t > 0 ? e.slice(0, t) : e;
|
|
6472
|
+
}, [o, i]), p = C((e) => a(`${f}/${encodeURIComponent(e)}`), [a, f]);
|
|
6473
|
+
return /* @__PURE__ */ A(nl, {
|
|
6474
|
+
detailMode: t,
|
|
6475
|
+
pageSize: n,
|
|
6476
|
+
columnVisibilityStorageKey: r,
|
|
6477
|
+
toolbarStart: d ? /* @__PURE__ */ A(Fs, {
|
|
6478
|
+
options: s ?? [],
|
|
6479
|
+
value: i,
|
|
6480
|
+
onSelect: p,
|
|
6481
|
+
loading: c,
|
|
6482
|
+
error: l,
|
|
6483
|
+
onRetry: u
|
|
6484
|
+
}) : void 0,
|
|
6485
|
+
emptyVariant: i ? "no-traces" : d ? "no-api-selected" : "no-api-loader"
|
|
6292
6486
|
});
|
|
6293
6487
|
}
|
|
6294
6488
|
//#endregion
|
|
6295
6489
|
//#region src/routing/ObservabilityRoutes.tsx
|
|
6296
|
-
var
|
|
6297
|
-
function
|
|
6490
|
+
var sl = [];
|
|
6491
|
+
function cl(e, t, n) {
|
|
6298
6492
|
return e ? /* @__PURE__ */ A(g, {
|
|
6299
6493
|
dataSource: t,
|
|
6300
6494
|
children: n
|
|
6301
6495
|
}) : n;
|
|
6302
6496
|
}
|
|
6303
|
-
function
|
|
6497
|
+
function ll(e, t, n) {
|
|
6304
6498
|
return e ? /* @__PURE__ */ A(s, {
|
|
6305
6499
|
dataSource: t,
|
|
6306
6500
|
children: n
|
|
6307
6501
|
}) : n;
|
|
6308
6502
|
}
|
|
6309
|
-
function
|
|
6503
|
+
function ul({ children: e }) {
|
|
6310
6504
|
let t = fn(), { data: n, isLoading: r, isError: i } = N({
|
|
6311
6505
|
queryKey: ["observability", "filter-definitions"],
|
|
6312
6506
|
queryFn: ({ signal: e }) => t.fetchFilterDefinitions(e),
|
|
6313
6507
|
enabled: !!t,
|
|
6314
6508
|
staleTime: 300 * 1e3
|
|
6315
6509
|
});
|
|
6316
|
-
return r ? /* @__PURE__ */ A(
|
|
6510
|
+
return r ? /* @__PURE__ */ A(dl, {}) : i || !n ? /* @__PURE__ */ A(k, { children: e([]) }) : /* @__PURE__ */ A(k, { children: e(n) });
|
|
6317
6511
|
}
|
|
6318
|
-
function
|
|
6512
|
+
function dl() {
|
|
6319
6513
|
return /* @__PURE__ */ j("div", {
|
|
6320
6514
|
className: "flex items-center gap-2 p-4",
|
|
6321
6515
|
children: [
|
|
@@ -6325,124 +6519,140 @@ function rl() {
|
|
|
6325
6519
|
]
|
|
6326
6520
|
});
|
|
6327
6521
|
}
|
|
6328
|
-
function
|
|
6329
|
-
let n = a(), r = E(() =>
|
|
6522
|
+
function fl({ templates: e, contextFilters: t }) {
|
|
6523
|
+
let n = a(), r = E(() => ja(e, n), [e, n]);
|
|
6330
6524
|
return r.length === 1 && r[0] ? /* @__PURE__ */ A(Kt, {
|
|
6331
6525
|
to: `./${r[0].id}`,
|
|
6332
6526
|
replace: !0
|
|
6333
6527
|
}) : /* @__PURE__ */ A(bn, {
|
|
6334
6528
|
filters: t,
|
|
6335
|
-
children: /* @__PURE__ */ A(
|
|
6529
|
+
children: /* @__PURE__ */ A(Jc, { templates: e })
|
|
6336
6530
|
});
|
|
6337
6531
|
}
|
|
6338
|
-
function
|
|
6339
|
-
let
|
|
6532
|
+
function pl({ baseUrl: e, http: n, dataSource: r, filterProviders: o, logsPage: s, logsDataSource: l, logsColumns: u, logsOnRowClick: d, logsGetRowId: f, logsDetailBasePath: p, tracesDataSource: g, loadTracingApis: _, config: v }) {
|
|
6533
|
+
let y = hn(), b = n ?? y, x = a(), S = c(), ee = E(() => jc(e, b), [e, b]), te = r !== void 0 || S === null, ne = r ?? S ?? ee, re = E(() => Pc(e, b), [e, b]), C = i(), w = E(() => v.features.logs?.enabled ? Lc(e, b) : void 0, [
|
|
6340
6534
|
e,
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
]),
|
|
6535
|
+
b,
|
|
6536
|
+
v.features.logs?.enabled
|
|
6537
|
+
]), T = l ?? C ?? w, ie = l !== void 0 || C === null, D = t(), O = E(() => v.features.tracing?.enabled ? qc(e, b) : void 0, [
|
|
6344
6538
|
e,
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
]),
|
|
6348
|
-
if (
|
|
6539
|
+
b,
|
|
6540
|
+
v.features.tracing?.enabled
|
|
6541
|
+
]), M = g ?? D ?? O, ae = g !== void 0 || D === null, N = v.features.dashboards, P = v.features.logs, F = v.features.tracing, oe = N?.contextFilters ?? sl, se = P?.contextFilters ?? sl, I = P?.enabled, L = P?.logDetail, ce = P?.analyticsFilterMapping, le = E(() => {
|
|
6542
|
+
if (I) return L || Qo({
|
|
6349
6543
|
basePath: p ?? "",
|
|
6350
|
-
contextChart: { analyticsFilterMapping:
|
|
6544
|
+
contextChart: { analyticsFilterMapping: ce }
|
|
6351
6545
|
});
|
|
6352
6546
|
}, [
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6547
|
+
I,
|
|
6548
|
+
L,
|
|
6549
|
+
ce,
|
|
6356
6550
|
p
|
|
6357
|
-
]),
|
|
6551
|
+
]), ue = P?.detailMode ?? "drawer", de = (e) => /* @__PURE__ */ A(h, {
|
|
6358
6552
|
providers: e,
|
|
6359
6553
|
children: /* @__PURE__ */ j(qt, { children: [
|
|
6360
|
-
|
|
6554
|
+
N?.enabled && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(G, {
|
|
6361
6555
|
path: "dashboards",
|
|
6362
|
-
element: /* @__PURE__ */ A(
|
|
6363
|
-
templates:
|
|
6364
|
-
contextFilters:
|
|
6556
|
+
element: /* @__PURE__ */ A(fl, {
|
|
6557
|
+
templates: N.templates,
|
|
6558
|
+
contextFilters: oe
|
|
6365
6559
|
})
|
|
6366
|
-
}), /* @__PURE__ */ A(
|
|
6560
|
+
}), /* @__PURE__ */ A(G, {
|
|
6367
6561
|
path: "dashboards/:dashboardId",
|
|
6368
6562
|
element: /* @__PURE__ */ A(bn, {
|
|
6369
|
-
filters:
|
|
6370
|
-
children: /* @__PURE__ */ A(
|
|
6371
|
-
templates:
|
|
6372
|
-
scopeFilterField:
|
|
6373
|
-
externalLinks:
|
|
6563
|
+
filters: oe,
|
|
6564
|
+
children: /* @__PURE__ */ A(el, {
|
|
6565
|
+
templates: N.templates,
|
|
6566
|
+
scopeFilterField: N.scopeFilterField,
|
|
6567
|
+
externalLinks: N.externalLinks
|
|
6374
6568
|
})
|
|
6375
6569
|
})
|
|
6376
6570
|
})] }),
|
|
6377
|
-
|
|
6571
|
+
v.features.logs?.enabled && /* @__PURE__ */ A(G, {
|
|
6378
6572
|
path: "logs",
|
|
6379
6573
|
element: /* @__PURE__ */ A(bn, {
|
|
6380
|
-
filters:
|
|
6381
|
-
children: s ?? (
|
|
6574
|
+
filters: se,
|
|
6575
|
+
children: s ?? (T && u ? cl(ie, T, /* @__PURE__ */ A(Zc, {
|
|
6382
6576
|
columns: u,
|
|
6383
6577
|
getRowId: f,
|
|
6384
6578
|
onRowClickOverride: d,
|
|
6385
|
-
detailConfig:
|
|
6386
|
-
detailMode:
|
|
6387
|
-
pageSize:
|
|
6388
|
-
scopeFilterField:
|
|
6389
|
-
columnVisibilityStorageKey:
|
|
6390
|
-
analyticsFilterMapping:
|
|
6579
|
+
detailConfig: le,
|
|
6580
|
+
detailMode: ue,
|
|
6581
|
+
pageSize: P?.pageSize,
|
|
6582
|
+
scopeFilterField: P?.scopeFilterField,
|
|
6583
|
+
columnVisibilityStorageKey: P?.columnVisibilityStorageKey,
|
|
6584
|
+
analyticsFilterMapping: P?.analyticsFilterMapping
|
|
6391
6585
|
})) : /* @__PURE__ */ A("div", {
|
|
6392
6586
|
className: "flex items-center justify-center p-8 text-muted-foreground",
|
|
6393
6587
|
children: "Logs feature enabled but no page provided."
|
|
6394
6588
|
}))
|
|
6395
6589
|
})
|
|
6396
6590
|
}),
|
|
6397
|
-
|
|
6591
|
+
v.features.logs?.enabled && le && T && /* @__PURE__ */ A(G, {
|
|
6398
6592
|
path: "logs/:logId",
|
|
6399
6593
|
element: /* @__PURE__ */ A(bn, {
|
|
6400
|
-
filters:
|
|
6401
|
-
children:
|
|
6594
|
+
filters: se,
|
|
6595
|
+
children: cl(ie, T, /* @__PURE__ */ A(ml, { config: le }))
|
|
6402
6596
|
})
|
|
6403
6597
|
}),
|
|
6404
|
-
|
|
6405
|
-
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6598
|
+
F?.enabled && x["observability.traces.read"] && M && /* @__PURE__ */ j(k, { children: [
|
|
6599
|
+
/* @__PURE__ */ A(G, {
|
|
6600
|
+
path: "tracing",
|
|
6601
|
+
element: ll(ae, M, /* @__PURE__ */ A(ol, {
|
|
6602
|
+
loadTracingApis: _,
|
|
6603
|
+
detailMode: F.detailMode ?? "drawer",
|
|
6604
|
+
pageSize: F.pageSize,
|
|
6605
|
+
columnVisibilityStorageKey: F.columnVisibilityStorageKey
|
|
6606
|
+
}))
|
|
6607
|
+
}),
|
|
6608
|
+
/* @__PURE__ */ A(G, {
|
|
6609
|
+
path: "tracing/:apiId",
|
|
6610
|
+
element: ll(ae, M, /* @__PURE__ */ A(ol, {
|
|
6611
|
+
loadTracingApis: _,
|
|
6612
|
+
detailMode: F.detailMode ?? "drawer",
|
|
6613
|
+
pageSize: F.pageSize,
|
|
6614
|
+
columnVisibilityStorageKey: F.columnVisibilityStorageKey
|
|
6615
|
+
}))
|
|
6616
|
+
}),
|
|
6617
|
+
/* @__PURE__ */ A(G, {
|
|
6618
|
+
path: "tracing/:apiId/:traceId",
|
|
6619
|
+
element: ll(ae, M, /* @__PURE__ */ A(cc, {}))
|
|
6620
|
+
})
|
|
6621
|
+
] }),
|
|
6622
|
+
/* @__PURE__ */ A(G, {
|
|
6416
6623
|
path: "*",
|
|
6417
|
-
element:
|
|
6624
|
+
element: N?.enabled ? /* @__PURE__ */ A(Kt, {
|
|
6418
6625
|
to: "dashboards",
|
|
6419
6626
|
replace: !0
|
|
6420
|
-
}) :
|
|
6627
|
+
}) : v.features.logs?.enabled ? /* @__PURE__ */ A(Kt, {
|
|
6421
6628
|
to: "logs",
|
|
6422
6629
|
replace: !0
|
|
6630
|
+
}) : F?.enabled ? /* @__PURE__ */ A(Kt, {
|
|
6631
|
+
to: "tracing",
|
|
6632
|
+
replace: !0
|
|
6423
6633
|
}) : /* @__PURE__ */ A("div", {
|
|
6424
6634
|
className: "flex items-center justify-center p-8 text-muted-foreground",
|
|
6425
6635
|
children: "No observability features enabled."
|
|
6426
6636
|
})
|
|
6427
6637
|
})
|
|
6428
6638
|
] })
|
|
6429
|
-
}),
|
|
6430
|
-
source:
|
|
6431
|
-
children: o ?
|
|
6432
|
-
}) :
|
|
6433
|
-
return
|
|
6434
|
-
dataSource:
|
|
6435
|
-
children:
|
|
6436
|
-
}) :
|
|
6437
|
-
}
|
|
6438
|
-
function
|
|
6439
|
-
let t = Yt(), { filters: n, timeRange: r } =
|
|
6440
|
-
return /* @__PURE__ */ A(
|
|
6639
|
+
}), fe = N?.enabled || P?.enabled ? /* @__PURE__ */ A(dn, {
|
|
6640
|
+
source: re,
|
|
6641
|
+
children: o ? de(o) : /* @__PURE__ */ A(ul, { children: (e) => de(e) })
|
|
6642
|
+
}) : de(o ?? []);
|
|
6643
|
+
return te ? /* @__PURE__ */ A(m, {
|
|
6644
|
+
dataSource: ne,
|
|
6645
|
+
children: fe
|
|
6646
|
+
}) : fe;
|
|
6647
|
+
}
|
|
6648
|
+
function ml({ config: e }) {
|
|
6649
|
+
let t = Yt(), { filters: n, timeRange: r } = Ra();
|
|
6650
|
+
return /* @__PURE__ */ A(Ss, {
|
|
6441
6651
|
config: e,
|
|
6442
6652
|
onFilter: C((e, i) => {
|
|
6443
6653
|
t({
|
|
6444
6654
|
pathname: "..",
|
|
6445
|
-
search:
|
|
6655
|
+
search: Xc(Yc(n, e, i), r)
|
|
6446
6656
|
}, { relative: "path" });
|
|
6447
6657
|
}, [
|
|
6448
6658
|
n,
|
|
@@ -6453,7 +6663,7 @@ function ol({ config: e }) {
|
|
|
6453
6663
|
}
|
|
6454
6664
|
//#endregion
|
|
6455
6665
|
//#region src/routing/define-observability-features.ts
|
|
6456
|
-
var
|
|
6666
|
+
var hl = {
|
|
6457
6667
|
dashboards: {
|
|
6458
6668
|
icon: st,
|
|
6459
6669
|
title: "Dashboards",
|
|
@@ -6470,13 +6680,13 @@ var sl = {
|
|
|
6470
6680
|
icon: St,
|
|
6471
6681
|
title: "Tracing",
|
|
6472
6682
|
order: 2,
|
|
6473
|
-
showInNav: !
|
|
6683
|
+
showInNav: !0
|
|
6474
6684
|
}
|
|
6475
6685
|
};
|
|
6476
|
-
function
|
|
6477
|
-
let t = e.basePath ?? "observe", n =
|
|
6686
|
+
function gl(e) {
|
|
6687
|
+
let t = e.basePath ?? "observe", n = _l(e), r = vl(e, n, t), i = n.map((e) => `${t}/${e}`), a = yl(n, t);
|
|
6478
6688
|
function o(t) {
|
|
6479
|
-
return ee(
|
|
6689
|
+
return ee(pl, {
|
|
6480
6690
|
...t,
|
|
6481
6691
|
config: e
|
|
6482
6692
|
});
|
|
@@ -6505,13 +6715,13 @@ function cl(e) {
|
|
|
6505
6715
|
breadcrumbSegments: c
|
|
6506
6716
|
};
|
|
6507
6717
|
}
|
|
6508
|
-
function
|
|
6718
|
+
function _l(e) {
|
|
6509
6719
|
let t = [];
|
|
6510
|
-
return e.features.dashboards?.enabled && t.push("dashboards"), e.features.logs?.enabled && t.push("logs"), e.features.tracing?.enabled && t.push("tracing"), t.sort((e, t) =>
|
|
6720
|
+
return e.features.dashboards?.enabled && t.push("dashboards"), e.features.logs?.enabled && t.push("logs"), e.features.tracing?.enabled && t.push("tracing"), t.sort((e, t) => hl[e].order - hl[t].order);
|
|
6511
6721
|
}
|
|
6512
|
-
function
|
|
6513
|
-
let r = t.filter((e) =>
|
|
6514
|
-
let r =
|
|
6722
|
+
function vl(e, t, n) {
|
|
6723
|
+
let r = t.filter((e) => hl[e].showInNav).map((t) => {
|
|
6724
|
+
let r = hl[t], i = e.nav.overrides?.[t];
|
|
6515
6725
|
return {
|
|
6516
6726
|
key: `${n}/${t}`,
|
|
6517
6727
|
title: i?.title ?? r.title,
|
|
@@ -6523,10 +6733,10 @@ function ul(e, t, n) {
|
|
|
6523
6733
|
items: r
|
|
6524
6734
|
};
|
|
6525
6735
|
}
|
|
6526
|
-
function
|
|
6736
|
+
function yl(e, t) {
|
|
6527
6737
|
let n = {};
|
|
6528
6738
|
for (let r of e) {
|
|
6529
|
-
let e =
|
|
6739
|
+
let e = hl[r], i = `${t}/${r}`;
|
|
6530
6740
|
n[i] = {
|
|
6531
6741
|
path: `${t}/${r}`,
|
|
6532
6742
|
label: e.title
|
|
@@ -6536,7 +6746,7 @@ function dl(e, t) {
|
|
|
6536
6746
|
}
|
|
6537
6747
|
//#endregion
|
|
6538
6748
|
//#region src/build-observability-base-url.ts
|
|
6539
|
-
function
|
|
6749
|
+
function bl(e, t, n) {
|
|
6540
6750
|
let r = e;
|
|
6541
6751
|
if (n?.useDevProxy) try {
|
|
6542
6752
|
r = new URL(r).pathname;
|
|
@@ -6544,4 +6754,4 @@ function fl(e, t, n) {
|
|
|
6544
6754
|
return r = r.replace(/\/+$/, ""), `${r}/v2/environments/${encodeURIComponent(t)}`;
|
|
6545
6755
|
}
|
|
6546
6756
|
//#endregion
|
|
6547
|
-
export {
|
|
6757
|
+
export { ji as BarPresentation, Hn as CODEC_VERSION, o as CapabilityProvider, Ki as CartesianPresentation, bn as ContextFiltersProvider, Wi as DASHBOARD_BUCKET_TARGET, _ as DEFAULT_CAPABILITIES, rn as DEFAULT_MEASURE, Fn as DEFAULT_PERIOD, an as DEFAULT_REFRESH_INTERVAL_MS, q as DEFAULT_STALE_TIME, Un as DEFAULT_TIME_RANGE, f as DashboardPersistenceProvider, Na as DashboardTemplatesProvider, Ta as DashboardView, Xi as DoughnutPresentation, v as FILTER_OPERATORS, ci as FilterBar, $r as FilterChip, Gr as FilterPopoverForm, h as FilterProvidersProvider, Ni as HTTP_STATUS_PALETTE, mn as HttpProvider, La as LiveIndicator, sn as LiveRefreshProvider, Z as LogDetailCodeBlock, rs as LogDetailContextChart, bs as LogDetailDrawer, cs as LogDetailDrawerShell, Eo as LogDetailEmptyField, fs as LogDetailHeader, Q as LogDetailHeadersTable, Do as LogDetailJsonTree, $ as LogDetailKeyValueGrid, ps as LogDetailMetrics, Ss as LogDetailPage, gs as LogDetailSection, hs as LogDetailSections, Va as LogSeverityBadge, $a as LogTable, g as LogsDataSourceProvider, _o as LogsExplorerPage, sa as MetricGroupPresentation, fa as MetricPresentation, m as MetricsDataSourceProvider, zn as PERIOD_DISPLAY_LABELS, Rn as PERIOD_LABELS, In as PRESET_CATEGORIES, Ln as RELATIVE_PERIODS, zs as SpanDetailPanel, rr as TimeRangePicker, lc as TraceDetailDrawer, cc as TraceDetailPage, rc as TraceDetailShell, Ns as TraceExplorerPage, Ys as TraceLineage, ws as TraceStatusBadge, Ms as TraceTable, tc as TraceTimeline, s as TracesDataSourceProvider, Fs as TracingApiSelector, ol as TracingScreen, Oa as WidgetGroup, xa as WidgetItem, So as buildApiTypeLink, Yr as buildChipLabel, Xr as buildChipLabelParts, Zr as buildChipTooltip, Co as buildDefaultConnectionLogColumns, Qo as buildDefaultLogDetailConfig, vo as buildLogsDeepLink, bl as buildObservabilityBaseUrl, Is as buildTracesDeepLink, _a as clearWidgetRenderers, Gi as computeBucketInterval, oa as computePreviousTimeRange, ea as computeTrend, jo as connectionLogPreset, jc as createHttpDataSource, Pc as createHttpFilterSource, Lc as createHttpLogsSource, qc as createHttpTracesSource, Jn as decodeObservabilityState, ka as defineDashboardTemplate, fr as defineFilterProvider, Yo as defineLogDetail, gl as defineObservabilityFeatures, qn as encodeObservabilityState, Qi as extractMeasureValue, ta as extractSparklineData, bi as facetsToBar, yi as facetsToDoughnut, Es as formatDuration, Ts as formatTraceTime, ir as getLocaleWeekStart, ga as getWidgetRenderer, en as isBarWidget, Qt as isCartesianWidget, $t as isDoughnutWidget, nn as isMetricGroupWidget, tn as isMetricWidget, Lr as isMultiSelectForFilter, eo as mapAnalyticsFilters, $i as measureResultToMetric, Y as mergeFilters, Ri as mergeTimeSeriesToCartesian, Lo as messageLogPreset, Rr as normalizeMembershipOperatorForValues, J as observabilityQueryKeys, Pr as operatorLabel, Fr as operatorNeedsValue, ya as registerDefaultRenderers, ha as registerWidgetRenderer, Aa as resolveDashboardFromTemplate, Fi as resolveGroupColor, Xo as resolveLogDetailVariant, K as resolveMeasure, Zo as resolvePreset, dr as resolveRelativePeriod, mi as resolveStableTimeRange, a as useCapabilities, e as useCapability, X as useContextFilters, l as useDashboardPersistence, Fa as useDashboardTemplate, Pa as useDashboardTemplates, Sn as useFacetsQuery, u as useFilterProvider, p as useFilterProviders, hn as useHttpOptions, cn as useLiveRefresh, as as useLogDetailDrawerExpand, Cn as useLogDetailQuery, r as useLogsDataSource, Dn as useLogsPagedQuery, wn as useLogsQuery, On as useMeasuresQuery, xi as useMergedWidgetFilters, n as useMetricsDataSource, ln as useOptionalLiveRefresh, i as useOptionalLogsDataSource, c as useOptionalMetricsDataSource, t as useOptionalTracesDataSource, gi as useStableTimeRange, An as useTimeSeriesQuery, jn as useTraceDetailQuery, d as useTracesDataSource, Pn as useTracesPagedQuery, fi as useWidgetGroupContext, Ho as webhookLogPreset };
|