@grafana/scenes 4.26.1--canary.770.9381277561.0 → 4.26.1--canary.770.9383024969.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/esm/components/SceneTimeRangeCompare.js +55 -1
- package/dist/esm/components/SceneTimeRangeCompare.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/querying/ExtraQueryProvider.js +6 -0
- package/dist/esm/querying/ExtraQueryProvider.js.map +1 -0
- package/dist/esm/querying/SceneQueryRunner.js +84 -88
- package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
- package/dist/esm/querying/extraQueryProcessingOperator.js +46 -0
- package/dist/esm/querying/extraQueryProcessingOperator.js.map +1 -0
- package/dist/esm/variables/components/VariableValueSelect.js +2 -1
- package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
- package/dist/index.d.ts +18 -8
- package/dist/index.js +884 -843
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/esm/querying/timeShiftQueryResponseOperator.js +0 -60
- package/dist/esm/querying/timeShiftQueryResponseOperator.js.map +0 -1
package/dist/index.js
CHANGED
@@ -11,8 +11,8 @@ var uuid = require('uuid');
|
|
11
11
|
var lodash = require('lodash');
|
12
12
|
var schema = require('@grafana/schema');
|
13
13
|
var ui = require('@grafana/ui');
|
14
|
-
var css = require('@emotion/css');
|
15
14
|
var e2eSelectors = require('@grafana/e2e-selectors');
|
15
|
+
var css = require('@emotion/css');
|
16
16
|
var uFuzzy = require('@leeoniya/ufuzzy');
|
17
17
|
var reactUse = require('react-use');
|
18
18
|
var operators = require('rxjs/operators');
|
@@ -77,8 +77,8 @@ function renderSceneComponentWithRouteProps(sceneObject, routeProps) {
|
|
77
77
|
}
|
78
78
|
|
79
79
|
var __defProp$J = Object.defineProperty;
|
80
|
-
var __defProps$
|
81
|
-
var __getOwnPropDescs$
|
80
|
+
var __defProps$t = Object.defineProperties;
|
81
|
+
var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
|
82
82
|
var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
|
83
83
|
var __hasOwnProp$J = Object.prototype.hasOwnProperty;
|
84
84
|
var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
|
@@ -94,13 +94,13 @@ var __spreadValues$J = (a, b) => {
|
|
94
94
|
}
|
95
95
|
return a;
|
96
96
|
};
|
97
|
-
var __spreadProps$
|
97
|
+
var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
|
98
98
|
const runtimePanelPlugins = /* @__PURE__ */ new Map();
|
99
99
|
function registerRuntimePanelPlugin({ pluginId, plugin }) {
|
100
100
|
if (runtimePanelPlugins.has(pluginId)) {
|
101
101
|
throw new Error(`A runtime panel plugin with id ${pluginId} has already been registered`);
|
102
102
|
}
|
103
|
-
plugin.meta = __spreadProps$
|
103
|
+
plugin.meta = __spreadProps$t(__spreadValues$J({}, plugin.meta), {
|
104
104
|
id: pluginId,
|
105
105
|
name: pluginId,
|
106
106
|
module: "runtime plugin",
|
@@ -129,8 +129,8 @@ function loadPanelPluginSync(pluginId) {
|
|
129
129
|
}
|
130
130
|
|
131
131
|
var __defProp$I = Object.defineProperty;
|
132
|
-
var __defProps$
|
133
|
-
var __getOwnPropDescs$
|
132
|
+
var __defProps$s = Object.defineProperties;
|
133
|
+
var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
|
134
134
|
var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
|
135
135
|
var __hasOwnProp$I = Object.prototype.hasOwnProperty;
|
136
136
|
var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
|
@@ -146,7 +146,7 @@ var __spreadValues$I = (a, b) => {
|
|
146
146
|
}
|
147
147
|
return a;
|
148
148
|
};
|
149
|
-
var __spreadProps$
|
149
|
+
var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
|
150
150
|
var __objRest$4 = (source, exclude) => {
|
151
151
|
var target = {};
|
152
152
|
for (var prop in source)
|
@@ -172,7 +172,7 @@ function SceneComponentWrapperWithoutMemo(_a) {
|
|
172
172
|
if (!model.isActive) {
|
173
173
|
return null;
|
174
174
|
}
|
175
|
-
return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$
|
175
|
+
return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$s(__spreadValues$I({}, otherProps), {
|
176
176
|
model
|
177
177
|
}));
|
178
178
|
}
|
@@ -1749,8 +1749,8 @@ function collectAllVariables(sceneObject, record = {}) {
|
|
1749
1749
|
}
|
1750
1750
|
|
1751
1751
|
var __defProp$D = Object.defineProperty;
|
1752
|
-
var __defProps$
|
1753
|
-
var __getOwnPropDescs$
|
1752
|
+
var __defProps$r = Object.defineProperties;
|
1753
|
+
var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
|
1754
1754
|
var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
|
1755
1755
|
var __hasOwnProp$D = Object.prototype.hasOwnProperty;
|
1756
1756
|
var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
|
@@ -1766,7 +1766,7 @@ var __spreadValues$D = (a, b) => {
|
|
1766
1766
|
}
|
1767
1767
|
return a;
|
1768
1768
|
};
|
1769
|
-
var __spreadProps$
|
1769
|
+
var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
|
1770
1770
|
function getTemplateProxyForField(field, frame, frames) {
|
1771
1771
|
return new Proxy(
|
1772
1772
|
{},
|
@@ -1782,7 +1782,7 @@ function getTemplateProxyForField(field, frame, frames) {
|
|
1782
1782
|
if (!field.labels) {
|
1783
1783
|
return "";
|
1784
1784
|
}
|
1785
|
-
return __spreadProps$
|
1785
|
+
return __spreadProps$r(__spreadValues$D({}, field.labels), {
|
1786
1786
|
__values: Object.values(field.labels).sort().join(", "),
|
1787
1787
|
toString: () => {
|
1788
1788
|
return data.formatLabels(field.labels, "", true);
|
@@ -2255,7 +2255,13 @@ class VariableValueRecorder {
|
|
2255
2255
|
}
|
2256
2256
|
}
|
2257
2257
|
|
2258
|
+
function isExtraQueryProvider(obj) {
|
2259
|
+
return typeof obj === "object" && "getExtraQueries" in obj;
|
2260
|
+
}
|
2261
|
+
|
2258
2262
|
var __defProp$C = Object.defineProperty;
|
2263
|
+
var __defProps$q = Object.defineProperties;
|
2264
|
+
var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
|
2259
2265
|
var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
|
2260
2266
|
var __hasOwnProp$C = Object.prototype.hasOwnProperty;
|
2261
2267
|
var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
|
@@ -2271,166 +2277,29 @@ var __spreadValues$C = (a, b) => {
|
|
2271
2277
|
}
|
2272
2278
|
return a;
|
2273
2279
|
};
|
2274
|
-
|
2275
|
-
const
|
2276
|
-
const
|
2277
|
-
|
2278
|
-
|
2279
|
-
|
2280
|
-
|
2281
|
-
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
-
|
2286
|
-
|
2287
|
-
|
2288
|
-
]
|
2289
|
-
|
2290
|
-
|
2291
|
-
|
2292
|
-
|
2293
|
-
this._onActivate = () => {
|
2294
|
-
const sceneTimeRange = sceneGraph.getTimeRange(this);
|
2295
|
-
this.setState({ compareOptions: this.getCompareOptions(sceneTimeRange.state.value) });
|
2296
|
-
this._subs.add(
|
2297
|
-
sceneTimeRange.subscribeToState((timeRange) => {
|
2298
|
-
const compareOptions = this.getCompareOptions(timeRange.value);
|
2299
|
-
const stateUpdate = { compareOptions };
|
2300
|
-
if (Boolean(this.state.compareWith) && !compareOptions.find(({ value }) => value === this.state.compareWith)) {
|
2301
|
-
stateUpdate.compareWith = PREVIOUS_PERIOD_VALUE;
|
2302
|
-
}
|
2303
|
-
this.setState(stateUpdate);
|
2304
|
-
})
|
2305
|
-
);
|
2306
|
-
};
|
2307
|
-
this.getCompareOptions = (timeRange) => {
|
2308
|
-
const diffDays = Math.ceil(timeRange.to.diff(timeRange.from));
|
2309
|
-
const matchIndex = DEFAULT_COMPARE_OPTIONS.findIndex(({ value }) => {
|
2310
|
-
const intervalInMs = data.rangeUtil.intervalToMs(value);
|
2311
|
-
return intervalInMs >= diffDays;
|
2280
|
+
var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
|
2281
|
+
const passthroughProcessor = (_, secondary) => rxjs.of(secondary);
|
2282
|
+
const extraQueryProcessingOperator = (processors) => (data) => {
|
2283
|
+
return data.pipe(
|
2284
|
+
rxjs.mergeMap(([primary, ...secondaries]) => {
|
2285
|
+
const processedSecondaries = secondaries.flatMap((s) => {
|
2286
|
+
var _a, _b;
|
2287
|
+
return (_b = (_a = processors.get(s.request.requestId)) == null ? void 0 : _a(primary, s)) != null ? _b : rxjs.of(s);
|
2288
|
+
});
|
2289
|
+
return rxjs.forkJoin([rxjs.of(primary), ...processedSecondaries]);
|
2290
|
+
}),
|
2291
|
+
rxjs.map(([primary, ...processedSecondaries]) => {
|
2292
|
+
var _a;
|
2293
|
+
return __spreadProps$q(__spreadValues$C({}, primary), {
|
2294
|
+
series: [...primary.series, ...processedSecondaries.flatMap((s) => s.series)],
|
2295
|
+
annotations: [...(_a = primary.annotations) != null ? _a : [], ...processedSecondaries.flatMap((s) => {
|
2296
|
+
var _a2;
|
2297
|
+
return (_a2 = s.annotations) != null ? _a2 : [];
|
2298
|
+
})]
|
2312
2299
|
});
|
2313
|
-
return [
|
2314
|
-
NO_COMPARE_OPTION,
|
2315
|
-
PREVIOUS_PERIOD_COMPARE_OPTION,
|
2316
|
-
...DEFAULT_COMPARE_OPTIONS.slice(matchIndex).map(({ label, value }) => ({ label, value }))
|
2317
|
-
];
|
2318
|
-
};
|
2319
|
-
this.onCompareWithChanged = (compareWith) => {
|
2320
|
-
if (compareWith === NO_PERIOD_VALUE) {
|
2321
|
-
this.onClearCompare();
|
2322
|
-
} else {
|
2323
|
-
this.setState({ compareWith });
|
2324
|
-
}
|
2325
|
-
};
|
2326
|
-
this.onClearCompare = () => {
|
2327
|
-
this.setState({ compareWith: void 0 });
|
2328
|
-
};
|
2329
|
-
this.addActivationHandler(this._onActivate);
|
2330
|
-
}
|
2331
|
-
getCompareTimeRange(timeRange) {
|
2332
|
-
let compareFrom;
|
2333
|
-
let compareTo;
|
2334
|
-
if (this.state.compareWith) {
|
2335
|
-
if (this.state.compareWith === PREVIOUS_PERIOD_VALUE) {
|
2336
|
-
const diffMs = timeRange.to.diff(timeRange.from);
|
2337
|
-
compareFrom = data.dateTime(timeRange.from).subtract(diffMs);
|
2338
|
-
compareTo = data.dateTime(timeRange.to).subtract(diffMs);
|
2339
|
-
} else {
|
2340
|
-
compareFrom = data.dateTime(timeRange.from).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
|
2341
|
-
compareTo = data.dateTime(timeRange.to).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
|
2342
|
-
}
|
2343
|
-
return {
|
2344
|
-
from: compareFrom,
|
2345
|
-
to: compareTo,
|
2346
|
-
raw: {
|
2347
|
-
from: compareFrom,
|
2348
|
-
to: compareTo
|
2349
|
-
}
|
2350
|
-
};
|
2351
|
-
}
|
2352
|
-
return void 0;
|
2353
|
-
}
|
2354
|
-
getUrlState() {
|
2355
|
-
return {
|
2356
|
-
compareWith: this.state.compareWith
|
2357
|
-
};
|
2358
|
-
}
|
2359
|
-
updateFromUrl(values) {
|
2360
|
-
if (!values.compareWith) {
|
2361
|
-
return;
|
2362
|
-
}
|
2363
|
-
const compareWith = parseUrlParam(values.compareWith);
|
2364
|
-
if (compareWith) {
|
2365
|
-
const compareOptions = this.getCompareOptions(sceneGraph.getTimeRange(this).state.value);
|
2366
|
-
if (compareOptions.find(({ value }) => value === compareWith)) {
|
2367
|
-
this.setState({
|
2368
|
-
compareWith
|
2369
|
-
});
|
2370
|
-
} else {
|
2371
|
-
this.setState({
|
2372
|
-
compareWith: "__previousPeriod"
|
2373
|
-
});
|
2374
|
-
}
|
2375
|
-
}
|
2376
|
-
}
|
2377
|
-
}
|
2378
|
-
SceneTimeRangeCompare.Component = SceneTimeRangeCompareRenderer;
|
2379
|
-
function SceneTimeRangeCompareRenderer({ model }) {
|
2380
|
-
var _a;
|
2381
|
-
const styles = ui.useStyles2(getStyles$9);
|
2382
|
-
const { compareWith, compareOptions } = model.useState();
|
2383
|
-
const [previousCompare, setPreviousCompare] = React__default["default"].useState(compareWith);
|
2384
|
-
const previousValue = (_a = compareOptions.find(({ value: value2 }) => value2 === previousCompare)) != null ? _a : PREVIOUS_PERIOD_COMPARE_OPTION;
|
2385
|
-
const value = compareOptions.find(({ value: value2 }) => value2 === compareWith);
|
2386
|
-
const enabled = Boolean(value);
|
2387
|
-
const onClick = () => {
|
2388
|
-
if (enabled) {
|
2389
|
-
setPreviousCompare(compareWith);
|
2390
|
-
model.onClearCompare();
|
2391
|
-
} else if (!enabled) {
|
2392
|
-
model.onCompareWithChanged(previousValue.value);
|
2393
|
-
}
|
2394
|
-
};
|
2395
|
-
return /* @__PURE__ */ React__default["default"].createElement(ui.ButtonGroup, null, /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
|
2396
|
-
variant: "canvas",
|
2397
|
-
tooltip: "Enable time frame comparison",
|
2398
|
-
onClick: (e) => {
|
2399
|
-
e.stopPropagation();
|
2400
|
-
e.preventDefault();
|
2401
|
-
onClick();
|
2402
|
-
}
|
2403
|
-
}, /* @__PURE__ */ React__default["default"].createElement(ui.Checkbox, {
|
2404
|
-
label: " ",
|
2405
|
-
value: enabled,
|
2406
|
-
onClick
|
2407
|
-
}), "Comparison"), enabled ? /* @__PURE__ */ React__default["default"].createElement(ui.ButtonSelect, {
|
2408
|
-
variant: "canvas",
|
2409
|
-
value,
|
2410
|
-
options: compareOptions,
|
2411
|
-
onChange: (v) => {
|
2412
|
-
model.onCompareWithChanged(v.value);
|
2413
|
-
}
|
2414
|
-
}) : /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
|
2415
|
-
className: styles.previewButton,
|
2416
|
-
disabled: true,
|
2417
|
-
variant: "canvas",
|
2418
|
-
isOpen: false
|
2419
|
-
}, previousValue.label));
|
2420
|
-
}
|
2421
|
-
function getStyles$9(theme) {
|
2422
|
-
return {
|
2423
|
-
previewButton: css.css({
|
2424
|
-
"&:disabled": {
|
2425
|
-
border: `1px solid ${theme.colors.secondary.border}`,
|
2426
|
-
color: theme.colors.text.disabled,
|
2427
|
-
opacity: 1
|
2428
|
-
}
|
2429
2300
|
})
|
2430
|
-
|
2431
|
-
}
|
2432
|
-
|
2433
|
-
const getCompareSeriesRefId = (refId) => `${refId}-compare`;
|
2301
|
+
);
|
2302
|
+
};
|
2434
2303
|
|
2435
2304
|
var __defProp$B = Object.defineProperty;
|
2436
2305
|
var __defProps$p = Object.defineProperties;
|
@@ -2451,59 +2320,6 @@ var __spreadValues$B = (a, b) => {
|
|
2451
2320
|
return a;
|
2452
2321
|
};
|
2453
2322
|
var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
|
2454
|
-
function timeShiftQueryResponseOperator(data$1) {
|
2455
|
-
return data$1.pipe(
|
2456
|
-
rxjs.map(([p, s]) => {
|
2457
|
-
const diff = s.timeRange.from.diff(p.timeRange.from);
|
2458
|
-
s.series.forEach((series) => {
|
2459
|
-
series.refId = getCompareSeriesRefId(series.refId || "");
|
2460
|
-
series.meta = __spreadProps$p(__spreadValues$B({}, series.meta), {
|
2461
|
-
timeCompare: {
|
2462
|
-
diffMs: diff,
|
2463
|
-
isTimeShiftQuery: true
|
2464
|
-
}
|
2465
|
-
});
|
2466
|
-
series.fields.forEach((field) => {
|
2467
|
-
if (field.type === data.FieldType.time) {
|
2468
|
-
field.values = field.values.map((v) => {
|
2469
|
-
return diff < 0 ? v - diff : v + diff;
|
2470
|
-
});
|
2471
|
-
}
|
2472
|
-
field.config = __spreadProps$p(__spreadValues$B({}, field.config), {
|
2473
|
-
color: {
|
2474
|
-
mode: "fixed",
|
2475
|
-
fixedColor: runtime.config.theme.palette.gray60
|
2476
|
-
}
|
2477
|
-
});
|
2478
|
-
return field;
|
2479
|
-
});
|
2480
|
-
});
|
2481
|
-
return __spreadProps$p(__spreadValues$B({}, p), {
|
2482
|
-
series: [...p.series, ...s.series]
|
2483
|
-
});
|
2484
|
-
})
|
2485
|
-
);
|
2486
|
-
}
|
2487
|
-
|
2488
|
-
var __defProp$A = Object.defineProperty;
|
2489
|
-
var __defProps$o = Object.defineProperties;
|
2490
|
-
var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
|
2491
|
-
var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
|
2492
|
-
var __hasOwnProp$A = Object.prototype.hasOwnProperty;
|
2493
|
-
var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
|
2494
|
-
var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
2495
|
-
var __spreadValues$A = (a, b) => {
|
2496
|
-
for (var prop in b || (b = {}))
|
2497
|
-
if (__hasOwnProp$A.call(b, prop))
|
2498
|
-
__defNormalProp$A(a, prop, b[prop]);
|
2499
|
-
if (__getOwnPropSymbols$A)
|
2500
|
-
for (var prop of __getOwnPropSymbols$A(b)) {
|
2501
|
-
if (__propIsEnum$A.call(b, prop))
|
2502
|
-
__defNormalProp$A(a, prop, b[prop]);
|
2503
|
-
}
|
2504
|
-
return a;
|
2505
|
-
};
|
2506
|
-
var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
|
2507
2323
|
function filterAnnotations(data, filters) {
|
2508
2324
|
var _a;
|
2509
2325
|
if (!Array.isArray(data) || data.length === 0) {
|
@@ -2554,11 +2370,11 @@ function filterAnnotations(data, filters) {
|
|
2554
2370
|
continue;
|
2555
2371
|
}
|
2556
2372
|
}
|
2557
|
-
fields.push(__spreadProps$
|
2373
|
+
fields.push(__spreadProps$p(__spreadValues$B({}, field), {
|
2558
2374
|
values: buffer
|
2559
2375
|
}));
|
2560
2376
|
}
|
2561
|
-
processed.push(__spreadProps$
|
2377
|
+
processed.push(__spreadProps$p(__spreadValues$B({}, frame), {
|
2562
2378
|
fields,
|
2563
2379
|
length: frameLength
|
2564
2380
|
}));
|
@@ -2990,33 +2806,33 @@ function getOptionSearcher(options, includeAll, value, text) {
|
|
2990
2806
|
};
|
2991
2807
|
}
|
2992
2808
|
|
2993
|
-
var __defProp$
|
2994
|
-
var __defProps$
|
2995
|
-
var __getOwnPropDescs$
|
2996
|
-
var __getOwnPropSymbols$
|
2997
|
-
var __hasOwnProp$
|
2998
|
-
var __propIsEnum$
|
2999
|
-
var __defNormalProp$
|
3000
|
-
var __spreadValues$
|
2809
|
+
var __defProp$A = Object.defineProperty;
|
2810
|
+
var __defProps$o = Object.defineProperties;
|
2811
|
+
var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
|
2812
|
+
var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
|
2813
|
+
var __hasOwnProp$A = Object.prototype.hasOwnProperty;
|
2814
|
+
var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
|
2815
|
+
var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
2816
|
+
var __spreadValues$A = (a, b) => {
|
3001
2817
|
for (var prop in b || (b = {}))
|
3002
|
-
if (__hasOwnProp$
|
3003
|
-
__defNormalProp$
|
3004
|
-
if (__getOwnPropSymbols$
|
3005
|
-
for (var prop of __getOwnPropSymbols$
|
3006
|
-
if (__propIsEnum$
|
3007
|
-
__defNormalProp$
|
2818
|
+
if (__hasOwnProp$A.call(b, prop))
|
2819
|
+
__defNormalProp$A(a, prop, b[prop]);
|
2820
|
+
if (__getOwnPropSymbols$A)
|
2821
|
+
for (var prop of __getOwnPropSymbols$A(b)) {
|
2822
|
+
if (__propIsEnum$A.call(b, prop))
|
2823
|
+
__defNormalProp$A(a, prop, b[prop]);
|
3008
2824
|
}
|
3009
2825
|
return a;
|
3010
2826
|
};
|
3011
|
-
var __spreadProps$
|
2827
|
+
var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
|
3012
2828
|
var __objRest$3 = (source, exclude) => {
|
3013
2829
|
var target = {};
|
3014
2830
|
for (var prop in source)
|
3015
|
-
if (__hasOwnProp$
|
2831
|
+
if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
|
3016
2832
|
target[prop] = source[prop];
|
3017
|
-
if (source != null && __getOwnPropSymbols$
|
3018
|
-
for (var prop of __getOwnPropSymbols$
|
3019
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
2833
|
+
if (source != null && __getOwnPropSymbols$A)
|
2834
|
+
for (var prop of __getOwnPropSymbols$A(source)) {
|
2835
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
|
3020
2836
|
target[prop] = source[prop];
|
3021
2837
|
}
|
3022
2838
|
return target;
|
@@ -3139,11 +2955,12 @@ const OptionWithCheckbox = ({
|
|
3139
2955
|
isSelected,
|
3140
2956
|
renderOptionLabel
|
3141
2957
|
}) => {
|
2958
|
+
var _b;
|
3142
2959
|
const _a = innerProps, rest = __objRest$3(_a, ["onMouseMove", "onMouseOver"]);
|
3143
2960
|
const theme = ui.useTheme2();
|
3144
2961
|
const selectStyles = ui.getSelectStyles(theme);
|
3145
2962
|
const optionStyles = ui.useStyles2(getOptionStyles);
|
3146
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$
|
2963
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$o(__spreadValues$A({
|
3147
2964
|
ref: innerRef,
|
3148
2965
|
className: css.cx(selectStyles.option, isFocused && selectStyles.optionFocused)
|
3149
2966
|
}, rest), {
|
@@ -3156,7 +2973,7 @@ const OptionWithCheckbox = ({
|
|
3156
2973
|
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
3157
2974
|
className: selectStyles.optionBody,
|
3158
2975
|
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(
|
3159
|
-
data.label
|
2976
|
+
(_b = data.label) != null ? _b : String(data.value)
|
3160
2977
|
)
|
3161
2978
|
}, /* @__PURE__ */ React__default["default"].createElement("span", null, children)));
|
3162
2979
|
};
|
@@ -3237,28 +3054,28 @@ function fromUrlValues(urlValues) {
|
|
3237
3054
|
);
|
3238
3055
|
}
|
3239
3056
|
|
3240
|
-
var __defProp$
|
3241
|
-
var __defProps$
|
3242
|
-
var __getOwnPropDescs$
|
3243
|
-
var __getOwnPropSymbols$
|
3244
|
-
var __hasOwnProp$
|
3245
|
-
var __propIsEnum$
|
3246
|
-
var __defNormalProp$
|
3247
|
-
var __spreadValues$
|
3248
|
-
for (var prop in b || (b = {}))
|
3249
|
-
if (__hasOwnProp$
|
3250
|
-
__defNormalProp$
|
3251
|
-
if (__getOwnPropSymbols$
|
3252
|
-
for (var prop of __getOwnPropSymbols$
|
3253
|
-
if (__propIsEnum$
|
3254
|
-
__defNormalProp$
|
3057
|
+
var __defProp$z = Object.defineProperty;
|
3058
|
+
var __defProps$n = Object.defineProperties;
|
3059
|
+
var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
|
3060
|
+
var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
|
3061
|
+
var __hasOwnProp$z = Object.prototype.hasOwnProperty;
|
3062
|
+
var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
|
3063
|
+
var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
3064
|
+
var __spreadValues$z = (a, b) => {
|
3065
|
+
for (var prop in b || (b = {}))
|
3066
|
+
if (__hasOwnProp$z.call(b, prop))
|
3067
|
+
__defNormalProp$z(a, prop, b[prop]);
|
3068
|
+
if (__getOwnPropSymbols$z)
|
3069
|
+
for (var prop of __getOwnPropSymbols$z(b)) {
|
3070
|
+
if (__propIsEnum$z.call(b, prop))
|
3071
|
+
__defNormalProp$z(a, prop, b[prop]);
|
3255
3072
|
}
|
3256
3073
|
return a;
|
3257
3074
|
};
|
3258
|
-
var __spreadProps$
|
3075
|
+
var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
|
3259
3076
|
class GroupByVariable extends MultiValueVariable {
|
3260
3077
|
constructor(initialState) {
|
3261
|
-
super(__spreadProps$
|
3078
|
+
super(__spreadProps$n(__spreadValues$z({
|
3262
3079
|
isMulti: true,
|
3263
3080
|
name: "",
|
3264
3081
|
value: [],
|
@@ -3457,7 +3274,7 @@ function LoadingIndicator(props) {
|
|
3457
3274
|
}
|
3458
3275
|
|
3459
3276
|
function ControlsLabel(props) {
|
3460
|
-
const styles = ui.useStyles2(getStyles$
|
3277
|
+
const styles = ui.useStyles2(getStyles$9);
|
3461
3278
|
const theme = ui.useTheme2();
|
3462
3279
|
const isVertical = props.layout === "vertical";
|
3463
3280
|
const loadingIndicator = Boolean(props.isLoading) ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
@@ -3520,7 +3337,7 @@ function ControlsLabel(props) {
|
|
3520
3337
|
}
|
3521
3338
|
return labelElement;
|
3522
3339
|
}
|
3523
|
-
const getStyles$
|
3340
|
+
const getStyles$9 = (theme) => ({
|
3524
3341
|
horizontalLabel: css.css({
|
3525
3342
|
background: theme.isDark ? theme.colors.background.primary : theme.colors.background.secondary,
|
3526
3343
|
display: `flex`,
|
@@ -3563,7 +3380,7 @@ function keyLabelToOption(key, label) {
|
|
3563
3380
|
}
|
3564
3381
|
function AdHocFilterRenderer({ filter, model }) {
|
3565
3382
|
var _a, _b;
|
3566
|
-
const styles = ui.useStyles2(getStyles$
|
3383
|
+
const styles = ui.useStyles2(getStyles$8);
|
3567
3384
|
const [keys, setKeys] = React.useState([]);
|
3568
3385
|
const [values, setValues] = React.useState([]);
|
3569
3386
|
const [isKeysLoading, setIsKeysLoading] = React.useState(false);
|
@@ -3668,7 +3485,7 @@ function AdHocFilterRenderer({ filter, model }) {
|
|
3668
3485
|
onClick: () => model._removeFilter(filter)
|
3669
3486
|
}));
|
3670
3487
|
}
|
3671
|
-
const getStyles$
|
3488
|
+
const getStyles$8 = (theme) => ({
|
3672
3489
|
field: css.css({
|
3673
3490
|
marginBottom: 0
|
3674
3491
|
}),
|
@@ -3806,29 +3623,29 @@ function isFilter(filter) {
|
|
3806
3623
|
return filter !== null && typeof filter.key === "string" && typeof filter.value === "string";
|
3807
3624
|
}
|
3808
3625
|
|
3809
|
-
var __defProp$
|
3810
|
-
var __defProps$
|
3811
|
-
var __getOwnPropDescs$
|
3812
|
-
var __getOwnPropSymbols$
|
3813
|
-
var __hasOwnProp$
|
3814
|
-
var __propIsEnum$
|
3815
|
-
var __defNormalProp$
|
3816
|
-
var __spreadValues$
|
3626
|
+
var __defProp$y = Object.defineProperty;
|
3627
|
+
var __defProps$m = Object.defineProperties;
|
3628
|
+
var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
|
3629
|
+
var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
|
3630
|
+
var __hasOwnProp$y = Object.prototype.hasOwnProperty;
|
3631
|
+
var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
|
3632
|
+
var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
3633
|
+
var __spreadValues$y = (a, b) => {
|
3817
3634
|
for (var prop in b || (b = {}))
|
3818
|
-
if (__hasOwnProp$
|
3819
|
-
__defNormalProp$
|
3820
|
-
if (__getOwnPropSymbols$
|
3821
|
-
for (var prop of __getOwnPropSymbols$
|
3822
|
-
if (__propIsEnum$
|
3823
|
-
__defNormalProp$
|
3635
|
+
if (__hasOwnProp$y.call(b, prop))
|
3636
|
+
__defNormalProp$y(a, prop, b[prop]);
|
3637
|
+
if (__getOwnPropSymbols$y)
|
3638
|
+
for (var prop of __getOwnPropSymbols$y(b)) {
|
3639
|
+
if (__propIsEnum$y.call(b, prop))
|
3640
|
+
__defNormalProp$y(a, prop, b[prop]);
|
3824
3641
|
}
|
3825
3642
|
return a;
|
3826
3643
|
};
|
3827
|
-
var __spreadProps$
|
3644
|
+
var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
|
3828
3645
|
class AdHocFiltersVariable extends SceneObjectBase {
|
3829
3646
|
constructor(state) {
|
3830
3647
|
var _a, _b;
|
3831
|
-
super(__spreadValues$
|
3648
|
+
super(__spreadValues$y({
|
3832
3649
|
type: "adhoc",
|
3833
3650
|
name: (_a = state.name) != null ? _a : "Filters",
|
3834
3651
|
filters: [],
|
@@ -3865,15 +3682,15 @@ class AdHocFiltersVariable extends SceneObjectBase {
|
|
3865
3682
|
const propLabelKey = `${prop}Label`;
|
3866
3683
|
if (filter === _wip) {
|
3867
3684
|
if (prop === "value") {
|
3868
|
-
this.setState({ filters: [...filters, __spreadProps$
|
3685
|
+
this.setState({ filters: [...filters, __spreadProps$m(__spreadValues$y({}, _wip), { [prop]: value, [propLabelKey]: label })], _wip: void 0 });
|
3869
3686
|
} else {
|
3870
|
-
this.setState({ _wip: __spreadProps$
|
3687
|
+
this.setState({ _wip: __spreadProps$m(__spreadValues$y({}, filter), { [prop]: value, [propLabelKey]: label }) });
|
3871
3688
|
}
|
3872
3689
|
return;
|
3873
3690
|
}
|
3874
3691
|
const updatedFilters = this.state.filters.map((f) => {
|
3875
3692
|
if (f === filter) {
|
3876
|
-
const updatedFilter = __spreadProps$
|
3693
|
+
const updatedFilter = __spreadProps$m(__spreadValues$y({}, f), { [prop]: value, [propLabelKey]: label });
|
3877
3694
|
if (prop === "key" && filter[prop] !== value) {
|
3878
3695
|
updatedFilter.value = "";
|
3879
3696
|
updatedFilter.valueLabel = "";
|
@@ -3954,7 +3771,7 @@ function renderExpression(builder, filters) {
|
|
3954
3771
|
}
|
3955
3772
|
function AdHocFiltersVariableRenderer({ model }) {
|
3956
3773
|
const { filters, readOnly, addFilterButtonText } = model.useState();
|
3957
|
-
const styles = ui.useStyles2(getStyles$
|
3774
|
+
const styles = ui.useStyles2(getStyles$7);
|
3958
3775
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
3959
3776
|
className: styles.wrapper
|
3960
3777
|
}, filters.map((filter, index) => /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, {
|
@@ -3968,7 +3785,7 @@ function AdHocFiltersVariableRenderer({ model }) {
|
|
3968
3785
|
addFilterButtonText
|
3969
3786
|
}));
|
3970
3787
|
}
|
3971
|
-
const getStyles$
|
3788
|
+
const getStyles$7 = (theme) => ({
|
3972
3789
|
wrapper: css.css({
|
3973
3790
|
display: "flex",
|
3974
3791
|
flexWrap: "wrap",
|
@@ -4052,25 +3869,25 @@ function areDifferentLayers(a, b) {
|
|
4052
3869
|
return false;
|
4053
3870
|
}
|
4054
3871
|
|
4055
|
-
var __defProp$
|
4056
|
-
var __defProps$
|
4057
|
-
var __getOwnPropDescs$
|
4058
|
-
var __getOwnPropSymbols$
|
4059
|
-
var __hasOwnProp$
|
4060
|
-
var __propIsEnum$
|
4061
|
-
var __defNormalProp$
|
4062
|
-
var __spreadValues$
|
3872
|
+
var __defProp$x = Object.defineProperty;
|
3873
|
+
var __defProps$l = Object.defineProperties;
|
3874
|
+
var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
|
3875
|
+
var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
|
3876
|
+
var __hasOwnProp$x = Object.prototype.hasOwnProperty;
|
3877
|
+
var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
|
3878
|
+
var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
3879
|
+
var __spreadValues$x = (a, b) => {
|
4063
3880
|
for (var prop in b || (b = {}))
|
4064
|
-
if (__hasOwnProp$
|
4065
|
-
__defNormalProp$
|
4066
|
-
if (__getOwnPropSymbols$
|
4067
|
-
for (var prop of __getOwnPropSymbols$
|
4068
|
-
if (__propIsEnum$
|
4069
|
-
__defNormalProp$
|
3881
|
+
if (__hasOwnProp$x.call(b, prop))
|
3882
|
+
__defNormalProp$x(a, prop, b[prop]);
|
3883
|
+
if (__getOwnPropSymbols$x)
|
3884
|
+
for (var prop of __getOwnPropSymbols$x(b)) {
|
3885
|
+
if (__propIsEnum$x.call(b, prop))
|
3886
|
+
__defNormalProp$x(a, prop, b[prop]);
|
4070
3887
|
}
|
4071
3888
|
return a;
|
4072
3889
|
};
|
4073
|
-
var __spreadProps$
|
3890
|
+
var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
|
4074
3891
|
let counter$1 = 100;
|
4075
3892
|
function getNextRequestId$1() {
|
4076
3893
|
return "SQR" + counter$1++;
|
@@ -4087,70 +3904,6 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4087
3904
|
onVariableUpdateCompleted: this.onVariableUpdatesCompleted.bind(this),
|
4088
3905
|
onAnyVariableChanged: this.onAnyVariableChanged.bind(this)
|
4089
3906
|
});
|
4090
|
-
this.prepareRequests = (timeRange, ds) => {
|
4091
|
-
const comparer = this.getTimeCompare();
|
4092
|
-
const { minInterval, queries } = this.state;
|
4093
|
-
let secondaryRequest;
|
4094
|
-
let request = __spreadValues$w({
|
4095
|
-
app: "scenes",
|
4096
|
-
requestId: getNextRequestId$1(),
|
4097
|
-
timezone: timeRange.getTimeZone(),
|
4098
|
-
panelId: 1,
|
4099
|
-
range: timeRange.state.value,
|
4100
|
-
interval: "1s",
|
4101
|
-
intervalMs: 1e3,
|
4102
|
-
targets: lodash.cloneDeep(queries),
|
4103
|
-
maxDataPoints: this.getMaxDataPoints(),
|
4104
|
-
scopedVars: this._scopedVars,
|
4105
|
-
startTime: Date.now(),
|
4106
|
-
liveStreaming: this.state.liveStreaming,
|
4107
|
-
rangeRaw: {
|
4108
|
-
from: timeRange.state.from,
|
4109
|
-
to: timeRange.state.to
|
4110
|
-
},
|
4111
|
-
cacheTimeout: this.state.cacheTimeout,
|
4112
|
-
queryCachingTTL: this.state.queryCachingTTL
|
4113
|
-
}, getEnrichedDataRequest(this));
|
4114
|
-
if (this._adhocFiltersVar) {
|
4115
|
-
request.filters = this._adhocFiltersVar.state.filters.filter(isFilterComplete);
|
4116
|
-
}
|
4117
|
-
if (this._groupByVar) {
|
4118
|
-
request.groupByKeys = this._groupByVar.state.value;
|
4119
|
-
}
|
4120
|
-
request.targets = request.targets.map((query) => {
|
4121
|
-
var _a;
|
4122
|
-
if (!query.datasource || query.datasource.uid !== ds.uid && !((_a = ds.meta) == null ? void 0 : _a.mixed) && runtime.isExpressionReference && !runtime.isExpressionReference(query.datasource)) {
|
4123
|
-
query.datasource = ds.getRef();
|
4124
|
-
}
|
4125
|
-
return query;
|
4126
|
-
});
|
4127
|
-
const lowerIntervalLimit = minInterval ? minInterval : ds.interval;
|
4128
|
-
const norm = data.rangeUtil.calculateInterval(timeRange.state.value, request.maxDataPoints, lowerIntervalLimit);
|
4129
|
-
request.scopedVars = Object.assign({}, request.scopedVars, {
|
4130
|
-
__interval: { text: norm.interval, value: norm.interval },
|
4131
|
-
__interval_ms: { text: norm.intervalMs.toString(), value: norm.intervalMs }
|
4132
|
-
});
|
4133
|
-
request.interval = norm.interval;
|
4134
|
-
request.intervalMs = norm.intervalMs;
|
4135
|
-
const primaryTimeRange = timeRange.state.value;
|
4136
|
-
if (comparer) {
|
4137
|
-
const secondaryTimeRange = comparer.getCompareTimeRange(primaryTimeRange);
|
4138
|
-
if (secondaryTimeRange) {
|
4139
|
-
const secondaryTargets = request.targets.filter((query) => query.timeRangeCompare !== false);
|
4140
|
-
if (secondaryTargets.length) {
|
4141
|
-
secondaryRequest = __spreadProps$k(__spreadValues$w({}, request), {
|
4142
|
-
targets: secondaryTargets,
|
4143
|
-
range: secondaryTimeRange,
|
4144
|
-
requestId: getNextRequestId$1()
|
4145
|
-
});
|
4146
|
-
}
|
4147
|
-
request = __spreadProps$k(__spreadValues$w({}, request), {
|
4148
|
-
range: primaryTimeRange
|
4149
|
-
});
|
4150
|
-
}
|
4151
|
-
}
|
4152
|
-
return [request, secondaryRequest];
|
4153
|
-
};
|
4154
3907
|
this.onDataReceived = (data$1) => {
|
4155
3908
|
const preProcessedData = data.preProcessPanelData(data$1, this.state.data);
|
4156
3909
|
this._resultAnnotations = data$1.annotations;
|
@@ -4169,11 +3922,11 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4169
3922
|
}
|
4170
3923
|
_onActivate() {
|
4171
3924
|
const timeRange = sceneGraph.getTimeRange(this);
|
4172
|
-
const
|
4173
|
-
|
3925
|
+
const providers = this.getClosestExtraQueryProviders();
|
3926
|
+
for (const provider of providers) {
|
4174
3927
|
this._subs.add(
|
4175
|
-
|
4176
|
-
if (
|
3928
|
+
provider.subscribeToState((n, p) => {
|
3929
|
+
if (provider.shouldRerun(p, n)) {
|
4177
3930
|
this.runQueries();
|
4178
3931
|
}
|
4179
3932
|
})
|
@@ -4232,9 +3985,9 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4232
3985
|
return;
|
4233
3986
|
}
|
4234
3987
|
this._layerAnnotations = annotations;
|
4235
|
-
const baseStateUpdate = this.state.data ? this.state.data : __spreadProps$
|
3988
|
+
const baseStateUpdate = this.state.data ? this.state.data : __spreadProps$l(__spreadValues$x({}, emptyPanelData), { timeRange: timeRange.state.value });
|
4236
3989
|
this.setState({
|
4237
|
-
data: __spreadProps$
|
3990
|
+
data: __spreadProps$l(__spreadValues$x({}, baseStateUpdate), {
|
4238
3991
|
annotations: [...(_d = this._resultAnnotations) != null ? _d : [], ...annotations],
|
4239
3992
|
alertState: alertState != null ? alertState : (_e = this.state.data) == null ? void 0 : _e.alertState
|
4240
3993
|
})
|
@@ -4353,7 +4106,7 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4353
4106
|
this._dataLayersSub = void 0;
|
4354
4107
|
}
|
4355
4108
|
this.setState({
|
4356
|
-
data: __spreadProps$
|
4109
|
+
data: __spreadProps$l(__spreadValues$x({}, this.state.data), { state: schema.LoadingState.Done })
|
4357
4110
|
});
|
4358
4111
|
}
|
4359
4112
|
async runWithTimeRange(timeRange) {
|
@@ -4379,16 +4132,18 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4379
4132
|
const ds = await getDataSource(datasource, this._scopedVars);
|
4380
4133
|
this.findAndSubscribeToAdHocFilters(datasource == null ? void 0 : datasource.uid);
|
4381
4134
|
const runRequest = runtime.getRunRequest();
|
4382
|
-
const
|
4135
|
+
const { primary, secondaries, processors } = this.prepareRequests(timeRange, ds);
|
4383
4136
|
writeSceneLog("SceneQueryRunner", "Starting runRequest", this.state.key);
|
4384
|
-
let stream = runRequest(ds,
|
4385
|
-
if (
|
4386
|
-
|
4137
|
+
let stream = runRequest(ds, primary);
|
4138
|
+
if (secondaries.length > 0) {
|
4139
|
+
const secondaryStreams = secondaries.map((r) => runRequest(ds, r));
|
4140
|
+
const op = extraQueryProcessingOperator(processors);
|
4141
|
+
stream = rxjs.forkJoin([stream, ...secondaryStreams]).pipe(op);
|
4387
4142
|
}
|
4388
4143
|
stream = stream.pipe(
|
4389
4144
|
registerQueryWithController({
|
4390
4145
|
type: "data",
|
4391
|
-
request,
|
4146
|
+
request: primary,
|
4392
4147
|
origin: this,
|
4393
4148
|
cancel: () => this.cancelQuery()
|
4394
4149
|
})
|
@@ -4396,7 +4151,7 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4396
4151
|
this._querySub = stream.subscribe(this.onDataReceived);
|
4397
4152
|
} catch (err) {
|
4398
4153
|
console.error("PanelQueryRunner Error", err);
|
4399
|
-
this.onDataReceived(__spreadProps$
|
4154
|
+
this.onDataReceived(__spreadProps$l(__spreadValues$x(__spreadValues$x({}, emptyPanelData), this.state.data), {
|
4400
4155
|
state: schema.LoadingState.Error,
|
4401
4156
|
errors: [runtime.toDataQueryError(err)]
|
4402
4157
|
}));
|
@@ -4406,16 +4161,73 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4406
4161
|
var _a;
|
4407
4162
|
const clone = super.clone(withState);
|
4408
4163
|
if (this._resultAnnotations) {
|
4409
|
-
clone["_resultAnnotations"] = this._resultAnnotations.map((frame) => __spreadValues$
|
4164
|
+
clone["_resultAnnotations"] = this._resultAnnotations.map((frame) => __spreadValues$x({}, frame));
|
4410
4165
|
}
|
4411
4166
|
if (this._layerAnnotations) {
|
4412
|
-
clone["_layerAnnotations"] = this._layerAnnotations.map((frame) => __spreadValues$
|
4167
|
+
clone["_layerAnnotations"] = this._layerAnnotations.map((frame) => __spreadValues$x({}, frame));
|
4413
4168
|
}
|
4414
4169
|
clone["_variableValueRecorder"] = this._variableValueRecorder.cloneAndRecordCurrentValuesForSceneObject(this);
|
4415
4170
|
clone["_containerWidth"] = this._containerWidth;
|
4416
4171
|
clone["_results"].next({ origin: this, data: (_a = this.state.data) != null ? _a : emptyPanelData });
|
4417
4172
|
return clone;
|
4418
4173
|
}
|
4174
|
+
prepareRequests(timeRange, ds) {
|
4175
|
+
var _a;
|
4176
|
+
const { minInterval, queries } = this.state;
|
4177
|
+
let request = __spreadValues$x({
|
4178
|
+
app: "scenes",
|
4179
|
+
requestId: getNextRequestId$1(),
|
4180
|
+
timezone: timeRange.getTimeZone(),
|
4181
|
+
panelId: 1,
|
4182
|
+
range: timeRange.state.value,
|
4183
|
+
interval: "1s",
|
4184
|
+
intervalMs: 1e3,
|
4185
|
+
targets: lodash.cloneDeep(queries),
|
4186
|
+
maxDataPoints: this.getMaxDataPoints(),
|
4187
|
+
scopedVars: this._scopedVars,
|
4188
|
+
startTime: Date.now(),
|
4189
|
+
liveStreaming: this.state.liveStreaming,
|
4190
|
+
rangeRaw: {
|
4191
|
+
from: timeRange.state.from,
|
4192
|
+
to: timeRange.state.to
|
4193
|
+
},
|
4194
|
+
cacheTimeout: this.state.cacheTimeout,
|
4195
|
+
queryCachingTTL: this.state.queryCachingTTL
|
4196
|
+
}, getEnrichedDataRequest(this));
|
4197
|
+
if (this._adhocFiltersVar) {
|
4198
|
+
request.filters = this._adhocFiltersVar.state.filters.filter(isFilterComplete);
|
4199
|
+
}
|
4200
|
+
if (this._groupByVar) {
|
4201
|
+
request.groupByKeys = this._groupByVar.state.value;
|
4202
|
+
}
|
4203
|
+
request.targets = request.targets.map((query) => {
|
4204
|
+
var _a2;
|
4205
|
+
if (!query.datasource || query.datasource.uid !== ds.uid && !((_a2 = ds.meta) == null ? void 0 : _a2.mixed) && runtime.isExpressionReference && !runtime.isExpressionReference(query.datasource)) {
|
4206
|
+
query.datasource = ds.getRef();
|
4207
|
+
}
|
4208
|
+
return query;
|
4209
|
+
});
|
4210
|
+
const lowerIntervalLimit = minInterval ? minInterval : ds.interval;
|
4211
|
+
const norm = data.rangeUtil.calculateInterval(timeRange.state.value, request.maxDataPoints, lowerIntervalLimit);
|
4212
|
+
request.scopedVars = Object.assign({}, request.scopedVars, {
|
4213
|
+
__interval: { text: norm.interval, value: norm.interval },
|
4214
|
+
__interval_ms: { text: norm.intervalMs.toString(), value: norm.intervalMs }
|
4215
|
+
});
|
4216
|
+
request.interval = norm.interval;
|
4217
|
+
request.intervalMs = norm.intervalMs;
|
4218
|
+
const primaryTimeRange = timeRange.state.value;
|
4219
|
+
let secondaryRequests = [];
|
4220
|
+
let secondaryProcessors = /* @__PURE__ */ new Map();
|
4221
|
+
for (const provider of (_a = this.getClosestExtraQueryProviders()) != null ? _a : []) {
|
4222
|
+
for (const { req, processor } of provider.getExtraQueries(request)) {
|
4223
|
+
const requestId = getNextRequestId$1();
|
4224
|
+
secondaryRequests.push(__spreadProps$l(__spreadValues$x({}, req), { requestId }));
|
4225
|
+
secondaryProcessors.set(requestId, processor != null ? processor : passthroughProcessor);
|
4226
|
+
}
|
4227
|
+
}
|
4228
|
+
request.range = primaryTimeRange;
|
4229
|
+
return { primary: request, secondaries: secondaryRequests, processors: secondaryProcessors };
|
4230
|
+
}
|
4419
4231
|
_combineDataLayers(data) {
|
4420
4232
|
if (this._layerAnnotations && this._layerAnnotations.length > 0) {
|
4421
4233
|
data.annotations = (data.annotations || []).concat(this._layerAnnotations);
|
@@ -4430,22 +4242,23 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4430
4242
|
this.setState({ data: emptyPanelData });
|
4431
4243
|
}
|
4432
4244
|
}
|
4433
|
-
|
4245
|
+
getClosestExtraQueryProviders() {
|
4246
|
+
const found = /* @__PURE__ */ new Map();
|
4434
4247
|
if (!this.parent) {
|
4435
|
-
return
|
4248
|
+
return [];
|
4436
4249
|
}
|
4437
|
-
|
4438
|
-
|
4439
|
-
|
4440
|
-
return s;
|
4250
|
+
getClosest(this.parent, (s) => {
|
4251
|
+
if (isExtraQueryProvider(s) && !found.has(s.constructor)) {
|
4252
|
+
found.set(s.constructor, s);
|
4441
4253
|
}
|
4442
4254
|
s.forEachChild((child) => {
|
4443
|
-
if (child
|
4444
|
-
found
|
4255
|
+
if (isExtraQueryProvider(child) && !found.has(child.constructor)) {
|
4256
|
+
found.set(child.constructor, child);
|
4445
4257
|
}
|
4446
4258
|
});
|
4447
|
-
return
|
4259
|
+
return null;
|
4448
4260
|
});
|
4261
|
+
return Array.from(found.values());
|
4449
4262
|
}
|
4450
4263
|
findAndSubscribeToAdHocFilters(uid) {
|
4451
4264
|
const filtersVar = findActiveAdHocFilterVariableByUid(uid);
|
@@ -4644,28 +4457,28 @@ class ActWhenVariableChanged extends SceneObjectBase {
|
|
4644
4457
|
}
|
4645
4458
|
}
|
4646
4459
|
|
4647
|
-
var __defProp$
|
4648
|
-
var __defProps$
|
4649
|
-
var __getOwnPropDescs$
|
4650
|
-
var __getOwnPropSymbols$
|
4651
|
-
var __hasOwnProp$
|
4652
|
-
var __propIsEnum$
|
4653
|
-
var __defNormalProp$
|
4654
|
-
var __spreadValues$
|
4460
|
+
var __defProp$w = Object.defineProperty;
|
4461
|
+
var __defProps$k = Object.defineProperties;
|
4462
|
+
var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
|
4463
|
+
var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
|
4464
|
+
var __hasOwnProp$w = Object.prototype.hasOwnProperty;
|
4465
|
+
var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
|
4466
|
+
var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
4467
|
+
var __spreadValues$w = (a, b) => {
|
4655
4468
|
for (var prop in b || (b = {}))
|
4656
|
-
if (__hasOwnProp$
|
4657
|
-
__defNormalProp$
|
4658
|
-
if (__getOwnPropSymbols$
|
4659
|
-
for (var prop of __getOwnPropSymbols$
|
4660
|
-
if (__propIsEnum$
|
4661
|
-
__defNormalProp$
|
4469
|
+
if (__hasOwnProp$w.call(b, prop))
|
4470
|
+
__defNormalProp$w(a, prop, b[prop]);
|
4471
|
+
if (__getOwnPropSymbols$w)
|
4472
|
+
for (var prop of __getOwnPropSymbols$w(b)) {
|
4473
|
+
if (__propIsEnum$w.call(b, prop))
|
4474
|
+
__defNormalProp$w(a, prop, b[prop]);
|
4662
4475
|
}
|
4663
4476
|
return a;
|
4664
4477
|
};
|
4665
|
-
var __spreadProps$
|
4478
|
+
var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
|
4666
4479
|
class CursorSync extends SceneObjectBase {
|
4667
4480
|
constructor(state) {
|
4668
|
-
super(__spreadProps$
|
4481
|
+
super(__spreadProps$k(__spreadValues$w({}, state), {
|
4669
4482
|
sync: state.sync || schema.DashboardCursorSync.Off
|
4670
4483
|
}));
|
4671
4484
|
this.getEventsBus = (panel) => {
|
@@ -4929,25 +4742,25 @@ const getAlertStateStyles = (theme) => {
|
|
4929
4742
|
};
|
4930
4743
|
};
|
4931
4744
|
|
4932
|
-
var __defProp$
|
4933
|
-
var __defProps$
|
4934
|
-
var __getOwnPropDescs$
|
4935
|
-
var __getOwnPropSymbols$
|
4936
|
-
var __hasOwnProp$
|
4937
|
-
var __propIsEnum$
|
4938
|
-
var __defNormalProp$
|
4939
|
-
var __spreadValues$
|
4745
|
+
var __defProp$v = Object.defineProperty;
|
4746
|
+
var __defProps$j = Object.defineProperties;
|
4747
|
+
var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
|
4748
|
+
var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
|
4749
|
+
var __hasOwnProp$v = Object.prototype.hasOwnProperty;
|
4750
|
+
var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
|
4751
|
+
var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
4752
|
+
var __spreadValues$v = (a, b) => {
|
4940
4753
|
for (var prop in b || (b = {}))
|
4941
|
-
if (__hasOwnProp$
|
4942
|
-
__defNormalProp$
|
4943
|
-
if (__getOwnPropSymbols$
|
4944
|
-
for (var prop of __getOwnPropSymbols$
|
4945
|
-
if (__propIsEnum$
|
4946
|
-
__defNormalProp$
|
4754
|
+
if (__hasOwnProp$v.call(b, prop))
|
4755
|
+
__defNormalProp$v(a, prop, b[prop]);
|
4756
|
+
if (__getOwnPropSymbols$v)
|
4757
|
+
for (var prop of __getOwnPropSymbols$v(b)) {
|
4758
|
+
if (__propIsEnum$v.call(b, prop))
|
4759
|
+
__defNormalProp$v(a, prop, b[prop]);
|
4947
4760
|
}
|
4948
4761
|
return a;
|
4949
4762
|
};
|
4950
|
-
var __spreadProps$
|
4763
|
+
var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
|
4951
4764
|
const displayOverrideRef = "hideSeriesFrom";
|
4952
4765
|
const isHideSeriesOverride = data.isSystemOverrideWithRef(displayOverrideRef);
|
4953
4766
|
function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
|
@@ -4957,13 +4770,13 @@ function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
|
|
4957
4770
|
if (currentIndex < 0) {
|
4958
4771
|
if (mode === ui.SeriesVisibilityChangeMode.ToggleSelection) {
|
4959
4772
|
const override3 = createOverride$1([displayName, ...getNamesOfHiddenFields(overrides, data)]);
|
4960
|
-
return __spreadProps$
|
4773
|
+
return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
|
4961
4774
|
overrides: [...fieldConfig.overrides, override3]
|
4962
4775
|
});
|
4963
4776
|
}
|
4964
4777
|
const displayNames = getDisplayNames(data, displayName);
|
4965
4778
|
const override2 = createOverride$1(displayNames);
|
4966
|
-
return __spreadProps$
|
4779
|
+
return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
|
4967
4780
|
overrides: [...fieldConfig.overrides, override2]
|
4968
4781
|
});
|
4969
4782
|
}
|
@@ -4976,22 +4789,22 @@ function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
|
|
4976
4789
|
existing = existing.filter((el) => nameOfHiddenFields.indexOf(el) < 0);
|
4977
4790
|
}
|
4978
4791
|
if (existing[0] === displayName && existing.length === 1) {
|
4979
|
-
return __spreadProps$
|
4792
|
+
return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
|
4980
4793
|
overrides: overridesCopy
|
4981
4794
|
});
|
4982
4795
|
}
|
4983
4796
|
const override2 = createOverride$1([displayName, ...nameOfHiddenFields]);
|
4984
|
-
return __spreadProps$
|
4797
|
+
return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
|
4985
4798
|
overrides: [...overridesCopy, override2]
|
4986
4799
|
});
|
4987
4800
|
}
|
4988
4801
|
const override = createExtendedOverride(current, displayName);
|
4989
4802
|
if (allFieldsAreExcluded(override, data)) {
|
4990
|
-
return __spreadProps$
|
4803
|
+
return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
|
4991
4804
|
overrides: overridesCopy
|
4992
4805
|
});
|
4993
4806
|
}
|
4994
|
-
return __spreadProps$
|
4807
|
+
return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
|
4995
4808
|
overrides: [...overridesCopy, override]
|
4996
4809
|
});
|
4997
4810
|
}
|
@@ -5016,7 +4829,7 @@ function createOverride$1(names, mode = data.ByNamesMatcherMode.exclude, propert
|
|
5016
4829
|
}
|
5017
4830
|
},
|
5018
4831
|
properties: [
|
5019
|
-
__spreadProps$
|
4832
|
+
__spreadProps$j(__spreadValues$v({}, property), {
|
5020
4833
|
value: {
|
5021
4834
|
viz: true,
|
5022
4835
|
legend: false,
|
@@ -5088,32 +4901,32 @@ const getNamesOfHiddenFields = (overrides, data$1) => {
|
|
5088
4901
|
return names;
|
5089
4902
|
};
|
5090
4903
|
|
5091
|
-
var __defProp$
|
5092
|
-
var __defProps$
|
5093
|
-
var __getOwnPropDescs$
|
5094
|
-
var __getOwnPropSymbols$
|
5095
|
-
var __hasOwnProp$
|
5096
|
-
var __propIsEnum$
|
5097
|
-
var __defNormalProp$
|
5098
|
-
var __spreadValues$
|
4904
|
+
var __defProp$u = Object.defineProperty;
|
4905
|
+
var __defProps$i = Object.defineProperties;
|
4906
|
+
var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
|
4907
|
+
var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
|
4908
|
+
var __hasOwnProp$u = Object.prototype.hasOwnProperty;
|
4909
|
+
var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
|
4910
|
+
var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
4911
|
+
var __spreadValues$u = (a, b) => {
|
5099
4912
|
for (var prop in b || (b = {}))
|
5100
|
-
if (__hasOwnProp$
|
5101
|
-
__defNormalProp$
|
5102
|
-
if (__getOwnPropSymbols$
|
5103
|
-
for (var prop of __getOwnPropSymbols$
|
5104
|
-
if (__propIsEnum$
|
5105
|
-
__defNormalProp$
|
4913
|
+
if (__hasOwnProp$u.call(b, prop))
|
4914
|
+
__defNormalProp$u(a, prop, b[prop]);
|
4915
|
+
if (__getOwnPropSymbols$u)
|
4916
|
+
for (var prop of __getOwnPropSymbols$u(b)) {
|
4917
|
+
if (__propIsEnum$u.call(b, prop))
|
4918
|
+
__defNormalProp$u(a, prop, b[prop]);
|
5106
4919
|
}
|
5107
4920
|
return a;
|
5108
4921
|
};
|
5109
|
-
var __spreadProps$
|
4922
|
+
var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
|
5110
4923
|
const changeSeriesColorConfigFactory = (label, color, fieldConfig) => {
|
5111
4924
|
const { overrides } = fieldConfig;
|
5112
4925
|
const currentIndex = fieldConfig.overrides.findIndex((override) => {
|
5113
4926
|
return override.matcher.id === data.FieldMatcherID.byName && override.matcher.options === label;
|
5114
4927
|
});
|
5115
4928
|
if (currentIndex < 0) {
|
5116
|
-
return __spreadProps$
|
4929
|
+
return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
|
5117
4930
|
overrides: [...fieldConfig.overrides, createOverride(label, color)]
|
5118
4931
|
});
|
5119
4932
|
}
|
@@ -5121,19 +4934,19 @@ const changeSeriesColorConfigFactory = (label, color, fieldConfig) => {
|
|
5121
4934
|
const existing = overridesCopy[currentIndex];
|
5122
4935
|
const propertyIndex = existing.properties.findIndex((p) => p.id === "color");
|
5123
4936
|
if (propertyIndex < 0) {
|
5124
|
-
overridesCopy[currentIndex] = __spreadProps$
|
4937
|
+
overridesCopy[currentIndex] = __spreadProps$i(__spreadValues$u({}, existing), {
|
5125
4938
|
properties: [...existing.properties, createProperty(color)]
|
5126
4939
|
});
|
5127
|
-
return __spreadProps$
|
4940
|
+
return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
|
5128
4941
|
overrides: overridesCopy
|
5129
4942
|
});
|
5130
4943
|
}
|
5131
4944
|
const propertiesCopy = Array.from(existing.properties);
|
5132
4945
|
propertiesCopy[propertyIndex] = createProperty(color);
|
5133
|
-
overridesCopy[currentIndex] = __spreadProps$
|
4946
|
+
overridesCopy[currentIndex] = __spreadProps$i(__spreadValues$u({}, existing), {
|
5134
4947
|
properties: propertiesCopy
|
5135
4948
|
});
|
5136
|
-
return __spreadProps$
|
4949
|
+
return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
|
5137
4950
|
overrides: overridesCopy
|
5138
4951
|
});
|
5139
4952
|
};
|
@@ -5156,29 +4969,29 @@ const createProperty = (color) => {
|
|
5156
4969
|
};
|
5157
4970
|
};
|
5158
4971
|
|
5159
|
-
var __defProp$
|
5160
|
-
var __defProps$
|
5161
|
-
var __getOwnPropDescs$
|
5162
|
-
var __getOwnPropSymbols$
|
5163
|
-
var __hasOwnProp$
|
5164
|
-
var __propIsEnum$
|
5165
|
-
var __defNormalProp$
|
5166
|
-
var __spreadValues$
|
4972
|
+
var __defProp$t = Object.defineProperty;
|
4973
|
+
var __defProps$h = Object.defineProperties;
|
4974
|
+
var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
|
4975
|
+
var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
|
4976
|
+
var __hasOwnProp$t = Object.prototype.hasOwnProperty;
|
4977
|
+
var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
|
4978
|
+
var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
4979
|
+
var __spreadValues$t = (a, b) => {
|
5167
4980
|
for (var prop in b || (b = {}))
|
5168
|
-
if (__hasOwnProp$
|
5169
|
-
__defNormalProp$
|
5170
|
-
if (__getOwnPropSymbols$
|
5171
|
-
for (var prop of __getOwnPropSymbols$
|
5172
|
-
if (__propIsEnum$
|
5173
|
-
__defNormalProp$
|
4981
|
+
if (__hasOwnProp$t.call(b, prop))
|
4982
|
+
__defNormalProp$t(a, prop, b[prop]);
|
4983
|
+
if (__getOwnPropSymbols$t)
|
4984
|
+
for (var prop of __getOwnPropSymbols$t(b)) {
|
4985
|
+
if (__propIsEnum$t.call(b, prop))
|
4986
|
+
__defNormalProp$t(a, prop, b[prop]);
|
5174
4987
|
}
|
5175
4988
|
return a;
|
5176
4989
|
};
|
5177
|
-
var __spreadProps$
|
4990
|
+
var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
|
5178
4991
|
class VizPanel extends SceneObjectBase {
|
5179
4992
|
constructor(state) {
|
5180
4993
|
var _a;
|
5181
|
-
super(__spreadValues$
|
4994
|
+
super(__spreadValues$t({
|
5182
4995
|
options: {},
|
5183
4996
|
fieldConfig: { defaults: {}, overrides: [] },
|
5184
4997
|
title: "Title",
|
@@ -5291,7 +5104,7 @@ class VizPanel extends SceneObjectBase {
|
|
5291
5104
|
};
|
5292
5105
|
this._onInstanceStateChange = (state) => {
|
5293
5106
|
if (this._panelContext) {
|
5294
|
-
this._panelContext = __spreadProps$
|
5107
|
+
this._panelContext = __spreadProps$h(__spreadValues$t({}, this._panelContext), {
|
5295
5108
|
instanceState: state
|
5296
5109
|
});
|
5297
5110
|
}
|
@@ -5315,8 +5128,8 @@ class VizPanel extends SceneObjectBase {
|
|
5315
5128
|
sortBy = sortKey;
|
5316
5129
|
}
|
5317
5130
|
this.onOptionsChange(
|
5318
|
-
__spreadProps$
|
5319
|
-
legend: __spreadProps$
|
5131
|
+
__spreadProps$h(__spreadValues$t({}, this.state.options), {
|
5132
|
+
legend: __spreadProps$h(__spreadValues$t({}, legendOptions), { sortBy, sortDesc })
|
5320
5133
|
}),
|
5321
5134
|
true
|
5322
5135
|
);
|
@@ -5423,7 +5236,7 @@ class VizPanel extends SceneObjectBase {
|
|
5423
5236
|
if (!data.compareArrayValues(newFrames, prevFrames, data.compareDataFrameStructures)) {
|
5424
5237
|
this._structureRev++;
|
5425
5238
|
}
|
5426
|
-
this._dataWithFieldConfig = __spreadProps$
|
5239
|
+
this._dataWithFieldConfig = __spreadProps$h(__spreadValues$t({}, rawData), {
|
5427
5240
|
structureRev: this._structureRev,
|
5428
5241
|
series: newFrames
|
5429
5242
|
});
|
@@ -5566,25 +5379,25 @@ function getMessageFromError(err) {
|
|
5566
5379
|
return JSON.stringify(err);
|
5567
5380
|
}
|
5568
5381
|
|
5569
|
-
var __defProp$
|
5570
|
-
var __getOwnPropSymbols$
|
5571
|
-
var __hasOwnProp$
|
5572
|
-
var __propIsEnum$
|
5573
|
-
var __defNormalProp$
|
5574
|
-
var __spreadValues$
|
5382
|
+
var __defProp$s = Object.defineProperty;
|
5383
|
+
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
5384
|
+
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
5385
|
+
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
5386
|
+
var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
5387
|
+
var __spreadValues$s = (a, b) => {
|
5575
5388
|
for (var prop in b || (b = {}))
|
5576
|
-
if (__hasOwnProp$
|
5577
|
-
__defNormalProp$
|
5578
|
-
if (__getOwnPropSymbols$
|
5579
|
-
for (var prop of __getOwnPropSymbols$
|
5580
|
-
if (__propIsEnum$
|
5581
|
-
__defNormalProp$
|
5389
|
+
if (__hasOwnProp$s.call(b, prop))
|
5390
|
+
__defNormalProp$s(a, prop, b[prop]);
|
5391
|
+
if (__getOwnPropSymbols$s)
|
5392
|
+
for (var prop of __getOwnPropSymbols$s(b)) {
|
5393
|
+
if (__propIsEnum$s.call(b, prop))
|
5394
|
+
__defNormalProp$s(a, prop, b[prop]);
|
5582
5395
|
}
|
5583
5396
|
return a;
|
5584
5397
|
};
|
5585
5398
|
class SceneDataLayerBase extends SceneObjectBase {
|
5586
5399
|
constructor(initialState, variableDependencyStatePaths = []) {
|
5587
|
-
super(__spreadValues$
|
5400
|
+
super(__spreadValues$s({
|
5588
5401
|
isEnabled: true
|
5589
5402
|
}, initialState));
|
5590
5403
|
this._results = new rxjs.ReplaySubject(1);
|
@@ -5706,33 +5519,33 @@ function DataLayerControlSwitch({ layer }) {
|
|
5706
5519
|
}
|
5707
5520
|
const containerStyle$1 = css.css({ display: "flex" });
|
5708
5521
|
|
5709
|
-
var __defProp$
|
5710
|
-
var __defProps$
|
5711
|
-
var __getOwnPropDescs$
|
5712
|
-
var __getOwnPropSymbols$
|
5713
|
-
var __hasOwnProp$
|
5714
|
-
var __propIsEnum$
|
5715
|
-
var __defNormalProp$
|
5716
|
-
var __spreadValues$
|
5522
|
+
var __defProp$r = Object.defineProperty;
|
5523
|
+
var __defProps$g = Object.defineProperties;
|
5524
|
+
var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
|
5525
|
+
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
5526
|
+
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
5527
|
+
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
5528
|
+
var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
5529
|
+
var __spreadValues$r = (a, b) => {
|
5717
5530
|
for (var prop in b || (b = {}))
|
5718
|
-
if (__hasOwnProp$
|
5719
|
-
__defNormalProp$
|
5720
|
-
if (__getOwnPropSymbols$
|
5721
|
-
for (var prop of __getOwnPropSymbols$
|
5722
|
-
if (__propIsEnum$
|
5723
|
-
__defNormalProp$
|
5531
|
+
if (__hasOwnProp$r.call(b, prop))
|
5532
|
+
__defNormalProp$r(a, prop, b[prop]);
|
5533
|
+
if (__getOwnPropSymbols$r)
|
5534
|
+
for (var prop of __getOwnPropSymbols$r(b)) {
|
5535
|
+
if (__propIsEnum$r.call(b, prop))
|
5536
|
+
__defNormalProp$r(a, prop, b[prop]);
|
5724
5537
|
}
|
5725
5538
|
return a;
|
5726
5539
|
};
|
5727
|
-
var __spreadProps$
|
5540
|
+
var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
|
5728
5541
|
var __objRest$2 = (source, exclude) => {
|
5729
5542
|
var target = {};
|
5730
5543
|
for (var prop in source)
|
5731
|
-
if (__hasOwnProp$
|
5544
|
+
if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
|
5732
5545
|
target[prop] = source[prop];
|
5733
|
-
if (source != null && __getOwnPropSymbols$
|
5734
|
-
for (var prop of __getOwnPropSymbols$
|
5735
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
5546
|
+
if (source != null && __getOwnPropSymbols$r)
|
5547
|
+
for (var prop of __getOwnPropSymbols$r(source)) {
|
5548
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
|
5736
5549
|
target[prop] = source[prop];
|
5737
5550
|
}
|
5738
5551
|
return target;
|
@@ -5741,7 +5554,7 @@ const standardAnnotationSupport = {
|
|
5741
5554
|
prepareAnnotation: (json) => {
|
5742
5555
|
if (lodash.isString(json == null ? void 0 : json.query)) {
|
5743
5556
|
const _a = json, { query } = _a, rest = __objRest$2(_a, ["query"]);
|
5744
|
-
return __spreadProps$
|
5557
|
+
return __spreadProps$g(__spreadValues$r({}, rest), {
|
5745
5558
|
target: {
|
5746
5559
|
refId: "annotation_query",
|
5747
5560
|
query
|
@@ -5909,25 +5722,25 @@ function shouldUseLegacyRunner(datasource) {
|
|
5909
5722
|
return !datasource.annotations || legacyRunner.includes(type);
|
5910
5723
|
}
|
5911
5724
|
|
5912
|
-
var __defProp$
|
5913
|
-
var __defProps$
|
5914
|
-
var __getOwnPropDescs$
|
5915
|
-
var __getOwnPropSymbols$
|
5916
|
-
var __hasOwnProp$
|
5917
|
-
var __propIsEnum$
|
5918
|
-
var __defNormalProp$
|
5919
|
-
var __spreadValues$
|
5725
|
+
var __defProp$q = Object.defineProperty;
|
5726
|
+
var __defProps$f = Object.defineProperties;
|
5727
|
+
var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
|
5728
|
+
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
5729
|
+
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
5730
|
+
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
5731
|
+
var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
5732
|
+
var __spreadValues$q = (a, b) => {
|
5920
5733
|
for (var prop in b || (b = {}))
|
5921
|
-
if (__hasOwnProp$
|
5922
|
-
__defNormalProp$
|
5923
|
-
if (__getOwnPropSymbols$
|
5924
|
-
for (var prop of __getOwnPropSymbols$
|
5925
|
-
if (__propIsEnum$
|
5926
|
-
__defNormalProp$
|
5734
|
+
if (__hasOwnProp$q.call(b, prop))
|
5735
|
+
__defNormalProp$q(a, prop, b[prop]);
|
5736
|
+
if (__getOwnPropSymbols$q)
|
5737
|
+
for (var prop of __getOwnPropSymbols$q(b)) {
|
5738
|
+
if (__propIsEnum$q.call(b, prop))
|
5739
|
+
__defNormalProp$q(a, prop, b[prop]);
|
5927
5740
|
}
|
5928
5741
|
return a;
|
5929
5742
|
};
|
5930
|
-
var __spreadProps$
|
5743
|
+
var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
|
5931
5744
|
let counter = 100;
|
5932
5745
|
function getNextRequestId() {
|
5933
5746
|
return "AQ" + counter++;
|
@@ -5950,8 +5763,8 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
|
|
5950
5763
|
}))
|
5951
5764
|
);
|
5952
5765
|
}
|
5953
|
-
const processor = __spreadValues$
|
5954
|
-
const annotationWithDefaults = __spreadValues$
|
5766
|
+
const processor = __spreadValues$q(__spreadValues$q({}, standardAnnotationSupport), datasource.annotations);
|
5767
|
+
const annotationWithDefaults = __spreadValues$q(__spreadValues$q({}, (_a = processor.getDefaultQuery) == null ? void 0 : _a.call(processor)), query);
|
5955
5768
|
const annotation = processor.prepareAnnotation(annotationWithDefaults);
|
5956
5769
|
if (!annotation) {
|
5957
5770
|
return rxjs.of({
|
@@ -5974,7 +5787,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
|
|
5974
5787
|
__annotation: { text: annotation.name, value: annotation },
|
5975
5788
|
__sceneObject: { text: "__sceneObject", value: layer }
|
5976
5789
|
};
|
5977
|
-
const queryRequest = __spreadValues$
|
5790
|
+
const queryRequest = __spreadValues$q(__spreadProps$f(__spreadValues$q({
|
5978
5791
|
startTime: Date.now(),
|
5979
5792
|
requestId: getNextRequestId(),
|
5980
5793
|
range: timeRange.state.value,
|
@@ -5984,7 +5797,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
|
|
5984
5797
|
app: data.CoreApp.Dashboard,
|
5985
5798
|
timezone: timeRange.getTimeZone(),
|
5986
5799
|
targets: [
|
5987
|
-
__spreadProps$
|
5800
|
+
__spreadProps$f(__spreadValues$q({}, processedQuery), {
|
5988
5801
|
refId: "Anno"
|
5989
5802
|
})
|
5990
5803
|
]
|
@@ -6002,7 +5815,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
|
|
6002
5815
|
data$1.forEach((frame) => {
|
6003
5816
|
var _a2;
|
6004
5817
|
if (!((_a2 = frame.meta) == null ? void 0 : _a2.dataTopic)) {
|
6005
|
-
frame.meta = __spreadProps$
|
5818
|
+
frame.meta = __spreadProps$f(__spreadValues$q({}, frame.meta || {}), { dataTopic: data.DataTopic.Annotations });
|
6006
5819
|
}
|
6007
5820
|
});
|
6008
5821
|
return processor.processEvents(annotation, data$1).pipe(
|
@@ -6017,19 +5830,19 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
|
|
6017
5830
|
);
|
6018
5831
|
}
|
6019
5832
|
|
6020
|
-
var __defProp$
|
6021
|
-
var __getOwnPropSymbols$
|
6022
|
-
var __hasOwnProp$
|
6023
|
-
var __propIsEnum$
|
6024
|
-
var __defNormalProp$
|
6025
|
-
var __spreadValues$
|
5833
|
+
var __defProp$p = Object.defineProperty;
|
5834
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
5835
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
5836
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
5837
|
+
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
5838
|
+
var __spreadValues$p = (a, b) => {
|
6026
5839
|
for (var prop in b || (b = {}))
|
6027
|
-
if (__hasOwnProp$
|
6028
|
-
__defNormalProp$
|
6029
|
-
if (__getOwnPropSymbols$
|
6030
|
-
for (var prop of __getOwnPropSymbols$
|
6031
|
-
if (__propIsEnum$
|
6032
|
-
__defNormalProp$
|
5840
|
+
if (__hasOwnProp$p.call(b, prop))
|
5841
|
+
__defNormalProp$p(a, prop, b[prop]);
|
5842
|
+
if (__getOwnPropSymbols$p)
|
5843
|
+
for (var prop of __getOwnPropSymbols$p(b)) {
|
5844
|
+
if (__propIsEnum$p.call(b, prop))
|
5845
|
+
__defNormalProp$p(a, prop, b[prop]);
|
6033
5846
|
}
|
6034
5847
|
return a;
|
6035
5848
|
};
|
@@ -6040,7 +5853,7 @@ function postProcessQueryResult(annotation, results) {
|
|
6040
5853
|
}
|
6041
5854
|
const processed = results.map((item) => {
|
6042
5855
|
var _a;
|
6043
|
-
const processedItem = __spreadValues$
|
5856
|
+
const processedItem = __spreadValues$p({}, item);
|
6044
5857
|
processedItem.source = annotation;
|
6045
5858
|
processedItem.color = runtime.config.theme2.visualization.getColorByName(annotation.iconColor);
|
6046
5859
|
processedItem.type = annotation.name;
|
@@ -6089,29 +5902,29 @@ function isPanelAlert(event) {
|
|
6089
5902
|
return event.eventType === "panel-alert";
|
6090
5903
|
}
|
6091
5904
|
|
6092
|
-
var __defProp$
|
6093
|
-
var __defProps$
|
6094
|
-
var __getOwnPropDescs$
|
6095
|
-
var __getOwnPropSymbols$
|
6096
|
-
var __hasOwnProp$
|
6097
|
-
var __propIsEnum$
|
6098
|
-
var __defNormalProp$
|
6099
|
-
var __spreadValues$
|
5905
|
+
var __defProp$o = Object.defineProperty;
|
5906
|
+
var __defProps$e = Object.defineProperties;
|
5907
|
+
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
5908
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
5909
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
5910
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
5911
|
+
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
5912
|
+
var __spreadValues$o = (a, b) => {
|
6100
5913
|
for (var prop in b || (b = {}))
|
6101
|
-
if (__hasOwnProp$
|
6102
|
-
__defNormalProp$
|
6103
|
-
if (__getOwnPropSymbols$
|
6104
|
-
for (var prop of __getOwnPropSymbols$
|
6105
|
-
if (__propIsEnum$
|
6106
|
-
__defNormalProp$
|
5914
|
+
if (__hasOwnProp$o.call(b, prop))
|
5915
|
+
__defNormalProp$o(a, prop, b[prop]);
|
5916
|
+
if (__getOwnPropSymbols$o)
|
5917
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
5918
|
+
if (__propIsEnum$o.call(b, prop))
|
5919
|
+
__defNormalProp$o(a, prop, b[prop]);
|
6107
5920
|
}
|
6108
5921
|
return a;
|
6109
5922
|
};
|
6110
|
-
var __spreadProps$
|
5923
|
+
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
6111
5924
|
class AnnotationsDataLayer extends SceneDataLayerBase {
|
6112
5925
|
constructor(initialState) {
|
6113
5926
|
super(
|
6114
|
-
__spreadValues$
|
5927
|
+
__spreadValues$o({
|
6115
5928
|
isEnabled: true
|
6116
5929
|
}, initialState),
|
6117
5930
|
["query"]
|
@@ -6159,7 +5972,7 @@ class AnnotationsDataLayer extends SceneDataLayerBase {
|
|
6159
5972
|
this.publishResults(stateUpdate);
|
6160
5973
|
});
|
6161
5974
|
} catch (e) {
|
6162
|
-
this.publishResults(__spreadProps$
|
5975
|
+
this.publishResults(__spreadProps$e(__spreadValues$o({}, emptyPanelData), {
|
6163
5976
|
state: schema.LoadingState.Error,
|
6164
5977
|
errors: [
|
6165
5978
|
{
|
@@ -6176,9 +5989,9 @@ class AnnotationsDataLayer extends SceneDataLayerBase {
|
|
6176
5989
|
processEvents(query, events) {
|
6177
5990
|
let processedEvents = postProcessQueryResult(query, events.events || []);
|
6178
5991
|
processedEvents = dedupAnnotations(processedEvents);
|
6179
|
-
const stateUpdate = __spreadProps$
|
5992
|
+
const stateUpdate = __spreadProps$e(__spreadValues$o({}, emptyPanelData), { state: events.state });
|
6180
5993
|
const df = data.arrayToDataFrame(processedEvents);
|
6181
|
-
df.meta = __spreadProps$
|
5994
|
+
df.meta = __spreadProps$e(__spreadValues$o({}, df.meta), {
|
6182
5995
|
dataTopic: data.DataTopic.Annotations
|
6183
5996
|
});
|
6184
5997
|
stateUpdate.series = [df];
|
@@ -6231,28 +6044,28 @@ class SceneTimeRangeTransformerBase extends SceneObjectBase {
|
|
6231
6044
|
}
|
6232
6045
|
}
|
6233
6046
|
|
6234
|
-
var __defProp$
|
6235
|
-
var __defProps$
|
6236
|
-
var __getOwnPropDescs$
|
6237
|
-
var __getOwnPropSymbols$
|
6238
|
-
var __hasOwnProp$
|
6239
|
-
var __propIsEnum$
|
6240
|
-
var __defNormalProp$
|
6241
|
-
var __spreadValues$
|
6047
|
+
var __defProp$n = Object.defineProperty;
|
6048
|
+
var __defProps$d = Object.defineProperties;
|
6049
|
+
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
6050
|
+
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
6051
|
+
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
6052
|
+
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
6053
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6054
|
+
var __spreadValues$n = (a, b) => {
|
6242
6055
|
for (var prop in b || (b = {}))
|
6243
|
-
if (__hasOwnProp$
|
6244
|
-
__defNormalProp$
|
6245
|
-
if (__getOwnPropSymbols$
|
6246
|
-
for (var prop of __getOwnPropSymbols$
|
6247
|
-
if (__propIsEnum$
|
6248
|
-
__defNormalProp$
|
6056
|
+
if (__hasOwnProp$n.call(b, prop))
|
6057
|
+
__defNormalProp$n(a, prop, b[prop]);
|
6058
|
+
if (__getOwnPropSymbols$n)
|
6059
|
+
for (var prop of __getOwnPropSymbols$n(b)) {
|
6060
|
+
if (__propIsEnum$n.call(b, prop))
|
6061
|
+
__defNormalProp$n(a, prop, b[prop]);
|
6249
6062
|
}
|
6250
6063
|
return a;
|
6251
6064
|
};
|
6252
|
-
var __spreadProps$
|
6065
|
+
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
6253
6066
|
class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
|
6254
6067
|
constructor(state) {
|
6255
|
-
super(__spreadProps$
|
6068
|
+
super(__spreadProps$d(__spreadValues$n({}, state), {
|
6256
6069
|
timeZone: state.timeZone,
|
6257
6070
|
from: "now-6h",
|
6258
6071
|
to: "now",
|
@@ -6260,7 +6073,7 @@ class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
|
|
6260
6073
|
}));
|
6261
6074
|
}
|
6262
6075
|
ancestorTimeRangeChanged(timeRange) {
|
6263
|
-
this.setState(__spreadProps$
|
6076
|
+
this.setState(__spreadProps$d(__spreadValues$n({}, timeRange), {
|
6264
6077
|
timeZone: this.state.timeZone,
|
6265
6078
|
value: evaluateTimeRange(
|
6266
6079
|
timeRange.from,
|
@@ -6288,25 +6101,25 @@ class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
|
|
6288
6101
|
}
|
6289
6102
|
}
|
6290
6103
|
|
6291
|
-
var __defProp$
|
6292
|
-
var __defProps$
|
6293
|
-
var __getOwnPropDescs$
|
6294
|
-
var __getOwnPropSymbols$
|
6295
|
-
var __hasOwnProp$
|
6296
|
-
var __propIsEnum$
|
6297
|
-
var __defNormalProp$
|
6298
|
-
var __spreadValues$
|
6104
|
+
var __defProp$m = Object.defineProperty;
|
6105
|
+
var __defProps$c = Object.defineProperties;
|
6106
|
+
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
6107
|
+
var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
|
6108
|
+
var __hasOwnProp$m = Object.prototype.hasOwnProperty;
|
6109
|
+
var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
|
6110
|
+
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6111
|
+
var __spreadValues$m = (a, b) => {
|
6299
6112
|
for (var prop in b || (b = {}))
|
6300
|
-
if (__hasOwnProp$
|
6301
|
-
__defNormalProp$
|
6302
|
-
if (__getOwnPropSymbols$
|
6303
|
-
for (var prop of __getOwnPropSymbols$
|
6304
|
-
if (__propIsEnum$
|
6305
|
-
__defNormalProp$
|
6113
|
+
if (__hasOwnProp$m.call(b, prop))
|
6114
|
+
__defNormalProp$m(a, prop, b[prop]);
|
6115
|
+
if (__getOwnPropSymbols$m)
|
6116
|
+
for (var prop of __getOwnPropSymbols$m(b)) {
|
6117
|
+
if (__propIsEnum$m.call(b, prop))
|
6118
|
+
__defNormalProp$m(a, prop, b[prop]);
|
6306
6119
|
}
|
6307
6120
|
return a;
|
6308
6121
|
};
|
6309
|
-
var __spreadProps$
|
6122
|
+
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
6310
6123
|
class SceneDataLayerSetBase extends SceneObjectBase {
|
6311
6124
|
constructor() {
|
6312
6125
|
super(...arguments);
|
@@ -6330,7 +6143,7 @@ class SceneDataLayerSetBase extends SceneObjectBase {
|
|
6330
6143
|
series = series.concat(result.data.series);
|
6331
6144
|
}
|
6332
6145
|
}
|
6333
|
-
const combinedData = __spreadProps$
|
6146
|
+
const combinedData = __spreadProps$c(__spreadValues$m({}, emptyPanelData), { series });
|
6334
6147
|
this._results.next({ origin: this, data: combinedData });
|
6335
6148
|
this.setStateHelper({ data: combinedData });
|
6336
6149
|
}
|
@@ -6379,25 +6192,25 @@ SceneDataLayerSet.Component = ({ model }) => {
|
|
6379
6192
|
})));
|
6380
6193
|
};
|
6381
6194
|
|
6382
|
-
var __defProp$
|
6383
|
-
var __defProps$
|
6384
|
-
var __getOwnPropDescs$
|
6385
|
-
var __getOwnPropSymbols$
|
6386
|
-
var __hasOwnProp$
|
6387
|
-
var __propIsEnum$
|
6388
|
-
var __defNormalProp$
|
6389
|
-
var __spreadValues$
|
6195
|
+
var __defProp$l = Object.defineProperty;
|
6196
|
+
var __defProps$b = Object.defineProperties;
|
6197
|
+
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
6198
|
+
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
6199
|
+
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
6200
|
+
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
6201
|
+
var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6202
|
+
var __spreadValues$l = (a, b) => {
|
6390
6203
|
for (var prop in b || (b = {}))
|
6391
|
-
if (__hasOwnProp$
|
6392
|
-
__defNormalProp$
|
6393
|
-
if (__getOwnPropSymbols$
|
6394
|
-
for (var prop of __getOwnPropSymbols$
|
6395
|
-
if (__propIsEnum$
|
6396
|
-
__defNormalProp$
|
6204
|
+
if (__hasOwnProp$l.call(b, prop))
|
6205
|
+
__defNormalProp$l(a, prop, b[prop]);
|
6206
|
+
if (__getOwnPropSymbols$l)
|
6207
|
+
for (var prop of __getOwnPropSymbols$l(b)) {
|
6208
|
+
if (__propIsEnum$l.call(b, prop))
|
6209
|
+
__defNormalProp$l(a, prop, b[prop]);
|
6397
6210
|
}
|
6398
6211
|
return a;
|
6399
6212
|
};
|
6400
|
-
var __spreadProps$
|
6213
|
+
var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
|
6401
6214
|
class SceneDataTransformer extends SceneObjectBase {
|
6402
6215
|
constructor(state) {
|
6403
6216
|
super(state);
|
@@ -6474,7 +6287,7 @@ class SceneDataTransformer extends SceneObjectBase {
|
|
6474
6287
|
const { series, annotations } = this._prevDataFromSource;
|
6475
6288
|
if (data.series === series && data.annotations === annotations) {
|
6476
6289
|
if (this.state.data && data.state !== this.state.data.state) {
|
6477
|
-
this.setState({ data: __spreadProps$
|
6290
|
+
this.setState({ data: __spreadProps$b(__spreadValues$l({}, this.state.data), { state: data.state }) });
|
6478
6291
|
}
|
6479
6292
|
return true;
|
6480
6293
|
}
|
@@ -6522,7 +6335,7 @@ class SceneDataTransformer extends SceneObjectBase {
|
|
6522
6335
|
rxjs.map((values) => {
|
6523
6336
|
const transformedSeries = values[0];
|
6524
6337
|
const transformedAnnotations = values[1];
|
6525
|
-
return __spreadProps$
|
6338
|
+
return __spreadProps$b(__spreadValues$l({}, data$1), {
|
6526
6339
|
series: transformedSeries,
|
6527
6340
|
annotations: transformedAnnotations != null ? transformedAnnotations : data$1.annotations
|
6528
6341
|
});
|
@@ -6533,7 +6346,7 @@ class SceneDataTransformer extends SceneObjectBase {
|
|
6533
6346
|
const sourceErr = ((_a2 = this.getSourceData().state.data) == null ? void 0 : _a2.errors) || [];
|
6534
6347
|
const transformationError = runtime.toDataQueryError(err);
|
6535
6348
|
transformationError.message = `Error transforming data: ${transformationError.message}`;
|
6536
|
-
const result = __spreadProps$
|
6349
|
+
const result = __spreadProps$b(__spreadValues$l({}, data$1), {
|
6537
6350
|
state: data.LoadingState.Error,
|
6538
6351
|
errors: [...sourceErr, transformationError]
|
6539
6352
|
});
|
@@ -6866,28 +6679,28 @@ class SceneVariableSetVariableDependencyHandler {
|
|
6866
6679
|
}
|
6867
6680
|
}
|
6868
6681
|
|
6869
|
-
var __defProp$
|
6870
|
-
var __defProps$
|
6871
|
-
var __getOwnPropDescs$
|
6872
|
-
var __getOwnPropSymbols$
|
6873
|
-
var __hasOwnProp$
|
6874
|
-
var __propIsEnum$
|
6875
|
-
var __defNormalProp$
|
6876
|
-
var __spreadValues$
|
6682
|
+
var __defProp$k = Object.defineProperty;
|
6683
|
+
var __defProps$a = Object.defineProperties;
|
6684
|
+
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
6685
|
+
var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
|
6686
|
+
var __hasOwnProp$k = Object.prototype.hasOwnProperty;
|
6687
|
+
var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
|
6688
|
+
var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6689
|
+
var __spreadValues$k = (a, b) => {
|
6877
6690
|
for (var prop in b || (b = {}))
|
6878
|
-
if (__hasOwnProp$
|
6879
|
-
__defNormalProp$
|
6880
|
-
if (__getOwnPropSymbols$
|
6881
|
-
for (var prop of __getOwnPropSymbols$
|
6882
|
-
if (__propIsEnum$
|
6883
|
-
__defNormalProp$
|
6691
|
+
if (__hasOwnProp$k.call(b, prop))
|
6692
|
+
__defNormalProp$k(a, prop, b[prop]);
|
6693
|
+
if (__getOwnPropSymbols$k)
|
6694
|
+
for (var prop of __getOwnPropSymbols$k(b)) {
|
6695
|
+
if (__propIsEnum$k.call(b, prop))
|
6696
|
+
__defNormalProp$k(a, prop, b[prop]);
|
6884
6697
|
}
|
6885
6698
|
return a;
|
6886
6699
|
};
|
6887
|
-
var __spreadProps$
|
6700
|
+
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
6888
6701
|
class ConstantVariable extends SceneObjectBase {
|
6889
6702
|
constructor(initialState) {
|
6890
|
-
super(__spreadProps$
|
6703
|
+
super(__spreadProps$a(__spreadValues$k({
|
6891
6704
|
type: "constant",
|
6892
6705
|
value: "",
|
6893
6706
|
name: ""
|
@@ -6900,25 +6713,25 @@ class ConstantVariable extends SceneObjectBase {
|
|
6900
6713
|
}
|
6901
6714
|
}
|
6902
6715
|
|
6903
|
-
var __defProp$
|
6904
|
-
var __getOwnPropSymbols$
|
6905
|
-
var __hasOwnProp$
|
6906
|
-
var __propIsEnum$
|
6907
|
-
var __defNormalProp$
|
6908
|
-
var __spreadValues$
|
6716
|
+
var __defProp$j = Object.defineProperty;
|
6717
|
+
var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
|
6718
|
+
var __hasOwnProp$j = Object.prototype.hasOwnProperty;
|
6719
|
+
var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
|
6720
|
+
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6721
|
+
var __spreadValues$j = (a, b) => {
|
6909
6722
|
for (var prop in b || (b = {}))
|
6910
|
-
if (__hasOwnProp$
|
6911
|
-
__defNormalProp$
|
6912
|
-
if (__getOwnPropSymbols$
|
6913
|
-
for (var prop of __getOwnPropSymbols$
|
6914
|
-
if (__propIsEnum$
|
6915
|
-
__defNormalProp$
|
6723
|
+
if (__hasOwnProp$j.call(b, prop))
|
6724
|
+
__defNormalProp$j(a, prop, b[prop]);
|
6725
|
+
if (__getOwnPropSymbols$j)
|
6726
|
+
for (var prop of __getOwnPropSymbols$j(b)) {
|
6727
|
+
if (__propIsEnum$j.call(b, prop))
|
6728
|
+
__defNormalProp$j(a, prop, b[prop]);
|
6916
6729
|
}
|
6917
6730
|
return a;
|
6918
6731
|
};
|
6919
6732
|
class CustomVariable extends MultiValueVariable {
|
6920
6733
|
constructor(initialState) {
|
6921
|
-
super(__spreadValues$
|
6734
|
+
super(__spreadValues$j({
|
6922
6735
|
type: "custom",
|
6923
6736
|
query: "",
|
6924
6737
|
value: "",
|
@@ -6952,25 +6765,25 @@ CustomVariable.Component = ({ model }) => {
|
|
6952
6765
|
return renderSelectForVariable(model);
|
6953
6766
|
};
|
6954
6767
|
|
6955
|
-
var __defProp$
|
6956
|
-
var __getOwnPropSymbols$
|
6957
|
-
var __hasOwnProp$
|
6958
|
-
var __propIsEnum$
|
6959
|
-
var __defNormalProp$
|
6960
|
-
var __spreadValues$
|
6768
|
+
var __defProp$i = Object.defineProperty;
|
6769
|
+
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
6770
|
+
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|
6771
|
+
var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
|
6772
|
+
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6773
|
+
var __spreadValues$i = (a, b) => {
|
6961
6774
|
for (var prop in b || (b = {}))
|
6962
|
-
if (__hasOwnProp$
|
6963
|
-
__defNormalProp$
|
6964
|
-
if (__getOwnPropSymbols$
|
6965
|
-
for (var prop of __getOwnPropSymbols$
|
6966
|
-
if (__propIsEnum$
|
6967
|
-
__defNormalProp$
|
6775
|
+
if (__hasOwnProp$i.call(b, prop))
|
6776
|
+
__defNormalProp$i(a, prop, b[prop]);
|
6777
|
+
if (__getOwnPropSymbols$i)
|
6778
|
+
for (var prop of __getOwnPropSymbols$i(b)) {
|
6779
|
+
if (__propIsEnum$i.call(b, prop))
|
6780
|
+
__defNormalProp$i(a, prop, b[prop]);
|
6968
6781
|
}
|
6969
6782
|
return a;
|
6970
6783
|
};
|
6971
6784
|
class DataSourceVariable extends MultiValueVariable {
|
6972
6785
|
constructor(initialState) {
|
6973
|
-
super(__spreadValues$
|
6786
|
+
super(__spreadValues$i({
|
6974
6787
|
type: "datasource",
|
6975
6788
|
value: "",
|
6976
6789
|
text: "",
|
@@ -7054,25 +6867,25 @@ const hasCustomVariableSupport = (datasource) => {
|
|
7054
6867
|
return "query" in variableSupport && "editor" in variableSupport && Boolean(variableSupport.query) && Boolean(variableSupport.editor);
|
7055
6868
|
};
|
7056
6869
|
|
7057
|
-
var __defProp$
|
7058
|
-
var __defProps$
|
7059
|
-
var __getOwnPropDescs$
|
7060
|
-
var __getOwnPropSymbols$
|
7061
|
-
var __hasOwnProp$
|
7062
|
-
var __propIsEnum$
|
7063
|
-
var __defNormalProp$
|
7064
|
-
var __spreadValues$
|
6870
|
+
var __defProp$h = Object.defineProperty;
|
6871
|
+
var __defProps$9 = Object.defineProperties;
|
6872
|
+
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
6873
|
+
var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
|
6874
|
+
var __hasOwnProp$h = Object.prototype.hasOwnProperty;
|
6875
|
+
var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
|
6876
|
+
var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6877
|
+
var __spreadValues$h = (a, b) => {
|
7065
6878
|
for (var prop in b || (b = {}))
|
7066
|
-
if (__hasOwnProp$
|
7067
|
-
__defNormalProp$
|
7068
|
-
if (__getOwnPropSymbols$
|
7069
|
-
for (var prop of __getOwnPropSymbols$
|
7070
|
-
if (__propIsEnum$
|
7071
|
-
__defNormalProp$
|
6879
|
+
if (__hasOwnProp$h.call(b, prop))
|
6880
|
+
__defNormalProp$h(a, prop, b[prop]);
|
6881
|
+
if (__getOwnPropSymbols$h)
|
6882
|
+
for (var prop of __getOwnPropSymbols$h(b)) {
|
6883
|
+
if (__propIsEnum$h.call(b, prop))
|
6884
|
+
__defNormalProp$h(a, prop, b[prop]);
|
7072
6885
|
}
|
7073
6886
|
return a;
|
7074
6887
|
};
|
7075
|
-
var __spreadProps$
|
6888
|
+
var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
7076
6889
|
class StandardQueryRunner {
|
7077
6890
|
constructor(datasource, _runRequest = runtime.getRunRequest()) {
|
7078
6891
|
this.datasource = datasource;
|
@@ -7109,7 +6922,7 @@ class LegacyQueryRunner {
|
|
7109
6922
|
return getEmptyMetricFindValueObservable();
|
7110
6923
|
}
|
7111
6924
|
return rxjs.from(
|
7112
|
-
this.datasource.metricFindQuery(variable.state.query, __spreadProps$
|
6925
|
+
this.datasource.metricFindQuery(variable.state.query, __spreadProps$9(__spreadValues$h({}, request), {
|
7113
6926
|
variable: {
|
7114
6927
|
name: variable.state.name,
|
7115
6928
|
type: variable.state.type
|
@@ -7171,7 +6984,7 @@ function ensureVariableQueryModelIsADataQuery(variable) {
|
|
7171
6984
|
return { query, refId: `variable-${variable.state.name}` };
|
7172
6985
|
}
|
7173
6986
|
if (query.refId == null) {
|
7174
|
-
return __spreadProps$
|
6987
|
+
return __spreadProps$9(__spreadValues$h({}, query), { refId: `variable-${variable.state.name}` });
|
7175
6988
|
}
|
7176
6989
|
return variable.state.query;
|
7177
6990
|
}
|
@@ -7386,25 +7199,25 @@ function areMetricFindValues(data$1) {
|
|
7386
7199
|
return false;
|
7387
7200
|
}
|
7388
7201
|
|
7389
|
-
var __defProp$
|
7390
|
-
var __getOwnPropSymbols$
|
7391
|
-
var __hasOwnProp$
|
7392
|
-
var __propIsEnum$
|
7393
|
-
var __defNormalProp$
|
7394
|
-
var __spreadValues$
|
7202
|
+
var __defProp$g = Object.defineProperty;
|
7203
|
+
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
7204
|
+
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
7205
|
+
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
7206
|
+
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
7207
|
+
var __spreadValues$g = (a, b) => {
|
7395
7208
|
for (var prop in b || (b = {}))
|
7396
|
-
if (__hasOwnProp$
|
7397
|
-
__defNormalProp$
|
7398
|
-
if (__getOwnPropSymbols$
|
7399
|
-
for (var prop of __getOwnPropSymbols$
|
7400
|
-
if (__propIsEnum$
|
7401
|
-
__defNormalProp$
|
7209
|
+
if (__hasOwnProp$g.call(b, prop))
|
7210
|
+
__defNormalProp$g(a, prop, b[prop]);
|
7211
|
+
if (__getOwnPropSymbols$g)
|
7212
|
+
for (var prop of __getOwnPropSymbols$g(b)) {
|
7213
|
+
if (__propIsEnum$g.call(b, prop))
|
7214
|
+
__defNormalProp$g(a, prop, b[prop]);
|
7402
7215
|
}
|
7403
7216
|
return a;
|
7404
7217
|
};
|
7405
7218
|
class QueryVariable extends MultiValueVariable {
|
7406
7219
|
constructor(initialState) {
|
7407
|
-
super(__spreadValues$
|
7220
|
+
super(__spreadValues$g({
|
7408
7221
|
type: "query",
|
7409
7222
|
name: "",
|
7410
7223
|
value: "",
|
@@ -7557,25 +7370,25 @@ function queryMetricTree(query) {
|
|
7557
7370
|
return queryTree(children, query.split("."), 0);
|
7558
7371
|
}
|
7559
7372
|
|
7560
|
-
var __defProp$
|
7561
|
-
var __getOwnPropSymbols$
|
7562
|
-
var __hasOwnProp$
|
7563
|
-
var __propIsEnum$
|
7564
|
-
var __defNormalProp$
|
7565
|
-
var __spreadValues$
|
7373
|
+
var __defProp$f = Object.defineProperty;
|
7374
|
+
var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
|
7375
|
+
var __hasOwnProp$f = Object.prototype.hasOwnProperty;
|
7376
|
+
var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
|
7377
|
+
var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
7378
|
+
var __spreadValues$f = (a, b) => {
|
7566
7379
|
for (var prop in b || (b = {}))
|
7567
|
-
if (__hasOwnProp$
|
7568
|
-
__defNormalProp$
|
7569
|
-
if (__getOwnPropSymbols$
|
7570
|
-
for (var prop of __getOwnPropSymbols$
|
7571
|
-
if (__propIsEnum$
|
7572
|
-
__defNormalProp$
|
7380
|
+
if (__hasOwnProp$f.call(b, prop))
|
7381
|
+
__defNormalProp$f(a, prop, b[prop]);
|
7382
|
+
if (__getOwnPropSymbols$f)
|
7383
|
+
for (var prop of __getOwnPropSymbols$f(b)) {
|
7384
|
+
if (__propIsEnum$f.call(b, prop))
|
7385
|
+
__defNormalProp$f(a, prop, b[prop]);
|
7573
7386
|
}
|
7574
7387
|
return a;
|
7575
7388
|
};
|
7576
7389
|
class TestVariable extends MultiValueVariable {
|
7577
7390
|
constructor(initialState, isLazy = false) {
|
7578
|
-
super(__spreadValues$
|
7391
|
+
super(__spreadValues$f({
|
7579
7392
|
type: "custom",
|
7580
7393
|
name: "Test",
|
7581
7394
|
value: "Value",
|
@@ -7684,25 +7497,25 @@ function VariableValueInput({ model }) {
|
|
7684
7497
|
});
|
7685
7498
|
}
|
7686
7499
|
|
7687
|
-
var __defProp$
|
7688
|
-
var __getOwnPropSymbols$
|
7689
|
-
var __hasOwnProp$
|
7690
|
-
var __propIsEnum$
|
7691
|
-
var __defNormalProp$
|
7692
|
-
var __spreadValues$
|
7500
|
+
var __defProp$e = Object.defineProperty;
|
7501
|
+
var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
|
7502
|
+
var __hasOwnProp$e = Object.prototype.hasOwnProperty;
|
7503
|
+
var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
|
7504
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
7505
|
+
var __spreadValues$e = (a, b) => {
|
7693
7506
|
for (var prop in b || (b = {}))
|
7694
|
-
if (__hasOwnProp$
|
7695
|
-
__defNormalProp$
|
7696
|
-
if (__getOwnPropSymbols$
|
7697
|
-
for (var prop of __getOwnPropSymbols$
|
7698
|
-
if (__propIsEnum$
|
7699
|
-
__defNormalProp$
|
7507
|
+
if (__hasOwnProp$e.call(b, prop))
|
7508
|
+
__defNormalProp$e(a, prop, b[prop]);
|
7509
|
+
if (__getOwnPropSymbols$e)
|
7510
|
+
for (var prop of __getOwnPropSymbols$e(b)) {
|
7511
|
+
if (__propIsEnum$e.call(b, prop))
|
7512
|
+
__defNormalProp$e(a, prop, b[prop]);
|
7700
7513
|
}
|
7701
7514
|
return a;
|
7702
7515
|
};
|
7703
7516
|
class TextBoxVariable extends SceneObjectBase {
|
7704
7517
|
constructor(initialState) {
|
7705
|
-
super(__spreadValues$
|
7518
|
+
super(__spreadValues$e({
|
7706
7519
|
type: "textbox",
|
7707
7520
|
value: "",
|
7708
7521
|
name: ""
|
@@ -7739,28 +7552,28 @@ TextBoxVariable.Component = ({ model }) => {
|
|
7739
7552
|
});
|
7740
7553
|
};
|
7741
7554
|
|
7742
|
-
var __defProp$
|
7743
|
-
var __defProps$
|
7744
|
-
var __getOwnPropDescs$
|
7745
|
-
var __getOwnPropSymbols$
|
7746
|
-
var __hasOwnProp$
|
7747
|
-
var __propIsEnum$
|
7748
|
-
var __defNormalProp$
|
7749
|
-
var __spreadValues$
|
7555
|
+
var __defProp$d = Object.defineProperty;
|
7556
|
+
var __defProps$8 = Object.defineProperties;
|
7557
|
+
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
7558
|
+
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
7559
|
+
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
7560
|
+
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
7561
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
7562
|
+
var __spreadValues$d = (a, b) => {
|
7750
7563
|
for (var prop in b || (b = {}))
|
7751
|
-
if (__hasOwnProp$
|
7752
|
-
__defNormalProp$
|
7753
|
-
if (__getOwnPropSymbols$
|
7754
|
-
for (var prop of __getOwnPropSymbols$
|
7755
|
-
if (__propIsEnum$
|
7756
|
-
__defNormalProp$
|
7564
|
+
if (__hasOwnProp$d.call(b, prop))
|
7565
|
+
__defNormalProp$d(a, prop, b[prop]);
|
7566
|
+
if (__getOwnPropSymbols$d)
|
7567
|
+
for (var prop of __getOwnPropSymbols$d(b)) {
|
7568
|
+
if (__propIsEnum$d.call(b, prop))
|
7569
|
+
__defNormalProp$d(a, prop, b[prop]);
|
7757
7570
|
}
|
7758
7571
|
return a;
|
7759
7572
|
};
|
7760
|
-
var __spreadProps$
|
7573
|
+
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
7761
7574
|
class LocalValueVariable extends SceneObjectBase {
|
7762
7575
|
constructor(initialState) {
|
7763
|
-
super(__spreadProps$
|
7576
|
+
super(__spreadProps$8(__spreadValues$d({
|
7764
7577
|
type: "system",
|
7765
7578
|
value: "",
|
7766
7579
|
text: "",
|
@@ -7792,25 +7605,25 @@ class LocalValueVariable extends SceneObjectBase {
|
|
7792
7605
|
}
|
7793
7606
|
}
|
7794
7607
|
|
7795
|
-
var __defProp$
|
7796
|
-
var __getOwnPropSymbols$
|
7797
|
-
var __hasOwnProp$
|
7798
|
-
var __propIsEnum$
|
7799
|
-
var __defNormalProp$
|
7800
|
-
var __spreadValues$
|
7608
|
+
var __defProp$c = Object.defineProperty;
|
7609
|
+
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
7610
|
+
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
7611
|
+
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
7612
|
+
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
7613
|
+
var __spreadValues$c = (a, b) => {
|
7801
7614
|
for (var prop in b || (b = {}))
|
7802
|
-
if (__hasOwnProp$
|
7803
|
-
__defNormalProp$
|
7804
|
-
if (__getOwnPropSymbols$
|
7805
|
-
for (var prop of __getOwnPropSymbols$
|
7806
|
-
if (__propIsEnum$
|
7807
|
-
__defNormalProp$
|
7615
|
+
if (__hasOwnProp$c.call(b, prop))
|
7616
|
+
__defNormalProp$c(a, prop, b[prop]);
|
7617
|
+
if (__getOwnPropSymbols$c)
|
7618
|
+
for (var prop of __getOwnPropSymbols$c(b)) {
|
7619
|
+
if (__propIsEnum$c.call(b, prop))
|
7620
|
+
__defNormalProp$c(a, prop, b[prop]);
|
7808
7621
|
}
|
7809
7622
|
return a;
|
7810
7623
|
};
|
7811
7624
|
class IntervalVariable extends SceneObjectBase {
|
7812
7625
|
constructor(initialState) {
|
7813
|
-
super(__spreadValues$
|
7626
|
+
super(__spreadValues$c({
|
7814
7627
|
type: "interval",
|
7815
7628
|
value: "",
|
7816
7629
|
intervals: ["1m", "10m", "30m", "1h", "6h", "12h", "1d", "7d", "14d", "30d"],
|
@@ -8018,7 +7831,7 @@ class EmbeddedScene extends SceneObjectBase {
|
|
8018
7831
|
EmbeddedScene.Component = EmbeddedSceneRenderer;
|
8019
7832
|
function EmbeddedSceneRenderer({ model }) {
|
8020
7833
|
const { body, controls } = model.useState();
|
8021
|
-
const styles = ui.useStyles2(getStyles$
|
7834
|
+
const styles = ui.useStyles2(getStyles$6);
|
8022
7835
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
8023
7836
|
className: styles.container
|
8024
7837
|
}, controls && /* @__PURE__ */ React__default["default"].createElement("div", {
|
@@ -8032,7 +7845,7 @@ function EmbeddedSceneRenderer({ model }) {
|
|
8032
7845
|
model: body
|
8033
7846
|
})));
|
8034
7847
|
}
|
8035
|
-
const getStyles$
|
7848
|
+
const getStyles$6 = (theme) => {
|
8036
7849
|
return {
|
8037
7850
|
container: css.css({
|
8038
7851
|
flexGrow: 1,
|
@@ -8135,30 +7948,30 @@ function isSceneGridLayout(child) {
|
|
8135
7948
|
return child instanceof SceneGridLayout;
|
8136
7949
|
}
|
8137
7950
|
|
8138
|
-
var __defProp$
|
8139
|
-
var __getOwnPropSymbols$
|
8140
|
-
var __hasOwnProp$
|
8141
|
-
var __propIsEnum$
|
8142
|
-
var __defNormalProp$
|
8143
|
-
var __spreadValues$
|
7951
|
+
var __defProp$b = Object.defineProperty;
|
7952
|
+
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
7953
|
+
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
7954
|
+
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
7955
|
+
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
7956
|
+
var __spreadValues$b = (a, b) => {
|
8144
7957
|
for (var prop in b || (b = {}))
|
8145
|
-
if (__hasOwnProp$
|
8146
|
-
__defNormalProp$
|
8147
|
-
if (__getOwnPropSymbols$
|
8148
|
-
for (var prop of __getOwnPropSymbols$
|
8149
|
-
if (__propIsEnum$
|
8150
|
-
__defNormalProp$
|
7958
|
+
if (__hasOwnProp$b.call(b, prop))
|
7959
|
+
__defNormalProp$b(a, prop, b[prop]);
|
7960
|
+
if (__getOwnPropSymbols$b)
|
7961
|
+
for (var prop of __getOwnPropSymbols$b(b)) {
|
7962
|
+
if (__propIsEnum$b.call(b, prop))
|
7963
|
+
__defNormalProp$b(a, prop, b[prop]);
|
8151
7964
|
}
|
8152
7965
|
return a;
|
8153
7966
|
};
|
8154
7967
|
var __objRest$1 = (source, exclude) => {
|
8155
7968
|
var target = {};
|
8156
7969
|
for (var prop in source)
|
8157
|
-
if (__hasOwnProp$
|
7970
|
+
if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
|
8158
7971
|
target[prop] = source[prop];
|
8159
|
-
if (source != null && __getOwnPropSymbols$
|
8160
|
-
for (var prop of __getOwnPropSymbols$
|
8161
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
7972
|
+
if (source != null && __getOwnPropSymbols$b)
|
7973
|
+
for (var prop of __getOwnPropSymbols$b(source)) {
|
7974
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
|
8162
7975
|
target[prop] = source[prop];
|
8163
7976
|
}
|
8164
7977
|
return target;
|
@@ -8198,7 +8011,7 @@ const LazyLoader = React__default["default"].forwardRef(
|
|
8198
8011
|
}
|
8199
8012
|
};
|
8200
8013
|
});
|
8201
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$
|
8014
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$b({
|
8202
8015
|
id,
|
8203
8016
|
ref: innerRef
|
8204
8017
|
}, rest), loaded && (typeof children === "function" ? children({ isInView }) : children));
|
@@ -8216,33 +8029,33 @@ LazyLoader.observer = new IntersectionObserver(
|
|
8216
8029
|
{ rootMargin: "100px" }
|
8217
8030
|
);
|
8218
8031
|
|
8219
|
-
var __defProp$
|
8220
|
-
var __defProps$
|
8221
|
-
var __getOwnPropDescs$
|
8222
|
-
var __getOwnPropSymbols$
|
8223
|
-
var __hasOwnProp$
|
8224
|
-
var __propIsEnum$
|
8225
|
-
var __defNormalProp$
|
8226
|
-
var __spreadValues$
|
8032
|
+
var __defProp$a = Object.defineProperty;
|
8033
|
+
var __defProps$7 = Object.defineProperties;
|
8034
|
+
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
8035
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
8036
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
8037
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
8038
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
8039
|
+
var __spreadValues$a = (a, b) => {
|
8227
8040
|
for (var prop in b || (b = {}))
|
8228
|
-
if (__hasOwnProp$
|
8229
|
-
__defNormalProp$
|
8230
|
-
if (__getOwnPropSymbols$
|
8231
|
-
for (var prop of __getOwnPropSymbols$
|
8232
|
-
if (__propIsEnum$
|
8233
|
-
__defNormalProp$
|
8041
|
+
if (__hasOwnProp$a.call(b, prop))
|
8042
|
+
__defNormalProp$a(a, prop, b[prop]);
|
8043
|
+
if (__getOwnPropSymbols$a)
|
8044
|
+
for (var prop of __getOwnPropSymbols$a(b)) {
|
8045
|
+
if (__propIsEnum$a.call(b, prop))
|
8046
|
+
__defNormalProp$a(a, prop, b[prop]);
|
8234
8047
|
}
|
8235
8048
|
return a;
|
8236
8049
|
};
|
8237
|
-
var __spreadProps$
|
8050
|
+
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
8238
8051
|
var __objRest = (source, exclude) => {
|
8239
8052
|
var target = {};
|
8240
8053
|
for (var prop in source)
|
8241
|
-
if (__hasOwnProp$
|
8054
|
+
if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
|
8242
8055
|
target[prop] = source[prop];
|
8243
|
-
if (source != null && __getOwnPropSymbols$
|
8244
|
-
for (var prop of __getOwnPropSymbols$
|
8245
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
8056
|
+
if (source != null && __getOwnPropSymbols$a)
|
8057
|
+
for (var prop of __getOwnPropSymbols$a(source)) {
|
8058
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
|
8246
8059
|
target[prop] = source[prop];
|
8247
8060
|
}
|
8248
8061
|
return target;
|
@@ -8301,7 +8114,7 @@ const GridItemWrapper = React__default["default"].forwardRef((props, ref) => {
|
|
8301
8114
|
key: sceneChild.state.key
|
8302
8115
|
});
|
8303
8116
|
if (isLazy) {
|
8304
|
-
return /* @__PURE__ */ React__default["default"].createElement(LazyLoader, __spreadProps$
|
8117
|
+
return /* @__PURE__ */ React__default["default"].createElement(LazyLoader, __spreadProps$7(__spreadValues$a({}, divProps), {
|
8305
8118
|
key: sceneChild.state.key,
|
8306
8119
|
"data-griditem-key": sceneChild.state.key,
|
8307
8120
|
className: css.cx(className, props.className),
|
@@ -8309,7 +8122,7 @@ const GridItemWrapper = React__default["default"].forwardRef((props, ref) => {
|
|
8309
8122
|
ref
|
8310
8123
|
}), innerContent, children);
|
8311
8124
|
}
|
8312
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$
|
8125
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$7(__spreadValues$a({}, divProps), {
|
8313
8126
|
ref,
|
8314
8127
|
key: sceneChild.state.key,
|
8315
8128
|
"data-griditem-key": sceneChild.state.key,
|
@@ -8339,7 +8152,7 @@ function updateAnimationClass(ref, isDraggable, retry) {
|
|
8339
8152
|
const ResizeHandle = React__default["default"].forwardRef((_a, ref) => {
|
8340
8153
|
var _b = _a, divProps = __objRest(_b, ["handleAxis"]);
|
8341
8154
|
const customCssClass = ui.useStyles2(getResizeHandleStyles);
|
8342
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$
|
8155
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$7(__spreadValues$a({
|
8343
8156
|
ref
|
8344
8157
|
}, divProps), {
|
8345
8158
|
className: `${customCssClass} scene-resize-handle`
|
@@ -8379,60 +8192,60 @@ function getResizeHandleStyles(theme) {
|
|
8379
8192
|
});
|
8380
8193
|
}
|
8381
8194
|
|
8382
|
-
var __defProp$
|
8383
|
-
var __defProps$
|
8384
|
-
var __getOwnPropDescs$
|
8385
|
-
var __getOwnPropSymbols$
|
8386
|
-
var __hasOwnProp$
|
8387
|
-
var __propIsEnum$
|
8388
|
-
var __defNormalProp$
|
8389
|
-
var __spreadValues$
|
8195
|
+
var __defProp$9 = Object.defineProperty;
|
8196
|
+
var __defProps$6 = Object.defineProperties;
|
8197
|
+
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
8198
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
8199
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
8200
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
8201
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
8202
|
+
var __spreadValues$9 = (a, b) => {
|
8390
8203
|
for (var prop in b || (b = {}))
|
8391
|
-
if (__hasOwnProp$
|
8392
|
-
__defNormalProp$
|
8393
|
-
if (__getOwnPropSymbols$
|
8394
|
-
for (var prop of __getOwnPropSymbols$
|
8395
|
-
if (__propIsEnum$
|
8396
|
-
__defNormalProp$
|
8204
|
+
if (__hasOwnProp$9.call(b, prop))
|
8205
|
+
__defNormalProp$9(a, prop, b[prop]);
|
8206
|
+
if (__getOwnPropSymbols$9)
|
8207
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
8208
|
+
if (__propIsEnum$9.call(b, prop))
|
8209
|
+
__defNormalProp$9(a, prop, b[prop]);
|
8397
8210
|
}
|
8398
8211
|
return a;
|
8399
8212
|
};
|
8400
|
-
var __spreadProps$
|
8213
|
+
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
8401
8214
|
function fitPanelsInHeight(cells, height) {
|
8402
8215
|
const visibleHeight = height - GRID_CELL_VMARGIN * 4;
|
8403
8216
|
const currentGridHeight = Math.max(...cells.map((cell) => cell.h + cell.y));
|
8404
8217
|
const visibleGridHeight = Math.floor(visibleHeight / (GRID_CELL_HEIGHT + GRID_CELL_VMARGIN));
|
8405
8218
|
const scaleFactor = currentGridHeight / visibleGridHeight;
|
8406
8219
|
return cells.map((cell) => {
|
8407
|
-
return __spreadProps$
|
8220
|
+
return __spreadProps$6(__spreadValues$9({}, cell), {
|
8408
8221
|
y: Math.round(cell.y / scaleFactor) || 0,
|
8409
8222
|
h: Math.round(cell.h / scaleFactor) || 1
|
8410
8223
|
});
|
8411
8224
|
});
|
8412
8225
|
}
|
8413
8226
|
|
8414
|
-
var __defProp$
|
8415
|
-
var __defProps$
|
8416
|
-
var __getOwnPropDescs$
|
8417
|
-
var __getOwnPropSymbols$
|
8418
|
-
var __hasOwnProp$
|
8419
|
-
var __propIsEnum$
|
8420
|
-
var __defNormalProp$
|
8421
|
-
var __spreadValues$
|
8227
|
+
var __defProp$8 = Object.defineProperty;
|
8228
|
+
var __defProps$5 = Object.defineProperties;
|
8229
|
+
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
8230
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
8231
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
8232
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
8233
|
+
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
8234
|
+
var __spreadValues$8 = (a, b) => {
|
8422
8235
|
for (var prop in b || (b = {}))
|
8423
|
-
if (__hasOwnProp$
|
8424
|
-
__defNormalProp$
|
8425
|
-
if (__getOwnPropSymbols$
|
8426
|
-
for (var prop of __getOwnPropSymbols$
|
8427
|
-
if (__propIsEnum$
|
8428
|
-
__defNormalProp$
|
8236
|
+
if (__hasOwnProp$8.call(b, prop))
|
8237
|
+
__defNormalProp$8(a, prop, b[prop]);
|
8238
|
+
if (__getOwnPropSymbols$8)
|
8239
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
8240
|
+
if (__propIsEnum$8.call(b, prop))
|
8241
|
+
__defNormalProp$8(a, prop, b[prop]);
|
8429
8242
|
}
|
8430
8243
|
return a;
|
8431
8244
|
};
|
8432
|
-
var __spreadProps$
|
8245
|
+
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
8433
8246
|
const _SceneGridLayout = class extends SceneObjectBase {
|
8434
8247
|
constructor(state) {
|
8435
|
-
super(__spreadProps$
|
8248
|
+
super(__spreadProps$5(__spreadValues$8({}, state), {
|
8436
8249
|
children: sortChildrenByPosition(state.children)
|
8437
8250
|
}));
|
8438
8251
|
this._skipOnLayoutChange = false;
|
@@ -8456,7 +8269,7 @@ const _SceneGridLayout = class extends SceneObjectBase {
|
|
8456
8269
|
height: item.h
|
8457
8270
|
};
|
8458
8271
|
if (!isItemSizeEqual(child.state, nextSize)) {
|
8459
|
-
child.setState(__spreadValues$
|
8272
|
+
child.setState(__spreadValues$8({}, nextSize));
|
8460
8273
|
}
|
8461
8274
|
}
|
8462
8275
|
this.setState({ children: sortChildrenByPosition(this.state.children) });
|
@@ -8530,7 +8343,7 @@ const _SceneGridLayout = class extends SceneObjectBase {
|
|
8530
8343
|
const yDiff = firstPanelYPos - (rowY + 1);
|
8531
8344
|
let yMax = rowY;
|
8532
8345
|
for (const panel of rowChildren) {
|
8533
|
-
const newSize = __spreadValues$
|
8346
|
+
const newSize = __spreadValues$8({}, panel.state);
|
8534
8347
|
newSize.y = (_b = newSize.y) != null ? _b : rowY;
|
8535
8348
|
newSize.y -= yDiff;
|
8536
8349
|
if (newSize.y !== panel.state.y) {
|
@@ -8657,7 +8470,7 @@ const _SceneGridLayout = class extends SceneObjectBase {
|
|
8657
8470
|
}
|
8658
8471
|
if (width < 768) {
|
8659
8472
|
this._skipOnLayoutChange = true;
|
8660
|
-
return cells.map((cell) => __spreadProps$
|
8473
|
+
return cells.map((cell) => __spreadProps$5(__spreadValues$8({}, cell), { w: 24 }));
|
8661
8474
|
}
|
8662
8475
|
this._skipOnLayoutChange = false;
|
8663
8476
|
return cells;
|
@@ -8682,28 +8495,28 @@ function sortGridLayout(layout) {
|
|
8682
8495
|
return [...layout].sort((a, b) => a.y - b.y || a.x - b.x);
|
8683
8496
|
}
|
8684
8497
|
|
8685
|
-
var __defProp$
|
8686
|
-
var __defProps$
|
8687
|
-
var __getOwnPropDescs$
|
8688
|
-
var __getOwnPropSymbols$
|
8689
|
-
var __hasOwnProp$
|
8690
|
-
var __propIsEnum$
|
8691
|
-
var __defNormalProp$
|
8692
|
-
var __spreadValues$
|
8498
|
+
var __defProp$7 = Object.defineProperty;
|
8499
|
+
var __defProps$4 = Object.defineProperties;
|
8500
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
8501
|
+
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
8502
|
+
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
8503
|
+
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
8504
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
8505
|
+
var __spreadValues$7 = (a, b) => {
|
8693
8506
|
for (var prop in b || (b = {}))
|
8694
|
-
if (__hasOwnProp$
|
8695
|
-
__defNormalProp$
|
8696
|
-
if (__getOwnPropSymbols$
|
8697
|
-
for (var prop of __getOwnPropSymbols$
|
8698
|
-
if (__propIsEnum$
|
8699
|
-
__defNormalProp$
|
8507
|
+
if (__hasOwnProp$7.call(b, prop))
|
8508
|
+
__defNormalProp$7(a, prop, b[prop]);
|
8509
|
+
if (__getOwnPropSymbols$7)
|
8510
|
+
for (var prop of __getOwnPropSymbols$7(b)) {
|
8511
|
+
if (__propIsEnum$7.call(b, prop))
|
8512
|
+
__defNormalProp$7(a, prop, b[prop]);
|
8700
8513
|
}
|
8701
8514
|
return a;
|
8702
8515
|
};
|
8703
|
-
var __spreadProps$
|
8516
|
+
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
8704
8517
|
class SceneGridRow extends SceneObjectBase {
|
8705
8518
|
constructor(state) {
|
8706
|
-
super(__spreadProps$
|
8519
|
+
super(__spreadProps$4(__spreadValues$7({
|
8707
8520
|
children: state.children || [],
|
8708
8521
|
isCollapsible: state.isCollapsible || true,
|
8709
8522
|
title: state.title || ""
|
@@ -8868,7 +8681,7 @@ NestedScene.Component = NestedSceneRenderer;
|
|
8868
8681
|
function NestedSceneRenderer({ model }) {
|
8869
8682
|
const { title, isCollapsed, canCollapse, canRemove, body, controls } = model.useState();
|
8870
8683
|
const gridRow = ui.useStyles2(getSceneGridRowStyles);
|
8871
|
-
const styles = ui.useStyles2(getStyles$
|
8684
|
+
const styles = ui.useStyles2(getStyles$5);
|
8872
8685
|
const toolbarControls = (controls != null ? controls : []).map((action) => /* @__PURE__ */ React__default["default"].createElement(action.Component, {
|
8873
8686
|
key: action.state.key,
|
8874
8687
|
model: action
|
@@ -8903,7 +8716,7 @@ function NestedSceneRenderer({ model }) {
|
|
8903
8716
|
model: body
|
8904
8717
|
}));
|
8905
8718
|
}
|
8906
|
-
const getStyles$
|
8719
|
+
const getStyles$5 = (theme) => ({
|
8907
8720
|
wrapper: css.css({
|
8908
8721
|
display: "flex",
|
8909
8722
|
flexDirection: "column",
|
@@ -9070,30 +8883,30 @@ function getShiftedTimeRange(dir, timeRange, upperLimit) {
|
|
9070
8883
|
};
|
9071
8884
|
}
|
9072
8885
|
|
9073
|
-
var __defProp$
|
9074
|
-
var __defProps$
|
9075
|
-
var __getOwnPropDescs$
|
9076
|
-
var __getOwnPropSymbols$
|
9077
|
-
var __hasOwnProp$
|
9078
|
-
var __propIsEnum$
|
9079
|
-
var __defNormalProp$
|
9080
|
-
var __spreadValues$
|
8886
|
+
var __defProp$6 = Object.defineProperty;
|
8887
|
+
var __defProps$3 = Object.defineProperties;
|
8888
|
+
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
8889
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
8890
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
8891
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
8892
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
8893
|
+
var __spreadValues$6 = (a, b) => {
|
9081
8894
|
for (var prop in b || (b = {}))
|
9082
|
-
if (__hasOwnProp$
|
9083
|
-
__defNormalProp$
|
9084
|
-
if (__getOwnPropSymbols$
|
9085
|
-
for (var prop of __getOwnPropSymbols$
|
9086
|
-
if (__propIsEnum$
|
9087
|
-
__defNormalProp$
|
8895
|
+
if (__hasOwnProp$6.call(b, prop))
|
8896
|
+
__defNormalProp$6(a, prop, b[prop]);
|
8897
|
+
if (__getOwnPropSymbols$6)
|
8898
|
+
for (var prop of __getOwnPropSymbols$6(b)) {
|
8899
|
+
if (__propIsEnum$6.call(b, prop))
|
8900
|
+
__defNormalProp$6(a, prop, b[prop]);
|
9088
8901
|
}
|
9089
8902
|
return a;
|
9090
8903
|
};
|
9091
|
-
var __spreadProps$
|
8904
|
+
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
9092
8905
|
const DEFAULT_INTERVALS = ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"];
|
9093
8906
|
class SceneRefreshPicker extends SceneObjectBase {
|
9094
8907
|
constructor(state) {
|
9095
8908
|
var _a, _b, _c;
|
9096
|
-
super(__spreadProps$
|
8909
|
+
super(__spreadProps$3(__spreadValues$6({
|
9097
8910
|
refresh: ""
|
9098
8911
|
}, state), {
|
9099
8912
|
autoValue: void 0,
|
@@ -9225,6 +9038,234 @@ function useQueryControllerState(model) {
|
|
9225
9038
|
return queryController.useState().isRunning;
|
9226
9039
|
}
|
9227
9040
|
|
9041
|
+
const getCompareSeriesRefId = (refId) => `${refId}-compare`;
|
9042
|
+
|
9043
|
+
var __defProp$5 = Object.defineProperty;
|
9044
|
+
var __defProps$2 = Object.defineProperties;
|
9045
|
+
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
9046
|
+
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
9047
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
9048
|
+
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
9049
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
9050
|
+
var __spreadValues$5 = (a, b) => {
|
9051
|
+
for (var prop in b || (b = {}))
|
9052
|
+
if (__hasOwnProp$5.call(b, prop))
|
9053
|
+
__defNormalProp$5(a, prop, b[prop]);
|
9054
|
+
if (__getOwnPropSymbols$5)
|
9055
|
+
for (var prop of __getOwnPropSymbols$5(b)) {
|
9056
|
+
if (__propIsEnum$5.call(b, prop))
|
9057
|
+
__defNormalProp$5(a, prop, b[prop]);
|
9058
|
+
}
|
9059
|
+
return a;
|
9060
|
+
};
|
9061
|
+
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
9062
|
+
const PREVIOUS_PERIOD_VALUE = "__previousPeriod";
|
9063
|
+
const NO_PERIOD_VALUE = "__noPeriod";
|
9064
|
+
const PREVIOUS_PERIOD_COMPARE_OPTION = {
|
9065
|
+
label: "Previous period",
|
9066
|
+
value: PREVIOUS_PERIOD_VALUE
|
9067
|
+
};
|
9068
|
+
const NO_COMPARE_OPTION = {
|
9069
|
+
label: "No comparison",
|
9070
|
+
value: NO_PERIOD_VALUE
|
9071
|
+
};
|
9072
|
+
const DEFAULT_COMPARE_OPTIONS = [
|
9073
|
+
{ label: "Day before", value: "24h" },
|
9074
|
+
{ label: "Week before", value: "1w" },
|
9075
|
+
{ label: "Month before", value: "1M" }
|
9076
|
+
];
|
9077
|
+
class SceneTimeRangeCompare extends SceneObjectBase {
|
9078
|
+
constructor(state) {
|
9079
|
+
super(__spreadValues$5({ compareOptions: DEFAULT_COMPARE_OPTIONS }, state));
|
9080
|
+
this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["compareWith"] });
|
9081
|
+
this._onActivate = () => {
|
9082
|
+
const sceneTimeRange = sceneGraph.getTimeRange(this);
|
9083
|
+
this.setState({ compareOptions: this.getCompareOptions(sceneTimeRange.state.value) });
|
9084
|
+
this._subs.add(
|
9085
|
+
sceneTimeRange.subscribeToState((timeRange) => {
|
9086
|
+
const compareOptions = this.getCompareOptions(timeRange.value);
|
9087
|
+
const stateUpdate = { compareOptions };
|
9088
|
+
if (Boolean(this.state.compareWith) && !compareOptions.find(({ value }) => value === this.state.compareWith)) {
|
9089
|
+
stateUpdate.compareWith = PREVIOUS_PERIOD_VALUE;
|
9090
|
+
}
|
9091
|
+
this.setState(stateUpdate);
|
9092
|
+
})
|
9093
|
+
);
|
9094
|
+
};
|
9095
|
+
this.getCompareOptions = (timeRange) => {
|
9096
|
+
const diffDays = Math.ceil(timeRange.to.diff(timeRange.from));
|
9097
|
+
const matchIndex = DEFAULT_COMPARE_OPTIONS.findIndex(({ value }) => {
|
9098
|
+
const intervalInMs = data.rangeUtil.intervalToMs(value);
|
9099
|
+
return intervalInMs >= diffDays;
|
9100
|
+
});
|
9101
|
+
return [
|
9102
|
+
NO_COMPARE_OPTION,
|
9103
|
+
PREVIOUS_PERIOD_COMPARE_OPTION,
|
9104
|
+
...DEFAULT_COMPARE_OPTIONS.slice(matchIndex).map(({ label, value }) => ({ label, value }))
|
9105
|
+
];
|
9106
|
+
};
|
9107
|
+
this.onCompareWithChanged = (compareWith) => {
|
9108
|
+
if (compareWith === NO_PERIOD_VALUE) {
|
9109
|
+
this.onClearCompare();
|
9110
|
+
} else {
|
9111
|
+
this.setState({ compareWith });
|
9112
|
+
}
|
9113
|
+
};
|
9114
|
+
this.onClearCompare = () => {
|
9115
|
+
this.setState({ compareWith: void 0 });
|
9116
|
+
};
|
9117
|
+
this.addActivationHandler(this._onActivate);
|
9118
|
+
}
|
9119
|
+
getExtraQueries(request) {
|
9120
|
+
const extraQueries = [];
|
9121
|
+
const compareRange = this.getCompareTimeRange(request.range);
|
9122
|
+
if (!compareRange) {
|
9123
|
+
return extraQueries;
|
9124
|
+
}
|
9125
|
+
const targets = request.targets.filter((query) => query.timeRangeCompare !== false);
|
9126
|
+
if (targets.length) {
|
9127
|
+
extraQueries.push({
|
9128
|
+
req: __spreadProps$2(__spreadValues$5({}, request), {
|
9129
|
+
targets,
|
9130
|
+
range: compareRange
|
9131
|
+
}),
|
9132
|
+
processor: timeShiftAlignmentProcessor
|
9133
|
+
});
|
9134
|
+
}
|
9135
|
+
return extraQueries;
|
9136
|
+
}
|
9137
|
+
shouldRerun(prev, next) {
|
9138
|
+
return prev.compareWith !== next.compareWith;
|
9139
|
+
}
|
9140
|
+
getCompareTimeRange(timeRange) {
|
9141
|
+
let compareFrom;
|
9142
|
+
let compareTo;
|
9143
|
+
if (this.state.compareWith) {
|
9144
|
+
if (this.state.compareWith === PREVIOUS_PERIOD_VALUE) {
|
9145
|
+
const diffMs = timeRange.to.diff(timeRange.from);
|
9146
|
+
compareFrom = data.dateTime(timeRange.from).subtract(diffMs);
|
9147
|
+
compareTo = data.dateTime(timeRange.to).subtract(diffMs);
|
9148
|
+
} else {
|
9149
|
+
compareFrom = data.dateTime(timeRange.from).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
|
9150
|
+
compareTo = data.dateTime(timeRange.to).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
|
9151
|
+
}
|
9152
|
+
return {
|
9153
|
+
from: compareFrom,
|
9154
|
+
to: compareTo,
|
9155
|
+
raw: {
|
9156
|
+
from: compareFrom,
|
9157
|
+
to: compareTo
|
9158
|
+
}
|
9159
|
+
};
|
9160
|
+
}
|
9161
|
+
return void 0;
|
9162
|
+
}
|
9163
|
+
getUrlState() {
|
9164
|
+
return {
|
9165
|
+
compareWith: this.state.compareWith
|
9166
|
+
};
|
9167
|
+
}
|
9168
|
+
updateFromUrl(values) {
|
9169
|
+
if (!values.compareWith) {
|
9170
|
+
return;
|
9171
|
+
}
|
9172
|
+
const compareWith = parseUrlParam(values.compareWith);
|
9173
|
+
if (compareWith) {
|
9174
|
+
const compareOptions = this.getCompareOptions(sceneGraph.getTimeRange(this).state.value);
|
9175
|
+
if (compareOptions.find(({ value }) => value === compareWith)) {
|
9176
|
+
this.setState({
|
9177
|
+
compareWith
|
9178
|
+
});
|
9179
|
+
} else {
|
9180
|
+
this.setState({
|
9181
|
+
compareWith: "__previousPeriod"
|
9182
|
+
});
|
9183
|
+
}
|
9184
|
+
}
|
9185
|
+
}
|
9186
|
+
}
|
9187
|
+
SceneTimeRangeCompare.Component = SceneTimeRangeCompareRenderer;
|
9188
|
+
const timeShiftAlignmentProcessor = (primary, secondary) => {
|
9189
|
+
const diff = secondary.timeRange.from.diff(primary.timeRange.from);
|
9190
|
+
secondary.series.forEach((series) => {
|
9191
|
+
series.refId = getCompareSeriesRefId(series.refId || "");
|
9192
|
+
series.meta = __spreadProps$2(__spreadValues$5({}, series.meta), {
|
9193
|
+
timeCompare: {
|
9194
|
+
diffMs: diff,
|
9195
|
+
isTimeShiftQuery: true
|
9196
|
+
}
|
9197
|
+
});
|
9198
|
+
series.fields.forEach((field) => {
|
9199
|
+
if (field.type === data.FieldType.time) {
|
9200
|
+
field.values = field.values.map((v) => {
|
9201
|
+
return diff < 0 ? v - diff : v + diff;
|
9202
|
+
});
|
9203
|
+
}
|
9204
|
+
field.config = __spreadProps$2(__spreadValues$5({}, field.config), {
|
9205
|
+
color: {
|
9206
|
+
mode: "fixed",
|
9207
|
+
fixedColor: runtime.config.theme.palette.gray60
|
9208
|
+
}
|
9209
|
+
});
|
9210
|
+
return field;
|
9211
|
+
});
|
9212
|
+
});
|
9213
|
+
return rxjs.of(secondary);
|
9214
|
+
};
|
9215
|
+
function SceneTimeRangeCompareRenderer({ model }) {
|
9216
|
+
var _a;
|
9217
|
+
const styles = ui.useStyles2(getStyles$4);
|
9218
|
+
const { compareWith, compareOptions } = model.useState();
|
9219
|
+
const [previousCompare, setPreviousCompare] = React__default["default"].useState(compareWith);
|
9220
|
+
const previousValue = (_a = compareOptions.find(({ value: value2 }) => value2 === previousCompare)) != null ? _a : PREVIOUS_PERIOD_COMPARE_OPTION;
|
9221
|
+
const value = compareOptions.find(({ value: value2 }) => value2 === compareWith);
|
9222
|
+
const enabled = Boolean(value);
|
9223
|
+
const onClick = () => {
|
9224
|
+
if (enabled) {
|
9225
|
+
setPreviousCompare(compareWith);
|
9226
|
+
model.onClearCompare();
|
9227
|
+
} else if (!enabled) {
|
9228
|
+
model.onCompareWithChanged(previousValue.value);
|
9229
|
+
}
|
9230
|
+
};
|
9231
|
+
return /* @__PURE__ */ React__default["default"].createElement(ui.ButtonGroup, null, /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
|
9232
|
+
variant: "canvas",
|
9233
|
+
tooltip: "Enable time frame comparison",
|
9234
|
+
onClick: (e) => {
|
9235
|
+
e.stopPropagation();
|
9236
|
+
e.preventDefault();
|
9237
|
+
onClick();
|
9238
|
+
}
|
9239
|
+
}, /* @__PURE__ */ React__default["default"].createElement(ui.Checkbox, {
|
9240
|
+
label: " ",
|
9241
|
+
value: enabled,
|
9242
|
+
onClick
|
9243
|
+
}), "Comparison"), enabled ? /* @__PURE__ */ React__default["default"].createElement(ui.ButtonSelect, {
|
9244
|
+
variant: "canvas",
|
9245
|
+
value,
|
9246
|
+
options: compareOptions,
|
9247
|
+
onChange: (v) => {
|
9248
|
+
model.onCompareWithChanged(v.value);
|
9249
|
+
}
|
9250
|
+
}) : /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
|
9251
|
+
className: styles.previewButton,
|
9252
|
+
disabled: true,
|
9253
|
+
variant: "canvas",
|
9254
|
+
isOpen: false
|
9255
|
+
}, previousValue.label));
|
9256
|
+
}
|
9257
|
+
function getStyles$4(theme) {
|
9258
|
+
return {
|
9259
|
+
previewButton: css.css({
|
9260
|
+
"&:disabled": {
|
9261
|
+
border: `1px solid ${theme.colors.secondary.border}`,
|
9262
|
+
color: theme.colors.text.disabled,
|
9263
|
+
opacity: 1
|
9264
|
+
}
|
9265
|
+
})
|
9266
|
+
};
|
9267
|
+
}
|
9268
|
+
|
9228
9269
|
class SceneByFrameRepeater extends SceneObjectBase {
|
9229
9270
|
constructor(state) {
|
9230
9271
|
super(state);
|