Skip to content

Commit

Permalink
NAS-131666: Add support for Stopping state (#10830)
Browse files Browse the repository at this point in the history
  • Loading branch information
undsoft authored Oct 9, 2024
1 parent 4da3b68 commit 4d07d3f
Show file tree
Hide file tree
Showing 90 changed files with 4 additions and 185 deletions.
3 changes: 3 additions & 0 deletions src/app/enums/app-state.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ export enum AppState {
Running = 'RUNNING',
Deploying = 'DEPLOYING',
Stopped = 'STOPPED',
Stopping = 'STOPPING',
Crashed = 'CRASHED',
}

export const appStateIcons = new Map<AppState, string>([
[AppState.Running, 'mdi-check-circle'],
[AppState.Deploying, 'mdi-progress-wrench'],
[AppState.Stopped, 'mdi-stop-circle'],
[AppState.Stopping, 'mdi-progress-wrench'],
[AppState.Crashed, 'mdi-alert-circle'],
]);

export const appStateLabels = new Map<AppState, string>([
[AppState.Running, T('Running')],
[AppState.Deploying, T('Deploying')],
[AppState.Stopped, T('Stopped')],
[AppState.Stopping, T('Stopping')],
[AppState.Crashed, T('Crashed')],
]);
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { Store } from '@ngrx/store';
import { TranslateService } from '@ngx-translate/core';
import {
combineLatest, filter, finalize,
combineLatest, filter,
Observable,
} from 'rxjs';
import { AppState } from 'app/enums/app-state.enum';
import { EmptyType } from 'app/enums/empty-type.enum';
import { JobState } from 'app/enums/job-state.enum';
import { Role } from 'app/enums/role.enum';
import { WINDOW } from 'app/helpers/window.helper';
import { helptextApps } from 'app/helptext/apps/apps';
Expand Down Expand Up @@ -322,10 +321,8 @@ export class InstalledAppsComponent implements OnInit, AfterViewInit {
}

stop(name: string): void {
this.loader.open(this.translate.instant('Stopping "{app}"', { app: name }));
this.appService.stopApplication(name)
.pipe(
finalize(() => this.loader.close()),
this.errorHandler.catchError(),
untilDestroyed(this),
)
Expand All @@ -339,17 +336,12 @@ export class InstalledAppsComponent implements OnInit, AfterViewInit {
}

restart(name: string): void {
this.loader.open(this.translate.instant('Restarting "{app}"', { app: name }));
this.appService.restartApplication(name)
.pipe(
finalize(() => this.loader.close()),
this.errorHandler.catchError(),
untilDestroyed(this),
)
.subscribe((job: Job<void, AppStartQueryParams>) => {
if (job.state !== JobState.Running) {
this.loader.close();
}
this.appJobs.set(name, job);
this.sortChanged(this.sortingInfo);
this.cdr.markForCheck();
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/br.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2781,7 +2781,6 @@
"Restart is recommended for new FIPS setting to take effect. Would you like to restart now?": "",
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -3439,7 +3438,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -2404,7 +2404,6 @@
"Restart is recommended for new FIPS setting to take effect. Would you like to restart now?": "",
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore Config": "",
"Restore Config Defaults": "",
Expand Down Expand Up @@ -2912,7 +2911,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/dsb.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/en-au.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/en-gb.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
2 changes: 0 additions & 2 deletions src/assets/i18n/eo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,6 @@
"Restart is required after changing this setting.": "",
"Restart of a remote system is required for new FIPS setting to take effect. Would you like to restart standby now?": "",
"Restart the system?": "",
"Restarting \"{app}\"": "",
"Restarting Standby": "",
"Restore": "",
"Restore Cloud Sync Task": "",
Expand Down Expand Up @@ -4092,7 +4091,6 @@
"Stop {vmName}?": "",
"Stopped": "",
"Stopping": "",
"Stopping \"{app}\"": "",
"Stopping Apps Service": "",
"Stopping {rowName}": "",
"Stops the rollback when the safety check finds any related clone snapshots that are newer than the rollback snapshot.": "",
Expand Down
Loading

0 comments on commit 4d07d3f

Please sign in to comment.