@kong-ui-public/dashboard-renderer 0.28.14 → 0.29.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 +351 -333
- package/dist/dashboard-renderer.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/BarChartRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/BaseAnalyticsChartRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/DashboardRenderer.vue.d.ts +3 -1
- package/dist/types/components/DashboardRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/DashboardTile.vue.d.ts +2 -0
- 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 +2 -0
- package/dist/types/components/QueryDataProvider.vue.d.ts.map +1 -1
- package/dist/types/components/SimpleChartRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/TimeseriesChartRenderer.vue.d.ts.map +1 -1
- package/dist/types/components/TopNTableRenderer.vue.d.ts.map +1 -1
- package/dist/types/types/dashboard-renderer-types.d.ts +1 -0
- package/dist/types/types/dashboard-renderer-types.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as E, watchEffect as ue, defineComponent as _, inject as z, onUnmounted as Y, computed as f, resolveComponent as O, unref as m, openBlock as p, createBlock as g, withCtx as v, createTextVNode as j, toDisplayString as $, renderSlot as V, createCommentVNode as Z, useCssVars as P, createElementVNode as X, createVNode as T, mergeProps as ee, createSlots as te, createElementBlock as C, normalizeProps as pe, guardReactiveProps as de, resolveDynamicComponent as ye, onMounted as he, Fragment as me, renderList as fe, normalizeClass as ge, normalizeStyle as M } from "vue";
|
|
2
2
|
import { SimpleChart as ve, AnalyticsChart as _e, TopNTable as be, ChartMetricDisplay as qe } from "@kong-ui-public/analytics-chart";
|
|
3
3
|
import Se from "swrv";
|
|
4
4
|
import "axios";
|
|
5
|
-
import { createI18n as
|
|
6
|
-
import { stripUnknownFilters as Ae, Timeframe as
|
|
7
|
-
import { MetricsProvider as
|
|
5
|
+
import { createI18n as Ce, i18nTComponent as Te } from "@kong-ui-public/i18n";
|
|
6
|
+
import { stripUnknownFilters as Ae, Timeframe as Re, TimePeriods as De, granularityValues as Ee, exploreFilterTypesV2 as Ie, exploreAggregations as xe, queryableExploreDimensions as we, filterableExploreDimensions as ke, basicExploreAggregations as Oe, queryableBasicExploreDimensions as Pe, filterableBasicExploreDimensions as Le, aiExploreAggregations as Ne, queryableAiExploreDimensions as ze, filterableAiExploreDimensions as je, relativeTimeRangeValuesV4 as $e } from "@kong-ui-public/analytics-utilities";
|
|
7
|
+
import { MetricsProvider as Ve, MetricsConsumer as Fe } from "@kong-ui-public/analytics-metric-provider";
|
|
8
8
|
import { EntityLink as Be } from "@kong-ui-public/entities-shared";
|
|
9
|
-
import { useAnalyticsConfigStore as
|
|
10
|
-
var re = /* @__PURE__ */ ((
|
|
11
|
-
const
|
|
12
|
-
var r,
|
|
13
|
-
return
|
|
14
|
-
((
|
|
9
|
+
import { useAnalyticsConfigStore as Ge } from "@kong-ui-public/analytics-config-store";
|
|
10
|
+
var re = /* @__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))(re || {});
|
|
11
|
+
const Ke = (e) => {
|
|
12
|
+
var t, r, n, o, i;
|
|
13
|
+
return e ? !!// TODO: revisit: currently only the first check ever matters?
|
|
14
|
+
((t = Object.keys(e)) != null && t.length || (r = e.data) != null && r.length || (o = (n = e.data) == null ? void 0 : n.data) != null && o.length || !((i = e.data) != null && i.data) && typeof e.data == "object" && Object.keys(e == null ? void 0 : e.data).length) : !1;
|
|
15
15
|
};
|
|
16
|
-
function
|
|
17
|
-
const
|
|
16
|
+
function He(e = E({}), t, r, n = Ke) {
|
|
17
|
+
const o = E(
|
|
18
18
|
"PENDING"
|
|
19
19
|
/* PENDING */
|
|
20
20
|
);
|
|
21
|
-
return
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
|
|
21
|
+
return ue(() => {
|
|
22
|
+
const i = n(e.value);
|
|
23
|
+
if (e.value && i && r.value) {
|
|
24
|
+
o.value = "VALIDATING_HAS_DATA";
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
27
|
-
if (
|
|
28
|
-
|
|
27
|
+
if (e.value && r.value) {
|
|
28
|
+
o.value = "VALIDATING";
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
if (
|
|
32
|
-
|
|
31
|
+
if (e.value && t.value) {
|
|
32
|
+
o.value = "STALE_IF_ERROR";
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
if (
|
|
36
|
-
|
|
35
|
+
if (e.value === void 0 && !t.value) {
|
|
36
|
+
o.value = "PENDING";
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
-
if (
|
|
40
|
-
|
|
39
|
+
if (e.value && !t.value && i) {
|
|
40
|
+
o.value = "SUCCESS_HAS_DATA";
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
if (
|
|
44
|
-
|
|
43
|
+
if (e.value && !t.value) {
|
|
44
|
+
o.value = "SUCCESS";
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
e.value === void 0 && t && (o.value = "ERROR");
|
|
48
48
|
}), {
|
|
49
|
-
state:
|
|
49
|
+
state: o,
|
|
50
50
|
swrvState: re
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const Ue = {
|
|
54
54
|
noQueryBridge: "No query bridge provided. Unable to render dashboard.",
|
|
55
55
|
trendRange: {
|
|
56
56
|
"24h": "Last 24-Hour Summary",
|
|
@@ -61,83 +61,84 @@ const He = {
|
|
|
61
61
|
}, Qe = {
|
|
62
62
|
timeRangeExceeded: "The time range for this report is outside of your organization's data retention period"
|
|
63
63
|
}, Me = {
|
|
64
|
-
renderer:
|
|
64
|
+
renderer: Ue,
|
|
65
65
|
queryDataProvider: Qe
|
|
66
66
|
};
|
|
67
67
|
function Je() {
|
|
68
|
-
const
|
|
68
|
+
const e = Ce("en-us", Me);
|
|
69
69
|
return {
|
|
70
|
-
i18n:
|
|
71
|
-
i18nT:
|
|
70
|
+
i18n: e,
|
|
71
|
+
i18nT: Te(e)
|
|
72
72
|
// Translation component <i18n-t>
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
const
|
|
75
|
+
const F = {
|
|
76
76
|
useI18n: Je
|
|
77
|
-
}, L = 170, B = "analytics-query-provider", J = "{entity-id}", We = "{cp-id}", Ye = "{timeframe}", Ze = 30 * 1e3,
|
|
77
|
+
}, L = 170, B = "analytics-query-provider", J = "{entity-id}", We = "{cp-id}", Ye = "{timeframe}", Ze = 30 * 1e3, G = /* @__PURE__ */ _({
|
|
78
78
|
__name: "QueryDataProvider",
|
|
79
79
|
props: {
|
|
80
80
|
context: {},
|
|
81
81
|
query: {},
|
|
82
|
-
queryReady: { type: Boolean }
|
|
82
|
+
queryReady: { type: Boolean },
|
|
83
|
+
refreshCounter: {}
|
|
83
84
|
},
|
|
84
85
|
emits: ["queryComplete"],
|
|
85
|
-
setup(
|
|
86
|
-
const
|
|
86
|
+
setup(e, { emit: t }) {
|
|
87
|
+
const r = e, n = t, { i18n: o } = F.useI18n(), i = z(B), c = () => r.queryReady && i ? JSON.stringify([r.query, r.context, r.refreshCounter]) : null, s = new AbortController();
|
|
87
88
|
Y(() => {
|
|
88
|
-
|
|
89
|
+
s.abort();
|
|
89
90
|
});
|
|
90
|
-
const l = (
|
|
91
|
-
const
|
|
92
|
-
return
|
|
93
|
-
}, { data:
|
|
94
|
-
var
|
|
91
|
+
const l = (u, h, b) => {
|
|
92
|
+
const q = [];
|
|
93
|
+
return h && q.push(...h), q.push(...Ae(u, b)), q;
|
|
94
|
+
}, { data: a, error: A, isValidating: x } = Se(c, async () => {
|
|
95
|
+
var u, h, b, q;
|
|
95
96
|
try {
|
|
96
97
|
let {
|
|
97
|
-
datasource:
|
|
98
|
+
datasource: d,
|
|
98
99
|
...se
|
|
99
|
-
} =
|
|
100
|
-
|
|
101
|
-
const ce = l(
|
|
102
|
-
datasource:
|
|
100
|
+
} = r.query;
|
|
101
|
+
d || (d = "basic");
|
|
102
|
+
const ce = l(d, r.query.filters, r.context.filters), le = {
|
|
103
|
+
datasource: d,
|
|
103
104
|
query: {
|
|
104
105
|
...se,
|
|
105
106
|
time_range: {
|
|
106
|
-
...
|
|
107
|
-
tz:
|
|
107
|
+
...r.context.timeSpec,
|
|
108
|
+
tz: r.context.tz
|
|
108
109
|
},
|
|
109
110
|
filters: ce
|
|
110
111
|
}
|
|
111
112
|
};
|
|
112
|
-
return
|
|
113
|
-
} catch (
|
|
114
|
-
|
|
113
|
+
return i == null ? void 0 : i.queryFn(le, s);
|
|
114
|
+
} catch (d) {
|
|
115
|
+
k.value = ((h = (u = d == null ? void 0 : d.response) == null ? void 0 : u.data) == null ? void 0 : h.message) === "Range not allowed for this tier" ? o.t("queryDataProvider.timeRangeExceeded") : ((q = (b = d == null ? void 0 : d.response) == null ? void 0 : b.data) == null ? void 0 : q.message) || (d == null ? void 0 : d.message);
|
|
115
116
|
} finally {
|
|
116
|
-
|
|
117
|
+
n("queryComplete");
|
|
117
118
|
}
|
|
118
119
|
}, {
|
|
119
|
-
refreshInterval:
|
|
120
|
+
refreshInterval: r.context.refreshInterval,
|
|
120
121
|
revalidateOnFocus: !1
|
|
121
|
-
}), { state:
|
|
122
|
-
return (
|
|
123
|
-
const
|
|
124
|
-
return
|
|
122
|
+
}), { state: R, swrvState: D } = He(a, A, x), k = E(null), y = f(() => R.value === D.ERROR || !!k.value), S = f(() => !r.queryReady || [D.PENDING, D.VALIDATING, D.VALIDATING_HAS_DATA].includes(R.value));
|
|
123
|
+
return (u, h) => {
|
|
124
|
+
const b = O("KSkeleton"), q = O("KEmptyState");
|
|
125
|
+
return S.value || !m(a) && !y.value ? (p(), g(b, {
|
|
125
126
|
key: 0,
|
|
126
127
|
class: "chart-skeleton",
|
|
127
128
|
type: "table"
|
|
128
|
-
})) :
|
|
129
|
+
})) : y.value ? (p(), g(q, {
|
|
129
130
|
key: 1,
|
|
130
131
|
"action-button-visible": !1,
|
|
131
132
|
"data-testid": "chart-empty-state",
|
|
132
133
|
"icon-variant": "error"
|
|
133
134
|
}, {
|
|
134
135
|
default: v(() => [
|
|
135
|
-
j($(
|
|
136
|
+
j($(k.value), 1)
|
|
136
137
|
]),
|
|
137
138
|
_: 1
|
|
138
|
-
})) : m(
|
|
139
|
+
})) : m(a) ? V(u.$slots, "default", {
|
|
139
140
|
key: 2,
|
|
140
|
-
data: m(
|
|
141
|
+
data: m(a)
|
|
141
142
|
}) : Z("", !0);
|
|
142
143
|
};
|
|
143
144
|
}
|
|
@@ -148,36 +149,38 @@ const V = {
|
|
|
148
149
|
context: {},
|
|
149
150
|
queryReady: { type: Boolean },
|
|
150
151
|
chartOptions: {},
|
|
151
|
-
height: {}
|
|
152
|
+
height: {},
|
|
153
|
+
refreshCounter: {}
|
|
152
154
|
},
|
|
153
|
-
setup(
|
|
154
|
-
P((
|
|
155
|
-
|
|
155
|
+
setup(e) {
|
|
156
|
+
P((r) => ({
|
|
157
|
+
bc149350: `${r.height}px`
|
|
156
158
|
}));
|
|
157
|
-
const
|
|
158
|
-
return (
|
|
159
|
-
context:
|
|
160
|
-
query:
|
|
161
|
-
"query-ready":
|
|
159
|
+
const t = e;
|
|
160
|
+
return (r, n) => (p(), g(G, {
|
|
161
|
+
context: r.context,
|
|
162
|
+
query: r.query,
|
|
163
|
+
"query-ready": r.queryReady,
|
|
164
|
+
"refresh-counter": r.refreshCounter
|
|
162
165
|
}, {
|
|
163
|
-
default: v(({ data:
|
|
166
|
+
default: v(({ data: o }) => [
|
|
164
167
|
X("div", Xe, [
|
|
165
|
-
|
|
166
|
-
"chart-data":
|
|
167
|
-
"chart-options":
|
|
168
|
-
"synthetics-data-key":
|
|
168
|
+
T(m(ve), {
|
|
169
|
+
"chart-data": o,
|
|
170
|
+
"chart-options": t.chartOptions,
|
|
171
|
+
"synthetics-data-key": r.chartOptions.syntheticsDataKey
|
|
169
172
|
}, null, 8, ["chart-data", "chart-options", "synthetics-data-key"])
|
|
170
173
|
])
|
|
171
174
|
]),
|
|
172
175
|
_: 1
|
|
173
|
-
}, 8, ["context", "query", "query-ready"]));
|
|
176
|
+
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
174
177
|
}
|
|
175
|
-
}),
|
|
176
|
-
const
|
|
177
|
-
for (const [
|
|
178
|
-
|
|
179
|
-
return
|
|
180
|
-
}, tt = /* @__PURE__ */
|
|
178
|
+
}), I = (e, t) => {
|
|
179
|
+
const r = e.__vccOpts || e;
|
|
180
|
+
for (const [n, o] of t)
|
|
181
|
+
r[n] = o;
|
|
182
|
+
return r;
|
|
183
|
+
}, tt = /* @__PURE__ */ I(et, [["__scopeId", "data-v-e770c4a0"]]), rt = { class: "analytics-chart" }, ot = /* @__PURE__ */ _({
|
|
181
184
|
__name: "BaseAnalyticsChartRenderer",
|
|
182
185
|
props: {
|
|
183
186
|
query: {},
|
|
@@ -185,57 +188,59 @@ const V = {
|
|
|
185
188
|
queryReady: { type: Boolean },
|
|
186
189
|
chartOptions: {},
|
|
187
190
|
height: {},
|
|
191
|
+
refreshCounter: {},
|
|
188
192
|
extraProps: {}
|
|
189
193
|
},
|
|
190
194
|
emits: ["edit-tile"],
|
|
191
|
-
setup(
|
|
192
|
-
P((
|
|
193
|
-
|
|
195
|
+
setup(e, { emit: t }) {
|
|
196
|
+
P((a) => ({
|
|
197
|
+
"38f70f43": `${a.height}px`
|
|
194
198
|
}));
|
|
195
|
-
const
|
|
196
|
-
type:
|
|
197
|
-
stacked:
|
|
198
|
-
chartDatasetColors:
|
|
199
|
-
})),
|
|
200
|
-
if (
|
|
201
|
-
const
|
|
202
|
-
filters: [...
|
|
203
|
-
metrics:
|
|
204
|
-
dimensions:
|
|
205
|
-
time_range:
|
|
206
|
-
},
|
|
207
|
-
return `${
|
|
199
|
+
const r = e, n = t, o = z(B), { i18n: i } = F.useI18n(), c = f(() => ({
|
|
200
|
+
type: r.chartOptions.type,
|
|
201
|
+
stacked: r.chartOptions.stacked ?? !1,
|
|
202
|
+
chartDatasetColors: r.chartOptions.chartDatasetColors
|
|
203
|
+
})), s = f(() => {
|
|
204
|
+
if (o && o.exploreBaseUrl) {
|
|
205
|
+
const a = {
|
|
206
|
+
filters: [...r.context.filters, ...r.query.filters ?? []],
|
|
207
|
+
metrics: r.query.metrics ?? [],
|
|
208
|
+
dimensions: r.query.dimensions ?? [],
|
|
209
|
+
time_range: r.query.time_range || r.context.timeSpec
|
|
210
|
+
}, A = ["advanced", "ai"].includes(r.query.datasource) ? r.query.datasource : "advanced";
|
|
211
|
+
return `${o.exploreBaseUrl()}?q=${JSON.stringify(a)}&d=${A}&c=${r.chartOptions.type}`;
|
|
208
212
|
}
|
|
209
213
|
return "";
|
|
210
214
|
}), l = () => {
|
|
211
|
-
|
|
215
|
+
n("edit-tile");
|
|
212
216
|
};
|
|
213
|
-
return (
|
|
214
|
-
const
|
|
215
|
-
return
|
|
216
|
-
context:
|
|
217
|
-
query:
|
|
218
|
-
"query-ready":
|
|
217
|
+
return (a, A) => {
|
|
218
|
+
const x = O("KDropdownItem");
|
|
219
|
+
return p(), g(G, {
|
|
220
|
+
context: a.context,
|
|
221
|
+
query: a.query,
|
|
222
|
+
"query-ready": a.queryReady,
|
|
223
|
+
"refresh-counter": a.refreshCounter
|
|
219
224
|
}, {
|
|
220
|
-
default: v(({ data:
|
|
225
|
+
default: v(({ data: R }) => [
|
|
221
226
|
X("div", rt, [
|
|
222
|
-
|
|
223
|
-
"allow-csv-export":
|
|
224
|
-
"chart-data":
|
|
227
|
+
T(m(_e), ee({
|
|
228
|
+
"allow-csv-export": a.chartOptions.allowCsvExport,
|
|
229
|
+
"chart-data": R,
|
|
225
230
|
"chart-options": c.value,
|
|
226
|
-
"chart-title":
|
|
227
|
-
"go-to-explore":
|
|
231
|
+
"chart-title": a.chartOptions.chartTitle,
|
|
232
|
+
"go-to-explore": s.value,
|
|
228
233
|
"legend-position": "bottom",
|
|
229
|
-
"show-menu":
|
|
230
|
-
"synthetics-data-key":
|
|
234
|
+
"show-menu": a.context.editable,
|
|
235
|
+
"synthetics-data-key": a.chartOptions.syntheticsDataKey,
|
|
231
236
|
"tooltip-title": ""
|
|
232
|
-
},
|
|
233
|
-
|
|
237
|
+
}, a.extraProps), te({ _: 2 }, [
|
|
238
|
+
a.context.editable ? {
|
|
234
239
|
name: "menu-items",
|
|
235
240
|
fn: v(() => [
|
|
236
|
-
|
|
241
|
+
T(x, { onClick: l }, {
|
|
237
242
|
default: v(() => [
|
|
238
|
-
j($(m(
|
|
243
|
+
j($(m(i).t("renderer.edit")), 1)
|
|
239
244
|
]),
|
|
240
245
|
_: 1
|
|
241
246
|
})
|
|
@@ -246,145 +251,153 @@ const V = {
|
|
|
246
251
|
])
|
|
247
252
|
]),
|
|
248
253
|
_: 1
|
|
249
|
-
}, 8, ["context", "query", "query-ready"]);
|
|
254
|
+
}, 8, ["context", "query", "query-ready", "refresh-counter"]);
|
|
250
255
|
};
|
|
251
256
|
}
|
|
252
|
-
}),
|
|
257
|
+
}), oe = /* @__PURE__ */ I(ot, [["__scopeId", "data-v-42e7ce7e"]]), W = /* @__PURE__ */ _({
|
|
253
258
|
__name: "BarChartRenderer",
|
|
254
259
|
props: {
|
|
255
260
|
query: {},
|
|
256
261
|
context: {},
|
|
257
262
|
queryReady: { type: Boolean },
|
|
258
263
|
chartOptions: {},
|
|
259
|
-
height: {}
|
|
264
|
+
height: {},
|
|
265
|
+
refreshCounter: {}
|
|
260
266
|
},
|
|
261
|
-
setup(
|
|
262
|
-
return (
|
|
263
|
-
"chart-options":
|
|
264
|
-
context:
|
|
267
|
+
setup(e) {
|
|
268
|
+
return (t, r) => (p(), g(oe, {
|
|
269
|
+
"chart-options": t.chartOptions,
|
|
270
|
+
context: t.context,
|
|
265
271
|
"extra-props": { showAnnotations: !1 },
|
|
266
|
-
height:
|
|
267
|
-
query:
|
|
268
|
-
"query-ready":
|
|
269
|
-
|
|
272
|
+
height: t.height,
|
|
273
|
+
query: t.query,
|
|
274
|
+
"query-ready": t.queryReady,
|
|
275
|
+
"refresh-counter": t.refreshCounter
|
|
276
|
+
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
270
277
|
}
|
|
271
|
-
}),
|
|
278
|
+
}), nt = /* @__PURE__ */ _({
|
|
272
279
|
__name: "TimeseriesChartRenderer",
|
|
273
280
|
props: {
|
|
274
281
|
query: {},
|
|
275
282
|
context: {},
|
|
276
283
|
queryReady: { type: Boolean },
|
|
277
284
|
chartOptions: {},
|
|
278
|
-
height: {}
|
|
285
|
+
height: {},
|
|
286
|
+
refreshCounter: {}
|
|
279
287
|
},
|
|
280
|
-
setup(
|
|
281
|
-
return (
|
|
282
|
-
"chart-options":
|
|
283
|
-
context:
|
|
284
|
-
height:
|
|
285
|
-
query:
|
|
286
|
-
"query-ready":
|
|
287
|
-
|
|
288
|
+
setup(e) {
|
|
289
|
+
return (t, r) => (p(), g(oe, {
|
|
290
|
+
"chart-options": t.chartOptions,
|
|
291
|
+
context: t.context,
|
|
292
|
+
height: t.height,
|
|
293
|
+
query: t.query,
|
|
294
|
+
"query-ready": t.queryReady,
|
|
295
|
+
"refresh-counter": t.refreshCounter
|
|
296
|
+
}, null, 8, ["chart-options", "context", "height", "query", "query-ready", "refresh-counter"]));
|
|
288
297
|
}
|
|
289
|
-
}),
|
|
298
|
+
}), it = { class: "metric-card-tile-wrapper" }, at = /* @__PURE__ */ _({
|
|
290
299
|
__name: "GoldenSignalsRenderer",
|
|
291
300
|
props: {
|
|
292
301
|
query: {},
|
|
293
302
|
context: {},
|
|
294
303
|
queryReady: { type: Boolean },
|
|
295
304
|
chartOptions: {},
|
|
296
|
-
height: {}
|
|
305
|
+
height: {},
|
|
306
|
+
refreshCounter: {}
|
|
297
307
|
},
|
|
298
|
-
setup(
|
|
299
|
-
const
|
|
300
|
-
const
|
|
301
|
-
if (
|
|
302
|
-
return new
|
|
308
|
+
setup(e) {
|
|
309
|
+
const t = e, r = f(() => {
|
|
310
|
+
const o = t.context.timeSpec;
|
|
311
|
+
if (o.type === "absolute")
|
|
312
|
+
return new Re({
|
|
303
313
|
key: "custom",
|
|
304
314
|
timeframeText: "custom",
|
|
305
315
|
display: "custom",
|
|
306
|
-
startCustom:
|
|
307
|
-
endCustom:
|
|
308
|
-
timeframeLength: () =>
|
|
316
|
+
startCustom: o.start,
|
|
317
|
+
endCustom: o.end,
|
|
318
|
+
timeframeLength: () => o.end.getTime() - o.start.getTime(),
|
|
309
319
|
defaultResponseGranularity: "daily",
|
|
310
320
|
dataGranularity: "daily",
|
|
311
321
|
isRelative: !1,
|
|
312
322
|
allowedTiers: ["free", "plus", "enterprise"]
|
|
313
323
|
});
|
|
314
|
-
const
|
|
315
|
-
if (!
|
|
324
|
+
const i = De.get(o.time_range);
|
|
325
|
+
if (!i)
|
|
316
326
|
throw new Error("Unknown time range");
|
|
317
|
-
return
|
|
318
|
-
}),
|
|
319
|
-
var
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
throw new Error(`Invalid datasource value: ${
|
|
327
|
+
return i;
|
|
328
|
+
}), n = f(() => {
|
|
329
|
+
var i, c;
|
|
330
|
+
const o = (i = t.query) == null ? void 0 : i.datasource;
|
|
331
|
+
if (o && o !== "advanced" && o !== "basic")
|
|
332
|
+
throw new Error(`Invalid datasource value: ${o}`);
|
|
323
333
|
return {
|
|
324
|
-
datasource: (c =
|
|
325
|
-
overrideTimeframe:
|
|
326
|
-
tz:
|
|
327
|
-
additionalFilter:
|
|
334
|
+
datasource: (c = t.query) == null ? void 0 : c.datasource,
|
|
335
|
+
overrideTimeframe: r.value,
|
|
336
|
+
tz: t.context.tz,
|
|
337
|
+
additionalFilter: t.context.filters,
|
|
328
338
|
// TODO: Decide how to handle metric card filters.
|
|
329
|
-
longCardTitles:
|
|
330
|
-
containerTitle:
|
|
331
|
-
description:
|
|
332
|
-
percentileLatency:
|
|
333
|
-
refreshInterval:
|
|
334
|
-
queryReady:
|
|
339
|
+
longCardTitles: t.chartOptions.longCardTitles,
|
|
340
|
+
containerTitle: t.chartOptions.chartTitle,
|
|
341
|
+
description: t.chartOptions.description,
|
|
342
|
+
percentileLatency: t.chartOptions.percentileLatency,
|
|
343
|
+
refreshInterval: t.context.refreshInterval,
|
|
344
|
+
queryReady: t.queryReady,
|
|
345
|
+
refreshCounter: t.refreshCounter
|
|
335
346
|
};
|
|
336
347
|
});
|
|
337
|
-
return (
|
|
338
|
-
|
|
348
|
+
return (o, i) => (p(), C("div", it, [
|
|
349
|
+
T(m(Ve), pe(de(n.value)), {
|
|
339
350
|
default: v(() => [
|
|
340
|
-
|
|
351
|
+
T(m(Fe))
|
|
341
352
|
]),
|
|
342
353
|
_: 1
|
|
343
354
|
}, 16)
|
|
344
355
|
]));
|
|
345
356
|
}
|
|
346
|
-
}), st = /* @__PURE__ */
|
|
357
|
+
}), st = /* @__PURE__ */ I(at, [["__scopeId", "data-v-48bea474"]]), ne = "20px", ct = /* @__PURE__ */ _({
|
|
347
358
|
__name: "TopNTableRenderer",
|
|
348
359
|
props: {
|
|
349
360
|
query: {},
|
|
350
361
|
context: {},
|
|
351
362
|
queryReady: { type: Boolean },
|
|
352
363
|
chartOptions: {},
|
|
353
|
-
height: {}
|
|
364
|
+
height: {},
|
|
365
|
+
refreshCounter: {}
|
|
354
366
|
},
|
|
355
|
-
setup(
|
|
356
|
-
const
|
|
357
|
-
var
|
|
358
|
-
if ((
|
|
359
|
-
if (
|
|
360
|
-
const [
|
|
361
|
-
return
|
|
367
|
+
setup(e) {
|
|
368
|
+
const t = e, r = (n) => {
|
|
369
|
+
var o;
|
|
370
|
+
if ((o = t.chartOptions) != null && o.entityLink)
|
|
371
|
+
if (n.id.includes(":")) {
|
|
372
|
+
const [i, c] = n.id.split(":");
|
|
373
|
+
return t.chartOptions.entityLink.replace(We, i).replace(J, c);
|
|
362
374
|
} else
|
|
363
|
-
return
|
|
375
|
+
return t.chartOptions.entityLink.replace(J, n.id);
|
|
364
376
|
return "";
|
|
365
377
|
};
|
|
366
|
-
return (
|
|
367
|
-
context:
|
|
368
|
-
query:
|
|
369
|
-
"query-ready":
|
|
378
|
+
return (n, o) => (p(), g(G, {
|
|
379
|
+
context: n.context,
|
|
380
|
+
query: n.query,
|
|
381
|
+
"query-ready": n.queryReady,
|
|
382
|
+
"refresh-counter": n.refreshCounter
|
|
370
383
|
}, {
|
|
371
|
-
default: v(({ data:
|
|
372
|
-
|
|
373
|
-
data:
|
|
374
|
-
description:
|
|
375
|
-
"synthetics-data-key":
|
|
376
|
-
title:
|
|
384
|
+
default: v(({ data: i }) => [
|
|
385
|
+
T(m(be), {
|
|
386
|
+
data: i,
|
|
387
|
+
description: n.chartOptions.description,
|
|
388
|
+
"synthetics-data-key": n.chartOptions.syntheticsDataKey,
|
|
389
|
+
title: n.chartOptions.chartTitle || ""
|
|
377
390
|
}, te({ _: 2 }, [
|
|
378
|
-
|
|
391
|
+
t.chartOptions.entityLink ? {
|
|
379
392
|
name: "name",
|
|
380
393
|
fn: v(({ record: c }) => [
|
|
381
|
-
|
|
394
|
+
T(m(Be), {
|
|
382
395
|
"entity-link-data": {
|
|
383
396
|
id: c.id,
|
|
384
397
|
label: c.name,
|
|
385
398
|
deleted: c.deleted
|
|
386
399
|
},
|
|
387
|
-
"external-link":
|
|
400
|
+
"external-link": r(c)
|
|
388
401
|
}, null, 8, ["entity-link-data", "external-link"])
|
|
389
402
|
]),
|
|
390
403
|
key: "0"
|
|
@@ -392,58 +405,60 @@ const V = {
|
|
|
392
405
|
]), 1032, ["data", "description", "synthetics-data-key", "title"])
|
|
393
406
|
]),
|
|
394
407
|
_: 1
|
|
395
|
-
}, 8, ["context", "query", "query-ready"]));
|
|
408
|
+
}, 8, ["context", "query", "query-ready", "refresh-counter"]));
|
|
396
409
|
}
|
|
397
|
-
}), lt = { class: "tile-boundary" },
|
|
410
|
+
}), lt = { class: "tile-boundary" }, ut = /* @__PURE__ */ _({
|
|
398
411
|
__name: "DashboardTile",
|
|
399
412
|
props: {
|
|
400
413
|
definition: {},
|
|
401
414
|
context: {},
|
|
402
415
|
height: { default: L },
|
|
403
|
-
queryReady: { type: Boolean }
|
|
416
|
+
queryReady: { type: Boolean },
|
|
417
|
+
refreshCounter: {}
|
|
404
418
|
},
|
|
405
419
|
emits: ["edit-tile"],
|
|
406
|
-
setup(
|
|
420
|
+
setup(e, { emit: t }) {
|
|
407
421
|
P((l) => ({
|
|
408
|
-
|
|
422
|
+
"1bafe566": `${l.height}px`
|
|
409
423
|
}));
|
|
410
|
-
const
|
|
411
|
-
timeseries_line:
|
|
424
|
+
const r = parseInt(ne, 10), n = e, o = t, i = {
|
|
425
|
+
timeseries_line: nt,
|
|
412
426
|
horizontal_bar: W,
|
|
413
427
|
vertical_bar: W,
|
|
414
428
|
gauge: tt,
|
|
415
429
|
golden_signals: st,
|
|
416
430
|
top_n: ct,
|
|
417
431
|
slottable: void 0
|
|
418
|
-
}, c =
|
|
419
|
-
const l = n
|
|
432
|
+
}, c = f(() => {
|
|
433
|
+
const l = i[n.definition.chart.type];
|
|
420
434
|
return l && {
|
|
421
435
|
component: l,
|
|
422
436
|
rendererProps: {
|
|
423
|
-
query:
|
|
424
|
-
context:
|
|
425
|
-
queryReady:
|
|
426
|
-
chartOptions:
|
|
427
|
-
height:
|
|
437
|
+
query: n.definition.query,
|
|
438
|
+
context: n.context,
|
|
439
|
+
queryReady: n.queryReady,
|
|
440
|
+
chartOptions: n.definition.chart,
|
|
441
|
+
height: n.height - r * 2,
|
|
442
|
+
refreshCounter: n.refreshCounter
|
|
428
443
|
}
|
|
429
444
|
};
|
|
430
|
-
}),
|
|
431
|
-
|
|
445
|
+
}), s = () => {
|
|
446
|
+
o("edit-tile", n.definition);
|
|
432
447
|
};
|
|
433
|
-
return (l,
|
|
434
|
-
c.value ? (
|
|
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)
|
|
435
450
|
]));
|
|
436
451
|
}
|
|
437
|
-
}),
|
|
438
|
-
const
|
|
439
|
-
|
|
440
|
-
const c =
|
|
441
|
-
|
|
452
|
+
}), pt = /* @__PURE__ */ I(ut, [["__scopeId", "data-v-c13de16a"]]), dt = (e, t, r) => {
|
|
453
|
+
const n = /* @__PURE__ */ new Map();
|
|
454
|
+
r.forEach((i) => {
|
|
455
|
+
const c = i.layout.position.row, s = n.get(c), l = i.layout.size.rows === 1 && !!i.layout.size.fitToContent;
|
|
456
|
+
s === void 0 ? n.set(c, l) : n.set(c, s && l);
|
|
442
457
|
});
|
|
443
|
-
const
|
|
444
|
-
for (let
|
|
445
|
-
|
|
446
|
-
return
|
|
458
|
+
const o = [];
|
|
459
|
+
for (let i = 0; i < e; i++)
|
|
460
|
+
n.get(i) ? o.push("auto") : o.push(`${t}px`);
|
|
461
|
+
return o;
|
|
447
462
|
}, yt = /* @__PURE__ */ _({
|
|
448
463
|
__name: "GridLayout",
|
|
449
464
|
props: {
|
|
@@ -461,127 +476,130 @@ const V = {
|
|
|
461
476
|
required: !0
|
|
462
477
|
}
|
|
463
478
|
},
|
|
464
|
-
setup(
|
|
465
|
-
P((
|
|
466
|
-
"3bc5e939":
|
|
467
|
-
"77aa3028":
|
|
479
|
+
setup(e) {
|
|
480
|
+
P((s) => ({
|
|
481
|
+
"3bc5e939": e.gridSize.cols,
|
|
482
|
+
"77aa3028": i.value
|
|
468
483
|
}));
|
|
469
|
-
const
|
|
484
|
+
const t = e, r = E(null), n = E(0), o = new ResizeObserver((s) => {
|
|
470
485
|
window.requestAnimationFrame(() => {
|
|
471
|
-
!Array.isArray(
|
|
486
|
+
!Array.isArray(s) || !s.length || (n.value = s[0].contentRect.width);
|
|
472
487
|
});
|
|
473
488
|
});
|
|
474
|
-
|
|
475
|
-
|
|
489
|
+
he(() => {
|
|
490
|
+
r.value && o.observe(r.value);
|
|
476
491
|
}), Y(() => {
|
|
477
|
-
|
|
492
|
+
r.value && o.unobserve(r.value);
|
|
478
493
|
});
|
|
479
|
-
const
|
|
494
|
+
const i = f(() => {
|
|
480
495
|
var l;
|
|
481
|
-
return
|
|
482
|
-
}), c =
|
|
496
|
+
return dt((l = t.gridSize) == null ? void 0 : l.rows, t.tileHeight, t.tiles).join(" ");
|
|
497
|
+
}), c = f(() => t.tiles.map((s, l) => ({
|
|
483
498
|
key: `tile-${l}`,
|
|
484
|
-
tile:
|
|
499
|
+
tile: s,
|
|
485
500
|
style: {
|
|
486
|
-
"grid-column-start":
|
|
487
|
-
"grid-column-end":
|
|
488
|
-
"grid-row-start":
|
|
489
|
-
"grid-row-end":
|
|
501
|
+
"grid-column-start": s.layout.position.col + 1,
|
|
502
|
+
"grid-column-end": s.layout.position.col + 1 + s.layout.size.cols,
|
|
503
|
+
"grid-row-start": s.layout.position.row + 1,
|
|
504
|
+
"grid-row-end": s.layout.position.row + 1 + s.layout.size.rows
|
|
490
505
|
}
|
|
491
506
|
})));
|
|
492
|
-
return (
|
|
507
|
+
return (s, l) => (p(), C("div", {
|
|
493
508
|
ref_key: "gridContainer",
|
|
494
|
-
ref:
|
|
509
|
+
ref: r,
|
|
495
510
|
class: "kong-ui-public-grid-layout"
|
|
496
511
|
}, [
|
|
497
|
-
(
|
|
498
|
-
key:
|
|
499
|
-
class:
|
|
500
|
-
"empty-cell": !
|
|
512
|
+
(p(!0), C(me, null, fe(c.value, (a) => (p(), C("div", {
|
|
513
|
+
key: a.key,
|
|
514
|
+
class: ge(["grid-cell", {
|
|
515
|
+
"empty-cell": !a.tile
|
|
501
516
|
}]),
|
|
502
|
-
style: M(
|
|
517
|
+
style: M(a.style)
|
|
503
518
|
}, [
|
|
504
|
-
|
|
505
|
-
style: M(
|
|
506
|
-
tile:
|
|
519
|
+
V(s.$slots, "tile", {
|
|
520
|
+
style: M(a.style),
|
|
521
|
+
tile: a.tile
|
|
507
522
|
}, void 0, !0)
|
|
508
523
|
], 6))), 128))
|
|
509
524
|
], 512));
|
|
510
525
|
}
|
|
511
|
-
}),
|
|
526
|
+
}), ht = /* @__PURE__ */ I(yt, [["__scopeId", "data-v-f43eb7b8"]]), mt = { class: "kong-ui-public-dashboard-renderer" }, ft = {
|
|
512
527
|
key: 0,
|
|
513
528
|
class: "tile-container"
|
|
514
|
-
},
|
|
529
|
+
}, gt = /* @__PURE__ */ _({
|
|
515
530
|
__name: "DashboardRenderer",
|
|
516
531
|
props: {
|
|
517
532
|
context: {},
|
|
518
533
|
config: {}
|
|
519
534
|
},
|
|
520
535
|
emits: ["edit-tile"],
|
|
521
|
-
setup(
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
const
|
|
536
|
+
setup(e, { expose: t, emit: r }) {
|
|
537
|
+
const n = e, o = r, { i18n: i } = F.useI18n(), c = E(0), s = z(B);
|
|
538
|
+
s || (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"));
|
|
539
|
+
const l = Ge(), a = f(() => n.context.timeSpec ? n.context.timeSpec : {
|
|
525
540
|
type: "relative",
|
|
526
|
-
time_range:
|
|
527
|
-
}),
|
|
528
|
-
var
|
|
529
|
-
let u =
|
|
541
|
+
time_range: l.defaultQueryTimeForOrg
|
|
542
|
+
}), A = f(() => !!n.context.timeSpec || !l.loading), x = f(() => n.config.tiles.map((y, S) => {
|
|
543
|
+
var h;
|
|
544
|
+
let u = y.definition;
|
|
530
545
|
if ("description" in u.chart) {
|
|
531
|
-
const
|
|
532
|
-
const
|
|
533
|
-
return i.te(
|
|
546
|
+
const b = (h = u.chart.description) == null ? void 0 : h.replace(Ye, () => {
|
|
547
|
+
const d = `renderer.trendRange.${a.value.type === "absolute" ? "custom" : a.value.time_range}`;
|
|
548
|
+
return i.te(d) ? i.t(d) : "";
|
|
534
549
|
});
|
|
535
550
|
u = {
|
|
536
551
|
...u,
|
|
537
552
|
chart: {
|
|
538
553
|
...u.chart,
|
|
539
|
-
description:
|
|
554
|
+
description: b
|
|
540
555
|
}
|
|
541
556
|
};
|
|
542
557
|
}
|
|
543
558
|
return {
|
|
544
|
-
layout:
|
|
559
|
+
layout: y.layout,
|
|
545
560
|
meta: u,
|
|
546
561
|
// Add a unique key to each tile internally.
|
|
547
|
-
id:
|
|
562
|
+
id: S
|
|
548
563
|
};
|
|
549
|
-
})),
|
|
550
|
-
let { tz:
|
|
551
|
-
return
|
|
552
|
-
...
|
|
553
|
-
tz:
|
|
564
|
+
})), R = f(() => {
|
|
565
|
+
let { tz: y, refreshInterval: S, editable: u } = n.context;
|
|
566
|
+
return y || (y = new Intl.DateTimeFormat().resolvedOptions().timeZone), S === void 0 && (S = Ze), u === void 0 && (u = !1), {
|
|
567
|
+
...n.context,
|
|
568
|
+
tz: y,
|
|
554
569
|
timeSpec: a.value,
|
|
555
|
-
refreshInterval:
|
|
570
|
+
refreshInterval: S,
|
|
556
571
|
editable: u
|
|
557
572
|
};
|
|
558
|
-
}),
|
|
559
|
-
o("edit-tile",
|
|
573
|
+
}), D = (y) => {
|
|
574
|
+
o("edit-tile", y);
|
|
560
575
|
};
|
|
561
|
-
return (
|
|
576
|
+
return t({ refresh: () => {
|
|
577
|
+
c.value++;
|
|
578
|
+
} }), (y, S) => {
|
|
562
579
|
const u = O("KAlert");
|
|
563
|
-
return
|
|
564
|
-
m(
|
|
580
|
+
return p(), C("div", mt, [
|
|
581
|
+
m(s) ? (p(), g(ht, {
|
|
565
582
|
key: 1,
|
|
566
|
-
"grid-size":
|
|
567
|
-
"tile-height":
|
|
568
|
-
tiles:
|
|
583
|
+
"grid-size": y.config.gridSize,
|
|
584
|
+
"tile-height": y.config.tileHeight,
|
|
585
|
+
tiles: x.value
|
|
569
586
|
}, {
|
|
570
|
-
tile: v(({ tile:
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
])) : (
|
|
587
|
+
tile: v(({ tile: h }) => [
|
|
588
|
+
h.meta.chart.type === "slottable" ? (p(), C("div", ft, [
|
|
589
|
+
V(y.$slots, h.meta.chart.id, {}, void 0, !0)
|
|
590
|
+
])) : (p(), g(pt, {
|
|
574
591
|
key: 1,
|
|
575
592
|
class: "tile-container",
|
|
576
|
-
context:
|
|
577
|
-
definition:
|
|
578
|
-
height:
|
|
579
|
-
"query-ready":
|
|
580
|
-
|
|
581
|
-
|
|
593
|
+
context: R.value,
|
|
594
|
+
definition: h.meta,
|
|
595
|
+
height: h.layout.size.rows * (y.config.tileHeight || m(L)) + parseInt(m(ne), 10),
|
|
596
|
+
"query-ready": A.value,
|
|
597
|
+
"refresh-counter": c.value,
|
|
598
|
+
onEditTile: (b) => D(h)
|
|
599
|
+
}, null, 8, ["context", "definition", "height", "query-ready", "refresh-counter", "onEditTile"]))
|
|
582
600
|
]),
|
|
583
601
|
_: 3
|
|
584
|
-
}, 8, ["grid-size", "tile-height", "tiles"])) : (
|
|
602
|
+
}, 8, ["grid-size", "tile-height", "tiles"])) : (p(), g(u, {
|
|
585
603
|
key: 0,
|
|
586
604
|
appearance: "danger"
|
|
587
605
|
}, {
|
|
@@ -593,7 +611,7 @@ const V = {
|
|
|
593
611
|
]);
|
|
594
612
|
};
|
|
595
613
|
}
|
|
596
|
-
}), Bt = /* @__PURE__ */
|
|
614
|
+
}), Bt = /* @__PURE__ */ I(gt, [["__scopeId", "data-v-26130807"]]), Gt = [
|
|
597
615
|
"horizontal_bar",
|
|
598
616
|
"vertical_bar",
|
|
599
617
|
"gauge",
|
|
@@ -605,7 +623,7 @@ const V = {
|
|
|
605
623
|
type: "string"
|
|
606
624
|
}, w = {
|
|
607
625
|
type: "string"
|
|
608
|
-
},
|
|
626
|
+
}, ie = {
|
|
609
627
|
type: "boolean"
|
|
610
628
|
}, ae = {
|
|
611
629
|
type: ["object", "array"],
|
|
@@ -641,7 +659,7 @@ const V = {
|
|
|
641
659
|
chartDatasetColors: ae,
|
|
642
660
|
syntheticsDataKey: N,
|
|
643
661
|
chartTitle: w,
|
|
644
|
-
allowCsvExport:
|
|
662
|
+
allowCsvExport: ie
|
|
645
663
|
},
|
|
646
664
|
required: ["type"],
|
|
647
665
|
additionalProperties: !1
|
|
@@ -658,7 +676,7 @@ const V = {
|
|
|
658
676
|
chartDatasetColors: ae,
|
|
659
677
|
syntheticsDataKey: N,
|
|
660
678
|
chartTitle: w,
|
|
661
|
-
allowCsvExport:
|
|
679
|
+
allowCsvExport: ie
|
|
662
680
|
},
|
|
663
681
|
required: ["type"],
|
|
664
682
|
additionalProperties: !1
|
|
@@ -702,7 +720,7 @@ const V = {
|
|
|
702
720
|
},
|
|
703
721
|
required: ["type"],
|
|
704
722
|
additionalProperties: !1
|
|
705
|
-
},
|
|
723
|
+
}, Ct = {
|
|
706
724
|
type: "object",
|
|
707
725
|
properties: {
|
|
708
726
|
chartTitle: w,
|
|
@@ -722,7 +740,7 @@ const V = {
|
|
|
722
740
|
},
|
|
723
741
|
required: ["type"],
|
|
724
742
|
additionalProperties: !1
|
|
725
|
-
},
|
|
743
|
+
}, Tt = {
|
|
726
744
|
type: "object",
|
|
727
745
|
properties: {
|
|
728
746
|
tz: {
|
|
@@ -772,17 +790,17 @@ const V = {
|
|
|
772
790
|
"end"
|
|
773
791
|
],
|
|
774
792
|
additionalProperties: !1
|
|
775
|
-
},
|
|
793
|
+
}, K = {
|
|
776
794
|
granularity: {
|
|
777
795
|
type: "string",
|
|
778
796
|
description: 'Force time grouping into buckets of this duration. Only has an effect if "time" is in the "dimensions" list.',
|
|
779
|
-
enum:
|
|
797
|
+
enum: Ee
|
|
780
798
|
},
|
|
781
799
|
time_range: {
|
|
782
800
|
type: "object",
|
|
783
801
|
description: "The time range to query.",
|
|
784
802
|
anyOf: [
|
|
785
|
-
|
|
803
|
+
Tt,
|
|
786
804
|
At
|
|
787
805
|
],
|
|
788
806
|
default: {
|
|
@@ -796,23 +814,23 @@ const V = {
|
|
|
796
814
|
meta: {
|
|
797
815
|
type: "object"
|
|
798
816
|
}
|
|
799
|
-
},
|
|
817
|
+
}, H = (e) => ({
|
|
800
818
|
type: "array",
|
|
801
819
|
description: "List of aggregated metrics to collect across the requested time span.",
|
|
802
820
|
items: {
|
|
803
821
|
type: "string",
|
|
804
|
-
enum:
|
|
822
|
+
enum: e
|
|
805
823
|
}
|
|
806
|
-
}),
|
|
824
|
+
}), U = (e) => ({
|
|
807
825
|
type: "array",
|
|
808
826
|
description: "List of attributes or entity types to group by.",
|
|
809
827
|
minItems: 0,
|
|
810
828
|
maxItems: 2,
|
|
811
829
|
items: {
|
|
812
830
|
type: "string",
|
|
813
|
-
enum:
|
|
831
|
+
enum: e
|
|
814
832
|
}
|
|
815
|
-
}), Q = (
|
|
833
|
+
}), Q = (e) => ({
|
|
816
834
|
type: "array",
|
|
817
835
|
description: "A list of filters to apply to the query.",
|
|
818
836
|
items: {
|
|
@@ -821,11 +839,11 @@ const V = {
|
|
|
821
839
|
properties: {
|
|
822
840
|
dimension: {
|
|
823
841
|
type: "string",
|
|
824
|
-
enum:
|
|
842
|
+
enum: e
|
|
825
843
|
},
|
|
826
844
|
type: {
|
|
827
845
|
type: "string",
|
|
828
|
-
enum:
|
|
846
|
+
enum: Ie
|
|
829
847
|
},
|
|
830
848
|
values: {
|
|
831
849
|
type: "array",
|
|
@@ -841,7 +859,7 @@ const V = {
|
|
|
841
859
|
],
|
|
842
860
|
additionalProperties: !1
|
|
843
861
|
}
|
|
844
|
-
}),
|
|
862
|
+
}), Rt = {
|
|
845
863
|
type: "object",
|
|
846
864
|
description: "A query to launch at the advanced explore API",
|
|
847
865
|
properties: {
|
|
@@ -851,14 +869,14 @@ const V = {
|
|
|
851
869
|
"advanced"
|
|
852
870
|
]
|
|
853
871
|
},
|
|
854
|
-
metrics:
|
|
855
|
-
dimensions:
|
|
872
|
+
metrics: H(xe),
|
|
873
|
+
dimensions: U(we),
|
|
856
874
|
filters: Q(ke),
|
|
857
|
-
...
|
|
875
|
+
...K
|
|
858
876
|
},
|
|
859
877
|
required: ["datasource"],
|
|
860
878
|
additionalProperties: !1
|
|
861
|
-
},
|
|
879
|
+
}, Dt = {
|
|
862
880
|
type: "object",
|
|
863
881
|
description: "A query to launch at the basic explore API",
|
|
864
882
|
properties: {
|
|
@@ -868,14 +886,14 @@ const V = {
|
|
|
868
886
|
"basic"
|
|
869
887
|
]
|
|
870
888
|
},
|
|
871
|
-
metrics:
|
|
872
|
-
dimensions:
|
|
889
|
+
metrics: H(Oe),
|
|
890
|
+
dimensions: U(Pe),
|
|
873
891
|
filters: Q(Le),
|
|
874
|
-
...
|
|
892
|
+
...K
|
|
875
893
|
},
|
|
876
894
|
required: ["datasource"],
|
|
877
895
|
additionalProperties: !1
|
|
878
|
-
},
|
|
896
|
+
}, Et = {
|
|
879
897
|
type: "object",
|
|
880
898
|
description: "A query to launch at the AI explore API",
|
|
881
899
|
properties: {
|
|
@@ -885,21 +903,21 @@ const V = {
|
|
|
885
903
|
"ai"
|
|
886
904
|
]
|
|
887
905
|
},
|
|
888
|
-
metrics:
|
|
889
|
-
dimensions:
|
|
906
|
+
metrics: H(Ne),
|
|
907
|
+
dimensions: U(ze),
|
|
890
908
|
filters: Q(je),
|
|
891
|
-
...
|
|
909
|
+
...K
|
|
892
910
|
},
|
|
893
911
|
required: ["datasource"],
|
|
894
912
|
additionalProperties: !1
|
|
895
|
-
}, Ct = {
|
|
896
|
-
anyOf: [Et, xt, Dt]
|
|
897
913
|
}, It = {
|
|
914
|
+
anyOf: [Rt, Dt, Et]
|
|
915
|
+
}, xt = {
|
|
898
916
|
type: "object",
|
|
899
917
|
properties: {
|
|
900
|
-
query:
|
|
918
|
+
query: It,
|
|
901
919
|
chart: {
|
|
902
|
-
anyOf: [_t, qt, bt,
|
|
920
|
+
anyOf: [_t, qt, bt, Ct, St, vt]
|
|
903
921
|
}
|
|
904
922
|
},
|
|
905
923
|
required: ["query", "chart"],
|
|
@@ -944,12 +962,12 @@ const V = {
|
|
|
944
962
|
}, kt = {
|
|
945
963
|
type: "object",
|
|
946
964
|
properties: {
|
|
947
|
-
definition:
|
|
965
|
+
definition: xt,
|
|
948
966
|
layout: wt
|
|
949
967
|
},
|
|
950
968
|
required: ["definition", "layout"],
|
|
951
969
|
additionalProperties: !1
|
|
952
|
-
},
|
|
970
|
+
}, Kt = {
|
|
953
971
|
type: "object",
|
|
954
972
|
properties: {
|
|
955
973
|
tiles: {
|
|
@@ -984,22 +1002,22 @@ export {
|
|
|
984
1002
|
Ze as DEFAULT_TILE_REFRESH_INTERVAL_MS,
|
|
985
1003
|
Bt as DashboardRenderer,
|
|
986
1004
|
J as ENTITY_ID_TOKEN,
|
|
987
|
-
|
|
1005
|
+
ht as GridLayout,
|
|
988
1006
|
B as INJECT_QUERY_PROVIDER,
|
|
989
1007
|
Ye as TIMEFRAME_TOKEN,
|
|
990
|
-
|
|
1008
|
+
Et as aiQuerySchema,
|
|
991
1009
|
_t as barChartSchema,
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1010
|
+
Dt as basicQuerySchema,
|
|
1011
|
+
Kt as dashboardConfigSchema,
|
|
1012
|
+
Gt as dashboardTileTypes,
|
|
1013
|
+
Rt as exploreV4QuerySchema,
|
|
996
1014
|
qt as gaugeChartSchema,
|
|
997
|
-
|
|
1015
|
+
Ct as metricCardSchema,
|
|
998
1016
|
vt as slottableSchema,
|
|
999
1017
|
kt as tileConfigSchema,
|
|
1000
|
-
|
|
1018
|
+
xt as tileDefinitionSchema,
|
|
1001
1019
|
wt as tileLayoutSchema,
|
|
1002
1020
|
bt as timeseriesChartSchema,
|
|
1003
1021
|
St as topNTableSchema,
|
|
1004
|
-
|
|
1022
|
+
It as validDashboardQuery
|
|
1005
1023
|
};
|