|
@@ -11,7 +11,7 @@ import { DataPanel } from './DataPanel';
|
|
|
import ErrorBoundary from '../../../core/components/ErrorBoundary/ErrorBoundary';
|
|
import ErrorBoundary from '../../../core/components/ErrorBoundary/ErrorBoundary';
|
|
|
|
|
|
|
|
// Utils
|
|
// Utils
|
|
|
-import { applyPanelTimeOverrides, snapshotDataToPanelData } from 'app/features/dashboard/utils/panel';
|
|
|
|
|
|
|
+import { applyPanelTimeOverrides } from 'app/features/dashboard/utils/panel';
|
|
|
import { PANEL_HEADER_HEIGHT } from 'app/core/constants';
|
|
import { PANEL_HEADER_HEIGHT } from 'app/core/constants';
|
|
|
import { profiler } from 'app/core/profiler';
|
|
import { profiler } from 'app/core/profiler';
|
|
|
import config from 'app/core/config';
|
|
import config from 'app/core/config';
|
|
@@ -19,7 +19,7 @@ import config from 'app/core/config';
|
|
|
// Types
|
|
// Types
|
|
|
import { DashboardModel, PanelModel } from '../state';
|
|
import { DashboardModel, PanelModel } from '../state';
|
|
|
import { PanelPlugin } from 'app/types';
|
|
import { PanelPlugin } from 'app/types';
|
|
|
-import { DataQueryResponse, TimeRange, LoadingState, PanelData, DataQueryError } from '@grafana/ui';
|
|
|
|
|
|
|
+import { DataQueryResponse, TimeRange, LoadingState, TableData, DataQueryError, toTableData } from '@grafana/ui';
|
|
|
import { ScopedVars } from '@grafana/ui';
|
|
import { ScopedVars } from '@grafana/ui';
|
|
|
|
|
|
|
|
import templateSrv from 'app/features/templating/template_srv';
|
|
import templateSrv from 'app/features/templating/template_srv';
|
|
@@ -139,10 +139,10 @@ export class PanelChrome extends PureComponent<Props, State> {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
get getDataForPanel() {
|
|
get getDataForPanel() {
|
|
|
- return this.hasPanelSnapshot ? snapshotDataToPanelData(this.props.panel) : null;
|
|
|
|
|
|
|
+ return this.hasPanelSnapshot ? toTableData(this.props.panel.snapshotData) : null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- renderPanelPlugin(loading: LoadingState, panelData: PanelData, width: number, height: number): JSX.Element {
|
|
|
|
|
|
|
+ renderPanelPlugin(loading: LoadingState, data: TableData[], width: number, height: number): JSX.Element {
|
|
|
const { panel, plugin } = this.props;
|
|
const { panel, plugin } = this.props;
|
|
|
const { timeRange, renderCounter } = this.state;
|
|
const { timeRange, renderCounter } = this.state;
|
|
|
const PanelComponent = plugin.exports.reactPanel.panel;
|
|
const PanelComponent = plugin.exports.reactPanel.panel;
|
|
@@ -157,7 +157,7 @@ export class PanelChrome extends PureComponent<Props, State> {
|
|
|
<div className="panel-content">
|
|
<div className="panel-content">
|
|
|
<PanelComponent
|
|
<PanelComponent
|
|
|
loading={loading}
|
|
loading={loading}
|
|
|
- panelData={panelData}
|
|
|
|
|
|
|
+ data={data}
|
|
|
timeRange={timeRange}
|
|
timeRange={timeRange}
|
|
|
options={panel.getOptions(plugin.exports.reactPanel.defaults)}
|
|
options={panel.getOptions(plugin.exports.reactPanel.defaults)}
|
|
|
width={width - 2 * config.theme.panelPadding.horizontal}
|
|
width={width - 2 * config.theme.panelPadding.horizontal}
|
|
@@ -188,8 +188,8 @@ export class PanelChrome extends PureComponent<Props, State> {
|
|
|
onDataResponse={this.onDataResponse}
|
|
onDataResponse={this.onDataResponse}
|
|
|
onError={this.onDataError}
|
|
onError={this.onDataError}
|
|
|
>
|
|
>
|
|
|
- {({ loading, panelData }) => {
|
|
|
|
|
- return this.renderPanelPlugin(loading, panelData, width, height);
|
|
|
|
|
|
|
+ {({ loading, data }) => {
|
|
|
|
|
+ return this.renderPanelPlugin(loading, data, width, height);
|
|
|
}}
|
|
}}
|
|
|
</DataPanel>
|
|
</DataPanel>
|
|
|
) : (
|
|
) : (
|