Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAS-131317 / 25.04 / Replaced Lifetime with Power On Hours #10845

Merged
merged 7 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/interfaces/smart-test.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface SmartTestResult {
status: SmartTestResultStatus;
status_verbose: string;
segment_number: number;
power_on_hours_ago: number;
}

export interface ManualSmartTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
@for (column of displayedColumns; track column; let idx = $index) {
<th
[ngClass]="column.cssClass || ''"
[matTooltip]="column.title"
(click)="onSort(idx)"
>
<div class="title-container" [ngStyle]="{ cursor: !column.disableSorting ? 'pointer' : 'auto' }">
Expand All @@ -12,6 +11,12 @@
[dataProvider]="dataProvider"
[column]="column"
></ng-template>
@if (column.headerTooltip) {
<ix-tooltip
class="tooltip"
[message]="column.headerTooltip | translate">
</ix-tooltip>
}
</div>
@if (!column.disableSorting) {
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { NgClass, NgStyle } from '@angular/common';
import {
AfterViewInit, ChangeDetectorRef, ChangeDetectionStrategy, Component, Input,
} from '@angular/core';
import { MatTooltip } from '@angular/material/tooltip';
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { TranslateModule } from '@ngx-translate/core';
import { IxIconComponent } from 'app/modules/ix-icon/ix-icon.component';
import { IxTableHeaderCellDirective } from 'app/modules/ix-table/directives/ix-header-cell.directive';
import { SortDirection } from 'app/modules/ix-table/enums/sort-direction.enum';
import { Column, ColumnComponent } from 'app/modules/ix-table/interfaces/column-component.class';
import { DataProvider } from 'app/modules/ix-table/interfaces/data-provider.interface';
import { TestDirective } from 'app/modules/test-id/test.directive';
import { TooltipComponent } from 'app/modules/tooltip/tooltip.component';

@UntilDestroy()
@Component({
Expand All @@ -20,11 +21,12 @@ import { TestDirective } from 'app/modules/test-id/test.directive';
standalone: true,
imports: [
NgClass,
MatTooltip,
NgStyle,
IxTableHeaderCellDirective,
IxIconComponent,
TestDirective,
TooltipComponent,
TranslateModule,
],
})
export class IxTableHeadComponent<T> implements AfterViewInit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { DataProvider } from 'app/modules/ix-table/interfaces/data-provider.inte
export abstract class ColumnComponent<T> {
propertyName?: keyof T;
title?: string;
headerTooltip?: string;
cssClass?: string;
uniqueRowTag: (row: T) => string;
ariaLabels: (row: T) => string[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ describe('SmartTestResultListComponent', () => {
lba_of_first_error: null,
status: SmartTestResultStatus.Success,
remaining: null,
power_on_hours_ago: 1,
},
{
num: 2,
Expand All @@ -42,6 +43,7 @@ describe('SmartTestResultListComponent', () => {
lba_of_first_error: null,
status: SmartTestResultStatus.Success,
remaining: 50,
power_on_hours_ago: 25,
},
{
num: 3,
Expand All @@ -52,6 +54,7 @@ describe('SmartTestResultListComponent', () => {
lba_of_first_error: null,
status: SmartTestResultStatus.Success,
remaining: null,
power_on_hours_ago: 49,
}],
}, {
disk: 'sdb',
Expand All @@ -64,6 +67,7 @@ describe('SmartTestResultListComponent', () => {
lba_of_first_error: null,
status: SmartTestResultStatus.Success,
remaining: null,
power_on_hours_ago: 1,
},
{
num: 2,
Expand All @@ -74,6 +78,7 @@ describe('SmartTestResultListComponent', () => {
lba_of_first_error: null,
status: SmartTestResultStatus.Success,
remaining: 0.5,
power_on_hours_ago: 25,
},
{
num: 3,
Expand All @@ -84,6 +89,7 @@ describe('SmartTestResultListComponent', () => {
lba_of_first_error: null,
status: SmartTestResultStatus.Success,
remaining: 0,
power_on_hours_ago: 49,
}],
}];

Expand Down Expand Up @@ -114,13 +120,13 @@ describe('SmartTestResultListComponent', () => {

it('should show table rows', async () => {
const expectedRows = [
['Disk', 'Description', 'Status', 'Remaining', 'Lifetime', 'LBA of First Error'],
['sda', 'Background long', 'SUCCESS', '0%', '15959', 'No errors'],
['sda', 'Background short', 'SUCCESS', '50%', '15929', 'No errors'],
['sda', 'Background short', 'SUCCESS', 'Completed', '16939', 'No errors'],
['sdb', 'Background long', 'SUCCESS', 'Completed', '15959', 'No errors'],
['sdb', 'Background short', 'SUCCESS', '0.5%', '15929', 'No errors'],
['sdb', 'Background short', 'SUCCESS', '0%', '16939', 'No errors'],
['Disk', 'Description', 'Status', 'Remaining', 'Power On Hours Ago', 'LBA of First Error'],
['sda', 'Background long', 'SUCCESS', '0%', 'N/A', 'No errors'],
['sda', 'Background short', 'SUCCESS', '50%', 'N/A', 'No errors'],
['sda', 'Background short', 'SUCCESS', 'Completed', 'N/A', 'No errors'],
['sdb', 'Background long', 'SUCCESS', 'Completed', 'N/A', 'No errors'],
['sdb', 'Background short', 'SUCCESS', '0.5%', 'N/A', 'No errors'],
['sdb', 'Background short', 'SUCCESS', '0%', 'N/A', 'No errors'],
];

const cells = await table.getCellTexts();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ export class SmartTestResultListComponent implements OnInit {
},
}),
textColumn({
title: this.translate.instant('Lifetime'),
propertyName: 'lifetime',
title: this.translate.instant('Power On Hours Ago'),
propertyName: 'power_on_hours_ago',
headerTooltip: this.translate.instant('"Power On Hours" are how many hours have passed while the disk has been powered on. "Power On Hours Ago" is how many power on hours have passed since each test.'),
getValue: (row) => {
return row.lifetime || this.translate.instant('N/A');
return row.power_on_hours_ago || this.translate.instant('N/A');
},
}),
textColumn({
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/br.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/cs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"<a href=\"https://forums.truenas.com/\" target=\"_blank\"> TrueNAS Forums</a> - Find answers from other users in the forums.": "",
"<a href=\"https://tools.ietf.org/html/rfc8095\" target=\"_blank\">Transport Protocol</a> for the remote system log server connection. Choosing Transport Layer Security (TLS) also requires selecting a preconfigured system Certificate.": "",
"<a href=\"https://www.ixsystems.com/support/truenas-arrays/\" target=\"_blank\"> TrueNAS Licensing</a> - Learn more about enterprise-grade support.": "",
Expand Down Expand Up @@ -2556,6 +2557,7 @@
"Power Management": "",
"Power Menu": "",
"Power Mode": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
" Est. Usable Raw Capacity": "",
" as of {dateTime}": "",
" bytes.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
"(No description)": "",
Expand Down Expand Up @@ -2247,6 +2248,7 @@
"Power Management": "",
"Power Menu": "",
"Power Mode": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/dsb.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
" as of {dateTime}": "",
" bytes.": "",
" seconds.": "",
"\"Power On Hours\" are how many hours have passed while the disk has been powered on. \"Power On Hours Ago\" is how many power on hours have passed since each test.": "",
"% of all cores": "",
"'Hosts Allow' or 'Hosts Deny' has been set": "",
"'Hosts Allow' or 'Hosts Deny' has been updated": "",
Expand Down Expand Up @@ -3132,6 +3133,7 @@
"Power Mode": "",
"Power Off": "",
"Power Off UPS": "",
"Power On Hours Ago": "",
"Power Supply": "",
"Pre Init": "",
"Pre Script": "",
Expand Down
Loading
Loading