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