]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | <ng-container *ngIf="!loading; else isLoading"> |
2 | <cd-alert-panel *ngIf="error" | |
3 | type="error" | |
4 | i18n>Failed to retrieve SMART data.</cd-alert-panel> | |
5 | <cd-alert-panel *ngIf="incompatible" | |
6 | type="warning" | |
7 | i18n>The data received has the JSON format version 2.x and is currently incompatible with the dashboard.</cd-alert-panel> | |
8 | ||
9 | <ng-container *ngIf="!error && !incompatible"> | |
f91f0fd5 | 10 | <cd-alert-panel *ngIf="data | pipeFunction:isEmpty" |
9f95a23c TL |
11 | type="info" |
12 | i18n>No SMART data available.</cd-alert-panel> | |
13 | ||
f91f0fd5 TL |
14 | <ng-container *ngIf="!(data | pipeFunction:isEmpty)"> |
15 | <tabset> | |
16 | <tab *ngFor="let device of data | keyvalue" | |
17 | [heading]="device.value.device + ' (' + device.value.identifier + ')'"> | |
18 | <ng-container *ngIf="device.value.error; else noError"> | |
19 | <cd-alert-panel id="alert-error" | |
20 | type="warning">{{ device.value.userMessage }}</cd-alert-panel> | |
9f95a23c | 21 | </ng-container> |
f91f0fd5 TL |
22 | |
23 | <ng-template #noError> | |
24 | <cd-alert-panel *ngIf="device.value.info?.smart_status | pipeFunction:isEmpty; else hasSmartStatus" | |
25 | id="alert-self-test-unknown" | |
9f95a23c TL |
26 | size="slim" |
27 | type="warning" | |
28 | i18n-title | |
29 | title="SMART overall-health self-assessment test result" | |
f91f0fd5 TL |
30 | i18n>unknown</cd-alert-panel> |
31 | <ng-template #hasSmartStatus> | |
32 | <!-- HDD/NVMe self test --> | |
33 | <ng-container *ngIf="device.value.info.smart_status.passed; else selfTestFailed"> | |
34 | <cd-alert-panel id="alert-self-test-passed" | |
35 | size="slim" | |
36 | type="info" | |
37 | i18n-title | |
38 | title="SMART overall-health self-assessment test result" | |
39 | i18n>passed</cd-alert-panel> | |
40 | </ng-container> | |
41 | <ng-template #selfTestFailed> | |
42 | <cd-alert-panel id="alert-self-test-failed" | |
43 | size="slim" | |
44 | type="warning" | |
45 | i18n-title | |
46 | title="SMART overall-health self-assessment test result" | |
47 | i18n>failed</cd-alert-panel> | |
48 | </ng-template> | |
49 | </ng-template> | |
9f95a23c TL |
50 | </ng-template> |
51 | ||
f91f0fd5 TL |
52 | <tabset #innerTabset |
53 | *ngIf="!(device.value.info | pipeFunction:isEmpty) || !(device.value.smart | pipeFunction:isEmpty)"> | |
9f95a23c TL |
54 | <tab i18n-heading |
55 | heading="Device Information"> | |
f91f0fd5 TL |
56 | <cd-table-key-value *ngIf="!(device.value.info | pipeFunction:isEmpty)" |
57 | [renderObjects]="true" | |
9f95a23c | 58 | [data]="device.value.info"></cd-table-key-value> |
f91f0fd5 TL |
59 | <cd-alert-panel *ngIf="(device.value.info | pipeFunction:isEmpty)" |
60 | id="alert-device-info-unavailable" | |
61 | type="info" | |
62 | i18n>No device information available for this device.</cd-alert-panel> | |
9f95a23c | 63 | </tab> |
9f95a23c TL |
64 | <tab i18n-heading |
65 | heading="SMART"> | |
f91f0fd5 | 66 | <cd-table *ngIf="device.value.smart?.attributes" |
9f95a23c TL |
67 | [data]="device.value.smart.attributes.table" |
68 | updateSelectionOnRefresh="never" | |
69 | [columns]="smartDataColumns"></cd-table> | |
f91f0fd5 | 70 | <cd-table-key-value *ngIf="device.value.smart?.nvmeData" |
9f95a23c TL |
71 | [renderObjects]="true" |
72 | [data]="device.value.smart.nvmeData" | |
73 | updateSelectionOnRefresh="never"></cd-table-key-value> | |
f91f0fd5 TL |
74 | <cd-alert-panel *ngIf="!device.value.smart?.attributes && !device.value.smart?.nvmeData" |
75 | id="alert-device-smart-data-unavailable" | |
9f95a23c TL |
76 | type="info" |
77 | i18n>No SMART data available for this device.</cd-alert-panel> | |
78 | </tab> | |
79 | </tabset> | |
f91f0fd5 TL |
80 | </tab> |
81 | </tabset> | |
82 | </ng-container> | |
9f95a23c TL |
83 | </ng-container> |
84 | </ng-container> | |
85 | <ng-template #isLoading> | |
86 | <cd-loading-panel i18n>SMART data is loading.</cd-loading-panel> | |
87 | </ng-template> |