@gravitee/gamma-lib-observability 1.0.0 → 1.1.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/INTEGRATION.md +57 -1
- package/README.md +1 -0
- package/USAGE_GUIDE.md +156 -0
- package/dist/dashboards/DashboardView.d.ts +1 -1
- package/dist/dashboards/DashboardView.d.ts.map +1 -1
- package/dist/dashboards/WidgetGroup.d.ts +16 -0
- package/dist/dashboards/WidgetGroup.d.ts.map +1 -0
- package/dist/dashboards/WidgetGroupContext.d.ts +9 -0
- package/dist/dashboards/WidgetGroupContext.d.ts.map +1 -0
- package/dist/dashboards/WidgetItem.d.ts +50 -0
- package/dist/dashboards/WidgetItem.d.ts.map +1 -0
- package/dist/dashboards/index.d.ts +9 -0
- package/dist/dashboards/index.d.ts.map +1 -1
- package/dist/dashboards/renderers/BarPresentation.d.ts +4 -0
- package/dist/dashboards/renderers/BarPresentation.d.ts.map +1 -0
- package/dist/dashboards/renderers/BarWidgetRenderer.d.ts.map +1 -1
- package/dist/dashboards/renderers/CartesianPresentation.d.ts +4 -0
- package/dist/dashboards/renderers/CartesianPresentation.d.ts.map +1 -0
- package/dist/dashboards/renderers/CartesianWidgetRenderer.d.ts.map +1 -1
- package/dist/dashboards/renderers/DoughnutPresentation.d.ts +4 -0
- package/dist/dashboards/renderers/DoughnutPresentation.d.ts.map +1 -0
- package/dist/dashboards/renderers/DoughnutWidgetRenderer.d.ts.map +1 -1
- package/dist/dashboards/renderers/MetricGroupPresentation.d.ts +4 -0
- package/dist/dashboards/renderers/MetricGroupPresentation.d.ts.map +1 -0
- package/dist/dashboards/renderers/MetricGroupWidgetRenderer.d.ts.map +1 -1
- package/dist/dashboards/renderers/MetricPresentation.d.ts +4 -0
- package/dist/dashboards/renderers/MetricPresentation.d.ts.map +1 -0
- package/dist/dashboards/renderers/MetricWidgetRenderer.d.ts.map +1 -1
- package/dist/dashboards/widget-data.d.ts +71 -0
- package/dist/dashboards/widget-data.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +767 -643
- package/dist/styles/observability.css +1 -1
- package/dist/testing/mock-metrics-data-source.d.ts +8 -0
- package/dist/testing/mock-metrics-data-source.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ 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,
|
|
|
2
2
|
import _, { Fragment as v, createContext as y, createElement as b, forwardRef as x, memo as S, useCallback as C, useContext as w, useEffect as T, useId as E, useMemo as D, useRef as O, useState as k } from "react";
|
|
3
3
|
import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
4
4
|
import { keepPreviousData as N, useQueries as ee, useQuery as P } from "@tanstack/react-query";
|
|
5
|
-
import { Accordion as te, AccordionContent as F, AccordionItem as I, AccordionTrigger as ne, Badge as L, Button as R, Calendar as z, Card as B, Combobox as re, ComboboxChip as ie, ComboboxChips as ae, ComboboxChipsInput as oe, ComboboxContent as se, ComboboxEmpty as
|
|
5
|
+
import { Accordion as te, AccordionContent as F, AccordionItem as I, AccordionTrigger as ne, Badge as L, Button as R, Calendar as z, Card as B, Combobox as re, ComboboxChip as ie, ComboboxChips as ae, ComboboxChipsInput as oe, ComboboxContent as se, ComboboxEmpty as ce, ComboboxItem as le, ComboboxList as ue, ComboboxValue as de, DataTable as V, DataTablePagination as H, Empty as fe, EmptyDescription as pe, EmptyHeader as me, EmptyMedia as he, EmptyTitle as ge, Field as U, FieldError as _e, FieldLabel as ve, Input as W, Popover as ye, PopoverAnchor as G, PopoverContent as K, PopoverTrigger as be, ScrollArea as xe, Select as Se, SelectContent as Ce, SelectItem as q, SelectTrigger as we, SelectValue as Te, Separator as Ee, Sheet as De, SheetContent as Oe, SheetDescription as ke, SheetTitle as Ae, Skeleton as J, Spinner as je, ToggleGroup as Me, ToggleGroupItem as Ne, Tooltip as Y, TooltipContent as Pe, TooltipProvider as Fe, TooltipTrigger as Ie, cn as Le, cn as Re, toast as X, useComboboxAnchor as ze } from "@gravitee/graphene-core";
|
|
6
6
|
import { AreaSeries as Be, BarChart as Ve, BarSeries as He, CartesianChart as Ue, ChartContainer as We, ChartLegend as Ge, ChartLegendContent as Ke, ChartTooltip as qe, ChartTooltipContent as Je, DoughnutChart as Ye, Grid as Xe, LineSeries as Ze, Metric as Qe, MetricGroup as $e, ReferenceLine as et, XAxis as tt, YAxis as nt } from "@gravitee/graphene-charts";
|
|
7
7
|
import { Link as rt, Navigate as it, Route as at, Routes as ot, useNavigate as st, useParams as ct, useSearchParams as lt } from "react-router-dom";
|
|
8
8
|
//#region \0rolldown/runtime.js
|
|
@@ -1203,10 +1203,10 @@ function tr({ value: e, onChange: t, disabled: n = !1, showTimezone: r = !1, cla
|
|
|
1203
1203
|
to: y
|
|
1204
1204
|
}), l(!1));
|
|
1205
1205
|
}
|
|
1206
|
-
return /* @__PURE__ */ M(
|
|
1206
|
+
return /* @__PURE__ */ M(ye, {
|
|
1207
1207
|
open: c,
|
|
1208
1208
|
onOpenChange: S,
|
|
1209
|
-
children: [/* @__PURE__ */ j(
|
|
1209
|
+
children: [/* @__PURE__ */ j(be, {
|
|
1210
1210
|
asChild: !0,
|
|
1211
1211
|
children: /* @__PURE__ */ M(R, {
|
|
1212
1212
|
variant: "outline",
|
|
@@ -1220,7 +1220,7 @@ function tr({ value: e, onChange: t, disabled: n = !1, showTimezone: r = !1, cla
|
|
|
1220
1220
|
className: "size-4 shrink-0"
|
|
1221
1221
|
})]
|
|
1222
1222
|
})
|
|
1223
|
-
}), /* @__PURE__ */ M(
|
|
1223
|
+
}), /* @__PURE__ */ M(K, {
|
|
1224
1224
|
className: "w-80 p-4",
|
|
1225
1225
|
align: "start",
|
|
1226
1226
|
children: [
|
|
@@ -1282,12 +1282,12 @@ function tr({ value: e, onChange: t, disabled: n = !1, showTimezone: r = !1, cla
|
|
|
1282
1282
|
/* @__PURE__ */ M("div", {
|
|
1283
1283
|
className: "flex items-end gap-2",
|
|
1284
1284
|
children: [
|
|
1285
|
-
/* @__PURE__ */ M(
|
|
1285
|
+
/* @__PURE__ */ M(U, {
|
|
1286
1286
|
className: "flex-1",
|
|
1287
|
-
children: [/* @__PURE__ */ j(
|
|
1287
|
+
children: [/* @__PURE__ */ j(ve, {
|
|
1288
1288
|
htmlFor: o,
|
|
1289
1289
|
children: $n(f?.from)
|
|
1290
|
-
}), /* @__PURE__ */ j(
|
|
1290
|
+
}), /* @__PURE__ */ j(W, {
|
|
1291
1291
|
id: o,
|
|
1292
1292
|
type: "time",
|
|
1293
1293
|
value: m,
|
|
@@ -1301,12 +1301,12 @@ function tr({ value: e, onChange: t, disabled: n = !1, showTimezone: r = !1, cla
|
|
|
1301
1301
|
className: "pb-2 text-muted-foreground",
|
|
1302
1302
|
children: "-"
|
|
1303
1303
|
}),
|
|
1304
|
-
/* @__PURE__ */ M(
|
|
1304
|
+
/* @__PURE__ */ M(U, {
|
|
1305
1305
|
className: "flex-1",
|
|
1306
|
-
children: [/* @__PURE__ */ j(
|
|
1306
|
+
children: [/* @__PURE__ */ j(ve, {
|
|
1307
1307
|
htmlFor: s,
|
|
1308
1308
|
children: $n(f?.to)
|
|
1309
|
-
}), /* @__PURE__ */ j(
|
|
1309
|
+
}), /* @__PURE__ */ j(W, {
|
|
1310
1310
|
id: s,
|
|
1311
1311
|
type: "time",
|
|
1312
1312
|
value: g,
|
|
@@ -1510,8 +1510,8 @@ function _r({ options: e, selected: t, onSelectedChange: n, multiple: r, onSearc
|
|
|
1510
1510
|
...a && { filter: null },
|
|
1511
1511
|
...i && { onInputValueChange: (e) => i(String(e)) }
|
|
1512
1512
|
}, y = /* @__PURE__ */ M(A, { children: [
|
|
1513
|
-
/* @__PURE__ */ j(
|
|
1514
|
-
/* @__PURE__ */ j(
|
|
1513
|
+
/* @__PURE__ */ j(ce, { children: s }),
|
|
1514
|
+
/* @__PURE__ */ j(ue, { children: (e) => /* @__PURE__ */ j(le, {
|
|
1515
1515
|
value: e,
|
|
1516
1516
|
children: e.label
|
|
1517
1517
|
}, e.value) }),
|
|
@@ -1524,7 +1524,7 @@ function _r({ options: e, selected: t, onSelectedChange: n, multiple: r, onSearc
|
|
|
1524
1524
|
onValueChange: (e) => n(Array.isArray(e) ? e : []),
|
|
1525
1525
|
children: [/* @__PURE__ */ j(ae, {
|
|
1526
1526
|
ref: u,
|
|
1527
|
-
children: /* @__PURE__ */ j(
|
|
1527
|
+
children: /* @__PURE__ */ j(de, { children: (e) => /* @__PURE__ */ M(v, { children: [e.map((e) => /* @__PURE__ */ j(ie, {
|
|
1528
1528
|
removeAriaLabel: `Remove ${e.label}`,
|
|
1529
1529
|
children: e.label
|
|
1530
1530
|
}, e.value)), /* @__PURE__ */ j(oe, {
|
|
@@ -1559,7 +1559,7 @@ function _r({ options: e, selected: t, onSelectedChange: n, multiple: r, onSearc
|
|
|
1559
1559
|
children: y
|
|
1560
1560
|
})]
|
|
1561
1561
|
});
|
|
1562
|
-
return l ? /* @__PURE__ */ M(A, { children: [b, /* @__PURE__ */ j(
|
|
1562
|
+
return l ? /* @__PURE__ */ M(A, { children: [b, /* @__PURE__ */ j(_e, {
|
|
1563
1563
|
id: h,
|
|
1564
1564
|
children: l
|
|
1565
1565
|
})] }) : b;
|
|
@@ -1738,7 +1738,7 @@ function Or({ providers: e, selectedField: t, onFieldChange: n, showScopes: r })
|
|
|
1738
1738
|
})
|
|
1739
1739
|
}), /* @__PURE__ */ M(se, {
|
|
1740
1740
|
anchor: i,
|
|
1741
|
-
children: [/* @__PURE__ */ j(
|
|
1741
|
+
children: [/* @__PURE__ */ j(ce, { children: "No results." }), /* @__PURE__ */ j(ue, { children: (e) => /* @__PURE__ */ j(le, {
|
|
1742
1742
|
value: e,
|
|
1743
1743
|
children: /* @__PURE__ */ j(Dr, {
|
|
1744
1744
|
provider: e,
|
|
@@ -1912,7 +1912,7 @@ function Ur({ existingCondition: e, onApply: t, onCancel: n, showScopes: r = !1
|
|
|
1912
1912
|
}));
|
|
1913
1913
|
}
|
|
1914
1914
|
function C() {
|
|
1915
|
-
return !m || !s ? /* @__PURE__ */ j(
|
|
1915
|
+
return !m || !s ? /* @__PURE__ */ j(W, {
|
|
1916
1916
|
disabled: !0,
|
|
1917
1917
|
placeholder: "Search value…",
|
|
1918
1918
|
"aria-label": "Filter value"
|
|
@@ -1926,7 +1926,7 @@ function Ur({ existingCondition: e, onApply: t, onCancel: n, showScopes: r = !1
|
|
|
1926
1926
|
selected: l,
|
|
1927
1927
|
onSelectedChange: x,
|
|
1928
1928
|
multiple: h
|
|
1929
|
-
}, m.field) : m.allowFreeText ? /* @__PURE__ */ j(
|
|
1929
|
+
}, m.field) : m.allowFreeText ? /* @__PURE__ */ j(W, {
|
|
1930
1930
|
value: d,
|
|
1931
1931
|
onChange: (e) => f(e.target.value),
|
|
1932
1932
|
placeholder: "Enter value(s), comma-separated",
|
|
@@ -1939,13 +1939,13 @@ function Ur({ existingCondition: e, onApply: t, onCancel: n, showScopes: r = !1
|
|
|
1939
1939
|
return /* @__PURE__ */ M("div", {
|
|
1940
1940
|
className: "flex w-[340px] flex-col gap-4 p-4",
|
|
1941
1941
|
children: [
|
|
1942
|
-
/* @__PURE__ */ M(
|
|
1942
|
+
/* @__PURE__ */ M(U, { children: [/* @__PURE__ */ j(ve, { children: "Filter by" }), /* @__PURE__ */ j(Or, {
|
|
1943
1943
|
providers: i,
|
|
1944
1944
|
selectedField: a,
|
|
1945
1945
|
onFieldChange: y,
|
|
1946
1946
|
showScopes: r
|
|
1947
1947
|
})] }),
|
|
1948
|
-
/* @__PURE__ */ M(
|
|
1948
|
+
/* @__PURE__ */ M(U, { children: [/* @__PURE__ */ j(ve, { children: "Choose operator" }), /* @__PURE__ */ M(Se, {
|
|
1949
1949
|
value: s ?? void 0,
|
|
1950
1950
|
onValueChange: b,
|
|
1951
1951
|
disabled: !m,
|
|
@@ -1953,12 +1953,12 @@ function Ur({ existingCondition: e, onApply: t, onCancel: n, showScopes: r = !1
|
|
|
1953
1953
|
className: "w-full",
|
|
1954
1954
|
"aria-label": "Filter operator",
|
|
1955
1955
|
children: /* @__PURE__ */ j(Te, { placeholder: "Select operator…" })
|
|
1956
|
-
}), /* @__PURE__ */ j(
|
|
1956
|
+
}), /* @__PURE__ */ j(Ce, { children: (m?.operators ?? []).map((e) => /* @__PURE__ */ j(q, {
|
|
1957
1957
|
value: e,
|
|
1958
1958
|
children: Mr(e)
|
|
1959
1959
|
}, e)) })]
|
|
1960
1960
|
})] }),
|
|
1961
|
-
_ ? /* @__PURE__ */ M(
|
|
1961
|
+
_ ? /* @__PURE__ */ M(U, { children: [/* @__PURE__ */ j(ve, { children: "Filter value" }), C()] }) : null,
|
|
1962
1962
|
/* @__PURE__ */ M("div", {
|
|
1963
1963
|
className: "flex items-center justify-end gap-2",
|
|
1964
1964
|
children: [/* @__PURE__ */ j(R, {
|
|
@@ -2184,7 +2184,7 @@ function oi({ filters: e, onFiltersChange: t, editable: n = !0, showScopes: r =
|
|
|
2184
2184
|
e && (e.querySelector("[data-autofocus]") ?? e.querySelector("input:not([disabled])"))?.focus();
|
|
2185
2185
|
});
|
|
2186
2186
|
}
|
|
2187
|
-
return /* @__PURE__ */ j(Fe, { children: /* @__PURE__ */ M(
|
|
2187
|
+
return /* @__PURE__ */ j(Fe, { children: /* @__PURE__ */ M(ye, {
|
|
2188
2188
|
open: m,
|
|
2189
2189
|
onOpenChange: x,
|
|
2190
2190
|
children: [
|
|
@@ -2229,8 +2229,8 @@ function oi({ filters: e, onFiltersChange: t, editable: n = !0, showScopes: r =
|
|
|
2229
2229
|
}) : null
|
|
2230
2230
|
]
|
|
2231
2231
|
}),
|
|
2232
|
-
/* @__PURE__ */ j(
|
|
2233
|
-
/* @__PURE__ */ j(
|
|
2232
|
+
/* @__PURE__ */ j(G, { virtualRef: f }),
|
|
2233
|
+
/* @__PURE__ */ j(K, {
|
|
2234
2234
|
ref: d,
|
|
2235
2235
|
side: "bottom",
|
|
2236
2236
|
align: "start",
|
|
@@ -4544,20 +4544,20 @@ function Ba() {
|
|
|
4544
4544
|
//#region node_modules/react-grid-layout/dist/chunk-WGL5FSZH.mjs
|
|
4545
4545
|
var Va = Na(), Ha = Ra(), Ua = pa();
|
|
4546
4546
|
function Wa(e) {
|
|
4547
|
-
let { children: t, cols: n, containerWidth: r, margin: i, containerPadding: a, rowHeight: o, maxRows: s, isDraggable: c, isResizable: l, isBounded: u, static: d, useCSSTransforms: f = !0, usePercentages: p = !1, transformScale: m = 1, positionStrategy: h, dragThreshold: g = 0, droppingPosition: v, className: y = "", style: b, handle: x = "", cancel: S = "", x: w, y: E, w: A, h: M, minW: N = 1, maxW: ee = Infinity, minH: P = 1, maxH: te = Infinity, i: F, resizeHandles: I, resizeHandle: ne, constraints: L = ji, layoutItem: R, layout: z = [], onDragStart: B, onDrag: re, onDragStop: ie, onResizeStart: ae, onResize: oe, onResizeStop: se } = e, [
|
|
4547
|
+
let { children: t, cols: n, containerWidth: r, margin: i, containerPadding: a, rowHeight: o, maxRows: s, isDraggable: c, isResizable: l, isBounded: u, static: d, useCSSTransforms: f = !0, usePercentages: p = !1, transformScale: m = 1, positionStrategy: h, dragThreshold: g = 0, droppingPosition: v, className: y = "", style: b, handle: x = "", cancel: S = "", x: w, y: E, w: A, h: M, minW: N = 1, maxW: ee = Infinity, minH: P = 1, maxH: te = Infinity, i: F, resizeHandles: I, resizeHandle: ne, constraints: L = ji, layoutItem: R, layout: z = [], onDragStart: B, onDrag: re, onDragStop: ie, onResizeStart: ae, onResize: oe, onResizeStop: se } = e, [ce, le] = k(!1), [ue, de] = k(!1), V = O(null), H = O({
|
|
4548
4548
|
left: 0,
|
|
4549
4549
|
top: 0
|
|
4550
|
-
}),
|
|
4550
|
+
}), fe = O({
|
|
4551
4551
|
top: 0,
|
|
4552
4552
|
left: 0,
|
|
4553
4553
|
width: 0,
|
|
4554
4554
|
height: 0
|
|
4555
|
-
}),
|
|
4556
|
-
|
|
4557
|
-
let
|
|
4555
|
+
}), pe = O(void 0), me = O(z);
|
|
4556
|
+
me.current = z;
|
|
4557
|
+
let he = O(null), ge = O(null), U = O(!1), _e = O({
|
|
4558
4558
|
x: 0,
|
|
4559
4559
|
y: 0
|
|
4560
|
-
}),
|
|
4560
|
+
}), ve = O(!1), W = D(() => ({
|
|
4561
4561
|
cols: n,
|
|
4562
4562
|
containerPadding: a,
|
|
4563
4563
|
containerWidth: r,
|
|
@@ -4571,7 +4571,7 @@ function Wa(e) {
|
|
|
4571
4571
|
i,
|
|
4572
4572
|
s,
|
|
4573
4573
|
o
|
|
4574
|
-
]),
|
|
4574
|
+
]), ye = D(() => ({
|
|
4575
4575
|
cols: n,
|
|
4576
4576
|
maxRows: s,
|
|
4577
4577
|
containerWidth: r,
|
|
@@ -4585,10 +4585,10 @@ function Wa(e) {
|
|
|
4585
4585
|
r,
|
|
4586
4586
|
o,
|
|
4587
4587
|
i
|
|
4588
|
-
]),
|
|
4589
|
-
...
|
|
4590
|
-
layout:
|
|
4591
|
-
}), [
|
|
4588
|
+
]), G = C(() => ({
|
|
4589
|
+
...ye,
|
|
4590
|
+
layout: me.current
|
|
4591
|
+
}), [ye]), K = D(() => R ?? {
|
|
4592
4592
|
i: F,
|
|
4593
4593
|
x: w,
|
|
4594
4594
|
y: E,
|
|
@@ -4609,7 +4609,7 @@ function Wa(e) {
|
|
|
4609
4609
|
ee,
|
|
4610
4610
|
P,
|
|
4611
4611
|
te
|
|
4612
|
-
]),
|
|
4612
|
+
]), be = C((e) => {
|
|
4613
4613
|
if (h?.calcStyle) return h.calcStyle(e);
|
|
4614
4614
|
if (f) return Pi(e);
|
|
4615
4615
|
let t = Fi(e);
|
|
@@ -4623,7 +4623,7 @@ function Wa(e) {
|
|
|
4623
4623
|
f,
|
|
4624
4624
|
p,
|
|
4625
4625
|
r
|
|
4626
|
-
]),
|
|
4626
|
+
]), xe = C((e, { node: t }) => {
|
|
4627
4627
|
if (!B) return;
|
|
4628
4628
|
let { offsetParent: n } = t;
|
|
4629
4629
|
if (!n) return;
|
|
@@ -4635,16 +4635,16 @@ function Wa(e) {
|
|
|
4635
4635
|
left: a - o + n.scrollLeft,
|
|
4636
4636
|
top: s - c + n.scrollTop
|
|
4637
4637
|
};
|
|
4638
|
-
if (
|
|
4638
|
+
if (H.current = l, g > 0) {
|
|
4639
4639
|
let t = e;
|
|
4640
|
-
|
|
4640
|
+
_e.current = {
|
|
4641
4641
|
x: t.clientX,
|
|
4642
4642
|
y: t.clientY
|
|
4643
|
-
},
|
|
4643
|
+
}, U.current = !0, ve.current = !1, le(!0);
|
|
4644
4644
|
return;
|
|
4645
4645
|
}
|
|
4646
|
-
|
|
4647
|
-
let u = di(
|
|
4646
|
+
le(!0);
|
|
4647
|
+
let u = di(W, l.top, l.left), { x: d, y: f } = Mi(L, K, u.x, u.y, G());
|
|
4648
4648
|
B(F, d, f, {
|
|
4649
4649
|
e,
|
|
4650
4650
|
node: t,
|
|
@@ -4653,35 +4653,35 @@ function Wa(e) {
|
|
|
4653
4653
|
}, [
|
|
4654
4654
|
B,
|
|
4655
4655
|
m,
|
|
4656
|
-
|
|
4656
|
+
W,
|
|
4657
4657
|
h,
|
|
4658
4658
|
g,
|
|
4659
4659
|
L,
|
|
4660
|
-
q,
|
|
4661
4660
|
K,
|
|
4661
|
+
G,
|
|
4662
4662
|
F
|
|
4663
|
-
]),
|
|
4664
|
-
if (!re || !
|
|
4663
|
+
]), Se = C((e, { node: t, deltaX: n, deltaY: a }) => {
|
|
4664
|
+
if (!re || !ce) return;
|
|
4665
4665
|
let s = e;
|
|
4666
|
-
if (
|
|
4667
|
-
let n = s.clientX -
|
|
4666
|
+
if (U.current && !ve.current) {
|
|
4667
|
+
let n = s.clientX - _e.current.x, r = s.clientY - _e.current.y;
|
|
4668
4668
|
if (Math.hypot(n, r) < g) return;
|
|
4669
|
-
if (
|
|
4670
|
-
let n = di(
|
|
4669
|
+
if (ve.current = !0, U.current = !1, B) {
|
|
4670
|
+
let n = di(W, H.current.top, H.current.left), { x: r, y: i } = Mi(L, K, n.x, n.y, G());
|
|
4671
4671
|
B(F, r, i, {
|
|
4672
4672
|
e,
|
|
4673
4673
|
node: t,
|
|
4674
|
-
newPosition:
|
|
4674
|
+
newPosition: H.current
|
|
4675
4675
|
});
|
|
4676
4676
|
}
|
|
4677
4677
|
}
|
|
4678
|
-
let c =
|
|
4678
|
+
let c = H.current.top + a, l = H.current.left + n;
|
|
4679
4679
|
if (u) {
|
|
4680
4680
|
let { offsetParent: e } = t;
|
|
4681
4681
|
if (e) {
|
|
4682
4682
|
let t = e.clientHeight - ci(M, o, i[1]);
|
|
4683
4683
|
c = pi(c, 0, t);
|
|
4684
|
-
let n = r - ci(A, si(
|
|
4684
|
+
let n = r - ci(A, si(W), i[0]);
|
|
4685
4685
|
l = pi(l, 0, n);
|
|
4686
4686
|
}
|
|
4687
4687
|
}
|
|
@@ -4689,8 +4689,8 @@ function Wa(e) {
|
|
|
4689
4689
|
top: c,
|
|
4690
4690
|
left: l
|
|
4691
4691
|
};
|
|
4692
|
-
|
|
4693
|
-
let f = di(
|
|
4692
|
+
H.current = d;
|
|
4693
|
+
let f = di(W, c, l), { x: p, y: m } = Mi(L, K, f.x, f.y, G());
|
|
4694
4694
|
re(F, p, m, {
|
|
4695
4695
|
e,
|
|
4696
4696
|
node: t,
|
|
@@ -4699,41 +4699,41 @@ function Wa(e) {
|
|
|
4699
4699
|
}, [
|
|
4700
4700
|
re,
|
|
4701
4701
|
B,
|
|
4702
|
-
|
|
4702
|
+
ce,
|
|
4703
4703
|
g,
|
|
4704
4704
|
u,
|
|
4705
4705
|
M,
|
|
4706
4706
|
o,
|
|
4707
4707
|
i,
|
|
4708
|
-
|
|
4708
|
+
W,
|
|
4709
4709
|
r,
|
|
4710
4710
|
A,
|
|
4711
4711
|
F,
|
|
4712
4712
|
L,
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
]),
|
|
4716
|
-
if (!ie || !
|
|
4717
|
-
let n =
|
|
4718
|
-
if (
|
|
4713
|
+
K,
|
|
4714
|
+
G
|
|
4715
|
+
]), Ce = C((e, { node: t }) => {
|
|
4716
|
+
if (!ie || !ce) return;
|
|
4717
|
+
let n = U.current;
|
|
4718
|
+
if (U.current = !1, ve.current = !1, _e.current = {
|
|
4719
4719
|
x: 0,
|
|
4720
4720
|
y: 0
|
|
4721
4721
|
}, n) {
|
|
4722
|
-
|
|
4722
|
+
le(!1), H.current = {
|
|
4723
4723
|
left: 0,
|
|
4724
4724
|
top: 0
|
|
4725
4725
|
};
|
|
4726
4726
|
return;
|
|
4727
4727
|
}
|
|
4728
|
-
let { left: r, top: i } =
|
|
4728
|
+
let { left: r, top: i } = H.current, a = {
|
|
4729
4729
|
top: i,
|
|
4730
4730
|
left: r
|
|
4731
4731
|
};
|
|
4732
|
-
|
|
4732
|
+
le(!1), H.current = {
|
|
4733
4733
|
left: 0,
|
|
4734
4734
|
top: 0
|
|
4735
4735
|
};
|
|
4736
|
-
let o = di(
|
|
4736
|
+
let o = di(W, i, r), { x: s, y: c } = Mi(L, K, o.x, o.y, G());
|
|
4737
4737
|
ie(F, s, c, {
|
|
4738
4738
|
e,
|
|
4739
4739
|
node: t,
|
|
@@ -4741,15 +4741,15 @@ function Wa(e) {
|
|
|
4741
4741
|
});
|
|
4742
4742
|
}, [
|
|
4743
4743
|
ie,
|
|
4744
|
-
|
|
4745
|
-
|
|
4744
|
+
ce,
|
|
4745
|
+
W,
|
|
4746
4746
|
L,
|
|
4747
|
-
q,
|
|
4748
4747
|
K,
|
|
4748
|
+
G,
|
|
4749
4749
|
F
|
|
4750
4750
|
]);
|
|
4751
|
-
|
|
4752
|
-
let
|
|
4751
|
+
he.current = xe, ge.current = Se;
|
|
4752
|
+
let q = C((e, { node: t, size: n, handle: i }, a, o) => {
|
|
4753
4753
|
let s = o === "onResizeStart" ? ae : o === "onResize" ? oe : se;
|
|
4754
4754
|
if (!s) return;
|
|
4755
4755
|
let c;
|
|
@@ -4757,8 +4757,8 @@ function Wa(e) {
|
|
|
4757
4757
|
...n,
|
|
4758
4758
|
top: a.top,
|
|
4759
4759
|
left: a.left
|
|
4760
|
-
},
|
|
4761
|
-
let l = fi(
|
|
4760
|
+
}, fe.current = c;
|
|
4761
|
+
let l = fi(W, c.width, c.height), { w: u, h: d } = Ni(L, K, l.w, l.h, i, G());
|
|
4762
4762
|
s(F, u, d, {
|
|
4763
4763
|
e: e.nativeEvent,
|
|
4764
4764
|
node: t,
|
|
@@ -4770,53 +4770,53 @@ function Wa(e) {
|
|
|
4770
4770
|
oe,
|
|
4771
4771
|
se,
|
|
4772
4772
|
r,
|
|
4773
|
-
|
|
4773
|
+
W,
|
|
4774
4774
|
F,
|
|
4775
4775
|
L,
|
|
4776
|
-
|
|
4777
|
-
|
|
4776
|
+
K,
|
|
4777
|
+
G
|
|
4778
4778
|
]), we = C((e, t) => {
|
|
4779
|
-
|
|
4780
|
-
let n = li(
|
|
4781
|
-
|
|
4779
|
+
de(!0);
|
|
4780
|
+
let n = li(W, w, E, A, M);
|
|
4781
|
+
q(e, {
|
|
4782
4782
|
...t,
|
|
4783
4783
|
handle: t.handle
|
|
4784
4784
|
}, n, "onResizeStart");
|
|
4785
4785
|
}, [
|
|
4786
|
-
|
|
4787
|
-
|
|
4786
|
+
q,
|
|
4787
|
+
W,
|
|
4788
4788
|
w,
|
|
4789
4789
|
E,
|
|
4790
4790
|
A,
|
|
4791
4791
|
M
|
|
4792
4792
|
]), Te = C((e, t) => {
|
|
4793
|
-
let n = li(
|
|
4794
|
-
|
|
4793
|
+
let n = li(W, w, E, A, M);
|
|
4794
|
+
q(e, {
|
|
4795
4795
|
...t,
|
|
4796
4796
|
handle: t.handle
|
|
4797
4797
|
}, n, "onResize");
|
|
4798
4798
|
}, [
|
|
4799
|
-
|
|
4800
|
-
|
|
4799
|
+
q,
|
|
4800
|
+
W,
|
|
4801
4801
|
w,
|
|
4802
4802
|
E,
|
|
4803
4803
|
A,
|
|
4804
4804
|
M
|
|
4805
4805
|
]), Ee = C((e, t) => {
|
|
4806
|
-
|
|
4806
|
+
de(!1), fe.current = {
|
|
4807
4807
|
top: 0,
|
|
4808
4808
|
left: 0,
|
|
4809
4809
|
width: 0,
|
|
4810
4810
|
height: 0
|
|
4811
4811
|
};
|
|
4812
|
-
let n = li(
|
|
4813
|
-
|
|
4812
|
+
let n = li(W, w, E, A, M);
|
|
4813
|
+
q(e, {
|
|
4814
4814
|
...t,
|
|
4815
4815
|
handle: t.handle
|
|
4816
4816
|
}, n, "onResizeStop");
|
|
4817
4817
|
}, [
|
|
4818
|
-
|
|
4819
|
-
|
|
4818
|
+
q,
|
|
4819
|
+
W,
|
|
4820
4820
|
w,
|
|
4821
4821
|
E,
|
|
4822
4822
|
A,
|
|
@@ -4824,13 +4824,13 @@ function Wa(e) {
|
|
|
4824
4824
|
]);
|
|
4825
4825
|
T(() => {
|
|
4826
4826
|
if (!v) return;
|
|
4827
|
-
let e =
|
|
4827
|
+
let e = V.current;
|
|
4828
4828
|
if (!e) return;
|
|
4829
|
-
let t =
|
|
4829
|
+
let t = pe.current || {
|
|
4830
4830
|
left: 0,
|
|
4831
4831
|
top: 0
|
|
4832
|
-
}, n =
|
|
4833
|
-
if (!
|
|
4832
|
+
}, n = ce && (v.left !== t.left || v.top !== t.top);
|
|
4833
|
+
if (!ce) {
|
|
4834
4834
|
let t = {
|
|
4835
4835
|
node: e,
|
|
4836
4836
|
deltaX: v.left,
|
|
@@ -4840,39 +4840,39 @@ function Wa(e) {
|
|
|
4840
4840
|
x: v.left,
|
|
4841
4841
|
y: v.top
|
|
4842
4842
|
};
|
|
4843
|
-
|
|
4843
|
+
he.current?.(v.e, t);
|
|
4844
4844
|
} else if (n) {
|
|
4845
4845
|
let t = {
|
|
4846
4846
|
node: e,
|
|
4847
|
-
deltaX: v.left -
|
|
4848
|
-
deltaY: v.top -
|
|
4849
|
-
lastX:
|
|
4850
|
-
lastY:
|
|
4847
|
+
deltaX: v.left - H.current.left,
|
|
4848
|
+
deltaY: v.top - H.current.top,
|
|
4849
|
+
lastX: H.current.left,
|
|
4850
|
+
lastY: H.current.top,
|
|
4851
4851
|
x: v.left,
|
|
4852
4852
|
y: v.top
|
|
4853
4853
|
};
|
|
4854
|
-
|
|
4854
|
+
ge.current?.(v.e, t);
|
|
4855
4855
|
}
|
|
4856
|
-
|
|
4856
|
+
pe.current = v;
|
|
4857
4857
|
}, [
|
|
4858
4858
|
v,
|
|
4859
|
-
|
|
4859
|
+
ce,
|
|
4860
4860
|
F
|
|
4861
4861
|
]);
|
|
4862
|
-
let De = li(
|
|
4863
|
-
ref:
|
|
4862
|
+
let De = li(W, w, E, A, M, ce ? H.current : null, ue ? fe.current : null), Oe = _.Children.only(t), ke = si(W), Ae = [ci(N, ke, i[0]), ci(P, o, i[1])], J = [ci(ee, ke, i[0]), ci(te, o, i[1])], je = Oe.props, Me = je.className, Ne = je.style, Y = _.cloneElement(Oe, {
|
|
4863
|
+
ref: V,
|
|
4864
4864
|
className: Ba("react-grid-item", Me, y, {
|
|
4865
4865
|
static: d,
|
|
4866
|
-
resizing:
|
|
4866
|
+
resizing: ue,
|
|
4867
4867
|
"react-draggable": c,
|
|
4868
|
-
"react-draggable-dragging":
|
|
4868
|
+
"react-draggable-dragging": ce,
|
|
4869
4869
|
dropping: !!v,
|
|
4870
4870
|
cssTransforms: f
|
|
4871
4871
|
}),
|
|
4872
4872
|
style: {
|
|
4873
4873
|
...b,
|
|
4874
4874
|
...Ne,
|
|
4875
|
-
...
|
|
4875
|
+
...be(De)
|
|
4876
4876
|
}
|
|
4877
4877
|
}), Pe = ne;
|
|
4878
4878
|
return Y = /* @__PURE__ */ j(Ha.Resizable, {
|
|
@@ -4891,13 +4891,13 @@ function Wa(e) {
|
|
|
4891
4891
|
children: Y
|
|
4892
4892
|
}), Y = /* @__PURE__ */ j(Va.DraggableCore, {
|
|
4893
4893
|
disabled: !c,
|
|
4894
|
-
onStart:
|
|
4895
|
-
onDrag:
|
|
4896
|
-
onStop:
|
|
4894
|
+
onStart: xe,
|
|
4895
|
+
onDrag: Se,
|
|
4896
|
+
onStop: Ce,
|
|
4897
4897
|
handle: x,
|
|
4898
4898
|
cancel: ".react-resizable-handle" + (S ? "," + S : ""),
|
|
4899
4899
|
scale: m,
|
|
4900
|
-
nodeRef:
|
|
4900
|
+
nodeRef: V,
|
|
4901
4901
|
children: Y
|
|
4902
4902
|
}), Y;
|
|
4903
4903
|
}
|
|
@@ -4964,47 +4964,47 @@ function Xa(e) {
|
|
|
4964
4964
|
}), [a]), te = D(() => ({
|
|
4965
4965
|
...Zi,
|
|
4966
4966
|
...o
|
|
4967
|
-
}), [o]), { cols: F, rowHeight: I, maxRows: ne, margin: L, containerPadding: R } = N, { enabled: z, bounded: B, handle: re, cancel: ie, threshold: ae } = ee, { enabled: oe, handles: se, handleComponent:
|
|
4967
|
+
}), [o]), { cols: F, rowHeight: I, maxRows: ne, margin: L, containerPadding: R } = N, { enabled: z, bounded: B, handle: re, cancel: ie, threshold: ae } = ee, { enabled: oe, handles: se, handleComponent: ce } = P, { enabled: le, defaultItem: ue, onDragOver: de } = te, V = c ?? sa("vertical"), H = V.type, fe = V.allowOverlap, pe = V.preventCollision ?? !1, me = D(() => d ?? {
|
|
4968
4968
|
i: "__dropping-elem__",
|
|
4969
|
-
...
|
|
4970
|
-
}, [d,
|
|
4971
|
-
Me.current =
|
|
4972
|
-
|
|
4969
|
+
...ue
|
|
4970
|
+
}, [d, ue]), he = s.type === "transform", ge = s.scale, U = R ?? L, [_e, ve] = k(!1), [W, ye] = k(() => Ya(u, t, F, V)), [G, K] = k(null), [be, xe] = k(!1), [Se, Ce] = k(null), [q, we] = k(), Te = O(null), Ee = O(null), De = O(null), Oe = O(0), ke = O(W), Ae = O(u), J = O(t), je = O(H), Me = O(W);
|
|
4971
|
+
Me.current = W, T(() => {
|
|
4972
|
+
ve(!0), (0, Ua.deepEqual)(W, u) || g(W);
|
|
4973
4973
|
}, []), T(() => {
|
|
4974
|
-
if (
|
|
4975
|
-
let e = !(0, Ua.deepEqual)(u, Ae.current), n = !Ja(t, J.current), r =
|
|
4974
|
+
if (G || Se) return;
|
|
4975
|
+
let e = !(0, Ua.deepEqual)(u, Ae.current), n = !Ja(t, J.current), r = H !== je.current;
|
|
4976
4976
|
if (e || n || r) {
|
|
4977
|
-
let n = Ya(e ? u :
|
|
4978
|
-
(0, Ua.deepEqual)(n,
|
|
4977
|
+
let n = Ya(e ? u : W, t, F, V);
|
|
4978
|
+
(0, Ua.deepEqual)(n, W) || ye(n);
|
|
4979
4979
|
}
|
|
4980
|
-
Ae.current = u, J.current = t, je.current =
|
|
4980
|
+
Ae.current = u, J.current = t, je.current = H;
|
|
4981
4981
|
}, [
|
|
4982
4982
|
u,
|
|
4983
4983
|
t,
|
|
4984
4984
|
F,
|
|
4985
|
-
U,
|
|
4986
4985
|
H,
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4986
|
+
V,
|
|
4987
|
+
G,
|
|
4988
|
+
Se,
|
|
4989
|
+
W
|
|
4990
4990
|
]), T(() => {
|
|
4991
|
-
!
|
|
4991
|
+
!G && !(0, Ua.deepEqual)(W, ke.current) && (ke.current = W, g(W.filter((e) => e.i !== me.i)));
|
|
4992
4992
|
}, [
|
|
4993
|
+
W,
|
|
4993
4994
|
G,
|
|
4994
|
-
K,
|
|
4995
4995
|
g,
|
|
4996
|
-
|
|
4996
|
+
me.i
|
|
4997
4997
|
]);
|
|
4998
4998
|
let Ne = D(() => {
|
|
4999
4999
|
if (!f) return;
|
|
5000
|
-
let e = bi(
|
|
5000
|
+
let e = bi(W), t = U[1];
|
|
5001
5001
|
return e * I + (e - 1) * L[1] + t * 2 + "px";
|
|
5002
5002
|
}, [
|
|
5003
5003
|
f,
|
|
5004
|
-
|
|
5004
|
+
W,
|
|
5005
5005
|
I,
|
|
5006
5006
|
L,
|
|
5007
|
-
|
|
5007
|
+
U
|
|
5008
5008
|
]), Y = C((e, t, n, r) => {
|
|
5009
5009
|
let i = Me.current, a = xi(i, e);
|
|
5010
5010
|
if (!a) return;
|
|
@@ -5015,7 +5015,7 @@ function Xa(e) {
|
|
|
5015
5015
|
y: a.y,
|
|
5016
5016
|
i: e
|
|
5017
5017
|
};
|
|
5018
|
-
Te.current = Ci(a), De.current = i,
|
|
5018
|
+
Te.current = Ci(a), De.current = i, K(o), v(i, a, a, null, r.e, r.node);
|
|
5019
5019
|
}, [v]), Pe = C((e, t, n, r) => {
|
|
5020
5020
|
let i = Me.current, a = Te.current, o = xi(i, e);
|
|
5021
5021
|
if (!o) return;
|
|
@@ -5025,35 +5025,35 @@ function Xa(e) {
|
|
|
5025
5025
|
x: o.x,
|
|
5026
5026
|
y: o.y,
|
|
5027
5027
|
i: e
|
|
5028
|
-
}, c = Oi(i, o, t, n, !0,
|
|
5029
|
-
y(c, a, o, s, r.e, r.node),
|
|
5028
|
+
}, c = Oi(i, o, t, n, !0, pe, H, F, fe);
|
|
5029
|
+
y(c, a, o, s, r.e, r.node), ye(V.compact(c, F)), K(s);
|
|
5030
5030
|
}, [
|
|
5031
|
-
|
|
5032
|
-
U,
|
|
5033
|
-
F,
|
|
5034
|
-
de,
|
|
5031
|
+
pe,
|
|
5035
5032
|
H,
|
|
5033
|
+
F,
|
|
5034
|
+
fe,
|
|
5035
|
+
V,
|
|
5036
5036
|
y
|
|
5037
5037
|
]), Fe = C((e, t, n, r) => {
|
|
5038
|
-
if (!
|
|
5038
|
+
if (!G) return;
|
|
5039
5039
|
let i = Me.current, a = Te.current, o = xi(i, e);
|
|
5040
5040
|
if (!o) return;
|
|
5041
|
-
let s = Oi(i, o, t, n, !0,
|
|
5041
|
+
let s = Oi(i, o, t, n, !0, pe, H, F, fe), c = V.compact(s, F);
|
|
5042
5042
|
b(c, a, o, null, r.e, r.node);
|
|
5043
5043
|
let l = De.current;
|
|
5044
|
-
Te.current = null, De.current = null,
|
|
5044
|
+
Te.current = null, De.current = null, K(null), ye(c), l && !(0, Ua.deepEqual)(l, c) && g(c);
|
|
5045
5045
|
}, [
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
U,
|
|
5049
|
-
F,
|
|
5050
|
-
de,
|
|
5046
|
+
G,
|
|
5047
|
+
pe,
|
|
5051
5048
|
H,
|
|
5049
|
+
F,
|
|
5050
|
+
fe,
|
|
5051
|
+
V,
|
|
5052
5052
|
b,
|
|
5053
5053
|
g
|
|
5054
5054
|
]), Ie = C((e, t, n, r) => {
|
|
5055
5055
|
let i = Me.current, a = xi(i, e);
|
|
5056
|
-
a && (Ee.current = Ci(a), De.current = i,
|
|
5056
|
+
a && (Ee.current = Ci(a), De.current = i, xe(!0), x(i, a, a, null, r.e, r.node));
|
|
5057
5057
|
}, [x]), Le = C((e, t, n, r) => {
|
|
5058
5058
|
let i = Me.current, a = Ee.current, { handle: o } = r, s = !1, c, l, [u, d] = Ei(i, e, (e) => (c = e.x, l = e.y, [
|
|
5059
5059
|
"sw",
|
|
@@ -5069,7 +5069,7 @@ function Xa(e) {
|
|
|
5069
5069
|
"ne",
|
|
5070
5070
|
"n",
|
|
5071
5071
|
"nw"
|
|
5072
|
-
].includes(o) && (l = e.y + (e.h - n), n = e.y !== l && l < 0 ? e.h : n, l = l < 0 ? 0 : l), s = !0),
|
|
5072
|
+
].includes(o) && (l = e.y + (e.h - n), n = e.y !== l && l < 0 ? e.h : n, l = l < 0 ? 0 : l), s = !0), pe && !fe && gi(i, {
|
|
5073
5073
|
...e,
|
|
5074
5074
|
w: t,
|
|
5075
5075
|
h: n,
|
|
@@ -5078,7 +5078,7 @@ function Xa(e) {
|
|
|
5078
5078
|
}).filter((t) => t.i !== e.i).length > 0 && (l = e.y, n = e.h, c = e.x, t = e.w, s = !1), e.w = t, e.h = n, e));
|
|
5079
5079
|
if (!d) return;
|
|
5080
5080
|
let f = u;
|
|
5081
|
-
s && c !== void 0 && l !== void 0 && (f = Oi(u, d, c, l, !0,
|
|
5081
|
+
s && c !== void 0 && l !== void 0 && (f = Oi(u, d, c, l, !0, pe, H, F, fe));
|
|
5082
5082
|
let p = {
|
|
5083
5083
|
w: d.w,
|
|
5084
5084
|
h: d.h,
|
|
@@ -5087,41 +5087,41 @@ function Xa(e) {
|
|
|
5087
5087
|
i: e,
|
|
5088
5088
|
static: !0
|
|
5089
5089
|
};
|
|
5090
|
-
S(f, a, d, p, r.e, r.node),
|
|
5090
|
+
S(f, a, d, p, r.e, r.node), ye(V.compact(f, F)), K(p);
|
|
5091
5091
|
}, [
|
|
5092
|
-
|
|
5093
|
-
U,
|
|
5094
|
-
F,
|
|
5095
|
-
de,
|
|
5092
|
+
pe,
|
|
5096
5093
|
H,
|
|
5094
|
+
F,
|
|
5095
|
+
fe,
|
|
5096
|
+
V,
|
|
5097
5097
|
S
|
|
5098
5098
|
]), Re = C((e, t, n, r) => {
|
|
5099
|
-
let i = Me.current, a = Ee.current, o = xi(i, e), s =
|
|
5099
|
+
let i = Me.current, a = Ee.current, o = xi(i, e), s = V.compact(i, F);
|
|
5100
5100
|
w(s, a, o ?? null, null, r.e, r.node);
|
|
5101
5101
|
let c = De.current;
|
|
5102
|
-
Ee.current = null, De.current = null,
|
|
5102
|
+
Ee.current = null, De.current = null, K(null), xe(!1), ye(s), c && !(0, Ua.deepEqual)(c, s) && g(s);
|
|
5103
5103
|
}, [
|
|
5104
5104
|
F,
|
|
5105
|
-
|
|
5105
|
+
V,
|
|
5106
5106
|
w,
|
|
5107
5107
|
g
|
|
5108
5108
|
]), X = C(() => {
|
|
5109
5109
|
let e = Me.current;
|
|
5110
|
-
if (!e.some((e) => e.i ===
|
|
5111
|
-
|
|
5110
|
+
if (!e.some((e) => e.i === me.i)) {
|
|
5111
|
+
Ce(null), K(null), we(void 0);
|
|
5112
5112
|
return;
|
|
5113
5113
|
}
|
|
5114
|
-
|
|
5114
|
+
ye(V.compact(e.filter((e) => e.i !== me.i), F)), Ce(null), K(null), we(void 0);
|
|
5115
5115
|
}, [
|
|
5116
|
-
|
|
5116
|
+
me.i,
|
|
5117
5117
|
F,
|
|
5118
|
-
|
|
5118
|
+
V
|
|
5119
5119
|
]), ze = C((e) => {
|
|
5120
5120
|
if (e.preventDefault(), e.stopPropagation(), qa && !e.nativeEvent.target?.classList.contains(Ka)) return !1;
|
|
5121
|
-
let t =
|
|
5122
|
-
if (t === !1) return
|
|
5121
|
+
let t = de ? de(e.nativeEvent) : A(e);
|
|
5122
|
+
if (t === !1) return Se && X(), !1;
|
|
5123
5123
|
let { dragOffsetX: r = 0, dragOffsetY: i = 0, ...a } = t ?? {}, o = {
|
|
5124
|
-
...
|
|
5124
|
+
...me,
|
|
5125
5125
|
...a
|
|
5126
5126
|
}, s = e.currentTarget.getBoundingClientRect(), c = {
|
|
5127
5127
|
cols: F,
|
|
@@ -5129,16 +5129,16 @@ function Xa(e) {
|
|
|
5129
5129
|
maxRows: ne,
|
|
5130
5130
|
rowHeight: I,
|
|
5131
5131
|
containerWidth: n,
|
|
5132
|
-
containerPadding:
|
|
5132
|
+
containerPadding: U
|
|
5133
5133
|
}, l = si(c), u = ci(o.w, l, L[0]), d = ci(o.h, I, L[1]), f = u / 2, p = d / 2, m = e.clientX - s.left + r - f, h = e.clientY - s.top + i - p, g = Math.max(0, m), _ = Math.max(0, h), v = {
|
|
5134
|
-
left: g /
|
|
5135
|
-
top: _ /
|
|
5134
|
+
left: g / ge,
|
|
5135
|
+
top: _ / ge,
|
|
5136
5136
|
e: e.nativeEvent
|
|
5137
5137
|
};
|
|
5138
|
-
if (
|
|
5138
|
+
if (Se) q && (q.left !== v.left || q.top !== v.top) && we(v);
|
|
5139
5139
|
else {
|
|
5140
5140
|
let e = ui(c, _, g, o.w, o.h);
|
|
5141
|
-
|
|
5141
|
+
Ce(/* @__PURE__ */ j("div", {}, o.i)), we(v), ye([...Me.current.filter((e) => e.i !== o.i), {
|
|
5142
5142
|
...o,
|
|
5143
5143
|
x: e.x,
|
|
5144
5144
|
y: e.y,
|
|
@@ -5147,41 +5147,41 @@ function Xa(e) {
|
|
|
5147
5147
|
}]);
|
|
5148
5148
|
}
|
|
5149
5149
|
}, [
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5150
|
+
Se,
|
|
5151
|
+
q,
|
|
5152
|
+
me,
|
|
5153
|
+
de,
|
|
5154
5154
|
A,
|
|
5155
5155
|
X,
|
|
5156
|
-
|
|
5156
|
+
ge,
|
|
5157
5157
|
F,
|
|
5158
5158
|
L,
|
|
5159
5159
|
ne,
|
|
5160
5160
|
I,
|
|
5161
5161
|
n,
|
|
5162
|
-
|
|
5162
|
+
U
|
|
5163
5163
|
]), Be = C((e) => {
|
|
5164
5164
|
e.preventDefault(), e.stopPropagation(), Oe.current--, Oe.current < 0 && (Oe.current = 0), Oe.current === 0 && X();
|
|
5165
5165
|
}, [X]), Ve = C((e) => {
|
|
5166
5166
|
e.preventDefault(), e.stopPropagation(), Oe.current++;
|
|
5167
5167
|
}, []), He = C((e) => {
|
|
5168
5168
|
e.preventDefault(), e.stopPropagation();
|
|
5169
|
-
let t = Me.current, n = t.find((e) => e.i ===
|
|
5169
|
+
let t = Me.current, n = t.find((e) => e.i === me.i);
|
|
5170
5170
|
Oe.current = 0, X(), E(t, n, e.nativeEvent);
|
|
5171
5171
|
}, [
|
|
5172
|
-
|
|
5172
|
+
me.i,
|
|
5173
5173
|
X,
|
|
5174
5174
|
E
|
|
5175
5175
|
]), Ue = C((e, t) => {
|
|
5176
5176
|
if (!e || !e.key) return null;
|
|
5177
|
-
let r = xi(
|
|
5177
|
+
let r = xi(W, String(e.key));
|
|
5178
5178
|
if (!r) return null;
|
|
5179
|
-
let i = typeof r.isDraggable == "boolean" ? r.isDraggable : !r.static && z, a = typeof r.isResizable == "boolean" ? r.isResizable : !r.static && oe, o = r.resizeHandles || [...se], c = i && B && r.isBounded !== !1, u =
|
|
5179
|
+
let i = typeof r.isDraggable == "boolean" ? r.isDraggable : !r.static && z, a = typeof r.isResizable == "boolean" ? r.isResizable : !r.static && oe, o = r.resizeHandles || [...se], c = i && B && r.isBounded !== !1, u = ce;
|
|
5180
5180
|
return /* @__PURE__ */ j(Wa, {
|
|
5181
5181
|
containerWidth: n,
|
|
5182
5182
|
cols: F,
|
|
5183
5183
|
margin: L,
|
|
5184
|
-
containerPadding:
|
|
5184
|
+
containerPadding: U,
|
|
5185
5185
|
maxRows: ne,
|
|
5186
5186
|
rowHeight: I,
|
|
5187
5187
|
cancel: ie,
|
|
@@ -5195,9 +5195,9 @@ function Xa(e) {
|
|
|
5195
5195
|
isDraggable: i,
|
|
5196
5196
|
isResizable: a,
|
|
5197
5197
|
isBounded: c,
|
|
5198
|
-
useCSSTransforms:
|
|
5199
|
-
usePercentages: !
|
|
5200
|
-
transformScale:
|
|
5198
|
+
useCSSTransforms: he && _e,
|
|
5199
|
+
usePercentages: !_e,
|
|
5200
|
+
transformScale: ge,
|
|
5201
5201
|
positionStrategy: s,
|
|
5202
5202
|
dragThreshold: ae,
|
|
5203
5203
|
w: r.w,
|
|
@@ -5210,20 +5210,20 @@ function Xa(e) {
|
|
|
5210
5210
|
maxH: r.maxH,
|
|
5211
5211
|
maxW: r.maxW,
|
|
5212
5212
|
static: r.static,
|
|
5213
|
-
droppingPosition: t ?
|
|
5213
|
+
droppingPosition: t ? q : void 0,
|
|
5214
5214
|
resizeHandles: o,
|
|
5215
5215
|
resizeHandle: u,
|
|
5216
5216
|
constraints: l,
|
|
5217
5217
|
layoutItem: r,
|
|
5218
|
-
layout:
|
|
5218
|
+
layout: W,
|
|
5219
5219
|
children: e
|
|
5220
5220
|
}, r.i);
|
|
5221
5221
|
}, [
|
|
5222
|
-
|
|
5222
|
+
W,
|
|
5223
5223
|
n,
|
|
5224
5224
|
F,
|
|
5225
5225
|
L,
|
|
5226
|
-
|
|
5226
|
+
U,
|
|
5227
5227
|
ne,
|
|
5228
5228
|
I,
|
|
5229
5229
|
ie,
|
|
@@ -5237,35 +5237,35 @@ function Xa(e) {
|
|
|
5237
5237
|
z,
|
|
5238
5238
|
oe,
|
|
5239
5239
|
B,
|
|
5240
|
-
me,
|
|
5241
|
-
ge,
|
|
5242
5240
|
he,
|
|
5241
|
+
_e,
|
|
5242
|
+
ge,
|
|
5243
5243
|
s,
|
|
5244
5244
|
ae,
|
|
5245
|
-
|
|
5245
|
+
q,
|
|
5246
5246
|
se,
|
|
5247
|
-
|
|
5247
|
+
ce,
|
|
5248
5248
|
l
|
|
5249
|
-
]), We = () =>
|
|
5250
|
-
w:
|
|
5251
|
-
h:
|
|
5252
|
-
x:
|
|
5253
|
-
y:
|
|
5254
|
-
i:
|
|
5255
|
-
className: `react-grid-placeholder ${
|
|
5249
|
+
]), We = () => G ? /* @__PURE__ */ j(Wa, {
|
|
5250
|
+
w: G.w,
|
|
5251
|
+
h: G.h,
|
|
5252
|
+
x: G.x,
|
|
5253
|
+
y: G.y,
|
|
5254
|
+
i: G.i,
|
|
5255
|
+
className: `react-grid-placeholder ${be ? "placeholder-resizing" : ""}`,
|
|
5256
5256
|
containerWidth: n,
|
|
5257
5257
|
cols: F,
|
|
5258
5258
|
margin: L,
|
|
5259
|
-
containerPadding:
|
|
5259
|
+
containerPadding: U,
|
|
5260
5260
|
maxRows: ne,
|
|
5261
5261
|
rowHeight: I,
|
|
5262
5262
|
isDraggable: !1,
|
|
5263
5263
|
isResizable: !1,
|
|
5264
5264
|
isBounded: !1,
|
|
5265
|
-
useCSSTransforms:
|
|
5266
|
-
transformScale:
|
|
5265
|
+
useCSSTransforms: he,
|
|
5266
|
+
transformScale: ge,
|
|
5267
5267
|
constraints: l,
|
|
5268
|
-
layout:
|
|
5268
|
+
layout: W,
|
|
5269
5269
|
children: /* @__PURE__ */ j("div", {})
|
|
5270
5270
|
}) : null;
|
|
5271
5271
|
return /* @__PURE__ */ M("div", {
|
|
@@ -5275,13 +5275,13 @@ function Xa(e) {
|
|
|
5275
5275
|
height: Ne,
|
|
5276
5276
|
...m
|
|
5277
5277
|
},
|
|
5278
|
-
onDrop:
|
|
5279
|
-
onDragLeave:
|
|
5280
|
-
onDragEnter:
|
|
5281
|
-
onDragOver:
|
|
5278
|
+
onDrop: le ? He : void 0,
|
|
5279
|
+
onDragLeave: le ? Be : void 0,
|
|
5280
|
+
onDragEnter: le ? Ve : void 0,
|
|
5281
|
+
onDragOver: le ? ze : void 0,
|
|
5282
5282
|
children: [
|
|
5283
5283
|
_.Children.map(t, (e) => _.isValidElement(e) ? Ue(e) : null),
|
|
5284
|
-
|
|
5284
|
+
le && Se && Ue(Se, !0),
|
|
5285
5285
|
We()
|
|
5286
5286
|
]
|
|
5287
5287
|
});
|
|
@@ -5547,27 +5547,33 @@ function fo({ title: e, subtitle: t, icon: n, action: r, footer: i, noPadding: a
|
|
|
5547
5547
|
});
|
|
5548
5548
|
}
|
|
5549
5549
|
//#endregion
|
|
5550
|
+
//#region src/dashboards/WidgetGroupContext.tsx
|
|
5551
|
+
var po = [], mo = y(null), ho = mo.Provider;
|
|
5552
|
+
function go() {
|
|
5553
|
+
return w(mo);
|
|
5554
|
+
}
|
|
5555
|
+
//#endregion
|
|
5550
5556
|
//#region src/dashboards/resolve-stable-time-range.ts
|
|
5551
|
-
var
|
|
5552
|
-
function
|
|
5557
|
+
var _o = 6e4;
|
|
5558
|
+
function vo(e) {
|
|
5553
5559
|
if (e.type === "absolute") return e;
|
|
5554
5560
|
let t = lr(e.period);
|
|
5555
5561
|
return {
|
|
5556
5562
|
type: "absolute",
|
|
5557
|
-
from: Math.floor(t.from /
|
|
5558
|
-
to: Math.floor(t.to /
|
|
5563
|
+
from: Math.floor(t.from / _o) * _o,
|
|
5564
|
+
to: Math.floor(t.to / _o) * _o
|
|
5559
5565
|
};
|
|
5560
5566
|
}
|
|
5561
5567
|
//#endregion
|
|
5562
5568
|
//#region src/hooks/use-stable-time-range.ts
|
|
5563
|
-
function
|
|
5569
|
+
function yo(e) {
|
|
5564
5570
|
return Math.floor(Date.now() / e);
|
|
5565
5571
|
}
|
|
5566
|
-
function
|
|
5567
|
-
let t = bt(), n = t?.intervalMs ?? 6e4, r = t?.isLive ?? !0, [i, a] = k(() =>
|
|
5572
|
+
function bo(e) {
|
|
5573
|
+
let t = bt(), n = t?.intervalMs ?? 6e4, r = t?.isLive ?? !0, [i, a] = k(() => yo(n));
|
|
5568
5574
|
return T(() => {
|
|
5569
5575
|
if (e.type === "absolute" || !r) return;
|
|
5570
|
-
let t, i = () => a(
|
|
5576
|
+
let t, i = () => a(yo(n)), o = n - Date.now() % n, s = setTimeout(() => {
|
|
5571
5577
|
i(), t = setInterval(i, n);
|
|
5572
5578
|
}, o);
|
|
5573
5579
|
if (typeof document < "u") {
|
|
@@ -5585,31 +5591,49 @@ function go(e) {
|
|
|
5585
5591
|
e.type,
|
|
5586
5592
|
r,
|
|
5587
5593
|
n
|
|
5588
|
-
]), D(() =>
|
|
5594
|
+
]), D(() => vo(e), [e, i]);
|
|
5589
5595
|
}
|
|
5590
5596
|
//#endregion
|
|
5591
5597
|
//#region src/dashboards/adapters/facets-adapter.ts
|
|
5592
|
-
var
|
|
5593
|
-
function
|
|
5594
|
-
return e.length <=
|
|
5598
|
+
var xo = 20;
|
|
5599
|
+
function So(e) {
|
|
5600
|
+
return e.length <= xo ? e : `${e.slice(0, xo - 1)}…`;
|
|
5595
5601
|
}
|
|
5596
|
-
function
|
|
5602
|
+
function Co(e) {
|
|
5597
5603
|
return e.map((e) => ({
|
|
5598
5604
|
category: e.value,
|
|
5599
5605
|
value: e.count
|
|
5600
5606
|
}));
|
|
5601
5607
|
}
|
|
5602
|
-
function
|
|
5608
|
+
function wo(e) {
|
|
5603
5609
|
return e.map((e) => ({
|
|
5604
|
-
category:
|
|
5610
|
+
category: So(e.label || e.value),
|
|
5605
5611
|
count: e.count
|
|
5606
5612
|
}));
|
|
5607
5613
|
}
|
|
5608
5614
|
//#endregion
|
|
5615
|
+
//#region src/dashboards/renderers/BarPresentation.tsx
|
|
5616
|
+
var To = 160, Eo = 72, Do = 7, Oo = 20;
|
|
5617
|
+
function ko({ data: e, config: t, state: n, layout: r = "vertical" }) {
|
|
5618
|
+
let i = D(() => {
|
|
5619
|
+
if (!(r !== "horizontal" || e.length === 0)) return { left: Math.min(To, Math.max(Eo, e.reduce((e, t) => Math.max(e, t.category.length), 0) * Do + Oo)) };
|
|
5620
|
+
}, [e, r]);
|
|
5621
|
+
return /* @__PURE__ */ j(We, {
|
|
5622
|
+
config: t,
|
|
5623
|
+
className: "h-full w-full",
|
|
5624
|
+
children: /* @__PURE__ */ j(Ve, {
|
|
5625
|
+
data: [...e],
|
|
5626
|
+
state: n,
|
|
5627
|
+
layout: r,
|
|
5628
|
+
margin: i,
|
|
5629
|
+
children: /* @__PURE__ */ j(qe, { content: /* @__PURE__ */ j(Je, {}) })
|
|
5630
|
+
})
|
|
5631
|
+
});
|
|
5632
|
+
}
|
|
5633
|
+
//#endregion
|
|
5609
5634
|
//#region src/dashboards/renderers/BarWidgetRenderer.tsx
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
let r = kt(n, e.filters), i = go(t), { data: a, isLoading: o, isError: s } = Nt({
|
|
5635
|
+
function Ao({ widget: e, timeRange: t, filters: n }) {
|
|
5636
|
+
let r = kt(n, e.filters), i = bo(t), { data: a, isLoading: o, isError: s } = Nt({
|
|
5613
5637
|
field: e.field,
|
|
5614
5638
|
timeRange: i,
|
|
5615
5639
|
filters: r,
|
|
@@ -5618,44 +5642,29 @@ function To({ widget: e, timeRange: t, filters: n }) {
|
|
|
5618
5642
|
T(() => {
|
|
5619
5643
|
s && console.error(`[BarWidgetRenderer] Failed to fetch facets for widget "${e.title}"`);
|
|
5620
5644
|
}, [s, e.title]);
|
|
5621
|
-
let
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
}
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
}, [
|
|
5634
|
-
a,
|
|
5635
|
-
e.title,
|
|
5636
|
-
c
|
|
5637
|
-
]);
|
|
5638
|
-
return /* @__PURE__ */ j(We, {
|
|
5639
|
-
config: u,
|
|
5640
|
-
className: "h-full w-full",
|
|
5641
|
-
children: /* @__PURE__ */ j(Ve, {
|
|
5642
|
-
data: l,
|
|
5643
|
-
state: o ? "loading" : s ? "empty" : "ready",
|
|
5644
|
-
layout: c,
|
|
5645
|
-
margin: d,
|
|
5646
|
-
children: /* @__PURE__ */ j(qe, { content: /* @__PURE__ */ j(Je, {}) })
|
|
5647
|
-
})
|
|
5645
|
+
let { data: c, config: l } = D(() => a ? {
|
|
5646
|
+
data: wo(a),
|
|
5647
|
+
config: { count: { label: e.title } }
|
|
5648
|
+
} : {
|
|
5649
|
+
data: [],
|
|
5650
|
+
config: {}
|
|
5651
|
+
}, [a, e.title]);
|
|
5652
|
+
return /* @__PURE__ */ j(ko, {
|
|
5653
|
+
data: c,
|
|
5654
|
+
config: l,
|
|
5655
|
+
state: o ? "loading" : s ? "empty" : "ready",
|
|
5656
|
+
layout: e.barLayout
|
|
5648
5657
|
});
|
|
5649
5658
|
}
|
|
5650
5659
|
//#endregion
|
|
5651
5660
|
//#region src/dashboards/adapters/time-series-adapter.ts
|
|
5652
|
-
function
|
|
5661
|
+
function jo(e, t, n) {
|
|
5653
5662
|
return n.filter((e) => e.metric === t.metric).length > 1 ? `${e}_${t.representation}` : e;
|
|
5654
5663
|
}
|
|
5655
|
-
function
|
|
5664
|
+
function Mo(e) {
|
|
5656
5665
|
let t = /* @__PURE__ */ new Map(), n = Infinity, r = -Infinity;
|
|
5657
5666
|
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);
|
|
5658
|
-
let i = r - n >
|
|
5667
|
+
let i = r - n > No ? Io : Fo;
|
|
5659
5668
|
for (let n of e.values()) for (let e of n) for (let n of e.points) {
|
|
5660
5669
|
let e = i(n.timestamp), r = t.get(e);
|
|
5661
5670
|
(r === void 0 || n.timestamp < r) && t.set(e, n.timestamp);
|
|
@@ -5671,7 +5680,7 @@ function Do(e) {
|
|
|
5671
5680
|
}
|
|
5672
5681
|
return o;
|
|
5673
5682
|
}
|
|
5674
|
-
var
|
|
5683
|
+
var No = 1440 * 6e4, Po = [
|
|
5675
5684
|
"Jan",
|
|
5676
5685
|
"Feb",
|
|
5677
5686
|
"Mar",
|
|
@@ -5685,86 +5694,52 @@ var Oo = 1440 * 6e4, ko = [
|
|
|
5685
5694
|
"Nov",
|
|
5686
5695
|
"Dec"
|
|
5687
5696
|
];
|
|
5688
|
-
function
|
|
5697
|
+
function Fo(e) {
|
|
5689
5698
|
let t = new Date(e);
|
|
5690
5699
|
return `${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
|
|
5691
5700
|
}
|
|
5692
|
-
function
|
|
5701
|
+
function Io(e) {
|
|
5693
5702
|
let t = new Date(e);
|
|
5694
|
-
return `${
|
|
5703
|
+
return `${Po[t.getMonth()]} ${String(t.getDate()).padStart(2, "0")} ${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
|
|
5695
5704
|
}
|
|
5696
5705
|
//#endregion
|
|
5697
5706
|
//#region src/dashboards/compute-bucket-interval.ts
|
|
5698
|
-
var
|
|
5699
|
-
function
|
|
5700
|
-
if (t <= 0) return
|
|
5707
|
+
var Lo = 6e4;
|
|
5708
|
+
function Ro(e, t) {
|
|
5709
|
+
if (t <= 0) return Lo;
|
|
5701
5710
|
let n = e.to - e.from, r = Math.floor(n / t);
|
|
5702
|
-
return Math.max(
|
|
5711
|
+
return Math.max(Lo, r);
|
|
5703
5712
|
}
|
|
5704
5713
|
//#endregion
|
|
5705
|
-
//#region src/dashboards/renderers/
|
|
5706
|
-
function
|
|
5707
|
-
let
|
|
5708
|
-
let t = [{ name: e.metric }], n = e.groupBy ? [e.groupBy] : void 0;
|
|
5709
|
-
return {
|
|
5710
|
-
queryKey: Ot.timeSeries(t, a, o, r, n),
|
|
5711
|
-
queryFn: ({ signal: e }) => i.fetchTimeSeries({
|
|
5712
|
-
metrics: t,
|
|
5713
|
-
timeRange: a,
|
|
5714
|
-
interval: o,
|
|
5715
|
-
filters: r,
|
|
5716
|
-
by: n,
|
|
5717
|
-
signal: e
|
|
5718
|
-
}),
|
|
5719
|
-
staleTime: wt,
|
|
5720
|
-
refetchOnWindowFocus: !0
|
|
5721
|
-
};
|
|
5722
|
-
}) }), c = s.some((e) => e.isLoading), l = s.some((e) => e.isError);
|
|
5723
|
-
T(() => {
|
|
5724
|
-
l && console.error(`[CartesianWidgetRenderer] One or more series queries failed for widget "${e.title}"`);
|
|
5725
|
-
}, [l, e.title]);
|
|
5726
|
-
let u = s.map((e) => e.dataUpdatedAt).join(","), { data: d, config: f, allDataKeys: p, seriesDefMap: h } = D(() => {
|
|
5727
|
-
let t = /* @__PURE__ */ new Map(), n = [], r = /* @__PURE__ */ new Map();
|
|
5728
|
-
for (let i = 0; i < e.series.length; i++) {
|
|
5729
|
-
let a = s[i], o = e.series[i];
|
|
5730
|
-
if (!(!a?.data || !o)) for (let i of a.data) {
|
|
5731
|
-
let a = Eo(i.key, o, e.series);
|
|
5732
|
-
t.has(a) || (n.push(a), r.set(a, o)), t.set(a, [{
|
|
5733
|
-
...i,
|
|
5734
|
-
key: a
|
|
5735
|
-
}]);
|
|
5736
|
-
}
|
|
5737
|
-
}
|
|
5738
|
-
return {
|
|
5739
|
-
data: Do(t),
|
|
5740
|
-
config: Io(e.series, s),
|
|
5741
|
-
allDataKeys: n,
|
|
5742
|
-
seriesDefMap: r
|
|
5743
|
-
};
|
|
5744
|
-
}, [e.series, u]), g = e.series.some((e) => e.representation === "bar") ? "band" : "point";
|
|
5714
|
+
//#region src/dashboards/renderers/CartesianPresentation.tsx
|
|
5715
|
+
function zo({ data: e, config: t, series: n, state: r }) {
|
|
5716
|
+
let i = Object.keys(t), a = n.some((e) => e.representation === "bar") ? "band" : "point";
|
|
5745
5717
|
return /* @__PURE__ */ j(We, {
|
|
5746
|
-
config:
|
|
5718
|
+
config: t,
|
|
5747
5719
|
className: "h-full w-full",
|
|
5748
5720
|
children: /* @__PURE__ */ M(Ue, {
|
|
5749
|
-
data:
|
|
5750
|
-
state:
|
|
5751
|
-
categoryScaleType:
|
|
5752
|
-
animated:
|
|
5721
|
+
data: [...e],
|
|
5722
|
+
state: r,
|
|
5723
|
+
categoryScaleType: a,
|
|
5724
|
+
animated: r === "ready",
|
|
5753
5725
|
children: [
|
|
5754
5726
|
/* @__PURE__ */ j(Xe, {}),
|
|
5755
|
-
|
|
5756
|
-
let t =
|
|
5757
|
-
return t ?
|
|
5727
|
+
i.map((e) => {
|
|
5728
|
+
let t = Bo(e, n);
|
|
5729
|
+
return t ? Vo(e, t) : null;
|
|
5758
5730
|
}),
|
|
5759
5731
|
/* @__PURE__ */ j(tt, {}),
|
|
5760
5732
|
/* @__PURE__ */ j(nt, {}),
|
|
5761
5733
|
/* @__PURE__ */ j(qe, { content: /* @__PURE__ */ j(Je, {}) }),
|
|
5762
|
-
|
|
5734
|
+
i.length > 1 && /* @__PURE__ */ j(Ge, { content: /* @__PURE__ */ j(Ke, {}) })
|
|
5763
5735
|
]
|
|
5764
5736
|
})
|
|
5765
5737
|
});
|
|
5766
5738
|
}
|
|
5767
|
-
function
|
|
5739
|
+
function Bo(e, t) {
|
|
5740
|
+
return t.find((t) => e === t.metric || e.startsWith(`${t.metric}_`));
|
|
5741
|
+
}
|
|
5742
|
+
function Vo(e, t) {
|
|
5768
5743
|
switch (t.representation) {
|
|
5769
5744
|
case "line": return /* @__PURE__ */ j(Ze, {
|
|
5770
5745
|
dataKey: e,
|
|
@@ -5783,14 +5758,60 @@ function Fo(e, t) {
|
|
|
5783
5758
|
default: return t.representation;
|
|
5784
5759
|
}
|
|
5785
5760
|
}
|
|
5786
|
-
|
|
5761
|
+
//#endregion
|
|
5762
|
+
//#region src/dashboards/renderers/CartesianWidgetRenderer.tsx
|
|
5763
|
+
function Ho({ widget: e, timeRange: t, filters: n }) {
|
|
5764
|
+
let r = kt(Mt(), n, e.filters), i = m(), a = bo(t), o = D(() => Ro(a, 48), [a]), s = ee({ queries: e.series.map((e) => {
|
|
5765
|
+
let t = [{ name: e.metric }], n = e.groupBy ? [e.groupBy] : void 0;
|
|
5766
|
+
return {
|
|
5767
|
+
queryKey: Ot.timeSeries(t, a, o, r, n),
|
|
5768
|
+
queryFn: ({ signal: e }) => i.fetchTimeSeries({
|
|
5769
|
+
metrics: t,
|
|
5770
|
+
timeRange: a,
|
|
5771
|
+
interval: o,
|
|
5772
|
+
filters: r,
|
|
5773
|
+
by: n,
|
|
5774
|
+
signal: e
|
|
5775
|
+
}),
|
|
5776
|
+
staleTime: wt,
|
|
5777
|
+
refetchOnWindowFocus: !0
|
|
5778
|
+
};
|
|
5779
|
+
}) }), c = s.some((e) => e.isLoading), l = s.some((e) => e.isError);
|
|
5780
|
+
T(() => {
|
|
5781
|
+
l && console.error(`[CartesianWidgetRenderer] One or more series queries failed for widget "${e.title}"`);
|
|
5782
|
+
}, [l, e.title]);
|
|
5783
|
+
let u = s.map((e) => e.dataUpdatedAt).join(","), { data: d, config: f } = D(() => {
|
|
5784
|
+
let t = /* @__PURE__ */ new Map();
|
|
5785
|
+
for (let n = 0; n < e.series.length; n++) {
|
|
5786
|
+
let r = s[n], i = e.series[n];
|
|
5787
|
+
if (!(!r?.data || !i)) for (let n of r.data) {
|
|
5788
|
+
let r = jo(n.key, i, e.series);
|
|
5789
|
+
t.set(r, [{
|
|
5790
|
+
...n,
|
|
5791
|
+
key: r
|
|
5792
|
+
}]);
|
|
5793
|
+
}
|
|
5794
|
+
}
|
|
5795
|
+
return {
|
|
5796
|
+
data: Mo(t),
|
|
5797
|
+
config: Uo(e.series, s)
|
|
5798
|
+
};
|
|
5799
|
+
}, [e.series, u]), p = c ? "loading" : l ? "empty" : "ready";
|
|
5800
|
+
return /* @__PURE__ */ j(zo, {
|
|
5801
|
+
data: d,
|
|
5802
|
+
config: f,
|
|
5803
|
+
series: [...e.series],
|
|
5804
|
+
state: p
|
|
5805
|
+
});
|
|
5806
|
+
}
|
|
5807
|
+
function Uo(e, t) {
|
|
5787
5808
|
let n = {};
|
|
5788
5809
|
for (let r = 0; r < e.length; r++) {
|
|
5789
5810
|
let i = t[r], a = e[r];
|
|
5790
5811
|
if (!a) continue;
|
|
5791
5812
|
let o = i?.data;
|
|
5792
5813
|
if (o) for (let t of o) {
|
|
5793
|
-
let r =
|
|
5814
|
+
let r = jo(t.key, a, e);
|
|
5794
5815
|
n[r] = { label: t.label };
|
|
5795
5816
|
}
|
|
5796
5817
|
else n[a.metric] = { label: a.metric };
|
|
@@ -5798,9 +5819,22 @@ function Io(e, t) {
|
|
|
5798
5819
|
return n;
|
|
5799
5820
|
}
|
|
5800
5821
|
//#endregion
|
|
5822
|
+
//#region src/dashboards/renderers/DoughnutPresentation.tsx
|
|
5823
|
+
function Wo({ data: e, config: t, state: n }) {
|
|
5824
|
+
return /* @__PURE__ */ j(We, {
|
|
5825
|
+
config: t,
|
|
5826
|
+
className: "h-full w-full",
|
|
5827
|
+
children: /* @__PURE__ */ M(Ye, {
|
|
5828
|
+
data: [...e],
|
|
5829
|
+
state: n,
|
|
5830
|
+
children: [/* @__PURE__ */ j(qe, { content: /* @__PURE__ */ j(Je, {}) }), /* @__PURE__ */ j(Ge, { content: /* @__PURE__ */ j(Ke, {}) })]
|
|
5831
|
+
})
|
|
5832
|
+
});
|
|
5833
|
+
}
|
|
5834
|
+
//#endregion
|
|
5801
5835
|
//#region src/dashboards/renderers/DoughnutWidgetRenderer.tsx
|
|
5802
|
-
function
|
|
5803
|
-
let r = kt(n, e.filters), i =
|
|
5836
|
+
function Go({ widget: e, timeRange: t, filters: n }) {
|
|
5837
|
+
let r = kt(n, e.filters), i = bo(t), { data: a, isLoading: o, isError: s } = Nt({
|
|
5804
5838
|
field: e.field,
|
|
5805
5839
|
timeRange: i,
|
|
5806
5840
|
filters: r,
|
|
@@ -5814,37 +5848,33 @@ function Lo({ widget: e, timeRange: t, filters: n }) {
|
|
|
5814
5848
|
data: [],
|
|
5815
5849
|
config: {}
|
|
5816
5850
|
};
|
|
5817
|
-
let e =
|
|
5851
|
+
let e = Co(a), t = {};
|
|
5818
5852
|
for (let e of a) t[e.value] = { label: e.label || e.value };
|
|
5819
5853
|
return {
|
|
5820
5854
|
data: e,
|
|
5821
5855
|
config: t
|
|
5822
5856
|
};
|
|
5823
5857
|
}, [a]);
|
|
5824
|
-
return /* @__PURE__ */ j(
|
|
5858
|
+
return /* @__PURE__ */ j(Wo, {
|
|
5859
|
+
data: c,
|
|
5825
5860
|
config: l,
|
|
5826
|
-
|
|
5827
|
-
children: /* @__PURE__ */ M(Ye, {
|
|
5828
|
-
data: c,
|
|
5829
|
-
state: o ? "loading" : s ? "empty" : "ready",
|
|
5830
|
-
children: [/* @__PURE__ */ j(qe, { content: /* @__PURE__ */ j(Je, {}) }), /* @__PURE__ */ j(Ge, { content: /* @__PURE__ */ j(Ke, {}) })]
|
|
5831
|
-
})
|
|
5861
|
+
state: o ? "loading" : s ? "empty" : "ready"
|
|
5832
5862
|
});
|
|
5833
5863
|
}
|
|
5834
5864
|
//#endregion
|
|
5835
5865
|
//#region src/dashboards/adapters/measures-adapter.ts
|
|
5836
|
-
function
|
|
5866
|
+
function Ko(e, t) {
|
|
5837
5867
|
if (e.measures.length !== 0) return t ? e.measures.find((e) => e.name === t)?.value : e.measures[0].value;
|
|
5838
5868
|
}
|
|
5839
|
-
function
|
|
5840
|
-
let n =
|
|
5869
|
+
function qo(e, t) {
|
|
5870
|
+
let n = Ko(e, t);
|
|
5841
5871
|
return {
|
|
5842
|
-
value: n === void 0 ? "—" :
|
|
5872
|
+
value: n === void 0 ? "—" : $o(n, e.unit),
|
|
5843
5873
|
label: e.name,
|
|
5844
5874
|
unit: e.unit
|
|
5845
5875
|
};
|
|
5846
5876
|
}
|
|
5847
|
-
function
|
|
5877
|
+
function Jo(e, t) {
|
|
5848
5878
|
if (t === void 0) return;
|
|
5849
5879
|
if (t === 0) return {
|
|
5850
5880
|
value: 0,
|
|
@@ -5859,17 +5889,17 @@ function Bo(e, t) {
|
|
|
5859
5889
|
direction: n > 0 ? "up" : "down"
|
|
5860
5890
|
};
|
|
5861
5891
|
}
|
|
5862
|
-
function
|
|
5892
|
+
function Yo(e, t) {
|
|
5863
5893
|
if (!e || e.length === 0) return;
|
|
5864
5894
|
let n = t ? e.find((e) => e.key === t) : e[0];
|
|
5865
5895
|
if (!(!n || n.points.length < 2)) return n.points.slice().sort((e, t) => e.timestamp - t.timestamp).map((e) => e.value);
|
|
5866
5896
|
}
|
|
5867
|
-
var
|
|
5897
|
+
var Xo = new Set([
|
|
5868
5898
|
"B",
|
|
5869
5899
|
"KB",
|
|
5870
5900
|
"MB",
|
|
5871
5901
|
"GB"
|
|
5872
|
-
]),
|
|
5902
|
+
]), Zo = {
|
|
5873
5903
|
PERCENT: { suffix: "%" },
|
|
5874
5904
|
MILLISECONDS: { suffix: "ms" },
|
|
5875
5905
|
SECONDS: { suffix: "s" },
|
|
@@ -5879,17 +5909,17 @@ var Ho = new Set([
|
|
|
5879
5909
|
GIGABYTES: { suffix: "GB" },
|
|
5880
5910
|
COUNT: { suffix: "" },
|
|
5881
5911
|
COUNT_PER_SECOND: { suffix: "/s" }
|
|
5882
|
-
},
|
|
5883
|
-
function
|
|
5884
|
-
let n = t ?
|
|
5885
|
-
if (t && !n && !
|
|
5912
|
+
}, Qo = /* @__PURE__ */ new Set();
|
|
5913
|
+
function $o(e, t) {
|
|
5914
|
+
let n = t ? Zo[t] : void 0;
|
|
5915
|
+
if (t && !n && !Qo.has(t) && (Qo.add(t), console.warn(`[formatMeasureValue] Unknown unit "${t}" — value will be displayed without unit`)), n?.suffix === "%") return `${(Math.round(e * 10) / 10).toLocaleString()}%`;
|
|
5886
5916
|
if (n?.suffix === "ms" && e >= 1e3) return `${(e / 1e3).toFixed(2)} s`;
|
|
5887
|
-
let r = n !== void 0 &&
|
|
5917
|
+
let r = n !== void 0 && Xo.has(n.suffix) ? e.toLocaleString() : e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}k` : e.toLocaleString(), i = n?.suffix;
|
|
5888
5918
|
return i ? `${r}${i === "" ? "" : ` ${i}`}` : r;
|
|
5889
5919
|
}
|
|
5890
5920
|
//#endregion
|
|
5891
5921
|
//#region src/dashboards/compute-previous-time-range.ts
|
|
5892
|
-
function
|
|
5922
|
+
function es(e) {
|
|
5893
5923
|
let t = e.to - e.from;
|
|
5894
5924
|
return {
|
|
5895
5925
|
type: "absolute",
|
|
@@ -5898,8 +5928,17 @@ function Ko(e) {
|
|
|
5898
5928
|
};
|
|
5899
5929
|
}
|
|
5900
5930
|
//#endregion
|
|
5931
|
+
//#region src/dashboards/renderers/MetricGroupPresentation.tsx
|
|
5932
|
+
function ts({ items: e, state: t, skeletonCount: n }) {
|
|
5933
|
+
return /* @__PURE__ */ j($e, {
|
|
5934
|
+
items: e,
|
|
5935
|
+
state: t,
|
|
5936
|
+
skeletonCount: n ?? e.length
|
|
5937
|
+
});
|
|
5938
|
+
}
|
|
5939
|
+
//#endregion
|
|
5901
5940
|
//#region src/dashboards/renderers/MetricGroupWidgetRenderer.tsx
|
|
5902
|
-
function
|
|
5941
|
+
function ns(e) {
|
|
5903
5942
|
let t = /* @__PURE__ */ new Map();
|
|
5904
5943
|
for (let n of e) {
|
|
5905
5944
|
let e = t.get(n.name);
|
|
@@ -5912,14 +5951,14 @@ function qo(e) {
|
|
|
5912
5951
|
measures: t === "all" ? void 0 : Array.from(t)
|
|
5913
5952
|
}));
|
|
5914
5953
|
}
|
|
5915
|
-
function
|
|
5916
|
-
let r = kt(n, e.filters), i = e.items.some((e) => e.showTrend !== !1), a =
|
|
5954
|
+
function rs({ widget: e, timeRange: t, filters: n }) {
|
|
5955
|
+
let r = kt(n, e.filters), i = e.items.some((e) => e.showTrend !== !1), a = bo(t), o = D(() => ns(e.items.map((e) => ({
|
|
5917
5956
|
name: e.metric,
|
|
5918
5957
|
measures: e.measure ? [e.measure] : void 0
|
|
5919
|
-
}))), [e.items]), s = D(() =>
|
|
5958
|
+
}))), [e.items]), s = D(() => ns(e.items.filter((e) => e.showTrend !== !1).map((e) => ({
|
|
5920
5959
|
name: e.metric,
|
|
5921
5960
|
measures: e.measure ? [e.measure] : void 0
|
|
5922
|
-
}))), [e.items]), c = D(() =>
|
|
5961
|
+
}))), [e.items]), c = D(() => es(a), [a]), { data: l, isLoading: u, isError: d } = Rt({
|
|
5923
5962
|
metrics: o,
|
|
5924
5963
|
timeRange: a,
|
|
5925
5964
|
filters: r
|
|
@@ -5933,7 +5972,7 @@ function Jo({ widget: e, timeRange: t, filters: n }) {
|
|
|
5933
5972
|
d && console.error(`[MetricGroupWidgetRenderer] Failed to fetch measures for "${e.title}"`);
|
|
5934
5973
|
}, [d, e.title]), T(() => {
|
|
5935
5974
|
p && console.error(`[MetricGroupWidgetRenderer] Failed to fetch previous-period measures for "${e.title}"`);
|
|
5936
|
-
}, [p, e.title]), /* @__PURE__ */ j(
|
|
5975
|
+
}, [p, e.title]), /* @__PURE__ */ j(ts, {
|
|
5937
5976
|
items: D(() => {
|
|
5938
5977
|
let t = new Map(l?.map((e) => [e.name, e]) ?? []), n = new Map(f?.map((e) => [e.name, e]) ?? []);
|
|
5939
5978
|
return e.items.map((e) => {
|
|
@@ -5942,11 +5981,11 @@ function Jo({ widget: e, timeRange: t, filters: n }) {
|
|
|
5942
5981
|
value: "—",
|
|
5943
5982
|
label: e.label ?? e.metric
|
|
5944
5983
|
};
|
|
5945
|
-
let i =
|
|
5984
|
+
let i = qo(r, e.measure), a = e.showTrend !== !1, o = Ko(r, e.measure), s = n.get(e.metric), c = s ? Ko(s, e.measure) : void 0;
|
|
5946
5985
|
return {
|
|
5947
5986
|
value: i.value,
|
|
5948
5987
|
label: e.label ?? r.name,
|
|
5949
|
-
trend: a && o !== void 0 ?
|
|
5988
|
+
trend: a && o !== void 0 ? Jo(o, c) : void 0,
|
|
5950
5989
|
trendSentiment: e.sentiment
|
|
5951
5990
|
};
|
|
5952
5991
|
});
|
|
@@ -5960,12 +5999,24 @@ function Jo({ widget: e, timeRange: t, filters: n }) {
|
|
|
5960
5999
|
});
|
|
5961
6000
|
}
|
|
5962
6001
|
//#endregion
|
|
6002
|
+
//#region src/dashboards/renderers/MetricPresentation.tsx
|
|
6003
|
+
function is({ value: e, label: t, state: n, trend: r, trendSentiment: i, sparklineData: a }) {
|
|
6004
|
+
return /* @__PURE__ */ j(Qe, {
|
|
6005
|
+
value: e,
|
|
6006
|
+
label: t,
|
|
6007
|
+
state: n,
|
|
6008
|
+
trend: r,
|
|
6009
|
+
trendSentiment: i,
|
|
6010
|
+
sparklineData: a
|
|
6011
|
+
});
|
|
6012
|
+
}
|
|
6013
|
+
//#endregion
|
|
5963
6014
|
//#region src/dashboards/renderers/MetricWidgetRenderer.tsx
|
|
5964
|
-
function
|
|
5965
|
-
let r = kt(n, e.filters), i = e.showTrend !== !1, a = e.showSparkline !== !1, o =
|
|
6015
|
+
function as({ widget: e, timeRange: t, filters: n }) {
|
|
6016
|
+
let r = kt(n, e.filters), i = e.showTrend !== !1, a = e.showSparkline !== !1, o = bo(t), s = D(() => [{
|
|
5966
6017
|
name: e.metric,
|
|
5967
6018
|
measures: e.measure ? [e.measure] : void 0
|
|
5968
|
-
}], [e.metric, e.measure]), c = D(() =>
|
|
6019
|
+
}], [e.metric, e.measure]), c = D(() => es(o), [o]), l = D(() => Ro(o, 24), [o]), { data: u, isLoading: d, isError: f } = Rt({
|
|
5969
6020
|
metrics: s,
|
|
5970
6021
|
timeRange: o,
|
|
5971
6022
|
filters: r
|
|
@@ -5988,8 +6039,8 @@ function Yo({ widget: e, timeRange: t, filters: n }) {
|
|
|
5988
6039
|
}, [m, e.metric]), T(() => {
|
|
5989
6040
|
g && console.error(`[MetricWidgetRenderer] Failed to fetch sparkline data for "${e.metric}"`);
|
|
5990
6041
|
}, [g, e.metric]);
|
|
5991
|
-
let _ = u?.[0], v = p?.[0], y = _ ?
|
|
5992
|
-
return /* @__PURE__ */ j(
|
|
6042
|
+
let _ = u?.[0], v = p?.[0], y = _ ? qo(_, e.measure) : void 0, b = _ ? Ko(_, e.measure) : void 0, x = v ? Ko(v, e.measure) : void 0, S = i && b !== void 0 ? Jo(b, x) : void 0, C = a ? Yo(h, e.metric) : void 0, w = d ? "loading" : f || !d && !_ ? "empty" : "ready";
|
|
6043
|
+
return /* @__PURE__ */ j(is, {
|
|
5993
6044
|
value: y?.value ?? "—",
|
|
5994
6045
|
label: e.title,
|
|
5995
6046
|
state: w,
|
|
@@ -6000,25 +6051,25 @@ function Yo({ widget: e, timeRange: t, filters: n }) {
|
|
|
6000
6051
|
}
|
|
6001
6052
|
//#endregion
|
|
6002
6053
|
//#region src/dashboards/widget-renderer-registry.ts
|
|
6003
|
-
var
|
|
6004
|
-
function
|
|
6005
|
-
|
|
6054
|
+
var os = /* @__PURE__ */ new Map();
|
|
6055
|
+
function ss(e, t) {
|
|
6056
|
+
os.set(e, t);
|
|
6006
6057
|
}
|
|
6007
|
-
function
|
|
6008
|
-
return
|
|
6058
|
+
function cs(e) {
|
|
6059
|
+
return os.get(e);
|
|
6009
6060
|
}
|
|
6010
|
-
function
|
|
6011
|
-
|
|
6061
|
+
function ls() {
|
|
6062
|
+
os.clear();
|
|
6012
6063
|
}
|
|
6013
6064
|
//#endregion
|
|
6014
6065
|
//#region src/dashboards/register-default-renderers.ts
|
|
6015
|
-
var
|
|
6016
|
-
function
|
|
6017
|
-
|
|
6066
|
+
var us = !1;
|
|
6067
|
+
function ds() {
|
|
6068
|
+
us || (us = !0, ss("cartesian", Ho), ss("doughnut", Go), ss("bar", Ao), ss("metric", as), ss("metric-group", rs));
|
|
6018
6069
|
}
|
|
6019
6070
|
//#endregion
|
|
6020
6071
|
//#region src/dashboards/renderers/UnknownWidgetFallback.tsx
|
|
6021
|
-
function
|
|
6072
|
+
function fs({ widget: e }) {
|
|
6022
6073
|
return /* @__PURE__ */ M("div", {
|
|
6023
6074
|
role: "alert",
|
|
6024
6075
|
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",
|
|
@@ -6036,16 +6087,71 @@ function ns({ widget: e }) {
|
|
|
6036
6087
|
});
|
|
6037
6088
|
}
|
|
6038
6089
|
//#endregion
|
|
6090
|
+
//#region src/dashboards/WidgetItem.tsx
|
|
6091
|
+
ds();
|
|
6092
|
+
function ps(e) {
|
|
6093
|
+
return e.data ? hs(e.widget, e.data) : /* @__PURE__ */ j(ms, {
|
|
6094
|
+
widget: e.widget,
|
|
6095
|
+
timeRange: e.timeRange,
|
|
6096
|
+
filters: e.filters
|
|
6097
|
+
});
|
|
6098
|
+
}
|
|
6099
|
+
function ms({ widget: e, timeRange: t, filters: n }) {
|
|
6100
|
+
let r = go(), i = t ?? r?.timeRange, a = n ?? r?.filters ?? po;
|
|
6101
|
+
if (!i) throw Error("[gamma-lib-observability] <WidgetItem> requires a timeRange. Provide it as a prop or wrap the component in a <WidgetGroup>.");
|
|
6102
|
+
let o = cs(e.type);
|
|
6103
|
+
return o ? b(o, {
|
|
6104
|
+
widget: e,
|
|
6105
|
+
timeRange: i,
|
|
6106
|
+
filters: a
|
|
6107
|
+
}) : /* @__PURE__ */ j(fs, { widget: e });
|
|
6108
|
+
}
|
|
6109
|
+
function hs(e, t) {
|
|
6110
|
+
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.`);
|
|
6111
|
+
switch (t.type) {
|
|
6112
|
+
case "metric": return /* @__PURE__ */ j(is, {
|
|
6113
|
+
value: t.value,
|
|
6114
|
+
label: t.label,
|
|
6115
|
+
state: t.state,
|
|
6116
|
+
trend: t.trend,
|
|
6117
|
+
trendSentiment: t.trendSentiment,
|
|
6118
|
+
sparklineData: t.sparklineData
|
|
6119
|
+
});
|
|
6120
|
+
case "metric-group": return /* @__PURE__ */ j(ts, {
|
|
6121
|
+
items: t.items,
|
|
6122
|
+
state: t.state,
|
|
6123
|
+
skeletonCount: t.skeletonCount
|
|
6124
|
+
});
|
|
6125
|
+
case "cartesian": return /* @__PURE__ */ j(zo, {
|
|
6126
|
+
data: t.data,
|
|
6127
|
+
config: t.config,
|
|
6128
|
+
series: t.series,
|
|
6129
|
+
state: t.state
|
|
6130
|
+
});
|
|
6131
|
+
case "bar": return /* @__PURE__ */ j(ko, {
|
|
6132
|
+
data: t.data,
|
|
6133
|
+
config: t.config,
|
|
6134
|
+
state: t.state,
|
|
6135
|
+
layout: t.layout
|
|
6136
|
+
});
|
|
6137
|
+
case "doughnut": return /* @__PURE__ */ j(Wo, {
|
|
6138
|
+
data: t.data,
|
|
6139
|
+
config: t.config,
|
|
6140
|
+
state: t.state
|
|
6141
|
+
});
|
|
6142
|
+
default: return /* @__PURE__ */ j(fs, { widget: e });
|
|
6143
|
+
}
|
|
6144
|
+
}
|
|
6145
|
+
//#endregion
|
|
6039
6146
|
//#region src/dashboards/DashboardView.tsx
|
|
6040
|
-
|
|
6041
|
-
var rs = {
|
|
6147
|
+
var gs = {
|
|
6042
6148
|
lg: 12,
|
|
6043
6149
|
md: 12,
|
|
6044
6150
|
sm: 12,
|
|
6045
6151
|
xs: 12,
|
|
6046
6152
|
xxs: 12
|
|
6047
6153
|
};
|
|
6048
|
-
function
|
|
6154
|
+
function _s({ dashboard: e, timeRange: t, filters: n = po, editable: r = !1, rowHeight: i, breakpointCols: a = gs, onLayoutChange: s }) {
|
|
6049
6155
|
let c = o("observability.dashboards.write"), l = r && c, u = D(() => e.widgets.map((e) => ({
|
|
6050
6156
|
id: e.id,
|
|
6051
6157
|
x: e.layout.x,
|
|
@@ -6067,28 +6173,46 @@ function is({ dashboard: e, timeRange: t, filters: n = [], editable: r = !1, row
|
|
|
6067
6173
|
onLayoutChange: s,
|
|
6068
6174
|
children: (e) => {
|
|
6069
6175
|
let r = d.get(e.id);
|
|
6070
|
-
|
|
6071
|
-
let i = Qo(r.type);
|
|
6072
|
-
return /* @__PURE__ */ j(fo, {
|
|
6176
|
+
return r ? /* @__PURE__ */ j(fo, {
|
|
6073
6177
|
title: r.title,
|
|
6074
6178
|
subtitle: r.description,
|
|
6075
|
-
noPadding:
|
|
6076
|
-
children:
|
|
6179
|
+
noPadding: vs(r),
|
|
6180
|
+
children: /* @__PURE__ */ j(ps, {
|
|
6077
6181
|
widget: r,
|
|
6078
6182
|
timeRange: t,
|
|
6079
6183
|
filters: n
|
|
6080
|
-
})
|
|
6081
|
-
});
|
|
6184
|
+
})
|
|
6185
|
+
}) : null;
|
|
6082
6186
|
}
|
|
6083
6187
|
})
|
|
6084
6188
|
});
|
|
6085
6189
|
}
|
|
6086
|
-
function
|
|
6190
|
+
function vs(e) {
|
|
6087
6191
|
return e.type === "cartesian" || e.type === "doughnut" || e.type === "bar";
|
|
6088
6192
|
}
|
|
6089
6193
|
//#endregion
|
|
6194
|
+
//#region src/dashboards/WidgetGroup.tsx
|
|
6195
|
+
var ys = {
|
|
6196
|
+
stretch: "items-stretch",
|
|
6197
|
+
center: "items-center",
|
|
6198
|
+
start: "items-start",
|
|
6199
|
+
end: "items-end"
|
|
6200
|
+
};
|
|
6201
|
+
function bs({ timeRange: e, filters: t = po, align: n = "stretch", children: r }) {
|
|
6202
|
+
return /* @__PURE__ */ j(ho, {
|
|
6203
|
+
value: D(() => ({
|
|
6204
|
+
timeRange: e,
|
|
6205
|
+
filters: t
|
|
6206
|
+
}), [e, t]),
|
|
6207
|
+
children: /* @__PURE__ */ j("div", {
|
|
6208
|
+
className: `flex flex-wrap gap-4 ${ys[n]} *:min-w-48 *:flex-1`,
|
|
6209
|
+
children: r
|
|
6210
|
+
})
|
|
6211
|
+
});
|
|
6212
|
+
}
|
|
6213
|
+
//#endregion
|
|
6090
6214
|
//#region src/dashboards/templates/dashboard-template.ts
|
|
6091
|
-
function
|
|
6215
|
+
function xs(e) {
|
|
6092
6216
|
if (!e.id) throw Error("[gamma-lib-observability] DashboardTemplate must have a non-empty id.");
|
|
6093
6217
|
if (!e.label) throw Error(`[gamma-lib-observability] DashboardTemplate "${e.id}" must have a non-empty label.`);
|
|
6094
6218
|
if (!e.dashboard) throw Error(`[gamma-lib-observability] DashboardTemplate "${e.id}" must define a dashboard or a factory function.`);
|
|
@@ -6101,37 +6225,37 @@ function os(e) {
|
|
|
6101
6225
|
dashboard: e.dashboard
|
|
6102
6226
|
};
|
|
6103
6227
|
}
|
|
6104
|
-
function
|
|
6228
|
+
function Ss(e, t) {
|
|
6105
6229
|
return typeof e.dashboard == "function" ? e.dashboard(t) : e.dashboard;
|
|
6106
6230
|
}
|
|
6107
|
-
function
|
|
6231
|
+
function Cs(e, t) {
|
|
6108
6232
|
return e.filter((e) => e.requiredCapabilities?.length ? e.requiredCapabilities.every((e) => t[e]) : !0);
|
|
6109
6233
|
}
|
|
6110
6234
|
//#endregion
|
|
6111
6235
|
//#region src/dashboards/templates/DashboardTemplatesProvider.tsx
|
|
6112
|
-
var
|
|
6113
|
-
function
|
|
6236
|
+
var ws = y(null);
|
|
6237
|
+
function Ts({ templates: e, children: t }) {
|
|
6114
6238
|
let n = D(() => e, [e]);
|
|
6115
|
-
return /* @__PURE__ */ j(
|
|
6239
|
+
return /* @__PURE__ */ j(ws.Provider, {
|
|
6116
6240
|
value: n,
|
|
6117
6241
|
children: t
|
|
6118
6242
|
});
|
|
6119
6243
|
}
|
|
6120
|
-
function
|
|
6121
|
-
let e = w(
|
|
6244
|
+
function Es() {
|
|
6245
|
+
let e = w(ws), t = l();
|
|
6122
6246
|
if (!e) throw Error("[gamma-lib-observability] useDashboardTemplates must be used within a <DashboardTemplatesProvider>. Wrap your component tree with <DashboardTemplatesProvider templates={[...]}>.");
|
|
6123
|
-
return D(() =>
|
|
6247
|
+
return D(() => Cs(e, t), [e, t]);
|
|
6124
6248
|
}
|
|
6125
|
-
function
|
|
6126
|
-
return
|
|
6249
|
+
function Ds(e) {
|
|
6250
|
+
return Es().find((t) => t.id === e);
|
|
6127
6251
|
}
|
|
6128
6252
|
//#endregion
|
|
6129
6253
|
//#region src/live/LiveIndicator.tsx
|
|
6130
|
-
function
|
|
6254
|
+
function Os(e) {
|
|
6131
6255
|
return e < 6e4 ? `${Math.round(e / 1e3)}s` : `${Math.round(e / 6e4)}min`;
|
|
6132
6256
|
}
|
|
6133
|
-
function
|
|
6134
|
-
let n = bt(), [r, i] = k(!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 ${
|
|
6257
|
+
function ks({ isFetching: e, className: t }) {
|
|
6258
|
+
let n = bt(), [r, i] = k(!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 ${Os(s)}` : "Paused — click to resume";
|
|
6135
6259
|
return /* @__PURE__ */ M(Y, { children: [/* @__PURE__ */ j(Ie, {
|
|
6136
6260
|
asChild: !0,
|
|
6137
6261
|
children: /* @__PURE__ */ M("button", {
|
|
@@ -6152,7 +6276,7 @@ function ms({ isFetching: e, className: t }) {
|
|
|
6152
6276
|
}
|
|
6153
6277
|
//#endregion
|
|
6154
6278
|
//#region src/routing/use-observability-url-state.ts
|
|
6155
|
-
function
|
|
6279
|
+
function As() {
|
|
6156
6280
|
let [e, t] = lt(), n = D(() => en(e.get("q"), e.get("v")), [e]), r = C((e, n) => {
|
|
6157
6281
|
let r = $t({
|
|
6158
6282
|
conditions: n,
|
|
@@ -6172,7 +6296,7 @@ function hs() {
|
|
|
6172
6296
|
}
|
|
6173
6297
|
//#endregion
|
|
6174
6298
|
//#region src/logs/LogSeverityBadge.tsx
|
|
6175
|
-
var
|
|
6299
|
+
var js = {
|
|
6176
6300
|
trace: "outline",
|
|
6177
6301
|
debug: "secondary",
|
|
6178
6302
|
info: "highlight",
|
|
@@ -6180,19 +6304,19 @@ var gs = {
|
|
|
6180
6304
|
error: "destructive",
|
|
6181
6305
|
fatal: "destructive"
|
|
6182
6306
|
};
|
|
6183
|
-
function
|
|
6184
|
-
return e in
|
|
6307
|
+
function Ms(e) {
|
|
6308
|
+
return e in js;
|
|
6185
6309
|
}
|
|
6186
|
-
function
|
|
6310
|
+
function Ns({ level: e }) {
|
|
6187
6311
|
let t = e.toLowerCase();
|
|
6188
6312
|
return /* @__PURE__ */ j(L, {
|
|
6189
|
-
variant:
|
|
6313
|
+
variant: Ms(t) ? js[t] : "secondary",
|
|
6190
6314
|
children: e.toUpperCase()
|
|
6191
6315
|
});
|
|
6192
6316
|
}
|
|
6193
6317
|
//#endregion
|
|
6194
6318
|
//#region src/logs/map-log-columns.tsx
|
|
6195
|
-
var
|
|
6319
|
+
var Ps = {
|
|
6196
6320
|
GET: "success",
|
|
6197
6321
|
POST: "default",
|
|
6198
6322
|
PUT: "warning",
|
|
@@ -6201,7 +6325,7 @@ var ys = {
|
|
|
6201
6325
|
HEAD: "secondary",
|
|
6202
6326
|
OPTIONS: "secondary"
|
|
6203
6327
|
};
|
|
6204
|
-
function
|
|
6328
|
+
function Fs(e) {
|
|
6205
6329
|
let t = typeof e == "number" ? new Date(e) : new Date(String(e));
|
|
6206
6330
|
return Number.isNaN(t.getTime()) ? String(e) : new Intl.DateTimeFormat("en-US", {
|
|
6207
6331
|
year: "numeric",
|
|
@@ -6214,11 +6338,11 @@ function bs(e) {
|
|
|
6214
6338
|
hour12: !1
|
|
6215
6339
|
}).format(t);
|
|
6216
6340
|
}
|
|
6217
|
-
function
|
|
6341
|
+
function Is(e) {
|
|
6218
6342
|
let t = typeof e == "number" ? e : Number(e);
|
|
6219
6343
|
return Number.isNaN(t) ? String(e) : t < 1e3 ? `${Math.round(t)}ms` : `${(t / 1e3).toFixed(2)}s`;
|
|
6220
6344
|
}
|
|
6221
|
-
function
|
|
6345
|
+
function Ls(e, t, n) {
|
|
6222
6346
|
let r = e.href?.(t);
|
|
6223
6347
|
return r ? /* @__PURE__ */ j("a", {
|
|
6224
6348
|
href: r,
|
|
@@ -6229,7 +6353,7 @@ function Ss(e, t, n) {
|
|
|
6229
6353
|
children: n
|
|
6230
6354
|
}) : n;
|
|
6231
6355
|
}
|
|
6232
|
-
function
|
|
6356
|
+
function Rs(e, t) {
|
|
6233
6357
|
if (e.render) return e.render(t);
|
|
6234
6358
|
let n = e.value(t);
|
|
6235
6359
|
if (n == null) return /* @__PURE__ */ j("span", {
|
|
@@ -6238,17 +6362,17 @@ function Cs(e, t) {
|
|
|
6238
6362
|
});
|
|
6239
6363
|
let r;
|
|
6240
6364
|
switch (e.variant) {
|
|
6241
|
-
case "badge": return /* @__PURE__ */ j(
|
|
6365
|
+
case "badge": return /* @__PURE__ */ j(Ns, { level: String(n) });
|
|
6242
6366
|
case "datetime":
|
|
6243
6367
|
r = /* @__PURE__ */ j("span", {
|
|
6244
6368
|
className: "font-mono text-xs",
|
|
6245
|
-
children:
|
|
6369
|
+
children: Fs(n)
|
|
6246
6370
|
});
|
|
6247
6371
|
break;
|
|
6248
6372
|
case "duration":
|
|
6249
6373
|
r = /* @__PURE__ */ j("span", {
|
|
6250
6374
|
className: "font-mono text-xs",
|
|
6251
|
-
children:
|
|
6375
|
+
children: Is(n)
|
|
6252
6376
|
});
|
|
6253
6377
|
break;
|
|
6254
6378
|
case "status-code": {
|
|
@@ -6262,7 +6386,7 @@ function Cs(e, t) {
|
|
|
6262
6386
|
case "http-method": {
|
|
6263
6387
|
let e = String(n).toUpperCase();
|
|
6264
6388
|
r = /* @__PURE__ */ j(L, {
|
|
6265
|
-
variant:
|
|
6389
|
+
variant: Ps[e] ?? "secondary",
|
|
6266
6390
|
children: e
|
|
6267
6391
|
});
|
|
6268
6392
|
break;
|
|
@@ -6272,26 +6396,26 @@ function Cs(e, t) {
|
|
|
6272
6396
|
children: String(n)
|
|
6273
6397
|
});
|
|
6274
6398
|
}
|
|
6275
|
-
return
|
|
6399
|
+
return Ls(e, t, r);
|
|
6276
6400
|
}
|
|
6277
|
-
function
|
|
6401
|
+
function zs(e) {
|
|
6278
6402
|
return e.map((e) => ({
|
|
6279
6403
|
id: e.key,
|
|
6280
6404
|
accessorFn: (t) => e.value(t),
|
|
6281
6405
|
header: e.label,
|
|
6282
|
-
cell: ({ row: t }) =>
|
|
6406
|
+
cell: ({ row: t }) => Rs(e, t.original),
|
|
6283
6407
|
enableSorting: !1,
|
|
6284
6408
|
enableHiding: !0
|
|
6285
6409
|
}));
|
|
6286
6410
|
}
|
|
6287
|
-
function
|
|
6411
|
+
function Bs(e) {
|
|
6288
6412
|
let t = {};
|
|
6289
6413
|
for (let n of e) n.defaultVisible === !1 && (t[n.key] = !1);
|
|
6290
6414
|
return t;
|
|
6291
6415
|
}
|
|
6292
6416
|
//#endregion
|
|
6293
6417
|
//#region src/logs/LogTable.tsx
|
|
6294
|
-
function
|
|
6418
|
+
function Vs(e, t) {
|
|
6295
6419
|
try {
|
|
6296
6420
|
let n = localStorage.getItem(e);
|
|
6297
6421
|
return n ? {
|
|
@@ -6302,23 +6426,23 @@ function Es(e, t) {
|
|
|
6302
6426
|
return typeof console < "u" && console.warn("[LogTable] Failed to read column visibility:", e), t;
|
|
6303
6427
|
}
|
|
6304
6428
|
}
|
|
6305
|
-
function
|
|
6429
|
+
function Hs(e, t) {
|
|
6306
6430
|
try {
|
|
6307
6431
|
localStorage.setItem(e, JSON.stringify(t));
|
|
6308
6432
|
} catch (e) {
|
|
6309
6433
|
typeof console < "u" && console.warn("[LogTable] Failed to persist column visibility:", e);
|
|
6310
6434
|
}
|
|
6311
6435
|
}
|
|
6312
|
-
function
|
|
6436
|
+
function Us({ columns: e, data: t, loading: n, totalCount: r, page: i, pageSize: a, onPageChange: o, onPageSizeChange: s, pageSizeOptions: c = [
|
|
6313
6437
|
10,
|
|
6314
6438
|
25,
|
|
6315
6439
|
50,
|
|
6316
6440
|
100
|
|
6317
6441
|
], onRowClick: l, toolbar: u, getRowId: d, columnVisibilityStorageKey: f }) {
|
|
6318
|
-
let p = D(() =>
|
|
6442
|
+
let p = D(() => zs(e), [e]), m = D(() => Bs(e), [e]), [h, g] = k(() => f ? Vs(f, m) : m), _ = C((e) => {
|
|
6319
6443
|
g((t) => {
|
|
6320
6444
|
let n = typeof e == "function" ? e(t) : e;
|
|
6321
|
-
return f &&
|
|
6445
|
+
return f && Hs(f, n), n;
|
|
6322
6446
|
});
|
|
6323
6447
|
}, [f]), v = C((e) => {
|
|
6324
6448
|
if (!l) return;
|
|
@@ -6345,7 +6469,7 @@ function Os({ columns: e, data: t, loading: n, totalCount: r, page: i, pageSize:
|
|
|
6345
6469
|
onClick: v,
|
|
6346
6470
|
onKeyDown: y,
|
|
6347
6471
|
className: l ? "[&_tbody_tr]:cursor-pointer" : void 0,
|
|
6348
|
-
children: /* @__PURE__ */ j(
|
|
6472
|
+
children: /* @__PURE__ */ j(V, {
|
|
6349
6473
|
columns: p,
|
|
6350
6474
|
data: t,
|
|
6351
6475
|
loading: n,
|
|
@@ -6360,15 +6484,15 @@ function Os({ columns: e, data: t, loading: n, totalCount: r, page: i, pageSize:
|
|
|
6360
6484
|
state: { columnVisibility: h },
|
|
6361
6485
|
onColumnVisibilityChange: _
|
|
6362
6486
|
},
|
|
6363
|
-
emptyMessage: /* @__PURE__ */ j(
|
|
6364
|
-
/* @__PURE__ */ j(
|
|
6487
|
+
emptyMessage: /* @__PURE__ */ j(fe, { children: /* @__PURE__ */ M(me, { children: [
|
|
6488
|
+
/* @__PURE__ */ j(he, {
|
|
6365
6489
|
variant: "icon",
|
|
6366
6490
|
children: /* @__PURE__ */ j(Tn, {})
|
|
6367
6491
|
}),
|
|
6368
|
-
/* @__PURE__ */ j(
|
|
6369
|
-
/* @__PURE__ */ j(
|
|
6492
|
+
/* @__PURE__ */ j(ge, { children: "No logs found" }),
|
|
6493
|
+
/* @__PURE__ */ j(pe, { children: "Try adjusting your filters or time range to see log entries." })
|
|
6370
6494
|
] }) }),
|
|
6371
|
-
footer: r > 0 ? /* @__PURE__ */ j(
|
|
6495
|
+
footer: r > 0 ? /* @__PURE__ */ j(H, {
|
|
6372
6496
|
page: i,
|
|
6373
6497
|
pageSize: a,
|
|
6374
6498
|
totalCount: r,
|
|
@@ -6381,24 +6505,24 @@ function Os({ columns: e, data: t, loading: n, totalCount: r, page: i, pageSize:
|
|
|
6381
6505
|
}
|
|
6382
6506
|
//#endregion
|
|
6383
6507
|
//#region src/hooks/use-logs-histogram-query.ts
|
|
6384
|
-
var
|
|
6508
|
+
var Ws = 40, Gs = "HTTP_REQUESTS", Ks = "COUNT", qs = {
|
|
6385
6509
|
from: 100,
|
|
6386
6510
|
to: 399
|
|
6387
|
-
},
|
|
6511
|
+
}, Js = {
|
|
6388
6512
|
from: 400,
|
|
6389
6513
|
to: 499
|
|
6390
|
-
},
|
|
6514
|
+
}, Ys = {
|
|
6391
6515
|
from: 500,
|
|
6392
6516
|
to: 599
|
|
6393
6517
|
};
|
|
6394
|
-
function
|
|
6395
|
-
let { timeRange: t, filters: r, enabled: i = !0 } = e, a = n(), o = kt(Mt(), r), s =
|
|
6396
|
-
name:
|
|
6397
|
-
measures: [
|
|
6518
|
+
function Xs(e) {
|
|
6519
|
+
let { timeRange: t, filters: r, enabled: i = !0 } = e, a = n(), o = kt(Mt(), r), s = bo(t), c = D(() => Ro(s, Ws), [s]), l = D(() => [{
|
|
6520
|
+
name: Gs,
|
|
6521
|
+
measures: [Ks]
|
|
6398
6522
|
}], []), u = D(() => ["HTTP_STATUS"], []), d = D(() => [
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
|
|
6523
|
+
qs,
|
|
6524
|
+
Js,
|
|
6525
|
+
Ys
|
|
6402
6526
|
], []), f = P({
|
|
6403
6527
|
queryKey: [...Ot.timeSeries(l, s, c, o, u), "histogram"],
|
|
6404
6528
|
queryFn: ({ signal: e }) => a.fetchTimeSeries({
|
|
@@ -6427,7 +6551,7 @@ function Fs(e) {
|
|
|
6427
6551
|
}
|
|
6428
6552
|
//#endregion
|
|
6429
6553
|
//#region src/logs/LogsHistogram.tsx
|
|
6430
|
-
var
|
|
6554
|
+
var Zs = {
|
|
6431
6555
|
"100-399": {
|
|
6432
6556
|
label: "1xx–3xx",
|
|
6433
6557
|
color: "var(--success)"
|
|
@@ -6440,9 +6564,9 @@ var Is = {
|
|
|
6440
6564
|
label: "5xx",
|
|
6441
6565
|
color: "var(--destructive)"
|
|
6442
6566
|
}
|
|
6443
|
-
},
|
|
6444
|
-
function
|
|
6445
|
-
let { data: t, isLoading: n, available: r } =
|
|
6567
|
+
}, Qs = "100-399", $s = "400-499", ec = "500-599";
|
|
6568
|
+
function tc(e) {
|
|
6569
|
+
let { data: t, isLoading: n, available: r } = Xs(e), i = D(() => nc(t), [t]);
|
|
6446
6570
|
if (!r) return null;
|
|
6447
6571
|
let a = !n && i.length === 0;
|
|
6448
6572
|
return /* @__PURE__ */ M("div", {
|
|
@@ -6452,7 +6576,7 @@ function Bs(e) {
|
|
|
6452
6576
|
className: "mb-1 text-xs text-muted-foreground",
|
|
6453
6577
|
children: "Requests over time"
|
|
6454
6578
|
}), /* @__PURE__ */ j(We, {
|
|
6455
|
-
config:
|
|
6579
|
+
config: Zs,
|
|
6456
6580
|
className: "h-[120px] w-full",
|
|
6457
6581
|
children: /* @__PURE__ */ M(Ue, {
|
|
6458
6582
|
data: i,
|
|
@@ -6462,15 +6586,15 @@ function Bs(e) {
|
|
|
6462
6586
|
children: [
|
|
6463
6587
|
/* @__PURE__ */ j(Xe, { orientation: "horizontal" }),
|
|
6464
6588
|
/* @__PURE__ */ j(He, {
|
|
6465
|
-
dataKey:
|
|
6589
|
+
dataKey: Qs,
|
|
6466
6590
|
stackId: "volume"
|
|
6467
6591
|
}),
|
|
6468
6592
|
/* @__PURE__ */ j(He, {
|
|
6469
|
-
dataKey:
|
|
6593
|
+
dataKey: $s,
|
|
6470
6594
|
stackId: "volume"
|
|
6471
6595
|
}),
|
|
6472
6596
|
/* @__PURE__ */ j(He, {
|
|
6473
|
-
dataKey:
|
|
6597
|
+
dataKey: ec,
|
|
6474
6598
|
stackId: "volume"
|
|
6475
6599
|
}),
|
|
6476
6600
|
/* @__PURE__ */ j(tt, {}),
|
|
@@ -6481,23 +6605,23 @@ function Bs(e) {
|
|
|
6481
6605
|
})]
|
|
6482
6606
|
});
|
|
6483
6607
|
}
|
|
6484
|
-
function
|
|
6608
|
+
function nc(e) {
|
|
6485
6609
|
let t = /* @__PURE__ */ new Map();
|
|
6486
6610
|
for (let n of e) t.set(n.key, [n]);
|
|
6487
|
-
return
|
|
6611
|
+
return Mo(t);
|
|
6488
6612
|
}
|
|
6489
6613
|
//#endregion
|
|
6490
6614
|
//#region src/logs/LogsExplorerPage.tsx
|
|
6491
|
-
var
|
|
6492
|
-
function
|
|
6493
|
-
let { timeRange: o, filters: s, setTimeRange: c, setFilters: l } =
|
|
6615
|
+
var rc = 300, ic = "observability-logs-columns";
|
|
6616
|
+
function ac({ columns: e, onRowClick: t, pageSize: n = 25, getRowId: r, scopeFilterField: i, columnVisibilityStorageKey: a = ic }) {
|
|
6617
|
+
let { timeRange: o, filters: s, setTimeRange: c, setFilters: l } = As(), u = zt(s, Ct()), [d, f] = k(""), p = Lt({
|
|
6494
6618
|
timeRange: o,
|
|
6495
6619
|
filters: s,
|
|
6496
|
-
search: vr(d,
|
|
6620
|
+
search: vr(d, rc) || void 0,
|
|
6497
6621
|
pageSize: n
|
|
6498
6622
|
}), m = /* @__PURE__ */ M("div", {
|
|
6499
6623
|
className: "relative flex-1",
|
|
6500
|
-
children: [/* @__PURE__ */ j(Nn, { className: "absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ j(
|
|
6624
|
+
children: [/* @__PURE__ */ j(Nn, { className: "absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ j(W, {
|
|
6501
6625
|
type: "search",
|
|
6502
6626
|
placeholder: "Search logs…",
|
|
6503
6627
|
value: d,
|
|
@@ -6524,14 +6648,14 @@ function Ws({ columns: e, onRowClick: t, pageSize: n = 25, getRowId: r, scopeFil
|
|
|
6524
6648
|
scopeFilterField: i
|
|
6525
6649
|
})
|
|
6526
6650
|
}),
|
|
6527
|
-
/* @__PURE__ */ j(Fe, { children: /* @__PURE__ */ j(
|
|
6651
|
+
/* @__PURE__ */ j(Fe, { children: /* @__PURE__ */ j(ks, { isFetching: p.isFetching }) }),
|
|
6528
6652
|
/* @__PURE__ */ j(tr, {
|
|
6529
6653
|
value: o,
|
|
6530
6654
|
onChange: c
|
|
6531
6655
|
})
|
|
6532
6656
|
]
|
|
6533
6657
|
}),
|
|
6534
|
-
/* @__PURE__ */ j(
|
|
6658
|
+
/* @__PURE__ */ j(tc, {
|
|
6535
6659
|
timeRange: o,
|
|
6536
6660
|
filters: s
|
|
6537
6661
|
}),
|
|
@@ -6551,7 +6675,7 @@ function Ws({ columns: e, onRowClick: t, pageSize: n = 25, getRowId: r, scopeFil
|
|
|
6551
6675
|
})
|
|
6552
6676
|
]
|
|
6553
6677
|
}),
|
|
6554
|
-
/* @__PURE__ */ j(
|
|
6678
|
+
/* @__PURE__ */ j(Us, {
|
|
6555
6679
|
columns: e,
|
|
6556
6680
|
data: p.data,
|
|
6557
6681
|
loading: p.isLoading,
|
|
@@ -6570,7 +6694,7 @@ function Ws({ columns: e, onRowClick: t, pageSize: n = 25, getRowId: r, scopeFil
|
|
|
6570
6694
|
}
|
|
6571
6695
|
//#endregion
|
|
6572
6696
|
//#region src/logs/build-logs-deep-link.ts
|
|
6573
|
-
function
|
|
6697
|
+
function oc({ basePath: e, timeRange: t, filters: n = [] }) {
|
|
6574
6698
|
let r = $t({
|
|
6575
6699
|
conditions: n,
|
|
6576
6700
|
timeRange: t
|
|
@@ -6581,7 +6705,7 @@ function Gs({ basePath: e, timeRange: t, filters: n = [] }) {
|
|
|
6581
6705
|
}
|
|
6582
6706
|
//#endregion
|
|
6583
6707
|
//#region src/logs/default-connection-log-columns.tsx
|
|
6584
|
-
var
|
|
6708
|
+
var sc = {
|
|
6585
6709
|
HTTP_PROXY: {
|
|
6586
6710
|
icon: Dn,
|
|
6587
6711
|
label: "HTTP"
|
|
@@ -6603,8 +6727,8 @@ var Ks = {
|
|
|
6603
6727
|
label: "Webhook"
|
|
6604
6728
|
}
|
|
6605
6729
|
};
|
|
6606
|
-
function
|
|
6607
|
-
let t =
|
|
6730
|
+
function cc(e) {
|
|
6731
|
+
let t = sc[e.apiType];
|
|
6608
6732
|
if (t) {
|
|
6609
6733
|
let e = t.icon;
|
|
6610
6734
|
return /* @__PURE__ */ M("span", {
|
|
@@ -6617,7 +6741,7 @@ function qs(e) {
|
|
|
6617
6741
|
children: [/* @__PURE__ */ j(Sn, { className: "size-3.5" }), e.apiType]
|
|
6618
6742
|
});
|
|
6619
6743
|
}
|
|
6620
|
-
function
|
|
6744
|
+
function lc(e, t) {
|
|
6621
6745
|
let n = e.replace(/\/$/, ""), r = [
|
|
6622
6746
|
{
|
|
6623
6747
|
key: "timestamp",
|
|
@@ -6678,7 +6802,7 @@ function Js(e, t) {
|
|
|
6678
6802
|
key: "apiType",
|
|
6679
6803
|
label: "API Type",
|
|
6680
6804
|
value: (e) => e.apiType,
|
|
6681
|
-
render:
|
|
6805
|
+
render: cc,
|
|
6682
6806
|
defaultVisible: !1
|
|
6683
6807
|
},
|
|
6684
6808
|
{
|
|
@@ -6752,14 +6876,14 @@ function Js(e, t) {
|
|
|
6752
6876
|
}
|
|
6753
6877
|
//#endregion
|
|
6754
6878
|
//#region src/logs/detail/components/LogDetailCodeBlock.tsx
|
|
6755
|
-
var
|
|
6756
|
-
function $({ code: e, language: t = "json", maxHeight: n =
|
|
6879
|
+
var uc = 240;
|
|
6880
|
+
function $({ code: e, language: t = "json", maxHeight: n = uc }) {
|
|
6757
6881
|
let [r, i] = k(!1);
|
|
6758
6882
|
if (!e) return /* @__PURE__ */ j("p", {
|
|
6759
6883
|
className: "text-xs text-muted-foreground/70 py-3 italic",
|
|
6760
6884
|
children: "No body captured"
|
|
6761
6885
|
});
|
|
6762
|
-
let a =
|
|
6886
|
+
let a = dc(e), o = a.split("\n").length > 12;
|
|
6763
6887
|
return /* @__PURE__ */ M("div", {
|
|
6764
6888
|
className: "relative rounded-lg border",
|
|
6765
6889
|
children: [
|
|
@@ -6792,7 +6916,7 @@ function $({ code: e, language: t = "json", maxHeight: n = Ys }) {
|
|
|
6792
6916
|
]
|
|
6793
6917
|
});
|
|
6794
6918
|
}
|
|
6795
|
-
function
|
|
6919
|
+
function dc(e) {
|
|
6796
6920
|
try {
|
|
6797
6921
|
let t = JSON.parse(e);
|
|
6798
6922
|
return JSON.stringify(t, null, 2);
|
|
@@ -6802,7 +6926,7 @@ function Xs(e) {
|
|
|
6802
6926
|
}
|
|
6803
6927
|
//#endregion
|
|
6804
6928
|
//#region src/logs/detail/components/LogDetailEmptyField.tsx
|
|
6805
|
-
function
|
|
6929
|
+
function fc({ message: e = "Not captured" }) {
|
|
6806
6930
|
return /* @__PURE__ */ j("p", {
|
|
6807
6931
|
className: "text-xs italic text-muted-foreground py-2",
|
|
6808
6932
|
children: e
|
|
@@ -6810,8 +6934,8 @@ function Zs({ message: e = "Not captured" }) {
|
|
|
6810
6934
|
}
|
|
6811
6935
|
//#endregion
|
|
6812
6936
|
//#region src/logs/detail/components/LogDetailHeadersTable.tsx
|
|
6813
|
-
function
|
|
6814
|
-
return !e || Object.keys(e).length === 0 ? /* @__PURE__ */ j(
|
|
6937
|
+
function pc({ headers: e }) {
|
|
6938
|
+
return !e || Object.keys(e).length === 0 ? /* @__PURE__ */ j(fc, { message: "No headers captured" }) : /* @__PURE__ */ j("div", {
|
|
6815
6939
|
className: "rounded-lg border overflow-hidden",
|
|
6816
6940
|
children: /* @__PURE__ */ j("table", {
|
|
6817
6941
|
className: "w-full text-[13px]",
|
|
@@ -6833,7 +6957,7 @@ function Qs({ headers: e }) {
|
|
|
6833
6957
|
}
|
|
6834
6958
|
//#endregion
|
|
6835
6959
|
//#region src/logs/detail/components/LogDetailJsonTree.tsx
|
|
6836
|
-
function
|
|
6960
|
+
function mc({ data: e, onCopyAll: t }) {
|
|
6837
6961
|
let n = O(null), r = () => {
|
|
6838
6962
|
let n = JSON.stringify(e, null, 2);
|
|
6839
6963
|
navigator.clipboard.writeText(n).then(() => {
|
|
@@ -6874,7 +6998,7 @@ function $s({ data: e, onCopyAll: t }) {
|
|
|
6874
6998
|
"aria-label": "Log attributes",
|
|
6875
6999
|
className: "rounded-md border p-3 text-xs font-mono",
|
|
6876
7000
|
onKeyDown: i,
|
|
6877
|
-
children: /* @__PURE__ */ j(
|
|
7001
|
+
children: /* @__PURE__ */ j(hc, {
|
|
6878
7002
|
value: e,
|
|
6879
7003
|
depth: 0,
|
|
6880
7004
|
isRoot: !0
|
|
@@ -6882,9 +7006,9 @@ function $s({ data: e, onCopyAll: t }) {
|
|
|
6882
7006
|
})]
|
|
6883
7007
|
});
|
|
6884
7008
|
}
|
|
6885
|
-
function
|
|
7009
|
+
function hc({ name: e, value: t, depth: n, isRoot: r, isLast: i }) {
|
|
6886
7010
|
let [a, o] = k(n < 2);
|
|
6887
|
-
if (t === null) return /* @__PURE__ */ j(
|
|
7011
|
+
if (t === null) return /* @__PURE__ */ j(gc, {
|
|
6888
7012
|
name: e,
|
|
6889
7013
|
value: "null",
|
|
6890
7014
|
className: "text-muted-foreground",
|
|
@@ -6957,7 +7081,7 @@ function ec({ name: e, value: t, depth: n, isRoot: r, isLast: i }) {
|
|
|
6957
7081
|
a && /* @__PURE__ */ j("div", {
|
|
6958
7082
|
className: "ml-4 border-l border-muted pl-2",
|
|
6959
7083
|
role: "group",
|
|
6960
|
-
children: c.map(([e, t], r) => /* @__PURE__ */ j(
|
|
7084
|
+
children: c.map(([e, t], r) => /* @__PURE__ */ j(hc, {
|
|
6961
7085
|
name: s ? void 0 : e,
|
|
6962
7086
|
value: t,
|
|
6963
7087
|
depth: n + 1,
|
|
@@ -6971,29 +7095,29 @@ function ec({ name: e, value: t, depth: n, isRoot: r, isLast: i }) {
|
|
|
6971
7095
|
]
|
|
6972
7096
|
});
|
|
6973
7097
|
}
|
|
6974
|
-
return typeof t == "string" ? /* @__PURE__ */ j(
|
|
7098
|
+
return typeof t == "string" ? /* @__PURE__ */ j(gc, {
|
|
6975
7099
|
name: e,
|
|
6976
7100
|
value: `"${t}"`,
|
|
6977
7101
|
className: "text-green-600 dark:text-green-400",
|
|
6978
7102
|
isLast: i
|
|
6979
|
-
}) : typeof t == "number" ? /* @__PURE__ */ j(
|
|
7103
|
+
}) : typeof t == "number" ? /* @__PURE__ */ j(gc, {
|
|
6980
7104
|
name: e,
|
|
6981
7105
|
value: String(t),
|
|
6982
7106
|
className: "text-blue-600 dark:text-blue-400",
|
|
6983
7107
|
isLast: i
|
|
6984
|
-
}) : typeof t == "boolean" ? /* @__PURE__ */ j(
|
|
7108
|
+
}) : typeof t == "boolean" ? /* @__PURE__ */ j(gc, {
|
|
6985
7109
|
name: e,
|
|
6986
7110
|
value: String(t),
|
|
6987
7111
|
className: "text-amber-600 dark:text-amber-400",
|
|
6988
7112
|
isLast: i
|
|
6989
|
-
}) : /* @__PURE__ */ j(
|
|
7113
|
+
}) : /* @__PURE__ */ j(gc, {
|
|
6990
7114
|
name: e,
|
|
6991
7115
|
value: String(t),
|
|
6992
7116
|
className: "text-foreground",
|
|
6993
7117
|
isLast: i
|
|
6994
7118
|
});
|
|
6995
7119
|
}
|
|
6996
|
-
function
|
|
7120
|
+
function gc({ name: e, value: t, className: n, isLast: r }) {
|
|
6997
7121
|
return /* @__PURE__ */ M("div", {
|
|
6998
7122
|
className: "flex items-center py-px",
|
|
6999
7123
|
role: "treeitem",
|
|
@@ -7021,17 +7145,17 @@ function tc({ name: e, value: t, className: n, isLast: r }) {
|
|
|
7021
7145
|
}
|
|
7022
7146
|
//#endregion
|
|
7023
7147
|
//#region src/logs/detail/components/LogDetailKeyValueGrid.tsx
|
|
7024
|
-
function
|
|
7148
|
+
function _c({ items: e, onFilter: t }) {
|
|
7025
7149
|
let n = e.filter((e) => e.value !== void 0 && e.value !== null && e.value !== "");
|
|
7026
7150
|
return n.length === 0 ? null : /* @__PURE__ */ j("dl", {
|
|
7027
7151
|
className: "space-y-0 divide-y divide-border/50",
|
|
7028
|
-
children: n.map((e) => /* @__PURE__ */ j(
|
|
7152
|
+
children: n.map((e) => /* @__PURE__ */ j(vc, {
|
|
7029
7153
|
item: e,
|
|
7030
7154
|
onFilter: t
|
|
7031
7155
|
}, e.label))
|
|
7032
7156
|
});
|
|
7033
7157
|
}
|
|
7034
|
-
function
|
|
7158
|
+
function vc({ item: e, onFilter: t }) {
|
|
7035
7159
|
let n = String(e.value);
|
|
7036
7160
|
return /* @__PURE__ */ M("div", {
|
|
7037
7161
|
className: "group flex items-baseline gap-4 py-2.5",
|
|
@@ -7080,7 +7204,7 @@ function rc({ item: e, onFilter: t }) {
|
|
|
7080
7204
|
}
|
|
7081
7205
|
//#endregion
|
|
7082
7206
|
//#region src/logs/detail/presets/connection-log-preset.tsx
|
|
7083
|
-
function
|
|
7207
|
+
function yc(e) {
|
|
7084
7208
|
return {
|
|
7085
7209
|
type: "preset",
|
|
7086
7210
|
resolve: (t) => {
|
|
@@ -7114,7 +7238,7 @@ function ic(e) {
|
|
|
7114
7238
|
key: "overview",
|
|
7115
7239
|
title: "Overview",
|
|
7116
7240
|
defaultOpen: !0,
|
|
7117
|
-
render: () => /* @__PURE__ */ j(
|
|
7241
|
+
render: () => /* @__PURE__ */ j(bc, {
|
|
7118
7242
|
log: n,
|
|
7119
7243
|
basePath: e?.basePath,
|
|
7120
7244
|
extraFields: e?.extraFields
|
|
@@ -7123,23 +7247,23 @@ function ic(e) {
|
|
|
7123
7247
|
key: "request",
|
|
7124
7248
|
title: "Request",
|
|
7125
7249
|
defaultOpen: !1,
|
|
7126
|
-
render: () => /* @__PURE__ */ j(
|
|
7250
|
+
render: () => /* @__PURE__ */ j(xc, { log: n })
|
|
7127
7251
|
}), i.has("response") || a.push({
|
|
7128
7252
|
key: "response",
|
|
7129
7253
|
title: "Response",
|
|
7130
7254
|
defaultOpen: !1,
|
|
7131
|
-
render: () => /* @__PURE__ */ j(
|
|
7255
|
+
render: () => /* @__PURE__ */ j(Sc, { log: n })
|
|
7132
7256
|
}), !i.has("errors") && (n.errorKey || n.warnings && n.warnings.length > 0) && a.push({
|
|
7133
7257
|
key: "errors",
|
|
7134
7258
|
title: "Issues",
|
|
7135
7259
|
defaultOpen: !0,
|
|
7136
7260
|
badge: () => (n.warnings?.length ?? 0) + +!!n.errorKey,
|
|
7137
|
-
render: () => /* @__PURE__ */ j(
|
|
7261
|
+
render: () => /* @__PURE__ */ j(Cc, { log: n })
|
|
7138
7262
|
}), i.has("raw") || a.push({
|
|
7139
7263
|
key: "raw",
|
|
7140
7264
|
title: "Raw JSON",
|
|
7141
7265
|
defaultOpen: !1,
|
|
7142
|
-
render: () => /* @__PURE__ */ j(
|
|
7266
|
+
render: () => /* @__PURE__ */ j(mc, { data: n })
|
|
7143
7267
|
}), {
|
|
7144
7268
|
header: {
|
|
7145
7269
|
method: () => n.method,
|
|
@@ -7153,9 +7277,9 @@ function ic(e) {
|
|
|
7153
7277
|
}
|
|
7154
7278
|
};
|
|
7155
7279
|
}
|
|
7156
|
-
function
|
|
7280
|
+
function bc({ log: e, basePath: t, extraFields: n }) {
|
|
7157
7281
|
let r = t?.replace(/\/$/, "") ?? "";
|
|
7158
|
-
return /* @__PURE__ */ j(
|
|
7282
|
+
return /* @__PURE__ */ j(_c, { items: [
|
|
7159
7283
|
{
|
|
7160
7284
|
label: "API",
|
|
7161
7285
|
value: e.apiName,
|
|
@@ -7224,9 +7348,9 @@ function ac({ log: e, basePath: t, extraFields: n }) {
|
|
|
7224
7348
|
})) : []
|
|
7225
7349
|
] });
|
|
7226
7350
|
}
|
|
7227
|
-
function
|
|
7351
|
+
function xc({ log: e }) {
|
|
7228
7352
|
let t = e.entrypointRequest, n = e.endpointRequest;
|
|
7229
|
-
return !t && !n ? /* @__PURE__ */ j(
|
|
7353
|
+
return !t && !n ? /* @__PURE__ */ j(fc, { message: "No request details captured" }) : /* @__PURE__ */ M("div", {
|
|
7230
7354
|
className: "space-y-4",
|
|
7231
7355
|
children: [t && /* @__PURE__ */ M("div", {
|
|
7232
7356
|
className: "space-y-2",
|
|
@@ -7235,14 +7359,14 @@ function oc({ log: e }) {
|
|
|
7235
7359
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
7236
7360
|
children: "Consumer (Entrypoint)"
|
|
7237
7361
|
}),
|
|
7238
|
-
/* @__PURE__ */ j(
|
|
7362
|
+
/* @__PURE__ */ j(_c, { items: [...e.entrypointRequest.method ? [{
|
|
7239
7363
|
label: "Method",
|
|
7240
7364
|
value: e.entrypointRequest.method
|
|
7241
7365
|
}] : [], ...e.entrypointRequest.uri ? [{
|
|
7242
7366
|
label: "URI",
|
|
7243
7367
|
value: e.entrypointRequest.uri
|
|
7244
7368
|
}] : []] }),
|
|
7245
|
-
/* @__PURE__ */ j(
|
|
7369
|
+
/* @__PURE__ */ j(pc, { headers: e.entrypointRequest.headers }),
|
|
7246
7370
|
/* @__PURE__ */ j($, { code: e.entrypointRequest.body })
|
|
7247
7371
|
]
|
|
7248
7372
|
}), n && /* @__PURE__ */ M("div", {
|
|
@@ -7252,22 +7376,22 @@ function oc({ log: e }) {
|
|
|
7252
7376
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
7253
7377
|
children: "Gateway (Endpoint)"
|
|
7254
7378
|
}),
|
|
7255
|
-
/* @__PURE__ */ j(
|
|
7379
|
+
/* @__PURE__ */ j(_c, { items: [...e.endpointRequest.method ? [{
|
|
7256
7380
|
label: "Method",
|
|
7257
7381
|
value: e.endpointRequest.method
|
|
7258
7382
|
}] : [], ...e.endpointRequest.uri ? [{
|
|
7259
7383
|
label: "URI",
|
|
7260
7384
|
value: e.endpointRequest.uri
|
|
7261
7385
|
}] : []] }),
|
|
7262
|
-
/* @__PURE__ */ j(
|
|
7386
|
+
/* @__PURE__ */ j(pc, { headers: e.endpointRequest.headers }),
|
|
7263
7387
|
/* @__PURE__ */ j($, { code: e.endpointRequest.body })
|
|
7264
7388
|
]
|
|
7265
7389
|
})]
|
|
7266
7390
|
});
|
|
7267
7391
|
}
|
|
7268
|
-
function
|
|
7392
|
+
function Sc({ log: e }) {
|
|
7269
7393
|
let t = e.endpointResponse, n = e.entrypointResponse;
|
|
7270
|
-
return !t && !n ? /* @__PURE__ */ j(
|
|
7394
|
+
return !t && !n ? /* @__PURE__ */ j(fc, { message: "No response details captured" }) : /* @__PURE__ */ M("div", {
|
|
7271
7395
|
className: "space-y-4",
|
|
7272
7396
|
children: [t && /* @__PURE__ */ M("div", {
|
|
7273
7397
|
className: "space-y-2",
|
|
@@ -7276,11 +7400,11 @@ function sc({ log: e }) {
|
|
|
7276
7400
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
7277
7401
|
children: "Gateway (Endpoint)"
|
|
7278
7402
|
}),
|
|
7279
|
-
e.endpointResponse.status !== void 0 && /* @__PURE__ */ j(
|
|
7403
|
+
e.endpointResponse.status !== void 0 && /* @__PURE__ */ j(_c, { items: [{
|
|
7280
7404
|
label: "Status",
|
|
7281
7405
|
value: e.endpointResponse.status
|
|
7282
7406
|
}] }),
|
|
7283
|
-
/* @__PURE__ */ j(
|
|
7407
|
+
/* @__PURE__ */ j(pc, { headers: e.endpointResponse.headers }),
|
|
7284
7408
|
/* @__PURE__ */ j($, { code: e.endpointResponse.body })
|
|
7285
7409
|
]
|
|
7286
7410
|
}), n && /* @__PURE__ */ M("div", {
|
|
@@ -7290,17 +7414,17 @@ function sc({ log: e }) {
|
|
|
7290
7414
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
7291
7415
|
children: "Consumer (Entrypoint)"
|
|
7292
7416
|
}),
|
|
7293
|
-
e.entrypointResponse.status !== void 0 && /* @__PURE__ */ j(
|
|
7417
|
+
e.entrypointResponse.status !== void 0 && /* @__PURE__ */ j(_c, { items: [{
|
|
7294
7418
|
label: "Status",
|
|
7295
7419
|
value: e.entrypointResponse.status
|
|
7296
7420
|
}] }),
|
|
7297
|
-
/* @__PURE__ */ j(
|
|
7421
|
+
/* @__PURE__ */ j(pc, { headers: e.entrypointResponse.headers }),
|
|
7298
7422
|
/* @__PURE__ */ j($, { code: e.entrypointResponse.body })
|
|
7299
7423
|
]
|
|
7300
7424
|
})]
|
|
7301
7425
|
});
|
|
7302
7426
|
}
|
|
7303
|
-
function
|
|
7427
|
+
function Cc({ log: e }) {
|
|
7304
7428
|
return /* @__PURE__ */ M("div", {
|
|
7305
7429
|
className: "space-y-3",
|
|
7306
7430
|
children: [e.errorKey && /* @__PURE__ */ M("div", {
|
|
@@ -7350,9 +7474,9 @@ function cc({ log: e }) {
|
|
|
7350
7474
|
}
|
|
7351
7475
|
//#endregion
|
|
7352
7476
|
//#region src/logs/detail/presets/message-log-preset.tsx
|
|
7353
|
-
var
|
|
7354
|
-
function
|
|
7355
|
-
let t = e?.messagesPageSize ??
|
|
7477
|
+
var wc = 5;
|
|
7478
|
+
function Tc(e) {
|
|
7479
|
+
let t = e?.messagesPageSize ?? wc;
|
|
7356
7480
|
return {
|
|
7357
7481
|
type: "preset",
|
|
7358
7482
|
resolve: (e) => {
|
|
@@ -7360,19 +7484,19 @@ function uc(e) {
|
|
|
7360
7484
|
key: "overview",
|
|
7361
7485
|
title: "Overview",
|
|
7362
7486
|
defaultOpen: !0,
|
|
7363
|
-
render: () => /* @__PURE__ */ j(
|
|
7487
|
+
render: () => /* @__PURE__ */ j(Ec, { log: n })
|
|
7364
7488
|
}, {
|
|
7365
7489
|
key: "connection",
|
|
7366
7490
|
title: "Connection Logs",
|
|
7367
7491
|
defaultOpen: !1,
|
|
7368
|
-
render: () => /* @__PURE__ */ j(
|
|
7492
|
+
render: () => /* @__PURE__ */ j(Dc, { log: n })
|
|
7369
7493
|
}];
|
|
7370
7494
|
return n.messages && n.messages.length > 0 && r.push({
|
|
7371
7495
|
key: "messages",
|
|
7372
7496
|
title: "Messages",
|
|
7373
7497
|
defaultOpen: !0,
|
|
7374
7498
|
badge: () => n.messages?.length,
|
|
7375
|
-
render: () => /* @__PURE__ */ j(
|
|
7499
|
+
render: () => /* @__PURE__ */ j(Oc, {
|
|
7376
7500
|
messages: n.messages,
|
|
7377
7501
|
pageSize: t
|
|
7378
7502
|
})
|
|
@@ -7380,7 +7504,7 @@ function uc(e) {
|
|
|
7380
7504
|
key: "raw",
|
|
7381
7505
|
title: "Raw JSON",
|
|
7382
7506
|
defaultOpen: !1,
|
|
7383
|
-
render: () => /* @__PURE__ */ j(
|
|
7507
|
+
render: () => /* @__PURE__ */ j(mc, { data: n })
|
|
7384
7508
|
}), {
|
|
7385
7509
|
header: {
|
|
7386
7510
|
method: () => void 0,
|
|
@@ -7394,8 +7518,8 @@ function uc(e) {
|
|
|
7394
7518
|
}
|
|
7395
7519
|
};
|
|
7396
7520
|
}
|
|
7397
|
-
function
|
|
7398
|
-
return /* @__PURE__ */ j(
|
|
7521
|
+
function Ec({ log: e }) {
|
|
7522
|
+
return /* @__PURE__ */ j(_c, { items: [
|
|
7399
7523
|
{
|
|
7400
7524
|
label: "API",
|
|
7401
7525
|
value: e.apiName,
|
|
@@ -7435,7 +7559,7 @@ function dc({ log: e }) {
|
|
|
7435
7559
|
}] : []
|
|
7436
7560
|
] });
|
|
7437
7561
|
}
|
|
7438
|
-
function
|
|
7562
|
+
function Dc({ log: e }) {
|
|
7439
7563
|
return e.entrypointRequest || e.endpointRequest || e.entrypointResponse || e.endpointResponse ? /* @__PURE__ */ M("div", {
|
|
7440
7564
|
className: "space-y-4",
|
|
7441
7565
|
children: [
|
|
@@ -7446,14 +7570,14 @@ function fc({ log: e }) {
|
|
|
7446
7570
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
7447
7571
|
children: "Entrypoint Request"
|
|
7448
7572
|
}),
|
|
7449
|
-
/* @__PURE__ */ j(
|
|
7573
|
+
/* @__PURE__ */ j(_c, { items: [...e.entrypointRequest.method ? [{
|
|
7450
7574
|
label: "Method",
|
|
7451
7575
|
value: e.entrypointRequest.method
|
|
7452
7576
|
}] : [], ...e.entrypointRequest.uri ? [{
|
|
7453
7577
|
label: "URI",
|
|
7454
7578
|
value: e.entrypointRequest.uri
|
|
7455
7579
|
}] : []] }),
|
|
7456
|
-
/* @__PURE__ */ j(
|
|
7580
|
+
/* @__PURE__ */ j(pc, { headers: e.entrypointRequest.headers }),
|
|
7457
7581
|
/* @__PURE__ */ j($, { code: e.entrypointRequest.body })
|
|
7458
7582
|
]
|
|
7459
7583
|
}),
|
|
@@ -7464,14 +7588,14 @@ function fc({ log: e }) {
|
|
|
7464
7588
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
7465
7589
|
children: "Endpoint Request"
|
|
7466
7590
|
}),
|
|
7467
|
-
/* @__PURE__ */ j(
|
|
7591
|
+
/* @__PURE__ */ j(_c, { items: [...e.endpointRequest.method ? [{
|
|
7468
7592
|
label: "Method",
|
|
7469
7593
|
value: e.endpointRequest.method
|
|
7470
7594
|
}] : [], ...e.endpointRequest.uri ? [{
|
|
7471
7595
|
label: "URI",
|
|
7472
7596
|
value: e.endpointRequest.uri
|
|
7473
7597
|
}] : []] }),
|
|
7474
|
-
/* @__PURE__ */ j(
|
|
7598
|
+
/* @__PURE__ */ j(pc, { headers: e.endpointRequest.headers }),
|
|
7475
7599
|
/* @__PURE__ */ j($, { code: e.endpointRequest.body })
|
|
7476
7600
|
]
|
|
7477
7601
|
}),
|
|
@@ -7482,11 +7606,11 @@ function fc({ log: e }) {
|
|
|
7482
7606
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
7483
7607
|
children: "Endpoint Response"
|
|
7484
7608
|
}),
|
|
7485
|
-
/* @__PURE__ */ j(
|
|
7609
|
+
/* @__PURE__ */ j(_c, { items: [...e.endpointResponse.status === void 0 ? [] : [{
|
|
7486
7610
|
label: "Status",
|
|
7487
7611
|
value: e.endpointResponse.status
|
|
7488
7612
|
}]] }),
|
|
7489
|
-
/* @__PURE__ */ j(
|
|
7613
|
+
/* @__PURE__ */ j(pc, { headers: e.endpointResponse.headers }),
|
|
7490
7614
|
/* @__PURE__ */ j($, { code: e.endpointResponse.body })
|
|
7491
7615
|
]
|
|
7492
7616
|
}),
|
|
@@ -7497,22 +7621,22 @@ function fc({ log: e }) {
|
|
|
7497
7621
|
className: "text-xs font-medium text-muted-foreground uppercase tracking-wider",
|
|
7498
7622
|
children: "Entrypoint Response"
|
|
7499
7623
|
}),
|
|
7500
|
-
/* @__PURE__ */ j(
|
|
7624
|
+
/* @__PURE__ */ j(_c, { items: [...e.entrypointResponse.status === void 0 ? [] : [{
|
|
7501
7625
|
label: "Status",
|
|
7502
7626
|
value: e.entrypointResponse.status
|
|
7503
7627
|
}]] }),
|
|
7504
|
-
/* @__PURE__ */ j(
|
|
7628
|
+
/* @__PURE__ */ j(pc, { headers: e.entrypointResponse.headers }),
|
|
7505
7629
|
/* @__PURE__ */ j($, { code: e.entrypointResponse.body })
|
|
7506
7630
|
]
|
|
7507
7631
|
})
|
|
7508
7632
|
]
|
|
7509
|
-
}) : /* @__PURE__ */ j(
|
|
7633
|
+
}) : /* @__PURE__ */ j(fc, { message: "No connection log details captured" });
|
|
7510
7634
|
}
|
|
7511
|
-
function
|
|
7635
|
+
function Oc({ messages: e, pageSize: t }) {
|
|
7512
7636
|
let [n, r] = k(t), i = e.slice(0, n), a = n < e.length;
|
|
7513
7637
|
return /* @__PURE__ */ M("div", {
|
|
7514
7638
|
className: "space-y-3",
|
|
7515
|
-
children: [i.map((e, t) => /* @__PURE__ */ j(
|
|
7639
|
+
children: [i.map((e, t) => /* @__PURE__ */ j(kc, { message: e }, e.id ?? t)), a && /* @__PURE__ */ M("button", {
|
|
7516
7640
|
onClick: () => r((e) => e + t),
|
|
7517
7641
|
className: "w-full rounded-md border py-2 text-xs text-muted-foreground hover:bg-muted/50 transition-colors",
|
|
7518
7642
|
children: [
|
|
@@ -7523,7 +7647,7 @@ function pc({ messages: e, pageSize: t }) {
|
|
|
7523
7647
|
})]
|
|
7524
7648
|
});
|
|
7525
7649
|
}
|
|
7526
|
-
function
|
|
7650
|
+
function kc({ message: e }) {
|
|
7527
7651
|
return /* @__PURE__ */ M("div", {
|
|
7528
7652
|
className: "rounded-md border p-3 space-y-2",
|
|
7529
7653
|
children: [
|
|
@@ -7571,7 +7695,7 @@ function mc({ message: e }) {
|
|
|
7571
7695
|
}
|
|
7572
7696
|
//#endregion
|
|
7573
7697
|
//#region src/logs/detail/presets/webhook-log-preset.tsx
|
|
7574
|
-
function
|
|
7698
|
+
function Ac(e) {
|
|
7575
7699
|
return {
|
|
7576
7700
|
type: "preset",
|
|
7577
7701
|
resolve: (t) => {
|
|
@@ -7596,7 +7720,7 @@ function hc(e) {
|
|
|
7596
7720
|
key: "overview",
|
|
7597
7721
|
title: "Overview",
|
|
7598
7722
|
defaultOpen: !0,
|
|
7599
|
-
render: () => /* @__PURE__ */ j(
|
|
7723
|
+
render: () => /* @__PURE__ */ j(jc, {
|
|
7600
7724
|
log: n,
|
|
7601
7725
|
basePath: e?.basePath
|
|
7602
7726
|
})
|
|
@@ -7606,22 +7730,22 @@ function hc(e) {
|
|
|
7606
7730
|
title: "Delivery Attempts",
|
|
7607
7731
|
defaultOpen: !0,
|
|
7608
7732
|
badge: () => n.retryTimeline?.length,
|
|
7609
|
-
render: () => /* @__PURE__ */ j(
|
|
7733
|
+
render: () => /* @__PURE__ */ j(Mc, { attempts: n.retryTimeline })
|
|
7610
7734
|
}), i.push({
|
|
7611
7735
|
key: "request",
|
|
7612
7736
|
title: "Request Sent by Gateway",
|
|
7613
7737
|
defaultOpen: !1,
|
|
7614
|
-
render: () => /* @__PURE__ */ j(
|
|
7738
|
+
render: () => /* @__PURE__ */ j(Nc, { log: n })
|
|
7615
7739
|
}), i.push({
|
|
7616
7740
|
key: "response",
|
|
7617
7741
|
title: "Response from Callback",
|
|
7618
7742
|
defaultOpen: !1,
|
|
7619
|
-
render: () => /* @__PURE__ */ j(
|
|
7743
|
+
render: () => /* @__PURE__ */ j(Pc, { log: n })
|
|
7620
7744
|
}), i.push({
|
|
7621
7745
|
key: "raw",
|
|
7622
7746
|
title: "Raw JSON",
|
|
7623
7747
|
defaultOpen: !1,
|
|
7624
|
-
render: () => /* @__PURE__ */ j(
|
|
7748
|
+
render: () => /* @__PURE__ */ j(mc, { data: n })
|
|
7625
7749
|
}), {
|
|
7626
7750
|
header: {
|
|
7627
7751
|
method: () => n.method,
|
|
@@ -7635,9 +7759,9 @@ function hc(e) {
|
|
|
7635
7759
|
}
|
|
7636
7760
|
};
|
|
7637
7761
|
}
|
|
7638
|
-
function
|
|
7762
|
+
function jc({ log: e, basePath: t }) {
|
|
7639
7763
|
let n = t?.replace(/\/$/, "") ?? "";
|
|
7640
|
-
return /* @__PURE__ */ j(
|
|
7764
|
+
return /* @__PURE__ */ j(_c, { items: [
|
|
7641
7765
|
{
|
|
7642
7766
|
label: "API",
|
|
7643
7767
|
value: e.apiName,
|
|
@@ -7672,7 +7796,7 @@ function gc({ log: e, basePath: t }) {
|
|
|
7672
7796
|
}] : []
|
|
7673
7797
|
] });
|
|
7674
7798
|
}
|
|
7675
|
-
function
|
|
7799
|
+
function Mc({ attempts: e }) {
|
|
7676
7800
|
return /* @__PURE__ */ j("div", {
|
|
7677
7801
|
className: "rounded-md border",
|
|
7678
7802
|
children: /* @__PURE__ */ M("table", {
|
|
@@ -7724,30 +7848,30 @@ function _c({ attempts: e }) {
|
|
|
7724
7848
|
})
|
|
7725
7849
|
});
|
|
7726
7850
|
}
|
|
7727
|
-
function
|
|
7728
|
-
return !e.requestHeaders && !e.requestBody ? /* @__PURE__ */ j(
|
|
7851
|
+
function Nc({ log: e }) {
|
|
7852
|
+
return !e.requestHeaders && !e.requestBody ? /* @__PURE__ */ j(fc, { message: "No request details captured" }) : /* @__PURE__ */ M("div", {
|
|
7729
7853
|
className: "space-y-2",
|
|
7730
|
-
children: [/* @__PURE__ */ j(
|
|
7854
|
+
children: [/* @__PURE__ */ j(pc, { headers: e.requestHeaders }), /* @__PURE__ */ j($, { code: e.requestBody })]
|
|
7731
7855
|
});
|
|
7732
7856
|
}
|
|
7733
|
-
function
|
|
7734
|
-
return !e.responseHeaders && !e.responseBody ? /* @__PURE__ */ j(
|
|
7857
|
+
function Pc({ log: e }) {
|
|
7858
|
+
return !e.responseHeaders && !e.responseBody ? /* @__PURE__ */ j(fc, { message: "No response details captured" }) : /* @__PURE__ */ M("div", {
|
|
7735
7859
|
className: "space-y-2",
|
|
7736
|
-
children: [/* @__PURE__ */ j(
|
|
7860
|
+
children: [/* @__PURE__ */ j(pc, { headers: e.responseHeaders }), /* @__PURE__ */ j($, { code: e.responseBody })]
|
|
7737
7861
|
});
|
|
7738
7862
|
}
|
|
7739
7863
|
//#endregion
|
|
7740
7864
|
//#region src/logs/detail/types.ts
|
|
7741
|
-
function
|
|
7865
|
+
function Fc(e) {
|
|
7742
7866
|
return "discriminant" in e;
|
|
7743
7867
|
}
|
|
7744
7868
|
//#endregion
|
|
7745
7869
|
//#region src/logs/detail/define-log-detail.ts
|
|
7746
|
-
function
|
|
7870
|
+
function Ic(e) {
|
|
7747
7871
|
return "preset" in e;
|
|
7748
7872
|
}
|
|
7749
|
-
function
|
|
7750
|
-
return
|
|
7873
|
+
function Lc(e) {
|
|
7874
|
+
return Ic(e) ? {
|
|
7751
7875
|
preset: e.preset,
|
|
7752
7876
|
contextChart: e.contextChart
|
|
7753
7877
|
} : {
|
|
@@ -7756,31 +7880,31 @@ function Sc(e) {
|
|
|
7756
7880
|
contextChart: e.contextChart
|
|
7757
7881
|
};
|
|
7758
7882
|
}
|
|
7759
|
-
function
|
|
7760
|
-
if (
|
|
7883
|
+
function Rc(e, t) {
|
|
7884
|
+
if (Fc(e)) {
|
|
7761
7885
|
let n = e.discriminant(t);
|
|
7762
7886
|
return e.variants[n] ?? null;
|
|
7763
7887
|
}
|
|
7764
7888
|
return e.preset;
|
|
7765
7889
|
}
|
|
7766
|
-
function
|
|
7890
|
+
function zc(e, t) {
|
|
7767
7891
|
return e.type === "preset" ? e.resolve(t) : null;
|
|
7768
7892
|
}
|
|
7769
|
-
function
|
|
7770
|
-
let { basePath: t, connectionLog: n, messageLog: r, webhookLog: i, extraVariants: a, contextChart: o } = e, s =
|
|
7893
|
+
function Bc(e) {
|
|
7894
|
+
let { basePath: t, connectionLog: n, messageLog: r, webhookLog: i, extraVariants: a, contextChart: o } = e, s = yc({
|
|
7771
7895
|
...n,
|
|
7772
7896
|
basePath: t
|
|
7773
|
-
}), c =
|
|
7897
|
+
}), c = Ac({
|
|
7774
7898
|
...i,
|
|
7775
7899
|
basePath: t
|
|
7776
7900
|
});
|
|
7777
|
-
return
|
|
7901
|
+
return Lc({
|
|
7778
7902
|
discriminant: (e) => e.apiType,
|
|
7779
7903
|
variants: {
|
|
7780
7904
|
HTTP_PROXY: s,
|
|
7781
7905
|
LLM_PROXY: s,
|
|
7782
7906
|
MCP_PROXY: s,
|
|
7783
|
-
MESSAGE:
|
|
7907
|
+
MESSAGE: Tc(r),
|
|
7784
7908
|
WEBHOOK: c,
|
|
7785
7909
|
...a
|
|
7786
7910
|
},
|
|
@@ -7793,16 +7917,16 @@ function Tc(e) {
|
|
|
7793
7917
|
}
|
|
7794
7918
|
//#endregion
|
|
7795
7919
|
//#region src/logs/detail/components/LogDetailContextChart.tsx
|
|
7796
|
-
var
|
|
7797
|
-
function
|
|
7920
|
+
var Vc = 900 * 1e3, Hc = "gateway_response_time";
|
|
7921
|
+
function Uc({ apiId: e, timestamp: t, metric: r = Hc }) {
|
|
7798
7922
|
let i = n(), a = D(() => {
|
|
7799
7923
|
let e = new Date(t).getTime();
|
|
7800
7924
|
return {
|
|
7801
7925
|
type: "absolute",
|
|
7802
|
-
from: e -
|
|
7803
|
-
to: e +
|
|
7926
|
+
from: e - Vc,
|
|
7927
|
+
to: e + Vc
|
|
7804
7928
|
};
|
|
7805
|
-
}, [t]), o = D(() =>
|
|
7929
|
+
}, [t]), o = D(() => Ro(a, 30), [a]), { data: s, isLoading: c } = P({
|
|
7806
7930
|
queryKey: Ot.timeSeries([{ name: r }], a, o, [{
|
|
7807
7931
|
field: "API_ID",
|
|
7808
7932
|
operator: "eq",
|
|
@@ -7829,7 +7953,7 @@ function Oc({ apiId: e, timestamp: t, metric: r = Dc }) {
|
|
|
7829
7953
|
} }), [l]), d = D(() => {
|
|
7830
7954
|
if (!s) return [];
|
|
7831
7955
|
let e = /* @__PURE__ */ new Map();
|
|
7832
|
-
return e.set(l, s),
|
|
7956
|
+
return e.set(l, s), Mo(e);
|
|
7833
7957
|
}, [s, l]), f = D(() => {
|
|
7834
7958
|
let e = new Date(t).getTime(), n = s?.[0]?.points;
|
|
7835
7959
|
if (d.length === 0 || !n?.length) return;
|
|
@@ -7884,18 +8008,18 @@ function Oc({ apiId: e, timestamp: t, metric: r = Dc }) {
|
|
|
7884
8008
|
}
|
|
7885
8009
|
//#endregion
|
|
7886
8010
|
//#region src/logs/detail/components/LogDetailDrawerShell.tsx
|
|
7887
|
-
var
|
|
8011
|
+
var Wc = y({
|
|
7888
8012
|
expanded: !1,
|
|
7889
8013
|
setExpanded: () => {}
|
|
7890
8014
|
});
|
|
7891
|
-
function
|
|
7892
|
-
return w(
|
|
8015
|
+
function Gc() {
|
|
8016
|
+
return w(Wc);
|
|
7893
8017
|
}
|
|
7894
|
-
var
|
|
7895
|
-
function
|
|
7896
|
-
return e === document.body ? !0 : e.closest(
|
|
8018
|
+
var Kc = "[role=\"tree\"], [role=\"treeitem\"], input, textarea, select, [contenteditable]";
|
|
8019
|
+
function qc(e) {
|
|
8020
|
+
return e === document.body ? !0 : e.closest(Kc) ? !1 : !!e.closest("[data-log-detail-shell]");
|
|
7897
8021
|
}
|
|
7898
|
-
function
|
|
8022
|
+
function Jc({ open: e, onClose: t, onNavigatePrev: n, onNavigateNext: r, children: i }) {
|
|
7899
8023
|
let [a, o] = k(!1), s = C(() => {
|
|
7900
8024
|
o(!1), t();
|
|
7901
8025
|
}, [t]), c = C((e) => {
|
|
@@ -7906,10 +8030,10 @@ function Nc({ open: e, onClose: t, onNavigatePrev: n, onNavigateNext: r, childre
|
|
|
7906
8030
|
t.preventDefault(), a ? o(!1) : s();
|
|
7907
8031
|
break;
|
|
7908
8032
|
case "ArrowUp":
|
|
7909
|
-
|
|
8033
|
+
qc(t.target) && (t.preventDefault(), n?.());
|
|
7910
8034
|
break;
|
|
7911
8035
|
case "ArrowDown":
|
|
7912
|
-
|
|
8036
|
+
qc(t.target) && (t.preventDefault(), r?.());
|
|
7913
8037
|
break;
|
|
7914
8038
|
}
|
|
7915
8039
|
}, [
|
|
@@ -7924,7 +8048,7 @@ function Nc({ open: e, onClose: t, onNavigatePrev: n, onNavigateNext: r, childre
|
|
|
7924
8048
|
expanded: a,
|
|
7925
8049
|
setExpanded: o
|
|
7926
8050
|
}), [a]);
|
|
7927
|
-
return /* @__PURE__ */ j(
|
|
8051
|
+
return /* @__PURE__ */ j(Wc.Provider, {
|
|
7928
8052
|
value: f,
|
|
7929
8053
|
children: /* @__PURE__ */ j(De, {
|
|
7930
8054
|
open: e,
|
|
@@ -7949,7 +8073,7 @@ function Nc({ open: e, onClose: t, onNavigatePrev: n, onNavigateNext: r, childre
|
|
|
7949
8073
|
className: "sr-only",
|
|
7950
8074
|
children: "Detailed view of a log entry"
|
|
7951
8075
|
}),
|
|
7952
|
-
/* @__PURE__ */ j(
|
|
8076
|
+
/* @__PURE__ */ j(xe, {
|
|
7953
8077
|
className: "h-full",
|
|
7954
8078
|
children: i
|
|
7955
8079
|
})
|
|
@@ -7960,7 +8084,7 @@ function Nc({ open: e, onClose: t, onNavigatePrev: n, onNavigateNext: r, childre
|
|
|
7960
8084
|
}
|
|
7961
8085
|
//#endregion
|
|
7962
8086
|
//#region src/logs/detail/components/LogDetailHeader.tsx
|
|
7963
|
-
var
|
|
8087
|
+
var Yc = {
|
|
7964
8088
|
GET: "success",
|
|
7965
8089
|
POST: "default",
|
|
7966
8090
|
PUT: "warning",
|
|
@@ -7969,10 +8093,10 @@ var Pc = {
|
|
|
7969
8093
|
HEAD: "secondary",
|
|
7970
8094
|
OPTIONS: "secondary"
|
|
7971
8095
|
};
|
|
7972
|
-
function
|
|
8096
|
+
function Xc(e) {
|
|
7973
8097
|
return e >= 500 ? "text-destructive" : e >= 400 ? "text-warning" : "text-success";
|
|
7974
8098
|
}
|
|
7975
|
-
function
|
|
8099
|
+
function Zc(e) {
|
|
7976
8100
|
let t = new Date(e), n = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), r = Math.floor(n / 1e3), i;
|
|
7977
8101
|
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, {
|
|
7978
8102
|
month: "short",
|
|
@@ -7992,10 +8116,10 @@ function Ic(e) {
|
|
|
7992
8116
|
full: a
|
|
7993
8117
|
};
|
|
7994
8118
|
}
|
|
7995
|
-
function
|
|
7996
|
-
let { expanded: d, setExpanded: f } =
|
|
8119
|
+
function Qc({ 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 }) {
|
|
8120
|
+
let { expanded: d, setExpanded: f } = Gc(), p = C((e) => {
|
|
7997
8121
|
e.key === "Escape" && i?.();
|
|
7998
|
-
}, [i]), m = r ?
|
|
8122
|
+
}, [i]), m = r ? Zc(r) : null;
|
|
7999
8123
|
return /* @__PURE__ */ M("div", {
|
|
8000
8124
|
className: "sticky top-0 z-10 border-b bg-background/95 backdrop-blur-sm",
|
|
8001
8125
|
role: "toolbar",
|
|
@@ -8061,11 +8185,11 @@ function Lc({ method: e, status: t, uri: n, timestamp: r, onClose: i, onNavigate
|
|
|
8061
8185
|
className: "flex items-center gap-3",
|
|
8062
8186
|
children: [
|
|
8063
8187
|
e && /* @__PURE__ */ j(L, {
|
|
8064
|
-
variant:
|
|
8188
|
+
variant: Yc[e] ?? "secondary",
|
|
8065
8189
|
children: e
|
|
8066
8190
|
}),
|
|
8067
8191
|
t !== void 0 && /* @__PURE__ */ j("span", {
|
|
8068
|
-
className: `font-mono text-sm font-semibold tabular-nums ${
|
|
8192
|
+
className: `font-mono text-sm font-semibold tabular-nums ${Xc(t)}`,
|
|
8069
8193
|
children: t
|
|
8070
8194
|
}),
|
|
8071
8195
|
m && /* @__PURE__ */ j(Fe, { children: /* @__PURE__ */ M(Y, { children: [/* @__PURE__ */ j(Ie, {
|
|
@@ -8097,9 +8221,9 @@ function Lc({ method: e, status: t, uri: n, timestamp: r, onClose: i, onNavigate
|
|
|
8097
8221
|
}
|
|
8098
8222
|
//#endregion
|
|
8099
8223
|
//#region src/logs/detail/components/LogDetailMetrics.tsx
|
|
8100
|
-
function
|
|
8224
|
+
function $c({ items: e }) {
|
|
8101
8225
|
let t = e.filter((e) => e.value !== void 0 && e.value !== null), n = D(() => t.map((e) => ({
|
|
8102
|
-
value:
|
|
8226
|
+
value: el(e.value, e.unit),
|
|
8103
8227
|
label: e.label
|
|
8104
8228
|
})), [t]);
|
|
8105
8229
|
return n.length === 0 ? null : /* @__PURE__ */ j("div", {
|
|
@@ -8112,12 +8236,12 @@ function Rc({ items: e }) {
|
|
|
8112
8236
|
})
|
|
8113
8237
|
});
|
|
8114
8238
|
}
|
|
8115
|
-
function
|
|
8239
|
+
function el(e, t) {
|
|
8116
8240
|
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}`;
|
|
8117
8241
|
}
|
|
8118
8242
|
//#endregion
|
|
8119
8243
|
//#region src/logs/detail/components/LogDetailSection.tsx
|
|
8120
|
-
function
|
|
8244
|
+
function tl({ children: e, defaultValue: t }) {
|
|
8121
8245
|
let [n, r] = k(t ?? "");
|
|
8122
8246
|
return /* @__PURE__ */ j(te, {
|
|
8123
8247
|
type: "single",
|
|
@@ -8127,7 +8251,7 @@ function Bc({ children: e, defaultValue: t }) {
|
|
|
8127
8251
|
children: e
|
|
8128
8252
|
});
|
|
8129
8253
|
}
|
|
8130
|
-
function
|
|
8254
|
+
function nl({ title: e, badge: t, children: n }) {
|
|
8131
8255
|
return /* @__PURE__ */ M(I, {
|
|
8132
8256
|
value: e,
|
|
8133
8257
|
className: "border-b last:border-b-0",
|
|
@@ -8149,26 +8273,26 @@ function Vc({ title: e, badge: t, children: n }) {
|
|
|
8149
8273
|
}
|
|
8150
8274
|
//#endregion
|
|
8151
8275
|
//#region src/logs/detail/components/LogDetailContent.tsx
|
|
8152
|
-
var
|
|
8153
|
-
Header:
|
|
8154
|
-
Section:
|
|
8155
|
-
KeyValueGrid:
|
|
8156
|
-
HeadersTable:
|
|
8276
|
+
var rl = {
|
|
8277
|
+
Header: Qc,
|
|
8278
|
+
Section: nl,
|
|
8279
|
+
KeyValueGrid: _c,
|
|
8280
|
+
HeadersTable: pc,
|
|
8157
8281
|
CodeBlock: $,
|
|
8158
|
-
Metrics:
|
|
8282
|
+
Metrics: $c
|
|
8159
8283
|
};
|
|
8160
|
-
function
|
|
8161
|
-
let f =
|
|
8284
|
+
function il({ 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 }) {
|
|
8285
|
+
let f = Rc(e, t);
|
|
8162
8286
|
if (!f) return /* @__PURE__ */ j("div", {
|
|
8163
8287
|
className: "flex items-center justify-center p-8 text-sm text-muted-foreground",
|
|
8164
8288
|
children: "No detail view configured for this log type."
|
|
8165
8289
|
});
|
|
8166
|
-
if (f.type === "custom") return /* @__PURE__ */ j(A, { children: f.render(t,
|
|
8167
|
-
let p =
|
|
8290
|
+
if (f.type === "custom") return /* @__PURE__ */ j(A, { children: f.render(t, rl) });
|
|
8291
|
+
let p = zc(f, t);
|
|
8168
8292
|
if (!p) return null;
|
|
8169
8293
|
let m = e.contextChart;
|
|
8170
8294
|
return /* @__PURE__ */ M(A, { children: [
|
|
8171
|
-
/* @__PURE__ */ j(
|
|
8295
|
+
/* @__PURE__ */ j(Qc, {
|
|
8172
8296
|
method: p.header.method(t),
|
|
8173
8297
|
status: p.header.status(t),
|
|
8174
8298
|
uri: p.header.uri(t),
|
|
@@ -8181,19 +8305,19 @@ function Uc({ config: e, log: t, logId: n, onClose: r, onCopyJson: i, onNavigate
|
|
|
8181
8305
|
hasNext: d ? l : !1,
|
|
8182
8306
|
showExpandToggle: u
|
|
8183
8307
|
}),
|
|
8184
|
-
m && /* @__PURE__ */ j(
|
|
8308
|
+
m && /* @__PURE__ */ j(Uc, {
|
|
8185
8309
|
apiId: m.extractApiId(t),
|
|
8186
8310
|
timestamp: m.extractTimestamp?.(t) ?? p.header.timestamp(t),
|
|
8187
8311
|
metric: m.metric
|
|
8188
8312
|
}),
|
|
8189
|
-
p.metrics && p.metrics.length > 0 && /* @__PURE__ */ j(
|
|
8313
|
+
p.metrics && p.metrics.length > 0 && /* @__PURE__ */ j($c, { items: p.metrics.map((e) => ({
|
|
8190
8314
|
label: e.label,
|
|
8191
8315
|
value: e.value(t),
|
|
8192
8316
|
unit: e.unit
|
|
8193
8317
|
})) }),
|
|
8194
|
-
/* @__PURE__ */ j(
|
|
8318
|
+
/* @__PURE__ */ j(tl, {
|
|
8195
8319
|
defaultValue: p.sections.find((e) => e.defaultOpen)?.title,
|
|
8196
|
-
children: p.sections.map((e) => /* @__PURE__ */ j(
|
|
8320
|
+
children: p.sections.map((e) => /* @__PURE__ */ j(nl, {
|
|
8197
8321
|
title: e.title,
|
|
8198
8322
|
badge: e.badge?.(t),
|
|
8199
8323
|
children: e.render(t, s)
|
|
@@ -8203,20 +8327,20 @@ function Uc({ config: e, log: t, logId: n, onClose: r, onCopyJson: i, onNavigate
|
|
|
8203
8327
|
}
|
|
8204
8328
|
//#endregion
|
|
8205
8329
|
//#region src/logs/detail/utils/clipboard.ts
|
|
8206
|
-
function
|
|
8330
|
+
function al(e) {
|
|
8207
8331
|
navigator.clipboard.writeText(JSON.stringify(e, null, 2)).then(() => X.success("Full JSON copied to clipboard"), () => X.error("Failed to copy to clipboard"));
|
|
8208
8332
|
}
|
|
8209
8333
|
//#endregion
|
|
8210
8334
|
//#region src/logs/detail/components/LogDetailDrawer.tsx
|
|
8211
|
-
function
|
|
8335
|
+
function ol({ config: e, logId: t, onClose: n, onNavigatePrev: r, onNavigateNext: i, onFilter: a, hasPrev: o, hasNext: s }) {
|
|
8212
8336
|
let { data: c, isLoading: l, isError: u, isNotFound: d, isUnsupported: f, refetch: p } = Pt({ id: t });
|
|
8213
|
-
return /* @__PURE__ */ M(
|
|
8337
|
+
return /* @__PURE__ */ M(Jc, {
|
|
8214
8338
|
open: !!t,
|
|
8215
8339
|
onClose: n,
|
|
8216
8340
|
onNavigatePrev: r,
|
|
8217
8341
|
onNavigateNext: i,
|
|
8218
8342
|
children: [
|
|
8219
|
-
l && /* @__PURE__ */ j(
|
|
8343
|
+
l && /* @__PURE__ */ j(sl, {}),
|
|
8220
8344
|
f && /* @__PURE__ */ M("div", {
|
|
8221
8345
|
className: "flex flex-col items-center justify-center gap-2 p-8 text-center text-muted-foreground",
|
|
8222
8346
|
children: [/* @__PURE__ */ j("p", {
|
|
@@ -8253,13 +8377,13 @@ function Gc({ config: e, logId: t, onClose: n, onNavigatePrev: r, onNavigateNext
|
|
|
8253
8377
|
})
|
|
8254
8378
|
]
|
|
8255
8379
|
}),
|
|
8256
|
-
c != null && /* @__PURE__ */ j(
|
|
8380
|
+
c != null && /* @__PURE__ */ j(il, {
|
|
8257
8381
|
config: e,
|
|
8258
8382
|
log: c,
|
|
8259
8383
|
logId: t,
|
|
8260
8384
|
onClose: n,
|
|
8261
8385
|
onCopyJson: () => {
|
|
8262
|
-
c &&
|
|
8386
|
+
c && al(c);
|
|
8263
8387
|
},
|
|
8264
8388
|
onNavigatePrev: r,
|
|
8265
8389
|
onNavigateNext: i,
|
|
@@ -8270,7 +8394,7 @@ function Gc({ config: e, logId: t, onClose: n, onNavigatePrev: r, onNavigateNext
|
|
|
8270
8394
|
]
|
|
8271
8395
|
});
|
|
8272
8396
|
}
|
|
8273
|
-
function
|
|
8397
|
+
function sl() {
|
|
8274
8398
|
return /* @__PURE__ */ M("div", {
|
|
8275
8399
|
className: "space-y-4 p-4",
|
|
8276
8400
|
children: [
|
|
@@ -8298,7 +8422,7 @@ function Kc() {
|
|
|
8298
8422
|
}
|
|
8299
8423
|
//#endregion
|
|
8300
8424
|
//#region src/logs/detail/components/LogDetailPage.tsx
|
|
8301
|
-
function
|
|
8425
|
+
function cl({ config: e, onFilter: t }) {
|
|
8302
8426
|
let { logId: n } = ct(), r = st(), { data: i, isLoading: a, isError: o, isNotFound: s, isUnsupported: c, refetch: l } = Pt({ id: n }), u = () => r(-1);
|
|
8303
8427
|
return a ? /* @__PURE__ */ M("div", {
|
|
8304
8428
|
className: "space-y-4 p-6",
|
|
@@ -8359,13 +8483,13 @@ function qc({ config: e, onFilter: t }) {
|
|
|
8359
8483
|
})
|
|
8360
8484
|
}), /* @__PURE__ */ j(B, {
|
|
8361
8485
|
className: "mx-6 mt-4 overflow-hidden",
|
|
8362
|
-
children: /* @__PURE__ */ j(
|
|
8486
|
+
children: /* @__PURE__ */ j(il, {
|
|
8363
8487
|
config: e,
|
|
8364
8488
|
log: i,
|
|
8365
8489
|
logId: n,
|
|
8366
8490
|
onClose: u,
|
|
8367
8491
|
onCopyJson: () => {
|
|
8368
|
-
i &&
|
|
8492
|
+
i && al(i);
|
|
8369
8493
|
},
|
|
8370
8494
|
onFilter: t,
|
|
8371
8495
|
showExpandToggle: !1,
|
|
@@ -8376,14 +8500,14 @@ function qc({ config: e, onFilter: t }) {
|
|
|
8376
8500
|
}
|
|
8377
8501
|
//#endregion
|
|
8378
8502
|
//#region src/data-sources/http-data-source.ts
|
|
8379
|
-
function
|
|
8503
|
+
function ll(e) {
|
|
8380
8504
|
return e.metrics.map((e) => ({
|
|
8381
8505
|
name: e.name,
|
|
8382
8506
|
unit: e.unit,
|
|
8383
8507
|
measures: e.measures ?? []
|
|
8384
8508
|
}));
|
|
8385
8509
|
}
|
|
8386
|
-
function
|
|
8510
|
+
function ul(e) {
|
|
8387
8511
|
let t = [];
|
|
8388
8512
|
for (let n of e.metrics) if (n.buckets) for (let e of n.buckets) {
|
|
8389
8513
|
let n = e.measures?.[0]?.value ?? 0;
|
|
@@ -8395,7 +8519,7 @@ function Yc(e) {
|
|
|
8395
8519
|
}
|
|
8396
8520
|
return t;
|
|
8397
8521
|
}
|
|
8398
|
-
function
|
|
8522
|
+
function dl(e) {
|
|
8399
8523
|
let t = [];
|
|
8400
8524
|
for (let n of e.metrics) if (n.buckets) if (n.buckets.some((e) => e.type === "GROUP" && e.buckets?.length)) {
|
|
8401
8525
|
let e = /* @__PURE__ */ new Map();
|
|
@@ -8432,8 +8556,8 @@ function Xc(e) {
|
|
|
8432
8556
|
}
|
|
8433
8557
|
return t;
|
|
8434
8558
|
}
|
|
8435
|
-
function
|
|
8436
|
-
let t =
|
|
8559
|
+
function fl(e) {
|
|
8560
|
+
let t = vo(e.timeRange), n = { timeRange: {
|
|
8437
8561
|
from: new Date(t.from).toISOString(),
|
|
8438
8562
|
to: new Date(t.to).toISOString()
|
|
8439
8563
|
} };
|
|
@@ -8450,7 +8574,7 @@ function Zc(e) {
|
|
|
8450
8574
|
}))), "sorts" in e && e.sorts?.length && (t.sorts = e.sorts), t;
|
|
8451
8575
|
})), "interval" in e && (n.interval = e.interval), "by" in e && e.by?.length && (n.by = e.by), "limit" in e && e.limit !== void 0 && (n.limit = e.limit), "field" in e && (n.by = [e.field], n.metrics = []), n;
|
|
8452
8576
|
}
|
|
8453
|
-
function
|
|
8577
|
+
function pl(e) {
|
|
8454
8578
|
async function t(t, n, r) {
|
|
8455
8579
|
let i = await fetch(`${e}${t}`, {
|
|
8456
8580
|
method: "POST",
|
|
@@ -8463,19 +8587,19 @@ function Qc(e) {
|
|
|
8463
8587
|
}
|
|
8464
8588
|
return {
|
|
8465
8589
|
async fetchTimeSeries(e) {
|
|
8466
|
-
return
|
|
8590
|
+
return dl(await t("/analytics/time-series", fl(e), e.signal));
|
|
8467
8591
|
},
|
|
8468
8592
|
async fetchFacets(e) {
|
|
8469
|
-
return
|
|
8593
|
+
return ul(await t("/analytics/facets", fl(e), e.signal));
|
|
8470
8594
|
},
|
|
8471
8595
|
async fetchMeasures(e) {
|
|
8472
|
-
return
|
|
8596
|
+
return ll(await t("/analytics/measures", fl(e), e.signal));
|
|
8473
8597
|
}
|
|
8474
8598
|
};
|
|
8475
8599
|
}
|
|
8476
8600
|
//#endregion
|
|
8477
8601
|
//#region src/data-sources/http-filter-source.ts
|
|
8478
|
-
function
|
|
8602
|
+
function ml(e) {
|
|
8479
8603
|
return {
|
|
8480
8604
|
EQ: "eq",
|
|
8481
8605
|
IN: "in",
|
|
@@ -8488,10 +8612,10 @@ function $c(e) {
|
|
|
8488
8612
|
CONTAINS: "contains"
|
|
8489
8613
|
}[e] ?? e.toLowerCase();
|
|
8490
8614
|
}
|
|
8491
|
-
function
|
|
8615
|
+
function hl(e) {
|
|
8492
8616
|
return e === "ENUM" ? "enum" : "async";
|
|
8493
8617
|
}
|
|
8494
|
-
function
|
|
8618
|
+
function gl(e) {
|
|
8495
8619
|
function t(t) {
|
|
8496
8620
|
return async (n) => {
|
|
8497
8621
|
let r = new URLSearchParams({
|
|
@@ -8516,7 +8640,7 @@ function tl(e) {
|
|
|
8516
8640
|
let r = await fetch(`${e}/observability/filters/definition`, { signal: n });
|
|
8517
8641
|
if (!r.ok) throw Error(`[gamma-lib-observability] HTTP ${r.status} on GET filters/definition`);
|
|
8518
8642
|
return (await r.json()).data.map((e) => {
|
|
8519
|
-
let n =
|
|
8643
|
+
let n = hl(e.type), r = e.operators.map(ml), i = e.apiTypes;
|
|
8520
8644
|
if (n === "enum") {
|
|
8521
8645
|
let t = (e.enumValues ?? []).map((e) => ({
|
|
8522
8646
|
value: e,
|
|
@@ -8557,8 +8681,8 @@ function tl(e) {
|
|
|
8557
8681
|
}
|
|
8558
8682
|
//#endregion
|
|
8559
8683
|
//#region src/routing/DashboardListPage.tsx
|
|
8560
|
-
function
|
|
8561
|
-
let t = l(), n = D(() =>
|
|
8684
|
+
function _l({ templates: e }) {
|
|
8685
|
+
let t = l(), n = D(() => Cs(e, t), [e, t]), r = D(() => [{
|
|
8562
8686
|
id: "name",
|
|
8563
8687
|
accessorKey: "label",
|
|
8564
8688
|
header: "Name",
|
|
@@ -8581,7 +8705,7 @@ function nl({ templates: e }) {
|
|
|
8581
8705
|
children: [/* @__PURE__ */ j("h1", {
|
|
8582
8706
|
className: "text-lg font-semibold",
|
|
8583
8707
|
children: "Dashboards"
|
|
8584
|
-
}), /* @__PURE__ */ j(
|
|
8708
|
+
}), /* @__PURE__ */ j(V, {
|
|
8585
8709
|
columns: r,
|
|
8586
8710
|
data: n,
|
|
8587
8711
|
emptyMessage: "No dashboards available.",
|
|
@@ -8591,8 +8715,8 @@ function nl({ templates: e }) {
|
|
|
8591
8715
|
}
|
|
8592
8716
|
//#endregion
|
|
8593
8717
|
//#region src/routing/ObservabilityDashboardPage.tsx
|
|
8594
|
-
function
|
|
8595
|
-
let { dashboardId: n } = ct(), r = l(), i = D(() =>
|
|
8718
|
+
function vl({ templates: e, scopeFilterField: t }) {
|
|
8719
|
+
let { dashboardId: n } = ct(), r = l(), i = D(() => Cs(e, r), [e, r]).find((e) => e.id === n), { timeRange: a, filters: o, setTimeRange: s, setFilters: c } = As(), u = zt(o, Ct()), d = D(() => i ? Ss(i, { capabilities: r }) : null, [i, r]);
|
|
8596
8720
|
return !i || !d ? /* @__PURE__ */ j("div", {
|
|
8597
8721
|
className: "flex items-center justify-center p-8 text-muted-foreground",
|
|
8598
8722
|
children: n ? `Dashboard "${n}" not found.` : "No dashboard available."
|
|
@@ -8620,7 +8744,7 @@ function rl({ templates: e, scopeFilterField: t }) {
|
|
|
8620
8744
|
onChange: s
|
|
8621
8745
|
})]
|
|
8622
8746
|
}),
|
|
8623
|
-
/* @__PURE__ */ j(
|
|
8747
|
+
/* @__PURE__ */ j(_s, {
|
|
8624
8748
|
dashboard: d,
|
|
8625
8749
|
timeRange: a,
|
|
8626
8750
|
filters: o
|
|
@@ -8630,17 +8754,17 @@ function rl({ templates: e, scopeFilterField: t }) {
|
|
|
8630
8754
|
}
|
|
8631
8755
|
//#endregion
|
|
8632
8756
|
//#region src/routing/ObservabilityRoutes.tsx
|
|
8633
|
-
var
|
|
8634
|
-
function
|
|
8757
|
+
var yl = [];
|
|
8758
|
+
function bl({ children: e }) {
|
|
8635
8759
|
let t = Ct(), { data: n, isLoading: r, isError: i } = P({
|
|
8636
8760
|
queryKey: ["observability", "filter-definitions"],
|
|
8637
8761
|
queryFn: ({ signal: e }) => t.fetchFilterDefinitions(e),
|
|
8638
8762
|
enabled: !!t,
|
|
8639
8763
|
staleTime: 300 * 1e3
|
|
8640
8764
|
});
|
|
8641
|
-
return r ? /* @__PURE__ */ j(
|
|
8765
|
+
return r ? /* @__PURE__ */ j(xl, {}) : i || !n ? /* @__PURE__ */ j(A, { children: e([]) }) : /* @__PURE__ */ j(A, { children: e(n) });
|
|
8642
8766
|
}
|
|
8643
|
-
function
|
|
8767
|
+
function xl() {
|
|
8644
8768
|
return /* @__PURE__ */ M("div", {
|
|
8645
8769
|
className: "flex items-center gap-2 p-4",
|
|
8646
8770
|
children: [
|
|
@@ -8650,23 +8774,23 @@ function ol() {
|
|
|
8650
8774
|
]
|
|
8651
8775
|
});
|
|
8652
8776
|
}
|
|
8653
|
-
function
|
|
8654
|
-
let n = l(), r = D(() =>
|
|
8777
|
+
function Sl({ templates: e, contextFilters: t }) {
|
|
8778
|
+
let n = l(), r = D(() => Cs(e, n), [e, n]);
|
|
8655
8779
|
return r.length === 1 && r[0] ? /* @__PURE__ */ j(it, {
|
|
8656
8780
|
to: `./${r[0].id}`,
|
|
8657
8781
|
replace: !0
|
|
8658
8782
|
}) : /* @__PURE__ */ j(jt, {
|
|
8659
8783
|
filters: t,
|
|
8660
|
-
children: /* @__PURE__ */ j(
|
|
8784
|
+
children: /* @__PURE__ */ j(_l, { templates: e })
|
|
8661
8785
|
});
|
|
8662
8786
|
}
|
|
8663
|
-
function
|
|
8664
|
-
let u = D(() => t ??
|
|
8787
|
+
function Cl({ baseUrl: e, dataSource: t, filterProviders: n, logsPage: r, logsDataSource: i, logsColumns: a, logsOnRowClick: o, logsGetRowId: s, config: l }) {
|
|
8788
|
+
let u = D(() => t ?? pl(e), [e, t]), f = D(() => gl(e), [e]), p = l.features.dashboards, m = l.features.logs, g = p?.contextFilters ?? yl, _ = m?.contextFilters ?? yl, v = (e) => /* @__PURE__ */ j(h, {
|
|
8665
8789
|
providers: e,
|
|
8666
8790
|
children: /* @__PURE__ */ M(ot, { children: [
|
|
8667
8791
|
p?.enabled && /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(at, {
|
|
8668
8792
|
path: "dashboards",
|
|
8669
|
-
element: /* @__PURE__ */ j(
|
|
8793
|
+
element: /* @__PURE__ */ j(Sl, {
|
|
8670
8794
|
templates: p.templates,
|
|
8671
8795
|
contextFilters: g
|
|
8672
8796
|
})
|
|
@@ -8674,7 +8798,7 @@ function cl({ baseUrl: e, dataSource: t, filterProviders: n, logsPage: r, logsDa
|
|
|
8674
8798
|
path: "dashboards/:dashboardId",
|
|
8675
8799
|
element: /* @__PURE__ */ j(jt, {
|
|
8676
8800
|
filters: g,
|
|
8677
|
-
children: /* @__PURE__ */ j(
|
|
8801
|
+
children: /* @__PURE__ */ j(vl, {
|
|
8678
8802
|
templates: p.templates,
|
|
8679
8803
|
scopeFilterField: p.scopeFilterField
|
|
8680
8804
|
})
|
|
@@ -8686,7 +8810,7 @@ function cl({ baseUrl: e, dataSource: t, filterProviders: n, logsPage: r, logsDa
|
|
|
8686
8810
|
filters: _,
|
|
8687
8811
|
children: r ?? (i && a ? /* @__PURE__ */ j(c, {
|
|
8688
8812
|
dataSource: i,
|
|
8689
|
-
children: /* @__PURE__ */ j(
|
|
8813
|
+
children: /* @__PURE__ */ j(ac, {
|
|
8690
8814
|
columns: a,
|
|
8691
8815
|
onRowClick: o,
|
|
8692
8816
|
getRowId: s,
|
|
@@ -8706,7 +8830,7 @@ function cl({ baseUrl: e, dataSource: t, filterProviders: n, logsPage: r, logsDa
|
|
|
8706
8830
|
filters: _,
|
|
8707
8831
|
children: /* @__PURE__ */ j(c, {
|
|
8708
8832
|
dataSource: i,
|
|
8709
|
-
children: /* @__PURE__ */ j(
|
|
8833
|
+
children: /* @__PURE__ */ j(cl, { config: m.logDetail })
|
|
8710
8834
|
})
|
|
8711
8835
|
})
|
|
8712
8836
|
}),
|
|
@@ -8729,13 +8853,13 @@ function cl({ baseUrl: e, dataSource: t, filterProviders: n, logsPage: r, logsDa
|
|
|
8729
8853
|
dataSource: u,
|
|
8730
8854
|
children: /* @__PURE__ */ j(St, {
|
|
8731
8855
|
source: f,
|
|
8732
|
-
children: n ? v(n) : /* @__PURE__ */ j(
|
|
8856
|
+
children: n ? v(n) : /* @__PURE__ */ j(bl, { children: (e) => v(e) })
|
|
8733
8857
|
})
|
|
8734
8858
|
});
|
|
8735
8859
|
}
|
|
8736
8860
|
//#endregion
|
|
8737
8861
|
//#region src/routing/define-observability-features.ts
|
|
8738
|
-
var
|
|
8862
|
+
var wl = {
|
|
8739
8863
|
dashboards: {
|
|
8740
8864
|
icon: On,
|
|
8741
8865
|
title: "Dashboards",
|
|
@@ -8747,10 +8871,10 @@ var ll = {
|
|
|
8747
8871
|
order: 1
|
|
8748
8872
|
}
|
|
8749
8873
|
};
|
|
8750
|
-
function
|
|
8751
|
-
let t = e.basePath ?? "observe", n =
|
|
8874
|
+
function Tl(e) {
|
|
8875
|
+
let t = e.basePath ?? "observe", n = El(e), r = Dl(e, n, t), i = n.map((e) => `${t}/${e}`), a = Ol(n, t);
|
|
8752
8876
|
function o(t) {
|
|
8753
|
-
return b(
|
|
8877
|
+
return b(Cl, {
|
|
8754
8878
|
...t,
|
|
8755
8879
|
config: e
|
|
8756
8880
|
});
|
|
@@ -8762,13 +8886,13 @@ function ul(e) {
|
|
|
8762
8886
|
Routes: o
|
|
8763
8887
|
};
|
|
8764
8888
|
}
|
|
8765
|
-
function
|
|
8889
|
+
function El(e) {
|
|
8766
8890
|
let t = [];
|
|
8767
|
-
return e.features.dashboards?.enabled && t.push("dashboards"), e.features.logs?.enabled && t.push("logs"), t.sort((e, t) =>
|
|
8891
|
+
return e.features.dashboards?.enabled && t.push("dashboards"), e.features.logs?.enabled && t.push("logs"), t.sort((e, t) => wl[e].order - wl[t].order);
|
|
8768
8892
|
}
|
|
8769
|
-
function
|
|
8893
|
+
function Dl(e, t, n) {
|
|
8770
8894
|
let r = t.map((t) => {
|
|
8771
|
-
let r =
|
|
8895
|
+
let r = wl[t], i = e.nav.overrides?.[t];
|
|
8772
8896
|
return {
|
|
8773
8897
|
key: `${n}/${t}`,
|
|
8774
8898
|
title: i?.title ?? r.title,
|
|
@@ -8780,10 +8904,10 @@ function fl(e, t, n) {
|
|
|
8780
8904
|
items: r
|
|
8781
8905
|
};
|
|
8782
8906
|
}
|
|
8783
|
-
function
|
|
8907
|
+
function Ol(e, t) {
|
|
8784
8908
|
let n = {};
|
|
8785
8909
|
for (let r of e) {
|
|
8786
|
-
let e =
|
|
8910
|
+
let e = wl[r], i = `${t}/${r}`;
|
|
8787
8911
|
n[i] = {
|
|
8788
8912
|
path: `${t}/${r}`,
|
|
8789
8913
|
label: e.title
|
|
@@ -8792,4 +8916,4 @@ function pl(e, t) {
|
|
|
8792
8916
|
return n;
|
|
8793
8917
|
}
|
|
8794
8918
|
//#endregion
|
|
8795
|
-
export { Jt as CODEC_VERSION, f as CapabilityProvider, jt as ContextFiltersProvider, a as DEFAULT_CAPABILITIES, Vt as DEFAULT_PERIOD, gt as DEFAULT_REFRESH_INTERVAL_MS, wt as DEFAULT_STALE_TIME, Yt as DEFAULT_TIME_RANGE, r as DashboardPersistenceProvider,
|
|
8919
|
+
export { ko as BarPresentation, Jt as CODEC_VERSION, f as CapabilityProvider, zo as CartesianPresentation, jt as ContextFiltersProvider, a as DEFAULT_CAPABILITIES, Vt as DEFAULT_PERIOD, gt as DEFAULT_REFRESH_INTERVAL_MS, wt as DEFAULT_STALE_TIME, Yt as DEFAULT_TIME_RANGE, r as DashboardPersistenceProvider, Ts as DashboardTemplatesProvider, _s as DashboardView, Wo as DoughnutPresentation, e as FILTER_OPERATORS, oi as FilterBar, Zr as FilterChip, Ur as FilterPopoverForm, h as FilterProvidersProvider, ks as LiveIndicator, vt as LiveRefreshProvider, $ as LogDetailCodeBlock, Uc as LogDetailContextChart, ol as LogDetailDrawer, Jc as LogDetailDrawerShell, fc as LogDetailEmptyField, Qc as LogDetailHeader, pc as LogDetailHeadersTable, mc as LogDetailJsonTree, _c as LogDetailKeyValueGrid, $c as LogDetailMetrics, cl as LogDetailPage, nl as LogDetailSection, tl as LogDetailSections, Ns as LogSeverityBadge, Us as LogTable, c as LogsDataSourceProvider, ac as LogsExplorerPage, ts as MetricGroupPresentation, is as MetricPresentation, d as MetricsDataSourceProvider, Gt as PERIOD_DISPLAY_LABELS, Wt as PERIOD_LABELS, Ht as PRESET_CATEGORIES, Ut as RELATIVE_PERIODS, tr as TimeRangePicker, s as TracesDataSourceProvider, bs as WidgetGroup, ps as WidgetItem, qr as buildChipLabel, Jr as buildChipLabelParts, Yr as buildChipTooltip, lc as buildDefaultConnectionLogColumns, Bc as buildDefaultLogDetailConfig, oc as buildLogsDeepLink, ls as clearWidgetRenderers, Ro as computeBucketInterval, es as computePreviousTimeRange, Jo as computeTrend, yc as connectionLogPreset, pl as createHttpDataSource, gl as createHttpFilterSource, en as decodeObservabilityState, xs as defineDashboardTemplate, ur as defineFilterProvider, Lc as defineLogDetail, Tl as defineObservabilityFeatures, $t as encodeObservabilityState, Ko as extractMeasureValue, Yo as extractSparklineData, wo as facetsToBar, Co as facetsToDoughnut, nr as getLocaleWeekStart, cs as getWidgetRenderer, pt as isBarWidget, dt as isCartesianWidget, ft as isDoughnutWidget, ht as isMetricGroupWidget, mt as isMetricWidget, Fr as isMultiSelectForFilter, qo as measureResultToMetric, kt as mergeFilters, Mo as mergeTimeSeriesToCartesian, Tc as messageLogPreset, Ir as normalizeMembershipOperatorForValues, Ot as observabilityQueryKeys, Mr as operatorLabel, Nr as operatorNeedsValue, ds as registerDefaultRenderers, ss as registerWidgetRenderer, Ss as resolveDashboardFromTemplate, Rc as resolveLogDetailVariant, zc as resolvePreset, lr as resolveRelativePeriod, vo as resolveStableTimeRange, l as useCapabilities, o as useCapability, Mt as useContextFilters, i as useDashboardPersistence, Ds as useDashboardTemplate, Es as useDashboardTemplates, Nt as useFacetsQuery, u as useFilterProvider, p as useFilterProviders, yt as useLiveRefresh, Gc as useLogDetailDrawerExpand, Pt as useLogDetailQuery, g as useLogsDataSource, Lt as useLogsPagedQuery, Ft as useLogsQuery, Rt as useMeasuresQuery, m as useMetricsDataSource, bt as useOptionalLiveRefresh, bo as useStableTimeRange, Bt as useTimeSeriesQuery, t as useTracesDataSource, go as useWidgetGroupContext, Ac as webhookLogPreset };
|