Panel inspect: Interpolate variables in panel inspect title (#28779)
* Interpolate variables in panel inspect title * Update public/app/features/dashboard/components/Inspector/InspectContent.tsx Co-authored-by: Torkel Ödegaard <torkel@grafana.org> * fix typo Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
This commit is contained in:
co-authored by
Torkel Ödegaard
parent
a9e201332a
commit
4036a44a80
@@ -1,6 +1,8 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { getPanelInspectorStyles } from './styles';
|
import { DataSourceApi, PanelData, PanelPlugin } from '@grafana/data';
|
||||||
|
import { getTemplateSrv } from '@grafana/runtime';
|
||||||
import { CustomScrollbar, Drawer, TabContent } from '@grafana/ui';
|
import { CustomScrollbar, Drawer, TabContent } from '@grafana/ui';
|
||||||
|
import { getPanelInspectorStyles } from './styles';
|
||||||
import { InspectSubtitle } from './InspectSubtitle';
|
import { InspectSubtitle } from './InspectSubtitle';
|
||||||
import { InspectDataTab } from './InspectDataTab';
|
import { InspectDataTab } from './InspectDataTab';
|
||||||
import { InspectMetadataTab } from './InspectMetadataTab';
|
import { InspectMetadataTab } from './InspectMetadataTab';
|
||||||
@@ -10,7 +12,6 @@ import { InspectStatsTab } from './InspectStatsTab';
|
|||||||
import { QueryInspector } from './QueryInspector';
|
import { QueryInspector } from './QueryInspector';
|
||||||
import { InspectTab } from './types';
|
import { InspectTab } from './types';
|
||||||
import { DashboardModel, PanelModel } from '../../state';
|
import { DashboardModel, PanelModel } from '../../state';
|
||||||
import { DataSourceApi, PanelData, PanelPlugin } from '@grafana/data';
|
|
||||||
import { GetDataOptions } from '../../state/PanelQueryRunner';
|
import { GetDataOptions } from '../../state/PanelQueryRunner';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -56,10 +57,11 @@ export const InspectContent: React.FC<Props> = ({
|
|||||||
if (!tabs.find(item => item.value === currentTab)) {
|
if (!tabs.find(item => item.value === currentTab)) {
|
||||||
activeTab = InspectTab.JSON;
|
activeTab = InspectTab.JSON;
|
||||||
}
|
}
|
||||||
|
const title = getTemplateSrv().replace(panel.title, panel.scopedVars, 'text');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Drawer
|
<Drawer
|
||||||
title={`Inspect: ${panel.title}` || 'Panel inspect'}
|
title={`Inspect: ${title || 'Panel'}`}
|
||||||
subtitle={
|
subtitle={
|
||||||
<InspectSubtitle
|
<InspectSubtitle
|
||||||
tabs={tabs}
|
tabs={tabs}
|
||||||
|
|||||||
Reference in New Issue
Block a user