|
@@ -3,7 +3,6 @@ import _ from 'lodash';
|
|
|
|
|
|
|
|
// Types
|
|
// Types
|
|
|
import { Emitter } from 'app/core/utils/emitter';
|
|
import { Emitter } from 'app/core/utils/emitter';
|
|
|
-import { PANEL_OPTIONS_KEY_PREFIX } from 'app/core/constants';
|
|
|
|
|
import { DataQuery, TimeSeries } from '@grafana/ui';
|
|
import { DataQuery, TimeSeries } from '@grafana/ui';
|
|
|
import { TableData } from '@grafana/ui/src';
|
|
import { TableData } from '@grafana/ui/src';
|
|
|
|
|
|
|
@@ -92,6 +91,7 @@ export class PanelModel {
|
|
|
timeFrom?: any;
|
|
timeFrom?: any;
|
|
|
timeShift?: any;
|
|
timeShift?: any;
|
|
|
hideTimeOverride?: any;
|
|
hideTimeOverride?: any;
|
|
|
|
|
+ options: object;
|
|
|
|
|
|
|
|
maxDataPoints?: number;
|
|
maxDataPoints?: number;
|
|
|
interval?: string;
|
|
interval?: string;
|
|
@@ -105,8 +105,6 @@ export class PanelModel {
|
|
|
hasRefreshed: boolean;
|
|
hasRefreshed: boolean;
|
|
|
events: Emitter;
|
|
events: Emitter;
|
|
|
cacheTimeout?: any;
|
|
cacheTimeout?: any;
|
|
|
-
|
|
|
|
|
- // cache props between plugins
|
|
|
|
|
cachedPluginOptions?: any;
|
|
cachedPluginOptions?: any;
|
|
|
|
|
|
|
|
constructor(model) {
|
|
constructor(model) {
|
|
@@ -134,20 +132,14 @@ export class PanelModel {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
getOptions(panelDefaults) {
|
|
getOptions(panelDefaults) {
|
|
|
- return _.defaultsDeep(this[this.getOptionsKey()] || {}, panelDefaults);
|
|
|
|
|
|
|
+ return _.defaultsDeep(this.options || {}, panelDefaults);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
updateOptions(options: object) {
|
|
updateOptions(options: object) {
|
|
|
- const update: any = {};
|
|
|
|
|
- update[this.getOptionsKey()] = options;
|
|
|
|
|
- Object.assign(this, update);
|
|
|
|
|
|
|
+ this.options = options;
|
|
|
this.render();
|
|
this.render();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private getOptionsKey() {
|
|
|
|
|
- return PANEL_OPTIONS_KEY_PREFIX + this.type;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
getSaveModel() {
|
|
getSaveModel() {
|
|
|
const model: any = {};
|
|
const model: any = {};
|
|
|
for (const property in this) {
|
|
for (const property in this) {
|