mirror of
https://github.com/timberjoegithub/grafana-statusmap.git
synced 2026-07-22 15:53:09 +00:00
Merge pull request #107 from flant/fix_edit_mode_render_for_g7
fix: render buckets in edit mode for Grafana 7.0
This commit is contained in:
Vendored
+15
-5
@@ -513,11 +513,17 @@ System.register(["lodash", "./color_legend", "app/core/utils/kbn", "app/plugins/
|
||||
value: function onDataReceived(dataList) {
|
||||
var _this3 = this;
|
||||
|
||||
//console.log("data",dataList)
|
||||
this.data = dataList;
|
||||
this.bucketMatrix = this.convertDataToBuckets(dataList, this.range.from.valueOf(), this.range.to.valueOf(), this.intervalMs, true);
|
||||
this.noDatapoints = this.bucketMatrix.noDatapoints; //console.log("buckets",this.bucketMatrix)
|
||||
this.data = dataList; // Quick workaround for 7.0+. There is no call to
|
||||
// calculateInterval when enter Edit mode.
|
||||
|
||||
if (!this.intervalMs) {
|
||||
this.calculateInterval();
|
||||
}
|
||||
|
||||
this.bucketMatrix = this.convertDataToBuckets(dataList, this.range.from.valueOf(), this.range.to.valueOf(), this.intervalMs, true);
|
||||
this.noDatapoints = this.bucketMatrix.noDatapoints;
|
||||
|
||||
if (this.annotationsPromise) {
|
||||
this.annotationsPromise.then(function (result) {
|
||||
_this3.loading = false; //this.alertState = result.alertState;
|
||||
|
||||
@@ -534,6 +540,11 @@ System.register(["lodash", "./color_legend", "app/core/utils/kbn", "app/plugins/
|
||||
|
||||
_this3.render();
|
||||
});
|
||||
} else {
|
||||
this.loading = false;
|
||||
this.annotations = [];
|
||||
this.render();
|
||||
}
|
||||
}
|
||||
}, {
|
||||
key: "onInitEditMode",
|
||||
@@ -546,7 +557,6 @@ System.register(["lodash", "./color_legend", "app/core/utils/kbn", "app/plugins/
|
||||
}, {
|
||||
key: "onRender",
|
||||
value: function onRender() {
|
||||
//console.log('OnRender');
|
||||
if (!this.range || !this.data) {
|
||||
this.noDatapoints = true;
|
||||
return;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+11
-4
@@ -366,13 +366,16 @@ class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
||||
|
||||
|
||||
onDataReceived(dataList: any) {
|
||||
//console.log("data",dataList)
|
||||
this.data = dataList;
|
||||
// Quick workaround for 7.0+. There is no call to
|
||||
// calculateInterval when enter Edit mode.
|
||||
if (!this.intervalMs) {
|
||||
this.calculateInterval();
|
||||
}
|
||||
this.bucketMatrix = this.convertDataToBuckets(dataList, this.range.from.valueOf(), this.range.to.valueOf(), this.intervalMs, true);
|
||||
this.noDatapoints = this.bucketMatrix.noDatapoints;
|
||||
|
||||
//console.log("buckets",this.bucketMatrix)
|
||||
|
||||
if (this.annotationsPromise) {
|
||||
this.annotationsPromise.then(
|
||||
(result: { alertState: any; annotations: any }) => {
|
||||
this.loading = false;
|
||||
@@ -390,6 +393,11 @@ class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
||||
this.render();
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.loading = false;
|
||||
this.annotations = [];
|
||||
this.render();
|
||||
}
|
||||
}
|
||||
|
||||
onInitEditMode() {
|
||||
@@ -400,7 +408,6 @@ class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
||||
// onRender will be called before StatusmapRenderer.onRender.
|
||||
// Decide if warning should be displayed over cards.
|
||||
onRender() {
|
||||
//console.log('OnRender');
|
||||
if (!this.range || !this.data) {
|
||||
this.noDatapoints = true;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user