mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Restored loading spinner to DataPanel
This commit is contained in:
parent
79008a7acd
commit
19a080a4d4
@ -188,11 +188,7 @@ export class DataPanel extends Component<Props, State> {
|
|||||||
const panelData = this.getPanelData();
|
const panelData = this.getPanelData();
|
||||||
|
|
||||||
if (isFirstLoad && loading === LoadingState.Loading) {
|
if (isFirstLoad && loading === LoadingState.Loading) {
|
||||||
return (
|
return this.renderLoadingState();
|
||||||
<div className="panel-loading">
|
|
||||||
<i className="fa fa-spinner fa-spin" />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!queries.length) {
|
if (!queries.length) {
|
||||||
@ -203,9 +199,23 @@ export class DataPanel extends Component<Props, State> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.props.children({
|
return (
|
||||||
loading,
|
<>
|
||||||
panelData,
|
{this.renderLoadingState()}
|
||||||
});
|
{this.props.children({ loading, panelData })}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private renderLoadingState(): JSX.Element {
|
||||||
|
const { loading } = this.state;
|
||||||
|
if (loading === LoadingState.Loading) {
|
||||||
|
return (
|
||||||
|
<div className="panel-loading">
|
||||||
|
<i className="fa fa-spinner fa-spin" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user