Merge pull request #295 from AnalogJ/expanding_row

pull/296/head
Jason Kulatunga 3 years ago committed by GitHub
commit 0b8251fce2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,7 +19,7 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "low",
Critical: true,
Description: "",
Description: "The grown defect count shows the amount of swapped (defective) blocks since the drive was shipped by it's vendor. Each additional defective block increases the count by one.",
},
"read_errors_corrected_by_eccfast": {
ID: "read_errors_corrected_by_eccfast",
@ -27,7 +27,7 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "",
Critical: false,
Description: "",
Description: "An error correction was applied to get perfect data (a.k.a. ECC on-the-fly). \"Without substantial delay\" means the correction did not postpone reading of later sectors (e.g. a revolution was not lost). The counter is incremented once for each logical block that requires correction. Two different blocks corrected during the same command are counted as two events.",
},
"read_errors_corrected_by_eccdelayed": {
ID: "read_errors_corrected_by_eccdelayed",
@ -35,7 +35,7 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "",
Critical: false,
Description: "",
Description: "An error code or algorithm (e.g. ECC, checksum) is applied in order to get perfect data with substantial delay. \"With possible delay\" means the correction took longer than a sector time so that reading/writing of subsequent sectors was delayed (e.g. a lost revolution). The counter is incremented once for each logical block that requires correction. A block with a double error that is correctable counts as one event and two different blocks corrected during the same command count as two events. ",
},
"read_errors_corrected_by_rereads_rewrites": {
ID: "read_errors_corrected_by_rereads_rewrites",
@ -43,7 +43,7 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "low",
Critical: true,
Description: "",
Description: "This parameter code specifies the counter counting the number of errors that are corrected by applying retries. This counts errors recovered, not the number of retries. If five retries were required to recover one block of data, the counter increments by one, not five. The counter is incremented once for each logical block that is recovered using retries. If an error is not recoverable while applying retries and is recovered by ECC, it isn't counted by this counter; it will be counted by the counter specified by parameter code 01h - Errors Corrected With Possible Delays. ",
},
"read_total_errors_corrected": {
ID: "read_total_errors_corrected",
@ -51,7 +51,7 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "",
Critical: false,
Description: "",
Description: "This counter counts the total of parameter code errors 00h, 01h and 02h (i.e. error corrected by ECC: fast and delayed plus errors corrected by rereads and rewrites). There is no \"double counting\" of data errors among these three counters. The sum of all correctable errors can be reached by adding parameter code 01h and 02h errors, not by using this total.",
},
"read_correction_algorithm_invocations": {
ID: "read_correction_algorithm_invocations",
@ -59,7 +59,7 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "",
Critical: false,
Description: "",
Description: "This parameter code specifies the counter that counts the total number of retries, or \"times the retry algorithm is invoked\". If after five attempts a counter 02h type error is recovered, then five is added to this counter. If three retries are required to get stable ECC syndrome before a counter 01h type error is corrected, then those three retries are also counted here. The number of retries applied to unsuccessfully recover an error (counter 06h type error) are also counted by this counter. ",
},
"read_total_uncorrected_errors": {
ID: "read_total_uncorrected_errors",
@ -67,7 +67,7 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "low",
Critical: true,
Description: "",
Description: "This parameter code specifies the counter that contains the total number of blocks for which an uncorrected data error has occurred. ",
},
"write_errors_corrected_by_eccfast": {
ID: "write_errors_corrected_by_eccfast",
@ -75,7 +75,7 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "",
Critical: false,
Description: "",
Description: "An error correction was applied to get perfect data (a.k.a. ECC on-the-fly). \"Without substantial delay\" means the correction did not postpone reading of later sectors (e.g. a revolution was not lost). The counter is incremented once for each logical block that requires correction. Two different blocks corrected during the same command are counted as two events. ",
},
"write_errors_corrected_by_eccdelayed": {
ID: "write_errors_corrected_by_eccdelayed",
@ -83,7 +83,7 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "",
Critical: false,
Description: "",
Description: "An error code or algorithm (e.g. ECC, checksum) is applied in order to get perfect data with substantial delay. \"With possible delay\" means the correction took longer than a sector time so that reading/writing of subsequent sectors was delayed (e.g. a lost revolution). The counter is incremented once for each logical block that requires correction. A block with a double error that is correctable counts as one event and two different blocks corrected during the same command count as two events. ",
},
"write_errors_corrected_by_rereads_rewrites": {
ID: "write_errors_corrected_by_rereads_rewrites",
@ -91,7 +91,7 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "low",
Critical: true,
Description: "",
Description: "This parameter code specifies the counter counting the number of errors that are corrected by applying retries. This counts errors recovered, not the number of retries. If five retries were required to recover one block of data, the counter increments by one, not five. The counter is incremented once for each logical block that is recovered using retries. If an error is not recoverable while applying retries and is recovered by ECC, it isn't counted by this counter; it will be counted by the counter specified by parameter code 01h - Errors Corrected With Possible Delays.",
},
"write_total_errors_corrected": {
ID: "write_total_errors_corrected",
@ -99,7 +99,7 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "",
Critical: false,
Description: "",
Description: "This counter counts the total of parameter code errors 00h, 01h and 02h (i.e. error corrected by ECC: fast and delayed plus errors corrected by rereads and rewrites). There is no \"double counting\" of data errors among these three counters. The sum of all correctable errors can be reached by adding parameter code 01h and 02h errors, not by using this total.",
},
"write_correction_algorithm_invocations": {
ID: "write_correction_algorithm_invocations",
@ -107,7 +107,7 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "",
Critical: false,
Description: "",
Description: "This parameter code specifies the counter that counts the total number of retries, or \"times the retry algorithm is invoked\". If after five attempts a counter 02h type error is recovered, then five is added to this counter. If three retries are required to get stable ECC syndrome before a counter 01h type error is corrected, then those three retries are also counted here. The number of retries applied to unsuccessfully recover an error (counter 06h type error) are also counted by this counter. ",
},
"write_total_uncorrected_errors": {
ID: "write_total_uncorrected_errors",
@ -115,6 +115,6 @@ var ScsiMetadata = map[string]ScsiAttributeMetadata{
DisplayType: "",
Ideal: "low",
Critical: true,
Description: "",
Description: " This parameter code specifies the counter that contains the total number of blocks for which an uncorrected data error has occurred.",
},
}

@ -143,6 +143,7 @@
<table class="w-full bg-transparent"
mat-table
matSort
multiTemplateDataRows
[dataSource]="smartAttributeDataSource"
[trackBy]="trackByFn"
#smartAttributeTable>
@ -168,7 +169,7 @@
[ngClass]="{'bg-red': getAttributeStatusName(attribute.status) === 'failed',
'bg-green': getAttributeStatusName(attribute.status) === 'passed',
'bg-yellow': getAttributeStatusName(attribute.status) === 'warn'}"></span>
<span class="pr-2px leading-relaxed whitespace-no-wrap" matTooltip="{{attribute.status_reason}}">{{getAttributeStatusName(attribute.status)}}</span>
<span class="pr-2px leading-relaxed whitespace-no-wrap" matTooltip="{{attribute.status_reason}} - click for more details.">{{getAttributeStatusName(attribute.status)}}</span>
</span>
</td>
</ng-container>
@ -203,7 +204,7 @@
</th>
<td mat-cell
*matCellDef="let attribute">
<span class="pr-6 whitespace-no-wrap" matTooltip="{{getAttributeDescription(attribute)}}">
<span class="pr-6 whitespace-no-wrap" matTooltip="click for more details.">
{{getAttributeName(attribute)}} <mat-icon *ngIf="getAttributeDescription(attribute)" class="icon-size-10" [svgIcon]="'info'"></mat-icon>
</span>
</td>
@ -324,6 +325,72 @@
</td>
</ng-container>
<!-- Expanded Content Column - The detail row is made up of this one column that spans across all columns -->
<ng-container matColumnDef="expandedDetail">
<td mat-cell *matCellDef="let attribute" [attr.colspan]="smartAttributeTableColumns.length">
<div class="attribute-detail"
[@detailExpand]="attribute == expandedAttribute ? 'expanded' : 'collapsed'">
<div class="flex flex-auto w-1/3 min-w-80 py-4">
<div class="flex flex-col flex-auto justify-end text-md pb-3">
{{getAttributeDescription(attribute)}}
</div>
</div>
<div class="flex flex-auto w-2/3 min-w-80">
<div class="flex flex-col flex-auto justify-end text-md px-6 pb-3">
<div class="flex items-center justify-between py-3 border-b last:border-b-0 ng-star-inserted">
<div class="flex items-center w-1/4">Type</div>
<div class="flex items-center w-1/4">Value</div>
<div class="flex items-center w-1/4">Worst/Thresh</div>
<div class="flex items-center w-1/4">Failure %</div>
</div>
<div class="flex items-center justify-between py-3 border-b last:border-b-0 ng-star-inserted">
<div class="flex items-center w-1/4">
<div class="flex-shrink-0 w-2 h-2 mr-3 rounded-full"
[ngClass]="{'bg-red': getAttributeScrutinyStatusName(attribute.status) === 'failed',
'bg-green': getAttributeScrutinyStatusName(attribute.status) === 'passed',
'bg-yellow': getAttributeStatusName(attribute.status) === 'warn'}"></div>
<div class="truncate">Scrutiny</div>
</div>
<div class="w-1/4 items-center font-medium">{{getAttributeValue(attribute)}}</div>
<div class="w-1/4 items-center text-secondary">--</div>
<div class="w-1/4 items-center text-secondary">{{(attribute.failure_rate | percent) || '--'}}</div>
</div>
<div class="flex items-center justify-between py-3 border-b last:border-b-0 ng-star-inserted">
<div class="flex items-center w-1/4">
<div class="flex-shrink-0 w-2 h-2 mr-3 rounded-full"
[ngClass]="{'bg-red': getAttributeSmartStatusName(attribute.status) === 'failed',
'bg-green': getAttributeSmartStatusName(attribute.status) === 'passed'}"
></div>
<div class="truncate">Normalized</div>
</div>
<div class="w-1/4 items-center font-medium">{{attribute.value}}</div>
<div class="w-1/4 items-center text-secondary">{{getAttributeWorst(attribute) || '--' }}/{{getAttributeThreshold(attribute)}}</div>
<div class="w-1/4 items-center text-secondary">--</div>
</div>
<div class="flex items-center justify-between py-3 border-b last:border-b-0 ng-star-inserted">
<div class="flex items-center w-1/4">
<div class="flex-shrink-0 w-2 h-2 mr-3 rounded-full"></div>
<div class="truncate">Raw</div>
</div>
<div class="w-1/4 items-center font-medium">{{attribute.raw_value}}</div>
<div class="w-1/4 items-center text-secondary">--</div>
<div class="w-1/4 items-center text-secondary">--</div>
</div>
</div>
</div>
</div>
</td>
</ng-container>
<!-- Footer -->
<ng-container matColumnDef="recentOrdersTableFooter">
<td class="px-3 border-none"
@ -344,7 +411,10 @@
<tr class="attribute-row h-16"
mat-row
[ngClass]="{'yellow-50': getAttributeCritical(row)}"
[class.attribute-expanded-row]="expandedAttribute === row"
(click)="expandedAttribute = expandedAttribute === row ? null : row"
*matRowDef="let row; columns: smartAttributeTableColumns;"></tr>
<tr mat-row *matRowDef="let row; columns: ['expandedDetail']" class="attribute-detail-row"></tr>
<tr class="h-16"
mat-footer-row
*matFooterRowDef="['recentOrdersTableFooter']"></tr>

@ -1,7 +1,6 @@
@import 'treo';
detail {
}
// -----------------------------------------------------------------------------------------------------
@ -20,5 +19,35 @@ detail {
}
}
//table {
// width: 100%;
//}
$primary: map-get($theme, primary);
$is-dark: map-get($theme, is-dark);
tr.attribute-detail-row {
height: 0;
}
//tr.attribute-row:not(.attribute-expanded-row):hover {
// @if ($is-dark) {
// background: rgba(0, 0, 0, 0.05);
// } @else {
// background: map-get($primary, 50);
// }
//}
tr.attribute-row:not(.attribute-expanded-row):active {
background: #efefef;
}
.attribute-row td {
border-bottom-width: 0;
}
.attribute-detail {
overflow: hidden;
display: flex;
}

@ -11,11 +11,19 @@ import {MatDialog} from "@angular/material/dialog";
import humanizeDuration from 'humanize-duration';
import {TreoConfigService} from "../../../@treo/services/config";
import {AppConfig} from "../../core/config/app.config";
import {animate, state, style, transition, trigger} from '@angular/animations';
@Component({
selector: 'detail',
templateUrl: './detail.component.html',
styleUrls: ['./detail.component.scss']
styleUrls: ['./detail.component.scss'],
animations: [
trigger('detailExpand', [
state('collapsed', style({height: '0px', minHeight: '0'})),
state('expanded', style({height: '*'})),
transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4, 0.0, 0.2, 1)')),
]),
],
})
export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
@ -24,6 +32,7 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
onlyCritical: boolean = true;
// data: any;
expandedAttribute: any | null;
metadata: any;
device: any;
@ -141,6 +150,28 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
return ''
// tslint:enable:no-bitwise
}
getAttributeScrutinyStatusName(attributeStatus: number): string {
// tslint:disable:no-bitwise
if ((attributeStatus & 4) !== 0){
return 'failed'
} else if ((attributeStatus & 2) !== 0){
return 'warn'
} else {
return 'passed'
}
// tslint:enable:no-bitwise
}
getAttributeSmartStatusName(attributeStatus: number): string {
// tslint:disable:no-bitwise
if ((attributeStatus & 1) !== 0){
return 'failed'
} else {
return 'passed'
}
// tslint:enable:no-bitwise
}
getAttributeName(attribute_data): string {
let attribute_metadata = this.metadata[attribute_data.attribute_id]
@ -270,7 +301,7 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
} else {
//ATA
attributes = latest_smart_result.attrs
this.smartAttributeTableColumns = ['status', 'id', 'name', 'value', 'worst', 'thresh','ideal', 'failure', 'history'];
this.smartAttributeTableColumns = ['status', 'id', 'name', 'value', 'thresh','ideal', 'failure', 'history'];
}
for(const attrId in attributes){

Loading…
Cancel
Save