summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirror-health-color.pipe.ts
blob: 3c25d715e5e309de195691a3947b84296dfaa503 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'mirrorHealthColor'
})
export class MirrorHealthColorPipe implements PipeTransform {
  transform(value: any): any {
    if (value === 'warning') {
      return 'badge badge-warning';
    } else if (value === 'error') {
      return 'badge badge-danger';
    } else if (value === 'success') {
      return 'badge badge-success';
    }
    return 'badge badge-info';
  }
}