diff --git a/web/ui/react-app/src/pages/alerts/CollapsibleAlertPanel.tsx b/web/ui/react-app/src/pages/alerts/CollapsibleAlertPanel.tsx index 72edfbab7..8a5197aa7 100644 --- a/web/ui/react-app/src/pages/alerts/CollapsibleAlertPanel.tsx +++ b/web/ui/react-app/src/pages/alerts/CollapsibleAlertPanel.tsx @@ -28,81 +28,85 @@ const CollapsibleAlertPanel: FC = ({ rule, showAnnot {rule.name} ({`${rule.alerts.length} active`}) -
-          
-            
- name: {rule.name} -
-
- expr: {rule.query} -
- {rule.duration > 0 && ( -
-
for: {formatDuration(rule.duration * 1000)}
-
- )} - {rule.labels && Object.keys(rule.labels).length > 0 && ( -
-
labels:
- {Object.entries(rule.labels).map(([key, value]) => ( -
- {key}: {value} + {open && ( + <> +
+              
+                
+ name: {rule.name} +
+
+ expr: {rule.query} +
+ {rule.duration > 0 && ( +
+
for: {formatDuration(rule.duration * 1000)}
- ))} -
- )} - {rule.annotations && Object.keys(rule.annotations).length > 0 && ( -
-
annotations:
- {Object.entries(rule.annotations).map(([key, value]) => ( -
- {key}: {value} + )} + {rule.labels && Object.keys(rule.labels).length > 0 && ( +
+
labels:
+ {Object.entries(rule.labels).map(([key, value]) => ( +
+ {key}: {value} +
+ ))}
- ))} -
+ )} + {rule.annotations && Object.keys(rule.annotations).length > 0 && ( +
+
annotations:
+ {Object.entries(rule.annotations).map(([key, value]) => ( +
+ {key}: {value} +
+ ))} +
+ )} +
+
+ {rule.alerts.length > 0 && ( + + + + + + + + + + + {rule.alerts.map((alert, i) => { + return ( + + + + + + + + {showAnnotations && } + + ); + })} + +
LabelsStateActive SinceValue
+ {Object.entries(alert.labels).map(([k, v], j) => { + return ( + + {k}={v} + + ); + })} + +
+ + {alert.state} + +
+
{alert.activeAt}{parsePrometheusFloat(alert.value)}
)} -
- - {rule.alerts.length > 0 && ( - - - - - - - - - - - {rule.alerts.map((alert, i) => { - return ( - - - - - - - - {showAnnotations && } - - ); - })} - -
LabelsStateActive SinceValue
- {Object.entries(alert.labels).map(([k, v], j) => { - return ( - - {k}={v} - - ); - })} - -
- - {alert.state} - -
-
{alert.activeAt}{parsePrometheusFloat(alert.value)}
+ )}