diff options
Diffstat (limited to '')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-icon.pipe.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-icon.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-icon.pipe.ts new file mode 100644 index 000000000..1cb58e041 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-icon.pipe.ts @@ -0,0 +1,12 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +import { HealthIcon } from '../enum/health-icon.enum'; + +@Pipe({ + name: 'healthIcon' +}) +export class HealthIconPipe implements PipeTransform { + transform(value: string): string { + return Object.keys(HealthIcon).includes(value as HealthIcon) ? HealthIcon[value] : ''; + } +} |