@grafana/scenes 4.26.1--canary.770.9381823391.0 → 4.26.1--canary.734.9384160424.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -0
- package/dist/esm/components/SceneTimeRangeCompare.js +55 -1
- package/dist/esm/components/SceneTimeRangeCompare.js.map +1 -1
- package/dist/esm/components/VizPanel/VizPanel.js +3 -0
- package/dist/esm/components/VizPanel/VizPanel.js.map +1 -1
- package/dist/esm/core/PanelBuilders/VizConfigBuilder.js +78 -0
- package/dist/esm/core/PanelBuilders/VizConfigBuilder.js.map +1 -0
- package/dist/esm/core/PanelBuilders/VizConfigBuilders.js +114 -0
- package/dist/esm/core/PanelBuilders/VizConfigBuilders.js.map +1 -0
- package/dist/esm/core/types.js.map +1 -1
- package/dist/esm/index.js +4 -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/services/UrlSyncManager.js +5 -3
- package/dist/esm/services/UrlSyncManager.js.map +1 -1
- package/dist/esm/utils/writeSceneLog.js +5 -1
- package/dist/esm/utils/writeSceneLog.js.map +1 -1
- package/dist/esm/variables/components/VariableValueSelect.js +5 -6
- package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
- package/dist/esm/variables/utils.js.map +1 -1
- package/dist/esm/variables/variants/query/QueryVariable.js.map +1 -1
- package/dist/index.d.ts +257 -146
- package/dist/index.js +1111 -891
- package/dist/index.js.map +1 -1
- package/package.json +4 -7
- 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);
|
@@ -2071,7 +2071,11 @@ async function getDataSource(datasource, scopedVars) {
|
|
2071
2071
|
}
|
2072
2072
|
|
2073
2073
|
function writeSceneLog(logger, message, ...rest) {
|
2074
|
-
|
2074
|
+
let loggingEnabled = false;
|
2075
|
+
if (typeof window !== "undefined") {
|
2076
|
+
loggingEnabled = localStorage.getItem("grafana.debug.scenes") === "true";
|
2077
|
+
}
|
2078
|
+
if (loggingEnabled) {
|
2075
2079
|
console.log(`${logger}: `, message, ...rest);
|
2076
2080
|
}
|
2077
2081
|
}
|
@@ -2255,7 +2259,13 @@ class VariableValueRecorder {
|
|
2255
2259
|
}
|
2256
2260
|
}
|
2257
2261
|
|
2262
|
+
function isExtraQueryProvider(obj) {
|
2263
|
+
return typeof obj === "object" && "getExtraQueries" in obj;
|
2264
|
+
}
|
2265
|
+
|
2258
2266
|
var __defProp$C = Object.defineProperty;
|
2267
|
+
var __defProps$q = Object.defineProperties;
|
2268
|
+
var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
|
2259
2269
|
var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
|
2260
2270
|
var __hasOwnProp$C = Object.prototype.hasOwnProperty;
|
2261
2271
|
var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
|
@@ -2271,166 +2281,29 @@ var __spreadValues$C = (a, b) => {
|
|
2271
2281
|
}
|
2272
2282
|
return a;
|
2273
2283
|
};
|
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;
|
2284
|
+
var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
|
2285
|
+
const passthroughProcessor = (_, secondary) => rxjs.of(secondary);
|
2286
|
+
const extraQueryProcessingOperator = (processors) => (data) => {
|
2287
|
+
return data.pipe(
|
2288
|
+
rxjs.mergeMap(([primary, ...secondaries]) => {
|
2289
|
+
const processedSecondaries = secondaries.flatMap((s) => {
|
2290
|
+
var _a, _b;
|
2291
|
+
return (_b = (_a = processors.get(s.request.requestId)) == null ? void 0 : _a(primary, s)) != null ? _b : rxjs.of(s);
|
2292
|
+
});
|
2293
|
+
return rxjs.forkJoin([rxjs.of(primary), ...processedSecondaries]);
|
2294
|
+
}),
|
2295
|
+
rxjs.map(([primary, ...processedSecondaries]) => {
|
2296
|
+
var _a;
|
2297
|
+
return __spreadProps$q(__spreadValues$C({}, primary), {
|
2298
|
+
series: [...primary.series, ...processedSecondaries.flatMap((s) => s.series)],
|
2299
|
+
annotations: [...(_a = primary.annotations) != null ? _a : [], ...processedSecondaries.flatMap((s) => {
|
2300
|
+
var _a2;
|
2301
|
+
return (_a2 = s.annotations) != null ? _a2 : [];
|
2302
|
+
})]
|
2312
2303
|
});
|
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
2304
|
})
|
2430
|
-
|
2431
|
-
}
|
2432
|
-
|
2433
|
-
const getCompareSeriesRefId = (refId) => `${refId}-compare`;
|
2305
|
+
);
|
2306
|
+
};
|
2434
2307
|
|
2435
2308
|
var __defProp$B = Object.defineProperty;
|
2436
2309
|
var __defProps$p = Object.defineProperties;
|
@@ -2451,59 +2324,6 @@ var __spreadValues$B = (a, b) => {
|
|
2451
2324
|
return a;
|
2452
2325
|
};
|
2453
2326
|
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
2327
|
function filterAnnotations(data, filters) {
|
2508
2328
|
var _a;
|
2509
2329
|
if (!Array.isArray(data) || data.length === 0) {
|
@@ -2554,11 +2374,11 @@ function filterAnnotations(data, filters) {
|
|
2554
2374
|
continue;
|
2555
2375
|
}
|
2556
2376
|
}
|
2557
|
-
fields.push(__spreadProps$
|
2377
|
+
fields.push(__spreadProps$p(__spreadValues$B({}, field), {
|
2558
2378
|
values: buffer
|
2559
2379
|
}));
|
2560
2380
|
}
|
2561
|
-
processed.push(__spreadProps$
|
2381
|
+
processed.push(__spreadProps$p(__spreadValues$B({}, frame), {
|
2562
2382
|
fields,
|
2563
2383
|
length: frameLength
|
2564
2384
|
}));
|
@@ -2990,33 +2810,33 @@ function getOptionSearcher(options, includeAll, value, text) {
|
|
2990
2810
|
};
|
2991
2811
|
}
|
2992
2812
|
|
2993
|
-
var __defProp$
|
2994
|
-
var __defProps$
|
2995
|
-
var __getOwnPropDescs$
|
2996
|
-
var __getOwnPropSymbols$
|
2997
|
-
var __hasOwnProp$
|
2998
|
-
var __propIsEnum$
|
2999
|
-
var __defNormalProp$
|
3000
|
-
var __spreadValues$
|
2813
|
+
var __defProp$A = Object.defineProperty;
|
2814
|
+
var __defProps$o = Object.defineProperties;
|
2815
|
+
var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
|
2816
|
+
var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
|
2817
|
+
var __hasOwnProp$A = Object.prototype.hasOwnProperty;
|
2818
|
+
var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
|
2819
|
+
var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
2820
|
+
var __spreadValues$A = (a, b) => {
|
3001
2821
|
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$
|
2822
|
+
if (__hasOwnProp$A.call(b, prop))
|
2823
|
+
__defNormalProp$A(a, prop, b[prop]);
|
2824
|
+
if (__getOwnPropSymbols$A)
|
2825
|
+
for (var prop of __getOwnPropSymbols$A(b)) {
|
2826
|
+
if (__propIsEnum$A.call(b, prop))
|
2827
|
+
__defNormalProp$A(a, prop, b[prop]);
|
3008
2828
|
}
|
3009
2829
|
return a;
|
3010
2830
|
};
|
3011
|
-
var __spreadProps$
|
2831
|
+
var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
|
3012
2832
|
var __objRest$3 = (source, exclude) => {
|
3013
2833
|
var target = {};
|
3014
2834
|
for (var prop in source)
|
3015
|
-
if (__hasOwnProp$
|
2835
|
+
if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
|
3016
2836
|
target[prop] = source[prop];
|
3017
|
-
if (source != null && __getOwnPropSymbols$
|
3018
|
-
for (var prop of __getOwnPropSymbols$
|
3019
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
2837
|
+
if (source != null && __getOwnPropSymbols$A)
|
2838
|
+
for (var prop of __getOwnPropSymbols$A(source)) {
|
2839
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
|
3020
2840
|
target[prop] = source[prop];
|
3021
2841
|
}
|
3022
2842
|
return target;
|
@@ -3139,26 +2959,25 @@ const OptionWithCheckbox = ({
|
|
3139
2959
|
isSelected,
|
3140
2960
|
renderOptionLabel
|
3141
2961
|
}) => {
|
3142
|
-
var _b;
|
3143
2962
|
const _a = innerProps, rest = __objRest$3(_a, ["onMouseMove", "onMouseOver"]);
|
3144
2963
|
const theme = ui.useTheme2();
|
3145
2964
|
const selectStyles = ui.getSelectStyles(theme);
|
3146
2965
|
const optionStyles = ui.useStyles2(getOptionStyles);
|
3147
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$
|
2966
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$o(__spreadValues$A({
|
3148
2967
|
ref: innerRef,
|
3149
2968
|
className: css.cx(selectStyles.option, isFocused && selectStyles.optionFocused)
|
3150
2969
|
}, rest), {
|
3151
|
-
"
|
2970
|
+
"aria-label": "Select option",
|
2971
|
+
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(
|
2972
|
+
data.label || String(data.value)
|
2973
|
+
),
|
3152
2974
|
title: data.title
|
3153
2975
|
}), /* @__PURE__ */ React__default["default"].createElement("div", {
|
3154
2976
|
className: optionStyles.checkbox
|
3155
2977
|
}, /* @__PURE__ */ React__default["default"].createElement(ui.Checkbox, {
|
3156
2978
|
value: isSelected
|
3157
2979
|
})), /* @__PURE__ */ React__default["default"].createElement("div", {
|
3158
|
-
className: selectStyles.optionBody
|
3159
|
-
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(
|
3160
|
-
(_b = data.label) != null ? _b : String(data.value)
|
3161
|
-
)
|
2980
|
+
className: selectStyles.optionBody
|
3162
2981
|
}, /* @__PURE__ */ React__default["default"].createElement("span", null, children)));
|
3163
2982
|
};
|
3164
2983
|
OptionWithCheckbox.displayName = "SelectMenuOptions";
|
@@ -3238,28 +3057,28 @@ function fromUrlValues(urlValues) {
|
|
3238
3057
|
);
|
3239
3058
|
}
|
3240
3059
|
|
3241
|
-
var __defProp$
|
3242
|
-
var __defProps$
|
3243
|
-
var __getOwnPropDescs$
|
3244
|
-
var __getOwnPropSymbols$
|
3245
|
-
var __hasOwnProp$
|
3246
|
-
var __propIsEnum$
|
3247
|
-
var __defNormalProp$
|
3248
|
-
var __spreadValues$
|
3060
|
+
var __defProp$z = Object.defineProperty;
|
3061
|
+
var __defProps$n = Object.defineProperties;
|
3062
|
+
var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
|
3063
|
+
var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
|
3064
|
+
var __hasOwnProp$z = Object.prototype.hasOwnProperty;
|
3065
|
+
var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
|
3066
|
+
var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
3067
|
+
var __spreadValues$z = (a, b) => {
|
3249
3068
|
for (var prop in b || (b = {}))
|
3250
|
-
if (__hasOwnProp$
|
3251
|
-
__defNormalProp$
|
3252
|
-
if (__getOwnPropSymbols$
|
3253
|
-
for (var prop of __getOwnPropSymbols$
|
3254
|
-
if (__propIsEnum$
|
3255
|
-
__defNormalProp$
|
3069
|
+
if (__hasOwnProp$z.call(b, prop))
|
3070
|
+
__defNormalProp$z(a, prop, b[prop]);
|
3071
|
+
if (__getOwnPropSymbols$z)
|
3072
|
+
for (var prop of __getOwnPropSymbols$z(b)) {
|
3073
|
+
if (__propIsEnum$z.call(b, prop))
|
3074
|
+
__defNormalProp$z(a, prop, b[prop]);
|
3256
3075
|
}
|
3257
3076
|
return a;
|
3258
3077
|
};
|
3259
|
-
var __spreadProps$
|
3078
|
+
var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
|
3260
3079
|
class GroupByVariable extends MultiValueVariable {
|
3261
3080
|
constructor(initialState) {
|
3262
|
-
super(__spreadProps$
|
3081
|
+
super(__spreadProps$n(__spreadValues$z({
|
3263
3082
|
isMulti: true,
|
3264
3083
|
name: "",
|
3265
3084
|
value: [],
|
@@ -3458,7 +3277,7 @@ function LoadingIndicator(props) {
|
|
3458
3277
|
}
|
3459
3278
|
|
3460
3279
|
function ControlsLabel(props) {
|
3461
|
-
const styles = ui.useStyles2(getStyles$
|
3280
|
+
const styles = ui.useStyles2(getStyles$9);
|
3462
3281
|
const theme = ui.useTheme2();
|
3463
3282
|
const isVertical = props.layout === "vertical";
|
3464
3283
|
const loadingIndicator = Boolean(props.isLoading) ? /* @__PURE__ */ React__default["default"].createElement("div", {
|
@@ -3521,7 +3340,7 @@ function ControlsLabel(props) {
|
|
3521
3340
|
}
|
3522
3341
|
return labelElement;
|
3523
3342
|
}
|
3524
|
-
const getStyles$
|
3343
|
+
const getStyles$9 = (theme) => ({
|
3525
3344
|
horizontalLabel: css.css({
|
3526
3345
|
background: theme.isDark ? theme.colors.background.primary : theme.colors.background.secondary,
|
3527
3346
|
display: `flex`,
|
@@ -3564,7 +3383,7 @@ function keyLabelToOption(key, label) {
|
|
3564
3383
|
}
|
3565
3384
|
function AdHocFilterRenderer({ filter, model }) {
|
3566
3385
|
var _a, _b;
|
3567
|
-
const styles = ui.useStyles2(getStyles$
|
3386
|
+
const styles = ui.useStyles2(getStyles$8);
|
3568
3387
|
const [keys, setKeys] = React.useState([]);
|
3569
3388
|
const [values, setValues] = React.useState([]);
|
3570
3389
|
const [isKeysLoading, setIsKeysLoading] = React.useState(false);
|
@@ -3669,7 +3488,7 @@ function AdHocFilterRenderer({ filter, model }) {
|
|
3669
3488
|
onClick: () => model._removeFilter(filter)
|
3670
3489
|
}));
|
3671
3490
|
}
|
3672
|
-
const getStyles$
|
3491
|
+
const getStyles$8 = (theme) => ({
|
3673
3492
|
field: css.css({
|
3674
3493
|
marginBottom: 0
|
3675
3494
|
}),
|
@@ -3807,29 +3626,29 @@ function isFilter(filter) {
|
|
3807
3626
|
return filter !== null && typeof filter.key === "string" && typeof filter.value === "string";
|
3808
3627
|
}
|
3809
3628
|
|
3810
|
-
var __defProp$
|
3811
|
-
var __defProps$
|
3812
|
-
var __getOwnPropDescs$
|
3813
|
-
var __getOwnPropSymbols$
|
3814
|
-
var __hasOwnProp$
|
3815
|
-
var __propIsEnum$
|
3816
|
-
var __defNormalProp$
|
3817
|
-
var __spreadValues$
|
3629
|
+
var __defProp$y = Object.defineProperty;
|
3630
|
+
var __defProps$m = Object.defineProperties;
|
3631
|
+
var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
|
3632
|
+
var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
|
3633
|
+
var __hasOwnProp$y = Object.prototype.hasOwnProperty;
|
3634
|
+
var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
|
3635
|
+
var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
3636
|
+
var __spreadValues$y = (a, b) => {
|
3818
3637
|
for (var prop in b || (b = {}))
|
3819
|
-
if (__hasOwnProp$
|
3820
|
-
__defNormalProp$
|
3821
|
-
if (__getOwnPropSymbols$
|
3822
|
-
for (var prop of __getOwnPropSymbols$
|
3823
|
-
if (__propIsEnum$
|
3824
|
-
__defNormalProp$
|
3638
|
+
if (__hasOwnProp$y.call(b, prop))
|
3639
|
+
__defNormalProp$y(a, prop, b[prop]);
|
3640
|
+
if (__getOwnPropSymbols$y)
|
3641
|
+
for (var prop of __getOwnPropSymbols$y(b)) {
|
3642
|
+
if (__propIsEnum$y.call(b, prop))
|
3643
|
+
__defNormalProp$y(a, prop, b[prop]);
|
3825
3644
|
}
|
3826
3645
|
return a;
|
3827
3646
|
};
|
3828
|
-
var __spreadProps$
|
3647
|
+
var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
|
3829
3648
|
class AdHocFiltersVariable extends SceneObjectBase {
|
3830
3649
|
constructor(state) {
|
3831
3650
|
var _a, _b;
|
3832
|
-
super(__spreadValues$
|
3651
|
+
super(__spreadValues$y({
|
3833
3652
|
type: "adhoc",
|
3834
3653
|
name: (_a = state.name) != null ? _a : "Filters",
|
3835
3654
|
filters: [],
|
@@ -3866,15 +3685,15 @@ class AdHocFiltersVariable extends SceneObjectBase {
|
|
3866
3685
|
const propLabelKey = `${prop}Label`;
|
3867
3686
|
if (filter === _wip) {
|
3868
3687
|
if (prop === "value") {
|
3869
|
-
this.setState({ filters: [...filters, __spreadProps$
|
3688
|
+
this.setState({ filters: [...filters, __spreadProps$m(__spreadValues$y({}, _wip), { [prop]: value, [propLabelKey]: label })], _wip: void 0 });
|
3870
3689
|
} else {
|
3871
|
-
this.setState({ _wip: __spreadProps$
|
3690
|
+
this.setState({ _wip: __spreadProps$m(__spreadValues$y({}, filter), { [prop]: value, [propLabelKey]: label }) });
|
3872
3691
|
}
|
3873
3692
|
return;
|
3874
3693
|
}
|
3875
3694
|
const updatedFilters = this.state.filters.map((f) => {
|
3876
3695
|
if (f === filter) {
|
3877
|
-
const updatedFilter = __spreadProps$
|
3696
|
+
const updatedFilter = __spreadProps$m(__spreadValues$y({}, f), { [prop]: value, [propLabelKey]: label });
|
3878
3697
|
if (prop === "key" && filter[prop] !== value) {
|
3879
3698
|
updatedFilter.value = "";
|
3880
3699
|
updatedFilter.valueLabel = "";
|
@@ -3955,7 +3774,7 @@ function renderExpression(builder, filters) {
|
|
3955
3774
|
}
|
3956
3775
|
function AdHocFiltersVariableRenderer({ model }) {
|
3957
3776
|
const { filters, readOnly, addFilterButtonText } = model.useState();
|
3958
|
-
const styles = ui.useStyles2(getStyles$
|
3777
|
+
const styles = ui.useStyles2(getStyles$7);
|
3959
3778
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
3960
3779
|
className: styles.wrapper
|
3961
3780
|
}, filters.map((filter, index) => /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, {
|
@@ -3969,7 +3788,7 @@ function AdHocFiltersVariableRenderer({ model }) {
|
|
3969
3788
|
addFilterButtonText
|
3970
3789
|
}));
|
3971
3790
|
}
|
3972
|
-
const getStyles$
|
3791
|
+
const getStyles$7 = (theme) => ({
|
3973
3792
|
wrapper: css.css({
|
3974
3793
|
display: "flex",
|
3975
3794
|
flexWrap: "wrap",
|
@@ -4053,25 +3872,25 @@ function areDifferentLayers(a, b) {
|
|
4053
3872
|
return false;
|
4054
3873
|
}
|
4055
3874
|
|
4056
|
-
var __defProp$
|
4057
|
-
var __defProps$
|
4058
|
-
var __getOwnPropDescs$
|
4059
|
-
var __getOwnPropSymbols$
|
4060
|
-
var __hasOwnProp$
|
4061
|
-
var __propIsEnum$
|
4062
|
-
var __defNormalProp$
|
4063
|
-
var __spreadValues$
|
3875
|
+
var __defProp$x = Object.defineProperty;
|
3876
|
+
var __defProps$l = Object.defineProperties;
|
3877
|
+
var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
|
3878
|
+
var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
|
3879
|
+
var __hasOwnProp$x = Object.prototype.hasOwnProperty;
|
3880
|
+
var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
|
3881
|
+
var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
3882
|
+
var __spreadValues$x = (a, b) => {
|
4064
3883
|
for (var prop in b || (b = {}))
|
4065
|
-
if (__hasOwnProp$
|
4066
|
-
__defNormalProp$
|
4067
|
-
if (__getOwnPropSymbols$
|
4068
|
-
for (var prop of __getOwnPropSymbols$
|
4069
|
-
if (__propIsEnum$
|
4070
|
-
__defNormalProp$
|
3884
|
+
if (__hasOwnProp$x.call(b, prop))
|
3885
|
+
__defNormalProp$x(a, prop, b[prop]);
|
3886
|
+
if (__getOwnPropSymbols$x)
|
3887
|
+
for (var prop of __getOwnPropSymbols$x(b)) {
|
3888
|
+
if (__propIsEnum$x.call(b, prop))
|
3889
|
+
__defNormalProp$x(a, prop, b[prop]);
|
4071
3890
|
}
|
4072
3891
|
return a;
|
4073
3892
|
};
|
4074
|
-
var __spreadProps$
|
3893
|
+
var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
|
4075
3894
|
let counter$1 = 100;
|
4076
3895
|
function getNextRequestId$1() {
|
4077
3896
|
return "SQR" + counter$1++;
|
@@ -4088,70 +3907,6 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4088
3907
|
onVariableUpdateCompleted: this.onVariableUpdatesCompleted.bind(this),
|
4089
3908
|
onAnyVariableChanged: this.onAnyVariableChanged.bind(this)
|
4090
3909
|
});
|
4091
|
-
this.prepareRequests = (timeRange, ds) => {
|
4092
|
-
const comparer = this.getTimeCompare();
|
4093
|
-
const { minInterval, queries } = this.state;
|
4094
|
-
let secondaryRequest;
|
4095
|
-
let request = __spreadValues$w({
|
4096
|
-
app: "scenes",
|
4097
|
-
requestId: getNextRequestId$1(),
|
4098
|
-
timezone: timeRange.getTimeZone(),
|
4099
|
-
panelId: 1,
|
4100
|
-
range: timeRange.state.value,
|
4101
|
-
interval: "1s",
|
4102
|
-
intervalMs: 1e3,
|
4103
|
-
targets: lodash.cloneDeep(queries),
|
4104
|
-
maxDataPoints: this.getMaxDataPoints(),
|
4105
|
-
scopedVars: this._scopedVars,
|
4106
|
-
startTime: Date.now(),
|
4107
|
-
liveStreaming: this.state.liveStreaming,
|
4108
|
-
rangeRaw: {
|
4109
|
-
from: timeRange.state.from,
|
4110
|
-
to: timeRange.state.to
|
4111
|
-
},
|
4112
|
-
cacheTimeout: this.state.cacheTimeout,
|
4113
|
-
queryCachingTTL: this.state.queryCachingTTL
|
4114
|
-
}, getEnrichedDataRequest(this));
|
4115
|
-
if (this._adhocFiltersVar) {
|
4116
|
-
request.filters = this._adhocFiltersVar.state.filters.filter(isFilterComplete);
|
4117
|
-
}
|
4118
|
-
if (this._groupByVar) {
|
4119
|
-
request.groupByKeys = this._groupByVar.state.value;
|
4120
|
-
}
|
4121
|
-
request.targets = request.targets.map((query) => {
|
4122
|
-
var _a;
|
4123
|
-
if (!query.datasource || query.datasource.uid !== ds.uid && !((_a = ds.meta) == null ? void 0 : _a.mixed) && runtime.isExpressionReference && !runtime.isExpressionReference(query.datasource)) {
|
4124
|
-
query.datasource = ds.getRef();
|
4125
|
-
}
|
4126
|
-
return query;
|
4127
|
-
});
|
4128
|
-
const lowerIntervalLimit = minInterval ? minInterval : ds.interval;
|
4129
|
-
const norm = data.rangeUtil.calculateInterval(timeRange.state.value, request.maxDataPoints, lowerIntervalLimit);
|
4130
|
-
request.scopedVars = Object.assign({}, request.scopedVars, {
|
4131
|
-
__interval: { text: norm.interval, value: norm.interval },
|
4132
|
-
__interval_ms: { text: norm.intervalMs.toString(), value: norm.intervalMs }
|
4133
|
-
});
|
4134
|
-
request.interval = norm.interval;
|
4135
|
-
request.intervalMs = norm.intervalMs;
|
4136
|
-
const primaryTimeRange = timeRange.state.value;
|
4137
|
-
if (comparer) {
|
4138
|
-
const secondaryTimeRange = comparer.getCompareTimeRange(primaryTimeRange);
|
4139
|
-
if (secondaryTimeRange) {
|
4140
|
-
const secondaryTargets = request.targets.filter((query) => query.timeRangeCompare !== false);
|
4141
|
-
if (secondaryTargets.length) {
|
4142
|
-
secondaryRequest = __spreadProps$k(__spreadValues$w({}, request), {
|
4143
|
-
targets: secondaryTargets,
|
4144
|
-
range: secondaryTimeRange,
|
4145
|
-
requestId: getNextRequestId$1()
|
4146
|
-
});
|
4147
|
-
}
|
4148
|
-
request = __spreadProps$k(__spreadValues$w({}, request), {
|
4149
|
-
range: primaryTimeRange
|
4150
|
-
});
|
4151
|
-
}
|
4152
|
-
}
|
4153
|
-
return [request, secondaryRequest];
|
4154
|
-
};
|
4155
3910
|
this.onDataReceived = (data$1) => {
|
4156
3911
|
const preProcessedData = data.preProcessPanelData(data$1, this.state.data);
|
4157
3912
|
this._resultAnnotations = data$1.annotations;
|
@@ -4170,11 +3925,11 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4170
3925
|
}
|
4171
3926
|
_onActivate() {
|
4172
3927
|
const timeRange = sceneGraph.getTimeRange(this);
|
4173
|
-
const
|
4174
|
-
|
3928
|
+
const providers = this.getClosestExtraQueryProviders();
|
3929
|
+
for (const provider of providers) {
|
4175
3930
|
this._subs.add(
|
4176
|
-
|
4177
|
-
if (
|
3931
|
+
provider.subscribeToState((n, p) => {
|
3932
|
+
if (provider.shouldRerun(p, n)) {
|
4178
3933
|
this.runQueries();
|
4179
3934
|
}
|
4180
3935
|
})
|
@@ -4233,9 +3988,9 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4233
3988
|
return;
|
4234
3989
|
}
|
4235
3990
|
this._layerAnnotations = annotations;
|
4236
|
-
const baseStateUpdate = this.state.data ? this.state.data : __spreadProps$
|
3991
|
+
const baseStateUpdate = this.state.data ? this.state.data : __spreadProps$l(__spreadValues$x({}, emptyPanelData), { timeRange: timeRange.state.value });
|
4237
3992
|
this.setState({
|
4238
|
-
data: __spreadProps$
|
3993
|
+
data: __spreadProps$l(__spreadValues$x({}, baseStateUpdate), {
|
4239
3994
|
annotations: [...(_d = this._resultAnnotations) != null ? _d : [], ...annotations],
|
4240
3995
|
alertState: alertState != null ? alertState : (_e = this.state.data) == null ? void 0 : _e.alertState
|
4241
3996
|
})
|
@@ -4354,7 +4109,7 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4354
4109
|
this._dataLayersSub = void 0;
|
4355
4110
|
}
|
4356
4111
|
this.setState({
|
4357
|
-
data: __spreadProps$
|
4112
|
+
data: __spreadProps$l(__spreadValues$x({}, this.state.data), { state: schema.LoadingState.Done })
|
4358
4113
|
});
|
4359
4114
|
}
|
4360
4115
|
async runWithTimeRange(timeRange) {
|
@@ -4380,16 +4135,18 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4380
4135
|
const ds = await getDataSource(datasource, this._scopedVars);
|
4381
4136
|
this.findAndSubscribeToAdHocFilters(datasource == null ? void 0 : datasource.uid);
|
4382
4137
|
const runRequest = runtime.getRunRequest();
|
4383
|
-
const
|
4138
|
+
const { primary, secondaries, processors } = this.prepareRequests(timeRange, ds);
|
4384
4139
|
writeSceneLog("SceneQueryRunner", "Starting runRequest", this.state.key);
|
4385
|
-
let stream = runRequest(ds,
|
4386
|
-
if (
|
4387
|
-
|
4140
|
+
let stream = runRequest(ds, primary);
|
4141
|
+
if (secondaries.length > 0) {
|
4142
|
+
const secondaryStreams = secondaries.map((r) => runRequest(ds, r));
|
4143
|
+
const op = extraQueryProcessingOperator(processors);
|
4144
|
+
stream = rxjs.forkJoin([stream, ...secondaryStreams]).pipe(op);
|
4388
4145
|
}
|
4389
4146
|
stream = stream.pipe(
|
4390
4147
|
registerQueryWithController({
|
4391
4148
|
type: "data",
|
4392
|
-
request,
|
4149
|
+
request: primary,
|
4393
4150
|
origin: this,
|
4394
4151
|
cancel: () => this.cancelQuery()
|
4395
4152
|
})
|
@@ -4397,7 +4154,7 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4397
4154
|
this._querySub = stream.subscribe(this.onDataReceived);
|
4398
4155
|
} catch (err) {
|
4399
4156
|
console.error("PanelQueryRunner Error", err);
|
4400
|
-
this.onDataReceived(__spreadProps$
|
4157
|
+
this.onDataReceived(__spreadProps$l(__spreadValues$x(__spreadValues$x({}, emptyPanelData), this.state.data), {
|
4401
4158
|
state: schema.LoadingState.Error,
|
4402
4159
|
errors: [runtime.toDataQueryError(err)]
|
4403
4160
|
}));
|
@@ -4407,16 +4164,73 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4407
4164
|
var _a;
|
4408
4165
|
const clone = super.clone(withState);
|
4409
4166
|
if (this._resultAnnotations) {
|
4410
|
-
clone["_resultAnnotations"] = this._resultAnnotations.map((frame) => __spreadValues$
|
4167
|
+
clone["_resultAnnotations"] = this._resultAnnotations.map((frame) => __spreadValues$x({}, frame));
|
4411
4168
|
}
|
4412
4169
|
if (this._layerAnnotations) {
|
4413
|
-
clone["_layerAnnotations"] = this._layerAnnotations.map((frame) => __spreadValues$
|
4170
|
+
clone["_layerAnnotations"] = this._layerAnnotations.map((frame) => __spreadValues$x({}, frame));
|
4414
4171
|
}
|
4415
4172
|
clone["_variableValueRecorder"] = this._variableValueRecorder.cloneAndRecordCurrentValuesForSceneObject(this);
|
4416
4173
|
clone["_containerWidth"] = this._containerWidth;
|
4417
4174
|
clone["_results"].next({ origin: this, data: (_a = this.state.data) != null ? _a : emptyPanelData });
|
4418
4175
|
return clone;
|
4419
4176
|
}
|
4177
|
+
prepareRequests(timeRange, ds) {
|
4178
|
+
var _a;
|
4179
|
+
const { minInterval, queries } = this.state;
|
4180
|
+
let request = __spreadValues$x({
|
4181
|
+
app: "scenes",
|
4182
|
+
requestId: getNextRequestId$1(),
|
4183
|
+
timezone: timeRange.getTimeZone(),
|
4184
|
+
panelId: 1,
|
4185
|
+
range: timeRange.state.value,
|
4186
|
+
interval: "1s",
|
4187
|
+
intervalMs: 1e3,
|
4188
|
+
targets: lodash.cloneDeep(queries),
|
4189
|
+
maxDataPoints: this.getMaxDataPoints(),
|
4190
|
+
scopedVars: this._scopedVars,
|
4191
|
+
startTime: Date.now(),
|
4192
|
+
liveStreaming: this.state.liveStreaming,
|
4193
|
+
rangeRaw: {
|
4194
|
+
from: timeRange.state.from,
|
4195
|
+
to: timeRange.state.to
|
4196
|
+
},
|
4197
|
+
cacheTimeout: this.state.cacheTimeout,
|
4198
|
+
queryCachingTTL: this.state.queryCachingTTL
|
4199
|
+
}, getEnrichedDataRequest(this));
|
4200
|
+
if (this._adhocFiltersVar) {
|
4201
|
+
request.filters = this._adhocFiltersVar.state.filters.filter(isFilterComplete);
|
4202
|
+
}
|
4203
|
+
if (this._groupByVar) {
|
4204
|
+
request.groupByKeys = this._groupByVar.state.value;
|
4205
|
+
}
|
4206
|
+
request.targets = request.targets.map((query) => {
|
4207
|
+
var _a2;
|
4208
|
+
if (!query.datasource || query.datasource.uid !== ds.uid && !((_a2 = ds.meta) == null ? void 0 : _a2.mixed) && runtime.isExpressionReference && !runtime.isExpressionReference(query.datasource)) {
|
4209
|
+
query.datasource = ds.getRef();
|
4210
|
+
}
|
4211
|
+
return query;
|
4212
|
+
});
|
4213
|
+
const lowerIntervalLimit = minInterval ? minInterval : ds.interval;
|
4214
|
+
const norm = data.rangeUtil.calculateInterval(timeRange.state.value, request.maxDataPoints, lowerIntervalLimit);
|
4215
|
+
request.scopedVars = Object.assign({}, request.scopedVars, {
|
4216
|
+
__interval: { text: norm.interval, value: norm.interval },
|
4217
|
+
__interval_ms: { text: norm.intervalMs.toString(), value: norm.intervalMs }
|
4218
|
+
});
|
4219
|
+
request.interval = norm.interval;
|
4220
|
+
request.intervalMs = norm.intervalMs;
|
4221
|
+
const primaryTimeRange = timeRange.state.value;
|
4222
|
+
let secondaryRequests = [];
|
4223
|
+
let secondaryProcessors = /* @__PURE__ */ new Map();
|
4224
|
+
for (const provider of (_a = this.getClosestExtraQueryProviders()) != null ? _a : []) {
|
4225
|
+
for (const { req, processor } of provider.getExtraQueries(request)) {
|
4226
|
+
const requestId = getNextRequestId$1();
|
4227
|
+
secondaryRequests.push(__spreadProps$l(__spreadValues$x({}, req), { requestId }));
|
4228
|
+
secondaryProcessors.set(requestId, processor != null ? processor : passthroughProcessor);
|
4229
|
+
}
|
4230
|
+
}
|
4231
|
+
request.range = primaryTimeRange;
|
4232
|
+
return { primary: request, secondaries: secondaryRequests, processors: secondaryProcessors };
|
4233
|
+
}
|
4420
4234
|
_combineDataLayers(data) {
|
4421
4235
|
if (this._layerAnnotations && this._layerAnnotations.length > 0) {
|
4422
4236
|
data.annotations = (data.annotations || []).concat(this._layerAnnotations);
|
@@ -4431,22 +4245,23 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4431
4245
|
this.setState({ data: emptyPanelData });
|
4432
4246
|
}
|
4433
4247
|
}
|
4434
|
-
|
4248
|
+
getClosestExtraQueryProviders() {
|
4249
|
+
const found = /* @__PURE__ */ new Map();
|
4435
4250
|
if (!this.parent) {
|
4436
|
-
return
|
4251
|
+
return [];
|
4437
4252
|
}
|
4438
|
-
|
4439
|
-
|
4440
|
-
|
4441
|
-
return s;
|
4253
|
+
getClosest(this.parent, (s) => {
|
4254
|
+
if (isExtraQueryProvider(s) && !found.has(s.constructor)) {
|
4255
|
+
found.set(s.constructor, s);
|
4442
4256
|
}
|
4443
4257
|
s.forEachChild((child) => {
|
4444
|
-
if (child
|
4445
|
-
found
|
4258
|
+
if (isExtraQueryProvider(child) && !found.has(child.constructor)) {
|
4259
|
+
found.set(child.constructor, child);
|
4446
4260
|
}
|
4447
4261
|
});
|
4448
|
-
return
|
4262
|
+
return null;
|
4449
4263
|
});
|
4264
|
+
return Array.from(found.values());
|
4450
4265
|
}
|
4451
4266
|
findAndSubscribeToAdHocFilters(uid) {
|
4452
4267
|
const filtersVar = findActiveAdHocFilterVariableByUid(uid);
|
@@ -4645,28 +4460,28 @@ class ActWhenVariableChanged extends SceneObjectBase {
|
|
4645
4460
|
}
|
4646
4461
|
}
|
4647
4462
|
|
4648
|
-
var __defProp$
|
4649
|
-
var __defProps$
|
4650
|
-
var __getOwnPropDescs$
|
4651
|
-
var __getOwnPropSymbols$
|
4652
|
-
var __hasOwnProp$
|
4653
|
-
var __propIsEnum$
|
4654
|
-
var __defNormalProp$
|
4655
|
-
var __spreadValues$
|
4463
|
+
var __defProp$w = Object.defineProperty;
|
4464
|
+
var __defProps$k = Object.defineProperties;
|
4465
|
+
var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
|
4466
|
+
var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
|
4467
|
+
var __hasOwnProp$w = Object.prototype.hasOwnProperty;
|
4468
|
+
var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
|
4469
|
+
var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
4470
|
+
var __spreadValues$w = (a, b) => {
|
4656
4471
|
for (var prop in b || (b = {}))
|
4657
|
-
if (__hasOwnProp$
|
4658
|
-
__defNormalProp$
|
4659
|
-
if (__getOwnPropSymbols$
|
4660
|
-
for (var prop of __getOwnPropSymbols$
|
4661
|
-
if (__propIsEnum$
|
4662
|
-
__defNormalProp$
|
4472
|
+
if (__hasOwnProp$w.call(b, prop))
|
4473
|
+
__defNormalProp$w(a, prop, b[prop]);
|
4474
|
+
if (__getOwnPropSymbols$w)
|
4475
|
+
for (var prop of __getOwnPropSymbols$w(b)) {
|
4476
|
+
if (__propIsEnum$w.call(b, prop))
|
4477
|
+
__defNormalProp$w(a, prop, b[prop]);
|
4663
4478
|
}
|
4664
4479
|
return a;
|
4665
4480
|
};
|
4666
|
-
var __spreadProps$
|
4481
|
+
var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
|
4667
4482
|
class CursorSync extends SceneObjectBase {
|
4668
4483
|
constructor(state) {
|
4669
|
-
super(__spreadProps$
|
4484
|
+
super(__spreadProps$k(__spreadValues$w({}, state), {
|
4670
4485
|
sync: state.sync || schema.DashboardCursorSync.Off
|
4671
4486
|
}));
|
4672
4487
|
this.getEventsBus = (panel) => {
|
@@ -4930,25 +4745,25 @@ const getAlertStateStyles = (theme) => {
|
|
4930
4745
|
};
|
4931
4746
|
};
|
4932
4747
|
|
4933
|
-
var __defProp$
|
4934
|
-
var __defProps$
|
4935
|
-
var __getOwnPropDescs$
|
4936
|
-
var __getOwnPropSymbols$
|
4937
|
-
var __hasOwnProp$
|
4938
|
-
var __propIsEnum$
|
4939
|
-
var __defNormalProp$
|
4940
|
-
var __spreadValues$
|
4748
|
+
var __defProp$v = Object.defineProperty;
|
4749
|
+
var __defProps$j = Object.defineProperties;
|
4750
|
+
var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
|
4751
|
+
var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
|
4752
|
+
var __hasOwnProp$v = Object.prototype.hasOwnProperty;
|
4753
|
+
var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
|
4754
|
+
var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
4755
|
+
var __spreadValues$v = (a, b) => {
|
4941
4756
|
for (var prop in b || (b = {}))
|
4942
|
-
if (__hasOwnProp$
|
4943
|
-
__defNormalProp$
|
4944
|
-
if (__getOwnPropSymbols$
|
4945
|
-
for (var prop of __getOwnPropSymbols$
|
4946
|
-
if (__propIsEnum$
|
4947
|
-
__defNormalProp$
|
4757
|
+
if (__hasOwnProp$v.call(b, prop))
|
4758
|
+
__defNormalProp$v(a, prop, b[prop]);
|
4759
|
+
if (__getOwnPropSymbols$v)
|
4760
|
+
for (var prop of __getOwnPropSymbols$v(b)) {
|
4761
|
+
if (__propIsEnum$v.call(b, prop))
|
4762
|
+
__defNormalProp$v(a, prop, b[prop]);
|
4948
4763
|
}
|
4949
4764
|
return a;
|
4950
4765
|
};
|
4951
|
-
var __spreadProps$
|
4766
|
+
var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
|
4952
4767
|
const displayOverrideRef = "hideSeriesFrom";
|
4953
4768
|
const isHideSeriesOverride = data.isSystemOverrideWithRef(displayOverrideRef);
|
4954
4769
|
function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
|
@@ -4958,13 +4773,13 @@ function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
|
|
4958
4773
|
if (currentIndex < 0) {
|
4959
4774
|
if (mode === ui.SeriesVisibilityChangeMode.ToggleSelection) {
|
4960
4775
|
const override3 = createOverride$1([displayName, ...getNamesOfHiddenFields(overrides, data)]);
|
4961
|
-
return __spreadProps$
|
4776
|
+
return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
|
4962
4777
|
overrides: [...fieldConfig.overrides, override3]
|
4963
4778
|
});
|
4964
4779
|
}
|
4965
4780
|
const displayNames = getDisplayNames(data, displayName);
|
4966
4781
|
const override2 = createOverride$1(displayNames);
|
4967
|
-
return __spreadProps$
|
4782
|
+
return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
|
4968
4783
|
overrides: [...fieldConfig.overrides, override2]
|
4969
4784
|
});
|
4970
4785
|
}
|
@@ -4977,22 +4792,22 @@ function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
|
|
4977
4792
|
existing = existing.filter((el) => nameOfHiddenFields.indexOf(el) < 0);
|
4978
4793
|
}
|
4979
4794
|
if (existing[0] === displayName && existing.length === 1) {
|
4980
|
-
return __spreadProps$
|
4795
|
+
return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
|
4981
4796
|
overrides: overridesCopy
|
4982
4797
|
});
|
4983
4798
|
}
|
4984
4799
|
const override2 = createOverride$1([displayName, ...nameOfHiddenFields]);
|
4985
|
-
return __spreadProps$
|
4800
|
+
return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
|
4986
4801
|
overrides: [...overridesCopy, override2]
|
4987
4802
|
});
|
4988
4803
|
}
|
4989
4804
|
const override = createExtendedOverride(current, displayName);
|
4990
4805
|
if (allFieldsAreExcluded(override, data)) {
|
4991
|
-
return __spreadProps$
|
4806
|
+
return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
|
4992
4807
|
overrides: overridesCopy
|
4993
4808
|
});
|
4994
4809
|
}
|
4995
|
-
return __spreadProps$
|
4810
|
+
return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
|
4996
4811
|
overrides: [...overridesCopy, override]
|
4997
4812
|
});
|
4998
4813
|
}
|
@@ -5017,7 +4832,7 @@ function createOverride$1(names, mode = data.ByNamesMatcherMode.exclude, propert
|
|
5017
4832
|
}
|
5018
4833
|
},
|
5019
4834
|
properties: [
|
5020
|
-
__spreadProps$
|
4835
|
+
__spreadProps$j(__spreadValues$v({}, property), {
|
5021
4836
|
value: {
|
5022
4837
|
viz: true,
|
5023
4838
|
legend: false,
|
@@ -5089,32 +4904,32 @@ const getNamesOfHiddenFields = (overrides, data$1) => {
|
|
5089
4904
|
return names;
|
5090
4905
|
};
|
5091
4906
|
|
5092
|
-
var __defProp$
|
5093
|
-
var __defProps$
|
5094
|
-
var __getOwnPropDescs$
|
5095
|
-
var __getOwnPropSymbols$
|
5096
|
-
var __hasOwnProp$
|
5097
|
-
var __propIsEnum$
|
5098
|
-
var __defNormalProp$
|
5099
|
-
var __spreadValues$
|
4907
|
+
var __defProp$u = Object.defineProperty;
|
4908
|
+
var __defProps$i = Object.defineProperties;
|
4909
|
+
var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
|
4910
|
+
var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
|
4911
|
+
var __hasOwnProp$u = Object.prototype.hasOwnProperty;
|
4912
|
+
var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
|
4913
|
+
var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
4914
|
+
var __spreadValues$u = (a, b) => {
|
5100
4915
|
for (var prop in b || (b = {}))
|
5101
|
-
if (__hasOwnProp$
|
5102
|
-
__defNormalProp$
|
5103
|
-
if (__getOwnPropSymbols$
|
5104
|
-
for (var prop of __getOwnPropSymbols$
|
5105
|
-
if (__propIsEnum$
|
5106
|
-
__defNormalProp$
|
4916
|
+
if (__hasOwnProp$u.call(b, prop))
|
4917
|
+
__defNormalProp$u(a, prop, b[prop]);
|
4918
|
+
if (__getOwnPropSymbols$u)
|
4919
|
+
for (var prop of __getOwnPropSymbols$u(b)) {
|
4920
|
+
if (__propIsEnum$u.call(b, prop))
|
4921
|
+
__defNormalProp$u(a, prop, b[prop]);
|
5107
4922
|
}
|
5108
4923
|
return a;
|
5109
4924
|
};
|
5110
|
-
var __spreadProps$
|
4925
|
+
var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
|
5111
4926
|
const changeSeriesColorConfigFactory = (label, color, fieldConfig) => {
|
5112
4927
|
const { overrides } = fieldConfig;
|
5113
4928
|
const currentIndex = fieldConfig.overrides.findIndex((override) => {
|
5114
4929
|
return override.matcher.id === data.FieldMatcherID.byName && override.matcher.options === label;
|
5115
4930
|
});
|
5116
4931
|
if (currentIndex < 0) {
|
5117
|
-
return __spreadProps$
|
4932
|
+
return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
|
5118
4933
|
overrides: [...fieldConfig.overrides, createOverride(label, color)]
|
5119
4934
|
});
|
5120
4935
|
}
|
@@ -5122,19 +4937,19 @@ const changeSeriesColorConfigFactory = (label, color, fieldConfig) => {
|
|
5122
4937
|
const existing = overridesCopy[currentIndex];
|
5123
4938
|
const propertyIndex = existing.properties.findIndex((p) => p.id === "color");
|
5124
4939
|
if (propertyIndex < 0) {
|
5125
|
-
overridesCopy[currentIndex] = __spreadProps$
|
4940
|
+
overridesCopy[currentIndex] = __spreadProps$i(__spreadValues$u({}, existing), {
|
5126
4941
|
properties: [...existing.properties, createProperty(color)]
|
5127
4942
|
});
|
5128
|
-
return __spreadProps$
|
4943
|
+
return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
|
5129
4944
|
overrides: overridesCopy
|
5130
4945
|
});
|
5131
4946
|
}
|
5132
4947
|
const propertiesCopy = Array.from(existing.properties);
|
5133
4948
|
propertiesCopy[propertyIndex] = createProperty(color);
|
5134
|
-
overridesCopy[currentIndex] = __spreadProps$
|
4949
|
+
overridesCopy[currentIndex] = __spreadProps$i(__spreadValues$u({}, existing), {
|
5135
4950
|
properties: propertiesCopy
|
5136
4951
|
});
|
5137
|
-
return __spreadProps$
|
4952
|
+
return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
|
5138
4953
|
overrides: overridesCopy
|
5139
4954
|
});
|
5140
4955
|
};
|
@@ -5157,29 +4972,29 @@ const createProperty = (color) => {
|
|
5157
4972
|
};
|
5158
4973
|
};
|
5159
4974
|
|
5160
|
-
var __defProp$
|
5161
|
-
var __defProps$
|
5162
|
-
var __getOwnPropDescs$
|
5163
|
-
var __getOwnPropSymbols$
|
5164
|
-
var __hasOwnProp$
|
5165
|
-
var __propIsEnum$
|
5166
|
-
var __defNormalProp$
|
5167
|
-
var __spreadValues$
|
4975
|
+
var __defProp$t = Object.defineProperty;
|
4976
|
+
var __defProps$h = Object.defineProperties;
|
4977
|
+
var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
|
4978
|
+
var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
|
4979
|
+
var __hasOwnProp$t = Object.prototype.hasOwnProperty;
|
4980
|
+
var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
|
4981
|
+
var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
4982
|
+
var __spreadValues$t = (a, b) => {
|
5168
4983
|
for (var prop in b || (b = {}))
|
5169
|
-
if (__hasOwnProp$
|
5170
|
-
__defNormalProp$
|
5171
|
-
if (__getOwnPropSymbols$
|
5172
|
-
for (var prop of __getOwnPropSymbols$
|
5173
|
-
if (__propIsEnum$
|
5174
|
-
__defNormalProp$
|
4984
|
+
if (__hasOwnProp$t.call(b, prop))
|
4985
|
+
__defNormalProp$t(a, prop, b[prop]);
|
4986
|
+
if (__getOwnPropSymbols$t)
|
4987
|
+
for (var prop of __getOwnPropSymbols$t(b)) {
|
4988
|
+
if (__propIsEnum$t.call(b, prop))
|
4989
|
+
__defNormalProp$t(a, prop, b[prop]);
|
5175
4990
|
}
|
5176
4991
|
return a;
|
5177
4992
|
};
|
5178
|
-
var __spreadProps$
|
4993
|
+
var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
|
5179
4994
|
class VizPanel extends SceneObjectBase {
|
5180
4995
|
constructor(state) {
|
5181
4996
|
var _a;
|
5182
|
-
super(__spreadValues$
|
4997
|
+
super(__spreadValues$t({
|
5183
4998
|
options: {},
|
5184
4999
|
fieldConfig: { defaults: {}, overrides: [] },
|
5185
5000
|
title: "Title",
|
@@ -5292,7 +5107,7 @@ class VizPanel extends SceneObjectBase {
|
|
5292
5107
|
};
|
5293
5108
|
this._onInstanceStateChange = (state) => {
|
5294
5109
|
if (this._panelContext) {
|
5295
|
-
this._panelContext = __spreadProps$
|
5110
|
+
this._panelContext = __spreadProps$h(__spreadValues$t({}, this._panelContext), {
|
5296
5111
|
instanceState: state
|
5297
5112
|
});
|
5298
5113
|
}
|
@@ -5316,8 +5131,8 @@ class VizPanel extends SceneObjectBase {
|
|
5316
5131
|
sortBy = sortKey;
|
5317
5132
|
}
|
5318
5133
|
this.onOptionsChange(
|
5319
|
-
__spreadProps$
|
5320
|
-
legend: __spreadProps$
|
5134
|
+
__spreadProps$h(__spreadValues$t({}, this.state.options), {
|
5135
|
+
legend: __spreadProps$h(__spreadValues$t({}, legendOptions), { sortBy, sortDesc })
|
5321
5136
|
}),
|
5322
5137
|
true
|
5323
5138
|
);
|
@@ -5401,6 +5216,9 @@ class VizPanel extends SceneObjectBase {
|
|
5401
5216
|
(_a = this._panelContext) != null ? _a : this._panelContext = this.buildPanelContext();
|
5402
5217
|
return this._panelContext;
|
5403
5218
|
}
|
5219
|
+
clearFieldConfigCache() {
|
5220
|
+
this._dataWithFieldConfig = void 0;
|
5221
|
+
}
|
5404
5222
|
applyFieldConfig(rawData) {
|
5405
5223
|
var _a, _b, _c, _d;
|
5406
5224
|
const plugin = this._plugin;
|
@@ -5424,7 +5242,7 @@ class VizPanel extends SceneObjectBase {
|
|
5424
5242
|
if (!data.compareArrayValues(newFrames, prevFrames, data.compareDataFrameStructures)) {
|
5425
5243
|
this._structureRev++;
|
5426
5244
|
}
|
5427
|
-
this._dataWithFieldConfig = __spreadProps$
|
5245
|
+
this._dataWithFieldConfig = __spreadProps$h(__spreadValues$t({}, rawData), {
|
5428
5246
|
structureRev: this._structureRev,
|
5429
5247
|
series: newFrames
|
5430
5248
|
});
|
@@ -5567,25 +5385,25 @@ function getMessageFromError(err) {
|
|
5567
5385
|
return JSON.stringify(err);
|
5568
5386
|
}
|
5569
5387
|
|
5570
|
-
var __defProp$
|
5571
|
-
var __getOwnPropSymbols$
|
5572
|
-
var __hasOwnProp$
|
5573
|
-
var __propIsEnum$
|
5574
|
-
var __defNormalProp$
|
5575
|
-
var __spreadValues$
|
5388
|
+
var __defProp$s = Object.defineProperty;
|
5389
|
+
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
5390
|
+
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
5391
|
+
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
5392
|
+
var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
5393
|
+
var __spreadValues$s = (a, b) => {
|
5576
5394
|
for (var prop in b || (b = {}))
|
5577
|
-
if (__hasOwnProp$
|
5578
|
-
__defNormalProp$
|
5579
|
-
if (__getOwnPropSymbols$
|
5580
|
-
for (var prop of __getOwnPropSymbols$
|
5581
|
-
if (__propIsEnum$
|
5582
|
-
__defNormalProp$
|
5395
|
+
if (__hasOwnProp$s.call(b, prop))
|
5396
|
+
__defNormalProp$s(a, prop, b[prop]);
|
5397
|
+
if (__getOwnPropSymbols$s)
|
5398
|
+
for (var prop of __getOwnPropSymbols$s(b)) {
|
5399
|
+
if (__propIsEnum$s.call(b, prop))
|
5400
|
+
__defNormalProp$s(a, prop, b[prop]);
|
5583
5401
|
}
|
5584
5402
|
return a;
|
5585
5403
|
};
|
5586
5404
|
class SceneDataLayerBase extends SceneObjectBase {
|
5587
5405
|
constructor(initialState, variableDependencyStatePaths = []) {
|
5588
|
-
super(__spreadValues$
|
5406
|
+
super(__spreadValues$s({
|
5589
5407
|
isEnabled: true
|
5590
5408
|
}, initialState));
|
5591
5409
|
this._results = new rxjs.ReplaySubject(1);
|
@@ -5707,33 +5525,33 @@ function DataLayerControlSwitch({ layer }) {
|
|
5707
5525
|
}
|
5708
5526
|
const containerStyle$1 = css.css({ display: "flex" });
|
5709
5527
|
|
5710
|
-
var __defProp$
|
5711
|
-
var __defProps$
|
5712
|
-
var __getOwnPropDescs$
|
5713
|
-
var __getOwnPropSymbols$
|
5714
|
-
var __hasOwnProp$
|
5715
|
-
var __propIsEnum$
|
5716
|
-
var __defNormalProp$
|
5717
|
-
var __spreadValues$
|
5528
|
+
var __defProp$r = Object.defineProperty;
|
5529
|
+
var __defProps$g = Object.defineProperties;
|
5530
|
+
var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
|
5531
|
+
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
5532
|
+
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
5533
|
+
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
5534
|
+
var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
5535
|
+
var __spreadValues$r = (a, b) => {
|
5718
5536
|
for (var prop in b || (b = {}))
|
5719
|
-
if (__hasOwnProp$
|
5720
|
-
__defNormalProp$
|
5721
|
-
if (__getOwnPropSymbols$
|
5722
|
-
for (var prop of __getOwnPropSymbols$
|
5723
|
-
if (__propIsEnum$
|
5724
|
-
__defNormalProp$
|
5537
|
+
if (__hasOwnProp$r.call(b, prop))
|
5538
|
+
__defNormalProp$r(a, prop, b[prop]);
|
5539
|
+
if (__getOwnPropSymbols$r)
|
5540
|
+
for (var prop of __getOwnPropSymbols$r(b)) {
|
5541
|
+
if (__propIsEnum$r.call(b, prop))
|
5542
|
+
__defNormalProp$r(a, prop, b[prop]);
|
5725
5543
|
}
|
5726
5544
|
return a;
|
5727
5545
|
};
|
5728
|
-
var __spreadProps$
|
5546
|
+
var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
|
5729
5547
|
var __objRest$2 = (source, exclude) => {
|
5730
5548
|
var target = {};
|
5731
5549
|
for (var prop in source)
|
5732
|
-
if (__hasOwnProp$
|
5550
|
+
if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
|
5733
5551
|
target[prop] = source[prop];
|
5734
|
-
if (source != null && __getOwnPropSymbols$
|
5735
|
-
for (var prop of __getOwnPropSymbols$
|
5736
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
5552
|
+
if (source != null && __getOwnPropSymbols$r)
|
5553
|
+
for (var prop of __getOwnPropSymbols$r(source)) {
|
5554
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
|
5737
5555
|
target[prop] = source[prop];
|
5738
5556
|
}
|
5739
5557
|
return target;
|
@@ -5742,7 +5560,7 @@ const standardAnnotationSupport = {
|
|
5742
5560
|
prepareAnnotation: (json) => {
|
5743
5561
|
if (lodash.isString(json == null ? void 0 : json.query)) {
|
5744
5562
|
const _a = json, { query } = _a, rest = __objRest$2(_a, ["query"]);
|
5745
|
-
return __spreadProps$
|
5563
|
+
return __spreadProps$g(__spreadValues$r({}, rest), {
|
5746
5564
|
target: {
|
5747
5565
|
refId: "annotation_query",
|
5748
5566
|
query
|
@@ -5910,25 +5728,25 @@ function shouldUseLegacyRunner(datasource) {
|
|
5910
5728
|
return !datasource.annotations || legacyRunner.includes(type);
|
5911
5729
|
}
|
5912
5730
|
|
5913
|
-
var __defProp$
|
5914
|
-
var __defProps$
|
5915
|
-
var __getOwnPropDescs$
|
5916
|
-
var __getOwnPropSymbols$
|
5917
|
-
var __hasOwnProp$
|
5918
|
-
var __propIsEnum$
|
5919
|
-
var __defNormalProp$
|
5920
|
-
var __spreadValues$
|
5731
|
+
var __defProp$q = Object.defineProperty;
|
5732
|
+
var __defProps$f = Object.defineProperties;
|
5733
|
+
var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
|
5734
|
+
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
5735
|
+
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
5736
|
+
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
5737
|
+
var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
5738
|
+
var __spreadValues$q = (a, b) => {
|
5921
5739
|
for (var prop in b || (b = {}))
|
5922
|
-
if (__hasOwnProp$
|
5923
|
-
__defNormalProp$
|
5924
|
-
if (__getOwnPropSymbols$
|
5925
|
-
for (var prop of __getOwnPropSymbols$
|
5926
|
-
if (__propIsEnum$
|
5927
|
-
__defNormalProp$
|
5740
|
+
if (__hasOwnProp$q.call(b, prop))
|
5741
|
+
__defNormalProp$q(a, prop, b[prop]);
|
5742
|
+
if (__getOwnPropSymbols$q)
|
5743
|
+
for (var prop of __getOwnPropSymbols$q(b)) {
|
5744
|
+
if (__propIsEnum$q.call(b, prop))
|
5745
|
+
__defNormalProp$q(a, prop, b[prop]);
|
5928
5746
|
}
|
5929
5747
|
return a;
|
5930
5748
|
};
|
5931
|
-
var __spreadProps$
|
5749
|
+
var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
|
5932
5750
|
let counter = 100;
|
5933
5751
|
function getNextRequestId() {
|
5934
5752
|
return "AQ" + counter++;
|
@@ -5951,8 +5769,8 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
|
|
5951
5769
|
}))
|
5952
5770
|
);
|
5953
5771
|
}
|
5954
|
-
const processor = __spreadValues$
|
5955
|
-
const annotationWithDefaults = __spreadValues$
|
5772
|
+
const processor = __spreadValues$q(__spreadValues$q({}, standardAnnotationSupport), datasource.annotations);
|
5773
|
+
const annotationWithDefaults = __spreadValues$q(__spreadValues$q({}, (_a = processor.getDefaultQuery) == null ? void 0 : _a.call(processor)), query);
|
5956
5774
|
const annotation = processor.prepareAnnotation(annotationWithDefaults);
|
5957
5775
|
if (!annotation) {
|
5958
5776
|
return rxjs.of({
|
@@ -5975,7 +5793,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
|
|
5975
5793
|
__annotation: { text: annotation.name, value: annotation },
|
5976
5794
|
__sceneObject: { text: "__sceneObject", value: layer }
|
5977
5795
|
};
|
5978
|
-
const queryRequest = __spreadValues$
|
5796
|
+
const queryRequest = __spreadValues$q(__spreadProps$f(__spreadValues$q({
|
5979
5797
|
startTime: Date.now(),
|
5980
5798
|
requestId: getNextRequestId(),
|
5981
5799
|
range: timeRange.state.value,
|
@@ -5985,7 +5803,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
|
|
5985
5803
|
app: data.CoreApp.Dashboard,
|
5986
5804
|
timezone: timeRange.getTimeZone(),
|
5987
5805
|
targets: [
|
5988
|
-
__spreadProps$
|
5806
|
+
__spreadProps$f(__spreadValues$q({}, processedQuery), {
|
5989
5807
|
refId: "Anno"
|
5990
5808
|
})
|
5991
5809
|
]
|
@@ -6003,7 +5821,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
|
|
6003
5821
|
data$1.forEach((frame) => {
|
6004
5822
|
var _a2;
|
6005
5823
|
if (!((_a2 = frame.meta) == null ? void 0 : _a2.dataTopic)) {
|
6006
|
-
frame.meta = __spreadProps$
|
5824
|
+
frame.meta = __spreadProps$f(__spreadValues$q({}, frame.meta || {}), { dataTopic: data.DataTopic.Annotations });
|
6007
5825
|
}
|
6008
5826
|
});
|
6009
5827
|
return processor.processEvents(annotation, data$1).pipe(
|
@@ -6018,19 +5836,19 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
|
|
6018
5836
|
);
|
6019
5837
|
}
|
6020
5838
|
|
6021
|
-
var __defProp$
|
6022
|
-
var __getOwnPropSymbols$
|
6023
|
-
var __hasOwnProp$
|
6024
|
-
var __propIsEnum$
|
6025
|
-
var __defNormalProp$
|
6026
|
-
var __spreadValues$
|
5839
|
+
var __defProp$p = Object.defineProperty;
|
5840
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
5841
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
5842
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
5843
|
+
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
5844
|
+
var __spreadValues$p = (a, b) => {
|
6027
5845
|
for (var prop in b || (b = {}))
|
6028
|
-
if (__hasOwnProp$
|
6029
|
-
__defNormalProp$
|
6030
|
-
if (__getOwnPropSymbols$
|
6031
|
-
for (var prop of __getOwnPropSymbols$
|
6032
|
-
if (__propIsEnum$
|
6033
|
-
__defNormalProp$
|
5846
|
+
if (__hasOwnProp$p.call(b, prop))
|
5847
|
+
__defNormalProp$p(a, prop, b[prop]);
|
5848
|
+
if (__getOwnPropSymbols$p)
|
5849
|
+
for (var prop of __getOwnPropSymbols$p(b)) {
|
5850
|
+
if (__propIsEnum$p.call(b, prop))
|
5851
|
+
__defNormalProp$p(a, prop, b[prop]);
|
6034
5852
|
}
|
6035
5853
|
return a;
|
6036
5854
|
};
|
@@ -6041,7 +5859,7 @@ function postProcessQueryResult(annotation, results) {
|
|
6041
5859
|
}
|
6042
5860
|
const processed = results.map((item) => {
|
6043
5861
|
var _a;
|
6044
|
-
const processedItem = __spreadValues$
|
5862
|
+
const processedItem = __spreadValues$p({}, item);
|
6045
5863
|
processedItem.source = annotation;
|
6046
5864
|
processedItem.color = runtime.config.theme2.visualization.getColorByName(annotation.iconColor);
|
6047
5865
|
processedItem.type = annotation.name;
|
@@ -6090,29 +5908,29 @@ function isPanelAlert(event) {
|
|
6090
5908
|
return event.eventType === "panel-alert";
|
6091
5909
|
}
|
6092
5910
|
|
6093
|
-
var __defProp$
|
6094
|
-
var __defProps$
|
6095
|
-
var __getOwnPropDescs$
|
6096
|
-
var __getOwnPropSymbols$
|
6097
|
-
var __hasOwnProp$
|
6098
|
-
var __propIsEnum$
|
6099
|
-
var __defNormalProp$
|
6100
|
-
var __spreadValues$
|
5911
|
+
var __defProp$o = Object.defineProperty;
|
5912
|
+
var __defProps$e = Object.defineProperties;
|
5913
|
+
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
5914
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
5915
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
5916
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
5917
|
+
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
5918
|
+
var __spreadValues$o = (a, b) => {
|
6101
5919
|
for (var prop in b || (b = {}))
|
6102
|
-
if (__hasOwnProp$
|
6103
|
-
__defNormalProp$
|
6104
|
-
if (__getOwnPropSymbols$
|
6105
|
-
for (var prop of __getOwnPropSymbols$
|
6106
|
-
if (__propIsEnum$
|
6107
|
-
__defNormalProp$
|
5920
|
+
if (__hasOwnProp$o.call(b, prop))
|
5921
|
+
__defNormalProp$o(a, prop, b[prop]);
|
5922
|
+
if (__getOwnPropSymbols$o)
|
5923
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
5924
|
+
if (__propIsEnum$o.call(b, prop))
|
5925
|
+
__defNormalProp$o(a, prop, b[prop]);
|
6108
5926
|
}
|
6109
5927
|
return a;
|
6110
5928
|
};
|
6111
|
-
var __spreadProps$
|
5929
|
+
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
6112
5930
|
class AnnotationsDataLayer extends SceneDataLayerBase {
|
6113
5931
|
constructor(initialState) {
|
6114
5932
|
super(
|
6115
|
-
__spreadValues$
|
5933
|
+
__spreadValues$o({
|
6116
5934
|
isEnabled: true
|
6117
5935
|
}, initialState),
|
6118
5936
|
["query"]
|
@@ -6160,7 +5978,7 @@ class AnnotationsDataLayer extends SceneDataLayerBase {
|
|
6160
5978
|
this.publishResults(stateUpdate);
|
6161
5979
|
});
|
6162
5980
|
} catch (e) {
|
6163
|
-
this.publishResults(__spreadProps$
|
5981
|
+
this.publishResults(__spreadProps$e(__spreadValues$o({}, emptyPanelData), {
|
6164
5982
|
state: schema.LoadingState.Error,
|
6165
5983
|
errors: [
|
6166
5984
|
{
|
@@ -6177,9 +5995,9 @@ class AnnotationsDataLayer extends SceneDataLayerBase {
|
|
6177
5995
|
processEvents(query, events) {
|
6178
5996
|
let processedEvents = postProcessQueryResult(query, events.events || []);
|
6179
5997
|
processedEvents = dedupAnnotations(processedEvents);
|
6180
|
-
const stateUpdate = __spreadProps$
|
5998
|
+
const stateUpdate = __spreadProps$e(__spreadValues$o({}, emptyPanelData), { state: events.state });
|
6181
5999
|
const df = data.arrayToDataFrame(processedEvents);
|
6182
|
-
df.meta = __spreadProps$
|
6000
|
+
df.meta = __spreadProps$e(__spreadValues$o({}, df.meta), {
|
6183
6001
|
dataTopic: data.DataTopic.Annotations
|
6184
6002
|
});
|
6185
6003
|
stateUpdate.series = [df];
|
@@ -6232,28 +6050,28 @@ class SceneTimeRangeTransformerBase extends SceneObjectBase {
|
|
6232
6050
|
}
|
6233
6051
|
}
|
6234
6052
|
|
6235
|
-
var __defProp$
|
6236
|
-
var __defProps$
|
6237
|
-
var __getOwnPropDescs$
|
6238
|
-
var __getOwnPropSymbols$
|
6239
|
-
var __hasOwnProp$
|
6240
|
-
var __propIsEnum$
|
6241
|
-
var __defNormalProp$
|
6242
|
-
var __spreadValues$
|
6053
|
+
var __defProp$n = Object.defineProperty;
|
6054
|
+
var __defProps$d = Object.defineProperties;
|
6055
|
+
var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
|
6056
|
+
var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
|
6057
|
+
var __hasOwnProp$n = Object.prototype.hasOwnProperty;
|
6058
|
+
var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
|
6059
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6060
|
+
var __spreadValues$n = (a, b) => {
|
6243
6061
|
for (var prop in b || (b = {}))
|
6244
|
-
if (__hasOwnProp$
|
6245
|
-
__defNormalProp$
|
6246
|
-
if (__getOwnPropSymbols$
|
6247
|
-
for (var prop of __getOwnPropSymbols$
|
6248
|
-
if (__propIsEnum$
|
6249
|
-
__defNormalProp$
|
6062
|
+
if (__hasOwnProp$n.call(b, prop))
|
6063
|
+
__defNormalProp$n(a, prop, b[prop]);
|
6064
|
+
if (__getOwnPropSymbols$n)
|
6065
|
+
for (var prop of __getOwnPropSymbols$n(b)) {
|
6066
|
+
if (__propIsEnum$n.call(b, prop))
|
6067
|
+
__defNormalProp$n(a, prop, b[prop]);
|
6250
6068
|
}
|
6251
6069
|
return a;
|
6252
6070
|
};
|
6253
|
-
var __spreadProps$
|
6071
|
+
var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
|
6254
6072
|
class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
|
6255
6073
|
constructor(state) {
|
6256
|
-
super(__spreadProps$
|
6074
|
+
super(__spreadProps$d(__spreadValues$n({}, state), {
|
6257
6075
|
timeZone: state.timeZone,
|
6258
6076
|
from: "now-6h",
|
6259
6077
|
to: "now",
|
@@ -6261,7 +6079,7 @@ class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
|
|
6261
6079
|
}));
|
6262
6080
|
}
|
6263
6081
|
ancestorTimeRangeChanged(timeRange) {
|
6264
|
-
this.setState(__spreadProps$
|
6082
|
+
this.setState(__spreadProps$d(__spreadValues$n({}, timeRange), {
|
6265
6083
|
timeZone: this.state.timeZone,
|
6266
6084
|
value: evaluateTimeRange(
|
6267
6085
|
timeRange.from,
|
@@ -6289,25 +6107,25 @@ class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
|
|
6289
6107
|
}
|
6290
6108
|
}
|
6291
6109
|
|
6292
|
-
var __defProp$
|
6293
|
-
var __defProps$
|
6294
|
-
var __getOwnPropDescs$
|
6295
|
-
var __getOwnPropSymbols$
|
6296
|
-
var __hasOwnProp$
|
6297
|
-
var __propIsEnum$
|
6298
|
-
var __defNormalProp$
|
6299
|
-
var __spreadValues$
|
6110
|
+
var __defProp$m = Object.defineProperty;
|
6111
|
+
var __defProps$c = Object.defineProperties;
|
6112
|
+
var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
|
6113
|
+
var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
|
6114
|
+
var __hasOwnProp$m = Object.prototype.hasOwnProperty;
|
6115
|
+
var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
|
6116
|
+
var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6117
|
+
var __spreadValues$m = (a, b) => {
|
6300
6118
|
for (var prop in b || (b = {}))
|
6301
|
-
if (__hasOwnProp$
|
6302
|
-
__defNormalProp$
|
6303
|
-
if (__getOwnPropSymbols$
|
6304
|
-
for (var prop of __getOwnPropSymbols$
|
6305
|
-
if (__propIsEnum$
|
6306
|
-
__defNormalProp$
|
6119
|
+
if (__hasOwnProp$m.call(b, prop))
|
6120
|
+
__defNormalProp$m(a, prop, b[prop]);
|
6121
|
+
if (__getOwnPropSymbols$m)
|
6122
|
+
for (var prop of __getOwnPropSymbols$m(b)) {
|
6123
|
+
if (__propIsEnum$m.call(b, prop))
|
6124
|
+
__defNormalProp$m(a, prop, b[prop]);
|
6307
6125
|
}
|
6308
6126
|
return a;
|
6309
6127
|
};
|
6310
|
-
var __spreadProps$
|
6128
|
+
var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
|
6311
6129
|
class SceneDataLayerSetBase extends SceneObjectBase {
|
6312
6130
|
constructor() {
|
6313
6131
|
super(...arguments);
|
@@ -6331,7 +6149,7 @@ class SceneDataLayerSetBase extends SceneObjectBase {
|
|
6331
6149
|
series = series.concat(result.data.series);
|
6332
6150
|
}
|
6333
6151
|
}
|
6334
|
-
const combinedData = __spreadProps$
|
6152
|
+
const combinedData = __spreadProps$c(__spreadValues$m({}, emptyPanelData), { series });
|
6335
6153
|
this._results.next({ origin: this, data: combinedData });
|
6336
6154
|
this.setStateHelper({ data: combinedData });
|
6337
6155
|
}
|
@@ -6380,25 +6198,25 @@ SceneDataLayerSet.Component = ({ model }) => {
|
|
6380
6198
|
})));
|
6381
6199
|
};
|
6382
6200
|
|
6383
|
-
var __defProp$
|
6384
|
-
var __defProps$
|
6385
|
-
var __getOwnPropDescs$
|
6386
|
-
var __getOwnPropSymbols$
|
6387
|
-
var __hasOwnProp$
|
6388
|
-
var __propIsEnum$
|
6389
|
-
var __defNormalProp$
|
6390
|
-
var __spreadValues$
|
6201
|
+
var __defProp$l = Object.defineProperty;
|
6202
|
+
var __defProps$b = Object.defineProperties;
|
6203
|
+
var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
|
6204
|
+
var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
|
6205
|
+
var __hasOwnProp$l = Object.prototype.hasOwnProperty;
|
6206
|
+
var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
|
6207
|
+
var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6208
|
+
var __spreadValues$l = (a, b) => {
|
6391
6209
|
for (var prop in b || (b = {}))
|
6392
|
-
if (__hasOwnProp$
|
6393
|
-
__defNormalProp$
|
6394
|
-
if (__getOwnPropSymbols$
|
6395
|
-
for (var prop of __getOwnPropSymbols$
|
6396
|
-
if (__propIsEnum$
|
6397
|
-
__defNormalProp$
|
6210
|
+
if (__hasOwnProp$l.call(b, prop))
|
6211
|
+
__defNormalProp$l(a, prop, b[prop]);
|
6212
|
+
if (__getOwnPropSymbols$l)
|
6213
|
+
for (var prop of __getOwnPropSymbols$l(b)) {
|
6214
|
+
if (__propIsEnum$l.call(b, prop))
|
6215
|
+
__defNormalProp$l(a, prop, b[prop]);
|
6398
6216
|
}
|
6399
6217
|
return a;
|
6400
6218
|
};
|
6401
|
-
var __spreadProps$
|
6219
|
+
var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
|
6402
6220
|
class SceneDataTransformer extends SceneObjectBase {
|
6403
6221
|
constructor(state) {
|
6404
6222
|
super(state);
|
@@ -6475,7 +6293,7 @@ class SceneDataTransformer extends SceneObjectBase {
|
|
6475
6293
|
const { series, annotations } = this._prevDataFromSource;
|
6476
6294
|
if (data.series === series && data.annotations === annotations) {
|
6477
6295
|
if (this.state.data && data.state !== this.state.data.state) {
|
6478
|
-
this.setState({ data: __spreadProps$
|
6296
|
+
this.setState({ data: __spreadProps$b(__spreadValues$l({}, this.state.data), { state: data.state }) });
|
6479
6297
|
}
|
6480
6298
|
return true;
|
6481
6299
|
}
|
@@ -6523,7 +6341,7 @@ class SceneDataTransformer extends SceneObjectBase {
|
|
6523
6341
|
rxjs.map((values) => {
|
6524
6342
|
const transformedSeries = values[0];
|
6525
6343
|
const transformedAnnotations = values[1];
|
6526
|
-
return __spreadProps$
|
6344
|
+
return __spreadProps$b(__spreadValues$l({}, data$1), {
|
6527
6345
|
series: transformedSeries,
|
6528
6346
|
annotations: transformedAnnotations != null ? transformedAnnotations : data$1.annotations
|
6529
6347
|
});
|
@@ -6534,7 +6352,7 @@ class SceneDataTransformer extends SceneObjectBase {
|
|
6534
6352
|
const sourceErr = ((_a2 = this.getSourceData().state.data) == null ? void 0 : _a2.errors) || [];
|
6535
6353
|
const transformationError = runtime.toDataQueryError(err);
|
6536
6354
|
transformationError.message = `Error transforming data: ${transformationError.message}`;
|
6537
|
-
const result = __spreadProps$
|
6355
|
+
const result = __spreadProps$b(__spreadValues$l({}, data$1), {
|
6538
6356
|
state: data.LoadingState.Error,
|
6539
6357
|
errors: [...sourceErr, transformationError]
|
6540
6358
|
});
|
@@ -6867,28 +6685,28 @@ class SceneVariableSetVariableDependencyHandler {
|
|
6867
6685
|
}
|
6868
6686
|
}
|
6869
6687
|
|
6870
|
-
var __defProp$
|
6871
|
-
var __defProps$
|
6872
|
-
var __getOwnPropDescs$
|
6873
|
-
var __getOwnPropSymbols$
|
6874
|
-
var __hasOwnProp$
|
6875
|
-
var __propIsEnum$
|
6876
|
-
var __defNormalProp$
|
6877
|
-
var __spreadValues$
|
6688
|
+
var __defProp$k = Object.defineProperty;
|
6689
|
+
var __defProps$a = Object.defineProperties;
|
6690
|
+
var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
|
6691
|
+
var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
|
6692
|
+
var __hasOwnProp$k = Object.prototype.hasOwnProperty;
|
6693
|
+
var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
|
6694
|
+
var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6695
|
+
var __spreadValues$k = (a, b) => {
|
6878
6696
|
for (var prop in b || (b = {}))
|
6879
|
-
if (__hasOwnProp$
|
6880
|
-
__defNormalProp$
|
6881
|
-
if (__getOwnPropSymbols$
|
6882
|
-
for (var prop of __getOwnPropSymbols$
|
6883
|
-
if (__propIsEnum$
|
6884
|
-
__defNormalProp$
|
6697
|
+
if (__hasOwnProp$k.call(b, prop))
|
6698
|
+
__defNormalProp$k(a, prop, b[prop]);
|
6699
|
+
if (__getOwnPropSymbols$k)
|
6700
|
+
for (var prop of __getOwnPropSymbols$k(b)) {
|
6701
|
+
if (__propIsEnum$k.call(b, prop))
|
6702
|
+
__defNormalProp$k(a, prop, b[prop]);
|
6885
6703
|
}
|
6886
6704
|
return a;
|
6887
6705
|
};
|
6888
|
-
var __spreadProps$
|
6706
|
+
var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
|
6889
6707
|
class ConstantVariable extends SceneObjectBase {
|
6890
6708
|
constructor(initialState) {
|
6891
|
-
super(__spreadProps$
|
6709
|
+
super(__spreadProps$a(__spreadValues$k({
|
6892
6710
|
type: "constant",
|
6893
6711
|
value: "",
|
6894
6712
|
name: ""
|
@@ -6901,25 +6719,25 @@ class ConstantVariable extends SceneObjectBase {
|
|
6901
6719
|
}
|
6902
6720
|
}
|
6903
6721
|
|
6904
|
-
var __defProp$
|
6905
|
-
var __getOwnPropSymbols$
|
6906
|
-
var __hasOwnProp$
|
6907
|
-
var __propIsEnum$
|
6908
|
-
var __defNormalProp$
|
6909
|
-
var __spreadValues$
|
6722
|
+
var __defProp$j = Object.defineProperty;
|
6723
|
+
var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
|
6724
|
+
var __hasOwnProp$j = Object.prototype.hasOwnProperty;
|
6725
|
+
var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
|
6726
|
+
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6727
|
+
var __spreadValues$j = (a, b) => {
|
6910
6728
|
for (var prop in b || (b = {}))
|
6911
|
-
if (__hasOwnProp$
|
6912
|
-
__defNormalProp$
|
6913
|
-
if (__getOwnPropSymbols$
|
6914
|
-
for (var prop of __getOwnPropSymbols$
|
6915
|
-
if (__propIsEnum$
|
6916
|
-
__defNormalProp$
|
6729
|
+
if (__hasOwnProp$j.call(b, prop))
|
6730
|
+
__defNormalProp$j(a, prop, b[prop]);
|
6731
|
+
if (__getOwnPropSymbols$j)
|
6732
|
+
for (var prop of __getOwnPropSymbols$j(b)) {
|
6733
|
+
if (__propIsEnum$j.call(b, prop))
|
6734
|
+
__defNormalProp$j(a, prop, b[prop]);
|
6917
6735
|
}
|
6918
6736
|
return a;
|
6919
6737
|
};
|
6920
6738
|
class CustomVariable extends MultiValueVariable {
|
6921
6739
|
constructor(initialState) {
|
6922
|
-
super(__spreadValues$
|
6740
|
+
super(__spreadValues$j({
|
6923
6741
|
type: "custom",
|
6924
6742
|
query: "",
|
6925
6743
|
value: "",
|
@@ -6953,25 +6771,25 @@ CustomVariable.Component = ({ model }) => {
|
|
6953
6771
|
return renderSelectForVariable(model);
|
6954
6772
|
};
|
6955
6773
|
|
6956
|
-
var __defProp$
|
6957
|
-
var __getOwnPropSymbols$
|
6958
|
-
var __hasOwnProp$
|
6959
|
-
var __propIsEnum$
|
6960
|
-
var __defNormalProp$
|
6961
|
-
var __spreadValues$
|
6774
|
+
var __defProp$i = Object.defineProperty;
|
6775
|
+
var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
|
6776
|
+
var __hasOwnProp$i = Object.prototype.hasOwnProperty;
|
6777
|
+
var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
|
6778
|
+
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6779
|
+
var __spreadValues$i = (a, b) => {
|
6962
6780
|
for (var prop in b || (b = {}))
|
6963
|
-
if (__hasOwnProp$
|
6964
|
-
__defNormalProp$
|
6965
|
-
if (__getOwnPropSymbols$
|
6966
|
-
for (var prop of __getOwnPropSymbols$
|
6967
|
-
if (__propIsEnum$
|
6968
|
-
__defNormalProp$
|
6781
|
+
if (__hasOwnProp$i.call(b, prop))
|
6782
|
+
__defNormalProp$i(a, prop, b[prop]);
|
6783
|
+
if (__getOwnPropSymbols$i)
|
6784
|
+
for (var prop of __getOwnPropSymbols$i(b)) {
|
6785
|
+
if (__propIsEnum$i.call(b, prop))
|
6786
|
+
__defNormalProp$i(a, prop, b[prop]);
|
6969
6787
|
}
|
6970
6788
|
return a;
|
6971
6789
|
};
|
6972
6790
|
class DataSourceVariable extends MultiValueVariable {
|
6973
6791
|
constructor(initialState) {
|
6974
|
-
super(__spreadValues$
|
6792
|
+
super(__spreadValues$i({
|
6975
6793
|
type: "datasource",
|
6976
6794
|
value: "",
|
6977
6795
|
text: "",
|
@@ -7055,25 +6873,25 @@ const hasCustomVariableSupport = (datasource) => {
|
|
7055
6873
|
return "query" in variableSupport && "editor" in variableSupport && Boolean(variableSupport.query) && Boolean(variableSupport.editor);
|
7056
6874
|
};
|
7057
6875
|
|
7058
|
-
var __defProp$
|
7059
|
-
var __defProps$
|
7060
|
-
var __getOwnPropDescs$
|
7061
|
-
var __getOwnPropSymbols$
|
7062
|
-
var __hasOwnProp$
|
7063
|
-
var __propIsEnum$
|
7064
|
-
var __defNormalProp$
|
7065
|
-
var __spreadValues$
|
6876
|
+
var __defProp$h = Object.defineProperty;
|
6877
|
+
var __defProps$9 = Object.defineProperties;
|
6878
|
+
var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
|
6879
|
+
var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
|
6880
|
+
var __hasOwnProp$h = Object.prototype.hasOwnProperty;
|
6881
|
+
var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
|
6882
|
+
var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
6883
|
+
var __spreadValues$h = (a, b) => {
|
7066
6884
|
for (var prop in b || (b = {}))
|
7067
|
-
if (__hasOwnProp$
|
7068
|
-
__defNormalProp$
|
7069
|
-
if (__getOwnPropSymbols$
|
7070
|
-
for (var prop of __getOwnPropSymbols$
|
7071
|
-
if (__propIsEnum$
|
7072
|
-
__defNormalProp$
|
6885
|
+
if (__hasOwnProp$h.call(b, prop))
|
6886
|
+
__defNormalProp$h(a, prop, b[prop]);
|
6887
|
+
if (__getOwnPropSymbols$h)
|
6888
|
+
for (var prop of __getOwnPropSymbols$h(b)) {
|
6889
|
+
if (__propIsEnum$h.call(b, prop))
|
6890
|
+
__defNormalProp$h(a, prop, b[prop]);
|
7073
6891
|
}
|
7074
6892
|
return a;
|
7075
6893
|
};
|
7076
|
-
var __spreadProps$
|
6894
|
+
var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
|
7077
6895
|
class StandardQueryRunner {
|
7078
6896
|
constructor(datasource, _runRequest = runtime.getRunRequest()) {
|
7079
6897
|
this.datasource = datasource;
|
@@ -7110,7 +6928,7 @@ class LegacyQueryRunner {
|
|
7110
6928
|
return getEmptyMetricFindValueObservable();
|
7111
6929
|
}
|
7112
6930
|
return rxjs.from(
|
7113
|
-
this.datasource.metricFindQuery(variable.state.query, __spreadProps$
|
6931
|
+
this.datasource.metricFindQuery(variable.state.query, __spreadProps$9(__spreadValues$h({}, request), {
|
7114
6932
|
variable: {
|
7115
6933
|
name: variable.state.name,
|
7116
6934
|
type: variable.state.type
|
@@ -7172,7 +6990,7 @@ function ensureVariableQueryModelIsADataQuery(variable) {
|
|
7172
6990
|
return { query, refId: `variable-${variable.state.name}` };
|
7173
6991
|
}
|
7174
6992
|
if (query.refId == null) {
|
7175
|
-
return __spreadProps$
|
6993
|
+
return __spreadProps$9(__spreadValues$h({}, query), { refId: `variable-${variable.state.name}` });
|
7176
6994
|
}
|
7177
6995
|
return variable.state.query;
|
7178
6996
|
}
|
@@ -7387,25 +7205,25 @@ function areMetricFindValues(data$1) {
|
|
7387
7205
|
return false;
|
7388
7206
|
}
|
7389
7207
|
|
7390
|
-
var __defProp$
|
7391
|
-
var __getOwnPropSymbols$
|
7392
|
-
var __hasOwnProp$
|
7393
|
-
var __propIsEnum$
|
7394
|
-
var __defNormalProp$
|
7395
|
-
var __spreadValues$
|
7208
|
+
var __defProp$g = Object.defineProperty;
|
7209
|
+
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
7210
|
+
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
7211
|
+
var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
|
7212
|
+
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
7213
|
+
var __spreadValues$g = (a, b) => {
|
7396
7214
|
for (var prop in b || (b = {}))
|
7397
|
-
if (__hasOwnProp$
|
7398
|
-
__defNormalProp$
|
7399
|
-
if (__getOwnPropSymbols$
|
7400
|
-
for (var prop of __getOwnPropSymbols$
|
7401
|
-
if (__propIsEnum$
|
7402
|
-
__defNormalProp$
|
7215
|
+
if (__hasOwnProp$g.call(b, prop))
|
7216
|
+
__defNormalProp$g(a, prop, b[prop]);
|
7217
|
+
if (__getOwnPropSymbols$g)
|
7218
|
+
for (var prop of __getOwnPropSymbols$g(b)) {
|
7219
|
+
if (__propIsEnum$g.call(b, prop))
|
7220
|
+
__defNormalProp$g(a, prop, b[prop]);
|
7403
7221
|
}
|
7404
7222
|
return a;
|
7405
7223
|
};
|
7406
7224
|
class QueryVariable extends MultiValueVariable {
|
7407
7225
|
constructor(initialState) {
|
7408
|
-
super(__spreadValues$
|
7226
|
+
super(__spreadValues$g({
|
7409
7227
|
type: "query",
|
7410
7228
|
name: "",
|
7411
7229
|
value: "",
|
@@ -7558,25 +7376,25 @@ function queryMetricTree(query) {
|
|
7558
7376
|
return queryTree(children, query.split("."), 0);
|
7559
7377
|
}
|
7560
7378
|
|
7561
|
-
var __defProp$
|
7562
|
-
var __getOwnPropSymbols$
|
7563
|
-
var __hasOwnProp$
|
7564
|
-
var __propIsEnum$
|
7565
|
-
var __defNormalProp$
|
7566
|
-
var __spreadValues$
|
7379
|
+
var __defProp$f = Object.defineProperty;
|
7380
|
+
var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
|
7381
|
+
var __hasOwnProp$f = Object.prototype.hasOwnProperty;
|
7382
|
+
var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
|
7383
|
+
var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
7384
|
+
var __spreadValues$f = (a, b) => {
|
7567
7385
|
for (var prop in b || (b = {}))
|
7568
|
-
if (__hasOwnProp$
|
7569
|
-
__defNormalProp$
|
7570
|
-
if (__getOwnPropSymbols$
|
7571
|
-
for (var prop of __getOwnPropSymbols$
|
7572
|
-
if (__propIsEnum$
|
7573
|
-
__defNormalProp$
|
7386
|
+
if (__hasOwnProp$f.call(b, prop))
|
7387
|
+
__defNormalProp$f(a, prop, b[prop]);
|
7388
|
+
if (__getOwnPropSymbols$f)
|
7389
|
+
for (var prop of __getOwnPropSymbols$f(b)) {
|
7390
|
+
if (__propIsEnum$f.call(b, prop))
|
7391
|
+
__defNormalProp$f(a, prop, b[prop]);
|
7574
7392
|
}
|
7575
7393
|
return a;
|
7576
7394
|
};
|
7577
7395
|
class TestVariable extends MultiValueVariable {
|
7578
7396
|
constructor(initialState, isLazy = false) {
|
7579
|
-
super(__spreadValues$
|
7397
|
+
super(__spreadValues$f({
|
7580
7398
|
type: "custom",
|
7581
7399
|
name: "Test",
|
7582
7400
|
value: "Value",
|
@@ -7685,25 +7503,25 @@ function VariableValueInput({ model }) {
|
|
7685
7503
|
});
|
7686
7504
|
}
|
7687
7505
|
|
7688
|
-
var __defProp$
|
7689
|
-
var __getOwnPropSymbols$
|
7690
|
-
var __hasOwnProp$
|
7691
|
-
var __propIsEnum$
|
7692
|
-
var __defNormalProp$
|
7693
|
-
var __spreadValues$
|
7506
|
+
var __defProp$e = Object.defineProperty;
|
7507
|
+
var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
|
7508
|
+
var __hasOwnProp$e = Object.prototype.hasOwnProperty;
|
7509
|
+
var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
|
7510
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
7511
|
+
var __spreadValues$e = (a, b) => {
|
7694
7512
|
for (var prop in b || (b = {}))
|
7695
|
-
if (__hasOwnProp$
|
7696
|
-
__defNormalProp$
|
7697
|
-
if (__getOwnPropSymbols$
|
7698
|
-
for (var prop of __getOwnPropSymbols$
|
7699
|
-
if (__propIsEnum$
|
7700
|
-
__defNormalProp$
|
7513
|
+
if (__hasOwnProp$e.call(b, prop))
|
7514
|
+
__defNormalProp$e(a, prop, b[prop]);
|
7515
|
+
if (__getOwnPropSymbols$e)
|
7516
|
+
for (var prop of __getOwnPropSymbols$e(b)) {
|
7517
|
+
if (__propIsEnum$e.call(b, prop))
|
7518
|
+
__defNormalProp$e(a, prop, b[prop]);
|
7701
7519
|
}
|
7702
7520
|
return a;
|
7703
7521
|
};
|
7704
7522
|
class TextBoxVariable extends SceneObjectBase {
|
7705
7523
|
constructor(initialState) {
|
7706
|
-
super(__spreadValues$
|
7524
|
+
super(__spreadValues$e({
|
7707
7525
|
type: "textbox",
|
7708
7526
|
value: "",
|
7709
7527
|
name: ""
|
@@ -7740,28 +7558,28 @@ TextBoxVariable.Component = ({ model }) => {
|
|
7740
7558
|
});
|
7741
7559
|
};
|
7742
7560
|
|
7743
|
-
var __defProp$
|
7744
|
-
var __defProps$
|
7745
|
-
var __getOwnPropDescs$
|
7746
|
-
var __getOwnPropSymbols$
|
7747
|
-
var __hasOwnProp$
|
7748
|
-
var __propIsEnum$
|
7749
|
-
var __defNormalProp$
|
7750
|
-
var __spreadValues$
|
7561
|
+
var __defProp$d = Object.defineProperty;
|
7562
|
+
var __defProps$8 = Object.defineProperties;
|
7563
|
+
var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
|
7564
|
+
var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
|
7565
|
+
var __hasOwnProp$d = Object.prototype.hasOwnProperty;
|
7566
|
+
var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
|
7567
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
7568
|
+
var __spreadValues$d = (a, b) => {
|
7751
7569
|
for (var prop in b || (b = {}))
|
7752
|
-
if (__hasOwnProp$
|
7753
|
-
__defNormalProp$
|
7754
|
-
if (__getOwnPropSymbols$
|
7755
|
-
for (var prop of __getOwnPropSymbols$
|
7756
|
-
if (__propIsEnum$
|
7757
|
-
__defNormalProp$
|
7570
|
+
if (__hasOwnProp$d.call(b, prop))
|
7571
|
+
__defNormalProp$d(a, prop, b[prop]);
|
7572
|
+
if (__getOwnPropSymbols$d)
|
7573
|
+
for (var prop of __getOwnPropSymbols$d(b)) {
|
7574
|
+
if (__propIsEnum$d.call(b, prop))
|
7575
|
+
__defNormalProp$d(a, prop, b[prop]);
|
7758
7576
|
}
|
7759
7577
|
return a;
|
7760
7578
|
};
|
7761
|
-
var __spreadProps$
|
7579
|
+
var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
|
7762
7580
|
class LocalValueVariable extends SceneObjectBase {
|
7763
7581
|
constructor(initialState) {
|
7764
|
-
super(__spreadProps$
|
7582
|
+
super(__spreadProps$8(__spreadValues$d({
|
7765
7583
|
type: "system",
|
7766
7584
|
value: "",
|
7767
7585
|
text: "",
|
@@ -7793,25 +7611,25 @@ class LocalValueVariable extends SceneObjectBase {
|
|
7793
7611
|
}
|
7794
7612
|
}
|
7795
7613
|
|
7796
|
-
var __defProp$
|
7797
|
-
var __getOwnPropSymbols$
|
7798
|
-
var __hasOwnProp$
|
7799
|
-
var __propIsEnum$
|
7800
|
-
var __defNormalProp$
|
7801
|
-
var __spreadValues$
|
7614
|
+
var __defProp$c = Object.defineProperty;
|
7615
|
+
var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
|
7616
|
+
var __hasOwnProp$c = Object.prototype.hasOwnProperty;
|
7617
|
+
var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
|
7618
|
+
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
7619
|
+
var __spreadValues$c = (a, b) => {
|
7802
7620
|
for (var prop in b || (b = {}))
|
7803
|
-
if (__hasOwnProp$
|
7804
|
-
__defNormalProp$
|
7805
|
-
if (__getOwnPropSymbols$
|
7806
|
-
for (var prop of __getOwnPropSymbols$
|
7807
|
-
if (__propIsEnum$
|
7808
|
-
__defNormalProp$
|
7621
|
+
if (__hasOwnProp$c.call(b, prop))
|
7622
|
+
__defNormalProp$c(a, prop, b[prop]);
|
7623
|
+
if (__getOwnPropSymbols$c)
|
7624
|
+
for (var prop of __getOwnPropSymbols$c(b)) {
|
7625
|
+
if (__propIsEnum$c.call(b, prop))
|
7626
|
+
__defNormalProp$c(a, prop, b[prop]);
|
7809
7627
|
}
|
7810
7628
|
return a;
|
7811
7629
|
};
|
7812
7630
|
class IntervalVariable extends SceneObjectBase {
|
7813
7631
|
constructor(initialState) {
|
7814
|
-
super(__spreadValues$
|
7632
|
+
super(__spreadValues$c({
|
7815
7633
|
type: "interval",
|
7816
7634
|
value: "",
|
7817
7635
|
intervals: ["1m", "10m", "30m", "1h", "6h", "12h", "1d", "7d", "14d", "30d"],
|
@@ -7904,6 +7722,7 @@ class UrlSyncManager {
|
|
7904
7722
|
this._locationSub = null;
|
7905
7723
|
this._ignoreNextLocationUpdate = false;
|
7906
7724
|
this._onLocationUpdate = (location) => {
|
7725
|
+
this._urlParams = new URLSearchParams(location.search);
|
7907
7726
|
if (this._ignoreNextLocationUpdate) {
|
7908
7727
|
this._ignoreNextLocationUpdate = false;
|
7909
7728
|
return;
|
@@ -7911,9 +7730,8 @@ class UrlSyncManager {
|
|
7911
7730
|
if (this._lastPath !== location.pathname) {
|
7912
7731
|
return;
|
7913
7732
|
}
|
7914
|
-
const urlParams = new URLSearchParams(location.search);
|
7915
7733
|
this._urlKeyMapper.rebuildIndex(this._sceneRoot);
|
7916
|
-
syncStateFromUrl(this._sceneRoot,
|
7734
|
+
syncStateFromUrl(this._sceneRoot, this._urlParams, this._urlKeyMapper);
|
7917
7735
|
this._lastPath = location.pathname;
|
7918
7736
|
};
|
7919
7737
|
this._onStateChanged = ({ payload }) => {
|
@@ -7946,8 +7764,10 @@ class UrlSyncManager {
|
|
7946
7764
|
writeSceneLog("UrlSyncManager", "Unregister previous scene state subscription", this._sceneRoot.state.key);
|
7947
7765
|
this._stateSub.unsubscribe();
|
7948
7766
|
}
|
7767
|
+
const location = runtime.locationService.getLocation();
|
7949
7768
|
this._sceneRoot = root;
|
7950
|
-
this._lastPath =
|
7769
|
+
this._lastPath = location.pathname;
|
7770
|
+
this._urlParams = new URLSearchParams(location.search);
|
7951
7771
|
this._stateSub = root.subscribeToEvent(SceneObjectStateChangedEvent, this._onStateChanged);
|
7952
7772
|
this.syncFrom(this._sceneRoot);
|
7953
7773
|
}
|
@@ -8019,7 +7839,7 @@ class EmbeddedScene extends SceneObjectBase {
|
|
8019
7839
|
EmbeddedScene.Component = EmbeddedSceneRenderer;
|
8020
7840
|
function EmbeddedSceneRenderer({ model }) {
|
8021
7841
|
const { body, controls } = model.useState();
|
8022
|
-
const styles = ui.useStyles2(getStyles$
|
7842
|
+
const styles = ui.useStyles2(getStyles$6);
|
8023
7843
|
return /* @__PURE__ */ React__default["default"].createElement("div", {
|
8024
7844
|
className: styles.container
|
8025
7845
|
}, controls && /* @__PURE__ */ React__default["default"].createElement("div", {
|
@@ -8033,7 +7853,7 @@ function EmbeddedSceneRenderer({ model }) {
|
|
8033
7853
|
model: body
|
8034
7854
|
})));
|
8035
7855
|
}
|
8036
|
-
const getStyles$
|
7856
|
+
const getStyles$6 = (theme) => {
|
8037
7857
|
return {
|
8038
7858
|
container: css.css({
|
8039
7859
|
flexGrow: 1,
|
@@ -8136,30 +7956,30 @@ function isSceneGridLayout(child) {
|
|
8136
7956
|
return child instanceof SceneGridLayout;
|
8137
7957
|
}
|
8138
7958
|
|
8139
|
-
var __defProp$
|
8140
|
-
var __getOwnPropSymbols$
|
8141
|
-
var __hasOwnProp$
|
8142
|
-
var __propIsEnum$
|
8143
|
-
var __defNormalProp$
|
8144
|
-
var __spreadValues$
|
7959
|
+
var __defProp$b = Object.defineProperty;
|
7960
|
+
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
7961
|
+
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
7962
|
+
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
7963
|
+
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
7964
|
+
var __spreadValues$b = (a, b) => {
|
8145
7965
|
for (var prop in b || (b = {}))
|
8146
|
-
if (__hasOwnProp$
|
8147
|
-
__defNormalProp$
|
8148
|
-
if (__getOwnPropSymbols$
|
8149
|
-
for (var prop of __getOwnPropSymbols$
|
8150
|
-
if (__propIsEnum$
|
8151
|
-
__defNormalProp$
|
7966
|
+
if (__hasOwnProp$b.call(b, prop))
|
7967
|
+
__defNormalProp$b(a, prop, b[prop]);
|
7968
|
+
if (__getOwnPropSymbols$b)
|
7969
|
+
for (var prop of __getOwnPropSymbols$b(b)) {
|
7970
|
+
if (__propIsEnum$b.call(b, prop))
|
7971
|
+
__defNormalProp$b(a, prop, b[prop]);
|
8152
7972
|
}
|
8153
7973
|
return a;
|
8154
7974
|
};
|
8155
7975
|
var __objRest$1 = (source, exclude) => {
|
8156
7976
|
var target = {};
|
8157
7977
|
for (var prop in source)
|
8158
|
-
if (__hasOwnProp$
|
7978
|
+
if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
|
8159
7979
|
target[prop] = source[prop];
|
8160
|
-
if (source != null && __getOwnPropSymbols$
|
8161
|
-
for (var prop of __getOwnPropSymbols$
|
8162
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
7980
|
+
if (source != null && __getOwnPropSymbols$b)
|
7981
|
+
for (var prop of __getOwnPropSymbols$b(source)) {
|
7982
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
|
8163
7983
|
target[prop] = source[prop];
|
8164
7984
|
}
|
8165
7985
|
return target;
|
@@ -8199,7 +8019,7 @@ const LazyLoader = React__default["default"].forwardRef(
|
|
8199
8019
|
}
|
8200
8020
|
};
|
8201
8021
|
});
|
8202
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$
|
8022
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$b({
|
8203
8023
|
id,
|
8204
8024
|
ref: innerRef
|
8205
8025
|
}, rest), loaded && (typeof children === "function" ? children({ isInView }) : children));
|
@@ -8217,33 +8037,33 @@ LazyLoader.observer = new IntersectionObserver(
|
|
8217
8037
|
{ rootMargin: "100px" }
|
8218
8038
|
);
|
8219
8039
|
|
8220
|
-
var __defProp$
|
8221
|
-
var __defProps$
|
8222
|
-
var __getOwnPropDescs$
|
8223
|
-
var __getOwnPropSymbols$
|
8224
|
-
var __hasOwnProp$
|
8225
|
-
var __propIsEnum$
|
8226
|
-
var __defNormalProp$
|
8227
|
-
var __spreadValues$
|
8040
|
+
var __defProp$a = Object.defineProperty;
|
8041
|
+
var __defProps$7 = Object.defineProperties;
|
8042
|
+
var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
|
8043
|
+
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
8044
|
+
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
8045
|
+
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
8046
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
8047
|
+
var __spreadValues$a = (a, b) => {
|
8228
8048
|
for (var prop in b || (b = {}))
|
8229
|
-
if (__hasOwnProp$
|
8230
|
-
__defNormalProp$
|
8231
|
-
if (__getOwnPropSymbols$
|
8232
|
-
for (var prop of __getOwnPropSymbols$
|
8233
|
-
if (__propIsEnum$
|
8234
|
-
__defNormalProp$
|
8049
|
+
if (__hasOwnProp$a.call(b, prop))
|
8050
|
+
__defNormalProp$a(a, prop, b[prop]);
|
8051
|
+
if (__getOwnPropSymbols$a)
|
8052
|
+
for (var prop of __getOwnPropSymbols$a(b)) {
|
8053
|
+
if (__propIsEnum$a.call(b, prop))
|
8054
|
+
__defNormalProp$a(a, prop, b[prop]);
|
8235
8055
|
}
|
8236
8056
|
return a;
|
8237
8057
|
};
|
8238
|
-
var __spreadProps$
|
8058
|
+
var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
|
8239
8059
|
var __objRest = (source, exclude) => {
|
8240
8060
|
var target = {};
|
8241
8061
|
for (var prop in source)
|
8242
|
-
if (__hasOwnProp$
|
8062
|
+
if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
|
8243
8063
|
target[prop] = source[prop];
|
8244
|
-
if (source != null && __getOwnPropSymbols$
|
8245
|
-
for (var prop of __getOwnPropSymbols$
|
8246
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
8064
|
+
if (source != null && __getOwnPropSymbols$a)
|
8065
|
+
for (var prop of __getOwnPropSymbols$a(source)) {
|
8066
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
|
8247
8067
|
target[prop] = source[prop];
|
8248
8068
|
}
|
8249
8069
|
return target;
|
@@ -8302,7 +8122,7 @@ const GridItemWrapper = React__default["default"].forwardRef((props, ref) => {
|
|
8302
8122
|
key: sceneChild.state.key
|
8303
8123
|
});
|
8304
8124
|
if (isLazy) {
|
8305
|
-
return /* @__PURE__ */ React__default["default"].createElement(LazyLoader, __spreadProps$
|
8125
|
+
return /* @__PURE__ */ React__default["default"].createElement(LazyLoader, __spreadProps$7(__spreadValues$a({}, divProps), {
|
8306
8126
|
key: sceneChild.state.key,
|
8307
8127
|
"data-griditem-key": sceneChild.state.key,
|
8308
8128
|
className: css.cx(className, props.className),
|
@@ -8310,7 +8130,7 @@ const GridItemWrapper = React__default["default"].forwardRef((props, ref) => {
|
|
8310
8130
|
ref
|
8311
8131
|
}), innerContent, children);
|
8312
8132
|
}
|
8313
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$
|
8133
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$7(__spreadValues$a({}, divProps), {
|
8314
8134
|
ref,
|
8315
8135
|
key: sceneChild.state.key,
|
8316
8136
|
"data-griditem-key": sceneChild.state.key,
|
@@ -8340,7 +8160,7 @@ function updateAnimationClass(ref, isDraggable, retry) {
|
|
8340
8160
|
const ResizeHandle = React__default["default"].forwardRef((_a, ref) => {
|
8341
8161
|
var _b = _a, divProps = __objRest(_b, ["handleAxis"]);
|
8342
8162
|
const customCssClass = ui.useStyles2(getResizeHandleStyles);
|
8343
|
-
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$
|
8163
|
+
return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$7(__spreadValues$a({
|
8344
8164
|
ref
|
8345
8165
|
}, divProps), {
|
8346
8166
|
className: `${customCssClass} scene-resize-handle`
|
@@ -8380,60 +8200,60 @@ function getResizeHandleStyles(theme) {
|
|
8380
8200
|
});
|
8381
8201
|
}
|
8382
8202
|
|
8383
|
-
var __defProp$
|
8384
|
-
var __defProps$
|
8385
|
-
var __getOwnPropDescs$
|
8386
|
-
var __getOwnPropSymbols$
|
8387
|
-
var __hasOwnProp$
|
8388
|
-
var __propIsEnum$
|
8389
|
-
var __defNormalProp$
|
8390
|
-
var __spreadValues$
|
8203
|
+
var __defProp$9 = Object.defineProperty;
|
8204
|
+
var __defProps$6 = Object.defineProperties;
|
8205
|
+
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
8206
|
+
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
8207
|
+
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
8208
|
+
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
8209
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
8210
|
+
var __spreadValues$9 = (a, b) => {
|
8391
8211
|
for (var prop in b || (b = {}))
|
8392
|
-
if (__hasOwnProp$
|
8393
|
-
__defNormalProp$
|
8394
|
-
if (__getOwnPropSymbols$
|
8395
|
-
for (var prop of __getOwnPropSymbols$
|
8396
|
-
if (__propIsEnum$
|
8397
|
-
__defNormalProp$
|
8212
|
+
if (__hasOwnProp$9.call(b, prop))
|
8213
|
+
__defNormalProp$9(a, prop, b[prop]);
|
8214
|
+
if (__getOwnPropSymbols$9)
|
8215
|
+
for (var prop of __getOwnPropSymbols$9(b)) {
|
8216
|
+
if (__propIsEnum$9.call(b, prop))
|
8217
|
+
__defNormalProp$9(a, prop, b[prop]);
|
8398
8218
|
}
|
8399
8219
|
return a;
|
8400
8220
|
};
|
8401
|
-
var __spreadProps$
|
8221
|
+
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
8402
8222
|
function fitPanelsInHeight(cells, height) {
|
8403
8223
|
const visibleHeight = height - GRID_CELL_VMARGIN * 4;
|
8404
8224
|
const currentGridHeight = Math.max(...cells.map((cell) => cell.h + cell.y));
|
8405
8225
|
const visibleGridHeight = Math.floor(visibleHeight / (GRID_CELL_HEIGHT + GRID_CELL_VMARGIN));
|
8406
8226
|
const scaleFactor = currentGridHeight / visibleGridHeight;
|
8407
8227
|
return cells.map((cell) => {
|
8408
|
-
return __spreadProps$
|
8228
|
+
return __spreadProps$6(__spreadValues$9({}, cell), {
|
8409
8229
|
y: Math.round(cell.y / scaleFactor) || 0,
|
8410
8230
|
h: Math.round(cell.h / scaleFactor) || 1
|
8411
8231
|
});
|
8412
8232
|
});
|
8413
8233
|
}
|
8414
8234
|
|
8415
|
-
var __defProp$
|
8416
|
-
var __defProps$
|
8417
|
-
var __getOwnPropDescs$
|
8418
|
-
var __getOwnPropSymbols$
|
8419
|
-
var __hasOwnProp$
|
8420
|
-
var __propIsEnum$
|
8421
|
-
var __defNormalProp$
|
8422
|
-
var __spreadValues$
|
8235
|
+
var __defProp$8 = Object.defineProperty;
|
8236
|
+
var __defProps$5 = Object.defineProperties;
|
8237
|
+
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
8238
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
8239
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
8240
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
8241
|
+
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
8242
|
+
var __spreadValues$8 = (a, b) => {
|
8423
8243
|
for (var prop in b || (b = {}))
|
8424
|
-
if (__hasOwnProp$
|
8425
|
-
__defNormalProp$
|
8426
|
-
if (__getOwnPropSymbols$
|
8427
|
-
for (var prop of __getOwnPropSymbols$
|
8428
|
-
if (__propIsEnum$
|
8429
|
-
__defNormalProp$
|
8244
|
+
if (__hasOwnProp$8.call(b, prop))
|
8245
|
+
__defNormalProp$8(a, prop, b[prop]);
|
8246
|
+
if (__getOwnPropSymbols$8)
|
8247
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
8248
|
+
if (__propIsEnum$8.call(b, prop))
|
8249
|
+
__defNormalProp$8(a, prop, b[prop]);
|
8430
8250
|
}
|
8431
8251
|
return a;
|
8432
8252
|
};
|
8433
|
-
var __spreadProps$
|
8253
|
+
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
8434
8254
|
const _SceneGridLayout = class extends SceneObjectBase {
|
8435
8255
|
constructor(state) {
|
8436
|
-
super(__spreadProps$
|
8256
|
+
super(__spreadProps$5(__spreadValues$8({}, state), {
|
8437
8257
|
children: sortChildrenByPosition(state.children)
|
8438
8258
|
}));
|
8439
8259
|
this._skipOnLayoutChange = false;
|
@@ -8457,7 +8277,7 @@ const _SceneGridLayout = class extends SceneObjectBase {
|
|
8457
8277
|
height: item.h
|
8458
8278
|
};
|
8459
8279
|
if (!isItemSizeEqual(child.state, nextSize)) {
|
8460
|
-
child.setState(__spreadValues$
|
8280
|
+
child.setState(__spreadValues$8({}, nextSize));
|
8461
8281
|
}
|
8462
8282
|
}
|
8463
8283
|
this.setState({ children: sortChildrenByPosition(this.state.children) });
|
@@ -8531,7 +8351,7 @@ const _SceneGridLayout = class extends SceneObjectBase {
|
|
8531
8351
|
const yDiff = firstPanelYPos - (rowY + 1);
|
8532
8352
|
let yMax = rowY;
|
8533
8353
|
for (const panel of rowChildren) {
|
8534
|
-
const newSize = __spreadValues$
|
8354
|
+
const newSize = __spreadValues$8({}, panel.state);
|
8535
8355
|
newSize.y = (_b = newSize.y) != null ? _b : rowY;
|
8536
8356
|
newSize.y -= yDiff;
|
8537
8357
|
if (newSize.y !== panel.state.y) {
|
@@ -8658,7 +8478,7 @@ const _SceneGridLayout = class extends SceneObjectBase {
|
|
8658
8478
|
}
|
8659
8479
|
if (width < 768) {
|
8660
8480
|
this._skipOnLayoutChange = true;
|
8661
|
-
return cells.map((cell) => __spreadProps$
|
8481
|
+
return cells.map((cell) => __spreadProps$5(__spreadValues$8({}, cell), { w: 24 }));
|
8662
8482
|
}
|
8663
8483
|
this._skipOnLayoutChange = false;
|
8664
8484
|
return cells;
|
@@ -8683,28 +8503,28 @@ function sortGridLayout(layout) {
|
|
8683
8503
|
return [...layout].sort((a, b) => a.y - b.y || a.x - b.x);
|
8684
8504
|
}
|
8685
8505
|
|
8686
|
-
var __defProp$
|
8687
|
-
var __defProps$
|
8688
|
-
var __getOwnPropDescs$
|
8689
|
-
var __getOwnPropSymbols$
|
8690
|
-
var __hasOwnProp$
|
8691
|
-
var __propIsEnum$
|
8692
|
-
var __defNormalProp$
|
8693
|
-
var __spreadValues$
|
8506
|
+
var __defProp$7 = Object.defineProperty;
|
8507
|
+
var __defProps$4 = Object.defineProperties;
|
8508
|
+
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
8509
|
+
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
8510
|
+
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
8511
|
+
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
8512
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
8513
|
+
var __spreadValues$7 = (a, b) => {
|
8694
8514
|
for (var prop in b || (b = {}))
|
8695
|
-
if (__hasOwnProp$
|
8696
|
-
__defNormalProp$
|
8697
|
-
if (__getOwnPropSymbols$
|
8698
|
-
for (var prop of __getOwnPropSymbols$
|
8699
|
-
if (__propIsEnum$
|
8700
|
-
__defNormalProp$
|
8515
|
+
if (__hasOwnProp$7.call(b, prop))
|
8516
|
+
__defNormalProp$7(a, prop, b[prop]);
|
8517
|
+
if (__getOwnPropSymbols$7)
|
8518
|
+
for (var prop of __getOwnPropSymbols$7(b)) {
|
8519
|
+
if (__propIsEnum$7.call(b, prop))
|
8520
|
+
__defNormalProp$7(a, prop, b[prop]);
|
8701
8521
|
}
|
8702
8522
|
return a;
|
8703
8523
|
};
|
8704
|
-
var __spreadProps$
|
8524
|
+
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
8705
8525
|
class SceneGridRow extends SceneObjectBase {
|
8706
8526
|
constructor(state) {
|
8707
|
-
super(__spreadProps$
|
8527
|
+
super(__spreadProps$4(__spreadValues$7({
|
8708
8528
|
children: state.children || [],
|
8709
8529
|
isCollapsible: state.isCollapsible || true,
|
8710
8530
|
title: state.title || ""
|
@@ -8869,7 +8689,7 @@ NestedScene.Component = NestedSceneRenderer;
|
|
8869
8689
|
function NestedSceneRenderer({ model }) {
|
8870
8690
|
const { title, isCollapsed, canCollapse, canRemove, body, controls } = model.useState();
|
8871
8691
|
const gridRow = ui.useStyles2(getSceneGridRowStyles);
|
8872
|
-
const styles = ui.useStyles2(getStyles$
|
8692
|
+
const styles = ui.useStyles2(getStyles$5);
|
8873
8693
|
const toolbarControls = (controls != null ? controls : []).map((action) => /* @__PURE__ */ React__default["default"].createElement(action.Component, {
|
8874
8694
|
key: action.state.key,
|
8875
8695
|
model: action
|
@@ -8904,7 +8724,7 @@ function NestedSceneRenderer({ model }) {
|
|
8904
8724
|
model: body
|
8905
8725
|
}));
|
8906
8726
|
}
|
8907
|
-
const getStyles$
|
8727
|
+
const getStyles$5 = (theme) => ({
|
8908
8728
|
wrapper: css.css({
|
8909
8729
|
display: "flex",
|
8910
8730
|
flexDirection: "column",
|
@@ -9071,30 +8891,30 @@ function getShiftedTimeRange(dir, timeRange, upperLimit) {
|
|
9071
8891
|
};
|
9072
8892
|
}
|
9073
8893
|
|
9074
|
-
var __defProp$
|
9075
|
-
var __defProps$
|
9076
|
-
var __getOwnPropDescs$
|
9077
|
-
var __getOwnPropSymbols$
|
9078
|
-
var __hasOwnProp$
|
9079
|
-
var __propIsEnum$
|
9080
|
-
var __defNormalProp$
|
9081
|
-
var __spreadValues$
|
8894
|
+
var __defProp$6 = Object.defineProperty;
|
8895
|
+
var __defProps$3 = Object.defineProperties;
|
8896
|
+
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
8897
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
8898
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
8899
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
8900
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
8901
|
+
var __spreadValues$6 = (a, b) => {
|
9082
8902
|
for (var prop in b || (b = {}))
|
9083
|
-
if (__hasOwnProp$
|
9084
|
-
__defNormalProp$
|
9085
|
-
if (__getOwnPropSymbols$
|
9086
|
-
for (var prop of __getOwnPropSymbols$
|
9087
|
-
if (__propIsEnum$
|
9088
|
-
__defNormalProp$
|
8903
|
+
if (__hasOwnProp$6.call(b, prop))
|
8904
|
+
__defNormalProp$6(a, prop, b[prop]);
|
8905
|
+
if (__getOwnPropSymbols$6)
|
8906
|
+
for (var prop of __getOwnPropSymbols$6(b)) {
|
8907
|
+
if (__propIsEnum$6.call(b, prop))
|
8908
|
+
__defNormalProp$6(a, prop, b[prop]);
|
9089
8909
|
}
|
9090
8910
|
return a;
|
9091
8911
|
};
|
9092
|
-
var __spreadProps$
|
8912
|
+
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
9093
8913
|
const DEFAULT_INTERVALS = ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"];
|
9094
8914
|
class SceneRefreshPicker extends SceneObjectBase {
|
9095
8915
|
constructor(state) {
|
9096
8916
|
var _a, _b, _c;
|
9097
|
-
super(__spreadProps$
|
8917
|
+
super(__spreadProps$3(__spreadValues$6({
|
9098
8918
|
refresh: ""
|
9099
8919
|
}, state), {
|
9100
8920
|
autoValue: void 0,
|
@@ -9175,55 +8995,283 @@ class SceneRefreshPicker extends SceneObjectBase {
|
|
9175
8995
|
}
|
9176
8996
|
getUrlState() {
|
9177
8997
|
return {
|
9178
|
-
refresh: this.state.refresh
|
8998
|
+
refresh: this.state.refresh
|
8999
|
+
};
|
9000
|
+
}
|
9001
|
+
updateFromUrl(values) {
|
9002
|
+
const refresh = values.refresh;
|
9003
|
+
if (refresh && typeof refresh === "string") {
|
9004
|
+
this.setState({
|
9005
|
+
refresh
|
9006
|
+
});
|
9007
|
+
}
|
9008
|
+
}
|
9009
|
+
}
|
9010
|
+
SceneRefreshPicker.Component = SceneRefreshPickerRenderer;
|
9011
|
+
function SceneRefreshPickerRenderer({ model }) {
|
9012
|
+
var _a;
|
9013
|
+
const { refresh, intervals, autoEnabled, autoValue, isOnCanvas, primary, withText } = model.useState();
|
9014
|
+
const isRunning = useQueryControllerState(model);
|
9015
|
+
let text = refresh === ((_a = ui.RefreshPicker.autoOption) == null ? void 0 : _a.value) ? autoValue : withText ? "Refresh" : void 0;
|
9016
|
+
let tooltip;
|
9017
|
+
let width;
|
9018
|
+
if (isRunning) {
|
9019
|
+
tooltip = "Cancel all queries";
|
9020
|
+
if (withText) {
|
9021
|
+
text = "Cancel";
|
9022
|
+
}
|
9023
|
+
}
|
9024
|
+
if (withText) {
|
9025
|
+
width = "96px";
|
9026
|
+
}
|
9027
|
+
return /* @__PURE__ */ React__default["default"].createElement(ui.RefreshPicker, {
|
9028
|
+
showAutoInterval: autoEnabled,
|
9029
|
+
value: refresh,
|
9030
|
+
intervals,
|
9031
|
+
tooltip,
|
9032
|
+
width,
|
9033
|
+
text,
|
9034
|
+
onRefresh: model.onRefresh,
|
9035
|
+
primary,
|
9036
|
+
onIntervalChanged: model.onIntervalChanged,
|
9037
|
+
isLoading: isRunning,
|
9038
|
+
isOnCanvas: isOnCanvas != null ? isOnCanvas : true
|
9039
|
+
});
|
9040
|
+
}
|
9041
|
+
function useQueryControllerState(model) {
|
9042
|
+
const queryController = sceneGraph.getQueryController(model);
|
9043
|
+
if (!queryController) {
|
9044
|
+
return false;
|
9045
|
+
}
|
9046
|
+
return queryController.useState().isRunning;
|
9047
|
+
}
|
9048
|
+
|
9049
|
+
const getCompareSeriesRefId = (refId) => `${refId}-compare`;
|
9050
|
+
|
9051
|
+
var __defProp$5 = Object.defineProperty;
|
9052
|
+
var __defProps$2 = Object.defineProperties;
|
9053
|
+
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
9054
|
+
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
9055
|
+
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
9056
|
+
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
9057
|
+
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
9058
|
+
var __spreadValues$5 = (a, b) => {
|
9059
|
+
for (var prop in b || (b = {}))
|
9060
|
+
if (__hasOwnProp$5.call(b, prop))
|
9061
|
+
__defNormalProp$5(a, prop, b[prop]);
|
9062
|
+
if (__getOwnPropSymbols$5)
|
9063
|
+
for (var prop of __getOwnPropSymbols$5(b)) {
|
9064
|
+
if (__propIsEnum$5.call(b, prop))
|
9065
|
+
__defNormalProp$5(a, prop, b[prop]);
|
9066
|
+
}
|
9067
|
+
return a;
|
9068
|
+
};
|
9069
|
+
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
9070
|
+
const PREVIOUS_PERIOD_VALUE = "__previousPeriod";
|
9071
|
+
const NO_PERIOD_VALUE = "__noPeriod";
|
9072
|
+
const PREVIOUS_PERIOD_COMPARE_OPTION = {
|
9073
|
+
label: "Previous period",
|
9074
|
+
value: PREVIOUS_PERIOD_VALUE
|
9075
|
+
};
|
9076
|
+
const NO_COMPARE_OPTION = {
|
9077
|
+
label: "No comparison",
|
9078
|
+
value: NO_PERIOD_VALUE
|
9079
|
+
};
|
9080
|
+
const DEFAULT_COMPARE_OPTIONS = [
|
9081
|
+
{ label: "Day before", value: "24h" },
|
9082
|
+
{ label: "Week before", value: "1w" },
|
9083
|
+
{ label: "Month before", value: "1M" }
|
9084
|
+
];
|
9085
|
+
class SceneTimeRangeCompare extends SceneObjectBase {
|
9086
|
+
constructor(state) {
|
9087
|
+
super(__spreadValues$5({ compareOptions: DEFAULT_COMPARE_OPTIONS }, state));
|
9088
|
+
this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["compareWith"] });
|
9089
|
+
this._onActivate = () => {
|
9090
|
+
const sceneTimeRange = sceneGraph.getTimeRange(this);
|
9091
|
+
this.setState({ compareOptions: this.getCompareOptions(sceneTimeRange.state.value) });
|
9092
|
+
this._subs.add(
|
9093
|
+
sceneTimeRange.subscribeToState((timeRange) => {
|
9094
|
+
const compareOptions = this.getCompareOptions(timeRange.value);
|
9095
|
+
const stateUpdate = { compareOptions };
|
9096
|
+
if (Boolean(this.state.compareWith) && !compareOptions.find(({ value }) => value === this.state.compareWith)) {
|
9097
|
+
stateUpdate.compareWith = PREVIOUS_PERIOD_VALUE;
|
9098
|
+
}
|
9099
|
+
this.setState(stateUpdate);
|
9100
|
+
})
|
9101
|
+
);
|
9102
|
+
};
|
9103
|
+
this.getCompareOptions = (timeRange) => {
|
9104
|
+
const diffDays = Math.ceil(timeRange.to.diff(timeRange.from));
|
9105
|
+
const matchIndex = DEFAULT_COMPARE_OPTIONS.findIndex(({ value }) => {
|
9106
|
+
const intervalInMs = data.rangeUtil.intervalToMs(value);
|
9107
|
+
return intervalInMs >= diffDays;
|
9108
|
+
});
|
9109
|
+
return [
|
9110
|
+
NO_COMPARE_OPTION,
|
9111
|
+
PREVIOUS_PERIOD_COMPARE_OPTION,
|
9112
|
+
...DEFAULT_COMPARE_OPTIONS.slice(matchIndex).map(({ label, value }) => ({ label, value }))
|
9113
|
+
];
|
9114
|
+
};
|
9115
|
+
this.onCompareWithChanged = (compareWith) => {
|
9116
|
+
if (compareWith === NO_PERIOD_VALUE) {
|
9117
|
+
this.onClearCompare();
|
9118
|
+
} else {
|
9119
|
+
this.setState({ compareWith });
|
9120
|
+
}
|
9121
|
+
};
|
9122
|
+
this.onClearCompare = () => {
|
9123
|
+
this.setState({ compareWith: void 0 });
|
9124
|
+
};
|
9125
|
+
this.addActivationHandler(this._onActivate);
|
9126
|
+
}
|
9127
|
+
getExtraQueries(request) {
|
9128
|
+
const extraQueries = [];
|
9129
|
+
const compareRange = this.getCompareTimeRange(request.range);
|
9130
|
+
if (!compareRange) {
|
9131
|
+
return extraQueries;
|
9132
|
+
}
|
9133
|
+
const targets = request.targets.filter((query) => query.timeRangeCompare !== false);
|
9134
|
+
if (targets.length) {
|
9135
|
+
extraQueries.push({
|
9136
|
+
req: __spreadProps$2(__spreadValues$5({}, request), {
|
9137
|
+
targets,
|
9138
|
+
range: compareRange
|
9139
|
+
}),
|
9140
|
+
processor: timeShiftAlignmentProcessor
|
9141
|
+
});
|
9142
|
+
}
|
9143
|
+
return extraQueries;
|
9144
|
+
}
|
9145
|
+
shouldRerun(prev, next) {
|
9146
|
+
return prev.compareWith !== next.compareWith;
|
9147
|
+
}
|
9148
|
+
getCompareTimeRange(timeRange) {
|
9149
|
+
let compareFrom;
|
9150
|
+
let compareTo;
|
9151
|
+
if (this.state.compareWith) {
|
9152
|
+
if (this.state.compareWith === PREVIOUS_PERIOD_VALUE) {
|
9153
|
+
const diffMs = timeRange.to.diff(timeRange.from);
|
9154
|
+
compareFrom = data.dateTime(timeRange.from).subtract(diffMs);
|
9155
|
+
compareTo = data.dateTime(timeRange.to).subtract(diffMs);
|
9156
|
+
} else {
|
9157
|
+
compareFrom = data.dateTime(timeRange.from).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
|
9158
|
+
compareTo = data.dateTime(timeRange.to).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
|
9159
|
+
}
|
9160
|
+
return {
|
9161
|
+
from: compareFrom,
|
9162
|
+
to: compareTo,
|
9163
|
+
raw: {
|
9164
|
+
from: compareFrom,
|
9165
|
+
to: compareTo
|
9166
|
+
}
|
9167
|
+
};
|
9168
|
+
}
|
9169
|
+
return void 0;
|
9170
|
+
}
|
9171
|
+
getUrlState() {
|
9172
|
+
return {
|
9173
|
+
compareWith: this.state.compareWith
|
9179
9174
|
};
|
9180
9175
|
}
|
9181
9176
|
updateFromUrl(values) {
|
9182
|
-
|
9183
|
-
|
9184
|
-
|
9185
|
-
|
9186
|
-
|
9177
|
+
if (!values.compareWith) {
|
9178
|
+
return;
|
9179
|
+
}
|
9180
|
+
const compareWith = parseUrlParam(values.compareWith);
|
9181
|
+
if (compareWith) {
|
9182
|
+
const compareOptions = this.getCompareOptions(sceneGraph.getTimeRange(this).state.value);
|
9183
|
+
if (compareOptions.find(({ value }) => value === compareWith)) {
|
9184
|
+
this.setState({
|
9185
|
+
compareWith
|
9186
|
+
});
|
9187
|
+
} else {
|
9188
|
+
this.setState({
|
9189
|
+
compareWith: "__previousPeriod"
|
9190
|
+
});
|
9191
|
+
}
|
9187
9192
|
}
|
9188
9193
|
}
|
9189
9194
|
}
|
9190
|
-
|
9191
|
-
|
9195
|
+
SceneTimeRangeCompare.Component = SceneTimeRangeCompareRenderer;
|
9196
|
+
const timeShiftAlignmentProcessor = (primary, secondary) => {
|
9197
|
+
const diff = secondary.timeRange.from.diff(primary.timeRange.from);
|
9198
|
+
secondary.series.forEach((series) => {
|
9199
|
+
series.refId = getCompareSeriesRefId(series.refId || "");
|
9200
|
+
series.meta = __spreadProps$2(__spreadValues$5({}, series.meta), {
|
9201
|
+
timeCompare: {
|
9202
|
+
diffMs: diff,
|
9203
|
+
isTimeShiftQuery: true
|
9204
|
+
}
|
9205
|
+
});
|
9206
|
+
series.fields.forEach((field) => {
|
9207
|
+
if (field.type === data.FieldType.time) {
|
9208
|
+
field.values = field.values.map((v) => {
|
9209
|
+
return diff < 0 ? v - diff : v + diff;
|
9210
|
+
});
|
9211
|
+
}
|
9212
|
+
field.config = __spreadProps$2(__spreadValues$5({}, field.config), {
|
9213
|
+
color: {
|
9214
|
+
mode: "fixed",
|
9215
|
+
fixedColor: runtime.config.theme.palette.gray60
|
9216
|
+
}
|
9217
|
+
});
|
9218
|
+
return field;
|
9219
|
+
});
|
9220
|
+
});
|
9221
|
+
return rxjs.of(secondary);
|
9222
|
+
};
|
9223
|
+
function SceneTimeRangeCompareRenderer({ model }) {
|
9192
9224
|
var _a;
|
9193
|
-
const
|
9194
|
-
const
|
9195
|
-
|
9196
|
-
|
9197
|
-
|
9198
|
-
|
9199
|
-
|
9200
|
-
if (
|
9201
|
-
|
9225
|
+
const styles = ui.useStyles2(getStyles$4);
|
9226
|
+
const { compareWith, compareOptions } = model.useState();
|
9227
|
+
const [previousCompare, setPreviousCompare] = React__default["default"].useState(compareWith);
|
9228
|
+
const previousValue = (_a = compareOptions.find(({ value: value2 }) => value2 === previousCompare)) != null ? _a : PREVIOUS_PERIOD_COMPARE_OPTION;
|
9229
|
+
const value = compareOptions.find(({ value: value2 }) => value2 === compareWith);
|
9230
|
+
const enabled = Boolean(value);
|
9231
|
+
const onClick = () => {
|
9232
|
+
if (enabled) {
|
9233
|
+
setPreviousCompare(compareWith);
|
9234
|
+
model.onClearCompare();
|
9235
|
+
} else if (!enabled) {
|
9236
|
+
model.onCompareWithChanged(previousValue.value);
|
9202
9237
|
}
|
9203
|
-
}
|
9204
|
-
|
9205
|
-
|
9206
|
-
|
9207
|
-
|
9208
|
-
|
9209
|
-
|
9210
|
-
|
9211
|
-
|
9212
|
-
|
9213
|
-
|
9214
|
-
|
9215
|
-
|
9216
|
-
|
9217
|
-
|
9218
|
-
|
9219
|
-
|
9238
|
+
};
|
9239
|
+
return /* @__PURE__ */ React__default["default"].createElement(ui.ButtonGroup, null, /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
|
9240
|
+
variant: "canvas",
|
9241
|
+
tooltip: "Enable time frame comparison",
|
9242
|
+
onClick: (e) => {
|
9243
|
+
e.stopPropagation();
|
9244
|
+
e.preventDefault();
|
9245
|
+
onClick();
|
9246
|
+
}
|
9247
|
+
}, /* @__PURE__ */ React__default["default"].createElement(ui.Checkbox, {
|
9248
|
+
label: " ",
|
9249
|
+
value: enabled,
|
9250
|
+
onClick
|
9251
|
+
}), "Comparison"), enabled ? /* @__PURE__ */ React__default["default"].createElement(ui.ButtonSelect, {
|
9252
|
+
variant: "canvas",
|
9253
|
+
value,
|
9254
|
+
options: compareOptions,
|
9255
|
+
onChange: (v) => {
|
9256
|
+
model.onCompareWithChanged(v.value);
|
9257
|
+
}
|
9258
|
+
}) : /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
|
9259
|
+
className: styles.previewButton,
|
9260
|
+
disabled: true,
|
9261
|
+
variant: "canvas",
|
9262
|
+
isOpen: false
|
9263
|
+
}, previousValue.label));
|
9220
9264
|
}
|
9221
|
-
function
|
9222
|
-
|
9223
|
-
|
9224
|
-
|
9225
|
-
|
9226
|
-
|
9265
|
+
function getStyles$4(theme) {
|
9266
|
+
return {
|
9267
|
+
previewButton: css.css({
|
9268
|
+
"&:disabled": {
|
9269
|
+
border: `1px solid ${theme.colors.secondary.border}`,
|
9270
|
+
color: theme.colors.text.disabled,
|
9271
|
+
opacity: 1
|
9272
|
+
}
|
9273
|
+
})
|
9274
|
+
};
|
9227
9275
|
}
|
9228
9276
|
|
9229
9277
|
class SceneByFrameRepeater extends SceneObjectBase {
|
@@ -11090,6 +11138,174 @@ const PanelBuilders = {
|
|
11090
11138
|
}
|
11091
11139
|
};
|
11092
11140
|
|
11141
|
+
class VizConfigBuilder {
|
11142
|
+
constructor(pluginId, pluginVersion, defaultOptions, defaultFieldConfig) {
|
11143
|
+
this._pluginId = pluginId;
|
11144
|
+
this._pluginVersion = pluginVersion;
|
11145
|
+
this._fieldConfigBuilder = new FieldConfigBuilder(defaultFieldConfig);
|
11146
|
+
this._panelOptionsBuilder = new PanelOptionsBuilder(defaultOptions);
|
11147
|
+
}
|
11148
|
+
setColor(color) {
|
11149
|
+
this._fieldConfigBuilder.setColor(color);
|
11150
|
+
return this;
|
11151
|
+
}
|
11152
|
+
setDecimals(decimals) {
|
11153
|
+
this._fieldConfigBuilder.setDecimals(decimals);
|
11154
|
+
return this;
|
11155
|
+
}
|
11156
|
+
setDisplayName(displayName) {
|
11157
|
+
this._fieldConfigBuilder.setDisplayName(displayName);
|
11158
|
+
return this;
|
11159
|
+
}
|
11160
|
+
setFilterable(filterable) {
|
11161
|
+
this._fieldConfigBuilder.setFilterable(filterable);
|
11162
|
+
return this;
|
11163
|
+
}
|
11164
|
+
setLinks(links) {
|
11165
|
+
this._fieldConfigBuilder.setLinks(links);
|
11166
|
+
return this;
|
11167
|
+
}
|
11168
|
+
setMappings(mappings) {
|
11169
|
+
this._fieldConfigBuilder.setMappings(mappings);
|
11170
|
+
return this;
|
11171
|
+
}
|
11172
|
+
setMax(max) {
|
11173
|
+
this._fieldConfigBuilder.setMax(max);
|
11174
|
+
return this;
|
11175
|
+
}
|
11176
|
+
setMin(min) {
|
11177
|
+
this._fieldConfigBuilder.setMin(min);
|
11178
|
+
return this;
|
11179
|
+
}
|
11180
|
+
setNoValue(noValue) {
|
11181
|
+
this._fieldConfigBuilder.setNoValue(noValue);
|
11182
|
+
return this;
|
11183
|
+
}
|
11184
|
+
setThresholds(thresholds) {
|
11185
|
+
this._fieldConfigBuilder.setThresholds(thresholds);
|
11186
|
+
return this;
|
11187
|
+
}
|
11188
|
+
setUnit(unit) {
|
11189
|
+
this._fieldConfigBuilder.setUnit(unit);
|
11190
|
+
return this;
|
11191
|
+
}
|
11192
|
+
setCustomFieldConfig(id, value) {
|
11193
|
+
this._fieldConfigBuilder.setCustomFieldConfig(id, value);
|
11194
|
+
return this;
|
11195
|
+
}
|
11196
|
+
setOverrides(builder) {
|
11197
|
+
this._fieldConfigBuilder.setOverrides(builder);
|
11198
|
+
return this;
|
11199
|
+
}
|
11200
|
+
setOption(id, value) {
|
11201
|
+
this._panelOptionsBuilder.setOption(id, value);
|
11202
|
+
return this;
|
11203
|
+
}
|
11204
|
+
build() {
|
11205
|
+
return {
|
11206
|
+
pluginId: this._pluginId,
|
11207
|
+
pluginVersion: this._pluginVersion,
|
11208
|
+
options: this._panelOptionsBuilder.build(),
|
11209
|
+
fieldConfig: this._fieldConfigBuilder.build()
|
11210
|
+
};
|
11211
|
+
}
|
11212
|
+
}
|
11213
|
+
|
11214
|
+
const VizConfigBuilders = {
|
11215
|
+
barchart() {
|
11216
|
+
return new VizConfigBuilder(
|
11217
|
+
"barchart",
|
11218
|
+
"10.0.0",
|
11219
|
+
() => BarChartPanelCfg_types_gen.defaultOptions,
|
11220
|
+
() => BarChartPanelCfg_types_gen.defaultFieldConfig
|
11221
|
+
);
|
11222
|
+
},
|
11223
|
+
bargauge() {
|
11224
|
+
return new VizConfigBuilder("bargauge", "10.0.0", () => BarGaugePanelCfg_types_gen.defaultOptions);
|
11225
|
+
},
|
11226
|
+
datagrid() {
|
11227
|
+
return new VizConfigBuilder("datagrid", "10.0.0", () => DatagridPanelCfg_types_gen.defaultOptions);
|
11228
|
+
},
|
11229
|
+
flamegraph() {
|
11230
|
+
return new VizConfigBuilder("flamegraph", "10.0.0");
|
11231
|
+
},
|
11232
|
+
gauge() {
|
11233
|
+
return new VizConfigBuilder("gauge", "10.0.0", () => GaugePanelCfg_types_gen.defaultOptions);
|
11234
|
+
},
|
11235
|
+
geomap() {
|
11236
|
+
return new VizConfigBuilder("geomap", "10.0.0", () => GeomapPanelCfg_types_gen.defaultOptions);
|
11237
|
+
},
|
11238
|
+
heatmap() {
|
11239
|
+
return new VizConfigBuilder("heatmap", "10.0.0", () => HeatmapPanelCfg_types_gen.defaultOptions);
|
11240
|
+
},
|
11241
|
+
histogram() {
|
11242
|
+
return new VizConfigBuilder(
|
11243
|
+
"histogram",
|
11244
|
+
"10.0.0",
|
11245
|
+
() => HistogramPanelCfg_types_gen.defaultOptions,
|
11246
|
+
() => HistogramPanelCfg_types_gen.defaultFieldConfig
|
11247
|
+
);
|
11248
|
+
},
|
11249
|
+
logs() {
|
11250
|
+
return new VizConfigBuilder("logs", "10.0.0");
|
11251
|
+
},
|
11252
|
+
news() {
|
11253
|
+
return new VizConfigBuilder("news", "10.0.0", () => NewsPanelCfg_types_gen.defaultOptions);
|
11254
|
+
},
|
11255
|
+
nodegraph() {
|
11256
|
+
return new VizConfigBuilder("nodeGraph", "10.0.0");
|
11257
|
+
},
|
11258
|
+
piechart() {
|
11259
|
+
return new VizConfigBuilder(
|
11260
|
+
"piechart",
|
11261
|
+
"10.0.0",
|
11262
|
+
() => PieChartPanelCfg_types_gen.defaultOptions
|
11263
|
+
);
|
11264
|
+
},
|
11265
|
+
stat() {
|
11266
|
+
return new VizConfigBuilder("stat", "10.0.0", () => StatPanelCfg_types_gen.defaultOptions);
|
11267
|
+
},
|
11268
|
+
statetimeline() {
|
11269
|
+
return new VizConfigBuilder(
|
11270
|
+
"state-timeline",
|
11271
|
+
"10.0.0",
|
11272
|
+
() => StateTimelinePanelCfg_types_gen.defaultOptions,
|
11273
|
+
() => StateTimelinePanelCfg_types_gen.defaultFieldConfig
|
11274
|
+
);
|
11275
|
+
},
|
11276
|
+
statushistory() {
|
11277
|
+
return new VizConfigBuilder(
|
11278
|
+
"status-history",
|
11279
|
+
"10.0.0",
|
11280
|
+
() => StatusHistoryPanelCfg_types_gen.defaultOptions,
|
11281
|
+
() => StatusHistoryPanelCfg_types_gen.defaultFieldConfig
|
11282
|
+
);
|
11283
|
+
},
|
11284
|
+
table() {
|
11285
|
+
return new VizConfigBuilder("table", "10.0.0", () => TablePanelCfg_types_gen.defaultOptions);
|
11286
|
+
},
|
11287
|
+
text() {
|
11288
|
+
return new VizConfigBuilder("text", "10.0.0", () => TextPanelCfg_types_gen.defaultOptions);
|
11289
|
+
},
|
11290
|
+
timeseries() {
|
11291
|
+
return new VizConfigBuilder("timeseries", "10.0.0");
|
11292
|
+
},
|
11293
|
+
trend() {
|
11294
|
+
return new VizConfigBuilder("trend", "10.0.0");
|
11295
|
+
},
|
11296
|
+
traces() {
|
11297
|
+
return new VizConfigBuilder("traces", "10.0.0");
|
11298
|
+
},
|
11299
|
+
xychart() {
|
11300
|
+
return new VizConfigBuilder(
|
11301
|
+
"xychart",
|
11302
|
+
"10.0.0",
|
11303
|
+
() => XYChartPanelCfg_types_gen.defaultOptions,
|
11304
|
+
() => XYChartPanelCfg_types_gen.defaultFieldConfig
|
11305
|
+
);
|
11306
|
+
}
|
11307
|
+
};
|
11308
|
+
|
11093
11309
|
const sceneUtils = {
|
11094
11310
|
getUrlWithAppState,
|
11095
11311
|
registerRuntimePanelPlugin,
|
@@ -11114,6 +11330,7 @@ exports.ConstantVariable = ConstantVariable;
|
|
11114
11330
|
exports.CustomVariable = CustomVariable;
|
11115
11331
|
exports.DataSourceVariable = DataSourceVariable;
|
11116
11332
|
exports.EmbeddedScene = EmbeddedScene;
|
11333
|
+
exports.FieldConfigBuilder = FieldConfigBuilder;
|
11117
11334
|
exports.FieldConfigBuilders = FieldConfigBuilders;
|
11118
11335
|
exports.FieldConfigOverridesBuilder = FieldConfigOverridesBuilder;
|
11119
11336
|
exports.GroupByVariable = GroupByVariable;
|
@@ -11168,7 +11385,10 @@ exports.UrlSyncManager = UrlSyncManager;
|
|
11168
11385
|
exports.UserActionEvent = UserActionEvent;
|
11169
11386
|
exports.VariableDependencyConfig = VariableDependencyConfig;
|
11170
11387
|
exports.VariableValueControl = VariableValueControl;
|
11388
|
+
exports.VariableValueSelectWrapper = VariableValueSelectWrapper;
|
11171
11389
|
exports.VariableValueSelectors = VariableValueSelectors;
|
11390
|
+
exports.VizConfigBuilder = VizConfigBuilder;
|
11391
|
+
exports.VizConfigBuilders = VizConfigBuilders;
|
11172
11392
|
exports.VizPanel = VizPanel;
|
11173
11393
|
exports.VizPanelBuilder = VizPanelBuilder;
|
11174
11394
|
exports.VizPanelMenu = VizPanelMenu;
|