mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 08:35:43 -06:00
Explore: updates Table container render to avoid rendering table on empty result
This commit is contained in:
parent
2bdbdd6930
commit
e230e1df96
@ -40,17 +40,19 @@ export class TableContainer extends PureComponent<TableContainerProps> {
|
||||
|
||||
const height = this.getTableHeight();
|
||||
const tableWidth = width - config.theme.panelPadding * 2 - PANEL_BORDER;
|
||||
const hasTableResult = tableResult?.length;
|
||||
|
||||
return (
|
||||
<Collapse label="Table" loading={loading} collapsible isOpen={showingTable} onToggle={this.onClickTableButton}>
|
||||
{!tableResult?.length && (
|
||||
{hasTableResult ? (
|
||||
<Table data={tableResult} width={tableWidth} height={height} onCellClick={onClickCell} />
|
||||
) : (
|
||||
<div className="logs-panel-meta">
|
||||
<div className="logs-panel-meta__item">
|
||||
<span className="logs-panel-meta__value">0 series returned</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{tableResult && <Table data={tableResult} width={tableWidth} height={height} onCellClick={onClickCell} />}
|
||||
</Collapse>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user