|
@@ -1,5 +1,5 @@
|
|
|
// Libraries
|
|
// Libraries
|
|
|
-import React, { ComponentClass, PureComponent } from 'react';
|
|
|
|
|
|
|
+import React, { PureComponent } from 'react';
|
|
|
import { AutoSizer } from 'react-virtualized';
|
|
import { AutoSizer } from 'react-virtualized';
|
|
|
|
|
|
|
|
// Services
|
|
// Services
|
|
@@ -16,12 +16,12 @@ import { PANEL_HEADER_HEIGHT } from 'app/core/constants';
|
|
|
// Types
|
|
// Types
|
|
|
import { PanelModel } from '../panel_model';
|
|
import { PanelModel } from '../panel_model';
|
|
|
import { DashboardModel } from '../dashboard_model';
|
|
import { DashboardModel } from '../dashboard_model';
|
|
|
-import { TimeRange, PanelProps } from 'app/types';
|
|
|
|
|
|
|
+import { PanelPlugin, TimeRange } from 'app/types';
|
|
|
|
|
|
|
|
export interface Props {
|
|
export interface Props {
|
|
|
panel: PanelModel;
|
|
panel: PanelModel;
|
|
|
dashboard: DashboardModel;
|
|
dashboard: DashboardModel;
|
|
|
- component: ComponentClass<PanelProps>;
|
|
|
|
|
|
|
+ plugin: PanelPlugin;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export interface State {
|
|
export interface State {
|
|
@@ -80,11 +80,11 @@ export class PanelChrome extends PureComponent<Props, State> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
render() {
|
|
|
- const { panel, dashboard } = this.props;
|
|
|
|
|
|
|
+ const { panel, dashboard, plugin } = this.props;
|
|
|
const { refreshCounter, timeRange, timeInfo, renderCounter } = this.state;
|
|
const { refreshCounter, timeRange, timeInfo, renderCounter } = this.state;
|
|
|
|
|
|
|
|
const { datasource, targets } = panel;
|
|
const { datasource, targets } = panel;
|
|
|
- const PanelComponent = this.props.component;
|
|
|
|
|
|
|
+ const PanelComponent = plugin.exports.Panel;
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<AutoSizer>
|
|
<AutoSizer>
|
|
@@ -111,7 +111,7 @@ export class PanelChrome extends PureComponent<Props, State> {
|
|
|
loading={loading}
|
|
loading={loading}
|
|
|
timeSeries={timeSeries}
|
|
timeSeries={timeSeries}
|
|
|
timeRange={timeRange}
|
|
timeRange={timeRange}
|
|
|
- options={panel.getOptions()}
|
|
|
|
|
|
|
+ options={panel.getOptions(plugin.exports.PanelDefaults)}
|
|
|
width={width}
|
|
width={width}
|
|
|
height={height - PANEL_HEADER_HEIGHT}
|
|
height={height - PANEL_HEADER_HEIGHT}
|
|
|
renderCounter={renderCounter}
|
|
renderCounter={renderCounter}
|