]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-color.pipe.ts
import ceph pacific 16.2.5
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / pipes / health-color.pipe.ts
index 7da99de4b297b90301c2c12f1a01775577cd0c5b..d046fa15a79b82c85dbbdd107f827ec0745cc6a8 100644 (file)
@@ -1,12 +1,17 @@
 import { Pipe, PipeTransform } from '@angular/core';
 
-import { Color } from '../enum/color.enum';
+import { CssHelper } from '~/app/shared/classes/css-helper';
+import { HealthColor } from '~/app/shared/enum/health-color.enum';
 
 @Pipe({
   name: 'healthColor'
 })
 export class HealthColorPipe implements PipeTransform {
+  constructor(private cssHelper: CssHelper) {}
+
   transform(value: any): any {
-    return Color[value] ? { color: Color[value] } : null;
+    return Object.keys(HealthColor).includes(value as HealthColor)
+      ? { color: this.cssHelper.propertyValue(HealthColor[value]) }
+      : null;
   }
 }