1 import { Component, Input } from '@angular/core'
2 import { Notifier } from '@app/core'
3 import { RedundancyService } from '@app/shared/shared-main'
6 selector: 'my-redundancy-checkbox',
7 templateUrl: './redundancy-checkbox.component.html',
8 styleUrls: [ './redundancy-checkbox.component.scss' ]
10 export class RedundancyCheckboxComponent {
11 @Input() redundancyAllowed: boolean
15 private notifier: Notifier,
16 private redundancyService: RedundancyService
19 updateRedundancyState () {
20 this.redundancyService.updateRedundancy(this.host, this.redundancyAllowed)
23 const stateLabel = this.redundancyAllowed ? $localize`enabled` : $localize`disabled`
25 this.notifier.success($localize`Redundancy for ${this.host} is ${stateLabel}`)
28 error: err => this.notifier.error(err.message)