mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34: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.
|
||||
lastQueryParams: QueryParams | null;
|
||||
loading: boolean;
|
||||
warnings: string[] | null;
|
||||
error: string | null;
|
||||
stats: QueryStats | null;
|
||||
exprInputValue: string;
|
||||
|
@ -67,6 +68,7 @@ class Panel extends Component<PanelProps, PanelState> {
|
|||
data: null,
|
||||
lastQueryParams: null,
|
||||
loading: false,
|
||||
warnings: null,
|
||||
error: null,
|
||||
stats: null,
|
||||
exprInputValue: props.options.expr,
|
||||
|
@ -156,6 +158,7 @@ class Panel extends Component<PanelProps, PanelState> {
|
|||
this.setState({
|
||||
error: null,
|
||||
data: json.data,
|
||||
warnings: json.warnings,
|
||||
lastQueryParams: {
|
||||
startTime,
|
||||
endTime,
|
||||
|
@ -245,6 +248,11 @@ class Panel extends Component<PanelProps, PanelState> {
|
|||
<Row>
|
||||
<Col>{this.state.error && <Alert color="danger">{this.state.error}</Alert>}</Col>
|
||||
</Row>
|
||||
{this.state.warnings?.map((warning, index) => (
|
||||
<Row key={index}>
|
||||
<Col>{warning && <Alert color="warning">{warning}</Alert>}</Col>
|
||||
</Row>
|
||||
))}
|
||||
<Row>
|
||||
<Col>
|
||||
<Nav tabs>
|
||||
|
|
Loading…
Reference in a new issue