X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fpybind%2Fmgr%2Fdashboard%2Ffrontend%2Fsrc%2Fapp%2Fshared%2Fpipes%2Fhealth-color.pipe.ts;fp=ceph%2Fsrc%2Fpybind%2Fmgr%2Fdashboard%2Ffrontend%2Fsrc%2Fapp%2Fshared%2Fpipes%2Fhealth-color.pipe.ts;h=d046fa15a79b82c85dbbdd107f827ec0745cc6a8;hb=b3b6e05ebb17ef6ac03c6f6f46d242185719a08e;hp=7da99de4b297b90301c2c12f1a01775577cd0c5b;hpb=a912ff2c95b1f9a8e2e48509e602ee008d5c9434;p=ceph.git diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-color.pipe.ts b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-color.pipe.ts index 7da99de4b..d046fa15a 100644 --- a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-color.pipe.ts +++ b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-color.pipe.ts @@ -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; } }