|
@@ -7,7 +7,7 @@ import { getNextRefIdChar } from 'app/core/utils/query';
|
|
|
|
|
|
|
|
// Types
|
|
// Types
|
|
|
import { DataQuery, Threshold, ScopedVars, DataQueryResponseData } from '@grafana/ui';
|
|
import { DataQuery, Threshold, ScopedVars, DataQueryResponseData } from '@grafana/ui';
|
|
|
-import { PanelPlugin } from 'app/types';
|
|
|
|
|
|
|
+import { PanelPluginMeta } from 'app/types';
|
|
|
import config from 'app/core/config';
|
|
import config from 'app/core/config';
|
|
|
|
|
|
|
|
import { PanelQueryRunner } from './PanelQueryRunner';
|
|
import { PanelQueryRunner } from './PanelQueryRunner';
|
|
@@ -117,7 +117,7 @@ export class PanelModel {
|
|
|
cacheTimeout?: any;
|
|
cacheTimeout?: any;
|
|
|
cachedPluginOptions?: any;
|
|
cachedPluginOptions?: any;
|
|
|
legend?: { show: boolean };
|
|
legend?: { show: boolean };
|
|
|
- plugin?: PanelPlugin;
|
|
|
|
|
|
|
+ plugin?: PanelPluginMeta;
|
|
|
private queryRunner?: PanelQueryRunner;
|
|
private queryRunner?: PanelQueryRunner;
|
|
|
|
|
|
|
|
constructor(model: any) {
|
|
constructor(model: any) {
|
|
@@ -249,23 +249,23 @@ export class PanelModel {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private getPluginVersion(plugin: PanelPlugin): string {
|
|
|
|
|
|
|
+ private getPluginVersion(plugin: PanelPluginMeta): string {
|
|
|
return this.plugin && this.plugin.info.version ? this.plugin.info.version : config.buildInfo.version;
|
|
return this.plugin && this.plugin.info.version ? this.plugin.info.version : config.buildInfo.version;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- pluginLoaded(plugin: PanelPlugin) {
|
|
|
|
|
|
|
+ pluginLoaded(plugin: PanelPluginMeta) {
|
|
|
this.plugin = plugin;
|
|
this.plugin = plugin;
|
|
|
|
|
|
|
|
- if (plugin.reactPlugin && plugin.reactPlugin.onPanelMigration) {
|
|
|
|
|
|
|
+ if (plugin.vizPlugin && plugin.vizPlugin.onPanelMigration) {
|
|
|
const version = this.getPluginVersion(plugin);
|
|
const version = this.getPluginVersion(plugin);
|
|
|
if (version !== this.pluginVersion) {
|
|
if (version !== this.pluginVersion) {
|
|
|
- this.options = plugin.reactPlugin.onPanelMigration(this);
|
|
|
|
|
|
|
+ this.options = plugin.vizPlugin.onPanelMigration(this);
|
|
|
this.pluginVersion = version;
|
|
this.pluginVersion = version;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- changePlugin(newPlugin: PanelPlugin) {
|
|
|
|
|
|
|
+ changePlugin(newPlugin: PanelPluginMeta) {
|
|
|
const pluginId = newPlugin.id;
|
|
const pluginId = newPlugin.id;
|
|
|
const oldOptions: any = this.getOptionsToRemember();
|
|
const oldOptions: any = this.getOptionsToRemember();
|
|
|
const oldPluginId = this.type;
|
|
const oldPluginId = this.type;
|
|
@@ -292,7 +292,7 @@ export class PanelModel {
|
|
|
this.plugin = newPlugin;
|
|
this.plugin = newPlugin;
|
|
|
|
|
|
|
|
// Let panel plugins inspect options from previous panel and keep any that it can use
|
|
// Let panel plugins inspect options from previous panel and keep any that it can use
|
|
|
- const reactPanel = newPlugin.reactPlugin;
|
|
|
|
|
|
|
+ const reactPanel = newPlugin.vizPlugin;
|
|
|
|
|
|
|
|
if (reactPanel) {
|
|
if (reactPanel) {
|
|
|
if (reactPanel.onPanelTypeChanged) {
|
|
if (reactPanel.onPanelTypeChanged) {
|