mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Annotations: Fix alerting annotation coloring (#37412)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
@@ -59,9 +59,9 @@ export function translateQueryResult(annotation: AnnotationQuery, results: Annot
|
||||
item.type = annotation.name;
|
||||
item.isRegion = Boolean(item.timeEnd && item.time !== item.timeEnd);
|
||||
|
||||
switch (item.newState) {
|
||||
switch (item.newState?.toLowerCase()) {
|
||||
case 'pending':
|
||||
item.color = 'gray';
|
||||
item.color = 'yellow';
|
||||
break;
|
||||
case 'alerting':
|
||||
item.color = 'red';
|
||||
@@ -69,9 +69,15 @@ export function translateQueryResult(annotation: AnnotationQuery, results: Annot
|
||||
case 'ok':
|
||||
item.color = 'green';
|
||||
break;
|
||||
case 'normal': // ngalert ("normal" instead of "ok")
|
||||
item.color = 'green';
|
||||
break;
|
||||
case 'no_data':
|
||||
item.color = 'gray';
|
||||
break;
|
||||
case 'nodata': // ngalert
|
||||
item.color = 'gray';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user