@gravitee/gamma-lib-observability 2.2.2-fix-obs-61-stop-false-editor-conflicts.0deb9bf → 2.2.2
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 +2 -7
- package/dist/dashboards/editor/DashboardEditorPage.d.ts.map +1 -1
- package/dist/data-sources/dashboard-persistence.d.ts +0 -20
- package/dist/data-sources/dashboard-persistence.d.ts.map +1 -1
- package/dist/data-sources/dashboard-revision-store.d.ts +2 -42
- package/dist/data-sources/dashboard-revision-store.d.ts.map +1 -1
- package/dist/data-sources/http-dashboard-persistence.d.ts +3 -10
- package/dist/data-sources/http-dashboard-persistence.d.ts.map +1 -1
- package/dist/hooks/use-custom-dashboards.d.ts +0 -15
- package/dist/hooks/use-custom-dashboards.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +558 -588
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as e, a as t, b as n, c as r, d as i, f as a, g as o, h as s, i as c, l, m as u, n as d, o as f, p, r as m, s as h, t as g, u as _, v, y } from "./filter-providers-context.js";
|
|
2
|
-
import { AlertCircleIcon as b, AlignRightIcon as x, ArrowLeftIcon as S, ArrowRightIcon as C, BarChart3Icon as w, BoxesIcon as ee, BrainCircuitIcon as te, CableIcon as
|
|
2
|
+
import { AlertCircleIcon as b, AlignRightIcon as x, ArrowLeftIcon as S, ArrowRightIcon as C, BarChart3Icon as w, BoxesIcon as ee, BrainCircuitIcon as te, CableIcon as T, CalendarIcon as ne, ChartLineIcon as re, CheckIcon as ie, ChevronDownIcon as ae, ChevronRightIcon as oe, CircleDotIcon as se, CircleHelpIcon as ce, ClockIcon as le, CopyIcon as E, ExpandIcon as ue, FileTextIcon as de, FilterIcon as fe, FunnelXIcon as pe, GlobeIcon as me, InfoIcon as he, LayoutDashboardIcon as ge, LayoutGridIcon as _e, ListIcon as ve, LockIcon as ye, MessageSquareIcon as be, MoreVerticalIcon as xe, NetworkIcon as Se, PanelLeftIcon as Ce, PencilIcon as we, PlusIcon as Te, RefreshCwIcon as Ee, Trash2Icon as De, TrendingUpIcon as Oe, WebhookIcon as ke, XIcon as Ae } from "@gravitee/graphene-core/icons";
|
|
3
3
|
import { Component as je, Fragment as Me, Suspense as Ne, createContext as Pe, createElement as Fe, forwardRef as Ie, lazy as Le, memo as Re, useCallback as D, useContext as ze, useEffect as O, useId as Be, useLayoutEffect as Ve, useMemo as k, useReducer as He, useRef as A, useState as j } from "react";
|
|
4
4
|
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
5
5
|
import { keepPreviousData as Ue, useInfiniteQuery as We, useMutation as Ge, useQueries as Ke, useQuery as F, useQueryClient as qe } from "@tanstack/react-query";
|
|
@@ -26,7 +26,7 @@ var Hn = [
|
|
|
26
26
|
{
|
|
27
27
|
id: "MCP",
|
|
28
28
|
label: "MCP",
|
|
29
|
-
icon:
|
|
29
|
+
icon: T,
|
|
30
30
|
colorClass: "text-chart-5",
|
|
31
31
|
bgClass: "bg-chart-5/10"
|
|
32
32
|
},
|
|
@@ -79,7 +79,7 @@ var qn = [
|
|
|
79
79
|
{
|
|
80
80
|
id: "ANALYTICS",
|
|
81
81
|
label: "Analytics",
|
|
82
|
-
icon:
|
|
82
|
+
icon: re,
|
|
83
83
|
colorClass: "text-chart-2"
|
|
84
84
|
},
|
|
85
85
|
{
|
|
@@ -1047,7 +1047,7 @@ function ki({ value: e, onChange: t, disabled: n = !1, showTimezone: r = !1, cla
|
|
|
1047
1047
|
"aria-haspopup": "dialog",
|
|
1048
1048
|
"aria-expanded": c,
|
|
1049
1049
|
className: Y("justify-between gap-2 font-normal", i),
|
|
1050
|
-
children: [Ei(e, r), /* @__PURE__ */ N(
|
|
1050
|
+
children: [Ei(e, r), /* @__PURE__ */ N(ne, {
|
|
1051
1051
|
"aria-hidden": "true",
|
|
1052
1052
|
className: "size-4 shrink-0"
|
|
1053
1053
|
})]
|
|
@@ -1691,19 +1691,19 @@ function ya({ existingCondition: e, onApply: t, onCancel: n, providers: r, activ
|
|
|
1691
1691
|
selectedOptions: h,
|
|
1692
1692
|
freeText: _
|
|
1693
1693
|
}), ee = S === "enum" && b?.options || b?.valueLoader ? h.length === 0 : _.trim() === "", te = w || a && !!b && !!f && ee;
|
|
1694
|
-
function
|
|
1694
|
+
function T(e) {
|
|
1695
1695
|
if (!e) {
|
|
1696
1696
|
u && (y.current = u), d(null);
|
|
1697
1697
|
return;
|
|
1698
1698
|
}
|
|
1699
1699
|
e.field !== u && (d(e.field), e.field !== y.current && (y.current = null, p(f && e.operators.includes(f) ? f : e.operators[0] ?? null), g([]), v("")));
|
|
1700
1700
|
}
|
|
1701
|
-
function
|
|
1701
|
+
function ne(e) {
|
|
1702
1702
|
if (!b?.operators.includes(e)) return;
|
|
1703
1703
|
let t = e;
|
|
1704
1704
|
p(t), aa(t) ? !la(b, t) && h.length > 1 && g(h.slice(0, 1)) : (g([]), v(""));
|
|
1705
1705
|
}
|
|
1706
|
-
function
|
|
1706
|
+
function re(e) {
|
|
1707
1707
|
let t = x ? e : e.slice(0, 1);
|
|
1708
1708
|
if (g(t), b && f) {
|
|
1709
1709
|
let e = ua(b, f, t.length);
|
|
@@ -1734,12 +1734,12 @@ function ya({ existingCondition: e, onApply: t, onCancel: n, providers: r, activ
|
|
|
1734
1734
|
/* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Filter by" }), /* @__PURE__ */ N(Ki, {
|
|
1735
1735
|
providers: l,
|
|
1736
1736
|
selectedField: u,
|
|
1737
|
-
onFieldChange:
|
|
1737
|
+
onFieldChange: T,
|
|
1738
1738
|
activeScopes: i
|
|
1739
1739
|
})] }),
|
|
1740
1740
|
/* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Choose operator" }), /* @__PURE__ */ P(B, {
|
|
1741
1741
|
value: f ?? void 0,
|
|
1742
|
-
onValueChange:
|
|
1742
|
+
onValueChange: ne,
|
|
1743
1743
|
disabled: !b,
|
|
1744
1744
|
children: [/* @__PURE__ */ N(U, {
|
|
1745
1745
|
className: "w-full",
|
|
@@ -1756,7 +1756,7 @@ function ya({ existingCondition: e, onApply: t, onCancel: n, providers: r, activ
|
|
|
1756
1756
|
provider: b,
|
|
1757
1757
|
operator: f,
|
|
1758
1758
|
selected: h,
|
|
1759
|
-
onSelectedChange:
|
|
1759
|
+
onSelectedChange: re,
|
|
1760
1760
|
multiple: x,
|
|
1761
1761
|
freeText: _,
|
|
1762
1762
|
onFreeTextChange: v,
|
|
@@ -2079,13 +2079,13 @@ function Ha({ filters: e, onFiltersChange: t, editable: n = !0, scopeFilterField
|
|
|
2079
2079
|
}
|
|
2080
2080
|
t(Ba(e, n, c.find((e) => e.field === n.field))), w();
|
|
2081
2081
|
}
|
|
2082
|
-
function
|
|
2082
|
+
function T(n) {
|
|
2083
2083
|
t(e.filter((e, t) => t !== n));
|
|
2084
2084
|
}
|
|
2085
|
-
function
|
|
2085
|
+
function ne() {
|
|
2086
2086
|
w(), t([]);
|
|
2087
2087
|
}
|
|
2088
|
-
function
|
|
2088
|
+
function re(e) {
|
|
2089
2089
|
e.preventDefault(), requestAnimationFrame(() => {
|
|
2090
2090
|
let e = h.current;
|
|
2091
2091
|
e && (e.querySelector("[data-autofocus]") ?? e.querySelector("input:not([disabled])"))?.focus();
|
|
@@ -2114,7 +2114,7 @@ function Ha({ filters: e, onFiltersChange: t, editable: n = !0, scopeFilterField
|
|
|
2114
2114
|
active: r,
|
|
2115
2115
|
signals: i?.signals,
|
|
2116
2116
|
onEdit: () => S(t),
|
|
2117
|
-
onRemove: () =>
|
|
2117
|
+
onRemove: () => T(t)
|
|
2118
2118
|
}, Na(e));
|
|
2119
2119
|
}),
|
|
2120
2120
|
n ? /* @__PURE__ */ P(L, {
|
|
@@ -2132,7 +2132,7 @@ function Ha({ filters: e, onFiltersChange: t, editable: n = !0, scopeFilterField
|
|
|
2132
2132
|
}) : null,
|
|
2133
2133
|
n && e.length > 0 ? /* @__PURE__ */ N("button", {
|
|
2134
2134
|
type: "button",
|
|
2135
|
-
onClick:
|
|
2135
|
+
onClick: ne,
|
|
2136
2136
|
className: "ml-1 shrink-0 rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground",
|
|
2137
2137
|
"aria-label": "Clear all filters",
|
|
2138
2138
|
children: /* @__PURE__ */ N(pe, { className: "size-3.5" })
|
|
@@ -2146,7 +2146,7 @@ function Ha({ filters: e, onFiltersChange: t, editable: n = !0, scopeFilterField
|
|
|
2146
2146
|
align: "start",
|
|
2147
2147
|
sideOffset: 8,
|
|
2148
2148
|
className: "w-auto p-0",
|
|
2149
|
-
onOpenAutoFocus:
|
|
2149
|
+
onOpenAutoFocus: re,
|
|
2150
2150
|
children: v ? /* @__PURE__ */ N(ya, {
|
|
2151
2151
|
providers: c,
|
|
2152
2152
|
existingCondition: y,
|
|
@@ -7107,13 +7107,13 @@ function rd(e) {
|
|
|
7107
7107
|
});
|
|
7108
7108
|
}
|
|
7109
7109
|
function id() {
|
|
7110
|
-
return
|
|
7110
|
+
return cd((e, t) => e.createDashboard(t));
|
|
7111
7111
|
}
|
|
7112
7112
|
function ad() {
|
|
7113
|
-
return
|
|
7113
|
+
return cd((e, t) => e.updateDashboard(t));
|
|
7114
7114
|
}
|
|
7115
7115
|
function od() {
|
|
7116
|
-
return
|
|
7116
|
+
return cd((e, t) => e.updateDashboard(t, void 0, { force: !0 }));
|
|
7117
7117
|
}
|
|
7118
7118
|
function sd() {
|
|
7119
7119
|
let e = s(), t = qe();
|
|
@@ -7121,13 +7121,7 @@ function sd() {
|
|
|
7121
7121
|
e?.adoptCurrentRevision?.(n.id), t.setQueryData(Z.customDashboard(n.id), n), t.invalidateQueries({ queryKey: Z.customDashboards() });
|
|
7122
7122
|
}, [e, t]);
|
|
7123
7123
|
}
|
|
7124
|
-
function cd() {
|
|
7125
|
-
let e = s();
|
|
7126
|
-
return D((t) => {
|
|
7127
|
-
e?.takeReadRevision?.(t);
|
|
7128
|
-
}, [e]);
|
|
7129
|
-
}
|
|
7130
|
-
function ld(e) {
|
|
7124
|
+
function cd(e) {
|
|
7131
7125
|
let t = s(), n = qe();
|
|
7132
7126
|
return Ge({
|
|
7133
7127
|
mutationFn: (n) => t ? e(t, n) : Promise.reject(/* @__PURE__ */ Error("No dashboard persistence configured.")),
|
|
@@ -7136,7 +7130,7 @@ function ld(e) {
|
|
|
7136
7130
|
}
|
|
7137
7131
|
});
|
|
7138
7132
|
}
|
|
7139
|
-
function
|
|
7133
|
+
function ld() {
|
|
7140
7134
|
let e = s(), t = qe();
|
|
7141
7135
|
return Ge({
|
|
7142
7136
|
mutationFn: (t) => e ? e.deleteDashboard(t) : Promise.reject(/* @__PURE__ */ Error("No dashboard persistence configured.")),
|
|
@@ -7147,23 +7141,23 @@ function ud() {
|
|
|
7147
7141
|
}
|
|
7148
7142
|
//#endregion
|
|
7149
7143
|
//#region src/dashboards/editor/DashboardConflictDialog.tsx
|
|
7150
|
-
function
|
|
7144
|
+
function ud({ open: e, theirDashboard: t, deleted: n = !1, pending: r = null, onResolve: i, onCancel: a }) {
|
|
7151
7145
|
let [o, s] = j(!1), [c, l] = j(e), u = r !== null;
|
|
7152
7146
|
return e !== c && (l(e), e && s(!1)), /* @__PURE__ */ N(ht, {
|
|
7153
7147
|
open: e,
|
|
7154
7148
|
onOpenChange: (e) => {
|
|
7155
7149
|
!e && !u && a();
|
|
7156
7150
|
},
|
|
7157
|
-
children: /* @__PURE__ */ N(_t, { children: n ? /* @__PURE__ */ N(
|
|
7151
|
+
children: /* @__PURE__ */ N(_t, { children: n ? /* @__PURE__ */ N(pd, {
|
|
7158
7152
|
busy: u,
|
|
7159
7153
|
pending: r,
|
|
7160
7154
|
onResolve: i,
|
|
7161
7155
|
onCancel: a
|
|
7162
|
-
}) : o ? /* @__PURE__ */ N(
|
|
7156
|
+
}) : o ? /* @__PURE__ */ N(fd, {
|
|
7163
7157
|
busy: u,
|
|
7164
7158
|
onResolve: i,
|
|
7165
7159
|
onBack: () => s(!1)
|
|
7166
|
-
}) : /* @__PURE__ */ N(
|
|
7160
|
+
}) : /* @__PURE__ */ N(dd, {
|
|
7167
7161
|
theirDashboard: t,
|
|
7168
7162
|
busy: u,
|
|
7169
7163
|
pending: r,
|
|
@@ -7173,27 +7167,27 @@ function dd({ open: e, theirDashboard: t, deleted: n = !1, pending: r = null, on
|
|
|
7173
7167
|
}) })
|
|
7174
7168
|
});
|
|
7175
7169
|
}
|
|
7176
|
-
function
|
|
7170
|
+
function dd({ theirDashboard: e, busy: t, pending: n, onResolve: r, onTakeTheirs: i, onCancel: a }) {
|
|
7177
7171
|
return /* @__PURE__ */ P(M, { children: [
|
|
7178
7172
|
/* @__PURE__ */ P(bt, { children: [/* @__PURE__ */ N(xt, { children: "Someone else updated this dashboard while you were editing" }), /* @__PURE__ */ N(vt, { children: "Nothing was saved and nothing was lost: your changes are still in the editor behind this dialog, and their version is still on the server. Pick what should happen to each." })] }),
|
|
7179
|
-
e && /* @__PURE__ */ N(
|
|
7173
|
+
e && /* @__PURE__ */ N(md, { dashboard: e }),
|
|
7180
7174
|
/* @__PURE__ */ P("div", {
|
|
7181
7175
|
className: "flex flex-col gap-2",
|
|
7182
7176
|
children: [
|
|
7183
|
-
/* @__PURE__ */ N(
|
|
7177
|
+
/* @__PURE__ */ N(hd, {
|
|
7184
7178
|
label: "Overwrite their version",
|
|
7185
7179
|
description: "Saves your changes over theirs. What they saved is lost.",
|
|
7186
7180
|
loading: n === "overwrite",
|
|
7187
7181
|
disabled: t,
|
|
7188
7182
|
onClick: () => r("overwrite")
|
|
7189
7183
|
}),
|
|
7190
|
-
/* @__PURE__ */ N(
|
|
7184
|
+
/* @__PURE__ */ N(hd, {
|
|
7191
7185
|
label: "Take their version",
|
|
7192
7186
|
description: "Replaces what is on your screen with theirs. Your changes are lost.",
|
|
7193
7187
|
disabled: t,
|
|
7194
7188
|
onClick: i
|
|
7195
7189
|
}),
|
|
7196
|
-
/* @__PURE__ */ N(
|
|
7190
|
+
/* @__PURE__ */ N(hd, {
|
|
7197
7191
|
label: "Save as a copy",
|
|
7198
7192
|
description: "Keeps both: your changes go to a new dashboard, theirs stays untouched.",
|
|
7199
7193
|
loading: n === "save-as-copy",
|
|
@@ -7210,7 +7204,7 @@ function fd({ theirDashboard: e, busy: t, pending: n, onResolve: r, onTakeTheirs
|
|
|
7210
7204
|
}) })
|
|
7211
7205
|
] });
|
|
7212
7206
|
}
|
|
7213
|
-
function
|
|
7207
|
+
function fd({ busy: e, onResolve: t, onBack: n }) {
|
|
7214
7208
|
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P(bt, { children: [/* @__PURE__ */ N(xt, { children: "Discard your changes?" }), /* @__PURE__ */ N(vt, { children: "Everything you edited since you opened this dashboard is replaced by the version the other author saved. It was never sent to the server, so this cannot be undone." })] }), /* @__PURE__ */ P(yt, { children: [/* @__PURE__ */ N(L, {
|
|
7215
7209
|
variant: "outline",
|
|
7216
7210
|
disabled: e,
|
|
@@ -7223,7 +7217,7 @@ function pd({ busy: e, onResolve: t, onBack: n }) {
|
|
|
7223
7217
|
children: "Discard and take their version"
|
|
7224
7218
|
})] })] });
|
|
7225
7219
|
}
|
|
7226
|
-
function
|
|
7220
|
+
function pd({ busy: e, pending: t, onResolve: n, onCancel: r }) {
|
|
7227
7221
|
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P(bt, { children: [/* @__PURE__ */ N(xt, { children: "This dashboard no longer exists" }), /* @__PURE__ */ N(vt, { children: "It was deleted while you were editing, so there is nothing left to save it to. Your changes are still here and can be kept as a new dashboard." })] }), /* @__PURE__ */ P(yt, { children: [/* @__PURE__ */ N(L, {
|
|
7228
7222
|
variant: "ghost",
|
|
7229
7223
|
disabled: e,
|
|
@@ -7235,7 +7229,7 @@ function md({ busy: e, pending: t, onResolve: n, onCancel: r }) {
|
|
|
7235
7229
|
children: t === "save-as-copy" ? "Saving…" : "Save as a copy"
|
|
7236
7230
|
})] })] });
|
|
7237
7231
|
}
|
|
7238
|
-
function
|
|
7232
|
+
function md({ dashboard: e }) {
|
|
7239
7233
|
return /* @__PURE__ */ P("div", {
|
|
7240
7234
|
className: "flex flex-col gap-0.5 rounded-lg border border-border bg-muted/50 p-3",
|
|
7241
7235
|
children: [
|
|
@@ -7254,7 +7248,7 @@ function hd({ dashboard: e }) {
|
|
|
7254
7248
|
]
|
|
7255
7249
|
});
|
|
7256
7250
|
}
|
|
7257
|
-
function
|
|
7251
|
+
function hd({ label: e, description: t, loading: n = !1, disabled: r, onClick: i }) {
|
|
7258
7252
|
return /* @__PURE__ */ P(L, {
|
|
7259
7253
|
variant: "outline",
|
|
7260
7254
|
className: "h-auto w-full flex-col items-start gap-0.5 py-3 text-left whitespace-normal",
|
|
@@ -7271,26 +7265,26 @@ function gd({ label: e, description: t, loading: n = !1, disabled: r, onClick: i
|
|
|
7271
7265
|
}
|
|
7272
7266
|
//#endregion
|
|
7273
7267
|
//#region src/dashboards/dashboard-filters.ts
|
|
7274
|
-
function
|
|
7268
|
+
function gd(e) {
|
|
7275
7269
|
return e.editable !== !0 && e.value.length > 0;
|
|
7276
7270
|
}
|
|
7277
|
-
function
|
|
7278
|
-
return !
|
|
7271
|
+
function _d(e) {
|
|
7272
|
+
return !gd(e);
|
|
7279
7273
|
}
|
|
7280
|
-
function
|
|
7274
|
+
function vd(e, t) {
|
|
7281
7275
|
return e || !t;
|
|
7282
7276
|
}
|
|
7283
|
-
function
|
|
7277
|
+
function yd(e, t) {
|
|
7284
7278
|
return t < 2 ? e : e === "eq" ? "in" : e === "neq" ? "not_in" : e;
|
|
7285
7279
|
}
|
|
7286
|
-
function
|
|
7287
|
-
let n = e.filter(
|
|
7280
|
+
function bd(e, t) {
|
|
7281
|
+
let n = e.filter(gd), r = e.filter(_d), i = new Set(e.map((e) => e.field)), a = new Map(r.map((e) => [e.field, e])), o = t.flatMap((e) => {
|
|
7288
7282
|
let t = a.get(e.field);
|
|
7289
7283
|
if (!t) return [];
|
|
7290
7284
|
let { valueLabels: n, ...r } = t;
|
|
7291
7285
|
return [{
|
|
7292
7286
|
...r,
|
|
7293
|
-
operator:
|
|
7287
|
+
operator: yd(t.operator, e.value.length),
|
|
7294
7288
|
value: e.value,
|
|
7295
7289
|
...e.valueLabels ? { valueLabels: e.valueLabels } : {}
|
|
7296
7290
|
}];
|
|
@@ -7307,7 +7301,7 @@ function xd(e, t) {
|
|
|
7307
7301
|
}
|
|
7308
7302
|
//#endregion
|
|
7309
7303
|
//#region src/dashboards/DashboardFilterChip.tsx
|
|
7310
|
-
var
|
|
7304
|
+
var xd = Ie(function({ condition: e, revaluable: t, changedByReader: n, editable: r, active: i, onEdit: a, onRemove: o }, s) {
|
|
7311
7305
|
return /* @__PURE__ */ N(ka, {
|
|
7312
7306
|
ref: s,
|
|
7313
7307
|
condition: e,
|
|
@@ -7332,13 +7326,13 @@ var Sd = Ie(function({ condition: e, revaluable: t, changedByReader: n, editable
|
|
|
7332
7326
|
});
|
|
7333
7327
|
//#endregion
|
|
7334
7328
|
//#region src/dashboards/DashboardFilterChipPopover.tsx
|
|
7335
|
-
function
|
|
7329
|
+
function Sd({ condition: e, revaluable: t, changedByReader: n, onRemove: r, renderForm: i }) {
|
|
7336
7330
|
let [a, o] = j(!1), s = A(null), c = A({ getBoundingClientRect: () => s.current?.getBoundingClientRect() ?? new DOMRect() });
|
|
7337
7331
|
return /* @__PURE__ */ P(Lt, {
|
|
7338
7332
|
open: a,
|
|
7339
7333
|
onOpenChange: o,
|
|
7340
7334
|
children: [
|
|
7341
|
-
/* @__PURE__ */ N(
|
|
7335
|
+
/* @__PURE__ */ N(xd, {
|
|
7342
7336
|
ref: s,
|
|
7343
7337
|
condition: e,
|
|
7344
7338
|
revaluable: t,
|
|
@@ -7358,9 +7352,9 @@ function Cd({ condition: e, revaluable: t, changedByReader: n, onRemove: r, rend
|
|
|
7358
7352
|
}
|
|
7359
7353
|
//#endregion
|
|
7360
7354
|
//#region src/dashboards/editor/DashboardFiltersEditor.tsx
|
|
7361
|
-
var
|
|
7362
|
-
function
|
|
7363
|
-
let r = ji(void 0,
|
|
7355
|
+
var Cd = ["ANALYTICS"];
|
|
7356
|
+
function wd({ filters: e, scopeFilterField: t, onChange: n }) {
|
|
7357
|
+
let r = ji(void 0, Cd), i = ji(t, Cd), a = Ma(t), o = new Set(e.map((e) => e.field)), s = i.filter((e) => !o.has(e.field));
|
|
7364
7358
|
return /* @__PURE__ */ N(J, { children: /* @__PURE__ */ P("div", {
|
|
7365
7359
|
className: "flex flex-wrap items-center gap-1.5",
|
|
7366
7360
|
children: [
|
|
@@ -7368,7 +7362,7 @@ function Td({ filters: e, scopeFilterField: t, onChange: n }) {
|
|
|
7368
7362
|
className: "text-xs font-medium text-muted-foreground",
|
|
7369
7363
|
children: "Dashboard filters"
|
|
7370
7364
|
}),
|
|
7371
|
-
e.map((t, i) => /* @__PURE__ */ N(
|
|
7365
|
+
e.map((t, i) => /* @__PURE__ */ N(Td, {
|
|
7372
7366
|
condition: {
|
|
7373
7367
|
...t,
|
|
7374
7368
|
label: Aa(t, r)
|
|
@@ -7379,7 +7373,7 @@ function Td({ filters: e, scopeFilterField: t, onChange: n }) {
|
|
|
7379
7373
|
onChange: (t) => n(e.map((e, n) => n === i ? t : e)),
|
|
7380
7374
|
onRemove: () => n(e.filter((e, t) => t !== i))
|
|
7381
7375
|
}, i)),
|
|
7382
|
-
/* @__PURE__ */ N(
|
|
7376
|
+
/* @__PURE__ */ N(Ed, {
|
|
7383
7377
|
addableProviders: s,
|
|
7384
7378
|
activeApiTypes: a,
|
|
7385
7379
|
onAdd: (t) => n([...e, t])
|
|
@@ -7387,13 +7381,13 @@ function Td({ filters: e, scopeFilterField: t, onChange: n }) {
|
|
|
7387
7381
|
]
|
|
7388
7382
|
}) });
|
|
7389
7383
|
}
|
|
7390
|
-
function
|
|
7384
|
+
function Td({ condition: e, own: t, addableProviders: n, activeApiTypes: r, onChange: i, onRemove: a }) {
|
|
7391
7385
|
let o = k(() => t ? [t, ...n.filter((e) => e.field !== t.field)] : n, [t, n]);
|
|
7392
|
-
return /* @__PURE__ */ N(
|
|
7386
|
+
return /* @__PURE__ */ N(Sd, {
|
|
7393
7387
|
condition: e,
|
|
7394
|
-
revaluable:
|
|
7388
|
+
revaluable: _d(e),
|
|
7395
7389
|
onRemove: a,
|
|
7396
|
-
renderForm: (t) => /* @__PURE__ */ N(
|
|
7390
|
+
renderForm: (t) => /* @__PURE__ */ N(Dd, {
|
|
7397
7391
|
existingCondition: e,
|
|
7398
7392
|
providers: o,
|
|
7399
7393
|
activeApiTypes: r,
|
|
@@ -7407,7 +7401,7 @@ function Ed({ condition: e, own: t, addableProviders: n, activeApiTypes: r, onCh
|
|
|
7407
7401
|
})
|
|
7408
7402
|
});
|
|
7409
7403
|
}
|
|
7410
|
-
function
|
|
7404
|
+
function Ed({ addableProviders: e, activeApiTypes: t, onAdd: n }) {
|
|
7411
7405
|
let [r, i] = j(!1);
|
|
7412
7406
|
return /* @__PURE__ */ P(Lt, {
|
|
7413
7407
|
open: r,
|
|
@@ -7424,7 +7418,7 @@ function Dd({ addableProviders: e, activeApiTypes: t, onAdd: n }) {
|
|
|
7424
7418
|
}), /* @__PURE__ */ N(zt, {
|
|
7425
7419
|
align: "start",
|
|
7426
7420
|
className: "w-auto p-0",
|
|
7427
|
-
children: /* @__PURE__ */ N(
|
|
7421
|
+
children: /* @__PURE__ */ N(Dd, {
|
|
7428
7422
|
providers: e,
|
|
7429
7423
|
activeApiTypes: t,
|
|
7430
7424
|
onApply: (e) => {
|
|
@@ -7435,8 +7429,8 @@ function Dd({ addableProviders: e, activeApiTypes: t, onAdd: n }) {
|
|
|
7435
7429
|
})]
|
|
7436
7430
|
});
|
|
7437
7431
|
}
|
|
7438
|
-
function
|
|
7439
|
-
let o = Be(), [s, c] = j(e ?
|
|
7432
|
+
function Dd({ existingCondition: e, providers: t, activeApiTypes: n, onApply: r, onCancel: i, onRemove: a }) {
|
|
7433
|
+
let o = Be(), [s, c] = j(e ? _d(e) : !0);
|
|
7440
7434
|
return /* @__PURE__ */ N(ya, {
|
|
7441
7435
|
existingCondition: e,
|
|
7442
7436
|
providers: t,
|
|
@@ -7464,33 +7458,33 @@ function Od({ existingCondition: e, providers: t, activeApiTypes: n, onApply: r,
|
|
|
7464
7458
|
onRemove: a,
|
|
7465
7459
|
onApply: (e) => r({
|
|
7466
7460
|
...e,
|
|
7467
|
-
editable:
|
|
7461
|
+
editable: vd(s, e.value.length > 0)
|
|
7468
7462
|
}),
|
|
7469
7463
|
onCancel: i
|
|
7470
7464
|
});
|
|
7471
7465
|
}
|
|
7472
7466
|
//#endregion
|
|
7473
7467
|
//#region src/dashboards/editor/is-json-equal.ts
|
|
7474
|
-
function
|
|
7468
|
+
function Od(e, t) {
|
|
7475
7469
|
if (e === t) return !0;
|
|
7476
7470
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
7477
|
-
if (Array.isArray(e) || Array.isArray(t)) return !Array.isArray(e) || !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) =>
|
|
7471
|
+
if (Array.isArray(e) || Array.isArray(t)) return !Array.isArray(e) || !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => Od(e, t[n]));
|
|
7478
7472
|
let n = e, r = t;
|
|
7479
|
-
for (let e of new Set([...Object.keys(n), ...Object.keys(r)])) if (!
|
|
7473
|
+
for (let e of new Set([...Object.keys(n), ...Object.keys(r)])) if (!Od(n[e], r[e])) return !1;
|
|
7480
7474
|
return !0;
|
|
7481
7475
|
}
|
|
7482
7476
|
//#endregion
|
|
7483
7477
|
//#region src/dashboards/editor/dashboard-editor-state.ts
|
|
7484
|
-
function
|
|
7478
|
+
function kd(e) {
|
|
7485
7479
|
return {
|
|
7486
7480
|
draft: e,
|
|
7487
7481
|
baseline: e
|
|
7488
7482
|
};
|
|
7489
7483
|
}
|
|
7490
|
-
function
|
|
7491
|
-
return !
|
|
7484
|
+
function Ad(e) {
|
|
7485
|
+
return !Od(e.draft, e.baseline);
|
|
7492
7486
|
}
|
|
7493
|
-
function
|
|
7487
|
+
function jd(e, t) {
|
|
7494
7488
|
return {
|
|
7495
7489
|
...e,
|
|
7496
7490
|
draft: {
|
|
@@ -7499,19 +7493,19 @@ function Md(e, t) {
|
|
|
7499
7493
|
}
|
|
7500
7494
|
};
|
|
7501
7495
|
}
|
|
7502
|
-
function
|
|
7496
|
+
function Md(e, t) {
|
|
7503
7497
|
switch (t.type) {
|
|
7504
|
-
case "init": return
|
|
7498
|
+
case "init": return kd(t.dashboard);
|
|
7505
7499
|
case "markSaved": return {
|
|
7506
7500
|
draft: t.dashboard,
|
|
7507
7501
|
baseline: t.dashboard
|
|
7508
7502
|
};
|
|
7509
|
-
case "setTitle": return
|
|
7510
|
-
case "setDescription": return
|
|
7511
|
-
case "setTimeRange": return
|
|
7512
|
-
case "setFilters": return
|
|
7513
|
-
case "upsertWidget": return
|
|
7514
|
-
case "removeWidget": return
|
|
7503
|
+
case "setTitle": return jd(e, { title: t.title });
|
|
7504
|
+
case "setDescription": return jd(e, { description: t.description.length > 0 ? t.description : void 0 });
|
|
7505
|
+
case "setTimeRange": return jd(e, { timeRange: t.timeRange });
|
|
7506
|
+
case "setFilters": return jd(e, { filters: t.filters });
|
|
7507
|
+
case "upsertWidget": return jd(e, { widgets: e.draft.widgets.some((e) => e.id === t.widget.id) ? e.draft.widgets.map((e) => e.id === t.widget.id ? t.widget : e) : [...e.draft.widgets, t.widget] });
|
|
7508
|
+
case "removeWidget": return jd(e, { widgets: e.draft.widgets.filter((e) => e.id !== t.widgetId) });
|
|
7515
7509
|
case "duplicateWidget": {
|
|
7516
7510
|
let n = e.draft.widgets.find((e) => e.id === t.widgetId);
|
|
7517
7511
|
if (!n) return e;
|
|
@@ -7524,7 +7518,7 @@ function Nd(e, t) {
|
|
|
7524
7518
|
y: n.layout.y + n.layout.rows
|
|
7525
7519
|
}
|
|
7526
7520
|
};
|
|
7527
|
-
return
|
|
7521
|
+
return jd(e, { widgets: [...e.draft.widgets, r] });
|
|
7528
7522
|
}
|
|
7529
7523
|
case "applyLayouts": {
|
|
7530
7524
|
let n = !1, r = e.draft.widgets.map((e) => {
|
|
@@ -7534,9 +7528,9 @@ function Nd(e, t) {
|
|
|
7534
7528
|
layout: r
|
|
7535
7529
|
});
|
|
7536
7530
|
});
|
|
7537
|
-
return n ?
|
|
7531
|
+
return n ? jd(e, { widgets: r }) : e;
|
|
7538
7532
|
}
|
|
7539
|
-
case "replaceEditable": return
|
|
7533
|
+
case "replaceEditable": return jd(e, {
|
|
7540
7534
|
title: t.fields.title,
|
|
7541
7535
|
description: t.fields.description,
|
|
7542
7536
|
widgets: t.fields.widgets,
|
|
@@ -7545,20 +7539,20 @@ function Nd(e, t) {
|
|
|
7545
7539
|
});
|
|
7546
7540
|
}
|
|
7547
7541
|
}
|
|
7548
|
-
function
|
|
7542
|
+
function Nd() {
|
|
7549
7543
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `w-${crypto.randomUUID().slice(0, 8)}` : `w-${Math.random().toString(36).slice(2, 10)}`;
|
|
7550
7544
|
}
|
|
7551
|
-
function
|
|
7545
|
+
function Pd() {
|
|
7552
7546
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
7553
7547
|
}
|
|
7554
|
-
function
|
|
7548
|
+
function Fd(e) {
|
|
7555
7549
|
return {
|
|
7556
7550
|
...e,
|
|
7557
|
-
id:
|
|
7551
|
+
id: Pd(),
|
|
7558
7552
|
title: `${e.title} (copy)`
|
|
7559
7553
|
};
|
|
7560
7554
|
}
|
|
7561
|
-
var
|
|
7555
|
+
var Id = "stacked", Ld = {
|
|
7562
7556
|
metric: {
|
|
7563
7557
|
cols: 3,
|
|
7564
7558
|
rows: 1
|
|
@@ -7584,17 +7578,17 @@ var Ld = "stacked", Rd = {
|
|
|
7584
7578
|
rows: 2
|
|
7585
7579
|
}
|
|
7586
7580
|
};
|
|
7587
|
-
function
|
|
7581
|
+
function Rd(e) {
|
|
7588
7582
|
return e.reduce((e, t) => Math.max(e, t.layout.y + t.layout.rows), 0);
|
|
7589
7583
|
}
|
|
7590
|
-
function
|
|
7584
|
+
function zd(e, t, n) {
|
|
7591
7585
|
let r = {
|
|
7592
7586
|
id: t,
|
|
7593
7587
|
title: "",
|
|
7594
7588
|
layout: {
|
|
7595
7589
|
x: 0,
|
|
7596
|
-
y:
|
|
7597
|
-
...
|
|
7590
|
+
y: Rd(n),
|
|
7591
|
+
...Ld[e]
|
|
7598
7592
|
}
|
|
7599
7593
|
};
|
|
7600
7594
|
switch (e) {
|
|
@@ -7643,7 +7637,7 @@ function Bd(e, t, n) {
|
|
|
7643
7637
|
measure: "COUNT",
|
|
7644
7638
|
order: "DESC"
|
|
7645
7639
|
}],
|
|
7646
|
-
variant:
|
|
7640
|
+
variant: Id
|
|
7647
7641
|
};
|
|
7648
7642
|
case "metric": return {
|
|
7649
7643
|
...r,
|
|
@@ -7664,7 +7658,7 @@ function Bd(e, t, n) {
|
|
|
7664
7658
|
};
|
|
7665
7659
|
}
|
|
7666
7660
|
}
|
|
7667
|
-
function
|
|
7661
|
+
function Bd(e) {
|
|
7668
7662
|
return `New dashboard · ${e.toLocaleDateString(void 0, {
|
|
7669
7663
|
month: "short",
|
|
7670
7664
|
day: "numeric"
|
|
@@ -7673,10 +7667,10 @@ function Vd(e) {
|
|
|
7673
7667
|
minute: "2-digit"
|
|
7674
7668
|
})}`;
|
|
7675
7669
|
}
|
|
7676
|
-
function
|
|
7670
|
+
function Vd(e = /* @__PURE__ */ new Date()) {
|
|
7677
7671
|
return {
|
|
7678
|
-
id:
|
|
7679
|
-
title:
|
|
7672
|
+
id: Pd(),
|
|
7673
|
+
title: Bd(e),
|
|
7680
7674
|
widgets: [],
|
|
7681
7675
|
filters: [],
|
|
7682
7676
|
timeRange: {
|
|
@@ -7689,15 +7683,15 @@ function Hd(e = /* @__PURE__ */ new Date()) {
|
|
|
7689
7683
|
}
|
|
7690
7684
|
//#endregion
|
|
7691
7685
|
//#region src/dashboards/editor/dashboard-json.ts
|
|
7692
|
-
var
|
|
7686
|
+
var Hd = new Set([
|
|
7693
7687
|
"cartesian",
|
|
7694
7688
|
"doughnut",
|
|
7695
7689
|
"bar",
|
|
7696
7690
|
"breakdown",
|
|
7697
7691
|
"metric",
|
|
7698
7692
|
"metric-group"
|
|
7699
|
-
]),
|
|
7700
|
-
function
|
|
7693
|
+
]), Ud = new Set(ci), Wd = new Set(Xu), Gd = 12;
|
|
7694
|
+
function Kd(e) {
|
|
7701
7695
|
let { title: t, description: n, filters: r, timeRange: i, widgets: a } = e;
|
|
7702
7696
|
return JSON.stringify({
|
|
7703
7697
|
title: t,
|
|
@@ -7707,7 +7701,7 @@ function qd(e) {
|
|
|
7707
7701
|
widgets: a
|
|
7708
7702
|
}, null, 2);
|
|
7709
7703
|
}
|
|
7710
|
-
function
|
|
7704
|
+
function qd(e) {
|
|
7711
7705
|
let t;
|
|
7712
7706
|
try {
|
|
7713
7707
|
t = JSON.parse(e);
|
|
@@ -7725,7 +7719,7 @@ function Jd(e) {
|
|
|
7725
7719
|
i || r.push("\"title\" must be a non-empty string.");
|
|
7726
7720
|
let a;
|
|
7727
7721
|
n.description !== void 0 && (typeof n.description == "string" ? a = n.description : r.push("\"description\" must be a string."));
|
|
7728
|
-
let o =
|
|
7722
|
+
let o = Jd(n.timeRange, r), s = Yd(n.filters, "filters", r), c = Zd(n.widgets, r);
|
|
7729
7723
|
return r.length > 0 || !i || !o || !s || !c ? {
|
|
7730
7724
|
ok: !1,
|
|
7731
7725
|
errors: r
|
|
@@ -7740,15 +7734,15 @@ function Jd(e) {
|
|
|
7740
7734
|
}
|
|
7741
7735
|
};
|
|
7742
7736
|
}
|
|
7743
|
-
function
|
|
7737
|
+
function Jd(e, t) {
|
|
7744
7738
|
if (typeof e != "object" || !e) {
|
|
7745
7739
|
t.push("\"timeRange\" must be an object like { \"type\": \"relative\", \"period\": \"24h\" }.");
|
|
7746
7740
|
return;
|
|
7747
7741
|
}
|
|
7748
7742
|
let n = e;
|
|
7749
7743
|
if (n.type === "relative") {
|
|
7750
|
-
if (typeof n.period != "string" || !
|
|
7751
|
-
t.push(`"timeRange.period" must be one of: ${[...
|
|
7744
|
+
if (typeof n.period != "string" || !Ud.has(n.period)) {
|
|
7745
|
+
t.push(`"timeRange.period" must be one of: ${[...Ud].join(", ")}.`);
|
|
7752
7746
|
return;
|
|
7753
7747
|
}
|
|
7754
7748
|
return {
|
|
@@ -7769,7 +7763,7 @@ function Yd(e, t) {
|
|
|
7769
7763
|
}
|
|
7770
7764
|
t.push("\"timeRange.type\" must be \"relative\" or \"absolute\".");
|
|
7771
7765
|
}
|
|
7772
|
-
function
|
|
7766
|
+
function Yd(e, t, n) {
|
|
7773
7767
|
if (e === void 0) return [];
|
|
7774
7768
|
if (!Array.isArray(e)) {
|
|
7775
7769
|
n.push(`"${t}" must be an array.`);
|
|
@@ -7777,7 +7771,7 @@ function Xd(e, t, n) {
|
|
|
7777
7771
|
}
|
|
7778
7772
|
let r = n.length, i = [], a = /* @__PURE__ */ new Set();
|
|
7779
7773
|
for (let [r, o] of e.entries()) {
|
|
7780
|
-
let e =
|
|
7774
|
+
let e = Xd(o, `${t}[${r}]`, n);
|
|
7781
7775
|
if (e) {
|
|
7782
7776
|
if (a.has(e.field)) {
|
|
7783
7777
|
n.push(`${t}[${r}].field duplicates "${e.field}". One condition per field.`);
|
|
@@ -7788,7 +7782,7 @@ function Xd(e, t, n) {
|
|
|
7788
7782
|
}
|
|
7789
7783
|
return n.length === r ? i : void 0;
|
|
7790
7784
|
}
|
|
7791
|
-
function
|
|
7785
|
+
function Xd(e, t, n) {
|
|
7792
7786
|
if (typeof e != "object" || !e) {
|
|
7793
7787
|
n.push(`${t} must be an object.`);
|
|
7794
7788
|
return;
|
|
@@ -7798,8 +7792,8 @@ function Zd(e, t, n) {
|
|
|
7798
7792
|
n.push(`${t}.field must be a non-empty string.`);
|
|
7799
7793
|
return;
|
|
7800
7794
|
}
|
|
7801
|
-
if (typeof r.operator != "string" || !
|
|
7802
|
-
n.push(`${t}.operator must be one of: ${[...
|
|
7795
|
+
if (typeof r.operator != "string" || !Wd.has(r.operator)) {
|
|
7796
|
+
n.push(`${t}.operator must be one of: ${[...Wd].join(", ")}.`);
|
|
7803
7797
|
return;
|
|
7804
7798
|
}
|
|
7805
7799
|
if (!Array.isArray(r.value) || !r.value.every((e) => typeof e == "string")) {
|
|
@@ -7820,7 +7814,7 @@ function Zd(e, t, n) {
|
|
|
7820
7814
|
...Array.isArray(r.valueLabels) && r.valueLabels.every((e) => typeof e == "string") ? { valueLabels: r.valueLabels } : {}
|
|
7821
7815
|
};
|
|
7822
7816
|
}
|
|
7823
|
-
function
|
|
7817
|
+
function Zd(e, t) {
|
|
7824
7818
|
if (e === void 0) return [];
|
|
7825
7819
|
if (!Array.isArray(e)) {
|
|
7826
7820
|
t.push("\"widgets\" must be an array.");
|
|
@@ -7834,23 +7828,23 @@ function Qd(e, t) {
|
|
|
7834
7828
|
continue;
|
|
7835
7829
|
}
|
|
7836
7830
|
let o = a;
|
|
7837
|
-
if (typeof o.type != "string" || !
|
|
7838
|
-
t.push(`${e}.type must be one of: ${[...
|
|
7831
|
+
if (typeof o.type != "string" || !Hd.has(o.type)) {
|
|
7832
|
+
t.push(`${e}.type must be one of: ${[...Hd].join(", ")}.`);
|
|
7839
7833
|
continue;
|
|
7840
7834
|
}
|
|
7841
7835
|
if (typeof o.title != "string") {
|
|
7842
7836
|
t.push(`${e}.title must be a string.`);
|
|
7843
7837
|
continue;
|
|
7844
7838
|
}
|
|
7845
|
-
let s =
|
|
7839
|
+
let s = Qd(o.layout, e, t);
|
|
7846
7840
|
if (!s) continue;
|
|
7847
|
-
let c = typeof o.id == "string" && o.id.length > 0 ? o.id :
|
|
7841
|
+
let c = typeof o.id == "string" && o.id.length > 0 ? o.id : Nd();
|
|
7848
7842
|
if (i.has(c)) {
|
|
7849
7843
|
t.push(`${e}.id "${c}" is duplicated. Widget ids must be unique.`);
|
|
7850
7844
|
continue;
|
|
7851
7845
|
}
|
|
7852
7846
|
i.add(c);
|
|
7853
|
-
let l = o.filters === void 0 ? void 0 :
|
|
7847
|
+
let l = o.filters === void 0 ? void 0 : Yd(o.filters, `${e}.filters`, t);
|
|
7854
7848
|
o.filters !== void 0 && !l || r.push({
|
|
7855
7849
|
...o,
|
|
7856
7850
|
id: c,
|
|
@@ -7860,7 +7854,7 @@ function Qd(e, t) {
|
|
|
7860
7854
|
}
|
|
7861
7855
|
return t.length === n ? r : void 0;
|
|
7862
7856
|
}
|
|
7863
|
-
function
|
|
7857
|
+
function Qd(e, t, n) {
|
|
7864
7858
|
if (typeof e != "object" || !e) {
|
|
7865
7859
|
n.push(`${t}.layout must be an object with numeric x, y, cols, rows.`);
|
|
7866
7860
|
return;
|
|
@@ -7870,8 +7864,8 @@ function $d(e, t, n) {
|
|
|
7870
7864
|
n.push(`${t}.layout needs integer x, y, cols, rows.`);
|
|
7871
7865
|
return;
|
|
7872
7866
|
}
|
|
7873
|
-
if (r < 0 || r >=
|
|
7874
|
-
n.push(`${t}.layout is out of bounds for the ${
|
|
7867
|
+
if (r < 0 || r >= Gd || a < 1 || a > Gd || r + a > Gd || i < 0 || o < 1) {
|
|
7868
|
+
n.push(`${t}.layout is out of bounds for the ${Gd}-column grid.`);
|
|
7875
7869
|
return;
|
|
7876
7870
|
}
|
|
7877
7871
|
return {
|
|
@@ -7883,9 +7877,9 @@ function $d(e, t, n) {
|
|
|
7883
7877
|
}
|
|
7884
7878
|
//#endregion
|
|
7885
7879
|
//#region src/dashboards/editor/DashboardJsonTab.tsx
|
|
7886
|
-
var
|
|
7887
|
-
function
|
|
7888
|
-
let i = k(() =>
|
|
7880
|
+
var $d = "calc(100vh - 16rem)", ef = "min-h-[24rem]", tf = Le(() => import("@gravitee/graphene-core/code-editor").then((e) => ({ default: e.CodeEditor })));
|
|
7881
|
+
function nf({ text: e, onTextChange: t, dirty: n, onApply: r }) {
|
|
7882
|
+
let i = k(() => qd(e), [e]), a = async () => {
|
|
7889
7883
|
try {
|
|
7890
7884
|
await navigator.clipboard.writeText(e), X.success("Dashboard JSON copied to clipboard");
|
|
7891
7885
|
} catch {
|
|
@@ -7925,16 +7919,16 @@ function rf({ text: e, onTextChange: t, dirty: n, onApply: r }) {
|
|
|
7925
7919
|
}) })]
|
|
7926
7920
|
}),
|
|
7927
7921
|
/* @__PURE__ */ N("div", {
|
|
7928
|
-
className:
|
|
7929
|
-
style: { height:
|
|
7930
|
-
children: /* @__PURE__ */ N(
|
|
7931
|
-
fallback: /* @__PURE__ */ N(
|
|
7922
|
+
className: ef,
|
|
7923
|
+
style: { height: $d },
|
|
7924
|
+
children: /* @__PURE__ */ N(af, {
|
|
7925
|
+
fallback: /* @__PURE__ */ N(rf, {
|
|
7932
7926
|
text: e,
|
|
7933
7927
|
onTextChange: t
|
|
7934
7928
|
}),
|
|
7935
7929
|
children: /* @__PURE__ */ N(Ne, {
|
|
7936
7930
|
fallback: /* @__PURE__ */ N(G, { className: "size-full" }),
|
|
7937
|
-
children: /* @__PURE__ */ N(
|
|
7931
|
+
children: /* @__PURE__ */ N(tf, {
|
|
7938
7932
|
language: "json",
|
|
7939
7933
|
height: "100%",
|
|
7940
7934
|
value: e,
|
|
@@ -7946,7 +7940,7 @@ function rf({ text: e, onTextChange: t, dirty: n, onApply: r }) {
|
|
|
7946
7940
|
]
|
|
7947
7941
|
});
|
|
7948
7942
|
}
|
|
7949
|
-
function
|
|
7943
|
+
function rf({ text: e, onTextChange: t }) {
|
|
7950
7944
|
return /* @__PURE__ */ P("div", {
|
|
7951
7945
|
className: "flex h-full flex-col gap-2",
|
|
7952
7946
|
children: [/* @__PURE__ */ P("p", {
|
|
@@ -7964,7 +7958,7 @@ function af({ text: e, onTextChange: t }) {
|
|
|
7964
7958
|
})]
|
|
7965
7959
|
});
|
|
7966
7960
|
}
|
|
7967
|
-
var
|
|
7961
|
+
var af = class extends je {
|
|
7968
7962
|
state = { hasError: !1 };
|
|
7969
7963
|
static getDerivedStateFromError() {
|
|
7970
7964
|
return { hasError: !0 };
|
|
@@ -7978,7 +7972,7 @@ var of = class extends je {
|
|
|
7978
7972
|
};
|
|
7979
7973
|
//#endregion
|
|
7980
7974
|
//#region src/dashboards/editor/EmptyDashboardState.tsx
|
|
7981
|
-
function
|
|
7975
|
+
function of({ onAddWidget: e }) {
|
|
7982
7976
|
return /* @__PURE__ */ N("button", {
|
|
7983
7977
|
type: "button",
|
|
7984
7978
|
onClick: e,
|
|
@@ -7999,7 +7993,7 @@ function sf({ onAddWidget: e }) {
|
|
|
7999
7993
|
}
|
|
8000
7994
|
//#endregion
|
|
8001
7995
|
//#region src/dashboards/editor/InlineEditableText.tsx
|
|
8002
|
-
function
|
|
7996
|
+
function sf({ value: e, onChange: t, placeholder: n, ariaLabel: r, textClassName: i, inputClassName: a }) {
|
|
8003
7997
|
let [o, s] = j(!1), [c, l] = j(e), u = A(null);
|
|
8004
7998
|
O(() => {
|
|
8005
7999
|
o && (u.current?.focus(), u.current?.select());
|
|
@@ -8035,7 +8029,7 @@ function cf({ value: e, onChange: t, placeholder: n, ariaLabel: r, textClassName
|
|
|
8035
8029
|
}
|
|
8036
8030
|
//#endregion
|
|
8037
8031
|
//#region src/dashboards/editor/CartesianDisplayFields.tsx
|
|
8038
|
-
function
|
|
8032
|
+
function cf({ widget: e, onChange: t }) {
|
|
8039
8033
|
let n = Be(), r = e.showTotal ?? !1, i = e.series.length < 2 && !e.series[0]?.by?.length;
|
|
8040
8034
|
return /* @__PURE__ */ P(M, { children: [
|
|
8041
8035
|
/* @__PURE__ */ N(Mt, { children: "Adds a total row to the tooltip, summing every series at the hovered point. Useful when the series are parts of one whole." }),
|
|
@@ -8073,7 +8067,7 @@ function lf({ widget: e, onChange: t }) {
|
|
|
8073
8067
|
}
|
|
8074
8068
|
//#endregion
|
|
8075
8069
|
//#region src/dashboards/editor/LabelledRow.tsx
|
|
8076
|
-
function
|
|
8070
|
+
function lf({ cols: e, labels: t, className: n, children: r }) {
|
|
8077
8071
|
return /* @__PURE__ */ P("div", {
|
|
8078
8072
|
className: n,
|
|
8079
8073
|
children: [/* @__PURE__ */ N("div", {
|
|
@@ -8087,14 +8081,14 @@ function uf({ cols: e, labels: t, className: n, children: r }) {
|
|
|
8087
8081
|
}
|
|
8088
8082
|
//#endregion
|
|
8089
8083
|
//#region src/dashboards/editor/facet-display-cols.ts
|
|
8090
|
-
var
|
|
8084
|
+
var uf = "grid grid-cols-2";
|
|
8091
8085
|
//#endregion
|
|
8092
8086
|
//#region src/dashboards/editor/DoughnutCentreFields.tsx
|
|
8093
|
-
function
|
|
8087
|
+
function df(e) {
|
|
8094
8088
|
return e.centerValue === void 0 ? e.centerTotal ? "total" : "none" : "custom";
|
|
8095
8089
|
}
|
|
8096
|
-
function
|
|
8097
|
-
let n =
|
|
8090
|
+
function ff({ widget: e, onChange: t }) {
|
|
8091
|
+
let n = df(e), r = (n) => {
|
|
8098
8092
|
if (n === "none") {
|
|
8099
8093
|
t({
|
|
8100
8094
|
...e,
|
|
@@ -8117,8 +8111,8 @@ function pf({ widget: e, onChange: t }) {
|
|
|
8117
8111
|
centerValue: e.centerValue ?? ""
|
|
8118
8112
|
});
|
|
8119
8113
|
};
|
|
8120
|
-
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P(
|
|
8121
|
-
cols:
|
|
8114
|
+
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P(lf, {
|
|
8115
|
+
cols: uf,
|
|
8122
8116
|
labels: ["Centre", "Custom value"],
|
|
8123
8117
|
children: [/* @__PURE__ */ P(B, {
|
|
8124
8118
|
value: n,
|
|
@@ -8151,8 +8145,8 @@ function pf({ widget: e, onChange: t }) {
|
|
|
8151
8145
|
centerValue: n.target.value
|
|
8152
8146
|
})
|
|
8153
8147
|
})]
|
|
8154
|
-
}), /* @__PURE__ */ N(
|
|
8155
|
-
cols:
|
|
8148
|
+
}), /* @__PURE__ */ N(lf, {
|
|
8149
|
+
cols: uf,
|
|
8156
8150
|
labels: ["Caption"],
|
|
8157
8151
|
children: /* @__PURE__ */ N(z, {
|
|
8158
8152
|
"aria-label": "Centre caption",
|
|
@@ -8168,7 +8162,7 @@ function pf({ widget: e, onChange: t }) {
|
|
|
8168
8162
|
}
|
|
8169
8163
|
//#endregion
|
|
8170
8164
|
//#region src/dashboards/editor/SentimentSelect.tsx
|
|
8171
|
-
var
|
|
8165
|
+
var pf = [
|
|
8172
8166
|
{
|
|
8173
8167
|
value: "neutral",
|
|
8174
8168
|
label: "Neutral"
|
|
@@ -8181,10 +8175,10 @@ var mf = [
|
|
|
8181
8175
|
value: "lower-is-better",
|
|
8182
8176
|
label: "Lower is better"
|
|
8183
8177
|
}
|
|
8184
|
-
],
|
|
8185
|
-
function
|
|
8178
|
+
], mf = "higher-is-better";
|
|
8179
|
+
function hf({ value: e, onChange: t, id: n, disabled: r }) {
|
|
8186
8180
|
return /* @__PURE__ */ P(B, {
|
|
8187
|
-
value: e ??
|
|
8181
|
+
value: e ?? mf,
|
|
8188
8182
|
onValueChange: (e) => e && t(e),
|
|
8189
8183
|
disabled: r,
|
|
8190
8184
|
children: [/* @__PURE__ */ N(U, {
|
|
@@ -8192,7 +8186,7 @@ function gf({ value: e, onChange: t, id: n, disabled: r }) {
|
|
|
8192
8186
|
className: "w-full",
|
|
8193
8187
|
"aria-label": "Trend sentiment",
|
|
8194
8188
|
children: /* @__PURE__ */ N(W, {})
|
|
8195
|
-
}), /* @__PURE__ */ N(V, { children:
|
|
8189
|
+
}), /* @__PURE__ */ N(V, { children: pf.map((e) => /* @__PURE__ */ N(H, {
|
|
8196
8190
|
value: e.value,
|
|
8197
8191
|
children: e.label
|
|
8198
8192
|
}, e.value)) })]
|
|
@@ -8200,9 +8194,9 @@ function gf({ value: e, onChange: t, id: n, disabled: r }) {
|
|
|
8200
8194
|
}
|
|
8201
8195
|
//#endregion
|
|
8202
8196
|
//#region src/dashboards/editor/FacetDisplayFields.tsx
|
|
8203
|
-
function
|
|
8204
|
-
if (e.type === "bar") return /* @__PURE__ */ P(
|
|
8205
|
-
cols:
|
|
8197
|
+
function gf({ widget: e, onChange: t }) {
|
|
8198
|
+
if (e.type === "bar") return /* @__PURE__ */ P(lf, {
|
|
8199
|
+
cols: uf,
|
|
8206
8200
|
labels: ["Orientation", "Value label"],
|
|
8207
8201
|
children: [/* @__PURE__ */ P(B, {
|
|
8208
8202
|
value: e.barLayout ?? "vertical",
|
|
@@ -8231,14 +8225,14 @@ function _f({ widget: e, onChange: t }) {
|
|
|
8231
8225
|
})
|
|
8232
8226
|
})]
|
|
8233
8227
|
});
|
|
8234
|
-
if (e.type === "doughnut") return /* @__PURE__ */ N(
|
|
8228
|
+
if (e.type === "doughnut") return /* @__PURE__ */ N(ff, {
|
|
8235
8229
|
widget: e,
|
|
8236
8230
|
onChange: t
|
|
8237
8231
|
});
|
|
8238
8232
|
let n = e.showTrend ?? !1, r = e.variant === "stacked";
|
|
8239
8233
|
return /* @__PURE__ */ P(M, { children: [
|
|
8240
|
-
/* @__PURE__ */ P(
|
|
8241
|
-
cols:
|
|
8234
|
+
/* @__PURE__ */ P(lf, {
|
|
8235
|
+
cols: uf,
|
|
8242
8236
|
labels: ["Representation", "Row order"],
|
|
8243
8237
|
children: [/* @__PURE__ */ P(B, {
|
|
8244
8238
|
value: e.variant ?? "list",
|
|
@@ -8326,7 +8320,7 @@ function _f({ widget: e, onChange: t }) {
|
|
|
8326
8320
|
})
|
|
8327
8321
|
]
|
|
8328
8322
|
}),
|
|
8329
|
-
!r && /* @__PURE__ */ P(
|
|
8323
|
+
!r && /* @__PURE__ */ P(lf, {
|
|
8330
8324
|
cols: "grid grid-cols-2",
|
|
8331
8325
|
labels: n ? ["Collapse after", "Trend sentiment"] : ["Collapse after"],
|
|
8332
8326
|
children: [/* @__PURE__ */ N(z, {
|
|
@@ -8343,7 +8337,7 @@ function _f({ widget: e, onChange: t }) {
|
|
|
8343
8337
|
maxItems: Number.isNaN(r) ? void 0 : Math.max(1, Math.min(i, r))
|
|
8344
8338
|
});
|
|
8345
8339
|
}
|
|
8346
|
-
}), n && /* @__PURE__ */ N(
|
|
8340
|
+
}), n && /* @__PURE__ */ N(hf, {
|
|
8347
8341
|
value: e.trendSentiment,
|
|
8348
8342
|
onChange: (n) => t({
|
|
8349
8343
|
...e,
|
|
@@ -8355,13 +8349,13 @@ function _f({ widget: e, onChange: t }) {
|
|
|
8355
8349
|
}
|
|
8356
8350
|
//#endregion
|
|
8357
8351
|
//#region src/dashboards/editor/DimensionSelect.tsx
|
|
8358
|
-
var
|
|
8359
|
-
function
|
|
8352
|
+
var _f = "__none__";
|
|
8353
|
+
function vf({ value: e, onChange: t, id: n, allowNone: r = !1, disabled: i, ariaLabel: a = "Dimension" }) {
|
|
8360
8354
|
let o = e !== void 0 && Go(e) !== void 0;
|
|
8361
8355
|
return /* @__PURE__ */ P(B, {
|
|
8362
|
-
value: e ?? (r ?
|
|
8356
|
+
value: e ?? (r ? _f : void 0),
|
|
8363
8357
|
onValueChange: (e) => {
|
|
8364
|
-
e && t(e ===
|
|
8358
|
+
e && t(e === _f ? void 0 : e);
|
|
8365
8359
|
},
|
|
8366
8360
|
disabled: i,
|
|
8367
8361
|
children: [/* @__PURE__ */ N(U, {
|
|
@@ -8372,7 +8366,7 @@ function yf({ value: e, onChange: t, id: n, allowNone: r = !1, disabled: i, aria
|
|
|
8372
8366
|
children: /* @__PURE__ */ N(W, { placeholder: "Select a dimension" })
|
|
8373
8367
|
}), /* @__PURE__ */ P(V, { children: [
|
|
8374
8368
|
r && /* @__PURE__ */ N(H, {
|
|
8375
|
-
value:
|
|
8369
|
+
value: _f,
|
|
8376
8370
|
children: "None"
|
|
8377
8371
|
}),
|
|
8378
8372
|
Vo.map((e) => /* @__PURE__ */ N(H, {
|
|
@@ -8398,11 +8392,11 @@ function yf({ value: e, onChange: t, id: n, allowNone: r = !1, disabled: i, aria
|
|
|
8398
8392
|
}
|
|
8399
8393
|
//#endregion
|
|
8400
8394
|
//#region src/dashboards/editor/MeasureSelect.tsx
|
|
8401
|
-
function
|
|
8395
|
+
function yf(e, t, n) {
|
|
8402
8396
|
if (t) return `${e[0]} is the only measure available for this metric`;
|
|
8403
8397
|
if (!n) return "This measure is not among the ones the metric is known to support";
|
|
8404
8398
|
}
|
|
8405
|
-
function
|
|
8399
|
+
function bf({ value: e, onChange: t, id: n, metric: r }) {
|
|
8406
8400
|
let i = (r === void 0 ? void 0 : qo(r)) ?? Ro, a = e === void 0 || i.includes(e), o = a || e === void 0 ? i : [...i, e], s = o.length === 1;
|
|
8407
8401
|
return /* @__PURE__ */ P(B, {
|
|
8408
8402
|
value: e ?? (s ? o[0] : void 0),
|
|
@@ -8412,7 +8406,7 @@ function xf({ value: e, onChange: t, id: n, metric: r }) {
|
|
|
8412
8406
|
id: n,
|
|
8413
8407
|
className: "w-full",
|
|
8414
8408
|
"aria-label": "Measure",
|
|
8415
|
-
title:
|
|
8409
|
+
title: yf(o, s, a),
|
|
8416
8410
|
children: /* @__PURE__ */ N(W, { placeholder: "Measure" })
|
|
8417
8411
|
}), /* @__PURE__ */ N(V, { children: o.map((e) => /* @__PURE__ */ N(H, {
|
|
8418
8412
|
value: e,
|
|
@@ -8422,7 +8416,7 @@ function xf({ value: e, onChange: t, id: n, metric: r }) {
|
|
|
8422
8416
|
}
|
|
8423
8417
|
//#endregion
|
|
8424
8418
|
//#region src/dashboards/editor/MetricSelect.tsx
|
|
8425
|
-
function
|
|
8419
|
+
function xf({ value: e, onChange: t, id: n }) {
|
|
8426
8420
|
let r = Wo(e) !== void 0;
|
|
8427
8421
|
return /* @__PURE__ */ P(B, {
|
|
8428
8422
|
value: e,
|
|
@@ -8454,8 +8448,8 @@ function Sf({ value: e, onChange: t, id: n }) {
|
|
|
8454
8448
|
}
|
|
8455
8449
|
//#endregion
|
|
8456
8450
|
//#region src/dashboards/editor/FacetQueryFields.tsx
|
|
8457
|
-
var
|
|
8458
|
-
function
|
|
8451
|
+
var Sf = "grid grid-cols-[minmax(0,1.7fr)_minmax(0,0.9fr)_minmax(0,1.2fr)_minmax(0,0.8fr)_minmax(0,1.1fr)]", Cf = "grid grid-cols-[minmax(0,0.35fr)_minmax(0,1.4fr)_minmax(0,1.1fr)]", wf = "COUNT";
|
|
8452
|
+
function Tf({ widget: e, onChange: t }) {
|
|
8459
8453
|
let n = (n) => {
|
|
8460
8454
|
let r = Jo(n, e.measure), i = e.sorts && r !== void 0 ? e.sorts.map((e) => ({
|
|
8461
8455
|
...e,
|
|
@@ -8478,7 +8472,7 @@ function Ef({ widget: e, onChange: t }) {
|
|
|
8478
8472
|
sorts: r
|
|
8479
8473
|
});
|
|
8480
8474
|
}, i = e.sorts?.[0]?.order ?? "DESC", a = (n) => {
|
|
8481
|
-
let r = e.measure ??
|
|
8475
|
+
let r = e.measure ?? wf;
|
|
8482
8476
|
t({
|
|
8483
8477
|
...e,
|
|
8484
8478
|
sorts: [{
|
|
@@ -8487,8 +8481,8 @@ function Ef({ widget: e, onChange: t }) {
|
|
|
8487
8481
|
}]
|
|
8488
8482
|
});
|
|
8489
8483
|
};
|
|
8490
|
-
return /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ P(
|
|
8491
|
-
cols:
|
|
8484
|
+
return /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ P(lf, {
|
|
8485
|
+
cols: Sf,
|
|
8492
8486
|
labels: [
|
|
8493
8487
|
"Metric",
|
|
8494
8488
|
"Measure",
|
|
@@ -8497,16 +8491,16 @@ function Ef({ widget: e, onChange: t }) {
|
|
|
8497
8491
|
"Keep"
|
|
8498
8492
|
],
|
|
8499
8493
|
children: [
|
|
8500
|
-
/* @__PURE__ */ N(
|
|
8494
|
+
/* @__PURE__ */ N(xf, {
|
|
8501
8495
|
value: e.metric ?? "HTTP_REQUESTS",
|
|
8502
8496
|
onChange: n
|
|
8503
8497
|
}),
|
|
8504
|
-
/* @__PURE__ */ N(
|
|
8498
|
+
/* @__PURE__ */ N(bf, {
|
|
8505
8499
|
value: e.measure,
|
|
8506
8500
|
metric: e.metric ?? "HTTP_REQUESTS",
|
|
8507
8501
|
onChange: r
|
|
8508
8502
|
}),
|
|
8509
|
-
/* @__PURE__ */ N(
|
|
8503
|
+
/* @__PURE__ */ N(vf, {
|
|
8510
8504
|
ariaLabel: "Group by",
|
|
8511
8505
|
value: e.by[0],
|
|
8512
8506
|
onChange: (n) => n && t({
|
|
@@ -8546,16 +8540,16 @@ function Ef({ widget: e, onChange: t }) {
|
|
|
8546
8540
|
})] })]
|
|
8547
8541
|
})
|
|
8548
8542
|
]
|
|
8549
|
-
}), e.type === "breakdown" && /* @__PURE__ */ N(
|
|
8543
|
+
}), e.type === "breakdown" && /* @__PURE__ */ N(Ef, {
|
|
8550
8544
|
widget: e,
|
|
8551
8545
|
onChange: t
|
|
8552
8546
|
})] });
|
|
8553
8547
|
}
|
|
8554
|
-
function
|
|
8548
|
+
function Ef({ widget: e, onChange: t }) {
|
|
8555
8549
|
let n = e.showTooltip ?? !0;
|
|
8556
|
-
return /* @__PURE__ */ P(
|
|
8550
|
+
return /* @__PURE__ */ P(lf, {
|
|
8557
8551
|
className: "mt-2",
|
|
8558
|
-
cols:
|
|
8552
|
+
cols: Cf,
|
|
8559
8553
|
labels: [
|
|
8560
8554
|
"On hover",
|
|
8561
8555
|
"Break down by",
|
|
@@ -8570,7 +8564,7 @@ function Df({ widget: e, onChange: t }) {
|
|
|
8570
8564
|
showTooltip: n
|
|
8571
8565
|
})
|
|
8572
8566
|
}),
|
|
8573
|
-
/* @__PURE__ */ N(
|
|
8567
|
+
/* @__PURE__ */ N(vf, {
|
|
8574
8568
|
allowNone: !0,
|
|
8575
8569
|
ariaLabel: "Hover breakdown dimension",
|
|
8576
8570
|
disabled: !n,
|
|
@@ -8604,8 +8598,8 @@ function Df({ widget: e, onChange: t }) {
|
|
|
8604
8598
|
}
|
|
8605
8599
|
//#endregion
|
|
8606
8600
|
//#region src/dashboards/editor/MetricGroupItemsEditor.tsx
|
|
8607
|
-
var
|
|
8608
|
-
function
|
|
8601
|
+
var Df = "grid-cols-[minmax(0,1.5fr)_minmax(0,0.8fr)_minmax(0,1.1fr)_minmax(0,1.1fr)_minmax(0,0.45fr)_minmax(0,1.1fr)_2rem]";
|
|
8602
|
+
function Of({ items: e, onChange: t }) {
|
|
8609
8603
|
let n = (n, r) => {
|
|
8610
8604
|
t(e.map((e, t) => t === n ? {
|
|
8611
8605
|
...e,
|
|
@@ -8631,7 +8625,7 @@ function kf({ items: e, onChange: t }) {
|
|
|
8631
8625
|
className: "flex flex-col gap-1.5",
|
|
8632
8626
|
children: [
|
|
8633
8627
|
/* @__PURE__ */ P("div", {
|
|
8634
|
-
className: `grid ${
|
|
8628
|
+
className: `grid ${Df} gap-1.5 text-xs font-medium text-muted-foreground`,
|
|
8635
8629
|
children: [
|
|
8636
8630
|
/* @__PURE__ */ N("span", { children: "Metric" }),
|
|
8637
8631
|
/* @__PURE__ */ N("span", { children: "Measure" }),
|
|
@@ -8645,13 +8639,13 @@ function kf({ items: e, onChange: t }) {
|
|
|
8645
8639
|
e.map((t, i) => {
|
|
8646
8640
|
let o = t.showTrend ?? !0;
|
|
8647
8641
|
return /* @__PURE__ */ P("div", {
|
|
8648
|
-
className: `grid ${
|
|
8642
|
+
className: `grid ${Df} items-center gap-1.5`,
|
|
8649
8643
|
children: [
|
|
8650
|
-
/* @__PURE__ */ N(
|
|
8644
|
+
/* @__PURE__ */ N(xf, {
|
|
8651
8645
|
value: t.metric,
|
|
8652
8646
|
onChange: (e) => r(i, e)
|
|
8653
8647
|
}),
|
|
8654
|
-
/* @__PURE__ */ N(
|
|
8648
|
+
/* @__PURE__ */ N(bf, {
|
|
8655
8649
|
value: t.measure,
|
|
8656
8650
|
metric: t.metric,
|
|
8657
8651
|
onChange: (e) => n(i, { measure: e })
|
|
@@ -8673,7 +8667,7 @@ function kf({ items: e, onChange: t }) {
|
|
|
8673
8667
|
checked: o,
|
|
8674
8668
|
onCheckedChange: (e) => n(i, { showTrend: e })
|
|
8675
8669
|
}),
|
|
8676
|
-
/* @__PURE__ */ N(
|
|
8670
|
+
/* @__PURE__ */ N(hf, {
|
|
8677
8671
|
value: t.sentiment,
|
|
8678
8672
|
disabled: !o,
|
|
8679
8673
|
onChange: (e) => n(i, { sentiment: e })
|
|
@@ -8704,11 +8698,11 @@ function kf({ items: e, onChange: t }) {
|
|
|
8704
8698
|
}
|
|
8705
8699
|
//#endregion
|
|
8706
8700
|
//#region src/dashboards/editor/MetricQueryFields.tsx
|
|
8707
|
-
var
|
|
8708
|
-
function
|
|
8701
|
+
var kf = "grid grid-cols-[minmax(0,1.6fr)_minmax(0,0.9fr)_minmax(0,1.3fr)_minmax(0,0.5fr)_minmax(0,0.6fr)_minmax(0,1.2fr)]";
|
|
8702
|
+
function Af({ widget: e, onChange: t }) {
|
|
8709
8703
|
let n = e.showTrend ?? !1;
|
|
8710
|
-
return /* @__PURE__ */ N(R, { children: /* @__PURE__ */ P(
|
|
8711
|
-
cols:
|
|
8704
|
+
return /* @__PURE__ */ N(R, { children: /* @__PURE__ */ P(lf, {
|
|
8705
|
+
cols: kf,
|
|
8712
8706
|
labels: [
|
|
8713
8707
|
"Metric",
|
|
8714
8708
|
"Measure",
|
|
@@ -8718,7 +8712,7 @@ function jf({ widget: e, onChange: t }) {
|
|
|
8718
8712
|
"Sentiment"
|
|
8719
8713
|
],
|
|
8720
8714
|
children: [
|
|
8721
|
-
/* @__PURE__ */ N(
|
|
8715
|
+
/* @__PURE__ */ N(xf, {
|
|
8722
8716
|
value: e.metric,
|
|
8723
8717
|
onChange: (n) => t({
|
|
8724
8718
|
...e,
|
|
@@ -8726,7 +8720,7 @@ function jf({ widget: e, onChange: t }) {
|
|
|
8726
8720
|
measure: Jo(n, e.measure)
|
|
8727
8721
|
})
|
|
8728
8722
|
}),
|
|
8729
|
-
/* @__PURE__ */ N(
|
|
8723
|
+
/* @__PURE__ */ N(bf, {
|
|
8730
8724
|
value: e.measure,
|
|
8731
8725
|
metric: e.metric,
|
|
8732
8726
|
onChange: (n) => t({
|
|
@@ -8759,7 +8753,7 @@ function jf({ widget: e, onChange: t }) {
|
|
|
8759
8753
|
showSparkline: n
|
|
8760
8754
|
})
|
|
8761
8755
|
}),
|
|
8762
|
-
/* @__PURE__ */ N(
|
|
8756
|
+
/* @__PURE__ */ N(hf, {
|
|
8763
8757
|
value: e.sentiment,
|
|
8764
8758
|
disabled: !n,
|
|
8765
8759
|
onChange: (n) => t({
|
|
@@ -8772,7 +8766,7 @@ function jf({ widget: e, onChange: t }) {
|
|
|
8772
8766
|
}
|
|
8773
8767
|
//#endregion
|
|
8774
8768
|
//#region src/dashboards/editor/SeriesListEditor.tsx
|
|
8775
|
-
var
|
|
8769
|
+
var jf = "stack", Mf = [
|
|
8776
8770
|
{
|
|
8777
8771
|
value: "line",
|
|
8778
8772
|
label: "Line"
|
|
@@ -8785,9 +8779,9 @@ var Mf = "stack", Nf = [
|
|
|
8785
8779
|
value: "bar",
|
|
8786
8780
|
label: "Bars"
|
|
8787
8781
|
}
|
|
8788
|
-
],
|
|
8789
|
-
function
|
|
8790
|
-
let n = e.length > 1, r = n ?
|
|
8782
|
+
], Nf = "grid grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)_minmax(0,1.2fr)_minmax(0,0.9fr)_minmax(0,1.1fr)_2rem]", Pf = "grid grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)_minmax(0,1.2fr)_minmax(0,0.9fr)_minmax(0,1.1fr)_minmax(0,0.8fr)_2rem]";
|
|
8783
|
+
function Ff({ series: e, onChange: t }) {
|
|
8784
|
+
let n = e.length > 1, r = n ? Pf : Nf, i = (n, r) => {
|
|
8791
8785
|
t(e.map((e, t) => t === n ? {
|
|
8792
8786
|
...e,
|
|
8793
8787
|
...r
|
|
@@ -8802,7 +8796,7 @@ function If({ series: e, onChange: t }) {
|
|
|
8802
8796
|
}, o = (e, t) => {
|
|
8803
8797
|
i(e, { axisId: t === "right" ? "right" : void 0 });
|
|
8804
8798
|
}, s = (e, t) => {
|
|
8805
|
-
i(e, { stackId: t ?
|
|
8799
|
+
i(e, { stackId: t ? jf : void 0 });
|
|
8806
8800
|
}, c = (e, t) => {
|
|
8807
8801
|
i(e, {
|
|
8808
8802
|
representation: t,
|
|
@@ -8840,16 +8834,16 @@ function If({ series: e, onChange: t }) {
|
|
|
8840
8834
|
e.map((t, l) => /* @__PURE__ */ P("div", {
|
|
8841
8835
|
className: `${r} items-center gap-1.5`,
|
|
8842
8836
|
children: [
|
|
8843
|
-
/* @__PURE__ */ N(
|
|
8837
|
+
/* @__PURE__ */ N(xf, {
|
|
8844
8838
|
value: t.metric,
|
|
8845
8839
|
onChange: (e) => a(l, e)
|
|
8846
8840
|
}),
|
|
8847
|
-
/* @__PURE__ */ N(
|
|
8841
|
+
/* @__PURE__ */ N(bf, {
|
|
8848
8842
|
value: t.measure,
|
|
8849
8843
|
metric: t.metric,
|
|
8850
8844
|
onChange: (e) => i(l, { measure: e })
|
|
8851
8845
|
}),
|
|
8852
|
-
/* @__PURE__ */ N(
|
|
8846
|
+
/* @__PURE__ */ N(vf, {
|
|
8853
8847
|
allowNone: !0,
|
|
8854
8848
|
value: t.by?.[0],
|
|
8855
8849
|
onChange: (e) => i(l, { by: e ? [e] : void 0 })
|
|
@@ -8861,7 +8855,7 @@ function If({ series: e, onChange: t }) {
|
|
|
8861
8855
|
className: "w-full",
|
|
8862
8856
|
"aria-label": "Representation",
|
|
8863
8857
|
children: /* @__PURE__ */ N(W, {})
|
|
8864
|
-
}), /* @__PURE__ */ N(V, { children:
|
|
8858
|
+
}), /* @__PURE__ */ N(V, { children: Mf.map((e) => /* @__PURE__ */ N(H, {
|
|
8865
8859
|
value: e.value,
|
|
8866
8860
|
children: e.label
|
|
8867
8861
|
}, e.value)) })]
|
|
@@ -8923,12 +8917,12 @@ function If({ series: e, onChange: t }) {
|
|
|
8923
8917
|
}
|
|
8924
8918
|
//#endregion
|
|
8925
8919
|
//#region src/dashboards/editor/VisualizationTypePicker.tsx
|
|
8926
|
-
var
|
|
8920
|
+
var If = [
|
|
8927
8921
|
{
|
|
8928
8922
|
type: "cartesian",
|
|
8929
8923
|
label: "Timeseries",
|
|
8930
8924
|
description: "Lines, bars or areas over time",
|
|
8931
|
-
icon:
|
|
8925
|
+
icon: re
|
|
8932
8926
|
},
|
|
8933
8927
|
{
|
|
8934
8928
|
type: "bar",
|
|
@@ -8961,7 +8955,7 @@ var Lf = [
|
|
|
8961
8955
|
icon: _e
|
|
8962
8956
|
}
|
|
8963
8957
|
];
|
|
8964
|
-
function
|
|
8958
|
+
function Lf({ value: e, onChange: t }) {
|
|
8965
8959
|
return /* @__PURE__ */ N(nn, {
|
|
8966
8960
|
type: "single",
|
|
8967
8961
|
value: e,
|
|
@@ -8969,7 +8963,7 @@ function Rf({ value: e, onChange: t }) {
|
|
|
8969
8963
|
variant: "outline",
|
|
8970
8964
|
"aria-label": "Visualization type",
|
|
8971
8965
|
className: "grid grid-cols-3 gap-2 sm:grid-cols-6",
|
|
8972
|
-
children:
|
|
8966
|
+
children: If.map((e) => {
|
|
8973
8967
|
let t = e.icon;
|
|
8974
8968
|
return /* @__PURE__ */ P(rn, {
|
|
8975
8969
|
value: e.type,
|
|
@@ -8985,12 +8979,12 @@ function Rf({ value: e, onChange: t }) {
|
|
|
8985
8979
|
}
|
|
8986
8980
|
//#endregion
|
|
8987
8981
|
//#region src/dashboards/editor/convert-widget-type.ts
|
|
8988
|
-
var
|
|
8989
|
-
function
|
|
8982
|
+
var Rf = "HTTP_REQUESTS", zf = "COUNT", Bf = "API";
|
|
8983
|
+
function Vf(e) {
|
|
8990
8984
|
if (Xn(e)) {
|
|
8991
8985
|
let t = e.series[0];
|
|
8992
8986
|
return {
|
|
8993
|
-
metric: t?.metric ??
|
|
8987
|
+
metric: t?.metric ?? Rf,
|
|
8994
8988
|
measure: t?.measure,
|
|
8995
8989
|
by: t?.by?.[0]
|
|
8996
8990
|
};
|
|
@@ -9003,20 +8997,20 @@ function Hf(e) {
|
|
|
9003
8997
|
if (e.type === "metric-group") {
|
|
9004
8998
|
let t = e.items[0];
|
|
9005
8999
|
return {
|
|
9006
|
-
metric: t?.metric ??
|
|
9000
|
+
metric: t?.metric ?? Rf,
|
|
9007
9001
|
measure: t?.measure,
|
|
9008
9002
|
by: void 0
|
|
9009
9003
|
};
|
|
9010
9004
|
}
|
|
9011
9005
|
return {
|
|
9012
|
-
metric: e.metric ??
|
|
9006
|
+
metric: e.metric ?? Rf,
|
|
9013
9007
|
measure: e.measure,
|
|
9014
9008
|
by: e.by[0]
|
|
9015
9009
|
};
|
|
9016
9010
|
}
|
|
9017
|
-
function
|
|
9011
|
+
function Hf(e, t) {
|
|
9018
9012
|
if (e.type === t) return e;
|
|
9019
|
-
let { metric: n, measure: r, by: i } =
|
|
9013
|
+
let { metric: n, measure: r, by: i } = Vf(e), a = {
|
|
9020
9014
|
id: e.id,
|
|
9021
9015
|
title: e.title,
|
|
9022
9016
|
...e.description !== void 0 && { description: e.description },
|
|
@@ -9029,7 +9023,7 @@ function Uf(e, t) {
|
|
|
9029
9023
|
type: t,
|
|
9030
9024
|
series: [{
|
|
9031
9025
|
metric: n,
|
|
9032
|
-
measure: r ??
|
|
9026
|
+
measure: r ?? zf,
|
|
9033
9027
|
representation: "line",
|
|
9034
9028
|
...i !== void 0 && { by: [i] },
|
|
9035
9029
|
...Wo(n)?.unit !== void 0 && { unit: Wo(n)?.unit }
|
|
@@ -9038,45 +9032,45 @@ function Uf(e, t) {
|
|
|
9038
9032
|
case "bar": return {
|
|
9039
9033
|
...a,
|
|
9040
9034
|
type: t,
|
|
9041
|
-
by: [i ??
|
|
9035
|
+
by: [i ?? Bf],
|
|
9042
9036
|
metric: n,
|
|
9043
|
-
measure: r ??
|
|
9037
|
+
measure: r ?? zf,
|
|
9044
9038
|
limit: 5,
|
|
9045
9039
|
sorts: [{
|
|
9046
|
-
measure: r ??
|
|
9040
|
+
measure: r ?? zf,
|
|
9047
9041
|
order: "DESC"
|
|
9048
9042
|
}]
|
|
9049
9043
|
};
|
|
9050
9044
|
case "doughnut": return {
|
|
9051
9045
|
...a,
|
|
9052
9046
|
type: t,
|
|
9053
|
-
by: [i ??
|
|
9047
|
+
by: [i ?? Bf],
|
|
9054
9048
|
metric: n,
|
|
9055
|
-
measure: r ??
|
|
9049
|
+
measure: r ?? zf,
|
|
9056
9050
|
limit: 5,
|
|
9057
9051
|
sorts: [{
|
|
9058
|
-
measure: r ??
|
|
9052
|
+
measure: r ?? zf,
|
|
9059
9053
|
order: "DESC"
|
|
9060
9054
|
}]
|
|
9061
9055
|
};
|
|
9062
9056
|
case "breakdown": return {
|
|
9063
9057
|
...a,
|
|
9064
9058
|
type: t,
|
|
9065
|
-
by: [i ??
|
|
9059
|
+
by: [i ?? Bf],
|
|
9066
9060
|
metric: n,
|
|
9067
|
-
measure: r ??
|
|
9061
|
+
measure: r ?? zf,
|
|
9068
9062
|
limit: 5,
|
|
9069
9063
|
sorts: [{
|
|
9070
|
-
measure: r ??
|
|
9064
|
+
measure: r ?? zf,
|
|
9071
9065
|
order: "DESC"
|
|
9072
9066
|
}],
|
|
9073
|
-
variant:
|
|
9067
|
+
variant: Id
|
|
9074
9068
|
};
|
|
9075
9069
|
case "metric": return {
|
|
9076
9070
|
...a,
|
|
9077
9071
|
type: t,
|
|
9078
9072
|
metric: n,
|
|
9079
|
-
measure: r ??
|
|
9073
|
+
measure: r ?? zf,
|
|
9080
9074
|
showTrend: !0,
|
|
9081
9075
|
sentiment: "neutral"
|
|
9082
9076
|
};
|
|
@@ -9085,7 +9079,7 @@ function Uf(e, t) {
|
|
|
9085
9079
|
type: t,
|
|
9086
9080
|
items: [{
|
|
9087
9081
|
metric: n,
|
|
9088
|
-
measure: r ??
|
|
9082
|
+
measure: r ?? zf,
|
|
9089
9083
|
sentiment: "neutral"
|
|
9090
9084
|
}]
|
|
9091
9085
|
};
|
|
@@ -9093,7 +9087,7 @@ function Uf(e, t) {
|
|
|
9093
9087
|
}
|
|
9094
9088
|
//#endregion
|
|
9095
9089
|
//#region src/dashboards/editor/widget-auto-scope.ts
|
|
9096
|
-
function
|
|
9090
|
+
function Uf(e) {
|
|
9097
9091
|
switch (e.type) {
|
|
9098
9092
|
case "cartesian": return {
|
|
9099
9093
|
metrics: e.series.map((e) => e.metric),
|
|
@@ -9113,13 +9107,13 @@ function Wf(e) {
|
|
|
9113
9107
|
};
|
|
9114
9108
|
}
|
|
9115
9109
|
}
|
|
9116
|
-
function
|
|
9117
|
-
let n =
|
|
9110
|
+
function Wf(e, t) {
|
|
9111
|
+
let n = Uf(e), r = Uf(t);
|
|
9118
9112
|
return n.metrics.join() === r.metrics.join() && n.dimensions.join() === r.dimensions.join();
|
|
9119
9113
|
}
|
|
9120
|
-
function
|
|
9121
|
-
if (
|
|
9122
|
-
let n = Qo(t.filters,
|
|
9114
|
+
function Gf(e, t) {
|
|
9115
|
+
if (Wf(e, t)) return t;
|
|
9116
|
+
let n = Qo(t.filters, Uf(t));
|
|
9123
9117
|
return n === t.filters ? t : {
|
|
9124
9118
|
...t,
|
|
9125
9119
|
...n === void 0 ? {} : { filters: n }
|
|
@@ -9127,14 +9121,14 @@ function Kf(e, t) {
|
|
|
9127
9121
|
}
|
|
9128
9122
|
//#endregion
|
|
9129
9123
|
//#region src/dashboards/editor/WidgetConfigForm.tsx
|
|
9130
|
-
var
|
|
9131
|
-
function
|
|
9124
|
+
var Kf = "flex flex-col gap-5 pt-4";
|
|
9125
|
+
function qf(e) {
|
|
9132
9126
|
return e !== "metric-group" && e !== "metric";
|
|
9133
9127
|
}
|
|
9134
|
-
function
|
|
9135
|
-
let [n, r] = j("data"), i =
|
|
9128
|
+
function Jf({ widget: e, onChange: t }) {
|
|
9129
|
+
let [n, r] = j("data"), i = qf(e.type), a = e.filters?.length ?? 0;
|
|
9136
9130
|
n === "display" && !i && r("data");
|
|
9137
|
-
let o = (n) => t(
|
|
9131
|
+
let o = (n) => t(Gf(e, n)), s = (t) => o(Hf(e, t)), c = (n) => {
|
|
9138
9132
|
t({
|
|
9139
9133
|
...e,
|
|
9140
9134
|
...n.length > 0 ? { filters: n } : { filters: void 0 }
|
|
@@ -9142,7 +9136,7 @@ function Yf({ widget: e, onChange: t }) {
|
|
|
9142
9136
|
};
|
|
9143
9137
|
return /* @__PURE__ */ P("div", {
|
|
9144
9138
|
className: "flex flex-col gap-5",
|
|
9145
|
-
children: [/* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Visualization" }), /* @__PURE__ */ N(
|
|
9139
|
+
children: [/* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Visualization" }), /* @__PURE__ */ N(Lf, {
|
|
9146
9140
|
value: e.type,
|
|
9147
9141
|
onChange: s
|
|
9148
9142
|
})] }), /* @__PURE__ */ P(Zt, {
|
|
@@ -9172,23 +9166,23 @@ function Yf({ widget: e, onChange: t }) {
|
|
|
9172
9166
|
}),
|
|
9173
9167
|
/* @__PURE__ */ N(Qt, {
|
|
9174
9168
|
value: "data",
|
|
9175
|
-
className:
|
|
9176
|
-
children: /* @__PURE__ */ N(
|
|
9169
|
+
className: Kf,
|
|
9170
|
+
children: /* @__PURE__ */ N(Yf, {
|
|
9177
9171
|
widget: e,
|
|
9178
9172
|
onChange: o
|
|
9179
9173
|
})
|
|
9180
9174
|
}),
|
|
9181
9175
|
i && /* @__PURE__ */ N(Qt, {
|
|
9182
9176
|
value: "display",
|
|
9183
|
-
className:
|
|
9184
|
-
children: /* @__PURE__ */ N(
|
|
9177
|
+
className: Kf,
|
|
9178
|
+
children: /* @__PURE__ */ N(Xf, {
|
|
9185
9179
|
widget: e,
|
|
9186
9180
|
onChange: o
|
|
9187
9181
|
})
|
|
9188
9182
|
}),
|
|
9189
9183
|
/* @__PURE__ */ N(Qt, {
|
|
9190
9184
|
value: "filters",
|
|
9191
|
-
className:
|
|
9185
|
+
className: Kf,
|
|
9192
9186
|
children: /* @__PURE__ */ P(R, { children: [
|
|
9193
9187
|
/* @__PURE__ */ N(Ft, { children: "Widget filters" }),
|
|
9194
9188
|
/* @__PURE__ */ N(Mt, { children: "Applied only to this widget, on top of the dashboard filters." }),
|
|
@@ -9203,41 +9197,41 @@ function Yf({ widget: e, onChange: t }) {
|
|
|
9203
9197
|
})]
|
|
9204
9198
|
});
|
|
9205
9199
|
}
|
|
9206
|
-
function
|
|
9200
|
+
function Yf({ widget: e, onChange: t }) {
|
|
9207
9201
|
switch (e.type) {
|
|
9208
|
-
case "cartesian": return /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Series" }), /* @__PURE__ */ N(
|
|
9202
|
+
case "cartesian": return /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Series" }), /* @__PURE__ */ N(Ff, {
|
|
9209
9203
|
series: e.series,
|
|
9210
9204
|
onChange: (n) => t({
|
|
9211
9205
|
...e,
|
|
9212
9206
|
series: n
|
|
9213
9207
|
})
|
|
9214
9208
|
})] });
|
|
9215
|
-
case "metric": return /* @__PURE__ */ N(
|
|
9209
|
+
case "metric": return /* @__PURE__ */ N(Af, {
|
|
9216
9210
|
widget: e,
|
|
9217
9211
|
onChange: t
|
|
9218
9212
|
});
|
|
9219
|
-
case "metric-group": return /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Metrics" }), /* @__PURE__ */ N(
|
|
9213
|
+
case "metric-group": return /* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, { children: "Metrics" }), /* @__PURE__ */ N(Of, {
|
|
9220
9214
|
items: e.items,
|
|
9221
9215
|
onChange: (n) => t({
|
|
9222
9216
|
...e,
|
|
9223
9217
|
items: n
|
|
9224
9218
|
})
|
|
9225
9219
|
})] });
|
|
9226
|
-
default: return /* @__PURE__ */ N(
|
|
9220
|
+
default: return /* @__PURE__ */ N(Tf, {
|
|
9227
9221
|
widget: e,
|
|
9228
9222
|
onChange: t
|
|
9229
9223
|
});
|
|
9230
9224
|
}
|
|
9231
9225
|
}
|
|
9232
|
-
function
|
|
9226
|
+
function Xf({ widget: e, onChange: t }) {
|
|
9233
9227
|
switch (e.type) {
|
|
9234
|
-
case "cartesian": return /* @__PURE__ */ N(
|
|
9228
|
+
case "cartesian": return /* @__PURE__ */ N(cf, {
|
|
9235
9229
|
widget: e,
|
|
9236
9230
|
onChange: t
|
|
9237
9231
|
});
|
|
9238
9232
|
case "metric":
|
|
9239
9233
|
case "metric-group": return null;
|
|
9240
|
-
default: return /* @__PURE__ */ N(
|
|
9234
|
+
default: return /* @__PURE__ */ N(gf, {
|
|
9241
9235
|
widget: e,
|
|
9242
9236
|
onChange: t
|
|
9243
9237
|
});
|
|
@@ -9245,7 +9239,7 @@ function Zf({ widget: e, onChange: t }) {
|
|
|
9245
9239
|
}
|
|
9246
9240
|
//#endregion
|
|
9247
9241
|
//#region src/dashboards/editor/WidgetIdentityFields.tsx
|
|
9248
|
-
function
|
|
9242
|
+
function Zf({ widget: e, onChange: t }) {
|
|
9249
9243
|
let n = Be(), r = Be();
|
|
9250
9244
|
return /* @__PURE__ */ P(Pt, { children: [/* @__PURE__ */ P(R, { children: [/* @__PURE__ */ N(Ft, {
|
|
9251
9245
|
htmlFor: n,
|
|
@@ -9276,7 +9270,7 @@ function Qf({ widget: e, onChange: t }) {
|
|
|
9276
9270
|
}
|
|
9277
9271
|
//#endregion
|
|
9278
9272
|
//#region src/dashboards/editor/suggest-widget-title.ts
|
|
9279
|
-
function
|
|
9273
|
+
function Qf(e) {
|
|
9280
9274
|
switch (e.type) {
|
|
9281
9275
|
case "cartesian": {
|
|
9282
9276
|
let t = e.series[0];
|
|
@@ -9294,7 +9288,7 @@ function $f(e) {
|
|
|
9294
9288
|
}
|
|
9295
9289
|
//#endregion
|
|
9296
9290
|
//#region src/dashboards/editor/use-debounced-value.ts
|
|
9297
|
-
function
|
|
9291
|
+
function $f(e, t) {
|
|
9298
9292
|
let [n, r] = j(e);
|
|
9299
9293
|
return O(() => {
|
|
9300
9294
|
let n = setTimeout(() => r(e), t);
|
|
@@ -9303,15 +9297,15 @@ function ep(e, t) {
|
|
|
9303
9297
|
}
|
|
9304
9298
|
//#endregion
|
|
9305
9299
|
//#region src/dashboards/editor/WidgetPreview.tsx
|
|
9306
|
-
var
|
|
9307
|
-
function
|
|
9308
|
-
let t = e *
|
|
9309
|
-
return Math.min(
|
|
9300
|
+
var ep = 450, tp = 150, np = 16, rp = .86, ip = 229, ap = 458;
|
|
9301
|
+
function op(e) {
|
|
9302
|
+
let t = e * tp + Math.max(0, e - 1) * np;
|
|
9303
|
+
return Math.min(ap, Math.max(ip, Math.round(t * rp)));
|
|
9310
9304
|
}
|
|
9311
|
-
function
|
|
9312
|
-
let r =
|
|
9305
|
+
function sp({ widget: e, timeRange: t, dashboardFilters: n }) {
|
|
9306
|
+
let r = $f(e, ep), i = k(() => Or(n), [n]), a = r.title.trim() || Qf(r), o = r.type === "cartesian" || r.type === "doughnut" || r.type === "bar";
|
|
9313
9307
|
return /* @__PURE__ */ N("div", {
|
|
9314
|
-
style: { height:
|
|
9308
|
+
style: { height: op(r.layout.rows) },
|
|
9315
9309
|
children: /* @__PURE__ */ N(Nn, {
|
|
9316
9310
|
title: a,
|
|
9317
9311
|
subtitle: r.description,
|
|
@@ -9326,11 +9320,11 @@ function cp({ widget: e, timeRange: t, dashboardFilters: n }) {
|
|
|
9326
9320
|
}
|
|
9327
9321
|
//#endregion
|
|
9328
9322
|
//#region src/dashboards/editor/normalize-widget-for-editor.ts
|
|
9329
|
-
var
|
|
9330
|
-
function
|
|
9323
|
+
var cp = "neutral";
|
|
9324
|
+
function lp(e) {
|
|
9331
9325
|
switch (e.type) {
|
|
9332
9326
|
case "metric": {
|
|
9333
|
-
let t = e.sentiment ??
|
|
9327
|
+
let t = e.sentiment ?? cp;
|
|
9334
9328
|
return t === e.sentiment ? e : {
|
|
9335
9329
|
...e,
|
|
9336
9330
|
sentiment: t
|
|
@@ -9338,7 +9332,7 @@ function up(e) {
|
|
|
9338
9332
|
}
|
|
9339
9333
|
case "metric-group": {
|
|
9340
9334
|
let t = !1, n = e.items.map((e) => {
|
|
9341
|
-
let n = e.sentiment ??
|
|
9335
|
+
let n = e.sentiment ?? cp;
|
|
9342
9336
|
return n === e.sentiment ? e : (t = !0, {
|
|
9343
9337
|
...e,
|
|
9344
9338
|
sentiment: n
|
|
@@ -9354,14 +9348,14 @@ function up(e) {
|
|
|
9354
9348
|
}
|
|
9355
9349
|
//#endregion
|
|
9356
9350
|
//#region src/dashboards/editor/WidgetEditorPanel.tsx
|
|
9357
|
-
function
|
|
9358
|
-
let [c, l] = j(() => t ?
|
|
9351
|
+
function up({ open: e, widget: t, isNew: n, timeRange: r, dashboardFilters: i, onSave: a, onCancel: o, onDirtyChange: s }) {
|
|
9352
|
+
let [c, l] = j(() => t ? lp(t) : null), [u, d] = j(c), [f, p] = j(!1), [m, h] = j(t);
|
|
9359
9353
|
if (t !== m) {
|
|
9360
|
-
let e = t ?
|
|
9354
|
+
let e = t ? lp(t) : null;
|
|
9361
9355
|
h(t), l(e), d(e);
|
|
9362
9356
|
}
|
|
9363
9357
|
!e && f && p(!1);
|
|
9364
|
-
let g = e && !
|
|
9358
|
+
let g = e && !Od(u, c);
|
|
9365
9359
|
O(() => {
|
|
9366
9360
|
s?.(g);
|
|
9367
9361
|
}, [g, s]);
|
|
@@ -9369,7 +9363,7 @@ function dp({ open: e, widget: t, isNew: n, timeRange: r, dashboardFilters: i, o
|
|
|
9369
9363
|
p(!1), o();
|
|
9370
9364
|
}, [o]), v = D(() => {
|
|
9371
9365
|
if (!u) return;
|
|
9372
|
-
let e = u.title.trim() ||
|
|
9366
|
+
let e = u.title.trim() || Qf(u);
|
|
9373
9367
|
a({
|
|
9374
9368
|
...u,
|
|
9375
9369
|
title: e
|
|
@@ -9433,14 +9427,14 @@ function dp({ open: e, widget: t, isNew: n, timeRange: r, dashboardFilters: i, o
|
|
|
9433
9427
|
children: [
|
|
9434
9428
|
/* @__PURE__ */ N("div", {
|
|
9435
9429
|
className: "px-4 pt-4 pb-3",
|
|
9436
|
-
children: /* @__PURE__ */ N(
|
|
9430
|
+
children: /* @__PURE__ */ N(Zf, {
|
|
9437
9431
|
widget: u,
|
|
9438
9432
|
onChange: d
|
|
9439
9433
|
})
|
|
9440
9434
|
}),
|
|
9441
9435
|
/* @__PURE__ */ N("div", {
|
|
9442
9436
|
className: "sticky top-0 z-10 border-y border-border bg-background/95 px-4 py-3 backdrop-blur-sm",
|
|
9443
|
-
children: /* @__PURE__ */ N(
|
|
9437
|
+
children: /* @__PURE__ */ N(sp, {
|
|
9444
9438
|
widget: u,
|
|
9445
9439
|
timeRange: r,
|
|
9446
9440
|
dashboardFilters: i
|
|
@@ -9448,7 +9442,7 @@ function dp({ open: e, widget: t, isNew: n, timeRange: r, dashboardFilters: i, o
|
|
|
9448
9442
|
}),
|
|
9449
9443
|
/* @__PURE__ */ N("div", {
|
|
9450
9444
|
className: "p-4",
|
|
9451
|
-
children: /* @__PURE__ */ N(
|
|
9445
|
+
children: /* @__PURE__ */ N(Jf, {
|
|
9452
9446
|
widget: u,
|
|
9453
9447
|
onChange: d
|
|
9454
9448
|
})
|
|
@@ -9472,13 +9466,13 @@ function dp({ open: e, widget: t, isNew: n, timeRange: r, dashboardFilters: i, o
|
|
|
9472
9466
|
}
|
|
9473
9467
|
//#endregion
|
|
9474
9468
|
//#region src/dashboards/editor/locked-filter-conflicts.ts
|
|
9475
|
-
function
|
|
9476
|
-
let n = new Map(e.filter(
|
|
9469
|
+
function dp(e, t) {
|
|
9470
|
+
let n = new Map(e.filter(gd).map((e) => [e.field, e]));
|
|
9477
9471
|
if (n.size === 0) return [];
|
|
9478
9472
|
let r = [];
|
|
9479
9473
|
for (let e of t) for (let t of e.filters ?? []) {
|
|
9480
9474
|
let i = n.get(t.field);
|
|
9481
|
-
!i ||
|
|
9475
|
+
!i || fp(i.value, t.value) || r.push({
|
|
9482
9476
|
widgetId: e.id,
|
|
9483
9477
|
widgetTitle: e.title || e.id,
|
|
9484
9478
|
field: t.field,
|
|
@@ -9491,32 +9485,32 @@ function fp(e, t) {
|
|
|
9491
9485
|
}
|
|
9492
9486
|
return r;
|
|
9493
9487
|
}
|
|
9494
|
-
function
|
|
9488
|
+
function fp(e, t) {
|
|
9495
9489
|
if (e.length !== t.length) return !1;
|
|
9496
9490
|
let n = [...t].sort();
|
|
9497
9491
|
return [...e].sort().every((e, t) => e === n[t]);
|
|
9498
9492
|
}
|
|
9499
9493
|
//#endregion
|
|
9500
9494
|
//#region src/dashboards/editor/DashboardEditorPage.tsx
|
|
9501
|
-
function
|
|
9495
|
+
function pp({ scopeFilterField: e }) {
|
|
9502
9496
|
let { dashboardId: t } = Bn();
|
|
9503
9497
|
return /* @__PURE__ */ N(ar, {
|
|
9504
9498
|
config: { defaultEnabled: !1 },
|
|
9505
|
-
children: t ? /* @__PURE__ */ N(
|
|
9499
|
+
children: t ? /* @__PURE__ */ N(hp, {
|
|
9506
9500
|
dashboardId: t,
|
|
9507
9501
|
scopeFilterField: e
|
|
9508
|
-
}) : /* @__PURE__ */ N(
|
|
9502
|
+
}) : /* @__PURE__ */ N(mp, { scopeFilterField: e })
|
|
9509
9503
|
});
|
|
9510
9504
|
}
|
|
9511
|
-
function
|
|
9512
|
-
let [t] = j(() =>
|
|
9513
|
-
return /* @__PURE__ */ N(
|
|
9505
|
+
function mp({ scopeFilterField: e }) {
|
|
9506
|
+
let [t] = j(() => Vd());
|
|
9507
|
+
return /* @__PURE__ */ N(gp, {
|
|
9514
9508
|
initial: t,
|
|
9515
9509
|
mode: "create",
|
|
9516
9510
|
scopeFilterField: e
|
|
9517
9511
|
});
|
|
9518
9512
|
}
|
|
9519
|
-
function
|
|
9513
|
+
function hp({ dashboardId: e, scopeFilterField: t }) {
|
|
9520
9514
|
let { data: n, isLoading: r, isError: i } = rd(e);
|
|
9521
9515
|
return r ? /* @__PURE__ */ P("div", {
|
|
9522
9516
|
className: "flex flex-col gap-4 p-4",
|
|
@@ -9532,61 +9526,53 @@ function gp({ dashboardId: e, scopeFilterField: t }) {
|
|
|
9532
9526
|
e,
|
|
9533
9527
|
"\" was not found. It may have been deleted."
|
|
9534
9528
|
]
|
|
9535
|
-
}) : /* @__PURE__ */ N(
|
|
9529
|
+
}) : /* @__PURE__ */ N(gp, {
|
|
9536
9530
|
initial: n,
|
|
9537
9531
|
mode: "edit",
|
|
9538
9532
|
scopeFilterField: t
|
|
9539
9533
|
}, n.id);
|
|
9540
9534
|
}
|
|
9541
|
-
function
|
|
9542
|
-
let r = zn(), [i, a] = He(
|
|
9535
|
+
function gp({ initial: e, mode: t, scopeFilterField: n }) {
|
|
9536
|
+
let r = zn(), [i, a] = He(Md, e, kd), [o, s] = j(null), [c, l] = j("builder"), [u, d] = j(""), [f, p] = j(!1), [m] = Vn(), [h, g] = j(() => bi(m.get("q"), m.get("v"), { defaultTimeRange: e.timeRange }).timeRange), _ = A(!1), [v, y] = j(null), b = D((e) => {
|
|
9543
9537
|
if (o && _.current) {
|
|
9544
9538
|
y({ target: e });
|
|
9545
9539
|
return;
|
|
9546
9540
|
}
|
|
9547
9541
|
s(e);
|
|
9548
|
-
}, [o]), x =
|
|
9549
|
-
Ve(() => {
|
|
9550
|
-
t !== "edit" || C.current || (C.current = !0, x(e.id));
|
|
9551
|
-
}, [
|
|
9552
|
-
t,
|
|
9553
|
-
e.id,
|
|
9554
|
-
x
|
|
9555
|
-
]);
|
|
9556
|
-
let w = id(), ee = ad(), te = od(), ne = sd(), re = w.isPending || ee.isPending || te.isPending, T = i.draft, ae = jd(i), [oe, se] = j(null);
|
|
9542
|
+
}, [o]), x = id(), C = ad(), w = od(), ee = sd(), te = x.isPending || C.isPending || w.isPending, T = i.draft, ne = Ad(i), [re, ae] = j(null);
|
|
9557
9543
|
O(() => {
|
|
9558
|
-
if (!
|
|
9544
|
+
if (!ne) return;
|
|
9559
9545
|
let e = (e) => {
|
|
9560
9546
|
e.preventDefault();
|
|
9561
9547
|
};
|
|
9562
9548
|
return window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
|
|
9563
|
-
}, [
|
|
9564
|
-
let
|
|
9549
|
+
}, [ne]);
|
|
9550
|
+
let oe = D((e = "..") => {
|
|
9565
9551
|
r(e, { relative: "path" });
|
|
9566
|
-
}, [r]),
|
|
9567
|
-
if (
|
|
9552
|
+
}, [r]), se = D(() => {
|
|
9553
|
+
if (ne) {
|
|
9568
9554
|
p(!0);
|
|
9569
9555
|
return;
|
|
9570
9556
|
}
|
|
9571
|
-
|
|
9572
|
-
}, [
|
|
9557
|
+
oe();
|
|
9558
|
+
}, [ne, oe]), ce = (e) => t === "create" ? `../${e}` : `../../${e}`, ue = (e, t) => {
|
|
9573
9559
|
a({
|
|
9574
9560
|
type: "markSaved",
|
|
9575
9561
|
dashboard: e
|
|
9576
|
-
}), X.success(t), ce(
|
|
9577
|
-
},
|
|
9578
|
-
(t === "create" ?
|
|
9579
|
-
onSuccess: (e) =>
|
|
9562
|
+
}), X.success(t), oe(ce(e.id));
|
|
9563
|
+
}, de = () => {
|
|
9564
|
+
(t === "create" ? x : C).mutate(T, {
|
|
9565
|
+
onSuccess: (e) => ue(e, t === "create" ? "Dashboard created" : "Dashboard saved"),
|
|
9580
9566
|
onError: (e) => {
|
|
9581
9567
|
if (e instanceof Gu) {
|
|
9582
|
-
|
|
9568
|
+
ae({
|
|
9583
9569
|
theirs: e.currentDashboard,
|
|
9584
9570
|
deleted: !1
|
|
9585
9571
|
});
|
|
9586
9572
|
return;
|
|
9587
9573
|
}
|
|
9588
9574
|
if (t === "edit" && e instanceof Wu) {
|
|
9589
|
-
|
|
9575
|
+
ae({
|
|
9590
9576
|
theirs: null,
|
|
9591
9577
|
deleted: !0
|
|
9592
9578
|
});
|
|
@@ -9595,14 +9581,14 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9595
9581
|
X.error(`Could not save the dashboard: ${e.message}`);
|
|
9596
9582
|
}
|
|
9597
9583
|
});
|
|
9598
|
-
},
|
|
9599
|
-
|
|
9584
|
+
}, fe = () => {
|
|
9585
|
+
w.mutate(T, {
|
|
9600
9586
|
onSuccess: (e) => {
|
|
9601
|
-
|
|
9587
|
+
ae(null), ue(e, "Dashboard saved over the other version");
|
|
9602
9588
|
},
|
|
9603
9589
|
onError: (e) => {
|
|
9604
9590
|
if (e instanceof Wu) {
|
|
9605
|
-
|
|
9591
|
+
ae((e) => e && {
|
|
9606
9592
|
...e,
|
|
9607
9593
|
deleted: !0
|
|
9608
9594
|
});
|
|
@@ -9611,26 +9597,26 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9611
9597
|
X.error(`Could not overwrite the dashboard: ${e.message}`);
|
|
9612
9598
|
}
|
|
9613
9599
|
});
|
|
9614
|
-
},
|
|
9615
|
-
let e =
|
|
9616
|
-
e && (
|
|
9600
|
+
}, pe = () => {
|
|
9601
|
+
let e = re?.theirs;
|
|
9602
|
+
e && (ee(e), a({
|
|
9617
9603
|
type: "init",
|
|
9618
9604
|
dashboard: e
|
|
9619
|
-
}), d(
|
|
9620
|
-
},
|
|
9621
|
-
|
|
9605
|
+
}), d(Kd(e)), s(null), y(null), ae(null), X.success("Showing the version saved by the other author"));
|
|
9606
|
+
}, me = () => {
|
|
9607
|
+
x.mutate(Fd(T), {
|
|
9622
9608
|
onSuccess: (e) => {
|
|
9623
|
-
|
|
9609
|
+
ae(null), ue(e, `Saved as "${e.title}"`);
|
|
9624
9610
|
},
|
|
9625
9611
|
onError: (e) => X.error(`Could not save a copy: ${e.message}`)
|
|
9626
9612
|
});
|
|
9627
|
-
},
|
|
9613
|
+
}, he = (e) => e === "overwrite" ? fe() : e === "take-theirs" ? pe() : me(), ge = () => w.isPending ? "overwrite" : x.isPending ? "save-as-copy" : null, _e = (e) => {
|
|
9628
9614
|
if (s(null), y(null), e === "json") {
|
|
9629
|
-
d(
|
|
9615
|
+
d(Kd(T)), l("json");
|
|
9630
9616
|
return;
|
|
9631
9617
|
}
|
|
9632
|
-
if (u !==
|
|
9633
|
-
let e =
|
|
9618
|
+
if (u !== Kd(T)) {
|
|
9619
|
+
let e = qd(u);
|
|
9634
9620
|
if (!e.ok) {
|
|
9635
9621
|
X.error("Fix the JSON errors (or copy your changes) before going back to the builder.");
|
|
9636
9622
|
return;
|
|
@@ -9641,25 +9627,25 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9641
9627
|
}), X.success("JSON applied to the dashboard");
|
|
9642
9628
|
}
|
|
9643
9629
|
l("builder");
|
|
9644
|
-
},
|
|
9630
|
+
}, ve = (e) => {
|
|
9645
9631
|
a({
|
|
9646
9632
|
type: "replaceEditable",
|
|
9647
9633
|
fields: e
|
|
9648
|
-
}), d(
|
|
9634
|
+
}), d(Kd({
|
|
9649
9635
|
...T,
|
|
9650
9636
|
...e
|
|
9651
9637
|
}));
|
|
9652
|
-
},
|
|
9638
|
+
}, ye = () => {
|
|
9653
9639
|
b({
|
|
9654
|
-
widget:
|
|
9640
|
+
widget: zd("cartesian", Nd(), T.widgets),
|
|
9655
9641
|
isNew: !0
|
|
9656
9642
|
});
|
|
9657
|
-
},
|
|
9643
|
+
}, be = (e) => {
|
|
9658
9644
|
a({
|
|
9659
9645
|
type: "upsertWidget",
|
|
9660
9646
|
widget: e
|
|
9661
9647
|
}), s(null);
|
|
9662
|
-
},
|
|
9648
|
+
}, Se = D((e) => /* @__PURE__ */ P("div", {
|
|
9663
9649
|
className: "flex items-center gap-0.5",
|
|
9664
9650
|
children: [/* @__PURE__ */ N(L, {
|
|
9665
9651
|
variant: "ghost",
|
|
@@ -9693,7 +9679,7 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9693
9679
|
onSelect: () => a({
|
|
9694
9680
|
type: "duplicateWidget",
|
|
9695
9681
|
widgetId: e.id,
|
|
9696
|
-
newWidgetId:
|
|
9682
|
+
newWidgetId: Nd()
|
|
9697
9683
|
}),
|
|
9698
9684
|
children: [/* @__PURE__ */ N(E, { className: "size-4" }), "Duplicate"]
|
|
9699
9685
|
}),
|
|
@@ -9708,13 +9694,13 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9708
9694
|
})
|
|
9709
9695
|
]
|
|
9710
9696
|
})] })]
|
|
9711
|
-
}), [b]),
|
|
9697
|
+
}), [b]), Ce = k(() => Yu([...T.filters ?? [], ...T.widgets.flatMap((e) => e.filters ?? [])]), [T.filters, T.widgets]), Ee = ja(T.filters), Oe = k(() => dp(Ee, T.widgets), [Ee, T.widgets]), ke = k(() => Od(h, T.timeRange), [h, T.timeRange]);
|
|
9712
9698
|
return /* @__PURE__ */ P("div", {
|
|
9713
9699
|
className: "flex flex-col gap-4 p-4",
|
|
9714
9700
|
children: [
|
|
9715
9701
|
/* @__PURE__ */ P(Zt, {
|
|
9716
9702
|
value: c,
|
|
9717
|
-
onValueChange:
|
|
9703
|
+
onValueChange: _e,
|
|
9718
9704
|
className: "flex flex-col gap-4",
|
|
9719
9705
|
children: [
|
|
9720
9706
|
/* @__PURE__ */ P("div", {
|
|
@@ -9725,11 +9711,11 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9725
9711
|
variant: "ghost",
|
|
9726
9712
|
size: "icon",
|
|
9727
9713
|
"aria-label": "Back",
|
|
9728
|
-
onClick:
|
|
9714
|
+
onClick: se,
|
|
9729
9715
|
children: /* @__PURE__ */ N(S, { className: "size-4" })
|
|
9730
9716
|
}), /* @__PURE__ */ P("div", {
|
|
9731
9717
|
className: "flex min-w-0 flex-col gap-0.5",
|
|
9732
|
-
children: [/* @__PURE__ */ N(
|
|
9718
|
+
children: [/* @__PURE__ */ N(sf, {
|
|
9733
9719
|
value: T.title,
|
|
9734
9720
|
onChange: (e) => a({
|
|
9735
9721
|
type: "setTitle",
|
|
@@ -9739,7 +9725,7 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9739
9725
|
ariaLabel: "Dashboard title",
|
|
9740
9726
|
textClassName: "text-lg font-semibold",
|
|
9741
9727
|
inputClassName: "h-8 w-96 text-lg font-semibold"
|
|
9742
|
-
}), /* @__PURE__ */ N(
|
|
9728
|
+
}), /* @__PURE__ */ N(sf, {
|
|
9743
9729
|
value: T.description ?? "",
|
|
9744
9730
|
onChange: (e) => a({
|
|
9745
9731
|
type: "setDescription",
|
|
@@ -9763,13 +9749,13 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9763
9749
|
})] }),
|
|
9764
9750
|
/* @__PURE__ */ N(L, {
|
|
9765
9751
|
variant: "outline",
|
|
9766
|
-
onClick:
|
|
9752
|
+
onClick: se,
|
|
9767
9753
|
children: "Cancel"
|
|
9768
9754
|
}),
|
|
9769
9755
|
/* @__PURE__ */ N(L, {
|
|
9770
|
-
onClick:
|
|
9771
|
-
disabled:
|
|
9772
|
-
children:
|
|
9756
|
+
onClick: de,
|
|
9757
|
+
disabled: te || !ne && t === "edit",
|
|
9758
|
+
children: te ? "Saving…" : "Save"
|
|
9773
9759
|
})
|
|
9774
9760
|
]
|
|
9775
9761
|
})]
|
|
@@ -9783,7 +9769,7 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9783
9769
|
children: [
|
|
9784
9770
|
/* @__PURE__ */ N("div", {
|
|
9785
9771
|
className: "flex flex-1 items-center gap-2",
|
|
9786
|
-
children: /* @__PURE__ */ N(
|
|
9772
|
+
children: /* @__PURE__ */ N(wd, {
|
|
9787
9773
|
filters: T.filters,
|
|
9788
9774
|
scopeFilterField: n,
|
|
9789
9775
|
onChange: (e) => a({
|
|
@@ -9795,7 +9781,7 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9795
9781
|
/* @__PURE__ */ P("div", {
|
|
9796
9782
|
className: "flex items-center gap-1.5",
|
|
9797
9783
|
children: [
|
|
9798
|
-
!
|
|
9784
|
+
!ke && /* @__PURE__ */ P(L, {
|
|
9799
9785
|
variant: "ghost",
|
|
9800
9786
|
size: "sm",
|
|
9801
9787
|
className: "text-xs",
|
|
@@ -9808,7 +9794,7 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9808
9794
|
},
|
|
9809
9795
|
children: [/* @__PURE__ */ N(le, { className: "size-3.5" }), "Set as default"]
|
|
9810
9796
|
}),
|
|
9811
|
-
|
|
9797
|
+
ke && /* @__PURE__ */ P("span", {
|
|
9812
9798
|
className: "flex items-center gap-1 text-xs text-muted-foreground",
|
|
9813
9799
|
title: "This is the dashboard default range",
|
|
9814
9800
|
children: [/* @__PURE__ */ N(ie, { className: "size-3.5" }), "Default"]
|
|
@@ -9820,25 +9806,25 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9820
9806
|
]
|
|
9821
9807
|
}),
|
|
9822
9808
|
/* @__PURE__ */ P(L, {
|
|
9823
|
-
onClick:
|
|
9809
|
+
onClick: ye,
|
|
9824
9810
|
children: [/* @__PURE__ */ N(Te, { className: "size-4" }), "Add widget"]
|
|
9825
9811
|
})
|
|
9826
9812
|
]
|
|
9827
9813
|
}),
|
|
9828
|
-
|
|
9814
|
+
Ce.length > 0 && /* @__PURE__ */ P(Qe, {
|
|
9829
9815
|
variant: "destructive",
|
|
9830
9816
|
children: [/* @__PURE__ */ N(et, { children: "These dashboard filters cannot be queried" }), /* @__PURE__ */ P($e, { children: [
|
|
9831
|
-
|
|
9817
|
+
Ce.map((e) => `${e.label || e.field} (${e.operator})`).join(", "),
|
|
9832
9818
|
". The analytics API only accepts ",
|
|
9833
9819
|
Xu.join(", "),
|
|
9834
9820
|
". The affected widgets stay empty until the operator is changed, from a widget's Filters tab or from the JSON tab."
|
|
9835
9821
|
] })]
|
|
9836
9822
|
}),
|
|
9837
|
-
|
|
9823
|
+
Oe.length > 0 && /* @__PURE__ */ P(Qe, {
|
|
9838
9824
|
variant: "warning",
|
|
9839
9825
|
children: [/* @__PURE__ */ N(et, { children: "These widgets ignore a locked dashboard filter" }), /* @__PURE__ */ P($e, { children: [/* @__PURE__ */ N("ul", {
|
|
9840
9826
|
className: "list-inside list-disc",
|
|
9841
|
-
children:
|
|
9827
|
+
children: Oe.map((e) => /* @__PURE__ */ P("li", { children: [
|
|
9842
9828
|
/* @__PURE__ */ N("span", {
|
|
9843
9829
|
className: "font-medium",
|
|
9844
9830
|
children: e.widgetTitle
|
|
@@ -9847,15 +9833,15 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9847
9833
|
e.label,
|
|
9848
9834
|
" on",
|
|
9849
9835
|
" ",
|
|
9850
|
-
|
|
9836
|
+
_p(e.widgetValue, e.widgetValueLabels),
|
|
9851
9837
|
", the dashboard locks it to",
|
|
9852
9838
|
" ",
|
|
9853
|
-
|
|
9839
|
+
_p(e.dashboardValue, e.dashboardValueLabels),
|
|
9854
9840
|
"."
|
|
9855
9841
|
] }, `${e.widgetId}-${e.field}`))
|
|
9856
9842
|
}), "A widget's own filter wins, so the widget value is what gets queried, within whatever scope this module is mounted with. Readers still see the locked chip. Either change the widget's filter or unlock the dashboard one."] })]
|
|
9857
9843
|
}),
|
|
9858
|
-
T.widgets.length === 0 ? /* @__PURE__ */ N(
|
|
9844
|
+
T.widgets.length === 0 ? /* @__PURE__ */ N(of, { onAddWidget: ye }) : /* @__PURE__ */ N(zs, {
|
|
9859
9845
|
dashboard: T,
|
|
9860
9846
|
timeRange: h,
|
|
9861
9847
|
filters: T.filters,
|
|
@@ -9864,41 +9850,41 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9864
9850
|
type: "applyLayouts",
|
|
9865
9851
|
layouts: e
|
|
9866
9852
|
}),
|
|
9867
|
-
widgetActions:
|
|
9853
|
+
widgetActions: Se,
|
|
9868
9854
|
highlightedWidgetId: o && !o.isNew ? o.widget.id : void 0
|
|
9869
9855
|
})
|
|
9870
9856
|
]
|
|
9871
9857
|
}),
|
|
9872
9858
|
/* @__PURE__ */ N(Qt, {
|
|
9873
9859
|
value: "json",
|
|
9874
|
-
children: /* @__PURE__ */ N(
|
|
9860
|
+
children: /* @__PURE__ */ N(nf, {
|
|
9875
9861
|
text: u,
|
|
9876
9862
|
onTextChange: d,
|
|
9877
|
-
dirty: u !==
|
|
9878
|
-
onApply:
|
|
9863
|
+
dirty: u !== Kd(T),
|
|
9864
|
+
onApply: ve
|
|
9879
9865
|
})
|
|
9880
9866
|
})
|
|
9881
9867
|
]
|
|
9882
9868
|
}),
|
|
9883
|
-
/* @__PURE__ */ N(
|
|
9869
|
+
/* @__PURE__ */ N(up, {
|
|
9884
9870
|
open: o !== null,
|
|
9885
9871
|
widget: o?.widget ?? null,
|
|
9886
9872
|
isNew: o?.isNew ?? !1,
|
|
9887
9873
|
timeRange: h,
|
|
9888
9874
|
dashboardFilters: T.filters,
|
|
9889
|
-
onSave:
|
|
9875
|
+
onSave: be,
|
|
9890
9876
|
onCancel: () => s(null),
|
|
9891
9877
|
onDirtyChange: (e) => {
|
|
9892
9878
|
_.current = e;
|
|
9893
9879
|
}
|
|
9894
9880
|
}),
|
|
9895
|
-
/* @__PURE__ */ N(
|
|
9896
|
-
open:
|
|
9897
|
-
theirDashboard:
|
|
9898
|
-
deleted:
|
|
9899
|
-
pending:
|
|
9900
|
-
onResolve:
|
|
9901
|
-
onCancel: () =>
|
|
9881
|
+
/* @__PURE__ */ N(ud, {
|
|
9882
|
+
open: re !== null,
|
|
9883
|
+
theirDashboard: re?.theirs ?? null,
|
|
9884
|
+
deleted: re?.deleted ?? !1,
|
|
9885
|
+
pending: re ? ge() : null,
|
|
9886
|
+
onResolve: he,
|
|
9887
|
+
onCancel: () => ae(null)
|
|
9902
9888
|
}),
|
|
9903
9889
|
/* @__PURE__ */ N(ht, {
|
|
9904
9890
|
open: v !== null,
|
|
@@ -9930,7 +9916,7 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9930
9916
|
}), /* @__PURE__ */ N(L, {
|
|
9931
9917
|
variant: "destructive",
|
|
9932
9918
|
onClick: () => {
|
|
9933
|
-
p(!1),
|
|
9919
|
+
p(!1), oe();
|
|
9934
9920
|
},
|
|
9935
9921
|
children: "Discard changes"
|
|
9936
9922
|
})] })] })
|
|
@@ -9938,58 +9924,45 @@ function _p({ initial: e, mode: t, scopeFilterField: n }) {
|
|
|
9938
9924
|
]
|
|
9939
9925
|
});
|
|
9940
9926
|
}
|
|
9941
|
-
function
|
|
9927
|
+
function _p(e, t) {
|
|
9942
9928
|
return e.length === 0 ? "all values" : e.map((e, n) => t?.[n] ?? e).join(", ");
|
|
9943
9929
|
}
|
|
9944
9930
|
//#endregion
|
|
9945
9931
|
//#region src/data-sources/dashboard-revision-store.ts
|
|
9946
|
-
function
|
|
9947
|
-
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map()
|
|
9948
|
-
function r(n, r) {
|
|
9949
|
-
e.set(n, r), t.set(n, r);
|
|
9950
|
-
}
|
|
9951
|
-
function i(t, n) {
|
|
9952
|
-
e.has(t) || n && e.set(t, n);
|
|
9953
|
-
}
|
|
9932
|
+
function vp() {
|
|
9933
|
+
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
9954
9934
|
return {
|
|
9955
9935
|
current(t) {
|
|
9956
9936
|
return e.get(t);
|
|
9957
9937
|
},
|
|
9958
|
-
refresh(
|
|
9959
|
-
|
|
9938
|
+
refresh(n, r) {
|
|
9939
|
+
r && e.set(n, r), t.delete(n);
|
|
9960
9940
|
},
|
|
9961
|
-
seed(
|
|
9962
|
-
|
|
9941
|
+
seed(t, n) {
|
|
9942
|
+
e.has(t) || n && e.set(t, n);
|
|
9963
9943
|
},
|
|
9964
|
-
|
|
9965
|
-
|
|
9944
|
+
offer(e, n) {
|
|
9945
|
+
n && t.set(e, n);
|
|
9966
9946
|
},
|
|
9967
|
-
|
|
9947
|
+
adopt(n) {
|
|
9968
9948
|
let r = t.get(n);
|
|
9969
|
-
r && e.set(n, r);
|
|
9970
|
-
},
|
|
9971
|
-
offer(e, t) {
|
|
9972
|
-
t && n.set(e, t);
|
|
9949
|
+
r && (t.delete(n), e.set(n, r));
|
|
9973
9950
|
},
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
t && (n.delete(e), r(e, t));
|
|
9977
|
-
},
|
|
9978
|
-
forget(r) {
|
|
9979
|
-
e.delete(r), t.delete(r), n.delete(r);
|
|
9951
|
+
forget(n) {
|
|
9952
|
+
e.delete(n), t.delete(n);
|
|
9980
9953
|
}
|
|
9981
9954
|
};
|
|
9982
9955
|
}
|
|
9983
9956
|
//#endregion
|
|
9984
9957
|
//#region src/data-sources/dashboard-wire.ts
|
|
9985
|
-
var
|
|
9958
|
+
var yp = {
|
|
9986
9959
|
type: "relative",
|
|
9987
9960
|
period: "24h"
|
|
9988
9961
|
};
|
|
9989
|
-
function
|
|
9962
|
+
function bp(e) {
|
|
9990
9963
|
return e.toLowerCase();
|
|
9991
9964
|
}
|
|
9992
|
-
function
|
|
9965
|
+
function xp(e) {
|
|
9993
9966
|
return {
|
|
9994
9967
|
name: e.field,
|
|
9995
9968
|
...e.label === void 0 ? {} : { label: e.label },
|
|
@@ -9998,17 +9971,17 @@ function Sp(e) {
|
|
|
9998
9971
|
editable: e.editable === !0
|
|
9999
9972
|
};
|
|
10000
9973
|
}
|
|
10001
|
-
function
|
|
9974
|
+
function Sp(e) {
|
|
10002
9975
|
let t = e.label ?? void 0;
|
|
10003
9976
|
return {
|
|
10004
9977
|
field: e.name,
|
|
10005
9978
|
...t === void 0 ? {} : { label: t },
|
|
10006
|
-
operator:
|
|
9979
|
+
operator: bp(e.operator),
|
|
10007
9980
|
value: e.value ?? [],
|
|
10008
9981
|
editable: e.editable === !0
|
|
10009
9982
|
};
|
|
10010
9983
|
}
|
|
10011
|
-
function
|
|
9984
|
+
function Cp(e) {
|
|
10012
9985
|
return e.type === "relative" ? {
|
|
10013
9986
|
type: "relative",
|
|
10014
9987
|
period: e.period
|
|
@@ -10018,50 +9991,50 @@ function wp(e) {
|
|
|
10018
9991
|
to: e.to
|
|
10019
9992
|
};
|
|
10020
9993
|
}
|
|
10021
|
-
function
|
|
10022
|
-
if (!e) return
|
|
9994
|
+
function wp(e) {
|
|
9995
|
+
if (!e) return yp;
|
|
10023
9996
|
if (e.type === "absolute") {
|
|
10024
9997
|
let t = e.from ?? void 0, n = e.to ?? void 0;
|
|
10025
|
-
return t === void 0 || n === void 0 ?
|
|
9998
|
+
return t === void 0 || n === void 0 ? yp : {
|
|
10026
9999
|
type: "absolute",
|
|
10027
10000
|
from: t,
|
|
10028
10001
|
to: n
|
|
10029
10002
|
};
|
|
10030
10003
|
}
|
|
10031
10004
|
let t = e.period ?? void 0;
|
|
10032
|
-
return t === void 0 ?
|
|
10005
|
+
return t === void 0 ? yp : {
|
|
10033
10006
|
type: "relative",
|
|
10034
10007
|
period: t
|
|
10035
10008
|
};
|
|
10036
10009
|
}
|
|
10037
|
-
function
|
|
10010
|
+
function Tp(e) {
|
|
10038
10011
|
let t = e.description ?? void 0;
|
|
10039
10012
|
return {
|
|
10040
10013
|
id: e.id,
|
|
10041
10014
|
title: e.title,
|
|
10042
10015
|
...t === void 0 ? {} : { description: t },
|
|
10043
10016
|
widgets: e.widgets ?? [],
|
|
10044
|
-
filters: (e.filters ?? []).map(
|
|
10045
|
-
timeRange:
|
|
10017
|
+
filters: (e.filters ?? []).map(Sp),
|
|
10018
|
+
timeRange: wp(e.timeRange),
|
|
10046
10019
|
createdAt: e.createdAt ?? 0,
|
|
10047
10020
|
updatedAt: e.updatedAt ?? e.createdAt ?? 0
|
|
10048
10021
|
};
|
|
10049
10022
|
}
|
|
10050
|
-
function
|
|
10023
|
+
function Ep(e, t) {
|
|
10051
10024
|
return {
|
|
10052
10025
|
...t.includeId ? { id: e.id } : {},
|
|
10053
10026
|
title: e.title,
|
|
10054
10027
|
...e.description === void 0 ? {} : { description: e.description },
|
|
10055
|
-
filters: e.filters.map(
|
|
10056
|
-
timeRange:
|
|
10028
|
+
filters: e.filters.map(xp),
|
|
10029
|
+
timeRange: Cp(e.timeRange),
|
|
10057
10030
|
widgets: e.widgets
|
|
10058
10031
|
};
|
|
10059
10032
|
}
|
|
10060
10033
|
//#endregion
|
|
10061
10034
|
//#region src/data-sources/http-dashboard-persistence.ts
|
|
10062
|
-
var
|
|
10063
|
-
function
|
|
10064
|
-
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.dashboardsPath ??
|
|
10035
|
+
var Dp = "/observability/dashboards", Op = 100, kp = "*";
|
|
10036
|
+
function Ap(e, t) {
|
|
10037
|
+
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.dashboardsPath ?? Dp, a = `${e}${i}`, o = (e) => `${a}/${encodeURIComponent(e)}`, s = t?.revisionStore ?? vp();
|
|
10065
10038
|
function c(e, n) {
|
|
10066
10039
|
let i = {
|
|
10067
10040
|
method: e,
|
|
@@ -10097,7 +10070,7 @@ function jp(e, t) {
|
|
|
10097
10070
|
case 412:
|
|
10098
10071
|
if (r?.dashboard) {
|
|
10099
10072
|
let t = r.dashboard, n = u(e.headers.get("ETag"), r.currentVersion ?? t.version);
|
|
10100
|
-
return s.offer(t.id, n), new Gu(i,
|
|
10073
|
+
return s.offer(t.id, n), new Gu(i, Tp(t), r.currentVersion ?? t.version ?? void 0);
|
|
10101
10074
|
}
|
|
10102
10075
|
return new Hu(e.status, i);
|
|
10103
10076
|
default: return new Hu(e.status, i);
|
|
@@ -10105,42 +10078,39 @@ function jp(e, t) {
|
|
|
10105
10078
|
}
|
|
10106
10079
|
async function m(e, t) {
|
|
10107
10080
|
let n = await e.json();
|
|
10108
|
-
return d(n.id, e.headers.get("ETag"), n.version, t),
|
|
10081
|
+
return d(n.id, e.headers.get("ETag"), n.version, t), Tp(n);
|
|
10109
10082
|
}
|
|
10110
10083
|
async function h(e, t) {
|
|
10111
10084
|
let r = await n(o(e), c("GET", t ? { signal: t } : void 0));
|
|
10112
10085
|
if (!r.ok) throw await p(r, `GET ${i}/{dashboardId}`, e);
|
|
10113
|
-
return m(r, "
|
|
10086
|
+
return m(r, "seed");
|
|
10114
10087
|
}
|
|
10115
10088
|
async function g(e, t) {
|
|
10116
|
-
return s.current(e) || (console.warn(`[gamma-lib-observability] Saving dashboard "${e}" that this persistence never read. Its current revision is read back first, so an edit saved in between is overwritten without a conflict. Read or create the dashboard through the same instance before saving, or pass a shared \`revisionStore\` if the adapter is being rebuilt.`), await h(e, t), s.current(e) ??
|
|
10089
|
+
return s.current(e) || (console.warn(`[gamma-lib-observability] Saving dashboard "${e}" that this persistence never read. Its current revision is read back first, so an edit saved in between is overwritten without a conflict. Read or create the dashboard through the same instance before saving, or pass a shared \`revisionStore\` if the adapter is being rebuilt.`), await h(e, t), s.current(e) ?? kp);
|
|
10117
10090
|
}
|
|
10118
10091
|
return {
|
|
10119
10092
|
fetchDashboard: h,
|
|
10120
10093
|
adoptCurrentRevision(e) {
|
|
10121
10094
|
s.adopt(e);
|
|
10122
10095
|
},
|
|
10123
|
-
takeReadRevision(e) {
|
|
10124
|
-
s.take(e);
|
|
10125
|
-
},
|
|
10126
10096
|
async fetchDashboards(e) {
|
|
10127
10097
|
let t = [];
|
|
10128
10098
|
for (let r = 1;; r += 1) {
|
|
10129
|
-
let o = await n(`${a}?page=${r}&perPage=${
|
|
10099
|
+
let o = await n(`${a}?page=${r}&perPage=${Op}`, c("GET", e ? { signal: e } : void 0));
|
|
10130
10100
|
if (!o.ok) throw await p(o, `GET ${i}`);
|
|
10131
10101
|
let s = await o.json(), l = s.data ?? [];
|
|
10132
|
-
for (let e of l) d(e.id, null, e.version, "seed"), t.push(
|
|
10102
|
+
for (let e of l) d(e.id, null, e.version, "seed"), t.push(Tp(e));
|
|
10133
10103
|
let u = s.pagination?.pageCount ?? 0;
|
|
10134
10104
|
if (l.length === 0 || r >= u) return t;
|
|
10135
10105
|
}
|
|
10136
10106
|
},
|
|
10137
10107
|
async createDashboard(e, t) {
|
|
10138
|
-
let r = await n(a, l("POST",
|
|
10108
|
+
let r = await n(a, l("POST", Ep(e, { includeId: !0 }), t));
|
|
10139
10109
|
if (!r.ok) throw await p(r, `POST ${i}`, e.id);
|
|
10140
10110
|
return m(r, "refresh");
|
|
10141
10111
|
},
|
|
10142
10112
|
async updateDashboard(e, t, r) {
|
|
10143
|
-
let a = r?.force ?
|
|
10113
|
+
let a = r?.force ? kp : await g(e.id, t), s = await n(o(e.id), l("PUT", Ep(e, { includeId: !1 }), t, { "If-Match": a }));
|
|
10144
10114
|
if (!s.ok) throw await p(s, `PUT ${i}/{dashboardId}`, e.id);
|
|
10145
10115
|
return m(s, "refresh");
|
|
10146
10116
|
},
|
|
@@ -10152,23 +10122,23 @@ function jp(e, t) {
|
|
|
10152
10122
|
}
|
|
10153
10123
|
//#endregion
|
|
10154
10124
|
//#region src/data-sources/http-data-source.ts
|
|
10155
|
-
var
|
|
10125
|
+
var jp = {
|
|
10156
10126
|
name: "HTTP_REQUESTS",
|
|
10157
10127
|
measures: [tr]
|
|
10158
10128
|
};
|
|
10159
|
-
function
|
|
10129
|
+
function Mp(e) {
|
|
10160
10130
|
return e.metrics.map((e) => ({
|
|
10161
10131
|
name: e.name,
|
|
10162
10132
|
unit: e.unit,
|
|
10163
10133
|
measures: e.measures ?? []
|
|
10164
10134
|
}));
|
|
10165
10135
|
}
|
|
10166
|
-
function
|
|
10136
|
+
function Np(e, t = "", n = "") {
|
|
10167
10137
|
let r = [];
|
|
10168
10138
|
for (let i of e) {
|
|
10169
10139
|
let e = t ? `${t} / ${i.key}` : i.key, a = n ? `${n}${qa}${i.name ?? i.key}` : i.name ?? i.key;
|
|
10170
10140
|
if (i.type === "GROUP" && i.buckets?.length) {
|
|
10171
|
-
r.push(...
|
|
10141
|
+
r.push(...Np(i.buckets, e, a));
|
|
10172
10142
|
continue;
|
|
10173
10143
|
}
|
|
10174
10144
|
r.push({
|
|
@@ -10179,12 +10149,12 @@ function Pp(e, t = "", n = "") {
|
|
|
10179
10149
|
}
|
|
10180
10150
|
return r;
|
|
10181
10151
|
}
|
|
10182
|
-
function
|
|
10152
|
+
function Pp(e) {
|
|
10183
10153
|
let t = [];
|
|
10184
|
-
for (let n of e.metrics) n.buckets && t.push(...
|
|
10154
|
+
for (let n of e.metrics) n.buckets && t.push(...Np(n.buckets));
|
|
10185
10155
|
return t;
|
|
10186
10156
|
}
|
|
10187
|
-
function
|
|
10157
|
+
function Fp(e) {
|
|
10188
10158
|
let t = [];
|
|
10189
10159
|
for (let n of e.metrics) if (n.buckets) if (n.buckets.some((e) => e.type === "GROUP" && e.buckets?.length)) {
|
|
10190
10160
|
let e = /* @__PURE__ */ new Map();
|
|
@@ -10221,42 +10191,42 @@ function Ip(e) {
|
|
|
10221
10191
|
}
|
|
10222
10192
|
return t;
|
|
10223
10193
|
}
|
|
10224
|
-
function
|
|
10194
|
+
function Ip(e) {
|
|
10225
10195
|
return {
|
|
10226
10196
|
...e,
|
|
10227
10197
|
measures: e.measures?.length ? e.measures : [tr]
|
|
10228
10198
|
};
|
|
10229
10199
|
}
|
|
10230
|
-
function
|
|
10231
|
-
let t =
|
|
10232
|
-
return t.metrics = e.metrics.map(
|
|
10200
|
+
function Lp(e) {
|
|
10201
|
+
let t = Bp(e);
|
|
10202
|
+
return t.metrics = e.metrics.map(Vp), t;
|
|
10233
10203
|
}
|
|
10234
|
-
function
|
|
10235
|
-
let t =
|
|
10236
|
-
return t.interval = e.interval, t.metrics = e.metrics.map(
|
|
10204
|
+
function Rp(e) {
|
|
10205
|
+
let t = Bp(e);
|
|
10206
|
+
return t.interval = e.interval, t.metrics = e.metrics.map(Vp), e.by?.length && (t.by = e.by), e.ranges?.length && (t.ranges = e.ranges), e.limit !== void 0 && (t.limit = e.limit), t;
|
|
10237
10207
|
}
|
|
10238
|
-
function
|
|
10239
|
-
let n =
|
|
10240
|
-
return n.by = e.by, n.metrics = (e.metrics?.length ? e.metrics : [t]).map(
|
|
10208
|
+
function zp(e, t) {
|
|
10209
|
+
let n = Bp(e);
|
|
10210
|
+
return n.by = e.by, n.metrics = (e.metrics?.length ? e.metrics : [t]).map(Vp), e.ranges?.length && (n.ranges = e.ranges), e.limit !== void 0 && (n.limit = e.limit), n;
|
|
10241
10211
|
}
|
|
10242
|
-
function
|
|
10212
|
+
function Bp(e) {
|
|
10243
10213
|
let t = Ur(e.timeRange), n = { timeRange: {
|
|
10244
10214
|
from: new Date(t.from).toISOString(),
|
|
10245
10215
|
to: new Date(t.to).toISOString()
|
|
10246
10216
|
} }, r = td(e.filters);
|
|
10247
10217
|
return r && (n.filters = r), n;
|
|
10248
10218
|
}
|
|
10249
|
-
function
|
|
10250
|
-
let t =
|
|
10219
|
+
function Vp(e) {
|
|
10220
|
+
let t = Ip(e), n = {
|
|
10251
10221
|
name: t.name,
|
|
10252
10222
|
measures: t.measures
|
|
10253
10223
|
}, r = td(e.filters);
|
|
10254
10224
|
return r && (n.filters = r), "sorts" in e && e.sorts?.length && (n.sorts = e.sorts), n;
|
|
10255
10225
|
}
|
|
10256
|
-
function
|
|
10226
|
+
function Hp(e, t) {
|
|
10257
10227
|
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = {
|
|
10258
|
-
name: t?.defaultFacetMetric?.name ??
|
|
10259
|
-
measures: t?.defaultFacetMetric?.measures?.length ? [...t.defaultFacetMetric.measures] : [...
|
|
10228
|
+
name: t?.defaultFacetMetric?.name ?? jp.name,
|
|
10229
|
+
measures: t?.defaultFacetMetric?.measures?.length ? [...t.defaultFacetMetric.measures] : [...jp.measures]
|
|
10260
10230
|
};
|
|
10261
10231
|
async function a(i, a, o) {
|
|
10262
10232
|
let s = {
|
|
@@ -10272,19 +10242,19 @@ function Up(e, t) {
|
|
|
10272
10242
|
}
|
|
10273
10243
|
return {
|
|
10274
10244
|
async fetchTimeSeries(e) {
|
|
10275
|
-
return
|
|
10245
|
+
return Fp(await a("/observability/analytics/time-series", Rp(e), e.signal));
|
|
10276
10246
|
},
|
|
10277
10247
|
async fetchFacets(e) {
|
|
10278
|
-
return
|
|
10248
|
+
return Pp(await a("/observability/analytics/facets", zp(e, i), e.signal));
|
|
10279
10249
|
},
|
|
10280
10250
|
async fetchMeasures(e) {
|
|
10281
|
-
return
|
|
10251
|
+
return Mp(await a("/observability/analytics/measures", Lp(e), e.signal));
|
|
10282
10252
|
}
|
|
10283
10253
|
};
|
|
10284
10254
|
}
|
|
10285
10255
|
//#endregion
|
|
10286
10256
|
//#region src/data-sources/http-filter-source.ts
|
|
10287
|
-
function
|
|
10257
|
+
function Up(e) {
|
|
10288
10258
|
return {
|
|
10289
10259
|
EQ: "eq",
|
|
10290
10260
|
IN: "in",
|
|
@@ -10297,10 +10267,10 @@ function Wp(e) {
|
|
|
10297
10267
|
CONTAINS: "contains"
|
|
10298
10268
|
}[e] ?? e.toLowerCase();
|
|
10299
10269
|
}
|
|
10300
|
-
function
|
|
10270
|
+
function Wp(e) {
|
|
10301
10271
|
return e.toUpperCase() === "ENUM" ? "enum" : "async";
|
|
10302
10272
|
}
|
|
10303
|
-
function
|
|
10273
|
+
function Gp(e, t) {
|
|
10304
10274
|
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials;
|
|
10305
10275
|
function i(e) {
|
|
10306
10276
|
let n = { ...e }, i = dr(t?.headers);
|
|
@@ -10330,7 +10300,7 @@ function Kp(e, t) {
|
|
|
10330
10300
|
let r = await n(`${e}/observability/filters/definition`, i({ signal: t }));
|
|
10331
10301
|
if (!r.ok) throw Error(`[gamma-lib-observability] HTTP ${r.status} on GET filters/definition`);
|
|
10332
10302
|
return (await r.json()).data.map((e) => {
|
|
10333
|
-
let t =
|
|
10303
|
+
let t = Wp(e.type), n = e.operators.map(Up), r = e.type.toUpperCase(), i = e.apiTypes, o = e.signals;
|
|
10334
10304
|
if (t === "enum") {
|
|
10335
10305
|
let r = (e.enumValues ?? []).map((e) => typeof e == "string" ? {
|
|
10336
10306
|
value: e,
|
|
@@ -10385,9 +10355,9 @@ function Kp(e, t) {
|
|
|
10385
10355
|
}
|
|
10386
10356
|
//#endregion
|
|
10387
10357
|
//#region src/data-sources/http-logs-source.ts
|
|
10388
|
-
var
|
|
10389
|
-
function
|
|
10390
|
-
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.searchPath ??
|
|
10358
|
+
var Kp = "/observability/logs/search";
|
|
10359
|
+
function qp(e, t) {
|
|
10360
|
+
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.searchPath ?? Kp;
|
|
10391
10361
|
function a(e) {
|
|
10392
10362
|
let n = {
|
|
10393
10363
|
method: "POST",
|
|
@@ -10441,30 +10411,30 @@ function Jp(e, t) {
|
|
|
10441
10411
|
}
|
|
10442
10412
|
//#endregion
|
|
10443
10413
|
//#region src/data-sources/http-traces-source.ts
|
|
10444
|
-
var
|
|
10445
|
-
function
|
|
10414
|
+
var Jp = "/observability/traces/search";
|
|
10415
|
+
function Yp(e) {
|
|
10446
10416
|
return e / 1e6;
|
|
10447
10417
|
}
|
|
10448
|
-
function
|
|
10418
|
+
function Xp(e) {
|
|
10449
10419
|
return e;
|
|
10450
10420
|
}
|
|
10451
|
-
function
|
|
10421
|
+
function Zp(e) {
|
|
10452
10422
|
return {
|
|
10453
10423
|
name: e.name,
|
|
10454
10424
|
timestampEpochMs: e.timestampEpochMs,
|
|
10455
|
-
attributes:
|
|
10425
|
+
attributes: Xp(e.attributes)
|
|
10456
10426
|
};
|
|
10457
10427
|
}
|
|
10458
|
-
function
|
|
10428
|
+
function Qp(e) {
|
|
10459
10429
|
return {
|
|
10460
10430
|
timestampEpochMs: e.timestampEpochMs,
|
|
10461
10431
|
body: e.body,
|
|
10462
10432
|
severity: e.severity,
|
|
10463
|
-
attributes:
|
|
10433
|
+
attributes: Xp(e.attributes)
|
|
10464
10434
|
};
|
|
10465
10435
|
}
|
|
10466
|
-
function
|
|
10467
|
-
let t =
|
|
10436
|
+
function $p(e) {
|
|
10437
|
+
let t = Yp(e.durationNanos);
|
|
10468
10438
|
return {
|
|
10469
10439
|
traceId: e.traceId,
|
|
10470
10440
|
rootOperationName: e.rootOperationName,
|
|
@@ -10475,8 +10445,8 @@ function em(e) {
|
|
|
10475
10445
|
status: e.status
|
|
10476
10446
|
};
|
|
10477
10447
|
}
|
|
10478
|
-
function
|
|
10479
|
-
let t = e.startTimeEpochMs, n =
|
|
10448
|
+
function em(e) {
|
|
10449
|
+
let t = e.startTimeEpochMs, n = Yp(e.durationNanos);
|
|
10480
10450
|
return {
|
|
10481
10451
|
traceId: e.traceId,
|
|
10482
10452
|
spanId: e.spanId,
|
|
@@ -10489,23 +10459,23 @@ function tm(e) {
|
|
|
10489
10459
|
status: e.status,
|
|
10490
10460
|
kind: e.kind,
|
|
10491
10461
|
attributes: e.attributes,
|
|
10492
|
-
events: e.events.map(
|
|
10493
|
-
payloadLogs: e.payloadLogs.map(
|
|
10462
|
+
events: e.events.map(Zp),
|
|
10463
|
+
payloadLogs: e.payloadLogs.map(Qp)
|
|
10494
10464
|
};
|
|
10495
10465
|
}
|
|
10496
|
-
function
|
|
10497
|
-
let t = e.spans.map(
|
|
10466
|
+
function tm(e) {
|
|
10467
|
+
let t = e.spans.map(em);
|
|
10498
10468
|
return {
|
|
10499
|
-
|
|
10469
|
+
...$p(e),
|
|
10500
10470
|
spanCount: t.length,
|
|
10501
10471
|
spans: t
|
|
10502
10472
|
};
|
|
10503
10473
|
}
|
|
10504
|
-
function
|
|
10474
|
+
function nm(e) {
|
|
10505
10475
|
return e.endsWith("/search") ? e.slice(0, -7) : e;
|
|
10506
10476
|
}
|
|
10507
|
-
function
|
|
10508
|
-
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.searchPath ??
|
|
10477
|
+
function rm(e, t) {
|
|
10478
|
+
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.searchPath ?? Jp, a = nm(i);
|
|
10509
10479
|
function o(e) {
|
|
10510
10480
|
let n = {
|
|
10511
10481
|
method: e,
|
|
@@ -10538,7 +10508,7 @@ function im(e, t) {
|
|
|
10538
10508
|
if (!u.ok) throw Error(`[gamma-lib-observability] HTTP ${u.status} on POST ${i}`);
|
|
10539
10509
|
let d = await u.json();
|
|
10540
10510
|
return {
|
|
10541
|
-
entries: (d.data ?? []).map(
|
|
10511
|
+
entries: (d.data ?? []).map($p),
|
|
10542
10512
|
totalCount: d.pagination?.totalCount,
|
|
10543
10513
|
page: d.pagination?.page,
|
|
10544
10514
|
pageCount: d.pagination?.pageCount
|
|
@@ -10549,13 +10519,13 @@ function im(e, t) {
|
|
|
10549
10519
|
t.signal && (i.signal = t.signal);
|
|
10550
10520
|
let s = await n(r, i);
|
|
10551
10521
|
if (!s.ok) throw Error(`[gamma-lib-observability] HTTP ${s.status} on GET ${a}/${t.traceId}`);
|
|
10552
|
-
return
|
|
10522
|
+
return tm(await s.json());
|
|
10553
10523
|
}
|
|
10554
10524
|
};
|
|
10555
10525
|
}
|
|
10556
10526
|
//#endregion
|
|
10557
10527
|
//#region src/routing/DashboardListPage.tsx
|
|
10558
|
-
function
|
|
10528
|
+
function im(e) {
|
|
10559
10529
|
return new Date(e).toLocaleDateString(void 0, {
|
|
10560
10530
|
month: "short",
|
|
10561
10531
|
day: "numeric",
|
|
@@ -10563,7 +10533,7 @@ function am(e) {
|
|
|
10563
10533
|
minute: "2-digit"
|
|
10564
10534
|
});
|
|
10565
10535
|
}
|
|
10566
|
-
function
|
|
10536
|
+
function am({ templates: t }) {
|
|
10567
10537
|
let n = e(), r = v("observability.dashboards.write"), i = s(), a = nd(), o = zn(), c = r && i !== null, l = k(() => Gs(t, n), [t, n]), u = k(() => {
|
|
10568
10538
|
let e = l.map((e) => ({
|
|
10569
10539
|
id: e.id,
|
|
@@ -10616,13 +10586,13 @@ function om({ templates: t }) {
|
|
|
10616
10586
|
header: "Last updated",
|
|
10617
10587
|
cell: ({ row: e }) => /* @__PURE__ */ N("span", {
|
|
10618
10588
|
className: "text-muted-foreground",
|
|
10619
|
-
children: e.original.updatedAt === void 0 ? "—" :
|
|
10589
|
+
children: e.original.updatedAt === void 0 ? "—" : im(e.original.updatedAt)
|
|
10620
10590
|
})
|
|
10621
10591
|
},
|
|
10622
10592
|
{
|
|
10623
10593
|
id: "actions",
|
|
10624
10594
|
header: "",
|
|
10625
|
-
cell: ({ row: e }) => /* @__PURE__ */ N(
|
|
10595
|
+
cell: ({ row: e }) => /* @__PURE__ */ N(om, {
|
|
10626
10596
|
row: e.original,
|
|
10627
10597
|
capabilities: n
|
|
10628
10598
|
})
|
|
@@ -10647,17 +10617,17 @@ function om({ templates: t }) {
|
|
|
10647
10617
|
})]
|
|
10648
10618
|
});
|
|
10649
10619
|
}
|
|
10650
|
-
function
|
|
10651
|
-
let n = zn(), r = v("observability.dashboards.write"), i = s(), a = id(), o =
|
|
10620
|
+
function om({ row: e, capabilities: t }) {
|
|
10621
|
+
let n = zn(), r = v("observability.dashboards.write"), i = s(), a = id(), o = ld(), [c, l] = j(!1), u = r && i !== null, d = () => e.kind === "custom" ? e.dashboard ?? null : e.template ? Ws(e.template, { capabilities: t }) : null, f = async () => {
|
|
10652
10622
|
let e = d();
|
|
10653
10623
|
if (e) try {
|
|
10654
|
-
await navigator.clipboard.writeText(
|
|
10624
|
+
await navigator.clipboard.writeText(Kd(e)), X.success("Dashboard JSON copied to clipboard");
|
|
10655
10625
|
} catch {
|
|
10656
10626
|
X.error("Could not copy to clipboard");
|
|
10657
10627
|
}
|
|
10658
10628
|
}, p = () => {
|
|
10659
10629
|
let e = d();
|
|
10660
|
-
e && a.mutate(
|
|
10630
|
+
e && a.mutate(Fd(e), {
|
|
10661
10631
|
onSuccess: (e) => {
|
|
10662
10632
|
X.success(`Duplicated as "${e.title}"`), n(`${e.id}/edit`, { relative: "path" });
|
|
10663
10633
|
},
|
|
@@ -10726,7 +10696,7 @@ function sm({ row: e, capabilities: t }) {
|
|
|
10726
10696
|
}
|
|
10727
10697
|
//#endregion
|
|
10728
10698
|
//#region src/routing/detail-filter.ts
|
|
10729
|
-
function
|
|
10699
|
+
function sm(e, t, n) {
|
|
10730
10700
|
let r = e.filter((e) => e.field !== t);
|
|
10731
10701
|
return r.push({
|
|
10732
10702
|
field: t,
|
|
@@ -10734,7 +10704,7 @@ function cm(e, t, n) {
|
|
|
10734
10704
|
value: [n]
|
|
10735
10705
|
}), r;
|
|
10736
10706
|
}
|
|
10737
|
-
function
|
|
10707
|
+
function cm(e, t) {
|
|
10738
10708
|
let n = yi({
|
|
10739
10709
|
conditions: [...e],
|
|
10740
10710
|
timeRange: t
|
|
@@ -10743,9 +10713,9 @@ function lm(e, t) {
|
|
|
10743
10713
|
}
|
|
10744
10714
|
//#endregion
|
|
10745
10715
|
//#region src/routing/LogsRouteElement.tsx
|
|
10746
|
-
function
|
|
10716
|
+
function lm({ columns: e, getRowId: t, getApiId: n, onRowClickOverride: r, detailConfig: i, detailMode: a, pageSize: o, scopeFilterField: s, columnVisibilityStorageKey: c, widget: l }) {
|
|
10747
10717
|
let u = !r && !!i && !!t;
|
|
10748
|
-
return u && a === "drawer" && i && t ? /* @__PURE__ */ N(
|
|
10718
|
+
return u && a === "drawer" && i && t ? /* @__PURE__ */ N(um, {
|
|
10749
10719
|
columns: e,
|
|
10750
10720
|
getRowId: t,
|
|
10751
10721
|
getApiId: n,
|
|
@@ -10754,7 +10724,7 @@ function um({ columns: e, getRowId: t, getApiId: n, onRowClickOverride: r, detai
|
|
|
10754
10724
|
scopeFilterField: s,
|
|
10755
10725
|
columnVisibilityStorageKey: c,
|
|
10756
10726
|
widget: l
|
|
10757
|
-
}) : /* @__PURE__ */ N(
|
|
10727
|
+
}) : /* @__PURE__ */ N(dm, {
|
|
10758
10728
|
columns: e,
|
|
10759
10729
|
getRowId: t,
|
|
10760
10730
|
getApiId: n,
|
|
@@ -10766,7 +10736,7 @@ function um({ columns: e, getRowId: t, getApiId: n, onRowClickOverride: r, detai
|
|
|
10766
10736
|
widget: l
|
|
10767
10737
|
});
|
|
10768
10738
|
}
|
|
10769
|
-
function
|
|
10739
|
+
function um({ columns: e, getRowId: t, getApiId: n, detailConfig: r, pageSize: i, scopeFilterField: a, columnVisibilityStorageKey: o, widget: s }) {
|
|
10770
10740
|
let [c, l] = j(void 0), [u, d] = j(void 0), [f, p] = j([]), { filters: m, setFilters: h } = ic(), g = k(() => c ? f.findIndex((e) => t(e) === c) : -1, [
|
|
10771
10741
|
c,
|
|
10772
10742
|
f,
|
|
@@ -10774,7 +10744,7 @@ function dm({ columns: e, getRowId: t, getApiId: n, detailConfig: r, pageSize: i
|
|
|
10774
10744
|
]), _ = D((e) => {
|
|
10775
10745
|
l(t(e)), d(n?.(e));
|
|
10776
10746
|
}, [t, n]), v = D((e, t) => {
|
|
10777
|
-
h(
|
|
10747
|
+
h(sm(m, e, t)), l(void 0), d(void 0);
|
|
10778
10748
|
}, [m, h]), y = D(() => {
|
|
10779
10749
|
let e = f[g - 1];
|
|
10780
10750
|
e && (l(t(e)), d(n?.(e)));
|
|
@@ -10816,7 +10786,7 @@ function dm({ columns: e, getRowId: t, getApiId: n, detailConfig: r, pageSize: i
|
|
|
10816
10786
|
hasNext: g >= 0 && g < f.length - 1
|
|
10817
10787
|
})] });
|
|
10818
10788
|
}
|
|
10819
|
-
function
|
|
10789
|
+
function dm({ columns: e, getRowId: t, getApiId: n, onRowClickOverride: r, builtInDetailEnabled: i, pageSize: a, scopeFilterField: o, columnVisibilityStorageKey: s, widget: c }) {
|
|
10820
10790
|
let l = zn(), { pathname: u } = Rn();
|
|
10821
10791
|
return /* @__PURE__ */ N(Sc, {
|
|
10822
10792
|
columns: e,
|
|
@@ -10846,7 +10816,7 @@ function fm({ columns: e, getRowId: t, getApiId: n, onRowClickOverride: r, built
|
|
|
10846
10816
|
}
|
|
10847
10817
|
//#endregion
|
|
10848
10818
|
//#region src/dashboards/DashboardFilterValueForm.tsx
|
|
10849
|
-
function
|
|
10819
|
+
function fm({ condition: e, provider: t, activeApiTypes: n, onReset: r, onApply: i, onCancel: a }) {
|
|
10850
10820
|
let [o, s] = j(() => ma(e.value, e.valueLabels)), [c, l] = j(e.value.join(", ")), u = !!(t?.kind === "enum" && t.options || t?.valueLoader), d = u ? o.length === 0 : c.trim() === "", f = t ? la(t, e.operator) : !1, p = Ea(e);
|
|
10851
10821
|
function m() {
|
|
10852
10822
|
let t = {
|
|
@@ -10924,13 +10894,13 @@ function pm({ condition: e, provider: t, activeApiTypes: n, onReset: r, onApply:
|
|
|
10924
10894
|
}
|
|
10925
10895
|
//#endregion
|
|
10926
10896
|
//#region src/dashboards/DashboardFilterChips.tsx
|
|
10927
|
-
function
|
|
10897
|
+
function pm(e, t) {
|
|
10928
10898
|
if (e.length !== t.length) return !1;
|
|
10929
10899
|
let n = [...t].sort();
|
|
10930
10900
|
return [...e].sort().every((e, t) => e === n[t]);
|
|
10931
10901
|
}
|
|
10932
|
-
function
|
|
10933
|
-
return e.length === 0 && t.length === 0 ? null : /* @__PURE__ */ P(M, { children: [e.map((e) => /* @__PURE__ */ N(
|
|
10902
|
+
function mm({ lockedFilters: e, revaluableFilters: t, revaluableDefaults: n, providers: r, activeApiTypes: i, onRevalue: a, onResetRevalue: o }) {
|
|
10903
|
+
return e.length === 0 && t.length === 0 ? null : /* @__PURE__ */ P(M, { children: [e.map((e) => /* @__PURE__ */ N(xd, {
|
|
10934
10904
|
condition: {
|
|
10935
10905
|
...e,
|
|
10936
10906
|
label: Aa(e, r)
|
|
@@ -10941,12 +10911,12 @@ function hm({ lockedFilters: e, revaluableFilters: t, revaluableDefaults: n, pro
|
|
|
10941
10911
|
let s = r.find((t) => t.field === e.field), c = {
|
|
10942
10912
|
...e,
|
|
10943
10913
|
label: Aa(e, r)
|
|
10944
|
-
}, l = n?.[t], u = !!(l && !
|
|
10945
|
-
return /* @__PURE__ */ N(
|
|
10914
|
+
}, l = n?.[t], u = !!(l && !pm(l.value, e.value));
|
|
10915
|
+
return /* @__PURE__ */ N(Sd, {
|
|
10946
10916
|
condition: c,
|
|
10947
10917
|
revaluable: !0,
|
|
10948
10918
|
changedByReader: u,
|
|
10949
|
-
renderForm: (t) => /* @__PURE__ */ N(
|
|
10919
|
+
renderForm: (t) => /* @__PURE__ */ N(fm, {
|
|
10950
10920
|
condition: c,
|
|
10951
10921
|
provider: s,
|
|
10952
10922
|
activeApiTypes: i,
|
|
@@ -10963,20 +10933,20 @@ function hm({ lockedFilters: e, revaluableFilters: t, revaluableDefaults: n, pro
|
|
|
10963
10933
|
}
|
|
10964
10934
|
//#endregion
|
|
10965
10935
|
//#region src/routing/ObservabilityDashboardPage.tsx
|
|
10966
|
-
var
|
|
10967
|
-
function
|
|
10936
|
+
var hm = ["ANALYTICS"];
|
|
10937
|
+
function gm(e) {
|
|
10968
10938
|
let [t] = Vn(), n = qe(), r = t.get("live");
|
|
10969
10939
|
return /* @__PURE__ */ N(ar, {
|
|
10970
10940
|
config: {
|
|
10971
10941
|
defaultEnabled: r === "1" || r === "true",
|
|
10972
10942
|
onResume: D(() => n.invalidateQueries({ queryKey: Z.all }), [n])
|
|
10973
10943
|
},
|
|
10974
|
-
children: /* @__PURE__ */ N(
|
|
10944
|
+
children: /* @__PURE__ */ N(_m, { ...e })
|
|
10975
10945
|
});
|
|
10976
10946
|
}
|
|
10977
|
-
function
|
|
10947
|
+
function _m(t) {
|
|
10978
10948
|
let { dashboardId: n } = Bn(), r = e(), i = s(), a = k(() => Gs(t.templates, r), [t.templates, r]).find((e) => e.id === n), o = rd(a || !i ? void 0 : n), c = k(() => a ? Ws(a, { capabilities: r }) : null, [a, r]);
|
|
10979
|
-
return a && c ? /* @__PURE__ */ N(
|
|
10949
|
+
return a && c ? /* @__PURE__ */ N(vm, {
|
|
10980
10950
|
...t,
|
|
10981
10951
|
dashboard: c,
|
|
10982
10952
|
kind: "template"
|
|
@@ -10987,7 +10957,7 @@ function vm(t) {
|
|
|
10987
10957
|
/* @__PURE__ */ N(G, { className: "h-10 w-full" }),
|
|
10988
10958
|
/* @__PURE__ */ N(G, { className: "h-[420px] w-full" })
|
|
10989
10959
|
]
|
|
10990
|
-
}) : o.data ? /* @__PURE__ */ N(
|
|
10960
|
+
}) : o.data ? /* @__PURE__ */ N(vm, {
|
|
10991
10961
|
...t,
|
|
10992
10962
|
dashboard: o.data,
|
|
10993
10963
|
kind: "custom"
|
|
@@ -10996,14 +10966,14 @@ function vm(t) {
|
|
|
10996
10966
|
children: n ? `Dashboard "${n}" not found.` : "No dashboard available."
|
|
10997
10967
|
});
|
|
10998
10968
|
}
|
|
10999
|
-
function
|
|
10969
|
+
function vm({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
|
|
11000
10970
|
let i = sr(), [, a] = Vn(), { timeRange: o, filters: s, setTimeRange: c, setFilters: l } = ic({ defaultTimeRange: t === "custom" ? e.timeRange : void 0 }), u = ur(), d = m(), { analyticsFilters: f, excludedFilters: p } = k(() => {
|
|
11001
10971
|
let { matching: e, excluded: t } = Ri(s, d, "ANALYTICS");
|
|
11002
10972
|
return {
|
|
11003
10973
|
analyticsFilters: e,
|
|
11004
10974
|
excludedFilters: t
|
|
11005
10975
|
};
|
|
11006
|
-
}, [s, d]), h = ei(k(() => [...e.filters, ...f], [e.filters, f]), u), _ = k(() =>
|
|
10976
|
+
}, [s, d]), h = ei(k(() => [...e.filters, ...f], [e.filters, f]), u), _ = k(() => bd(h.slice(0, e.filters.length), h.slice(e.filters.length)), [h, e.filters.length]), { lockedChips: v, revaluableChips: y, userOwnFilters: b } = _, x = _.effectiveFilters, S = k(() => _.governedFields.size === 0 ? d : d.filter((e) => !_.governedFields.has(e.field)), [d, _.governedFields]), C = Ma(n), w = D((e) => {
|
|
11007
10977
|
l([
|
|
11008
10978
|
...e,
|
|
11009
10979
|
..._.userRevalues,
|
|
@@ -11017,22 +10987,22 @@ function ym({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
|
|
|
11017
10987
|
l(s.filter((t) => t.field !== e));
|
|
11018
10988
|
}, [s, l]), te = D((e, t) => {
|
|
11019
10989
|
l([...s.filter((t) => t.field !== e), t]);
|
|
11020
|
-
}, [s, l]),
|
|
10990
|
+
}, [s, l]), T = i?.isLive ?? !1;
|
|
11021
10991
|
O(() => {
|
|
11022
10992
|
a((e) => {
|
|
11023
10993
|
let t = e.has("live");
|
|
11024
|
-
if (
|
|
10994
|
+
if (T && !t) {
|
|
11025
10995
|
let t = new URLSearchParams(e);
|
|
11026
10996
|
return t.set("live", "1"), t;
|
|
11027
10997
|
}
|
|
11028
|
-
if (!
|
|
10998
|
+
if (!T && t) {
|
|
11029
10999
|
let t = new URLSearchParams(e);
|
|
11030
11000
|
return t.delete("live"), t;
|
|
11031
11001
|
}
|
|
11032
11002
|
return e;
|
|
11033
11003
|
}, { replace: !0 });
|
|
11034
|
-
}, [
|
|
11035
|
-
let
|
|
11004
|
+
}, [T, a]);
|
|
11005
|
+
let ne = D((e) => {
|
|
11036
11006
|
e.type === "absolute" && i?.isLive && i.toggle(), c(e);
|
|
11037
11007
|
}, [c, i]);
|
|
11038
11008
|
return /* @__PURE__ */ P("div", {
|
|
@@ -11055,7 +11025,7 @@ function ym({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
|
|
|
11055
11025
|
className: "mt-0.5 truncate text-xs text-muted-foreground",
|
|
11056
11026
|
children: e.description
|
|
11057
11027
|
})]
|
|
11058
|
-
}), /* @__PURE__ */ N(
|
|
11028
|
+
}), /* @__PURE__ */ N(ym, {
|
|
11059
11029
|
dashboard: e,
|
|
11060
11030
|
kind: t
|
|
11061
11031
|
})]
|
|
@@ -11071,8 +11041,8 @@ function ym({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
|
|
|
11071
11041
|
filters: b,
|
|
11072
11042
|
onFiltersChange: w,
|
|
11073
11043
|
scopeFilterField: n,
|
|
11074
|
-
visibleSignals:
|
|
11075
|
-
leadingChips: /* @__PURE__ */ N(
|
|
11044
|
+
visibleSignals: hm,
|
|
11045
|
+
leadingChips: /* @__PURE__ */ N(mm, {
|
|
11076
11046
|
lockedFilters: v,
|
|
11077
11047
|
revaluableFilters: y,
|
|
11078
11048
|
revaluableDefaults: _.revaluableDefaults,
|
|
@@ -11092,7 +11062,7 @@ function ym({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
|
|
|
11092
11062
|
/* @__PURE__ */ N(J, { children: /* @__PURE__ */ N(rc, {}) }),
|
|
11093
11063
|
/* @__PURE__ */ N(ki, {
|
|
11094
11064
|
value: o,
|
|
11095
|
-
onChange:
|
|
11065
|
+
onChange: ne
|
|
11096
11066
|
})
|
|
11097
11067
|
]
|
|
11098
11068
|
}),
|
|
@@ -11104,15 +11074,15 @@ function ym({ dashboard: e, kind: t, scopeFilterField: n, externalLinks: r }) {
|
|
|
11104
11074
|
]
|
|
11105
11075
|
});
|
|
11106
11076
|
}
|
|
11107
|
-
function
|
|
11108
|
-
let n = zn(), r = Rn(), i = v("observability.dashboards.write"), a = s(), o = id(), c =
|
|
11077
|
+
function ym({ dashboard: e, kind: t }) {
|
|
11078
|
+
let n = zn(), r = Rn(), i = v("observability.dashboards.write"), a = s(), o = id(), c = ld(), [l, u] = j(!1), d = i && a !== null, f = async () => {
|
|
11109
11079
|
try {
|
|
11110
|
-
await navigator.clipboard.writeText(
|
|
11080
|
+
await navigator.clipboard.writeText(Kd(e)), X.success("Dashboard JSON copied to clipboard");
|
|
11111
11081
|
} catch {
|
|
11112
11082
|
X.error("Could not copy to clipboard");
|
|
11113
11083
|
}
|
|
11114
11084
|
}, p = () => {
|
|
11115
|
-
o.mutate(
|
|
11085
|
+
o.mutate(Fd(e), {
|
|
11116
11086
|
onSuccess: (e) => {
|
|
11117
11087
|
X.success(`Duplicated as "${e.title}"`), n(`../${e.id}/edit`, { relative: "path" });
|
|
11118
11088
|
},
|
|
@@ -11183,7 +11153,7 @@ function bm({ dashboard: e, kind: t }) {
|
|
|
11183
11153
|
}
|
|
11184
11154
|
//#endregion
|
|
11185
11155
|
//#region src/data-sources/http-traces-filter-source.ts
|
|
11186
|
-
function
|
|
11156
|
+
function bm(e) {
|
|
11187
11157
|
return {
|
|
11188
11158
|
EQ: "eq",
|
|
11189
11159
|
IN: "in",
|
|
@@ -11196,11 +11166,11 @@ function xm(e) {
|
|
|
11196
11166
|
CONTAINS: "contains"
|
|
11197
11167
|
}[e] ?? e.toLowerCase();
|
|
11198
11168
|
}
|
|
11199
|
-
function
|
|
11169
|
+
function xm(e) {
|
|
11200
11170
|
let t = e.toUpperCase();
|
|
11201
11171
|
return t === "ENUM" || t === "BOOLEAN" ? "enum" : "async";
|
|
11202
11172
|
}
|
|
11203
|
-
function
|
|
11173
|
+
function Sm(e, t) {
|
|
11204
11174
|
let n = t?.fetch ?? globalThis.fetch.bind(globalThis), r = t?.credentials, i = t?.module;
|
|
11205
11175
|
function a(e) {
|
|
11206
11176
|
let n = { ...e }, i = dr(t?.headers);
|
|
@@ -11230,7 +11200,7 @@ function Cm(e, t) {
|
|
|
11230
11200
|
let r = await n(`${e}/observability/traces/filters/definition`, a({ signal: t }));
|
|
11231
11201
|
if (!r.ok) throw Error(`[gamma-lib-observability] HTTP ${r.status} on GET traces/filters/definition`);
|
|
11232
11202
|
return (await r.json()).data.map((e) => {
|
|
11233
|
-
let t =
|
|
11203
|
+
let t = xm(e.type), n = e.operators.map(bm), r = e.type.toUpperCase();
|
|
11234
11204
|
if (r === "BOOLEAN") return {
|
|
11235
11205
|
field: e.name,
|
|
11236
11206
|
label: e.label,
|
|
@@ -11280,8 +11250,8 @@ function Cm(e, t) {
|
|
|
11280
11250
|
}
|
|
11281
11251
|
//#endregion
|
|
11282
11252
|
//#region src/routing/TracingFilterProvider.tsx
|
|
11283
|
-
function
|
|
11284
|
-
let i = k(() =>
|
|
11253
|
+
function Cm({ baseUrl: e, http: t, module: n, children: r }) {
|
|
11254
|
+
let i = k(() => Sm(e, {
|
|
11285
11255
|
...t,
|
|
11286
11256
|
module: n
|
|
11287
11257
|
}), [
|
|
@@ -11303,15 +11273,15 @@ function wm({ baseUrl: e, http: t, module: n, children: r }) {
|
|
|
11303
11273
|
}
|
|
11304
11274
|
//#endregion
|
|
11305
11275
|
//#region src/routing/TracesRouteElement.tsx
|
|
11306
|
-
function
|
|
11307
|
-
return N(e === "drawer" ?
|
|
11276
|
+
function wm({ detailMode: e, pageSize: t, columnVisibilityStorageKey: n, toolbarStart: r, emptyVariant: i }) {
|
|
11277
|
+
return N(e === "drawer" ? Tm : Em, {
|
|
11308
11278
|
pageSize: t,
|
|
11309
11279
|
columnVisibilityStorageKey: n,
|
|
11310
11280
|
toolbarStart: r,
|
|
11311
11281
|
emptyVariant: i
|
|
11312
11282
|
});
|
|
11313
11283
|
}
|
|
11314
|
-
function
|
|
11284
|
+
function Tm({ pageSize: e, columnVisibilityStorageKey: t, toolbarStart: n, emptyVariant: r }) {
|
|
11315
11285
|
let { apiId: i } = Bn(), [a, o] = j(void 0), [s, c] = j([]), l = k(() => a ? s.findIndex((e) => e.traceId === a) : -1, [a, s]), u = D((e) => o(e.traceId), []), d = D(() => o(void 0), []), f = D(() => {
|
|
11316
11286
|
let e = s[l - 1];
|
|
11317
11287
|
e && o(e.traceId);
|
|
@@ -11337,7 +11307,7 @@ function Em({ pageSize: e, columnVisibilityStorageKey: t, toolbarStart: n, empty
|
|
|
11337
11307
|
hasNext: l >= 0 && l < s.length - 1
|
|
11338
11308
|
})] });
|
|
11339
11309
|
}
|
|
11340
|
-
function
|
|
11310
|
+
function Em({ pageSize: e, columnVisibilityStorageKey: t, toolbarStart: n, emptyVariant: r }) {
|
|
11341
11311
|
let i = zn(), { pathname: a } = Rn(), { apiId: o } = Bn();
|
|
11342
11312
|
return /* @__PURE__ */ N(Ll, {
|
|
11343
11313
|
onRowClick: k(() => {
|
|
@@ -11357,7 +11327,7 @@ function Dm({ pageSize: e, columnVisibilityStorageKey: t, toolbarStart: n, empty
|
|
|
11357
11327
|
}
|
|
11358
11328
|
//#endregion
|
|
11359
11329
|
//#region src/routing/TracingScreen.tsx
|
|
11360
|
-
function
|
|
11330
|
+
function Dm(e) {
|
|
11361
11331
|
let t = e !== void 0 && Xl(e), n = F({
|
|
11362
11332
|
queryKey: Z.tracingApis(),
|
|
11363
11333
|
queryFn: ({ signal: t }) => e(t),
|
|
@@ -11381,19 +11351,19 @@ function Om(e) {
|
|
|
11381
11351
|
refetch: () => {}
|
|
11382
11352
|
};
|
|
11383
11353
|
}
|
|
11384
|
-
function
|
|
11354
|
+
function Om(e) {
|
|
11385
11355
|
return k(() => {
|
|
11386
11356
|
if (!(e === void 0 || !Ql(e))) return Zl(e);
|
|
11387
11357
|
}, [e]);
|
|
11388
11358
|
}
|
|
11389
|
-
function
|
|
11390
|
-
let { apiId: i } = Bn(), a = zn(), { pathname: o } = Rn(), { options: s, loading: c, error: l, refetch: u } =
|
|
11359
|
+
function km({ loadTracingApis: e, detailMode: t = "drawer", pageSize: n, columnVisibilityStorageKey: r }) {
|
|
11360
|
+
let { apiId: i } = Bn(), a = zn(), { pathname: o } = Rn(), { options: s, loading: c, error: l, refetch: u } = Dm(e), d = Om(e), f = e !== void 0, p = k(() => {
|
|
11391
11361
|
let e = o.replace(/\/+$/, "");
|
|
11392
11362
|
if (!i) return e;
|
|
11393
11363
|
let t = e.lastIndexOf("/");
|
|
11394
11364
|
return t > 0 ? e.slice(0, t) : e;
|
|
11395
11365
|
}, [o, i]), m = D((e) => a(`${p}/${encodeURIComponent(e)}`), [a, p]);
|
|
11396
|
-
return /* @__PURE__ */ N(
|
|
11366
|
+
return /* @__PURE__ */ N(wm, {
|
|
11397
11367
|
detailMode: t,
|
|
11398
11368
|
pageSize: n,
|
|
11399
11369
|
columnVisibilityStorageKey: r,
|
|
@@ -11415,9 +11385,9 @@ function Am({ loadTracingApis: e, detailMode: t = "drawer", pageSize: n, columnV
|
|
|
11415
11385
|
}
|
|
11416
11386
|
//#endregion
|
|
11417
11387
|
//#region src/routing/ObservabilityRoutes.tsx
|
|
11418
|
-
var
|
|
11419
|
-
function
|
|
11420
|
-
let n = e?.scopeApiTypes ?? t, r = e?.contextFilters ??
|
|
11388
|
+
var Am = [];
|
|
11389
|
+
function jm(e, t) {
|
|
11390
|
+
let n = e?.scopeApiTypes ?? t, r = e?.contextFilters ?? Am, i = e?.scopeFilterField;
|
|
11421
11391
|
return n?.length && (i ||= "API_TYPE", r.some((e) => e.field === "API_TYPE") || (r = [{
|
|
11422
11392
|
field: "API_TYPE",
|
|
11423
11393
|
operator: "in",
|
|
@@ -11427,28 +11397,28 @@ function Mm(e, t) {
|
|
|
11427
11397
|
scopeFilterField: i
|
|
11428
11398
|
};
|
|
11429
11399
|
}
|
|
11430
|
-
function
|
|
11400
|
+
function Mm(e, t, n) {
|
|
11431
11401
|
return e ? /* @__PURE__ */ N(_, {
|
|
11432
11402
|
dataSource: t,
|
|
11433
11403
|
children: n
|
|
11434
11404
|
}) : n;
|
|
11435
11405
|
}
|
|
11436
|
-
function
|
|
11406
|
+
function Nm(e, t, n) {
|
|
11437
11407
|
return e ? /* @__PURE__ */ N(c, {
|
|
11438
11408
|
dataSource: t,
|
|
11439
11409
|
children: n
|
|
11440
11410
|
}) : n;
|
|
11441
11411
|
}
|
|
11442
|
-
function
|
|
11412
|
+
function Pm({ children: e }) {
|
|
11443
11413
|
let t = ur(), { data: n, isLoading: r, isError: i } = F({
|
|
11444
11414
|
queryKey: ["observability", "filter-definitions"],
|
|
11445
11415
|
queryFn: ({ signal: e }) => t.fetchFilterDefinitions(e),
|
|
11446
11416
|
enabled: !!t,
|
|
11447
11417
|
staleTime: 300 * 1e3
|
|
11448
11418
|
});
|
|
11449
|
-
return r ? /* @__PURE__ */ N(
|
|
11419
|
+
return r ? /* @__PURE__ */ N(Fm, {}) : i || !n ? /* @__PURE__ */ N(M, { children: e([]) }) : /* @__PURE__ */ N(M, { children: e(n) });
|
|
11450
11420
|
}
|
|
11451
|
-
function
|
|
11421
|
+
function Fm() {
|
|
11452
11422
|
return /* @__PURE__ */ P("div", {
|
|
11453
11423
|
className: "flex items-center gap-2 p-4",
|
|
11454
11424
|
children: [
|
|
@@ -11458,26 +11428,26 @@ function Im() {
|
|
|
11458
11428
|
]
|
|
11459
11429
|
});
|
|
11460
11430
|
}
|
|
11461
|
-
function
|
|
11431
|
+
function Im({ baseUrl: e, http: t, children: n }) {
|
|
11462
11432
|
let { apiId: r } = Bn();
|
|
11463
|
-
return /* @__PURE__ */ N(
|
|
11433
|
+
return /* @__PURE__ */ N(Cm, {
|
|
11464
11434
|
baseUrl: e,
|
|
11465
11435
|
http: t,
|
|
11466
11436
|
module: r,
|
|
11467
11437
|
children: n
|
|
11468
11438
|
});
|
|
11469
11439
|
}
|
|
11470
|
-
function
|
|
11440
|
+
function Lm({ templates: t, contextFilters: n }) {
|
|
11471
11441
|
let r = e(), i = s(), a = nd(), o = k(() => Gs(t, r), [t, r]), c = r["observability.dashboards.write"] && i !== null, l = i !== null && a.isLoading, u = (a.data?.length ?? 0) > 0;
|
|
11472
11442
|
return !c && !l && !u && o.length === 1 && o[0] ? /* @__PURE__ */ N(Fn, {
|
|
11473
11443
|
to: `./${o[0].id}`,
|
|
11474
11444
|
replace: !0
|
|
11475
11445
|
}) : l && !c ? null : /* @__PURE__ */ N(Mr, {
|
|
11476
11446
|
filters: n,
|
|
11477
|
-
children: /* @__PURE__ */ N(
|
|
11447
|
+
children: /* @__PURE__ */ N(am, { templates: t })
|
|
11478
11448
|
});
|
|
11479
11449
|
}
|
|
11480
|
-
function
|
|
11450
|
+
function Rm({ contextFilters: t, scopeFilterField: n }) {
|
|
11481
11451
|
let r = e(), i = s();
|
|
11482
11452
|
return !r["observability.dashboards.write"] || i === null ? /* @__PURE__ */ N(Fn, {
|
|
11483
11453
|
to: "..",
|
|
@@ -11485,27 +11455,27 @@ function zm({ contextFilters: t, scopeFilterField: n }) {
|
|
|
11485
11455
|
relative: "path"
|
|
11486
11456
|
}) : /* @__PURE__ */ N(Mr, {
|
|
11487
11457
|
filters: t,
|
|
11488
|
-
children: /* @__PURE__ */ N(
|
|
11458
|
+
children: /* @__PURE__ */ N(pp, { scopeFilterField: n })
|
|
11489
11459
|
});
|
|
11490
11460
|
}
|
|
11491
|
-
function
|
|
11492
|
-
let C = hr(), w = gr(i ?? C), ee = e(), te = l(),
|
|
11461
|
+
function zm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProviders: c, logsPage: u, logsDataSource: d, logsColumns: f, logsOnRowClick: m, logsGetRowId: _, logsGetApiId: v, logsDetailBasePath: y, tracesDataSource: b, loadTracingApis: x, config: S }) {
|
|
11462
|
+
let C = hr(), w = gr(i ?? C), ee = e(), te = l(), T = k(() => Hp(n, w), [n, w]), ne = o !== void 0 || te === null, re = o ?? te ?? T, ie = k(() => Gp(n, w), [n, w]), ae = a(), oe = k(() => S.features.logs?.enabled ? qp(n, w) : void 0, [
|
|
11493
11463
|
n,
|
|
11494
11464
|
w,
|
|
11495
11465
|
S.features.logs?.enabled
|
|
11496
|
-
]), se = d ?? ae ?? oe, ce = d !== void 0 || ae === null, le = t(), E = r ?? n, ue = k(() => S.features.tracing?.enabled ?
|
|
11466
|
+
]), se = d ?? ae ?? oe, ce = d !== void 0 || ae === null, le = t(), E = r ?? n, ue = k(() => S.features.tracing?.enabled ? rm(E, w) : void 0, [
|
|
11497
11467
|
E,
|
|
11498
11468
|
w,
|
|
11499
11469
|
S.features.tracing?.enabled
|
|
11500
11470
|
]), de = b ?? le ?? ue, fe = b !== void 0 || le === null, pe = S.features.dashboards, me = s(), [he, ge] = j(() => ({
|
|
11501
11471
|
baseUrl: n,
|
|
11502
|
-
store:
|
|
11472
|
+
store: vp()
|
|
11503
11473
|
}));
|
|
11504
11474
|
he.baseUrl !== n && ge({
|
|
11505
11475
|
baseUrl: n,
|
|
11506
|
-
store:
|
|
11476
|
+
store: vp()
|
|
11507
11477
|
});
|
|
11508
|
-
let _e = k(() => pe?.enabled ?
|
|
11478
|
+
let _e = k(() => pe?.enabled ? Ap(n, {
|
|
11509
11479
|
...w,
|
|
11510
11480
|
revisionStore: he.store
|
|
11511
11481
|
}) : void 0, [
|
|
@@ -11513,7 +11483,7 @@ function Bm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
|
|
|
11513
11483
|
w,
|
|
11514
11484
|
pe?.enabled,
|
|
11515
11485
|
he
|
|
11516
|
-
]), ve = me ?? _e, ye = me === null, be = S.features.logs, xe = S.features.tracing, Se =
|
|
11486
|
+
]), ve = me ?? _e, ye = me === null, be = S.features.logs, xe = S.features.tracing, Se = jm(pe, S.scopeApiTypes), Ce = jm(be, S.scopeApiTypes), we = be?.enabled, Te = be?.logDetail, Ee = k(() => {
|
|
11517
11487
|
if (we) return Te || rl({ basePath: y ?? "" });
|
|
11518
11488
|
}, [
|
|
11519
11489
|
we,
|
|
@@ -11525,21 +11495,21 @@ function Bm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
|
|
|
11525
11495
|
pe?.enabled && /* @__PURE__ */ P(M, { children: [
|
|
11526
11496
|
/* @__PURE__ */ N(In, {
|
|
11527
11497
|
path: "dashboards",
|
|
11528
|
-
element: /* @__PURE__ */ N(
|
|
11498
|
+
element: /* @__PURE__ */ N(Lm, {
|
|
11529
11499
|
templates: pe.templates,
|
|
11530
11500
|
contextFilters: Se.contextFilters
|
|
11531
11501
|
})
|
|
11532
11502
|
}),
|
|
11533
11503
|
/* @__PURE__ */ N(In, {
|
|
11534
11504
|
path: "dashboards/new",
|
|
11535
|
-
element: /* @__PURE__ */ N(
|
|
11505
|
+
element: /* @__PURE__ */ N(Rm, {
|
|
11536
11506
|
contextFilters: Se.contextFilters,
|
|
11537
11507
|
scopeFilterField: Se.scopeFilterField
|
|
11538
11508
|
})
|
|
11539
11509
|
}),
|
|
11540
11510
|
/* @__PURE__ */ N(In, {
|
|
11541
11511
|
path: "dashboards/:dashboardId/edit",
|
|
11542
|
-
element: /* @__PURE__ */ N(
|
|
11512
|
+
element: /* @__PURE__ */ N(Rm, {
|
|
11543
11513
|
contextFilters: Se.contextFilters,
|
|
11544
11514
|
scopeFilterField: Se.scopeFilterField
|
|
11545
11515
|
})
|
|
@@ -11548,7 +11518,7 @@ function Bm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
|
|
|
11548
11518
|
path: "dashboards/:dashboardId",
|
|
11549
11519
|
element: /* @__PURE__ */ N(Mr, {
|
|
11550
11520
|
filters: Se.contextFilters,
|
|
11551
|
-
children: /* @__PURE__ */ N(
|
|
11521
|
+
children: /* @__PURE__ */ N(gm, {
|
|
11552
11522
|
templates: pe.templates,
|
|
11553
11523
|
scopeFilterField: Se.scopeFilterField,
|
|
11554
11524
|
externalLinks: pe.externalLinks
|
|
@@ -11560,7 +11530,7 @@ function Bm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
|
|
|
11560
11530
|
path: "logs",
|
|
11561
11531
|
element: /* @__PURE__ */ N(Mr, {
|
|
11562
11532
|
filters: Ce.contextFilters,
|
|
11563
|
-
children: u ?? (se ?
|
|
11533
|
+
children: u ?? (se ? Mm(ce, se, /* @__PURE__ */ N(lm, {
|
|
11564
11534
|
columns: Oe,
|
|
11565
11535
|
getRowId: ke,
|
|
11566
11536
|
getApiId: Ae,
|
|
@@ -11581,16 +11551,16 @@ function Bm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
|
|
|
11581
11551
|
path: "logs/:logId",
|
|
11582
11552
|
element: /* @__PURE__ */ N(Mr, {
|
|
11583
11553
|
filters: Ce.contextFilters,
|
|
11584
|
-
children:
|
|
11554
|
+
children: Mm(ce, se, /* @__PURE__ */ N(Bm, { config: Ee }))
|
|
11585
11555
|
})
|
|
11586
11556
|
}),
|
|
11587
11557
|
xe?.enabled && ee["observability.traces.read"] && de && /* @__PURE__ */ P(M, { children: [
|
|
11588
11558
|
/* @__PURE__ */ N(In, {
|
|
11589
11559
|
path: "tracing",
|
|
11590
|
-
element:
|
|
11560
|
+
element: Nm(fe, de, /* @__PURE__ */ N(Im, {
|
|
11591
11561
|
baseUrl: E,
|
|
11592
11562
|
http: w,
|
|
11593
|
-
children: /* @__PURE__ */ N(
|
|
11563
|
+
children: /* @__PURE__ */ N(km, {
|
|
11594
11564
|
loadTracingApis: x,
|
|
11595
11565
|
detailMode: xe.detailMode ?? "drawer",
|
|
11596
11566
|
pageSize: xe.pageSize,
|
|
@@ -11600,10 +11570,10 @@ function Bm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
|
|
|
11600
11570
|
}),
|
|
11601
11571
|
/* @__PURE__ */ N(In, {
|
|
11602
11572
|
path: "tracing/:apiId",
|
|
11603
|
-
element:
|
|
11573
|
+
element: Nm(fe, de, /* @__PURE__ */ N(Im, {
|
|
11604
11574
|
baseUrl: E,
|
|
11605
11575
|
http: w,
|
|
11606
|
-
children: /* @__PURE__ */ N(
|
|
11576
|
+
children: /* @__PURE__ */ N(km, {
|
|
11607
11577
|
loadTracingApis: x,
|
|
11608
11578
|
detailMode: xe.detailMode ?? "drawer",
|
|
11609
11579
|
pageSize: xe.pageSize,
|
|
@@ -11613,7 +11583,7 @@ function Bm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
|
|
|
11613
11583
|
}),
|
|
11614
11584
|
/* @__PURE__ */ N(In, {
|
|
11615
11585
|
path: "tracing/:apiId/:traceId",
|
|
11616
|
-
element:
|
|
11586
|
+
element: Nm(fe, de, /* @__PURE__ */ N(zu, {}))
|
|
11617
11587
|
})
|
|
11618
11588
|
] }),
|
|
11619
11589
|
/* @__PURE__ */ N(In, {
|
|
@@ -11635,24 +11605,24 @@ function Bm({ baseUrl: n, tracesBaseUrl: r, http: i, dataSource: o, filterProvid
|
|
|
11635
11605
|
] })
|
|
11636
11606
|
}), Me = /* @__PURE__ */ N(ar, { children: pe?.enabled || be?.enabled ? /* @__PURE__ */ N(lr, {
|
|
11637
11607
|
source: ie,
|
|
11638
|
-
children: c ? je(c) : /* @__PURE__ */ N(
|
|
11608
|
+
children: c ? je(c) : /* @__PURE__ */ N(Pm, { children: (e) => je(e) })
|
|
11639
11609
|
}) : je(c ?? []) }), Ne = ye && ve ? /* @__PURE__ */ N(p, {
|
|
11640
11610
|
persistence: ve,
|
|
11641
11611
|
children: Me
|
|
11642
11612
|
}) : Me;
|
|
11643
|
-
return
|
|
11644
|
-
dataSource:
|
|
11613
|
+
return ne ? /* @__PURE__ */ N(h, {
|
|
11614
|
+
dataSource: re,
|
|
11645
11615
|
children: Ne
|
|
11646
11616
|
}) : Ne;
|
|
11647
11617
|
}
|
|
11648
|
-
function
|
|
11618
|
+
function Bm({ config: e }) {
|
|
11649
11619
|
let t = zn(), { filters: n, timeRange: r } = ic();
|
|
11650
11620
|
return /* @__PURE__ */ N(Dl, {
|
|
11651
11621
|
config: e,
|
|
11652
11622
|
onFilter: D((e, i) => {
|
|
11653
11623
|
t({
|
|
11654
11624
|
pathname: "..",
|
|
11655
|
-
search:
|
|
11625
|
+
search: cm(sm(n, e, i), r)
|
|
11656
11626
|
}, { relative: "path" });
|
|
11657
11627
|
}, [
|
|
11658
11628
|
n,
|
|
@@ -11663,9 +11633,9 @@ function Vm({ config: e }) {
|
|
|
11663
11633
|
}
|
|
11664
11634
|
//#endregion
|
|
11665
11635
|
//#region src/routing/define-observability-features.ts
|
|
11666
|
-
var
|
|
11636
|
+
var Vm = {
|
|
11667
11637
|
dashboards: {
|
|
11668
|
-
icon:
|
|
11638
|
+
icon: re,
|
|
11669
11639
|
title: "Dashboards",
|
|
11670
11640
|
order: 0,
|
|
11671
11641
|
showInNav: !0
|
|
@@ -11683,10 +11653,10 @@ var Hm = {
|
|
|
11683
11653
|
showInNav: !0
|
|
11684
11654
|
}
|
|
11685
11655
|
};
|
|
11686
|
-
function
|
|
11687
|
-
let t = e.basePath ?? "observe", n =
|
|
11656
|
+
function Hm(e) {
|
|
11657
|
+
let t = e.basePath ?? "observe", n = Um(e), r = Wm(e, n, t), i = n.map((e) => `${t}/${e}`), a = Gm(n, t);
|
|
11688
11658
|
function o(t) {
|
|
11689
|
-
return Fe(
|
|
11659
|
+
return Fe(zm, {
|
|
11690
11660
|
...t,
|
|
11691
11661
|
config: e
|
|
11692
11662
|
});
|
|
@@ -11715,13 +11685,13 @@ function Um(e) {
|
|
|
11715
11685
|
breadcrumbSegments: c
|
|
11716
11686
|
};
|
|
11717
11687
|
}
|
|
11718
|
-
function
|
|
11688
|
+
function Um(e) {
|
|
11719
11689
|
let t = [];
|
|
11720
|
-
return e.features.dashboards?.enabled && t.push("dashboards"), e.features.logs?.enabled && t.push("logs"), e.features.tracing?.enabled && t.push("tracing"), t.sort((e, t) =>
|
|
11690
|
+
return e.features.dashboards?.enabled && t.push("dashboards"), e.features.logs?.enabled && t.push("logs"), e.features.tracing?.enabled && t.push("tracing"), t.sort((e, t) => Vm[e].order - Vm[t].order);
|
|
11721
11691
|
}
|
|
11722
|
-
function
|
|
11723
|
-
let r = t.filter((e) =>
|
|
11724
|
-
let r =
|
|
11692
|
+
function Wm(e, t, n) {
|
|
11693
|
+
let r = t.filter((e) => Vm[e].showInNav).map((t) => {
|
|
11694
|
+
let r = Vm[t], i = e.nav.overrides?.[t];
|
|
11725
11695
|
return {
|
|
11726
11696
|
key: `${n}/${t}`,
|
|
11727
11697
|
title: i?.title ?? r.title,
|
|
@@ -11733,10 +11703,10 @@ function Gm(e, t, n) {
|
|
|
11733
11703
|
items: r
|
|
11734
11704
|
};
|
|
11735
11705
|
}
|
|
11736
|
-
function
|
|
11706
|
+
function Gm(e, t) {
|
|
11737
11707
|
let n = {};
|
|
11738
11708
|
for (let r of e) {
|
|
11739
|
-
let e =
|
|
11709
|
+
let e = Vm[r], i = `${t}/${r}`;
|
|
11740
11710
|
n[i] = {
|
|
11741
11711
|
path: `${t}/${r}`,
|
|
11742
11712
|
label: e.title
|
|
@@ -11746,7 +11716,7 @@ function Km(e, t) {
|
|
|
11746
11716
|
}
|
|
11747
11717
|
//#endregion
|
|
11748
11718
|
//#region src/build-observability-base-url.ts
|
|
11749
|
-
function
|
|
11719
|
+
function Km(e, t, n, r) {
|
|
11750
11720
|
let i = e;
|
|
11751
11721
|
if (r?.useDevProxy) try {
|
|
11752
11722
|
i = new URL(i).pathname;
|
|
@@ -11755,21 +11725,21 @@ function qm(e, t, n, r) {
|
|
|
11755
11725
|
}
|
|
11756
11726
|
//#endregion
|
|
11757
11727
|
//#region src/build-traces-base-url.ts
|
|
11758
|
-
function
|
|
11759
|
-
return
|
|
11728
|
+
function qm(e, t, n, r) {
|
|
11729
|
+
return Km(e, t, n, r);
|
|
11760
11730
|
}
|
|
11761
11731
|
//#endregion
|
|
11762
11732
|
//#region src/persistence/local-storage-dashboard-persistence.ts
|
|
11763
|
-
var
|
|
11764
|
-
function
|
|
11765
|
-
let t = e.storageKey ??
|
|
11733
|
+
var Jm = "observability.custom-dashboards", Ym = 1;
|
|
11734
|
+
function Xm(e = {}) {
|
|
11735
|
+
let t = e.storageKey ?? Jm, n = () => {
|
|
11766
11736
|
if (e.storage) return e.storage;
|
|
11767
11737
|
if (typeof window > "u" || !window.localStorage) throw Error("[gamma-lib-observability] localStorage is not available in this environment.");
|
|
11768
11738
|
return window.localStorage;
|
|
11769
11739
|
}, r = () => {
|
|
11770
11740
|
let e = n().getItem(t);
|
|
11771
11741
|
if (!e) return {
|
|
11772
|
-
version:
|
|
11742
|
+
version: Ym,
|
|
11773
11743
|
dashboards: {}
|
|
11774
11744
|
};
|
|
11775
11745
|
let r = JSON.parse(e);
|
|
@@ -11832,4 +11802,4 @@ function Zm(e = {}) {
|
|
|
11832
11802
|
};
|
|
11833
11803
|
}
|
|
11834
11804
|
//#endregion
|
|
11835
|
-
export { Hn as API_TYPE_REGISTRY, xo as BarPresentation, pi as CODEC_VERSION, o as CapabilityProvider, ls as CartesianPresentation, Mr as ContextFiltersProvider, ss as DASHBOARD_BUCKET_TARGET, y as DEFAULT_CAPABILITIES, tr as DEFAULT_MEASURE, oi as DEFAULT_PERIOD, rr as DEFAULT_REFRESH_INTERVAL_MS, _r as DEFAULT_STALE_TIME, mi as DEFAULT_TIME_RANGE, Gu as DashboardConflictError, Uu as DashboardForbiddenError, Wu as DashboardNotFoundError, Hu as DashboardPersistenceError, p as DashboardPersistenceProvider, qs as DashboardTemplatesProvider, zs as DashboardView, gs as DoughnutPresentation, ec as ExplorerTable, n as FILTER_OPERATORS, Pi as FILTER_SCOPES, Ha as FilterBar, ka as FilterChip, ya as FilterPopoverForm, Ki as FilterPropertyCombobox, g as FilterProvidersProvider, $a as HTTP_STATUS_PALETTE, mr as HttpProvider, rc as LiveIndicator, ar as LiveRefreshProvider, Q as LogDetailCodeBlock, cl as LogDetailContextChart, Tl as LogDetailDrawer, pl as LogDetailDrawerShell, Ac as LogDetailEmptyField, _l as LogDetailHeader, jc as LogDetailHeadersTable, Mc as LogDetailJsonTree, $ as LogDetailKeyValueGrid, vl as LogDetailMetrics, Dl as LogDetailPage, xl as LogDetailSection, bl as LogDetailSections, cc as LogSeverityBadge, vc as LogTable, _ as LogsDataSourceProvider, Sc as LogsExplorerPage, xs as MetricGroupPresentation, Es as MetricPresentation, h as MetricsDataSourceProvider, ui as PERIOD_DISPLAY_LABELS, li as PERIOD_LABELS, cu as POLICY_POST_EVENT, su as POLICY_PRE_EVENT, si as PRESET_CATEGORIES, iu as PolicyAttributeDiff, tc as QueryErrorBanner, ci as RELATIVE_PERIODS, Ni as SCOPE_COMMON, Mi as SIGNAL_DATA_TYPES, qn as SIGNAL_REGISTRY, gu as SpanDetailPanel, ki as TimeRangePicker, Bu as TraceDetailDrawer, zu as TraceDetailPage, Pu as TraceDetailShell, Ll as TraceExplorerPage, Eu as TraceLineage, kl as TraceStatusBadge, Fl as TraceTable, Mu as TraceTimeline, c as TracesDataSourceProvider, ql as TracingApiSelector,
|
|
11805
|
+
export { Hn as API_TYPE_REGISTRY, xo as BarPresentation, pi as CODEC_VERSION, o as CapabilityProvider, ls as CartesianPresentation, Mr as ContextFiltersProvider, ss as DASHBOARD_BUCKET_TARGET, y as DEFAULT_CAPABILITIES, tr as DEFAULT_MEASURE, oi as DEFAULT_PERIOD, rr as DEFAULT_REFRESH_INTERVAL_MS, _r as DEFAULT_STALE_TIME, mi as DEFAULT_TIME_RANGE, Gu as DashboardConflictError, Uu as DashboardForbiddenError, Wu as DashboardNotFoundError, Hu as DashboardPersistenceError, p as DashboardPersistenceProvider, qs as DashboardTemplatesProvider, zs as DashboardView, gs as DoughnutPresentation, ec as ExplorerTable, n as FILTER_OPERATORS, Pi as FILTER_SCOPES, Ha as FilterBar, ka as FilterChip, ya as FilterPopoverForm, Ki as FilterPropertyCombobox, g as FilterProvidersProvider, $a as HTTP_STATUS_PALETTE, mr as HttpProvider, rc as LiveIndicator, ar as LiveRefreshProvider, Q as LogDetailCodeBlock, cl as LogDetailContextChart, Tl as LogDetailDrawer, pl as LogDetailDrawerShell, Ac as LogDetailEmptyField, _l as LogDetailHeader, jc as LogDetailHeadersTable, Mc as LogDetailJsonTree, $ as LogDetailKeyValueGrid, vl as LogDetailMetrics, Dl as LogDetailPage, xl as LogDetailSection, bl as LogDetailSections, cc as LogSeverityBadge, vc as LogTable, _ as LogsDataSourceProvider, Sc as LogsExplorerPage, xs as MetricGroupPresentation, Es as MetricPresentation, h as MetricsDataSourceProvider, ui as PERIOD_DISPLAY_LABELS, li as PERIOD_LABELS, cu as POLICY_POST_EVENT, su as POLICY_PRE_EVENT, si as PRESET_CATEGORIES, iu as PolicyAttributeDiff, tc as QueryErrorBanner, ci as RELATIVE_PERIODS, Ni as SCOPE_COMMON, Mi as SIGNAL_DATA_TYPES, qn as SIGNAL_REGISTRY, gu as SpanDetailPanel, ki as TimeRangePicker, Bu as TraceDetailDrawer, zu as TraceDetailPage, Pu as TraceDetailShell, Ll as TraceExplorerPage, Eu as TraceLineage, kl as TraceStatusBadge, Fl as TraceTable, Mu as TraceTimeline, c as TracesDataSourceProvider, ql as TracingApiSelector, km as TracingScreen, Hs as WidgetGroup, Fs as WidgetItem, Ec as buildApiTypeLink, Ta as buildChipLabel, Ea as buildChipLabelParts, Da as buildChipTooltip, Dc as buildDefaultConnectionLogColumns, rl as buildDefaultLogDetailConfig, Hi as buildFilterScopes, Cc as buildLogsDeepLink, Km as buildObservabilityBaseUrl, Ii as buildScopeFromId, qm as buildTracesBaseUrl, $l as buildTracesDeepLink, js as clearWidgetRenderers, cs as computeBucketInterval, pu as computePolicyAttributeDiff, jo as computePreviousTimeRange, To as computeTrend, Ic as connectionLogPreset, vp as createDashboardRevisionStore, Ap as createHttpDashboardPersistence, Hp as createHttpDataSource, Gp as createHttpFilterSource, qp as createHttpLogsSource, Sm as createHttpTracesFilterSource, rm as createHttpTracesSource, Xm as createLocalStorageDashboardPersistence, bi as decodeObservabilityState, Us as defineDashboardTemplate, Ai as defineFilterProvider, el as defineLogDetail, Hm as defineObservabilityFeatures, yi as encodeObservabilityState, Co as extractMeasureValue, Eo as extractSparklineData, Qa as facetsToBar, Xa as facetsToDoughnut, jl as formatDuration, Al as formatTraceTime, Wn as getApiType, Kn as getApiTypeOrFallback, Pr as getLocaleWeekStart, Yn as getSignal, As as getWidgetRenderer, Qn as isBarWidget, Xn as isCartesianWidget, Zn as isDoughnutWidget, er as isMetricGroupWidget, $n as isMetricWidget, la as isMultiSelectForFilter, to as isStatusFacetField, Xl as isTracingApiLegacyLoader, Ql as isTracingApiPaginatedLoad, Yl as isTracingApiPaginatedLoader, Jl as isTracingApiPaginatedLoaderConfig, wo as measureResultToMetric, Or as mergeFilters, ts as mergeTimeSeriesToCartesian, Hc as messageLogPreset, ua as normalizeMembershipOperatorForValues, no as normalizeStatusGroupKey, Z as observabilityQueryKeys, ia as operatorLabel, aa as operatorNeedsValue, qd as parseDashboardJson, Ns as registerDefaultRenderers, ks as registerWidgetRenderer, Ws as resolveDashboardFromTemplate, Gi as resolveDataTypeIds, oo as resolveGroupColor, tl as resolveLogDetailVariant, nr as resolveMeasure, nl as resolvePreset, Vr as resolveRelativePeriod, Ur as resolveStableTimeRange, ro as resolveStatusPaletteColor, Zl as resolveTracingApiPaginatedLoader, Kd as serializeDashboard, Ui as toFilterItems, sd as useAdoptServerDashboard, e as useCapabilities, v as useCapability, Nr as useContextFilters, id as useCreateDashboardMutation, rd as useCustomDashboardQuery, nd as useCustomDashboardsQuery, u as useDashboardPersistence, Ys as useDashboardTemplate, Js as useDashboardTemplates, ld as useDeleteDashboardMutation, qr as useFacetsQuery, d as useFilterProvider, m as useFilterProviders, hr as useHttpOptions, wr as useInfiniteOptions, or as useLiveRefresh, ul as useLogDetailDrawerExpand, Jr as useLogDetailQuery, i as useLogsDataSource, Qr as useLogsPagedQuery, Yr as useLogsQuery, $r as useMeasuresQuery, co as useMergedWidgetFilters, r as useMetricsDataSource, s as useOptionalDashboardPersistence, sr as useOptionalLiveRefresh, a as useOptionalLogsDataSource, l as useOptionalMetricsDataSource, t as useOptionalTracesDataSource, od as useOverwriteDashboardMutation, gr as useStableHttpOptions, Gr as useStableTimeRange, ti as useTimeSeriesQuery, ni as useTraceDetailQuery, f as useTracesDataSource, ai as useTracesPagedQuery, ad as useUpdateDashboardMutation, Ka as useWidgetGroupContext, qc as webhookLogPreset };
|