The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/features/explore/ErrorContainer.tsx

32 lines
1.1 KiB

import React, { FunctionComponent } from 'react';
import { DataQueryError } from '@grafana/data';
import { FadeIn } from 'app/core/components/Animations/FadeIn';
import { getFirstQueryErrorWithoutRefId, getValueWithRefId } from 'app/core/utils/explore';
interface Props {
queryErrors?: DataQueryError[];
}
export const ErrorContainer: FunctionComponent<Props> = props => {
const { queryErrors } = props;
const refId = getValueWithRefId(queryErrors);
const queryError = refId ? null : getFirstQueryErrorWithoutRefId(queryErrors);
const showError = queryError ? true : false;
const duration = showError ? 100 : 10;
const message = queryError ? queryError.message : null;
return (
<FadeIn in={showError} duration={duration}>
<div className="alert-container">
<div className="alert-error alert">
<div className="alert-icon">
<i className="fa fa-exclamation-triangle" />
</div>
<div className="alert-body">
<div className="alert-title">{message}</div>
</div>
</div>
</div>
</FadeIn>
);
};