mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
* DashboardScene: Inspect / Json tab * Fixing behaviors and writing tests * Progress * limit options based on data provider * Fixes * Add tracking * Remove unused function * Remove unused function * Fix test * Update * Move utils function * Rename to source
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import React from 'react';
|
|
|
|
import {
|
|
SceneComponentProps,
|
|
sceneGraph,
|
|
SceneObjectBase,
|
|
SceneObjectState,
|
|
SceneObjectRef,
|
|
VizPanel,
|
|
} from '@grafana/scenes';
|
|
import { t } from 'app/core/internationalization';
|
|
import { InspectTab } from 'app/features/inspector/types';
|
|
|
|
import { InspectStatsTab as OldInspectStatsTab } from '../../inspector/InspectStatsTab';
|
|
|
|
export interface InspectDataTabState extends SceneObjectState {
|
|
panelRef: SceneObjectRef<VizPanel>;
|
|
}
|
|
|
|
export class InspectStatsTab extends SceneObjectBase<InspectDataTabState> {
|
|
public getTabLabel() {
|
|
return t('dashboard.inspect.stats-tab', 'Stats');
|
|
}
|
|
|
|
public getTabValue() {
|
|
return InspectTab.Stats;
|
|
}
|
|
|
|
static Component = ({ model }: SceneComponentProps<InspectStatsTab>) => {
|
|
const data = sceneGraph.getData(model.state.panelRef.resolve()).useState();
|
|
const timeRange = sceneGraph.getTimeRange(model.state.panelRef.resolve());
|
|
|
|
if (!data.data) {
|
|
return null;
|
|
}
|
|
|
|
return <OldInspectStatsTab data={data.data} timeZone={timeRange.getTimeZone()} />;
|
|
};
|
|
}
|