@grafana/scenes 5.11.3--canary.858.10679390033.0 → 5.12.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +17 -5
- package/dist/esm/behaviors/SceneQueryController.js +5 -60
- package/dist/esm/behaviors/SceneQueryController.js.map +1 -1
- package/dist/esm/components/SceneRefreshPicker.js +1 -4
- package/dist/esm/components/SceneRefreshPicker.js.map +1 -1
- package/dist/esm/components/VizPanel/VizPanel.js +6 -9
- package/dist/esm/components/VizPanel/VizPanel.js.map +1 -1
- package/dist/esm/core/SceneTimeRange.js +32 -10
- package/dist/esm/core/SceneTimeRange.js.map +1 -1
- package/dist/esm/core/sceneGraph/index.js +1 -2
- package/dist/esm/core/sceneGraph/index.js.map +1 -1
- package/dist/esm/core/sceneGraph/sceneGraph.js +16 -1
- package/dist/esm/core/sceneGraph/sceneGraph.js.map +1 -1
- package/dist/esm/core/types.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/querying/SceneQueryRunner.js +3 -1
- package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
- package/dist/esm/querying/registerQueryWithController.js +2 -19
- package/dist/esm/querying/registerQueryWithController.js.map +1 -1
- package/dist/esm/services/useUrlSync.js.map +1 -1
- package/dist/esm/utils/getDataSource.js +1 -17
- package/dist/esm/utils/getDataSource.js.map +1 -1
- package/dist/esm/variables/components/VariableValueSelect.js +0 -5
- package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
- package/dist/esm/variables/variants/MultiValueVariable.js.map +1 -1
- package/dist/esm/variables/variants/TestVariable.js.map +1 -1
- package/dist/index.d.ts +25 -43
- package/dist/index.js +236 -469
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/esm/behaviors/SceneRenderProfiler.js +0 -168
- package/dist/esm/behaviors/SceneRenderProfiler.js.map +0 -1
- package/dist/esm/core/sceneGraph/getQueryController.js +0 -19
- package/dist/esm/core/sceneGraph/getQueryController.js.map +0 -1
package/dist/index.js
CHANGED
@@ -41,19 +41,19 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
41
41
|
var uFuzzy__default = /*#__PURE__*/_interopDefaultLegacy(uFuzzy);
|
42
42
|
var ReactGridLayout__default = /*#__PURE__*/_interopDefaultLegacy(ReactGridLayout);
|
43
43
|
|
44
|
-
var __defProp$
|
45
|
-
var __getOwnPropSymbols$
|
46
|
-
var __hasOwnProp$
|
47
|
-
var __propIsEnum$
|
48
|
-
var __defNormalProp$
|
49
|
-
var __spreadValues$
|
44
|
+
var __defProp$O = Object.defineProperty;
|
45
|
+
var __getOwnPropSymbols$O = Object.getOwnPropertySymbols;
|
46
|
+
var __hasOwnProp$O = Object.prototype.hasOwnProperty;
|
47
|
+
var __propIsEnum$O = Object.prototype.propertyIsEnumerable;
|
48
|
+
var __defNormalProp$O = (obj, key, value) => key in obj ? __defProp$O(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
49
|
+
var __spreadValues$O = (a, b) => {
|
50
50
|
for (var prop in b || (b = {}))
|
51
|
-
if (__hasOwnProp$
|
52
|
-
__defNormalProp$
|
53
|
-
if (__getOwnPropSymbols$
|
54
|
-
for (var prop of __getOwnPropSymbols$
|
55
|
-
if (__propIsEnum$
|
56
|
-
__defNormalProp$
|
51
|
+
if (__hasOwnProp$O.call(b, prop))
|
52
|
+
__defNormalProp$O(a, prop, b[prop]);
|
53
|
+
if (__getOwnPropSymbols$O)
|
54
|
+
for (var prop of __getOwnPropSymbols$O(b)) {
|
55
|
+
if (__propIsEnum$O.call(b, prop))
|
56
|
+
__defNormalProp$O(a, prop, b[prop]);
|
57
57
|
}
|
58
58
|
return a;
|
59
59
|
};
|
@@ -62,7 +62,7 @@ function useAppQueryParams() {
|
|
62
62
|
return runtime.locationSearchToObject(location.search || "");
|
63
63
|
}
|
64
64
|
function getUrlWithAppState(path, preserveParams) {
|
65
|
-
const paramsCopy = __spreadValues$
|
65
|
+
const paramsCopy = __spreadValues$O({}, runtime.locationService.getSearchObject());
|
66
66
|
if (preserveParams) {
|
67
67
|
for (const key of Object.keys(paramsCopy)) {
|
68
68
|
if (!preserveParams.includes(key)) {
|
@@ -76,31 +76,31 @@ function renderSceneComponentWithRouteProps(sceneObject, routeProps) {
|
|
76
76
|
return React__default["default"].createElement(sceneObject.Component, { model: sceneObject, routeProps });
|
77
77
|
}
|
78
78
|
|
79
|
-
var __defProp$
|
80
|
-
var __defProps$
|
81
|
-
var __getOwnPropDescs$
|
82
|
-
var __getOwnPropSymbols$
|
83
|
-
var __hasOwnProp$
|
84
|
-
var __propIsEnum$
|
85
|
-
var __defNormalProp$
|
86
|
-
var __spreadValues$
|
79
|
+
var __defProp$N = Object.defineProperty;
|
80
|
+
var __defProps$u = Object.defineProperties;
|
81
|
+
var __getOwnPropDescs$u = Object.getOwnPropertyDescriptors;
|
82
|
+
var __getOwnPropSymbols$N = Object.getOwnPropertySymbols;
|
83
|
+
var __hasOwnProp$N = Object.prototype.hasOwnProperty;
|
84
|
+
var __propIsEnum$N = Object.prototype.propertyIsEnumerable;
|
85
|
+
var __defNormalProp$N = (obj, key, value) => key in obj ? __defProp$N(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
86
|
+
var __spreadValues$N = (a, b) => {
|
87
87
|
for (var prop in b || (b = {}))
|
88
|
-
if (__hasOwnProp$
|
89
|
-
__defNormalProp$
|
90
|
-
if (__getOwnPropSymbols$
|
91
|
-
for (var prop of __getOwnPropSymbols$
|
92
|
-
if (__propIsEnum$
|
93
|
-
__defNormalProp$
|
88
|
+
if (__hasOwnProp$N.call(b, prop))
|
89
|
+
__defNormalProp$N(a, prop, b[prop]);
|
90
|
+
if (__getOwnPropSymbols$N)
|
91
|
+
for (var prop of __getOwnPropSymbols$N(b)) {
|
92
|
+
if (__propIsEnum$N.call(b, prop))
|
93
|
+
__defNormalProp$N(a, prop, b[prop]);
|
94
94
|
}
|
95
95
|
return a;
|
96
96
|
};
|
97
|
-
var __spreadProps$
|
97
|
+
var __spreadProps$u = (a, b) => __defProps$u(a, __getOwnPropDescs$u(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$u(__spreadValues$N({}, plugin.meta), {
|
104
104
|
id: pluginId,
|
105
105
|
name: pluginId,
|
106
106
|
module: "runtime plugin",
|
@@ -128,33 +128,33 @@ function loadPanelPluginSync(pluginId) {
|
|
128
128
|
return (_a = getPanelPluginFromCache(pluginId)) != null ? _a : runtimePanelPlugins.get(pluginId);
|
129
129
|
}
|
130
130
|
|
131
|
-
var __defProp$
|
132
|
-
var __defProps$
|
133
|
-
var __getOwnPropDescs$
|
134
|
-
var __getOwnPropSymbols$
|
135
|
-
var __hasOwnProp$
|
136
|
-
var __propIsEnum$
|
137
|
-
var __defNormalProp$
|
138
|
-
var __spreadValues$
|
131
|
+
var __defProp$M = Object.defineProperty;
|
132
|
+
var __defProps$t = Object.defineProperties;
|
133
|
+
var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
|
134
|
+
var __getOwnPropSymbols$M = Object.getOwnPropertySymbols;
|
135
|
+
var __hasOwnProp$M = Object.prototype.hasOwnProperty;
|
136
|
+
var __propIsEnum$M = Object.prototype.propertyIsEnumerable;
|
137
|
+
var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
138
|
+
var __spreadValues$M = (a, b) => {
|
139
139
|
for (var prop in b || (b = {}))
|
140
|
-
if (__hasOwnProp$
|
141
|
-
__defNormalProp$
|
142
|
-
if (__getOwnPropSymbols$
|
143
|
-
for (var prop of __getOwnPropSymbols$
|
144
|
-
if (__propIsEnum$
|
145
|
-
__defNormalProp$
|
140
|
+
if (__hasOwnProp$M.call(b, prop))
|
141
|
+
__defNormalProp$M(a, prop, b[prop]);
|
142
|
+
if (__getOwnPropSymbols$M)
|
143
|
+
for (var prop of __getOwnPropSymbols$M(b)) {
|
144
|
+
if (__propIsEnum$M.call(b, prop))
|
145
|
+
__defNormalProp$M(a, prop, b[prop]);
|
146
146
|
}
|
147
147
|
return a;
|
148
148
|
};
|
149
|
-
var __spreadProps$
|
149
|
+
var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
|
150
150
|
var __objRest$5 = (source, exclude) => {
|
151
151
|
var target = {};
|
152
152
|
for (var prop in source)
|
153
|
-
if (__hasOwnProp$
|
153
|
+
if (__hasOwnProp$M.call(source, prop) && exclude.indexOf(prop) < 0)
|
154
154
|
target[prop] = source[prop];
|
155
|
-
if (source != null && __getOwnPropSymbols$
|
156
|
-
for (var prop of __getOwnPropSymbols$
|
157
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
155
|
+
if (source != null && __getOwnPropSymbols$M)
|
156
|
+
for (var prop of __getOwnPropSymbols$M(source)) {
|
157
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$M.call(source, prop))
|
158
158
|
target[prop] = source[prop];
|
159
159
|
}
|
160
160
|
return target;
|
@@ -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$t(__spreadValues$M({}, otherProps), {
|
176
176
|
model
|
177
177
|
}));
|
178
178
|
}
|
@@ -188,49 +188,49 @@ class UserActionEvent extends data.BusEventWithPayload {
|
|
188
188
|
}
|
189
189
|
UserActionEvent.type = "scene-object-user-action";
|
190
190
|
|
191
|
-
var __accessCheck$
|
191
|
+
var __accessCheck$3 = (obj, member, msg) => {
|
192
192
|
if (!member.has(obj))
|
193
193
|
throw TypeError("Cannot " + msg);
|
194
194
|
};
|
195
|
-
var __privateGet$
|
196
|
-
__accessCheck$
|
195
|
+
var __privateGet$3 = (obj, member, getter) => {
|
196
|
+
__accessCheck$3(obj, member, "read from private field");
|
197
197
|
return getter ? getter.call(obj) : member.get(obj);
|
198
198
|
};
|
199
|
-
var __privateAdd$
|
199
|
+
var __privateAdd$3 = (obj, member, value) => {
|
200
200
|
if (member.has(obj))
|
201
201
|
throw TypeError("Cannot add the same private member more than once");
|
202
202
|
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
203
203
|
};
|
204
|
-
var __privateSet$
|
205
|
-
__accessCheck$
|
204
|
+
var __privateSet$2 = (obj, member, value, setter) => {
|
205
|
+
__accessCheck$3(obj, member, "write to private field");
|
206
206
|
setter ? setter.call(obj, value) : member.set(obj, value);
|
207
207
|
return value;
|
208
208
|
};
|
209
209
|
var _ref;
|
210
210
|
class SceneObjectRef {
|
211
211
|
constructor(ref) {
|
212
|
-
__privateAdd$
|
213
|
-
__privateSet$
|
212
|
+
__privateAdd$3(this, _ref, void 0);
|
213
|
+
__privateSet$2(this, _ref, ref);
|
214
214
|
}
|
215
215
|
resolve() {
|
216
|
-
return __privateGet$
|
216
|
+
return __privateGet$3(this, _ref);
|
217
217
|
}
|
218
218
|
}
|
219
219
|
_ref = new WeakMap();
|
220
220
|
|
221
|
-
var __defProp$
|
222
|
-
var __getOwnPropSymbols$
|
223
|
-
var __hasOwnProp$
|
224
|
-
var __propIsEnum$
|
225
|
-
var __defNormalProp$
|
226
|
-
var __spreadValues$
|
221
|
+
var __defProp$L = Object.defineProperty;
|
222
|
+
var __getOwnPropSymbols$L = Object.getOwnPropertySymbols;
|
223
|
+
var __hasOwnProp$L = Object.prototype.hasOwnProperty;
|
224
|
+
var __propIsEnum$L = Object.prototype.propertyIsEnumerable;
|
225
|
+
var __defNormalProp$L = (obj, key, value) => key in obj ? __defProp$L(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
226
|
+
var __spreadValues$L = (a, b) => {
|
227
227
|
for (var prop in b || (b = {}))
|
228
|
-
if (__hasOwnProp$
|
229
|
-
__defNormalProp$
|
230
|
-
if (__getOwnPropSymbols$
|
231
|
-
for (var prop of __getOwnPropSymbols$
|
232
|
-
if (__propIsEnum$
|
233
|
-
__defNormalProp$
|
228
|
+
if (__hasOwnProp$L.call(b, prop))
|
229
|
+
__defNormalProp$L(a, prop, b[prop]);
|
230
|
+
if (__getOwnPropSymbols$L)
|
231
|
+
for (var prop of __getOwnPropSymbols$L(b)) {
|
232
|
+
if (__propIsEnum$L.call(b, prop))
|
233
|
+
__defNormalProp$L(a, prop, b[prop]);
|
234
234
|
}
|
235
235
|
return a;
|
236
236
|
};
|
@@ -290,7 +290,7 @@ class SceneObjectBase {
|
|
290
290
|
}
|
291
291
|
setState(update) {
|
292
292
|
const prevState = this._state;
|
293
|
-
const newState = __spreadValues$
|
293
|
+
const newState = __spreadValues$L(__spreadValues$L({}, this._state), update);
|
294
294
|
this._state = Object.freeze(newState);
|
295
295
|
this._setParent(update);
|
296
296
|
this._handleActivationOfChangedStateProps(prevState, newState);
|
@@ -486,19 +486,19 @@ function forEachChild(state, callback) {
|
|
486
486
|
}
|
487
487
|
}
|
488
488
|
|
489
|
-
var __defProp$
|
490
|
-
var __getOwnPropSymbols$
|
491
|
-
var __hasOwnProp$
|
492
|
-
var __propIsEnum$
|
493
|
-
var __defNormalProp$
|
494
|
-
var __spreadValues$
|
489
|
+
var __defProp$K = Object.defineProperty;
|
490
|
+
var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
|
491
|
+
var __hasOwnProp$K = Object.prototype.hasOwnProperty;
|
492
|
+
var __propIsEnum$K = Object.prototype.propertyIsEnumerable;
|
493
|
+
var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
494
|
+
var __spreadValues$K = (a, b) => {
|
495
495
|
for (var prop in b || (b = {}))
|
496
|
-
if (__hasOwnProp$
|
497
|
-
__defNormalProp$
|
498
|
-
if (__getOwnPropSymbols$
|
499
|
-
for (var prop of __getOwnPropSymbols$
|
500
|
-
if (__propIsEnum$
|
501
|
-
__defNormalProp$
|
496
|
+
if (__hasOwnProp$K.call(b, prop))
|
497
|
+
__defNormalProp$K(a, prop, b[prop]);
|
498
|
+
if (__getOwnPropSymbols$K)
|
499
|
+
for (var prop of __getOwnPropSymbols$K(b)) {
|
500
|
+
if (__propIsEnum$K.call(b, prop))
|
501
|
+
__defNormalProp$K(a, prop, b[prop]);
|
502
502
|
}
|
503
503
|
return a;
|
504
504
|
};
|
@@ -507,7 +507,7 @@ function cloneSceneObject(sceneObject, withState) {
|
|
507
507
|
return new sceneObject.constructor(clonedState);
|
508
508
|
}
|
509
509
|
function cloneSceneObjectState(sceneState, withState) {
|
510
|
-
const clonedState = __spreadValues$
|
510
|
+
const clonedState = __spreadValues$K({}, sceneState);
|
511
511
|
for (const key in clonedState) {
|
512
512
|
const propValue = clonedState[key];
|
513
513
|
if (propValue instanceof SceneObjectBase) {
|
@@ -604,304 +604,6 @@ function lookupVariable(name, sceneObject) {
|
|
604
604
|
return null;
|
605
605
|
}
|
606
606
|
|
607
|
-
function writeSceneLog(logger, message, ...rest) {
|
608
|
-
let loggingEnabled = false;
|
609
|
-
if (typeof window !== "undefined") {
|
610
|
-
loggingEnabled = localStorage.getItem("grafana.debug.scenes") === "true";
|
611
|
-
}
|
612
|
-
if (loggingEnabled) {
|
613
|
-
console.log(`${logger}: `, message, ...rest);
|
614
|
-
}
|
615
|
-
}
|
616
|
-
|
617
|
-
var __accessCheck$3 = (obj, member, msg) => {
|
618
|
-
if (!member.has(obj))
|
619
|
-
throw TypeError("Cannot " + msg);
|
620
|
-
};
|
621
|
-
var __privateGet$3 = (obj, member, getter) => {
|
622
|
-
__accessCheck$3(obj, member, "read from private field");
|
623
|
-
return getter ? getter.call(obj) : member.get(obj);
|
624
|
-
};
|
625
|
-
var __privateAdd$3 = (obj, member, value) => {
|
626
|
-
if (member.has(obj))
|
627
|
-
throw TypeError("Cannot add the same private member more than once");
|
628
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
629
|
-
};
|
630
|
-
var __privateSet$3 = (obj, member, value, setter) => {
|
631
|
-
__accessCheck$3(obj, member, "write to private field");
|
632
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
633
|
-
return value;
|
634
|
-
};
|
635
|
-
var _profileInProgress, _profileStartTs, _trailAnimationFrameId, _recordedTrailingSpans;
|
636
|
-
const POST_STORM_WINDOW = 2e3;
|
637
|
-
const SPAN_THRESHOLD = 30;
|
638
|
-
class SceneRenderProfiler {
|
639
|
-
constructor(queryController) {
|
640
|
-
this.queryController = queryController;
|
641
|
-
__privateAdd$3(this, _profileInProgress, null);
|
642
|
-
__privateAdd$3(this, _profileStartTs, null);
|
643
|
-
__privateAdd$3(this, _trailAnimationFrameId, null);
|
644
|
-
__privateAdd$3(this, _recordedTrailingSpans, []);
|
645
|
-
this.lastFrameTime = 0;
|
646
|
-
this.measureTrailingFrames = (measurementStartTs, lastFrameTime, profileStartTs) => {
|
647
|
-
const currentFrameTime = performance.now();
|
648
|
-
const frameLength = currentFrameTime - lastFrameTime;
|
649
|
-
__privateGet$3(this, _recordedTrailingSpans).push(frameLength);
|
650
|
-
if (currentFrameTime - measurementStartTs < POST_STORM_WINDOW) {
|
651
|
-
__privateSet$3(this, _trailAnimationFrameId, requestAnimationFrame(
|
652
|
-
() => this.measureTrailingFrames(measurementStartTs, currentFrameTime, profileStartTs)
|
653
|
-
));
|
654
|
-
} else {
|
655
|
-
const slowFrames = processRecordedSpans(__privateGet$3(this, _recordedTrailingSpans));
|
656
|
-
const slowFramesTime = slowFrames.reduce((acc, val) => acc + val, 0);
|
657
|
-
writeSceneLog(
|
658
|
-
this.constructor.name,
|
659
|
-
"Profile tail recorded, slow frames duration:",
|
660
|
-
slowFramesTime,
|
661
|
-
slowFrames,
|
662
|
-
__privateGet$3(this, _profileInProgress)
|
663
|
-
);
|
664
|
-
__privateSet$3(this, _recordedTrailingSpans, []);
|
665
|
-
const profileDuration = measurementStartTs - profileStartTs;
|
666
|
-
writeSceneLog(
|
667
|
-
this.constructor.name,
|
668
|
-
"Stoped recording, total measured time (network included):",
|
669
|
-
profileDuration + slowFramesTime
|
670
|
-
);
|
671
|
-
__privateSet$3(this, _trailAnimationFrameId, null);
|
672
|
-
const profileEndTs = profileStartTs + profileDuration + slowFramesTime;
|
673
|
-
performance.measure("DashboardInteraction", {
|
674
|
-
start: profileStartTs,
|
675
|
-
end: profileEndTs
|
676
|
-
});
|
677
|
-
const networkDuration = captureNetwork(profileStartTs, profileEndTs);
|
678
|
-
if (this.queryController.state.onProfileComplete) {
|
679
|
-
this.queryController.state.onProfileComplete({
|
680
|
-
origin: __privateGet$3(this, _profileInProgress).origin,
|
681
|
-
crumbs: __privateGet$3(this, _profileInProgress).crumbs,
|
682
|
-
duration: profileDuration + slowFramesTime,
|
683
|
-
networkDuration,
|
684
|
-
jsHeapSizeLimit: performance.memory ? performance.memory.jsHeapSizeLimit : 0,
|
685
|
-
usedJSHeapSize: performance.memory ? performance.memory.usedJSHeapSize : 0,
|
686
|
-
totalJSHeapSize: performance.memory ? performance.memory.totalJSHeapSize : 0
|
687
|
-
});
|
688
|
-
}
|
689
|
-
if (window.__runs) {
|
690
|
-
window.__runs += `${Date.now()}, ${profileDuration + slowFramesTime}
|
691
|
-
`;
|
692
|
-
} else {
|
693
|
-
window.__runs = `${Date.now()}, ${profileDuration + slowFramesTime}
|
694
|
-
`;
|
695
|
-
}
|
696
|
-
}
|
697
|
-
};
|
698
|
-
}
|
699
|
-
startProfile(name) {
|
700
|
-
if (__privateGet$3(this, _trailAnimationFrameId)) {
|
701
|
-
cancelAnimationFrame(__privateGet$3(this, _trailAnimationFrameId));
|
702
|
-
__privateSet$3(this, _trailAnimationFrameId, null);
|
703
|
-
writeSceneLog(this.constructor.name, "New profile: Stopped recording frames");
|
704
|
-
}
|
705
|
-
__privateSet$3(this, _profileInProgress, { origin: name, crumbs: [] });
|
706
|
-
__privateSet$3(this, _profileStartTs, performance.now());
|
707
|
-
writeSceneLog(this.constructor.name, "Profile started:", __privateGet$3(this, _profileInProgress), __privateGet$3(this, _profileStartTs));
|
708
|
-
}
|
709
|
-
recordProfileTail(measurementStartTime, profileStartTs) {
|
710
|
-
__privateSet$3(this, _trailAnimationFrameId, requestAnimationFrame(
|
711
|
-
() => this.measureTrailingFrames(measurementStartTime, measurementStartTime, profileStartTs)
|
712
|
-
));
|
713
|
-
}
|
714
|
-
tryCompletingProfile() {
|
715
|
-
writeSceneLog(this.constructor.name, "Trying to complete profile", __privateGet$3(this, _profileInProgress));
|
716
|
-
if (this.queryController.runningQueriesCount() === 0 && __privateGet$3(this, _profileInProgress)) {
|
717
|
-
writeSceneLog(this.constructor.name, "All queries completed, stopping profile");
|
718
|
-
this.recordProfileTail(performance.now(), __privateGet$3(this, _profileStartTs));
|
719
|
-
}
|
720
|
-
}
|
721
|
-
isTailRecording() {
|
722
|
-
return Boolean(__privateGet$3(this, _trailAnimationFrameId));
|
723
|
-
}
|
724
|
-
cancelTailRecording() {
|
725
|
-
if (__privateGet$3(this, _trailAnimationFrameId)) {
|
726
|
-
cancelAnimationFrame(__privateGet$3(this, _trailAnimationFrameId));
|
727
|
-
__privateSet$3(this, _trailAnimationFrameId, null);
|
728
|
-
writeSceneLog(this.constructor.name, "Cancelled recording frames, new profile started");
|
729
|
-
}
|
730
|
-
}
|
731
|
-
addCrumb(crumb) {
|
732
|
-
if (__privateGet$3(this, _profileInProgress)) {
|
733
|
-
__privateGet$3(this, _profileInProgress).crumbs.push(crumb);
|
734
|
-
}
|
735
|
-
}
|
736
|
-
}
|
737
|
-
_profileInProgress = new WeakMap();
|
738
|
-
_profileStartTs = new WeakMap();
|
739
|
-
_trailAnimationFrameId = new WeakMap();
|
740
|
-
_recordedTrailingSpans = new WeakMap();
|
741
|
-
function processRecordedSpans(spans) {
|
742
|
-
for (let i = spans.length - 1; i >= 0; i--) {
|
743
|
-
if (spans[i] > SPAN_THRESHOLD) {
|
744
|
-
return spans.slice(0, i + 1);
|
745
|
-
}
|
746
|
-
}
|
747
|
-
return [spans[0]];
|
748
|
-
}
|
749
|
-
function captureNetwork(startTs, endTs) {
|
750
|
-
const entries = performance.getEntriesByType("resource");
|
751
|
-
const networkEntries = entries.filter((entry) => entry.startTime >= startTs && entry.startTime <= endTs);
|
752
|
-
for (const entry of networkEntries) {
|
753
|
-
performance.measure("Network entry " + entry.name, {
|
754
|
-
start: entry.startTime,
|
755
|
-
end: entry.responseEnd
|
756
|
-
});
|
757
|
-
}
|
758
|
-
return calculateNetworkTime(networkEntries);
|
759
|
-
}
|
760
|
-
function calculateNetworkTime(requests) {
|
761
|
-
if (requests.length === 0) {
|
762
|
-
return 0;
|
763
|
-
}
|
764
|
-
requests.sort((a, b) => a.startTime - b.startTime);
|
765
|
-
let totalNetworkTime = 0;
|
766
|
-
let currentStart = requests[0].startTime;
|
767
|
-
let currentEnd = requests[0].responseEnd;
|
768
|
-
for (let i = 1; i < requests.length; i++) {
|
769
|
-
if (requests[i].startTime <= currentEnd) {
|
770
|
-
currentEnd = Math.max(currentEnd, requests[i].responseEnd);
|
771
|
-
} else {
|
772
|
-
totalNetworkTime += currentEnd - currentStart;
|
773
|
-
currentStart = requests[i].startTime;
|
774
|
-
currentEnd = requests[i].responseEnd;
|
775
|
-
}
|
776
|
-
}
|
777
|
-
totalNetworkTime += currentEnd - currentStart;
|
778
|
-
return totalNetworkTime;
|
779
|
-
}
|
780
|
-
|
781
|
-
var __defProp$K = Object.defineProperty;
|
782
|
-
var __defProps$t = Object.defineProperties;
|
783
|
-
var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
|
784
|
-
var __getOwnPropSymbols$K = Object.getOwnPropertySymbols;
|
785
|
-
var __hasOwnProp$K = Object.prototype.hasOwnProperty;
|
786
|
-
var __propIsEnum$K = Object.prototype.propertyIsEnumerable;
|
787
|
-
var __defNormalProp$K = (obj, key, value) => key in obj ? __defProp$K(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
788
|
-
var __spreadValues$K = (a, b) => {
|
789
|
-
for (var prop in b || (b = {}))
|
790
|
-
if (__hasOwnProp$K.call(b, prop))
|
791
|
-
__defNormalProp$K(a, prop, b[prop]);
|
792
|
-
if (__getOwnPropSymbols$K)
|
793
|
-
for (var prop of __getOwnPropSymbols$K(b)) {
|
794
|
-
if (__propIsEnum$K.call(b, prop))
|
795
|
-
__defNormalProp$K(a, prop, b[prop]);
|
796
|
-
}
|
797
|
-
return a;
|
798
|
-
};
|
799
|
-
var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
|
800
|
-
var __accessCheck$2 = (obj, member, msg) => {
|
801
|
-
if (!member.has(obj))
|
802
|
-
throw TypeError("Cannot " + msg);
|
803
|
-
};
|
804
|
-
var __privateGet$2 = (obj, member, getter) => {
|
805
|
-
__accessCheck$2(obj, member, "read from private field");
|
806
|
-
return getter ? getter.call(obj) : member.get(obj);
|
807
|
-
};
|
808
|
-
var __privateAdd$2 = (obj, member, value) => {
|
809
|
-
if (member.has(obj))
|
810
|
-
throw TypeError("Cannot add the same private member more than once");
|
811
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
812
|
-
};
|
813
|
-
var __privateSet$2 = (obj, member, value, setter) => {
|
814
|
-
__accessCheck$2(obj, member, "write to private field");
|
815
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
816
|
-
return value;
|
817
|
-
};
|
818
|
-
var _running, _tryCompleteProfileFrameId;
|
819
|
-
function isQueryController(s) {
|
820
|
-
return "isQueryController" in s;
|
821
|
-
}
|
822
|
-
class SceneQueryController extends SceneObjectBase {
|
823
|
-
constructor(state = {}) {
|
824
|
-
super(__spreadProps$t(__spreadValues$K({}, state), { isRunning: false }));
|
825
|
-
this.isQueryController = true;
|
826
|
-
this.profiler = new SceneRenderProfiler(this);
|
827
|
-
__privateAdd$2(this, _running, /* @__PURE__ */ new Set());
|
828
|
-
__privateAdd$2(this, _tryCompleteProfileFrameId, null);
|
829
|
-
this.runningQueriesCount = () => {
|
830
|
-
return __privateGet$2(this, _running).size;
|
831
|
-
};
|
832
|
-
this.addActivationHandler(() => {
|
833
|
-
return () => __privateGet$2(this, _running).clear();
|
834
|
-
});
|
835
|
-
}
|
836
|
-
startProfile(source) {
|
837
|
-
if (!this.state.enableProfiling) {
|
838
|
-
return;
|
839
|
-
}
|
840
|
-
this.profiler.startProfile(source.constructor.name);
|
841
|
-
}
|
842
|
-
queryStarted(entry) {
|
843
|
-
__privateGet$2(this, _running).add(entry);
|
844
|
-
this.changeRunningQueryCount(1, entry);
|
845
|
-
if (!this.state.isRunning) {
|
846
|
-
this.setState({ isRunning: true });
|
847
|
-
}
|
848
|
-
}
|
849
|
-
queryCompleted(entry) {
|
850
|
-
if (!__privateGet$2(this, _running).has(entry)) {
|
851
|
-
return;
|
852
|
-
}
|
853
|
-
__privateGet$2(this, _running).delete(entry);
|
854
|
-
this.changeRunningQueryCount(-1);
|
855
|
-
if (__privateGet$2(this, _running).size === 0) {
|
856
|
-
this.setState({ isRunning: false });
|
857
|
-
}
|
858
|
-
}
|
859
|
-
changeRunningQueryCount(dir, entry) {
|
860
|
-
var _a;
|
861
|
-
window.__grafanaRunningQueryCount = ((_a = window.__grafanaRunningQueryCount) != null ? _a : 0) + dir;
|
862
|
-
if (dir === 1 && this.state.enableProfiling) {
|
863
|
-
if (entry) {
|
864
|
-
this.profiler.addCrumb(`${entry.origin.constructor.name}/${entry.type}`);
|
865
|
-
}
|
866
|
-
if (this.profiler.isTailRecording()) {
|
867
|
-
writeSceneLog(this.constructor.name, "New query started, cancelling tail recording");
|
868
|
-
this.profiler.cancelTailRecording();
|
869
|
-
}
|
870
|
-
}
|
871
|
-
if (this.state.enableProfiling) {
|
872
|
-
if (__privateGet$2(this, _tryCompleteProfileFrameId)) {
|
873
|
-
cancelAnimationFrame(__privateGet$2(this, _tryCompleteProfileFrameId));
|
874
|
-
}
|
875
|
-
__privateSet$2(this, _tryCompleteProfileFrameId, requestAnimationFrame(() => {
|
876
|
-
this.profiler.tryCompletingProfile();
|
877
|
-
}));
|
878
|
-
}
|
879
|
-
}
|
880
|
-
cancelAll() {
|
881
|
-
var _a;
|
882
|
-
for (const entry of __privateGet$2(this, _running).values()) {
|
883
|
-
(_a = entry.cancel) == null ? void 0 : _a.call(entry);
|
884
|
-
}
|
885
|
-
}
|
886
|
-
}
|
887
|
-
_running = new WeakMap();
|
888
|
-
_tryCompleteProfileFrameId = new WeakMap();
|
889
|
-
|
890
|
-
function getQueryController(sceneObject) {
|
891
|
-
let parent = sceneObject;
|
892
|
-
while (parent) {
|
893
|
-
if (parent.state.$behaviors) {
|
894
|
-
for (const behavior of parent.state.$behaviors) {
|
895
|
-
if (isQueryController(behavior)) {
|
896
|
-
return behavior;
|
897
|
-
}
|
898
|
-
}
|
899
|
-
}
|
900
|
-
parent = parent.parent;
|
901
|
-
}
|
902
|
-
return void 0;
|
903
|
-
}
|
904
|
-
|
905
607
|
var __defProp$J = Object.defineProperty;
|
906
608
|
var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
|
907
609
|
var __hasOwnProp$J = Object.prototype.hasOwnProperty;
|
@@ -1032,7 +734,7 @@ class SceneTimeRange extends SceneObjectBase {
|
|
1032
734
|
);
|
1033
735
|
const refreshOnActivate = (_c = state.refreshOnActivate) != null ? _c : { percent: 10 };
|
1034
736
|
super(__spreadValues$I({ from, to, timeZone, value, refreshOnActivate }, state));
|
1035
|
-
this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["from", "to", "timezone"] });
|
737
|
+
this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["from", "to", "timezone", "time", "time.window"] });
|
1036
738
|
this.onTimeRangeChange = (timeRange) => {
|
1037
739
|
const update = {};
|
1038
740
|
const updateToEval = {};
|
@@ -1058,8 +760,6 @@ class SceneTimeRange extends SceneObjectBase {
|
|
1058
760
|
this.state.UNSAFE_nowDelay
|
1059
761
|
);
|
1060
762
|
if (update.from !== this.state.from || update.to !== this.state.to) {
|
1061
|
-
const queryController = getQueryController(this);
|
1062
|
-
queryController == null ? void 0 : queryController.startProfile(this);
|
1063
763
|
this.setState(update);
|
1064
764
|
}
|
1065
765
|
};
|
@@ -1172,23 +872,35 @@ class SceneTimeRange extends SceneObjectBase {
|
|
1172
872
|
return data.getTimeZone();
|
1173
873
|
}
|
1174
874
|
getUrlState() {
|
875
|
+
const params = runtime.locationService.getSearchObject();
|
1175
876
|
const urlValues = { from: this.state.from, to: this.state.to };
|
1176
877
|
if (this.state.timeZone) {
|
1177
878
|
urlValues.timezone = this.state.timeZone;
|
1178
879
|
}
|
880
|
+
if (params.time && params["time.window"]) {
|
881
|
+
urlValues.time = null;
|
882
|
+
urlValues["time.window"] = null;
|
883
|
+
}
|
1179
884
|
return urlValues;
|
1180
885
|
}
|
1181
886
|
updateFromUrl(values) {
|
1182
887
|
var _a, _b, _c;
|
1183
|
-
|
888
|
+
const update = {};
|
889
|
+
let from = parseUrlParam(values.from);
|
890
|
+
let to = parseUrlParam(values.to);
|
891
|
+
if (values.time && values["time.window"]) {
|
892
|
+
const time = Array.isArray(values.time) ? values.time[0] : values.time;
|
893
|
+
const timeWindow = Array.isArray(values["time.window"]) ? values["time.window"][0] : values["time.window"];
|
894
|
+
const timeRange = getTimeWindow(time, timeWindow);
|
895
|
+
from = timeRange.from;
|
896
|
+
to = timeRange.to;
|
897
|
+
}
|
898
|
+
if (!from && !to) {
|
1184
899
|
return;
|
1185
900
|
}
|
1186
|
-
const update = {};
|
1187
|
-
const from = parseUrlParam(values.from);
|
1188
901
|
if (from) {
|
1189
902
|
update.from = from;
|
1190
903
|
}
|
1191
|
-
const to = parseUrlParam(values.to);
|
1192
904
|
if (to) {
|
1193
905
|
update.to = to;
|
1194
906
|
}
|
@@ -1205,6 +917,19 @@ class SceneTimeRange extends SceneObjectBase {
|
|
1205
917
|
this.setState(update);
|
1206
918
|
}
|
1207
919
|
}
|
920
|
+
function getTimeWindow(time, timeWindow) {
|
921
|
+
const valueTime = isNaN(Date.parse(time)) ? parseInt(time, 10) : Date.parse(time);
|
922
|
+
let timeWindowMs;
|
923
|
+
if (timeWindow.match(/^\d+$/) && parseInt(timeWindow, 10)) {
|
924
|
+
timeWindowMs = parseInt(timeWindow, 10);
|
925
|
+
} else {
|
926
|
+
timeWindowMs = data.rangeUtil.intervalToMs(timeWindow);
|
927
|
+
}
|
928
|
+
return {
|
929
|
+
from: data.toUtc(valueTime - timeWindowMs / 2).toISOString(),
|
930
|
+
to: data.toUtc(valueTime + timeWindowMs / 2).toISOString()
|
931
|
+
};
|
932
|
+
}
|
1208
933
|
|
1209
934
|
const EmptyDataNode = new SceneDataNode();
|
1210
935
|
const DefaultTimeRange = new SceneTimeRange();
|
@@ -2082,56 +1807,70 @@ function isDataLayer(obj) {
|
|
2082
1807
|
return "isDataLayer" in obj;
|
2083
1808
|
}
|
2084
1809
|
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2089
|
-
|
2090
|
-
|
2091
|
-
|
2092
|
-
|
2093
|
-
|
2094
|
-
|
2095
|
-
|
2096
|
-
|
2097
|
-
|
2098
|
-
|
2099
|
-
|
2100
|
-
|
2101
|
-
queryControler.queryCompleted(entry);
|
2102
|
-
}
|
2103
|
-
observer.next(v);
|
2104
|
-
},
|
2105
|
-
error: (e) => observer.error(e),
|
2106
|
-
complete: () => {
|
2107
|
-
observer.complete();
|
2108
|
-
}
|
2109
|
-
});
|
2110
|
-
return () => {
|
2111
|
-
sub.unsubscribe();
|
2112
|
-
if (!markedAsCompleted) {
|
2113
|
-
queryControler.queryCompleted(entry);
|
2114
|
-
}
|
2115
|
-
};
|
2116
|
-
});
|
2117
|
-
};
|
1810
|
+
var __accessCheck$2 = (obj, member, msg) => {
|
1811
|
+
if (!member.has(obj))
|
1812
|
+
throw TypeError("Cannot " + msg);
|
1813
|
+
};
|
1814
|
+
var __privateGet$2 = (obj, member, getter) => {
|
1815
|
+
__accessCheck$2(obj, member, "read from private field");
|
1816
|
+
return getter ? getter.call(obj) : member.get(obj);
|
1817
|
+
};
|
1818
|
+
var __privateAdd$2 = (obj, member, value) => {
|
1819
|
+
if (member.has(obj))
|
1820
|
+
throw TypeError("Cannot add the same private member more than once");
|
1821
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
1822
|
+
};
|
1823
|
+
var _running;
|
1824
|
+
function isQueryController(s) {
|
1825
|
+
return "isQueryController" in s;
|
2118
1826
|
}
|
2119
|
-
|
2120
|
-
|
2121
|
-
|
2122
|
-
|
2123
|
-
|
2124
|
-
|
2125
|
-
|
2126
|
-
rxjs.catchError(() => {
|
2127
|
-
observer.next({ state: schema.LoadingState.Error });
|
2128
|
-
return [];
|
2129
|
-
})
|
2130
|
-
).subscribe({
|
2131
|
-
next: (result) => observer.next(result),
|
2132
|
-
complete: () => observer.complete()
|
1827
|
+
class SceneQueryController extends SceneObjectBase {
|
1828
|
+
constructor() {
|
1829
|
+
super({ isRunning: false });
|
1830
|
+
this.isQueryController = true;
|
1831
|
+
__privateAdd$2(this, _running, /* @__PURE__ */ new Set());
|
1832
|
+
this.addActivationHandler(() => {
|
1833
|
+
return () => __privateGet$2(this, _running).clear();
|
2133
1834
|
});
|
2134
|
-
}
|
1835
|
+
}
|
1836
|
+
queryStarted(entry) {
|
1837
|
+
__privateGet$2(this, _running).add(entry);
|
1838
|
+
this.changeRunningQueryCount(1);
|
1839
|
+
if (!this.state.isRunning) {
|
1840
|
+
this.setState({ isRunning: true });
|
1841
|
+
}
|
1842
|
+
}
|
1843
|
+
queryCompleted(entry) {
|
1844
|
+
if (!__privateGet$2(this, _running).has(entry)) {
|
1845
|
+
return;
|
1846
|
+
}
|
1847
|
+
__privateGet$2(this, _running).delete(entry);
|
1848
|
+
this.changeRunningQueryCount(-1);
|
1849
|
+
if (__privateGet$2(this, _running).size === 0) {
|
1850
|
+
this.setState({ isRunning: false });
|
1851
|
+
}
|
1852
|
+
}
|
1853
|
+
changeRunningQueryCount(dir) {
|
1854
|
+
var _a;
|
1855
|
+
window.__grafanaRunningQueryCount = ((_a = window.__grafanaRunningQueryCount) != null ? _a : 0) + dir;
|
1856
|
+
}
|
1857
|
+
cancelAll() {
|
1858
|
+
var _a;
|
1859
|
+
for (const entry of __privateGet$2(this, _running).values()) {
|
1860
|
+
(_a = entry.cancel) == null ? void 0 : _a.call(entry);
|
1861
|
+
}
|
1862
|
+
}
|
1863
|
+
}
|
1864
|
+
_running = new WeakMap();
|
1865
|
+
|
1866
|
+
function writeSceneLog(logger, message, ...rest) {
|
1867
|
+
let loggingEnabled = false;
|
1868
|
+
if (typeof window !== "undefined") {
|
1869
|
+
loggingEnabled = localStorage.getItem("grafana.debug.scenes") === "true";
|
1870
|
+
}
|
1871
|
+
if (loggingEnabled) {
|
1872
|
+
console.log(`${logger}: `, message, ...rest);
|
1873
|
+
}
|
2135
1874
|
}
|
2136
1875
|
|
2137
1876
|
async function getDataSource(datasource, scopedVars) {
|
@@ -2144,21 +1883,7 @@ async function getDataSource(datasource, scopedVars) {
|
|
2144
1883
|
if (datasource && datasource.query) {
|
2145
1884
|
return datasource;
|
2146
1885
|
}
|
2147
|
-
|
2148
|
-
if (scopedVars.__sceneObject && scopedVars.__sceneObject.value.valueOf()) {
|
2149
|
-
const queryControler = sceneGraph.getQueryController(scopedVars.__sceneObject.value.valueOf());
|
2150
|
-
if (queryControler && queryControler.state.enableProfiling) {
|
2151
|
-
wrapPromiseInStateObservable(dsPromise).pipe(
|
2152
|
-
registerQueryWithController({
|
2153
|
-
type: "plugin",
|
2154
|
-
origin: scopedVars.__sceneObject.value.valueOf()
|
2155
|
-
})
|
2156
|
-
).subscribe(() => {
|
2157
|
-
});
|
2158
|
-
}
|
2159
|
-
}
|
2160
|
-
const result = await dsPromise;
|
2161
|
-
return result;
|
1886
|
+
return await runtime.getDataSourceSrv().get(datasource, scopedVars);
|
2162
1887
|
}
|
2163
1888
|
|
2164
1889
|
class VariableValueRecorder {
|
@@ -2406,6 +2131,41 @@ function findActiveAdHocFilterVariableByUid(dsUid) {
|
|
2406
2131
|
return void 0;
|
2407
2132
|
}
|
2408
2133
|
|
2134
|
+
function registerQueryWithController(entry) {
|
2135
|
+
return (queryStream) => {
|
2136
|
+
const queryControler = sceneGraph.getQueryController(entry.origin);
|
2137
|
+
if (!queryControler) {
|
2138
|
+
return queryStream;
|
2139
|
+
}
|
2140
|
+
return new rxjs.Observable((observer) => {
|
2141
|
+
if (!entry.cancel) {
|
2142
|
+
entry.cancel = () => observer.complete();
|
2143
|
+
}
|
2144
|
+
queryControler.queryStarted(entry);
|
2145
|
+
let markedAsCompleted = false;
|
2146
|
+
const sub = queryStream.subscribe({
|
2147
|
+
next: (v) => {
|
2148
|
+
if (!markedAsCompleted && v.state !== schema.LoadingState.Loading) {
|
2149
|
+
markedAsCompleted = true;
|
2150
|
+
queryControler.queryCompleted(entry);
|
2151
|
+
}
|
2152
|
+
observer.next(v);
|
2153
|
+
},
|
2154
|
+
error: (e) => observer.error(e),
|
2155
|
+
complete: () => {
|
2156
|
+
observer.complete();
|
2157
|
+
}
|
2158
|
+
});
|
2159
|
+
return () => {
|
2160
|
+
sub.unsubscribe();
|
2161
|
+
if (!markedAsCompleted) {
|
2162
|
+
queryControler.queryCompleted(entry);
|
2163
|
+
}
|
2164
|
+
};
|
2165
|
+
});
|
2166
|
+
};
|
2167
|
+
}
|
2168
|
+
|
2409
2169
|
const allActiveGroupByVariables = /* @__PURE__ */ new Set();
|
2410
2170
|
function findActiveGroupByVariablesByUid(dsUid) {
|
2411
2171
|
var _a;
|
@@ -2785,7 +2545,6 @@ function VariableValueSelect({ model }) {
|
|
2785
2545
|
const [inputValue, setInputValue] = React.useState("");
|
2786
2546
|
const [hasCustomValue, setHasCustomValue] = React.useState(false);
|
2787
2547
|
const selectValue = toSelectableValue$2(value, String(text));
|
2788
|
-
const queryController = sceneGraph.getQueryController(model);
|
2789
2548
|
const optionSearcher = React.useMemo(() => getOptionSearcher(options, includeAll), [options, includeAll]);
|
2790
2549
|
const onInputChange = (value2, { action }) => {
|
2791
2550
|
if (action === "input-change") {
|
@@ -2825,7 +2584,6 @@ function VariableValueSelect({ model }) {
|
|
2825
2584
|
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${value}`),
|
2826
2585
|
onChange: (newValue) => {
|
2827
2586
|
model.changeValueTo(newValue.value, newValue.label);
|
2828
|
-
queryController == null ? void 0 : queryController.startProfile(model);
|
2829
2587
|
if (hasCustomValue !== newValue.__isNew__) {
|
2830
2588
|
setHasCustomValue(newValue.__isNew__);
|
2831
2589
|
}
|
@@ -2837,7 +2595,6 @@ function VariableValueSelectMulti({ model }) {
|
|
2837
2595
|
const arrayValue = React.useMemo(() => lodash.isArray(value) ? value : [value], [value]);
|
2838
2596
|
const [uncommittedValue, setUncommittedValue] = React.useState(arrayValue);
|
2839
2597
|
const [inputValue, setInputValue] = React.useState("");
|
2840
|
-
const queryController = sceneGraph.getQueryController(model);
|
2841
2598
|
const optionSearcher = React.useMemo(() => getOptionSearcher(options, includeAll), [options, includeAll]);
|
2842
2599
|
React.useEffect(() => {
|
2843
2600
|
setUncommittedValue(arrayValue);
|
@@ -2878,7 +2635,6 @@ function VariableValueSelectMulti({ model }) {
|
|
2878
2635
|
onInputChange,
|
2879
2636
|
onBlur: () => {
|
2880
2637
|
model.changeValueTo(uncommittedValue);
|
2881
|
-
queryController == null ? void 0 : queryController.startProfile(model);
|
2882
2638
|
},
|
2883
2639
|
filterOption: filterNoOp$2,
|
2884
2640
|
"data-testid": e2eSelectors.selectors.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${uncommittedValue}`),
|
@@ -4984,7 +4740,9 @@ class SceneQueryRunner extends SceneObjectBase {
|
|
4984
4740
|
})
|
4985
4741
|
);
|
4986
4742
|
}
|
4987
|
-
this.subscribeToTimeRangeChanges(
|
4743
|
+
this.subscribeToTimeRangeChanges(
|
4744
|
+
timeRange
|
4745
|
+
);
|
4988
4746
|
if (this.shouldRunQueriesOnActivate()) {
|
4989
4747
|
this.runQueries();
|
4990
4748
|
}
|
@@ -6229,6 +5987,20 @@ function getAncestor(sceneObject, ancestorType) {
|
|
6229
5987
|
}
|
6230
5988
|
return parent;
|
6231
5989
|
}
|
5990
|
+
function getQueryController(sceneObject) {
|
5991
|
+
let parent = sceneObject;
|
5992
|
+
while (parent) {
|
5993
|
+
if (parent.state.$behaviors) {
|
5994
|
+
for (const behavior of parent.state.$behaviors) {
|
5995
|
+
if (isQueryController(behavior)) {
|
5996
|
+
return behavior;
|
5997
|
+
}
|
5998
|
+
}
|
5999
|
+
}
|
6000
|
+
parent = parent.parent;
|
6001
|
+
}
|
6002
|
+
return void 0;
|
6003
|
+
}
|
6232
6004
|
|
6233
6005
|
const sceneGraph = {
|
6234
6006
|
getVariables,
|
@@ -7108,13 +6880,7 @@ class VizPanel extends SceneObjectBase {
|
|
7108
6880
|
} else {
|
7109
6881
|
const { importPanelPlugin } = runtime.getPluginImportUtils();
|
7110
6882
|
try {
|
7111
|
-
const
|
7112
|
-
const queryControler = sceneGraph.getQueryController(this);
|
7113
|
-
if (queryControler && queryControler.state.enableProfiling) {
|
7114
|
-
wrapPromiseInStateObservable(panelPromise).pipe(registerQueryWithController({ type: "plugin", origin: this })).subscribe(() => {
|
7115
|
-
});
|
7116
|
-
}
|
7117
|
-
const result = await panelPromise;
|
6883
|
+
const result = await importPanelPlugin(pluginId);
|
7118
6884
|
this._pluginLoaded(result, overwriteOptions, overwriteFieldConfig, isAfterPluginChange);
|
7119
6885
|
} catch (err) {
|
7120
6886
|
this._pluginLoaded(getPanelPluginNotFound(pluginId));
|
@@ -7183,7 +6949,11 @@ class VizPanel extends SceneObjectBase {
|
|
7183
6949
|
}
|
7184
6950
|
async changePluginType(pluginId, newOptions, newFieldConfig) {
|
7185
6951
|
var _a, _b;
|
7186
|
-
const {
|
6952
|
+
const {
|
6953
|
+
options: prevOptions,
|
6954
|
+
fieldConfig: prevFieldConfig,
|
6955
|
+
pluginId: prevPluginId
|
6956
|
+
} = this.state;
|
7187
6957
|
this._dataWithFieldConfig = void 0;
|
7188
6958
|
await this._loadPlugin(pluginId, newOptions != null ? newOptions : {}, newFieldConfig, true);
|
7189
6959
|
const panel = {
|
@@ -10528,7 +10298,6 @@ class SceneRefreshPicker extends SceneObjectBase {
|
|
10528
10298
|
this._autoRefreshBlocked = false;
|
10529
10299
|
this.onRefresh = () => {
|
10530
10300
|
const queryController = sceneGraph.getQueryController(this);
|
10531
|
-
queryController == null ? void 0 : queryController.startProfile(this);
|
10532
10301
|
if (queryController == null ? void 0 : queryController.state.isRunning) {
|
10533
10302
|
queryController.cancelAll();
|
10534
10303
|
return;
|
@@ -10657,9 +10426,7 @@ function SceneRefreshPickerRenderer({ model }) {
|
|
10657
10426
|
tooltip,
|
10658
10427
|
width,
|
10659
10428
|
text,
|
10660
|
-
onRefresh:
|
10661
|
-
model.onRefresh();
|
10662
|
-
},
|
10429
|
+
onRefresh: model.onRefresh,
|
10663
10430
|
primary,
|
10664
10431
|
onIntervalChanged: model.onIntervalChanged,
|
10665
10432
|
isLoading: isRunning,
|