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