diff --git a/webapp/frontend/src/app/modules/dashboard/dashboard.component.html b/webapp/frontend/src/app/modules/dashboard/dashboard.component.html index cd53896..6fa33a6 100644 --- a/webapp/frontend/src/app/modules/dashboard/dashboard.component.html +++ b/webapp/frontend/src/app/modules/dashboard/dashboard.component.html @@ -51,7 +51,7 @@

{{hostId.key}}

- +
diff --git a/webapp/frontend/src/app/modules/dashboard/dashboard.component.ts b/webapp/frontend/src/app/modules/dashboard/dashboard.component.ts index 0f09cec..bc45ea7 100644 --- a/webapp/frontend/src/app/modules/dashboard/dashboard.component.ts +++ b/webapp/frontend/src/app/modules/dashboard/dashboard.component.ts @@ -226,6 +226,14 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy return titleParts.join(' - ') } + deviceSummariesForHostGroup(hostGroupWWNs: string[]) { + let deviceSummaries = [] + for(let wwn of hostGroupWWNs){ + deviceSummaries.push(this.data.data.summary[wwn]) + } + return deviceSummaries + } + openDialog() { const dialogRef = this.dialog.open(DashboardSettingsComponent); diff --git a/webapp/frontend/src/app/shared/device-sort.pipe.ts b/webapp/frontend/src/app/shared/device-sort.pipe.ts index 6f115f1..57f2859 100644 --- a/webapp/frontend/src/app/shared/device-sort.pipe.ts +++ b/webapp/frontend/src/app/shared/device-sort.pipe.ts @@ -5,20 +5,20 @@ import { Pipe, PipeTransform } from '@angular/core'; }) export class DeviceSortPipe implements PipeTransform { - numericalStatus(device): number { - if(!device.smart_results[0]){ + numericalStatus(deviceSummary): number { + if(!deviceSummary.smart){ return 0 - } else if (device.smart_results[0].smart_status == 'passed'){ + } else if (deviceSummary.device.device_status == 0){ return 1 } else { - return -1 + return deviceSummary.device.device_status * -1 // will return range from -1, -2, -3 } } - transform(devices: Array, ...args: unknown[]): Array { + transform(deviceSummaries: Array, sortBy = ''): Array { //failed, unknown/empty, passed - devices.sort((a: any, b: any) => { + deviceSummaries.sort((a: any, b: any) => { let left = this.numericalStatus(a) let right = this.numericalStatus(b) @@ -27,7 +27,7 @@ export class DeviceSortPipe implements PipeTransform { }); - return devices; + return deviceSummaries; } }