@kong-ui-public/dashboard-renderer 0.29.2 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard-renderer.es.js +528 -407
- package/dist/dashboard-renderer.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/BaseAnalyticsChartRenderer.vue.d.ts +3 -0
- package/dist/types/components/BaseAnalyticsChartRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/DashboardRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/DashboardTile.vue.d.ts.map +1 -1
- package/dist/types/components/GoldenSignalsRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/QueryDataProvider.vue.d.ts +7 -4
- package/dist/types/components/QueryDataProvider.vue.d.ts.map +1 -1
- package/dist/types/components/TopNTableRenderer.vue.d.ts.map +1 -1
- package/dist/types/composables/index.d.ts +2 -0
- package/dist/types/composables/index.d.ts.map +1 -1
- package/dist/types/composables/useEvauluateFeatureFlag.d.ts +4 -0
- package/dist/types/composables/useEvauluateFeatureFlag.d.ts.map +1 -0
- package/package.json +5 -5
|
@@ -1,56 +1,57 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { SimpleChart as
|
|
3
|
-
import
|
|
1
|
+
import { ref as A, watchEffect as de, inject as K, defineComponent as E, onUnmounted as oe, computed as v, watch as pe, resolveComponent as N, unref as l, openBlock as p, createBlock as g, withCtx as _, createTextVNode as M, toDisplayString as O, renderSlot as Q, createCommentVNode as w, useCssVars as $, createElementVNode as L, createVNode as F, mergeProps as ae, createSlots as ie, createElementBlock as D, normalizeProps as ye, guardReactiveProps as he, resolveDynamicComponent as me, onMounted as fe, Fragment as ge, renderList as ve, normalizeClass as be, normalizeStyle as te } from "vue";
|
|
2
|
+
import { SimpleChart as _e, AnalyticsChart as qe, TopNTable as Ce, CsvExportModal as Se, ChartMetricDisplay as Ee } from "@kong-ui-public/analytics-chart";
|
|
3
|
+
import xe from "swrv";
|
|
4
4
|
import "axios";
|
|
5
|
-
import { createI18n as
|
|
6
|
-
import { stripUnknownFilters as
|
|
7
|
-
import { MetricsProvider as
|
|
8
|
-
import { EntityLink as
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
import { createI18n as Te, i18nTComponent as Ae } from "@kong-ui-public/i18n";
|
|
6
|
+
import { stripUnknownFilters as De, Timeframe as Ie, TimePeriods as Re, granularityValues as ke, exploreFilterTypesV2 as we, exploreAggregations as Oe, queryableExploreDimensions as Fe, filterableExploreDimensions as Pe, basicExploreAggregations as Le, queryableBasicExploreDimensions as Ne, filterableBasicExploreDimensions as $e, aiExploreAggregations as je, queryableAiExploreDimensions as Ke, filterableAiExploreDimensions as ze, relativeTimeRangeValuesV4 as Ve } from "@kong-ui-public/analytics-utilities";
|
|
7
|
+
import { MetricsProvider as Me, MetricsConsumer as Be } from "@kong-ui-public/analytics-metric-provider";
|
|
8
|
+
import { EntityLink as Ue } from "@kong-ui-public/entities-shared";
|
|
9
|
+
import { MoreIcon as Ge } from "@kong/icons";
|
|
10
|
+
import { useAnalyticsConfigStore as He } from "@kong-ui-public/analytics-config-store";
|
|
11
|
+
var se = /* @__PURE__ */ ((e) => (e.VALIDATING = "VALIDATING", e.VALIDATING_HAS_DATA = "VALIDATING_HAS_DATA", e.PENDING = "PENDING", e.SUCCESS = "SUCCESS", e.SUCCESS_HAS_DATA = "SUCCESS_HAS_DATA", e.ERROR = "ERROR", e.STALE_IF_ERROR = "STALE_IF_ERROR", e))(se || {});
|
|
12
|
+
const Qe = (e) => {
|
|
13
|
+
var r, t, n, i, o;
|
|
13
14
|
return e ? !!// TODO: revisit: currently only the first check ever matters?
|
|
14
|
-
((
|
|
15
|
+
((r = Object.keys(e)) != null && r.length || (t = e.data) != null && t.length || (i = (n = e.data) == null ? void 0 : n.data) != null && i.length || !((o = e.data) != null && o.data) && typeof e.data == "object" && Object.keys(e == null ? void 0 : e.data).length) : !1;
|
|
15
16
|
};
|
|
16
|
-
function
|
|
17
|
-
const
|
|
17
|
+
function Je(e = A({}), r, t, n = Qe) {
|
|
18
|
+
const i = A(
|
|
18
19
|
"PENDING"
|
|
19
20
|
/* PENDING */
|
|
20
21
|
);
|
|
21
|
-
return
|
|
22
|
-
const
|
|
23
|
-
if (e.value &&
|
|
24
|
-
|
|
22
|
+
return de(() => {
|
|
23
|
+
const o = n(e.value);
|
|
24
|
+
if (e.value && o && t.value) {
|
|
25
|
+
i.value = "VALIDATING_HAS_DATA";
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
|
-
if (e.value &&
|
|
28
|
-
|
|
28
|
+
if (e.value && t.value) {
|
|
29
|
+
i.value = "VALIDATING";
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
|
-
if (e.value &&
|
|
32
|
-
|
|
32
|
+
if (e.value && r.value) {
|
|
33
|
+
i.value = "STALE_IF_ERROR";
|
|
33
34
|
return;
|
|
34
35
|
}
|
|
35
|
-
if (e.value === void 0 && !
|
|
36
|
-
|
|
36
|
+
if (e.value === void 0 && !r.value) {
|
|
37
|
+
i.value = "PENDING";
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
|
-
if (e.value && !
|
|
40
|
-
|
|
40
|
+
if (e.value && !r.value && o) {
|
|
41
|
+
i.value = "SUCCESS_HAS_DATA";
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
|
-
if (e.value && !
|
|
44
|
-
|
|
44
|
+
if (e.value && !r.value) {
|
|
45
|
+
i.value = "SUCCESS";
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
|
-
e.value === void 0 &&
|
|
48
|
+
e.value === void 0 && r && (i.value = "ERROR");
|
|
48
49
|
}), {
|
|
49
|
-
state:
|
|
50
|
-
swrvState:
|
|
50
|
+
state: i,
|
|
51
|
+
swrvState: se
|
|
51
52
|
};
|
|
52
53
|
}
|
|
53
|
-
const
|
|
54
|
+
const Ze = {
|
|
54
55
|
noQueryBridge: "No query bridge provided. Unable to render dashboard.",
|
|
55
56
|
trendRange: {
|
|
56
57
|
"24h": "Last 24-Hour Summary",
|
|
@@ -58,23 +59,36 @@ const Ue = {
|
|
|
58
59
|
"30d": "Last 30-Day Summary"
|
|
59
60
|
},
|
|
60
61
|
edit: "Edit"
|
|
61
|
-
},
|
|
62
|
+
}, We = {
|
|
62
63
|
timeRangeExceeded: "The time range for this report is outside of your organization's data retention period"
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
}, Ye = {
|
|
65
|
+
defaultFilename: "Chart Export",
|
|
66
|
+
exportAsCsv: "Export as CSV"
|
|
67
|
+
}, Xe = "Open in Explorer", et = {
|
|
68
|
+
renderer: Ze,
|
|
69
|
+
queryDataProvider: We,
|
|
70
|
+
csvExport: Ye,
|
|
71
|
+
jumpToExplore: Xe
|
|
66
72
|
};
|
|
67
|
-
function
|
|
68
|
-
const e =
|
|
73
|
+
function tt() {
|
|
74
|
+
const e = Te("en-us", et);
|
|
69
75
|
return {
|
|
70
76
|
i18n: e,
|
|
71
|
-
i18nT:
|
|
77
|
+
i18nT: Ae(e)
|
|
72
78
|
// Translation component <i18n-t>
|
|
73
79
|
};
|
|
74
80
|
}
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
81
|
+
const B = 170, z = "analytics-query-provider", re = "{entity-id}", rt = "{cp-id}", nt = "{timeframe}", ot = 30 * 1e3;
|
|
82
|
+
function at() {
|
|
83
|
+
const e = K(z);
|
|
84
|
+
return {
|
|
85
|
+
evaluateFeatureFlag: (t, n) => e ? e.evaluateFeatureFlagFn(t, n) : n
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const I = {
|
|
89
|
+
useI18n: tt,
|
|
90
|
+
useEvaluateFeatureFlag: at
|
|
91
|
+
}, J = /* @__PURE__ */ E({
|
|
78
92
|
__name: "QueryDataProvider",
|
|
79
93
|
props: {
|
|
80
94
|
context: {},
|
|
@@ -82,67 +96,69 @@ const F = {
|
|
|
82
96
|
queryReady: { type: Boolean },
|
|
83
97
|
refreshCounter: {}
|
|
84
98
|
},
|
|
85
|
-
emits: ["queryComplete"],
|
|
86
|
-
setup(e, { emit:
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
99
|
+
emits: ["chart-data", "queryComplete"],
|
|
100
|
+
setup(e, { emit: r }) {
|
|
101
|
+
const t = e, n = r, { i18n: i } = I.useI18n(), o = K(z), c = () => t.queryReady && o ? JSON.stringify([t.query, t.context, t.refreshCounter]) : null, a = new AbortController();
|
|
102
|
+
oe(() => {
|
|
103
|
+
a.abort();
|
|
90
104
|
});
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
return
|
|
94
|
-
}, { data:
|
|
95
|
-
var
|
|
105
|
+
const u = (d, b, h) => {
|
|
106
|
+
const m = [];
|
|
107
|
+
return b && m.push(...b), m.push(...De(d, h)), m;
|
|
108
|
+
}, { data: f, error: x, isValidating: q } = xe(c, async () => {
|
|
109
|
+
var d, b, h, m;
|
|
96
110
|
try {
|
|
97
111
|
let {
|
|
98
|
-
datasource:
|
|
99
|
-
...
|
|
100
|
-
} =
|
|
101
|
-
|
|
102
|
-
const
|
|
103
|
-
datasource:
|
|
112
|
+
datasource: s,
|
|
113
|
+
...S
|
|
114
|
+
} = t.query;
|
|
115
|
+
s || (s = "basic");
|
|
116
|
+
const k = u(s, t.query.filters, t.context.filters), G = {
|
|
117
|
+
datasource: s,
|
|
104
118
|
query: {
|
|
105
|
-
...
|
|
119
|
+
...S,
|
|
106
120
|
time_range: {
|
|
107
|
-
...
|
|
108
|
-
tz:
|
|
121
|
+
...t.context.timeSpec,
|
|
122
|
+
tz: t.context.tz
|
|
109
123
|
},
|
|
110
|
-
filters:
|
|
124
|
+
filters: k
|
|
111
125
|
}
|
|
112
126
|
};
|
|
113
|
-
return
|
|
114
|
-
} catch (
|
|
115
|
-
|
|
127
|
+
return o == null ? void 0 : o.queryFn(G, a);
|
|
128
|
+
} catch (s) {
|
|
129
|
+
T.value = ((b = (d = s == null ? void 0 : s.response) == null ? void 0 : d.data) == null ? void 0 : b.message) === "Range not allowed for this tier" ? i.t("queryDataProvider.timeRangeExceeded") : ((m = (h = s == null ? void 0 : s.response) == null ? void 0 : h.data) == null ? void 0 : m.message) || (s == null ? void 0 : s.message);
|
|
116
130
|
} finally {
|
|
117
131
|
n("queryComplete");
|
|
118
132
|
}
|
|
119
133
|
}, {
|
|
120
|
-
refreshInterval:
|
|
134
|
+
refreshInterval: t.context.refreshInterval,
|
|
121
135
|
revalidateOnFocus: !1
|
|
122
|
-
}), { state:
|
|
123
|
-
return (
|
|
124
|
-
|
|
125
|
-
|
|
136
|
+
}), { state: y, swrvState: C } = Je(f, x, q), T = A(null), R = v(() => y.value === C.ERROR || !!T.value), P = v(() => !t.queryReady || [C.PENDING, C.VALIDATING, C.VALIDATING_HAS_DATA].includes(y.value));
|
|
137
|
+
return pe(f, (d) => {
|
|
138
|
+
d && n("chart-data", d);
|
|
139
|
+
}), (d, b) => {
|
|
140
|
+
const h = N("KSkeleton"), m = N("KEmptyState");
|
|
141
|
+
return P.value || !l(f) && !R.value ? (p(), g(h, {
|
|
126
142
|
key: 0,
|
|
127
143
|
class: "chart-skeleton",
|
|
128
144
|
type: "table"
|
|
129
|
-
})) :
|
|
145
|
+
})) : R.value ? (p(), g(m, {
|
|
130
146
|
key: 1,
|
|
131
147
|
"action-button-visible": !1,
|
|
132
148
|
"data-testid": "chart-empty-state",
|
|
133
149
|
"icon-variant": "error"
|
|
134
150
|
}, {
|
|
135
|
-
default:
|
|
136
|
-
|
|
151
|
+
default: _(() => [
|
|
152
|
+
M(O(T.value), 1)
|
|
137
153
|
]),
|
|
138
154
|
_: 1
|
|
139
|
-
})) :
|
|
155
|
+
})) : l(f) ? Q(d.$slots, "default", {
|
|
140
156
|
key: 2,
|
|
141
|
-
data:
|
|
142
|
-
}) :
|
|
157
|
+
data: l(f)
|
|
158
|
+
}) : w("", !0);
|
|
143
159
|
};
|
|
144
160
|
}
|
|
145
|
-
}),
|
|
161
|
+
}), it = { class: "analytics-chart" }, st = /* @__PURE__ */ E({
|
|
146
162
|
__name: "SimpleChartRenderer",
|
|
147
163
|
props: {
|
|
148
164
|
query: {},
|
|
@@ -153,34 +169,34 @@ const F = {
|
|
|
153
169
|
refreshCounter: {}
|
|
154
170
|
},
|
|
155
171
|
setup(e) {
|
|
156
|
-
|
|
157
|
-
bc149350: `${
|
|
172
|
+
$((t) => ({
|
|
173
|
+
bc149350: `${t.height}px`
|
|
158
174
|
}));
|
|
159
|
-
const
|
|
160
|
-
return (
|
|
161
|
-
context:
|
|
162
|
-
query:
|
|
163
|
-
"query-ready":
|
|
164
|
-
"refresh-counter":
|
|
175
|
+
const r = e;
|
|
176
|
+
return (t, n) => (p(), g(J, {
|
|
177
|
+
context: t.context,
|
|
178
|
+
query: t.query,
|
|
179
|
+
"query-ready": t.queryReady,
|
|
180
|
+
"refresh-counter": t.refreshCounter
|
|
165
181
|
}, {
|
|
166
|
-
default:
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
"chart-data":
|
|
170
|
-
"chart-options":
|
|
171
|
-
"synthetics-data-key":
|
|
182
|
+
default: _(({ data: i }) => [
|
|
183
|
+
L("div", it, [
|
|
184
|
+
F(l(_e), {
|
|
185
|
+
"chart-data": i,
|
|
186
|
+
"chart-options": r.chartOptions,
|
|
187
|
+
"synthetics-data-key": t.chartOptions.syntheticsDataKey
|
|
172
188
|
}, null, 8, ["chart-data", "chart-options", "synthetics-data-key"])
|
|
173
189
|
])
|
|
174
190
|
]),
|
|
175
191
|
_: 1
|
|
176
192
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
177
193
|
}
|
|
178
|
-
}),
|
|
179
|
-
const
|
|
180
|
-
for (const [n,
|
|
181
|
-
|
|
182
|
-
return
|
|
183
|
-
},
|
|
194
|
+
}), j = (e, r) => {
|
|
195
|
+
const t = e.__vccOpts || e;
|
|
196
|
+
for (const [n, i] of r)
|
|
197
|
+
t[n] = i;
|
|
198
|
+
return t;
|
|
199
|
+
}, ct = /* @__PURE__ */ j(st, [["__scopeId", "data-v-e770c4a0"]]), lt = { class: "analytics-chart" }, ut = /* @__PURE__ */ E({
|
|
184
200
|
__name: "BaseAnalyticsChartRenderer",
|
|
185
201
|
props: {
|
|
186
202
|
query: {},
|
|
@@ -191,56 +207,59 @@ const F = {
|
|
|
191
207
|
refreshCounter: {},
|
|
192
208
|
extraProps: {}
|
|
193
209
|
},
|
|
194
|
-
emits: ["edit-tile"],
|
|
195
|
-
setup(e, { emit:
|
|
196
|
-
|
|
197
|
-
|
|
210
|
+
emits: ["edit-tile", "chart-data"],
|
|
211
|
+
setup(e, { emit: r }) {
|
|
212
|
+
$((y) => ({
|
|
213
|
+
b0a3e4ca: `${y.height}px`
|
|
198
214
|
}));
|
|
199
|
-
const
|
|
200
|
-
type:
|
|
201
|
-
stacked:
|
|
202
|
-
chartDatasetColors:
|
|
203
|
-
})),
|
|
204
|
-
if (
|
|
205
|
-
const
|
|
206
|
-
filters: [...
|
|
207
|
-
metrics:
|
|
208
|
-
dimensions:
|
|
209
|
-
time_range:
|
|
210
|
-
},
|
|
211
|
-
return `${
|
|
215
|
+
const t = e, n = r, i = K(z), { i18n: o } = I.useI18n(), { evaluateFeatureFlag: c } = I.useEvaluateFeatureFlag(), a = c("ma-3043-analytics-chart-kebab-menu", !1), u = v(() => ({
|
|
216
|
+
type: t.chartOptions.type,
|
|
217
|
+
stacked: t.chartOptions.stacked ?? !1,
|
|
218
|
+
chartDatasetColors: t.chartOptions.chartDatasetColors
|
|
219
|
+
})), f = v(() => {
|
|
220
|
+
if (i && i.exploreBaseUrl) {
|
|
221
|
+
const y = {
|
|
222
|
+
filters: [...t.context.filters, ...t.query.filters ?? []],
|
|
223
|
+
metrics: t.query.metrics ?? [],
|
|
224
|
+
dimensions: t.query.dimensions ?? [],
|
|
225
|
+
time_range: t.query.time_range || t.context.timeSpec
|
|
226
|
+
}, C = ["advanced", "ai"].includes(t.query.datasource) ? t.query.datasource : "advanced";
|
|
227
|
+
return `${i.exploreBaseUrl()}?q=${JSON.stringify(y)}&d=${C}&c=${t.chartOptions.type}`;
|
|
212
228
|
}
|
|
213
229
|
return "";
|
|
214
|
-
}),
|
|
230
|
+
}), x = () => {
|
|
215
231
|
n("edit-tile");
|
|
232
|
+
}, q = (y) => {
|
|
233
|
+
n("chart-data", y);
|
|
216
234
|
};
|
|
217
|
-
return (
|
|
218
|
-
const
|
|
219
|
-
return p(), g(
|
|
220
|
-
context:
|
|
221
|
-
query:
|
|
222
|
-
"query-ready":
|
|
223
|
-
"refresh-counter":
|
|
235
|
+
return (y, C) => {
|
|
236
|
+
const T = N("KDropdownItem");
|
|
237
|
+
return p(), g(J, {
|
|
238
|
+
context: y.context,
|
|
239
|
+
query: y.query,
|
|
240
|
+
"query-ready": y.queryReady,
|
|
241
|
+
"refresh-counter": y.refreshCounter,
|
|
242
|
+
onChartData: q
|
|
224
243
|
}, {
|
|
225
|
-
default:
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
"allow-csv-export":
|
|
244
|
+
default: _(({ data: R }) => [
|
|
245
|
+
L("div", lt, [
|
|
246
|
+
F(l(qe), ae({
|
|
247
|
+
"allow-csv-export": y.chartOptions.allowCsvExport,
|
|
229
248
|
"chart-data": R,
|
|
230
|
-
"chart-options":
|
|
231
|
-
"chart-title": a.chartOptions.chartTitle,
|
|
232
|
-
"go-to-explore":
|
|
249
|
+
"chart-options": u.value,
|
|
250
|
+
"chart-title": !l(a) && y.chartOptions.chartTitle || "",
|
|
251
|
+
"go-to-explore": f.value,
|
|
233
252
|
"legend-position": "bottom",
|
|
234
|
-
"show-menu":
|
|
235
|
-
"synthetics-data-key":
|
|
253
|
+
"show-menu": y.context.editable,
|
|
254
|
+
"synthetics-data-key": y.chartOptions.syntheticsDataKey,
|
|
236
255
|
"tooltip-title": ""
|
|
237
|
-
},
|
|
238
|
-
|
|
256
|
+
}, y.extraProps), ie({ _: 2 }, [
|
|
257
|
+
y.context.editable ? {
|
|
239
258
|
name: "menu-items",
|
|
240
|
-
fn:
|
|
241
|
-
T
|
|
242
|
-
default:
|
|
243
|
-
|
|
259
|
+
fn: _(() => [
|
|
260
|
+
F(T, { onClick: x }, {
|
|
261
|
+
default: _(() => [
|
|
262
|
+
M(O(l(o).t("renderer.edit")), 1)
|
|
244
263
|
]),
|
|
245
264
|
_: 1
|
|
246
265
|
})
|
|
@@ -254,7 +273,7 @@ const F = {
|
|
|
254
273
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]);
|
|
255
274
|
};
|
|
256
275
|
}
|
|
257
|
-
}),
|
|
276
|
+
}), ce = /* @__PURE__ */ j(ut, [["__scopeId", "data-v-40cb614f"]]), ne = /* @__PURE__ */ E({
|
|
258
277
|
__name: "BarChartRenderer",
|
|
259
278
|
props: {
|
|
260
279
|
query: {},
|
|
@@ -265,17 +284,17 @@ const F = {
|
|
|
265
284
|
refreshCounter: {}
|
|
266
285
|
},
|
|
267
286
|
setup(e) {
|
|
268
|
-
return (
|
|
269
|
-
"chart-options":
|
|
270
|
-
context:
|
|
287
|
+
return (r, t) => (p(), g(ce, {
|
|
288
|
+
"chart-options": r.chartOptions,
|
|
289
|
+
context: r.context,
|
|
271
290
|
"extra-props": { showAnnotations: !1 },
|
|
272
|
-
height:
|
|
273
|
-
query:
|
|
274
|
-
"query-ready":
|
|
275
|
-
"refresh-counter":
|
|
291
|
+
height: r.height,
|
|
292
|
+
query: r.query,
|
|
293
|
+
"query-ready": r.queryReady,
|
|
294
|
+
"refresh-counter": r.refreshCounter
|
|
276
295
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
277
296
|
}
|
|
278
|
-
}),
|
|
297
|
+
}), dt = /* @__PURE__ */ E({
|
|
279
298
|
__name: "TimeseriesChartRenderer",
|
|
280
299
|
props: {
|
|
281
300
|
query: {},
|
|
@@ -286,16 +305,16 @@ const F = {
|
|
|
286
305
|
refreshCounter: {}
|
|
287
306
|
},
|
|
288
307
|
setup(e) {
|
|
289
|
-
return (
|
|
290
|
-
"chart-options":
|
|
291
|
-
context:
|
|
292
|
-
height:
|
|
293
|
-
query:
|
|
294
|
-
"query-ready":
|
|
295
|
-
"refresh-counter":
|
|
308
|
+
return (r, t) => (p(), g(ce, {
|
|
309
|
+
"chart-options": r.chartOptions,
|
|
310
|
+
context: r.context,
|
|
311
|
+
height: r.height,
|
|
312
|
+
query: r.query,
|
|
313
|
+
"query-ready": r.queryReady,
|
|
314
|
+
"refresh-counter": r.refreshCounter
|
|
296
315
|
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
297
316
|
}
|
|
298
|
-
}),
|
|
317
|
+
}), pt = { class: "metric-card-tile-wrapper" }, yt = /* @__PURE__ */ E({
|
|
299
318
|
__name: "GoldenSignalsRenderer",
|
|
300
319
|
props: {
|
|
301
320
|
query: {},
|
|
@@ -306,55 +325,60 @@ const F = {
|
|
|
306
325
|
refreshCounter: {}
|
|
307
326
|
},
|
|
308
327
|
setup(e) {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
328
|
+
$((c) => ({
|
|
329
|
+
"3e99e905": l(n) ? "90%" : "100%",
|
|
330
|
+
"345e89d8": l(n) ? "auto" : "100%",
|
|
331
|
+
"7fa58fd9": l(n) ? "100%" : "none"
|
|
332
|
+
}));
|
|
333
|
+
const r = e, { evaluateFeatureFlag: t } = I.useEvaluateFeatureFlag(), n = t("ma-3043-analytics-chart-kebab-menu", !1), i = v(() => {
|
|
334
|
+
const c = r.context.timeSpec;
|
|
335
|
+
if (c.type === "absolute")
|
|
336
|
+
return new Ie({
|
|
313
337
|
key: "custom",
|
|
314
338
|
timeframeText: "custom",
|
|
315
339
|
display: "custom",
|
|
316
|
-
startCustom:
|
|
317
|
-
endCustom:
|
|
318
|
-
timeframeLength: () =>
|
|
340
|
+
startCustom: c.start,
|
|
341
|
+
endCustom: c.end,
|
|
342
|
+
timeframeLength: () => c.end.getTime() - c.start.getTime(),
|
|
319
343
|
defaultResponseGranularity: "daily",
|
|
320
344
|
dataGranularity: "daily",
|
|
321
345
|
isRelative: !1,
|
|
322
346
|
allowedTiers: ["free", "plus", "enterprise"]
|
|
323
347
|
});
|
|
324
|
-
const
|
|
325
|
-
if (!
|
|
348
|
+
const a = Re.get(c.time_range);
|
|
349
|
+
if (!a)
|
|
326
350
|
throw new Error("Unknown time range");
|
|
327
|
-
return
|
|
328
|
-
}),
|
|
329
|
-
var
|
|
330
|
-
const
|
|
331
|
-
if (
|
|
332
|
-
throw new Error(`Invalid datasource value: ${
|
|
351
|
+
return a;
|
|
352
|
+
}), o = v(() => {
|
|
353
|
+
var a, u;
|
|
354
|
+
const c = (a = r.query) == null ? void 0 : a.datasource;
|
|
355
|
+
if (c && c !== "advanced" && c !== "basic")
|
|
356
|
+
throw new Error(`Invalid datasource value: ${c}`);
|
|
333
357
|
return {
|
|
334
|
-
datasource: (
|
|
335
|
-
overrideTimeframe:
|
|
336
|
-
tz:
|
|
337
|
-
additionalFilter:
|
|
358
|
+
datasource: (u = r.query) == null ? void 0 : u.datasource,
|
|
359
|
+
overrideTimeframe: i.value,
|
|
360
|
+
tz: r.context.tz,
|
|
361
|
+
additionalFilter: r.context.filters,
|
|
338
362
|
// TODO: Decide how to handle metric card filters.
|
|
339
|
-
longCardTitles:
|
|
340
|
-
containerTitle:
|
|
341
|
-
description:
|
|
342
|
-
percentileLatency:
|
|
343
|
-
refreshInterval:
|
|
344
|
-
queryReady:
|
|
345
|
-
refreshCounter:
|
|
363
|
+
longCardTitles: r.chartOptions.longCardTitles,
|
|
364
|
+
...!n && { containerTitle: r.chartOptions.chartTitle },
|
|
365
|
+
...!n && { description: r.chartOptions.description },
|
|
366
|
+
percentileLatency: r.chartOptions.percentileLatency,
|
|
367
|
+
refreshInterval: r.context.refreshInterval,
|
|
368
|
+
queryReady: r.queryReady,
|
|
369
|
+
refreshCounter: r.refreshCounter
|
|
346
370
|
};
|
|
347
371
|
});
|
|
348
|
-
return (
|
|
349
|
-
|
|
350
|
-
default:
|
|
351
|
-
|
|
372
|
+
return (c, a) => (p(), D("div", pt, [
|
|
373
|
+
F(l(Me), ye(he(o.value)), {
|
|
374
|
+
default: _(() => [
|
|
375
|
+
F(l(Be))
|
|
352
376
|
]),
|
|
353
377
|
_: 1
|
|
354
378
|
}, 16)
|
|
355
379
|
]));
|
|
356
380
|
}
|
|
357
|
-
}),
|
|
381
|
+
}), ht = /* @__PURE__ */ j(yt, [["__scopeId", "data-v-84c4c1c8"]]), mt = "#6c7489", ft = "20px", gt = "6px", H = "20px", vt = /* @__PURE__ */ E({
|
|
358
382
|
__name: "TopNTableRenderer",
|
|
359
383
|
props: {
|
|
360
384
|
query: {},
|
|
@@ -365,39 +389,39 @@ const F = {
|
|
|
365
389
|
refreshCounter: {}
|
|
366
390
|
},
|
|
367
391
|
setup(e) {
|
|
368
|
-
const
|
|
369
|
-
var
|
|
370
|
-
if ((
|
|
371
|
-
if (
|
|
372
|
-
const [
|
|
373
|
-
return
|
|
392
|
+
const r = e, { evaluateFeatureFlag: t } = I.useEvaluateFeatureFlag(), n = t("ma-3043-analytics-chart-kebab-menu", !1), i = (o) => {
|
|
393
|
+
var c;
|
|
394
|
+
if ((c = r.chartOptions) != null && c.entityLink)
|
|
395
|
+
if (o.id.includes(":")) {
|
|
396
|
+
const [a, u] = o.id.split(":");
|
|
397
|
+
return r.chartOptions.entityLink.replace(rt, a).replace(re, u);
|
|
374
398
|
} else
|
|
375
|
-
return
|
|
399
|
+
return r.chartOptions.entityLink.replace(re, o.id);
|
|
376
400
|
return "";
|
|
377
401
|
};
|
|
378
|
-
return (
|
|
379
|
-
context:
|
|
380
|
-
query:
|
|
381
|
-
"query-ready":
|
|
382
|
-
"refresh-counter":
|
|
402
|
+
return (o, c) => (p(), g(J, {
|
|
403
|
+
context: o.context,
|
|
404
|
+
query: o.query,
|
|
405
|
+
"query-ready": o.queryReady,
|
|
406
|
+
"refresh-counter": o.refreshCounter
|
|
383
407
|
}, {
|
|
384
|
-
default:
|
|
385
|
-
|
|
386
|
-
data:
|
|
387
|
-
description: n.chartOptions.description,
|
|
388
|
-
"synthetics-data-key":
|
|
389
|
-
title: n.chartOptions.chartTitle || ""
|
|
390
|
-
},
|
|
391
|
-
|
|
408
|
+
default: _(({ data: a }) => [
|
|
409
|
+
F(l(Ce), {
|
|
410
|
+
data: a,
|
|
411
|
+
description: !l(n) && o.chartOptions.description || "",
|
|
412
|
+
"synthetics-data-key": o.chartOptions.syntheticsDataKey,
|
|
413
|
+
title: !l(n) && o.chartOptions.chartTitle || ""
|
|
414
|
+
}, ie({ _: 2 }, [
|
|
415
|
+
r.chartOptions.entityLink ? {
|
|
392
416
|
name: "name",
|
|
393
|
-
fn:
|
|
394
|
-
|
|
417
|
+
fn: _(({ record: u }) => [
|
|
418
|
+
F(l(Ue), {
|
|
395
419
|
"entity-link-data": {
|
|
396
|
-
id:
|
|
397
|
-
label:
|
|
398
|
-
deleted:
|
|
420
|
+
id: u.id,
|
|
421
|
+
label: u.name,
|
|
422
|
+
deleted: u.deleted
|
|
399
423
|
},
|
|
400
|
-
"external-link":
|
|
424
|
+
"external-link": i(u)
|
|
401
425
|
}, null, 8, ["entity-link-data", "external-link"])
|
|
402
426
|
]),
|
|
403
427
|
key: "0"
|
|
@@ -407,59 +431,153 @@ const F = {
|
|
|
407
431
|
_: 1
|
|
408
432
|
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
409
433
|
}
|
|
410
|
-
}),
|
|
434
|
+
}), bt = {
|
|
435
|
+
key: 0,
|
|
436
|
+
class: "tile-header"
|
|
437
|
+
}, _t = { class: "title" }, qt = {
|
|
438
|
+
appearance: "none",
|
|
439
|
+
class: "kebab-action-menu",
|
|
440
|
+
"data-testid": "kebab-action-menu"
|
|
441
|
+
}, Ct = ["href"], St = {
|
|
442
|
+
class: "chart-export-trigger",
|
|
443
|
+
"data-testid": "csv-export-button"
|
|
444
|
+
}, Et = {
|
|
445
|
+
key: 1,
|
|
446
|
+
class: "header-description"
|
|
447
|
+
}, xt = /* @__PURE__ */ E({
|
|
411
448
|
__name: "DashboardTile",
|
|
412
449
|
props: {
|
|
413
450
|
definition: {},
|
|
414
451
|
context: {},
|
|
415
|
-
height: { default:
|
|
452
|
+
height: { default: B },
|
|
416
453
|
queryReady: { type: Boolean },
|
|
417
454
|
refreshCounter: {}
|
|
418
455
|
},
|
|
419
456
|
emits: ["edit-tile"],
|
|
420
|
-
setup(e, { emit:
|
|
421
|
-
|
|
422
|
-
|
|
457
|
+
setup(e, { emit: r }) {
|
|
458
|
+
$((s) => ({
|
|
459
|
+
f269eb76: `${s.height}px`,
|
|
460
|
+
"1c28e871": q.value ? 1 : 0,
|
|
461
|
+
"1c525d74": q.value ? "visible" : "hidden"
|
|
423
462
|
}));
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
463
|
+
const t = parseInt(H, 10), n = e, i = r, o = K(z), { evaluateFeatureFlag: c } = I.useEvaluateFeatureFlag(), { i18n: a } = I.useI18n(), u = c("ma-3043-analytics-chart-kebab-menu", !1), f = A(), x = A(!1), q = A(!1), y = v(() => {
|
|
464
|
+
if (o && o.exploreBaseUrl) {
|
|
465
|
+
const s = {
|
|
466
|
+
filters: [...n.context.filters, ...n.definition.query.filters ?? []],
|
|
467
|
+
metrics: n.definition.query.metrics ?? [],
|
|
468
|
+
dimensions: n.definition.query.dimensions ?? [],
|
|
469
|
+
time_range: n.definition.query.time_range || n.context.timeSpec
|
|
470
|
+
}, S = ["advanced", "ai"].includes(n.definition.query.datasource) ? n.definition.query.datasource : "advanced";
|
|
471
|
+
return `${o.exploreBaseUrl()}?q=${JSON.stringify(s)}&d=${S}&c=${n.definition.chart.type}`;
|
|
472
|
+
}
|
|
473
|
+
return "";
|
|
474
|
+
}), C = v(() => a.t("csvExport.defaultFilename")), T = v(() => u && !["golden_signals", "top_n", "gauge"].includes(n.definition.chart.type)), R = {
|
|
475
|
+
timeseries_line: dt,
|
|
476
|
+
horizontal_bar: ne,
|
|
477
|
+
vertical_bar: ne,
|
|
478
|
+
gauge: ct,
|
|
479
|
+
golden_signals: ht,
|
|
480
|
+
top_n: vt,
|
|
431
481
|
slottable: void 0
|
|
432
|
-
},
|
|
433
|
-
const
|
|
434
|
-
return
|
|
435
|
-
component:
|
|
482
|
+
}, P = v(() => {
|
|
483
|
+
const s = R[n.definition.chart.type];
|
|
484
|
+
return s && {
|
|
485
|
+
component: s,
|
|
436
486
|
rendererProps: {
|
|
437
487
|
query: n.definition.query,
|
|
438
488
|
context: n.context,
|
|
439
489
|
queryReady: n.queryReady,
|
|
440
490
|
chartOptions: n.definition.chart,
|
|
441
|
-
height: n.height -
|
|
491
|
+
height: n.height - t * 2,
|
|
442
492
|
refreshCounter: n.refreshCounter
|
|
443
493
|
}
|
|
444
494
|
};
|
|
445
|
-
}),
|
|
446
|
-
|
|
495
|
+
}), d = () => {
|
|
496
|
+
i("edit-tile", n.definition);
|
|
497
|
+
}, b = (s) => {
|
|
498
|
+
f.value = s;
|
|
499
|
+
}, h = (s) => {
|
|
500
|
+
x.value = s;
|
|
501
|
+
}, m = () => {
|
|
502
|
+
h(!0);
|
|
503
|
+
};
|
|
504
|
+
return (s, S) => {
|
|
505
|
+
const k = N("KDropdownItem"), G = N("KDropdown");
|
|
506
|
+
return p(), D("div", {
|
|
507
|
+
class: "tile-boundary",
|
|
508
|
+
onMouseenter: S[1] || (S[1] = (ee) => q.value = !0),
|
|
509
|
+
onMouseleave: S[2] || (S[2] = (ee) => q.value = !1)
|
|
510
|
+
}, [
|
|
511
|
+
l(u) && s.definition.chart.type !== "slottable" ? (p(), D("div", bt, [
|
|
512
|
+
L("div", _t, O(s.definition.chart.chartTitle), 1),
|
|
513
|
+
T.value ? (p(), g(G, {
|
|
514
|
+
key: 0,
|
|
515
|
+
class: "dropdown",
|
|
516
|
+
"data-testid": "chart-action-menu"
|
|
517
|
+
}, {
|
|
518
|
+
items: _(() => [
|
|
519
|
+
y.value ? (p(), g(k, {
|
|
520
|
+
key: 0,
|
|
521
|
+
"data-testid": "chart-jump-to-explore"
|
|
522
|
+
}, {
|
|
523
|
+
default: _(() => [
|
|
524
|
+
L("a", { href: y.value }, O(l(a).t("jumpToExplore")), 9, Ct)
|
|
525
|
+
]),
|
|
526
|
+
_: 1
|
|
527
|
+
})) : w("", !0),
|
|
528
|
+
"allowCsvExport" in s.definition.chart && s.definition.chart.allowCsvExport ? (p(), g(k, {
|
|
529
|
+
key: 1,
|
|
530
|
+
class: "chart-export-button",
|
|
531
|
+
"data-testid": "chart-csv-export",
|
|
532
|
+
onClick: S[0] || (S[0] = (ee) => m())
|
|
533
|
+
}, {
|
|
534
|
+
default: _(() => [
|
|
535
|
+
L("span", St, O(l(a).t("csvExport.exportAsCsv")), 1)
|
|
536
|
+
]),
|
|
537
|
+
_: 1
|
|
538
|
+
})) : w("", !0),
|
|
539
|
+
s.context.editable ? (p(), g(k, {
|
|
540
|
+
key: 2,
|
|
541
|
+
onClick: d
|
|
542
|
+
}, {
|
|
543
|
+
default: _(() => [
|
|
544
|
+
M(O(l(a).t("renderer.edit")), 1)
|
|
545
|
+
]),
|
|
546
|
+
_: 1
|
|
547
|
+
})) : w("", !0)
|
|
548
|
+
]),
|
|
549
|
+
default: _(() => [
|
|
550
|
+
L("button", qt, [
|
|
551
|
+
F(l(Ge), {
|
|
552
|
+
color: l(mt),
|
|
553
|
+
size: l(ft)
|
|
554
|
+
}, null, 8, ["color", "size"])
|
|
555
|
+
])
|
|
556
|
+
]),
|
|
557
|
+
_: 1
|
|
558
|
+
})) : "description" in s.definition.chart ? (p(), D("div", Et, O(s.definition.chart.description), 1)) : w("", !0),
|
|
559
|
+
x.value ? (p(), g(l(Se), {
|
|
560
|
+
key: 2,
|
|
561
|
+
"chart-data": f.value,
|
|
562
|
+
filename: C.value,
|
|
563
|
+
onToggleModal: h
|
|
564
|
+
}, null, 8, ["chart-data", "filename"])) : w("", !0)
|
|
565
|
+
])) : w("", !0),
|
|
566
|
+
P.value ? (p(), g(me(P.value.component), ae({ key: 1 }, P.value.rendererProps, { onChartData: b }), null, 16)) : w("", !0)
|
|
567
|
+
], 32);
|
|
447
568
|
};
|
|
448
|
-
return (l, a) => (p(), C("div", lt, [
|
|
449
|
-
c.value ? (p(), g(ye(c.value.component), ee({ key: 0 }, c.value.rendererProps, { onEditTile: s }), null, 16)) : Z("", !0)
|
|
450
|
-
]));
|
|
451
569
|
}
|
|
452
|
-
}),
|
|
570
|
+
}), Tt = /* @__PURE__ */ j(xt, [["__scopeId", "data-v-3c97797e"]]), At = (e, r, t) => {
|
|
453
571
|
const n = /* @__PURE__ */ new Map();
|
|
454
|
-
|
|
455
|
-
const c =
|
|
456
|
-
|
|
572
|
+
t.forEach((o) => {
|
|
573
|
+
const c = o.layout.position.row, a = n.get(c), u = o.layout.size.rows === 1 && !!o.layout.size.fitToContent;
|
|
574
|
+
a === void 0 ? n.set(c, u) : n.set(c, a && u);
|
|
457
575
|
});
|
|
458
|
-
const
|
|
459
|
-
for (let
|
|
460
|
-
n.get(
|
|
461
|
-
return
|
|
462
|
-
},
|
|
576
|
+
const i = [];
|
|
577
|
+
for (let o = 0; o < e; o++)
|
|
578
|
+
n.get(o) ? i.push("auto") : i.push(`${r}px`);
|
|
579
|
+
return i;
|
|
580
|
+
}, Dt = /* @__PURE__ */ E({
|
|
463
581
|
__name: "GridLayout",
|
|
464
582
|
props: {
|
|
465
583
|
gridSize: {
|
|
@@ -469,7 +587,7 @@ const F = {
|
|
|
469
587
|
tileHeight: {
|
|
470
588
|
type: Number,
|
|
471
589
|
required: !1,
|
|
472
|
-
default: () =>
|
|
590
|
+
default: () => B
|
|
473
591
|
},
|
|
474
592
|
tiles: {
|
|
475
593
|
type: Array,
|
|
@@ -477,141 +595,144 @@ const F = {
|
|
|
477
595
|
}
|
|
478
596
|
},
|
|
479
597
|
setup(e) {
|
|
480
|
-
|
|
598
|
+
$((a) => ({
|
|
481
599
|
"3bc5e939": e.gridSize.cols,
|
|
482
|
-
"77aa3028":
|
|
600
|
+
"77aa3028": o.value
|
|
483
601
|
}));
|
|
484
|
-
const
|
|
602
|
+
const r = e, t = A(null), n = A(0), i = new ResizeObserver((a) => {
|
|
485
603
|
window.requestAnimationFrame(() => {
|
|
486
|
-
!Array.isArray(
|
|
604
|
+
!Array.isArray(a) || !a.length || (n.value = a[0].contentRect.width);
|
|
487
605
|
});
|
|
488
606
|
});
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
}),
|
|
492
|
-
|
|
607
|
+
fe(() => {
|
|
608
|
+
t.value && i.observe(t.value);
|
|
609
|
+
}), oe(() => {
|
|
610
|
+
t.value && i.unobserve(t.value);
|
|
493
611
|
});
|
|
494
|
-
const
|
|
495
|
-
var
|
|
496
|
-
return
|
|
497
|
-
}), c =
|
|
498
|
-
key: `tile-${
|
|
499
|
-
tile:
|
|
612
|
+
const o = v(() => {
|
|
613
|
+
var u;
|
|
614
|
+
return At((u = r.gridSize) == null ? void 0 : u.rows, r.tileHeight, r.tiles).join(" ");
|
|
615
|
+
}), c = v(() => r.tiles.map((a, u) => ({
|
|
616
|
+
key: `tile-${u}`,
|
|
617
|
+
tile: a,
|
|
500
618
|
style: {
|
|
501
|
-
"grid-column-start":
|
|
502
|
-
"grid-column-end":
|
|
503
|
-
"grid-row-start":
|
|
504
|
-
"grid-row-end":
|
|
619
|
+
"grid-column-start": a.layout.position.col + 1,
|
|
620
|
+
"grid-column-end": a.layout.position.col + 1 + a.layout.size.cols,
|
|
621
|
+
"grid-row-start": a.layout.position.row + 1,
|
|
622
|
+
"grid-row-end": a.layout.position.row + 1 + a.layout.size.rows
|
|
505
623
|
}
|
|
506
624
|
})));
|
|
507
|
-
return (
|
|
625
|
+
return (a, u) => (p(), D("div", {
|
|
508
626
|
ref_key: "gridContainer",
|
|
509
|
-
ref:
|
|
627
|
+
ref: t,
|
|
510
628
|
class: "kong-ui-public-grid-layout"
|
|
511
629
|
}, [
|
|
512
|
-
(p(!0),
|
|
513
|
-
key:
|
|
514
|
-
class:
|
|
515
|
-
"empty-cell": !
|
|
630
|
+
(p(!0), D(ge, null, ve(c.value, (f) => (p(), D("div", {
|
|
631
|
+
key: f.key,
|
|
632
|
+
class: be(["grid-cell", {
|
|
633
|
+
"empty-cell": !f.tile
|
|
516
634
|
}]),
|
|
517
|
-
style:
|
|
635
|
+
style: te(f.style)
|
|
518
636
|
}, [
|
|
519
|
-
|
|
520
|
-
style:
|
|
521
|
-
tile:
|
|
637
|
+
Q(a.$slots, "tile", {
|
|
638
|
+
style: te(f.style),
|
|
639
|
+
tile: f.tile
|
|
522
640
|
}, void 0, !0)
|
|
523
641
|
], 6))), 128))
|
|
524
642
|
], 512));
|
|
525
643
|
}
|
|
526
|
-
}),
|
|
644
|
+
}), It = /* @__PURE__ */ j(Dt, [["__scopeId", "data-v-f43eb7b8"]]), Rt = { class: "kong-ui-public-dashboard-renderer" }, kt = {
|
|
527
645
|
key: 0,
|
|
528
646
|
class: "tile-container"
|
|
529
|
-
},
|
|
647
|
+
}, wt = /* @__PURE__ */ E({
|
|
530
648
|
__name: "DashboardRenderer",
|
|
531
649
|
props: {
|
|
532
650
|
context: {},
|
|
533
651
|
config: {}
|
|
534
652
|
},
|
|
535
653
|
emits: ["edit-tile"],
|
|
536
|
-
setup(e, { expose:
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
654
|
+
setup(e, { expose: r, emit: t }) {
|
|
655
|
+
$((d) => ({
|
|
656
|
+
"468bc584": l(f) ? l(gt) : l(H)
|
|
657
|
+
}));
|
|
658
|
+
const n = e, i = t, { i18n: o } = I.useI18n(), c = A(0), a = K(z);
|
|
659
|
+
a || (console.warn("Analytics dashboards require a query bridge supplied via provide / inject."), console.warn("Please ensure your application has a query bridge provided under the key 'analytics-query-provider', as described in"), console.warn("https://github.com/Kong/public-ui-components/blob/main/packages/analytics/dashboard-renderer/README.md#requirements"));
|
|
660
|
+
const { evaluateFeatureFlag: u } = I.useEvaluateFeatureFlag(), f = u("ma-3043-analytics-chart-kebab-menu", !1), x = He(), q = v(() => n.context.timeSpec ? n.context.timeSpec : {
|
|
540
661
|
type: "relative",
|
|
541
|
-
time_range:
|
|
542
|
-
}),
|
|
543
|
-
var
|
|
544
|
-
let
|
|
545
|
-
if ("description" in
|
|
546
|
-
const
|
|
547
|
-
const
|
|
548
|
-
return
|
|
662
|
+
time_range: x.defaultQueryTimeForOrg
|
|
663
|
+
}), y = v(() => !!n.context.timeSpec || !x.loading), C = v(() => n.config.tiles.map((d, b) => {
|
|
664
|
+
var m;
|
|
665
|
+
let h = d.definition;
|
|
666
|
+
if ("description" in h.chart) {
|
|
667
|
+
const s = (m = h.chart.description) == null ? void 0 : m.replace(nt, () => {
|
|
668
|
+
const k = `renderer.trendRange.${q.value.type === "absolute" ? "custom" : q.value.time_range}`;
|
|
669
|
+
return o.te(k) ? o.t(k) : "";
|
|
549
670
|
});
|
|
550
|
-
|
|
551
|
-
...
|
|
671
|
+
h = {
|
|
672
|
+
...h,
|
|
552
673
|
chart: {
|
|
553
|
-
...
|
|
554
|
-
description:
|
|
674
|
+
...h.chart,
|
|
675
|
+
description: s
|
|
555
676
|
}
|
|
556
677
|
};
|
|
557
678
|
}
|
|
558
679
|
return {
|
|
559
|
-
layout:
|
|
560
|
-
meta:
|
|
680
|
+
layout: d.layout,
|
|
681
|
+
meta: h,
|
|
561
682
|
// Add a unique key to each tile internally.
|
|
562
|
-
id:
|
|
683
|
+
id: b
|
|
563
684
|
};
|
|
564
|
-
})),
|
|
565
|
-
let { tz:
|
|
566
|
-
return
|
|
685
|
+
})), T = v(() => {
|
|
686
|
+
let { tz: d, refreshInterval: b, editable: h } = n.context;
|
|
687
|
+
return d || (d = new Intl.DateTimeFormat().resolvedOptions().timeZone), b === void 0 && (b = ot), h === void 0 && (h = !1), {
|
|
567
688
|
...n.context,
|
|
568
|
-
tz:
|
|
569
|
-
timeSpec:
|
|
570
|
-
refreshInterval:
|
|
571
|
-
editable:
|
|
689
|
+
tz: d,
|
|
690
|
+
timeSpec: q.value,
|
|
691
|
+
refreshInterval: b,
|
|
692
|
+
editable: h
|
|
572
693
|
};
|
|
573
|
-
}),
|
|
574
|
-
|
|
694
|
+
}), R = (d) => {
|
|
695
|
+
i("edit-tile", d);
|
|
575
696
|
};
|
|
576
|
-
return
|
|
697
|
+
return r({ refresh: () => {
|
|
577
698
|
c.value++;
|
|
578
|
-
} }), (
|
|
579
|
-
const
|
|
580
|
-
return p(),
|
|
581
|
-
|
|
699
|
+
} }), (d, b) => {
|
|
700
|
+
const h = N("KAlert");
|
|
701
|
+
return p(), D("div", Rt, [
|
|
702
|
+
l(a) ? (p(), g(It, {
|
|
582
703
|
key: 1,
|
|
583
|
-
"grid-size":
|
|
584
|
-
"tile-height":
|
|
585
|
-
tiles:
|
|
704
|
+
"grid-size": d.config.gridSize,
|
|
705
|
+
"tile-height": d.config.tileHeight,
|
|
706
|
+
tiles: C.value
|
|
586
707
|
}, {
|
|
587
|
-
tile:
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
])) : (p(), g(
|
|
708
|
+
tile: _(({ tile: m }) => [
|
|
709
|
+
m.meta.chart.type === "slottable" ? (p(), D("div", kt, [
|
|
710
|
+
Q(d.$slots, m.meta.chart.id, {}, void 0, !0)
|
|
711
|
+
])) : (p(), g(Tt, {
|
|
591
712
|
key: 1,
|
|
592
713
|
class: "tile-container",
|
|
593
|
-
context:
|
|
594
|
-
definition:
|
|
595
|
-
height:
|
|
596
|
-
"query-ready":
|
|
714
|
+
context: T.value,
|
|
715
|
+
definition: m.meta,
|
|
716
|
+
height: m.layout.size.rows * (d.config.tileHeight || l(B)) + parseInt(l(H), 10),
|
|
717
|
+
"query-ready": y.value,
|
|
597
718
|
"refresh-counter": c.value,
|
|
598
|
-
onEditTile: (
|
|
719
|
+
onEditTile: (s) => R(m)
|
|
599
720
|
}, null, 8, ["context", "definition", "height", "query-ready", "refresh-counter", "onEditTile"]))
|
|
600
721
|
]),
|
|
601
722
|
_: 3
|
|
602
|
-
}, 8, ["grid-size", "tile-height", "tiles"])) : (p(), g(
|
|
723
|
+
}, 8, ["grid-size", "tile-height", "tiles"])) : (p(), g(h, {
|
|
603
724
|
key: 0,
|
|
604
725
|
appearance: "danger"
|
|
605
726
|
}, {
|
|
606
|
-
default:
|
|
607
|
-
|
|
727
|
+
default: _(() => [
|
|
728
|
+
M(O(l(o).t("renderer.noQueryBridge")), 1)
|
|
608
729
|
]),
|
|
609
730
|
_: 1
|
|
610
731
|
}))
|
|
611
732
|
]);
|
|
612
733
|
};
|
|
613
734
|
}
|
|
614
|
-
}),
|
|
735
|
+
}), or = /* @__PURE__ */ j(wt, [["__scopeId", "data-v-05d469f6"]]), ar = [
|
|
615
736
|
"horizontal_bar",
|
|
616
737
|
"vertical_bar",
|
|
617
738
|
"gauge",
|
|
@@ -619,13 +740,13 @@ const F = {
|
|
|
619
740
|
"golden_signals",
|
|
620
741
|
"top_n",
|
|
621
742
|
"slottable"
|
|
622
|
-
],
|
|
743
|
+
], U = {
|
|
623
744
|
type: "string"
|
|
624
|
-
},
|
|
745
|
+
}, V = {
|
|
625
746
|
type: "string"
|
|
626
|
-
},
|
|
747
|
+
}, le = {
|
|
627
748
|
type: "boolean"
|
|
628
|
-
},
|
|
749
|
+
}, ue = {
|
|
629
750
|
type: ["object", "array"],
|
|
630
751
|
items: {
|
|
631
752
|
type: "string"
|
|
@@ -633,7 +754,7 @@ const F = {
|
|
|
633
754
|
additionalProperties: {
|
|
634
755
|
type: "string"
|
|
635
756
|
}
|
|
636
|
-
},
|
|
757
|
+
}, Ot = {
|
|
637
758
|
type: "object",
|
|
638
759
|
properties: {
|
|
639
760
|
type: {
|
|
@@ -646,7 +767,7 @@ const F = {
|
|
|
646
767
|
},
|
|
647
768
|
required: ["type", "id"],
|
|
648
769
|
additionalProperties: !1
|
|
649
|
-
},
|
|
770
|
+
}, Ft = {
|
|
650
771
|
type: "object",
|
|
651
772
|
properties: {
|
|
652
773
|
type: {
|
|
@@ -656,14 +777,14 @@ const F = {
|
|
|
656
777
|
stacked: {
|
|
657
778
|
type: "boolean"
|
|
658
779
|
},
|
|
659
|
-
chartDatasetColors:
|
|
660
|
-
syntheticsDataKey:
|
|
661
|
-
chartTitle:
|
|
662
|
-
allowCsvExport:
|
|
780
|
+
chartDatasetColors: ue,
|
|
781
|
+
syntheticsDataKey: U,
|
|
782
|
+
chartTitle: V,
|
|
783
|
+
allowCsvExport: le
|
|
663
784
|
},
|
|
664
785
|
required: ["type"],
|
|
665
786
|
additionalProperties: !1
|
|
666
|
-
},
|
|
787
|
+
}, Pt = {
|
|
667
788
|
type: "object",
|
|
668
789
|
properties: {
|
|
669
790
|
type: {
|
|
@@ -673,14 +794,14 @@ const F = {
|
|
|
673
794
|
stacked: {
|
|
674
795
|
type: "boolean"
|
|
675
796
|
},
|
|
676
|
-
chartDatasetColors:
|
|
677
|
-
syntheticsDataKey:
|
|
678
|
-
chartTitle:
|
|
679
|
-
allowCsvExport:
|
|
797
|
+
chartDatasetColors: ue,
|
|
798
|
+
syntheticsDataKey: U,
|
|
799
|
+
chartTitle: V,
|
|
800
|
+
allowCsvExport: le
|
|
680
801
|
},
|
|
681
802
|
required: ["type"],
|
|
682
803
|
additionalProperties: !1
|
|
683
|
-
},
|
|
804
|
+
}, Lt = {
|
|
684
805
|
type: "object",
|
|
685
806
|
properties: {
|
|
686
807
|
type: {
|
|
@@ -689,7 +810,7 @@ const F = {
|
|
|
689
810
|
},
|
|
690
811
|
metricDisplay: {
|
|
691
812
|
type: "string",
|
|
692
|
-
enum: Object.values(
|
|
813
|
+
enum: Object.values(Ee)
|
|
693
814
|
},
|
|
694
815
|
reverseDataset: {
|
|
695
816
|
type: "boolean"
|
|
@@ -697,16 +818,16 @@ const F = {
|
|
|
697
818
|
numerator: {
|
|
698
819
|
type: "number"
|
|
699
820
|
},
|
|
700
|
-
syntheticsDataKey:
|
|
701
|
-
chartTitle:
|
|
821
|
+
syntheticsDataKey: U,
|
|
822
|
+
chartTitle: V
|
|
702
823
|
},
|
|
703
824
|
required: ["type"],
|
|
704
825
|
additionalProperties: !1
|
|
705
|
-
},
|
|
826
|
+
}, Nt = {
|
|
706
827
|
type: "object",
|
|
707
828
|
properties: {
|
|
708
|
-
chartTitle:
|
|
709
|
-
syntheticsDataKey:
|
|
829
|
+
chartTitle: V,
|
|
830
|
+
syntheticsDataKey: U,
|
|
710
831
|
type: {
|
|
711
832
|
type: "string",
|
|
712
833
|
enum: ["top_n"]
|
|
@@ -720,10 +841,10 @@ const F = {
|
|
|
720
841
|
},
|
|
721
842
|
required: ["type"],
|
|
722
843
|
additionalProperties: !1
|
|
723
|
-
},
|
|
844
|
+
}, $t = {
|
|
724
845
|
type: "object",
|
|
725
846
|
properties: {
|
|
726
|
-
chartTitle:
|
|
847
|
+
chartTitle: V,
|
|
727
848
|
type: {
|
|
728
849
|
type: "string",
|
|
729
850
|
enum: ["golden_signals"]
|
|
@@ -740,7 +861,7 @@ const F = {
|
|
|
740
861
|
},
|
|
741
862
|
required: ["type"],
|
|
742
863
|
additionalProperties: !1
|
|
743
|
-
},
|
|
864
|
+
}, jt = {
|
|
744
865
|
type: "object",
|
|
745
866
|
properties: {
|
|
746
867
|
tz: {
|
|
@@ -755,7 +876,7 @@ const F = {
|
|
|
755
876
|
},
|
|
756
877
|
time_range: {
|
|
757
878
|
type: "string",
|
|
758
|
-
enum:
|
|
879
|
+
enum: Ve,
|
|
759
880
|
default: "1h"
|
|
760
881
|
}
|
|
761
882
|
},
|
|
@@ -764,7 +885,7 @@ const F = {
|
|
|
764
885
|
"time_range"
|
|
765
886
|
],
|
|
766
887
|
additionalProperties: !1
|
|
767
|
-
},
|
|
888
|
+
}, Kt = {
|
|
768
889
|
type: "object",
|
|
769
890
|
description: "A duration representing an exact start and end time.",
|
|
770
891
|
properties: {
|
|
@@ -790,18 +911,18 @@ const F = {
|
|
|
790
911
|
"end"
|
|
791
912
|
],
|
|
792
913
|
additionalProperties: !1
|
|
793
|
-
},
|
|
914
|
+
}, Z = {
|
|
794
915
|
granularity: {
|
|
795
916
|
type: "string",
|
|
796
917
|
description: 'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',
|
|
797
|
-
enum:
|
|
918
|
+
enum: ke
|
|
798
919
|
},
|
|
799
920
|
time_range: {
|
|
800
921
|
type: "object",
|
|
801
922
|
description: "The time range to query.",
|
|
802
923
|
anyOf: [
|
|
803
|
-
|
|
804
|
-
|
|
924
|
+
jt,
|
|
925
|
+
Kt
|
|
805
926
|
],
|
|
806
927
|
default: {
|
|
807
928
|
type: "relative",
|
|
@@ -814,14 +935,14 @@ const F = {
|
|
|
814
935
|
meta: {
|
|
815
936
|
type: "object"
|
|
816
937
|
}
|
|
817
|
-
},
|
|
938
|
+
}, W = (e) => ({
|
|
818
939
|
type: "array",
|
|
819
940
|
description: "List of aggregated metrics to collect across the requested time span.",
|
|
820
941
|
items: {
|
|
821
942
|
type: "string",
|
|
822
943
|
enum: e
|
|
823
944
|
}
|
|
824
|
-
}),
|
|
945
|
+
}), Y = (e) => ({
|
|
825
946
|
type: "array",
|
|
826
947
|
description: "List of attributes or entity types to group by.",
|
|
827
948
|
minItems: 0,
|
|
@@ -830,7 +951,7 @@ const F = {
|
|
|
830
951
|
type: "string",
|
|
831
952
|
enum: e
|
|
832
953
|
}
|
|
833
|
-
}),
|
|
954
|
+
}), X = (e) => ({
|
|
834
955
|
type: "array",
|
|
835
956
|
description: "A list of filters to apply to the query.",
|
|
836
957
|
items: {
|
|
@@ -843,7 +964,7 @@ const F = {
|
|
|
843
964
|
},
|
|
844
965
|
type: {
|
|
845
966
|
type: "string",
|
|
846
|
-
enum:
|
|
967
|
+
enum: we
|
|
847
968
|
},
|
|
848
969
|
values: {
|
|
849
970
|
type: "array",
|
|
@@ -859,7 +980,7 @@ const F = {
|
|
|
859
980
|
],
|
|
860
981
|
additionalProperties: !1
|
|
861
982
|
}
|
|
862
|
-
}),
|
|
983
|
+
}), zt = {
|
|
863
984
|
type: "object",
|
|
864
985
|
description: "A query to launch at the advanced explore API",
|
|
865
986
|
properties: {
|
|
@@ -869,14 +990,14 @@ const F = {
|
|
|
869
990
|
"advanced"
|
|
870
991
|
]
|
|
871
992
|
},
|
|
872
|
-
metrics:
|
|
873
|
-
dimensions:
|
|
874
|
-
filters:
|
|
875
|
-
...
|
|
993
|
+
metrics: W(Oe),
|
|
994
|
+
dimensions: Y(Fe),
|
|
995
|
+
filters: X(Pe),
|
|
996
|
+
...Z
|
|
876
997
|
},
|
|
877
998
|
required: ["datasource"],
|
|
878
999
|
additionalProperties: !1
|
|
879
|
-
},
|
|
1000
|
+
}, Vt = {
|
|
880
1001
|
type: "object",
|
|
881
1002
|
description: "A query to launch at the basic explore API",
|
|
882
1003
|
properties: {
|
|
@@ -886,14 +1007,14 @@ const F = {
|
|
|
886
1007
|
"basic"
|
|
887
1008
|
]
|
|
888
1009
|
},
|
|
889
|
-
metrics:
|
|
890
|
-
dimensions:
|
|
891
|
-
filters:
|
|
892
|
-
...
|
|
1010
|
+
metrics: W(Le),
|
|
1011
|
+
dimensions: Y(Ne),
|
|
1012
|
+
filters: X($e),
|
|
1013
|
+
...Z
|
|
893
1014
|
},
|
|
894
1015
|
required: ["datasource"],
|
|
895
1016
|
additionalProperties: !1
|
|
896
|
-
},
|
|
1017
|
+
}, Mt = {
|
|
897
1018
|
type: "object",
|
|
898
1019
|
description: "A query to launch at the AI explore API",
|
|
899
1020
|
properties: {
|
|
@@ -903,26 +1024,26 @@ const F = {
|
|
|
903
1024
|
"ai"
|
|
904
1025
|
]
|
|
905
1026
|
},
|
|
906
|
-
metrics:
|
|
907
|
-
dimensions:
|
|
908
|
-
filters:
|
|
909
|
-
...
|
|
1027
|
+
metrics: W(je),
|
|
1028
|
+
dimensions: Y(Ke),
|
|
1029
|
+
filters: X(ze),
|
|
1030
|
+
...Z
|
|
910
1031
|
},
|
|
911
1032
|
required: ["datasource"],
|
|
912
1033
|
additionalProperties: !1
|
|
913
|
-
},
|
|
914
|
-
anyOf: [
|
|
915
|
-
},
|
|
1034
|
+
}, Bt = {
|
|
1035
|
+
anyOf: [zt, Vt, Mt]
|
|
1036
|
+
}, Ut = {
|
|
916
1037
|
type: "object",
|
|
917
1038
|
properties: {
|
|
918
|
-
query:
|
|
1039
|
+
query: Bt,
|
|
919
1040
|
chart: {
|
|
920
|
-
anyOf: [
|
|
1041
|
+
anyOf: [Ft, Lt, Pt, $t, Nt, Ot]
|
|
921
1042
|
}
|
|
922
1043
|
},
|
|
923
1044
|
required: ["query", "chart"],
|
|
924
1045
|
additionalProperties: !1
|
|
925
|
-
},
|
|
1046
|
+
}, Gt = {
|
|
926
1047
|
type: "object",
|
|
927
1048
|
properties: {
|
|
928
1049
|
position: {
|
|
@@ -959,24 +1080,24 @@ const F = {
|
|
|
959
1080
|
},
|
|
960
1081
|
required: ["position", "size"],
|
|
961
1082
|
additionalProperties: !1
|
|
962
|
-
},
|
|
1083
|
+
}, Ht = {
|
|
963
1084
|
type: "object",
|
|
964
1085
|
properties: {
|
|
965
|
-
definition:
|
|
966
|
-
layout:
|
|
1086
|
+
definition: Ut,
|
|
1087
|
+
layout: Gt
|
|
967
1088
|
},
|
|
968
1089
|
required: ["definition", "layout"],
|
|
969
1090
|
additionalProperties: !1
|
|
970
|
-
},
|
|
1091
|
+
}, ir = {
|
|
971
1092
|
type: "object",
|
|
972
1093
|
properties: {
|
|
973
1094
|
tiles: {
|
|
974
1095
|
type: "array",
|
|
975
|
-
items:
|
|
1096
|
+
items: Ht
|
|
976
1097
|
},
|
|
977
1098
|
tileHeight: {
|
|
978
1099
|
type: "number",
|
|
979
|
-
description: `Height of each tile in pixels. Default: ${
|
|
1100
|
+
description: `Height of each tile in pixels. Default: ${B}`
|
|
980
1101
|
},
|
|
981
1102
|
gridSize: {
|
|
982
1103
|
type: "object",
|
|
@@ -997,27 +1118,27 @@ const F = {
|
|
|
997
1118
|
additionalProperties: !1
|
|
998
1119
|
};
|
|
999
1120
|
export {
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1121
|
+
rt as CP_ID_TOKEN,
|
|
1122
|
+
B as DEFAULT_TILE_HEIGHT,
|
|
1123
|
+
ot as DEFAULT_TILE_REFRESH_INTERVAL_MS,
|
|
1124
|
+
or as DashboardRenderer,
|
|
1125
|
+
re as ENTITY_ID_TOKEN,
|
|
1126
|
+
It as GridLayout,
|
|
1127
|
+
z as INJECT_QUERY_PROVIDER,
|
|
1128
|
+
nt as TIMEFRAME_TOKEN,
|
|
1129
|
+
Mt as aiQuerySchema,
|
|
1130
|
+
Ft as barChartSchema,
|
|
1131
|
+
Vt as basicQuerySchema,
|
|
1132
|
+
ir as dashboardConfigSchema,
|
|
1133
|
+
ar as dashboardTileTypes,
|
|
1134
|
+
zt as exploreV4QuerySchema,
|
|
1135
|
+
Lt as gaugeChartSchema,
|
|
1136
|
+
$t as metricCardSchema,
|
|
1137
|
+
Ot as slottableSchema,
|
|
1138
|
+
Ht as tileConfigSchema,
|
|
1139
|
+
Ut as tileDefinitionSchema,
|
|
1140
|
+
Gt as tileLayoutSchema,
|
|
1141
|
+
Pt as timeseriesChartSchema,
|
|
1142
|
+
Nt as topNTableSchema,
|
|
1143
|
+
Bt as validDashboardQuery
|
|
1023
1144
|
};
|