|
@@ -1,5 +1,6 @@
|
|
|
// Libaries
|
|
// Libaries
|
|
|
-import moment from 'moment';
|
|
|
|
|
|
|
+import moment, { MomentInput } from 'moment';
|
|
|
|
|
+// @ts-ignore
|
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
|
|
|
|
|
|
// Constants
|
|
// Constants
|
|
@@ -12,11 +13,17 @@ import { contextSrv } from 'app/core/services/context_srv';
|
|
|
import sortByKeys from 'app/core/utils/sort_by_keys';
|
|
import sortByKeys from 'app/core/utils/sort_by_keys';
|
|
|
|
|
|
|
|
// Types
|
|
// Types
|
|
|
-import { PanelModel } from './PanelModel';
|
|
|
|
|
|
|
+import { PanelModel, GridPos } from './PanelModel';
|
|
|
import { DashboardMigrator } from './DashboardMigrator';
|
|
import { DashboardMigrator } from './DashboardMigrator';
|
|
|
import { TimeRange } from '@grafana/ui/src';
|
|
import { TimeRange } from '@grafana/ui/src';
|
|
|
import { UrlQueryValue, KIOSK_MODE_TV, DashboardMeta } from 'app/types';
|
|
import { UrlQueryValue, KIOSK_MODE_TV, DashboardMeta } from 'app/types';
|
|
|
|
|
|
|
|
|
|
+export interface CloneOptions {
|
|
|
|
|
+ saveVariables?: boolean;
|
|
|
|
|
+ saveTimerange?: boolean;
|
|
|
|
|
+ message?: string;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
export class DashboardModel {
|
|
export class DashboardModel {
|
|
|
id: any;
|
|
id: any;
|
|
|
uid: string;
|
|
uid: string;
|
|
@@ -31,9 +38,9 @@ export class DashboardModel {
|
|
|
time: any;
|
|
time: any;
|
|
|
private originalTime: any;
|
|
private originalTime: any;
|
|
|
timepicker: any;
|
|
timepicker: any;
|
|
|
- templating: any;
|
|
|
|
|
|
|
+ templating: { list: any[] };
|
|
|
private originalTemplating: any;
|
|
private originalTemplating: any;
|
|
|
- annotations: any;
|
|
|
|
|
|
|
+ annotations: { list: any[] };
|
|
|
refresh: any;
|
|
refresh: any;
|
|
|
snapshot: any;
|
|
snapshot: any;
|
|
|
schemaVersion: number;
|
|
schemaVersion: number;
|
|
@@ -61,7 +68,7 @@ export class DashboardModel {
|
|
|
originalTemplating: true,
|
|
originalTemplating: true,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- constructor(data, meta?) {
|
|
|
|
|
|
|
+ constructor(data: any, meta?: DashboardMeta) {
|
|
|
if (!data) {
|
|
if (!data) {
|
|
|
data = {};
|
|
data = {};
|
|
|
}
|
|
}
|
|
@@ -88,7 +95,7 @@ export class DashboardModel {
|
|
|
this.version = data.version || 0;
|
|
this.version = data.version || 0;
|
|
|
this.links = data.links || [];
|
|
this.links = data.links || [];
|
|
|
this.gnetId = data.gnetId || null;
|
|
this.gnetId = data.gnetId || null;
|
|
|
- this.panels = _.map(data.panels || [], panelData => new PanelModel(panelData));
|
|
|
|
|
|
|
+ this.panels = _.map(data.panels || [], (panelData: any) => new PanelModel(panelData));
|
|
|
|
|
|
|
|
this.resetOriginalVariables();
|
|
this.resetOriginalVariables();
|
|
|
this.resetOriginalTime();
|
|
this.resetOriginalTime();
|
|
@@ -124,7 +131,7 @@ export class DashboardModel {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private initMeta(meta) {
|
|
|
|
|
|
|
+ private initMeta(meta: DashboardMeta) {
|
|
|
meta = meta || {};
|
|
meta = meta || {};
|
|
|
|
|
|
|
|
meta.canShare = meta.canShare !== false;
|
|
meta.canShare = meta.canShare !== false;
|
|
@@ -146,7 +153,7 @@ export class DashboardModel {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// cleans meta data and other non persistent state
|
|
// cleans meta data and other non persistent state
|
|
|
- getSaveModelClone(options?) {
|
|
|
|
|
|
|
+ getSaveModelClone(options?: CloneOptions) {
|
|
|
const defaults = _.defaults(options || {}, {
|
|
const defaults = _.defaults(options || {}, {
|
|
|
saveVariables: true,
|
|
saveVariables: true,
|
|
|
saveTimerange: true,
|
|
saveTimerange: true,
|
|
@@ -164,7 +171,9 @@ export class DashboardModel {
|
|
|
|
|
|
|
|
// get variable save models
|
|
// get variable save models
|
|
|
copy.templating = {
|
|
copy.templating = {
|
|
|
- list: _.map(this.templating.list, variable => (variable.getSaveModel ? variable.getSaveModel() : variable)),
|
|
|
|
|
|
|
+ list: _.map(this.templating.list, (variable: any) =>
|
|
|
|
|
+ variable.getSaveModel ? variable.getSaveModel() : variable
|
|
|
|
|
+ ),
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
if (!defaults.saveVariables) {
|
|
if (!defaults.saveVariables) {
|
|
@@ -190,8 +199,8 @@ export class DashboardModel {
|
|
|
|
|
|
|
|
// get panel save models
|
|
// get panel save models
|
|
|
copy.panels = _.chain(this.panels)
|
|
copy.panels = _.chain(this.panels)
|
|
|
- .filter(panel => panel.type !== 'add-panel')
|
|
|
|
|
- .map(panel => panel.getSaveModel())
|
|
|
|
|
|
|
+ .filter((panel: PanelModel) => panel.type !== 'add-panel')
|
|
|
|
|
+ .map((panel: PanelModel) => panel.getSaveModel())
|
|
|
.value();
|
|
.value();
|
|
|
|
|
|
|
|
// sort by keys
|
|
// sort by keys
|
|
@@ -243,7 +252,7 @@ export class DashboardModel {
|
|
|
return this.meta.fullscreen && !panel.fullscreen;
|
|
return this.meta.fullscreen && !panel.fullscreen;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private ensureListExist(data) {
|
|
|
|
|
|
|
+ private ensureListExist(data: any) {
|
|
|
if (!data) {
|
|
if (!data) {
|
|
|
data = {};
|
|
data = {};
|
|
|
}
|
|
}
|
|
@@ -273,13 +282,13 @@ export class DashboardModel {
|
|
|
return max + 1;
|
|
return max + 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- forEachPanel(callback) {
|
|
|
|
|
|
|
+ forEachPanel(callback: (panel: PanelModel, index: number) => void) {
|
|
|
for (let i = 0; i < this.panels.length; i++) {
|
|
for (let i = 0; i < this.panels.length; i++) {
|
|
|
callback(this.panels[i], i);
|
|
callback(this.panels[i], i);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- getPanelById(id): PanelModel {
|
|
|
|
|
|
|
+ getPanelById(id: number): PanelModel {
|
|
|
for (const panel of this.panels) {
|
|
for (const panel of this.panels) {
|
|
|
if (panel.id === id) {
|
|
if (panel.id === id) {
|
|
|
return panel;
|
|
return panel;
|
|
@@ -288,7 +297,7 @@ export class DashboardModel {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- addPanel(panelData) {
|
|
|
|
|
|
|
+ addPanel(panelData: any) {
|
|
|
panelData.id = this.getNextPanelId();
|
|
panelData.id = this.getNextPanelId();
|
|
|
|
|
|
|
|
const panel = new PanelModel(panelData);
|
|
const panel = new PanelModel(panelData);
|
|
@@ -357,7 +366,7 @@ export class DashboardModel {
|
|
|
this.events.emit('repeats-processed');
|
|
this.events.emit('repeats-processed');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- cleanUpRowRepeats(rowPanels) {
|
|
|
|
|
|
|
+ cleanUpRowRepeats(rowPanels: PanelModel[]) {
|
|
|
const panelsToRemove = [];
|
|
const panelsToRemove = [];
|
|
|
for (let i = 0; i < rowPanels.length; i++) {
|
|
for (let i = 0; i < rowPanels.length; i++) {
|
|
|
const panel = rowPanels[i];
|
|
const panel = rowPanels[i];
|
|
@@ -376,7 +385,7 @@ export class DashboardModel {
|
|
|
|
|
|
|
|
let rowPanels = row.panels;
|
|
let rowPanels = row.panels;
|
|
|
if (!row.collapsed) {
|
|
if (!row.collapsed) {
|
|
|
- const rowPanelIndex = _.findIndex(this.panels, p => p.id === row.id);
|
|
|
|
|
|
|
+ const rowPanelIndex = _.findIndex(this.panels, (p: PanelModel) => p.id === row.id);
|
|
|
rowPanels = this.getRowPanels(rowPanelIndex);
|
|
rowPanels = this.getRowPanels(rowPanelIndex);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -385,13 +394,13 @@ export class DashboardModel {
|
|
|
for (let i = 0; i < rowPanels.length; i++) {
|
|
for (let i = 0; i < rowPanels.length; i++) {
|
|
|
const panel = rowPanels[i];
|
|
const panel = rowPanels[i];
|
|
|
if (panel.repeat) {
|
|
if (panel.repeat) {
|
|
|
- const panelIndex = _.findIndex(this.panels, p => p.id === panel.id);
|
|
|
|
|
|
|
+ const panelIndex = _.findIndex(this.panels, (p: PanelModel) => p.id === panel.id);
|
|
|
this.repeatPanel(panel, panelIndex);
|
|
this.repeatPanel(panel, panelIndex);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- getPanelRepeatClone(sourcePanel, valueIndex, sourcePanelIndex) {
|
|
|
|
|
|
|
+ getPanelRepeatClone(sourcePanel: PanelModel, valueIndex: number, sourcePanelIndex: number) {
|
|
|
// if first clone return source
|
|
// if first clone return source
|
|
|
if (valueIndex === 0) {
|
|
if (valueIndex === 0) {
|
|
|
return sourcePanel;
|
|
return sourcePanel;
|
|
@@ -409,7 +418,7 @@ export class DashboardModel {
|
|
|
return clone;
|
|
return clone;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- getRowRepeatClone(sourceRowPanel, valueIndex, sourcePanelIndex) {
|
|
|
|
|
|
|
+ getRowRepeatClone(sourceRowPanel: PanelModel, valueIndex: number, sourcePanelIndex: number) {
|
|
|
// if first clone return source
|
|
// if first clone return source
|
|
|
if (valueIndex === 0) {
|
|
if (valueIndex === 0) {
|
|
|
if (!sourceRowPanel.collapsed) {
|
|
if (!sourceRowPanel.collapsed) {
|
|
@@ -421,7 +430,7 @@ export class DashboardModel {
|
|
|
|
|
|
|
|
const clone = new PanelModel(sourceRowPanel.getSaveModel());
|
|
const clone = new PanelModel(sourceRowPanel.getSaveModel());
|
|
|
// for row clones we need to figure out panels under row to clone and where to insert clone
|
|
// for row clones we need to figure out panels under row to clone and where to insert clone
|
|
|
- let rowPanels, insertPos;
|
|
|
|
|
|
|
+ let rowPanels: PanelModel[], insertPos: number;
|
|
|
if (sourceRowPanel.collapsed) {
|
|
if (sourceRowPanel.collapsed) {
|
|
|
rowPanels = _.cloneDeep(sourceRowPanel.panels);
|
|
rowPanels = _.cloneDeep(sourceRowPanel.panels);
|
|
|
clone.panels = rowPanels;
|
|
clone.panels = rowPanels;
|
|
@@ -429,7 +438,7 @@ export class DashboardModel {
|
|
|
insertPos = sourcePanelIndex + valueIndex;
|
|
insertPos = sourcePanelIndex + valueIndex;
|
|
|
} else {
|
|
} else {
|
|
|
rowPanels = this.getRowPanels(sourcePanelIndex);
|
|
rowPanels = this.getRowPanels(sourcePanelIndex);
|
|
|
- clone.panels = _.map(rowPanels, panel => panel.getSaveModel());
|
|
|
|
|
|
|
+ clone.panels = _.map(rowPanels, (panel: PanelModel) => panel.getSaveModel());
|
|
|
// insert copied row after preceding row's panels
|
|
// insert copied row after preceding row's panels
|
|
|
insertPos = sourcePanelIndex + (rowPanels.length + 1) * valueIndex;
|
|
insertPos = sourcePanelIndex + (rowPanels.length + 1) * valueIndex;
|
|
|
}
|
|
}
|
|
@@ -495,11 +504,11 @@ export class DashboardModel {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- repeatRow(panel: PanelModel, panelIndex: number, variable) {
|
|
|
|
|
|
|
+ repeatRow(panel: PanelModel, panelIndex: number, variable: any) {
|
|
|
const selectedOptions = this.getSelectedVariableOptions(variable);
|
|
const selectedOptions = this.getSelectedVariableOptions(variable);
|
|
|
let yPos = panel.gridPos.y;
|
|
let yPos = panel.gridPos.y;
|
|
|
|
|
|
|
|
- function setScopedVars(panel, variableOption) {
|
|
|
|
|
|
|
+ function setScopedVars(panel: PanelModel, variableOption: any) {
|
|
|
panel.scopedVars = panel.scopedVars || {};
|
|
panel.scopedVars = panel.scopedVars || {};
|
|
|
panel.scopedVars[variable.name] = variableOption;
|
|
panel.scopedVars[variable.name] = variableOption;
|
|
|
}
|
|
}
|
|
@@ -515,7 +524,7 @@ export class DashboardModel {
|
|
|
|
|
|
|
|
if (panel.collapsed) {
|
|
if (panel.collapsed) {
|
|
|
// For collapsed row just copy its panels and set scoped vars and proper IDs
|
|
// For collapsed row just copy its panels and set scoped vars and proper IDs
|
|
|
- _.each(rowPanels, (rowPanel, i) => {
|
|
|
|
|
|
|
+ _.each(rowPanels, (rowPanel: PanelModel, i: number) => {
|
|
|
setScopedVars(rowPanel, option);
|
|
setScopedVars(rowPanel, option);
|
|
|
if (optionIndex > 0) {
|
|
if (optionIndex > 0) {
|
|
|
this.updateRepeatedPanelIds(rowPanel, true);
|
|
this.updateRepeatedPanelIds(rowPanel, true);
|
|
@@ -527,7 +536,7 @@ export class DashboardModel {
|
|
|
} else {
|
|
} else {
|
|
|
// insert after 'row' panel
|
|
// insert after 'row' panel
|
|
|
const insertPos = panelIndex + (rowPanels.length + 1) * optionIndex + 1;
|
|
const insertPos = panelIndex + (rowPanels.length + 1) * optionIndex + 1;
|
|
|
- _.each(rowPanels, (rowPanel, i) => {
|
|
|
|
|
|
|
+ _.each(rowPanels, (rowPanel: PanelModel, i: number) => {
|
|
|
setScopedVars(rowPanel, option);
|
|
setScopedVars(rowPanel, option);
|
|
|
if (optionIndex > 0) {
|
|
if (optionIndex > 0) {
|
|
|
const cloneRowPanel = new PanelModel(rowPanel);
|
|
const cloneRowPanel = new PanelModel(rowPanel);
|
|
@@ -562,8 +571,8 @@ export class DashboardModel {
|
|
|
return panel;
|
|
return panel;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- getSelectedVariableOptions(variable) {
|
|
|
|
|
- let selectedOptions;
|
|
|
|
|
|
|
+ getSelectedVariableOptions(variable: any) {
|
|
|
|
|
+ let selectedOptions: any[];
|
|
|
if (variable.current.text === 'All') {
|
|
if (variable.current.text === 'All') {
|
|
|
selectedOptions = variable.options.slice(1, variable.options.length);
|
|
selectedOptions = variable.options.slice(1, variable.options.length);
|
|
|
} else {
|
|
} else {
|
|
@@ -578,7 +587,7 @@ export class DashboardModel {
|
|
|
}
|
|
}
|
|
|
const rowYPos = rowPanel.gridPos.y;
|
|
const rowYPos = rowPanel.gridPos.y;
|
|
|
const positions = _.map(rowPanel.panels, 'gridPos');
|
|
const positions = _.map(rowPanel.panels, 'gridPos');
|
|
|
- const maxPos = _.maxBy(positions, pos => {
|
|
|
|
|
|
|
+ const maxPos = _.maxBy(positions, (pos: GridPos) => {
|
|
|
return pos.y + pos.h;
|
|
return pos.y + pos.h;
|
|
|
});
|
|
});
|
|
|
return maxPos.y + maxPos.h - rowYPos;
|
|
return maxPos.y + maxPos.h - rowYPos;
|
|
@@ -628,7 +637,7 @@ export class DashboardModel {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- setPanelFocus(id) {
|
|
|
|
|
|
|
+ setPanelFocus(id: number) {
|
|
|
this.meta.focusPanelId = id;
|
|
this.meta.focusPanelId = id;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -638,12 +647,12 @@ export class DashboardModel {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const visibleVars = _.filter(this.templating.list, variable => variable.hide !== 2);
|
|
|
|
|
|
|
+ const visibleVars = _.filter(this.templating.list, (variable: any) => variable.hide !== 2);
|
|
|
if (visibleVars.length > 0) {
|
|
if (visibleVars.length > 0) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const visibleAnnotations = _.filter(this.annotations.list, annotation => annotation.hide !== true);
|
|
|
|
|
|
|
+ const visibleAnnotations = _.filter(this.annotations.list, (annotation: any) => annotation.hide !== true);
|
|
|
if (visibleAnnotations.length > 0) {
|
|
if (visibleAnnotations.length > 0) {
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
@@ -652,7 +661,7 @@ export class DashboardModel {
|
|
|
})();
|
|
})();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- getPanelInfoById(panelId) {
|
|
|
|
|
|
|
+ getPanelInfoById(panelId: number) {
|
|
|
for (let i = 0; i < this.panels.length; i++) {
|
|
for (let i = 0; i < this.panels.length; i++) {
|
|
|
if (this.panels[i].id === panelId) {
|
|
if (this.panels[i].id === panelId) {
|
|
|
return {
|
|
return {
|
|
@@ -665,7 +674,7 @@ export class DashboardModel {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- duplicatePanel(panel) {
|
|
|
|
|
|
|
+ duplicatePanel(panel: PanelModel) {
|
|
|
const newPanel = panel.getSaveModel();
|
|
const newPanel = panel.getSaveModel();
|
|
|
newPanel.id = this.getNextPanelId();
|
|
newPanel.id = this.getNextPanelId();
|
|
|
|
|
|
|
@@ -690,7 +699,7 @@ export class DashboardModel {
|
|
|
return newPanel;
|
|
return newPanel;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- formatDate(date, format?) {
|
|
|
|
|
|
|
+ formatDate(date: MomentInput, format?: string) {
|
|
|
date = moment.isMoment(date) ? date : moment(date);
|
|
date = moment.isMoment(date) ? date : moment(date);
|
|
|
format = format || 'YYYY-MM-DD HH:mm:ss';
|
|
format = format || 'YYYY-MM-DD HH:mm:ss';
|
|
|
const timezone = this.getTimezone();
|
|
const timezone = this.getTimezone();
|
|
@@ -710,7 +719,7 @@ export class DashboardModel {
|
|
|
|
|
|
|
|
if (row.collapsed) {
|
|
if (row.collapsed) {
|
|
|
row.collapsed = false;
|
|
row.collapsed = false;
|
|
|
- const hasRepeat = _.some(row.panels, p => p.repeat);
|
|
|
|
|
|
|
+ const hasRepeat = _.some(row.panels, (p: PanelModel) => p.repeat);
|
|
|
|
|
|
|
|
if (row.panels.length > 0) {
|
|
if (row.panels.length > 0) {
|
|
|
// Use first panel to figure out if it was moved or pushed
|
|
// Use first panel to figure out if it was moved or pushed
|
|
@@ -761,7 +770,7 @@ export class DashboardModel {
|
|
|
// remove panels
|
|
// remove panels
|
|
|
_.pull(this.panels, ...rowPanels);
|
|
_.pull(this.panels, ...rowPanels);
|
|
|
// save panel models inside row panel
|
|
// save panel models inside row panel
|
|
|
- row.panels = _.map(rowPanels, panel => panel.getSaveModel());
|
|
|
|
|
|
|
+ row.panels = _.map(rowPanels, (panel: PanelModel) => panel.getSaveModel());
|
|
|
row.collapsed = true;
|
|
row.collapsed = true;
|
|
|
|
|
|
|
|
// emit change event
|
|
// emit change event
|
|
@@ -789,11 +798,11 @@ export class DashboardModel {
|
|
|
return rowPanels;
|
|
return rowPanels;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- on(eventName, callback) {
|
|
|
|
|
|
|
+ on(eventName: string, callback: Function) {
|
|
|
this.events.on(eventName, callback);
|
|
this.events.on(eventName, callback);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- off(eventName, callback?) {
|
|
|
|
|
|
|
+ off(eventName: string, callback?: Function) {
|
|
|
this.events.off(eventName, callback);
|
|
this.events.off(eventName, callback);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -809,7 +818,7 @@ export class DashboardModel {
|
|
|
return this.graphTooltip === 1;
|
|
return this.graphTooltip === 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- getRelativeTime(date) {
|
|
|
|
|
|
|
+ getRelativeTime(date: MomentInput) {
|
|
|
date = moment.isMoment(date) ? date : moment(date);
|
|
date = moment.isMoment(date) ? date : moment(date);
|
|
|
|
|
|
|
|
return this.timezone === 'browser' ? moment(date).fromNow() : moment.utc(date).fromNow();
|
|
return this.timezone === 'browser' ? moment(date).fromNow() : moment.utc(date).fromNow();
|
|
@@ -827,7 +836,7 @@ export class DashboardModel {
|
|
|
return this.timezone ? this.timezone : contextSrv.user.timezone;
|
|
return this.timezone ? this.timezone : contextSrv.user.timezone;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private updateSchema(old) {
|
|
|
|
|
|
|
+ private updateSchema(old: any) {
|
|
|
const migrator = new DashboardMigrator(this);
|
|
const migrator = new DashboardMigrator(this);
|
|
|
migrator.updateSchema(old);
|
|
migrator.updateSchema(old);
|
|
|
}
|
|
}
|
|
@@ -841,7 +850,7 @@ export class DashboardModel {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
resetOriginalVariables() {
|
|
resetOriginalVariables() {
|
|
|
- this.originalTemplating = _.map(this.templating.list, variable => {
|
|
|
|
|
|
|
+ this.originalTemplating = _.map(this.templating.list, (variable: any) => {
|
|
|
return {
|
|
return {
|
|
|
name: variable.name,
|
|
name: variable.name,
|
|
|
type: variable.type,
|
|
type: variable.type,
|
|
@@ -856,7 +865,7 @@ export class DashboardModel {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const updated = _.map(this.templating.list, variable => {
|
|
|
|
|
|
|
+ const updated = _.map(this.templating.list, (variable: any) => {
|
|
|
return {
|
|
return {
|
|
|
name: variable.name,
|
|
name: variable.name,
|
|
|
type: variable.type,
|
|
type: variable.type,
|