diff options
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/prometheus-list-helper.ts')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/prometheus-list-helper.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/prometheus-list-helper.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/prometheus-list-helper.ts new file mode 100644 index 000000000..c1a594908 --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/prometheus-list-helper.ts @@ -0,0 +1,24 @@ +import { Directive, OnInit } from '@angular/core'; + +import { PrometheusService } from '~/app/shared/api/prometheus.service'; +import { ListWithDetails } from '~/app/shared/classes/list-with-details.class'; + +@Directive() +// tslint:disable-next-line: directive-class-suffix +export class PrometheusListHelper extends ListWithDetails implements OnInit { + public isPrometheusConfigured = false; + public isAlertmanagerConfigured = false; + + constructor(protected prometheusService: PrometheusService) { + super(); + } + + ngOnInit() { + this.prometheusService.ifAlertmanagerConfigured(() => { + this.isAlertmanagerConfigured = true; + }); + this.prometheusService.ifPrometheusConfigured(() => { + this.isPrometheusConfigured = true; + }); + } +} |