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