]>
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" | |
f67539c2 TL |
7 | i18n>The data received has the JSON format version 2.x and is currently incompatible with the |
8 | dashboard.</cd-alert-panel> | |
9f95a23c TL |
9 | |
10 | <ng-container *ngIf="!error && !incompatible"> | |
f91f0fd5 | 11 | <cd-alert-panel *ngIf="data | pipeFunction:isEmpty" |
9f95a23c TL |
12 | type="info" |
13 | i18n>No SMART data available.</cd-alert-panel> | |
14 | ||
f91f0fd5 | 15 | <ng-container *ngIf="!(data | pipeFunction:isEmpty)"> |
f67539c2 TL |
16 | <ul ngbNav |
17 | #nav="ngbNav" | |
18 | class="nav-tabs"> | |
19 | <li ngbNavItem | |
20 | *ngFor="let device of data | keyvalue"> | |
21 | <a ngbNavLink>{{ device.value.device }} ({{ device.value.identifier }})</a> | |
22 | <ng-template ngbNavContent> | |
23 | <ng-container *ngIf="device.value.error; else noError"> | |
24 | <cd-alert-panel id="alert-error" | |
25 | type="warning">{{ device.value.userMessage }}</cd-alert-panel> | |
26 | </ng-container> | |
f91f0fd5 | 27 | |
f67539c2 TL |
28 | <ng-template #noError> |
29 | <cd-alert-panel *ngIf="device.value.info?.smart_status | pipeFunction:isEmpty; else hasSmartStatus" | |
30 | id="alert-self-test-unknown" | |
31 | size="slim" | |
32 | type="warning" | |
33 | i18n-title | |
34 | title="SMART overall-health self-assessment test result" | |
35 | i18n>unknown</cd-alert-panel> | |
36 | <ng-template #hasSmartStatus> | |
37 | <!-- HDD/NVMe self test --> | |
38 | <ng-container *ngIf="device.value.info.smart_status.passed; else selfTestFailed"> | |
39 | <cd-alert-panel id="alert-self-test-passed" | |
40 | size="slim" | |
41 | type="info" | |
42 | i18n-title | |
43 | title="SMART overall-health self-assessment test result" | |
44 | i18n>passed</cd-alert-panel> | |
45 | </ng-container> | |
46 | <ng-template #selfTestFailed> | |
47 | <cd-alert-panel id="alert-self-test-failed" | |
48 | size="slim" | |
49 | type="warning" | |
50 | i18n-title | |
51 | title="SMART overall-health self-assessment test result" | |
52 | i18n>failed</cd-alert-panel> | |
53 | </ng-template> | |
f91f0fd5 TL |
54 | </ng-template> |
55 | </ng-template> | |
f67539c2 TL |
56 | |
57 | <ng-container *ngIf="!(device.value.info | pipeFunction:isEmpty) || !(device.value.smart | pipeFunction:isEmpty)"> | |
58 | <ul ngbNav | |
59 | #innerNav="ngbNav" | |
60 | class="nav-tabs"> | |
61 | <li [ngbNavItem]="1"> | |
62 | <a ngbNavLink | |
63 | i18n>Device Information</a> | |
64 | <ng-template ngbNavContent> | |
65 | <cd-table-key-value *ngIf="!(device.value.info | pipeFunction:isEmpty)" | |
66 | [renderObjects]="true" | |
67 | [data]="device.value.info"></cd-table-key-value> | |
68 | <cd-alert-panel *ngIf="device.value.info | pipeFunction:isEmpty" | |
69 | id="alert-device-info-unavailable" | |
70 | type="info" | |
71 | i18n>No device information available for this device.</cd-alert-panel> | |
72 | </ng-template> | |
73 | </li> | |
74 | <li [ngbNavItem]="2"> | |
75 | <a ngbNavLink | |
76 | i18n>SMART</a> | |
77 | <ng-template ngbNavContent> | |
78 | <cd-table *ngIf="device.value.smart?.attributes" | |
79 | [data]="device.value.smart.attributes.table" | |
80 | updateSelectionOnRefresh="never" | |
81 | [columns]="smartDataColumns"></cd-table> | |
33c7a0ef TL |
82 | <cd-table-key-value *ngIf="device.value.smart?.scsi_error_counter_log" |
83 | [renderObjects]="true" | |
84 | [data]="device.value.smart" | |
85 | updateSelectionOnRefresh="never"></cd-table-key-value> | |
f67539c2 TL |
86 | <cd-table-key-value *ngIf="device.value.smart?.nvmeData" |
87 | [renderObjects]="true" | |
88 | [data]="device.value.smart.nvmeData" | |
89 | updateSelectionOnRefresh="never"></cd-table-key-value> | |
33c7a0ef | 90 | <cd-alert-panel *ngIf="!device.value.smart?.attributes && !device.value.smart?.nvmeData && !device.value.smart?.scsi_error_counter_log" |
f67539c2 TL |
91 | id="alert-device-smart-data-unavailable" |
92 | type="info" | |
93 | i18n>No SMART data available for this device.</cd-alert-panel> | |
94 | </ng-template> | |
95 | </li> | |
96 | </ul> | |
97 | ||
98 | <div [ngbNavOutlet]="innerNav"></div> | |
99 | </ng-container> | |
9f95a23c | 100 | </ng-template> |
f67539c2 TL |
101 | </li> |
102 | </ul> | |
9f95a23c | 103 | |
f67539c2 | 104 | <div [ngbNavOutlet]="nav"></div> |
f91f0fd5 | 105 | </ng-container> |
9f95a23c TL |
106 | </ng-container> |
107 | </ng-container> | |
108 | <ng-template #isLoading> | |
109 | <cd-loading-panel i18n>SMART data is loading.</cd-loading-panel> | |
110 | </ng-template> |