|
@@ -10,6 +10,7 @@ import kbn from 'app/core/utils/kbn';
|
|
|
|
|
|
|
|
// Types
|
|
// Types
|
|
|
import { TimeRange, LoadingState, DataQueryOptions, DataQueryResponse, TimeSeries } from 'app/types';
|
|
import { TimeRange, LoadingState, DataQueryOptions, DataQueryResponse, TimeSeries } from 'app/types';
|
|
|
|
|
+import { Themes } from 'app/core/components/Tooltip/Popper';
|
|
|
|
|
|
|
|
interface RenderProps {
|
|
interface RenderProps {
|
|
|
loading: LoadingState;
|
|
loading: LoadingState;
|
|
@@ -139,7 +140,7 @@ export class DataPanel extends Component<Props, State> {
|
|
|
const timeSeries = response.data;
|
|
const timeSeries = response.data;
|
|
|
|
|
|
|
|
if (isFirstLoad && loading === LoadingState.Loading) {
|
|
if (isFirstLoad && loading === LoadingState.Loading) {
|
|
|
- return this.renderLoadingState();
|
|
|
|
|
|
|
+ return this.renderLoadingStates();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!queries.length) {
|
|
if (!queries.length) {
|
|
@@ -152,7 +153,7 @@ export class DataPanel extends Component<Props, State> {
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
- {this.renderLoadingState()}
|
|
|
|
|
|
|
+ {this.renderLoadingStates()}
|
|
|
{this.props.children({
|
|
{this.props.children({
|
|
|
timeSeries,
|
|
timeSeries,
|
|
|
loading,
|
|
loading,
|
|
@@ -161,7 +162,7 @@ export class DataPanel extends Component<Props, State> {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private renderLoadingState(): JSX.Element {
|
|
|
|
|
|
|
+ private renderLoadingStates(): JSX.Element {
|
|
|
const { loading } = this.state;
|
|
const { loading } = this.state;
|
|
|
if (loading === LoadingState.Loading) {
|
|
if (loading === LoadingState.Loading) {
|
|
|
return (
|
|
return (
|
|
@@ -176,6 +177,7 @@ export class DataPanel extends Component<Props, State> {
|
|
|
className="popper__manager--block"
|
|
className="popper__manager--block"
|
|
|
refClassName={`panel-info-corner panel-info-corner--error`}
|
|
refClassName={`panel-info-corner panel-info-corner--error`}
|
|
|
placement="bottom-start"
|
|
placement="bottom-start"
|
|
|
|
|
+ theme={Themes.Error}
|
|
|
>
|
|
>
|
|
|
<i className="fa" />
|
|
<i className="fa" />
|
|
|
<span className="panel-info-corner-inner" />
|
|
<span className="panel-info-corner-inner" />
|