mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Tables: optionally show field type icon in tables (#38855)
This commit is contained in:
@@ -19,6 +19,7 @@ export function PanelEditorTableView({ width, height, panel, dashboard }: Props)
|
||||
const [options, setOptions] = useState<PanelOptions>({
|
||||
frameIndex: 0,
|
||||
showHeader: true,
|
||||
showTypeIcons: true,
|
||||
});
|
||||
|
||||
// Subscribe to panel event
|
||||
|
||||
@@ -228,7 +228,7 @@ export class InspectDataTab extends PureComponent<Props, State> {
|
||||
|
||||
return (
|
||||
<div style={{ width, height }}>
|
||||
<Table width={width} height={height} data={dataFrame} />
|
||||
<Table width={width} height={height} data={dataFrame} showTypeIcons={true} />
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
|
||||
@@ -86,6 +86,7 @@ export class TablePanel extends Component<Props> {
|
||||
width={width}
|
||||
data={frame}
|
||||
noHeader={!options.showHeader}
|
||||
showTypeIcons={options.showTypeIcons}
|
||||
resizable={true}
|
||||
initialSortBy={options.sortBy}
|
||||
onSortByChange={this.onSortByChange}
|
||||
|
||||
@@ -25,6 +25,7 @@ Family: {
|
||||
PanelOptions: {
|
||||
frameIndex: number | *0
|
||||
showHeader: bool | *true
|
||||
showTypeIcons: bool | *false
|
||||
sortBy?: [...ui.TableSortByFieldState]
|
||||
}
|
||||
PanelFieldConfig: {
|
||||
|
||||
@@ -14,12 +14,14 @@ export const modelVersion = Object.freeze([1, 0]);
|
||||
export interface PanelOptions {
|
||||
frameIndex: number;
|
||||
showHeader: boolean;
|
||||
showTypeIcons?: boolean;
|
||||
sortBy?: TableSortByFieldState[];
|
||||
}
|
||||
|
||||
export const defaultPanelOptions: PanelOptions = {
|
||||
frameIndex: 0,
|
||||
showHeader: true,
|
||||
showTypeIcons: false,
|
||||
};
|
||||
|
||||
export interface PanelFieldConfig {
|
||||
|
||||
Reference in New Issue
Block a user