mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-26 06:04:05 -08:00
Added warnings into react Panel on the Graph page (#8427)
Signed-off-by: Alex Petrov <alex.petrov.vt@gmail.com>
This commit is contained in:
parent
275f7e7766
commit
91eef5e3bf
|
@ -29,6 +29,7 @@ interface PanelState {
|
||||||
data: any; // TODO: Type data.
|
data: any; // TODO: Type data.
|
||||||
lastQueryParams: QueryParams | null;
|
lastQueryParams: QueryParams | null;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
|
warnings: string[] | null;
|
||||||
error: string | null;
|
error: string | null;
|
||||||
stats: QueryStats | null;
|
stats: QueryStats | null;
|
||||||
exprInputValue: string;
|
exprInputValue: string;
|
||||||
|
@ -67,6 +68,7 @@ class Panel extends Component<PanelProps, PanelState> {
|
||||||
data: null,
|
data: null,
|
||||||
lastQueryParams: null,
|
lastQueryParams: null,
|
||||||
loading: false,
|
loading: false,
|
||||||
|
warnings: null,
|
||||||
error: null,
|
error: null,
|
||||||
stats: null,
|
stats: null,
|
||||||
exprInputValue: props.options.expr,
|
exprInputValue: props.options.expr,
|
||||||
|
@ -156,6 +158,7 @@ class Panel extends Component<PanelProps, PanelState> {
|
||||||
this.setState({
|
this.setState({
|
||||||
error: null,
|
error: null,
|
||||||
data: json.data,
|
data: json.data,
|
||||||
|
warnings: json.warnings,
|
||||||
lastQueryParams: {
|
lastQueryParams: {
|
||||||
startTime,
|
startTime,
|
||||||
endTime,
|
endTime,
|
||||||
|
@ -245,6 +248,11 @@ class Panel extends Component<PanelProps, PanelState> {
|
||||||
<Row>
|
<Row>
|
||||||
<Col>{this.state.error && <Alert color="danger">{this.state.error}</Alert>}</Col>
|
<Col>{this.state.error && <Alert color="danger">{this.state.error}</Alert>}</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
{this.state.warnings?.map((warning, index) => (
|
||||||
|
<Row key={index}>
|
||||||
|
<Col>{warning && <Alert color="warning">{warning}</Alert>}</Col>
|
||||||
|
</Row>
|
||||||
|
))}
|
||||||
<Row>
|
<Row>
|
||||||
<Col>
|
<Col>
|
||||||
<Nav tabs>
|
<Nav tabs>
|
||||||
|
|
Loading…
Reference in a new issue