import { DatePipe } from '@angular/common';
import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core';
-import { I18n } from '@ngx-translate/i18n-polyfill';
-import { HostService } from '../../../shared/api/host.service';
-import { OsdService } from '../../../shared/api/osd.service';
-import { CellTemplate } from '../../../shared/enum/cell-template.enum';
-import { CdTableColumn } from '../../../shared/models/cd-table-column';
-import { CdDevice } from '../../../shared/models/devices';
+import { HostService } from '~/app/shared/api/host.service';
+import { OsdService } from '~/app/shared/api/osd.service';
+import { CellTemplate } from '~/app/shared/enum/cell-template.enum';
+import { CdTableColumn } from '~/app/shared/models/cd-table-column';
+import { CdDevice } from '~/app/shared/models/devices';
@Component({
selector: 'cd-device-list',
constructor(
private hostService: HostService,
- private i18n: I18n,
private datePipe: DatePipe,
private osdService: OsdService
) {}
ngOnInit() {
this.columns = [
- { prop: 'devid', name: this.i18n('Device ID'), minWidth: 200 },
+ { prop: 'devid', name: $localize`Device ID`, minWidth: 200 },
{
prop: 'state',
- name: this.i18n('State of Health'),
+ name: $localize`State of Health`,
flexGrow: 1,
cellTransformation: CellTemplate.badge,
customTemplateConfig: {
map: {
- good: { value: this.i18n('Good'), class: 'badge-success' },
- warning: { value: this.i18n('Warning'), class: 'badge-warning' },
- bad: { value: this.i18n('Bad'), class: 'badge-danger' },
- stale: { value: this.i18n('Stale'), class: 'badge-info' },
- unknown: { value: this.i18n('Unknown'), class: 'badge-dark' }
+ good: { value: $localize`Good`, class: 'badge-success' },
+ warning: { value: $localize`Warning`, class: 'badge-warning' },
+ bad: { value: $localize`Bad`, class: 'badge-danger' },
+ stale: { value: $localize`Stale`, class: 'badge-info' },
+ unknown: { value: $localize`Unknown`, class: 'badge-dark' }
}
}
},
{
prop: 'life_expectancy_weeks',
- name: this.i18n('Life Expectancy'),
+ name: $localize`Life Expectancy`,
cellTemplate: this.lifeExpectancyTemplate
},
{
prop: 'life_expectancy_stamp',
- name: this.i18n('Prediction Creation Date'),
+ name: $localize`Prediction Creation Date`,
cellTemplate: this.lifeExpectancyTimestampTemplate,
pipe: this.datePipe,
isHidden: true
},
- { prop: 'location', name: this.i18n('Device Name'), cellTemplate: this.locationTemplate },
- { prop: 'readableDaemons', name: this.i18n('Daemons') }
+ { prop: 'location', name: $localize`Device Name`, cellTemplate: this.locationTemplate },
+ { prop: 'readableDaemons', name: $localize`Daemons` }
];
}