Skip to content

Commit

Permalink
NAS-129512: Reboot vs. restart? (#10884)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKarpov98 authored Oct 18, 2024
1 parent c481050 commit c3fa30c
Show file tree
Hide file tree
Showing 116 changed files with 1,287 additions and 1,287 deletions.
2 changes: 1 addition & 1 deletion src/app/enums/boot-environment-active.enum.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum BootEnvironmentActive {
Now = 'N',
Reboot = 'R',
Restart = 'R',
NowReboot = 'NR',
Dash = '-',
Empty = '',
Expand Down
2 changes: 1 addition & 1 deletion src/app/helptext/system/advanced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const helptextSystemAdvanced = {
hardware issues.'),

debugkernel_tooltip: T('Set to boot a debug kernel after the next system\
reboot.'),
restart.'),

max_parallel_replication_tasks_tooltip: T('Maximum number of replication tasks being executed \
simultaneously.'),
Expand Down
2 changes: 1 addition & 1 deletion src/app/helptext/system/failover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const helptextSystemFailover = {
dialog_sync_to_peer_title: T('Sync to Peer'),
dialog_sync_to_peer_message: T('Are you sure you want to sync to peer?'),

dialog_sync_to_peer_checkbox: T('Reboot standby TrueNAS controller'),
dialog_sync_to_peer_checkbox: T('Restart standby TrueNAS controller'),
dialog_button_ok: T('Proceed'),

dialog_sync_from_peer_title: T('Sync from Peer'),
Expand Down
2 changes: 1 addition & 1 deletion src/app/helptext/system/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const helptextSystemGeneral = {

upload_config_form: {
message: T(
'<p>The system will reboot to perform this operation!</p>\
'<p>The system will restart to perform this operation!</p>\
<p><font color="red">All passwords are reset when the \
uploaded configuration database file was saved \
without the Password Secret Seed. </font></p>',
Expand Down
8 changes: 4 additions & 4 deletions src/app/helptext/system/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ export const helptextSystemUpdate = {
},

rebootAfterManualUpdate: {
placeholder: T('Reboot After Update'),
tooltip: T('Automatically reboot the system after the update\
placeholder: T('Restart After Update'),
tooltip: T('Automatically restart the system after the update\
is applied.'),

manual_reboot_msg: T('Update successful. Please reboot for the update to take effect. Reboot now?'),
manual_reboot_msg: T('Update successful. Please restart for the update to take effect. Restart now?'),
},

manual_update_action: T('Manual Update'),
Expand Down Expand Up @@ -51,6 +51,6 @@ export const helptextSystemUpdate = {
ha_download_msg: T('Upgrades both controllers. Files are downloaded to the Active Controller\
and then transferred to the Standby Controller. The upgrade process starts concurrently on both TrueNAS Controllers.\
Continue with download?'),
non_ha_confirm_msg: T('Apply updates and reboot system after downloading.'),
non_ha_confirm_msg: T('Apply updates and restart system after downloading.'),
ha_confirm_msg: T('Check the box for full upgrade. Leave unchecked to download only.'),
};
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class StartServiceDialogComponent implements OnInit {
if (result.startAutomatically) {
this.snackbar.success(
this.translate.instant(
'The {service} service is running and will auto-start after a system reboot.',
'The {service} service is running and will auto-start after a system restart.',
{ service: this.serviceHumanName },
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('PowerMenuComponent', () => {
expect(spectator.inject(MatDialog).open).toHaveBeenCalledWith(RebootOrShutdownDialogComponent, {
width: '400px',
});
expect(spectator.inject(Router).navigate).toHaveBeenCalledWith(['/system-tasks/reboot'], {
expect(spectator.inject(Router).navigate).toHaveBeenCalledWith(['/system-tasks/restart'], {
skipLocationChange: true,
queryParams: { reason: 'reason' },
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class PowerMenuComponent {
filter(Boolean),
untilDestroyed(this),
).subscribe((reason: string) => {
this.router.navigate(['/system-tasks/reboot'], {
this.router.navigate(['/system-tasks/restart'], {
skipLocationChange: true,
queryParams: { reason },
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export class RebootOrShutdownDialogComponent {
},
{
label: this.translate.instant('Power Outage'),
tooltip: this.translate.instant('Unexpected power loss necessitating a reboot.'),
value: 'Unexpected power loss necessitating a reboot.',
tooltip: this.translate.instant('Unexpected power loss necessitating a restart.'),
value: 'Unexpected power loss necessitating a restart.',
},
{
label: this.translate.instant('Maintenance Window'),
Expand All @@ -83,8 +83,8 @@ export class RebootOrShutdownDialogComponent {
},
{
label: this.translate.instant('Software Installation'),
tooltip: this.translate.instant('Required reboot after new software installation.'),
value: 'Required reboot after new software installation.',
tooltip: this.translate.instant('Required restart after new software installation.'),
value: 'Required restart after new software installation.',
},
{
label: this.translate.instant('Performance Optimization'),
Expand All @@ -98,8 +98,8 @@ export class RebootOrShutdownDialogComponent {
},
{
label: this.translate.instant('System Freeze'),
tooltip: this.translate.instant('Unresponsive system necessitating a forced reboot.'),
value: 'Unresponsive system necessitating a forced reboot.',
tooltip: this.translate.instant('Unresponsive system necessitating a forced restart.'),
value: 'Unresponsive system necessitating a forced restart.',
},
]);

Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/layout/topbar/topbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class TopbarComponent implements OnInit {
) {
this.systemWillRestart = true;
if (job.state === JobState.Success) {
this.router.navigate(['/system-tasks/reboot'], { skipLocationChange: true });
this.router.navigate(['/system-tasks/restart'], { skipLocationChange: true });
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/app/pages/system-tasks/failover/failover.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ export class FailoverComponent implements OnInit {
}

ngOnInit(): void {
// Replace URL so that we don't reboot again if page is refreshed.
// Replace URL so that we don't restart again if page is refreshed.
this.location.replaceState('/signin');
this.matDialog.closeAll();
this.ws.call('failover.become_passive').pipe(untilDestroyed(this)).subscribe({
error: (error: unknown) => { // error on reboot
error: (error: unknown) => { // error on restart
this.dialogService.error(this.errorHandler.parseError(error))
.pipe(untilDestroyed(this))
.subscribe(() => {
this.router.navigate(['/signin']);
});
},
complete: () => { // show reboot screen
complete: () => { // show restart screen
this.store$.dispatch(passiveNodeReplaced());

this.wsManager.prepareShutdown();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="wrapper">
<mat-card id="reboot-card">
<mat-card id="restart-card">
<mat-card-content id="message">
{{ 'System is restarting...' | translate }}
</mat-card-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
height: 100%;
}

#reboot-card {
#restart-card {
align-items: center;
box-sizing: content-box;
display: flex;
Expand Down Expand Up @@ -33,7 +33,7 @@
}

@media screen and (max-height: 700px) {
#reboot-card {
#restart-card {
font-size: 80%;
width: 225px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { WebSocketService } from 'app/services/ws.service';

@UntilDestroy()
@Component({
selector: 'ix-reboot',
templateUrl: './reboot.component.html',
styleUrls: ['./reboot.component.scss'],
selector: 'ix-restart',
templateUrl: './restart.component.html',
styleUrls: ['./restart.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
Expand All @@ -28,7 +28,7 @@ import { WebSocketService } from 'app/services/ws.service';
TranslateModule,
],
})
export class RebootComponent implements OnInit {
export class RestartComponent implements OnInit {
constructor(
protected ws: WebSocketService,
private wsManager: WebSocketConnectionService,
Expand All @@ -45,19 +45,19 @@ export class RebootComponent implements OnInit {
ngOnInit(): void {
const reason = this.route.snapshot.queryParamMap.get('reason');

// Replace URL so that we don't reboot again if page is refreshed.
// Replace URL so that we don't restart again if page is refreshed.
this.location.replaceState('/signin');

this.matDialog.closeAll();
this.ws.job('system.reboot', { reason }).pipe(untilDestroyed(this)).subscribe({
error: (error: unknown) => { // error on reboot
error: (error: unknown) => { // error on restart
this.dialogService.error(this.errorHandler.parseError(error))
.pipe(untilDestroyed(this))
.subscribe(() => {
this.router.navigate(['/signin']);
});
},
complete: () => { // show reboot screen
complete: () => { // show restart screen
this.wsManager.prepareShutdown();
this.wsManager.closeWebSocketConnection();
setTimeout(() => {
Expand Down
8 changes: 4 additions & 4 deletions src/app/pages/system-tasks/system-tasks.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import { Routes } from '@angular/router';
import { marker as T } from '@biesbjerg/ngx-translate-extract-marker';
import { ConfigResetComponent } from 'app/pages/system-tasks/config-reset/config-reset.component';
import { FailoverComponent } from 'app/pages/system-tasks/failover/failover.component';
import { RebootComponent } from 'app/pages/system-tasks/reboot/reboot.component';
import { RestartComponent } from 'app/pages/system-tasks/restart/restart.component';
import { ShutdownComponent } from 'app/pages/system-tasks/shutdown/shutdown.component';

export const systemTasksRoutes: Routes = [
{
path: '',
children: [{
path: 'reboot',
component: RebootComponent,
data: { title: T('Reboot'), breadcrumb: T('Reboot') },
path: 'restart',
component: RestartComponent,
data: { title: T('Restart'), breadcrumb: T('Restart') },
}, {
path: 'shutdown',
component: ShutdownComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class SystemSecurityFormComponent implements OnInit {
take(1),
switchMap((isHaLicensed) => {
if (isHaLicensed) {
// Reboot will be handled in response to failover.disabled.reasons event in HaFipsEffects.
// Restart will be handled in response to failover.disabled.reasons event in HaFipsEffects.
return EMPTY;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ describe('BootEnvironmentListComponent', () => {
[
'',
'22.12-MASTER-20220808-020013',
'Now/Reboot',
'Now/Restart',
'2022-08-09 06:52:00',
'2.61 GiB',
'No',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ export class BootEnvironmentListComponent implements OnInit {
switch (row.active) {
case BootEnvironmentActive.Now:
return this.translate.instant('Now');
case BootEnvironmentActive.Reboot:
return this.translate.instant('Reboot');
case BootEnvironmentActive.Restart:
return this.translate.instant('Restart');
case BootEnvironmentActive.NowReboot:
return this.translate.instant('Now/Reboot');
return this.translate.instant('Now/Restart');
default:
return row.active;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('FailoverComponent', () => {
const saveButton = await loader.getHarness(MatButtonHarness.with({ text: 'Sync To Peer' }));
await saveButton.click();

const rebootCheckbox = await rootLoader.getHarness(MatCheckboxHarness.with({ label: 'Reboot standby TrueNAS controller' }));
const rebootCheckbox = await rootLoader.getHarness(MatCheckboxHarness.with({ label: 'Restart standby TrueNAS controller' }));
await rebootCheckbox.check();
const confirmCheckbox = await rootLoader.getHarness(MatCheckboxHarness.with({ label: 'Confirm' }));
await confirmCheckbox.check();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ describe('UploadConfigDialogComponent', () => {

expect(spectator.inject(DialogService).jobDialog).toHaveBeenCalled();
expect(spectator.inject(UploadService).uploadAsJob).toHaveBeenCalledWith({ file, method: 'config.upload' });
expect(spectator.inject(Router).navigate).toHaveBeenCalledWith(['/system-tasks/reboot'], { skipLocationChange: true });
expect(spectator.inject(Router).navigate).toHaveBeenCalledWith(['/system-tasks/restart'], { skipLocationChange: true });
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class UploadConfigDialogComponent {
untilDestroyed(this),
)
.subscribe(() => {
this.router.navigate(['/system-tasks/reboot'], { skipLocationChange: true });
this.router.navigate(['/system-tasks/restart'], { skipLocationChange: true });
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class ManualUpdateFormComponent implements OnInit {
untilDestroyed(this),
)
.subscribe(() => {
this.router.navigate(['/system-tasks/reboot'], { skipLocationChange: true });
this.router.navigate(['/system-tasks/restart'], { skipLocationChange: true });
});
}

Expand Down Expand Up @@ -251,15 +251,15 @@ export class ManualUpdateFormComponent implements OnInit {

finishNonHaUpdate(): void {
if (this.form.value.rebootAfterManualUpdate) {
this.router.navigate(['/system-tasks/reboot'], { skipLocationChange: true });
this.router.navigate(['/system-tasks/restart'], { skipLocationChange: true });
} else {
this.dialogService.confirm({
title: this.translate.instant('Restart'),
message: this.translate.instant(helptext.rebootAfterManualUpdate.manual_reboot_msg),
}).pipe(
filter(Boolean),
untilDestroyed(this),
).subscribe(() => this.router.navigate(['/system-tasks/reboot'], { skipLocationChange: true }));
).subscribe(() => this.router.navigate(['/system-tasks/restart'], { skipLocationChange: true }));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<div class="train-card-row">
@if ((updateService.status$ | async) === SystemUpdateStatus.RebootRequired) {
<div>
{{ 'An update is already applied. Please reboot the system.' | translate }}
{{ 'An update is already applied. Please restart the system.' | translate }}
</div>
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ describe('UpdateActionsCardComponent', () => {
});

expect(spectator.inject(DialogService).confirm).toHaveBeenCalledWith({
message: 'The system will reboot and be briefly unavailable while applying updates. Apply updates and reboot?',
message: 'The system will restart and be briefly unavailable while applying updates. Apply updates and restart?',
title: 'Apply Pending Updates',
});

Expand Down Expand Up @@ -126,7 +126,7 @@ describe('UpdateActionsCardComponent', () => {
hideCheckbox: true,
message: 'Continue with download?',
secondaryCheckbox: true,
secondaryCheckboxText: 'Apply updates and reboot system after downloading.',
secondaryCheckboxText: 'Apply updates and restart system after downloading.',
title: 'Download Update',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class UpdateActionsCardComponent implements OnInit {
untilDestroyed(this),
)
.subscribe(() => {
this.router.navigate(['/system-tasks/reboot'], { skipLocationChange: true });
this.router.navigate(['/system-tasks/restart'], { skipLocationChange: true });
});
}

Expand Down Expand Up @@ -333,7 +333,7 @@ export class UpdateActionsCardComponent implements OnInit {
case UpdateType.ApplyPending: {
const message = this.isHaLicensed
? this.translate.instant('The standby controller will be automatically restarted to finalize the update. Apply updates and restart the standby controller?')
: this.translate.instant('The system will reboot and be briefly unavailable while applying updates. Apply updates and reboot?');
: this.translate.instant('The system will restart and be briefly unavailable while applying updates. Apply updates and restart?');
this.dialogService.confirm({
title: this.translate.instant('Apply Pending Updates'),
message: this.translate.instant(message),
Expand Down
4 changes: 2 additions & 2 deletions src/app/services/fips.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ describe('FipsService', () => {
});

describe('promptForLocalRestart', () => {
it('prompts for local standby and redirects to reboot page', () => {
it('prompts for local standby and redirects to restart page', () => {
spectator.service.promptForRestart().subscribe();

expect(spectator.inject(DialogService).confirm).toHaveBeenCalledWith(
expect.objectContaining({
buttonText: 'Restart Now',
}),
);
expect(spectator.inject(Router).navigate).toHaveBeenCalledWith(['/system-tasks/reboot'], { skipLocationChange: true });
expect(spectator.inject(Router).navigate).toHaveBeenCalledWith(['/system-tasks/restart'], { skipLocationChange: true });
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/app/services/fips.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class FipsService {
.pipe(
tap((approved) => {
if (approved) {
this.router.navigate(['/system-tasks/reboot'], { skipLocationChange: true });
this.router.navigate(['/system-tasks/restart'], { skipLocationChange: true });
}
}),
);
Expand Down
Loading

0 comments on commit c3fa30c

Please sign in to comment.