|
@@ -18,7 +18,7 @@ export class DashboardModel {
|
|
|
style: any;
|
|
style: any;
|
|
|
timezone: any;
|
|
timezone: any;
|
|
|
editable: any;
|
|
editable: any;
|
|
|
- sharedCrosshair: any;
|
|
|
|
|
|
|
+ graphTooltip: any;
|
|
|
rows: DashboardRow[];
|
|
rows: DashboardRow[];
|
|
|
time: any;
|
|
time: any;
|
|
|
timepicker: any;
|
|
timepicker: any;
|
|
@@ -51,7 +51,7 @@ export class DashboardModel {
|
|
|
this.style = data.style || "dark";
|
|
this.style = data.style || "dark";
|
|
|
this.timezone = data.timezone || '';
|
|
this.timezone = data.timezone || '';
|
|
|
this.editable = data.editable !== false;
|
|
this.editable = data.editable !== false;
|
|
|
- this.sharedCrosshair = data.sharedCrosshair || false;
|
|
|
|
|
|
|
+ this.graphTooltip = data.graphTooltip || false;
|
|
|
this.hideControls = data.hideControls || false;
|
|
this.hideControls = data.hideControls || false;
|
|
|
this.time = data.time || { from: 'now-6h', to: 'now' };
|
|
this.time = data.time || { from: 'now-6h', to: 'now' };
|
|
|
this.timepicker = data.timepicker || {};
|
|
this.timepicker = data.timepicker || {};
|
|
@@ -267,6 +267,18 @@ export class DashboardModel {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ cycleGraphTooltip() {
|
|
|
|
|
+ this.graphTooltip = (this.graphTooltip + 1) % 3;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ sharedTooltipModeEnabled() {
|
|
|
|
|
+ return this.graphTooltip !== 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ sharedCrosshairModeOnly() {
|
|
|
|
|
+ return this.graphTooltip === 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
getRelativeTime(date) {
|
|
getRelativeTime(date) {
|
|
|
date = moment.isMoment(date) ? date : moment(date);
|
|
date = moment.isMoment(date) ? date : moment(date);
|
|
|
|
|
|
|
@@ -297,7 +309,7 @@ export class DashboardModel {
|
|
|
var i, j, k;
|
|
var i, j, k;
|
|
|
var oldVersion = this.schemaVersion;
|
|
var oldVersion = this.schemaVersion;
|
|
|
var panelUpgrades = [];
|
|
var panelUpgrades = [];
|
|
|
- this.schemaVersion = 13;
|
|
|
|
|
|
|
+ this.schemaVersion = 14;
|
|
|
|
|
|
|
|
if (oldVersion === this.schemaVersion) {
|
|
if (oldVersion === this.schemaVersion) {
|
|
|
return;
|
|
return;
|
|
@@ -602,6 +614,10 @@ export class DashboardModel {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (oldVersion < 14) {
|
|
|
|
|
+ this.graphTooltip = old.sharedCrosshair ? 1 : 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (panelUpgrades.length === 0) {
|
|
if (panelUpgrades.length === 0) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|