Skip to content

Commit

Permalink
remove reboot bottom from UI
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpalide committed Nov 2, 2023
1 parent df2fb43 commit a99b2a6
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ export class NodeActionsHelper {
private currentNode: Node;
private currentNodeKey: string;
private canBeUpdated = false;
private canBeRestarted = false;
private canOpenTerminal = false;

options: MenuOptionData[] = [];

returnButtonText: string;

private rebootSubscription: Subscription;
private updateSubscription: Subscription;

// Services this class need.
Expand Down Expand Up @@ -78,14 +76,6 @@ export class NodeActionsHelper {
icon: 'subject',
});

if (this.canBeRestarted) {
this.options.push({
name: 'actions.menu.reboot',
actionName: 'reboot',
icon: 'rotate_right'
});
}

// TODO: remove if the option will not be added again. Delete the translatable strings too.
/*
if (this.canBeUpdated) {
Expand All @@ -106,10 +96,8 @@ export class NodeActionsHelper {

if (GeneralUtils.checkIfTagIsUpdatable(currentNode.buildTag)) {
this.canBeUpdated = true;
this.canBeRestarted = true;
} else {
this.canBeUpdated = false;
this.canBeRestarted = false;
}

this.canOpenTerminal = GeneralUtils.checkIfTagCanOpenterminal(currentNode.buildTag);
Expand All @@ -136,8 +124,6 @@ export class NodeActionsHelper {
this.update();
} else if (actionName === 'logs') {
this.runtimeLogs();
} else if (actionName === 'reboot') {
this.reboot();
} else if (actionName === null) {
// Null is returned if the back button was pressed.
this.back();
Expand All @@ -148,31 +134,11 @@ export class NodeActionsHelper {
* Cleans the object. Must be called when the object is no longer needed.
*/
dispose() {
if (this.rebootSubscription) {
this.rebootSubscription.unsubscribe();
}
if (this.updateSubscription) {
this.updateSubscription.unsubscribe();
}
}

reboot() {
const confirmationDialog = GeneralUtils.createConfirmationDialog(this.dialog, 'actions.reboot.confirmation');

confirmationDialog.componentInstance.operationAccepted.subscribe(() => {
confirmationDialog.componentInstance.showProcessing();

this.rebootSubscription = this.nodeService.reboot(this.currentNodeKey).subscribe(() => {
this.snackbarService.showDone('actions.reboot.done');
confirmationDialog.close();
}, (err: OperationError) => {
err = processServiceError(err);

confirmationDialog.componentInstance.showDone('confirmation.error-header-text', err.translatableErrorMsg);
});
});
}

update() {
const confirmationDialog = GeneralUtils.createConfirmationDialog(this.dialog, 'actions.update.confirmation');

Expand Down
7 changes: 0 additions & 7 deletions static/skywire-manager-src/src/app/services/node.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,6 @@ export class NodeService {
return this.apiService.delete(`visors/${nodeKey}/reward`);
}

/**
* Restarts a node.
*/
reboot(nodeKey: string): Observable<any> {
return this.apiService.post(`visors/${nodeKey}/restart`);
}

/**
* Checks if a node is currently being updated.
*/
Expand Down
7 changes: 1 addition & 6 deletions static/skywire-manager-src/src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,7 @@
"menu": {
"terminal": "Terminal",
"config": "Konfiguration",
"update": "Aktualisieren",
"reboot": "Neustart"
},
"reboot": {
"confirmation": "Den Visor wirklich neustarten?",
"done": "Der Visor wird neu gestartet."
"update": "Aktualisieren"
},
"terminal-options": {
"full": "Terminal",
Expand Down
7 changes: 1 addition & 6 deletions static/skywire-manager-src/src/assets/i18n/de_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,7 @@
"menu": {
"terminal": "Terminal",
"config": "Configuration",
"update": "Update",
"reboot": "Reboot"
},
"reboot": {
"confirmation": "Are you sure you want to reboot the visor?",
"done": "The visor is restarting."
"update": "Update"
},
"terminal-options": {
"full": "Full terminal",
Expand Down
5 changes: 0 additions & 5 deletions static/skywire-manager-src/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,8 @@
"terminal": "Terminal",
"config": "Configuration",
"update": "Update",
"reboot": "Reboot",
"logs": "View logs"
},
"reboot": {
"confirmation": "Are you sure you want to reboot the visor?",
"done": "The visor is restarting."
},
"update": {
"confirmation": "A terminal will be opened in a new tab and the update procedure will be started automatically. Do you want to continue?"
},
Expand Down
5 changes: 0 additions & 5 deletions static/skywire-manager-src/src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,8 @@
"terminal": "Terminal",
"config": "Configuración",
"update": "Actualizar",
"reboot": "Reiniciar",
"logs": "Ver logs"
},
"reboot": {
"confirmation": "¿Seguro que desea reiniciar el visor?",
"done": "El visor se está reiniciando."
},
"update": {
"confirmation": "Una terminal será abierta en una nueva pestaña y el proceso de actualización iniciará automáticamente. ¿Desea continuar?"
},
Expand Down
5 changes: 0 additions & 5 deletions static/skywire-manager-src/src/assets/i18n/es_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,8 @@
"terminal": "Terminal",
"config": "Configuration",
"update": "Update",
"reboot": "Reboot",
"logs": "View logs"
},
"reboot": {
"confirmation": "Are you sure you want to reboot the visor?",
"done": "The visor is restarting."
},
"update": {
"confirmation": "A terminal will be opened in a new tab and the update procedure will be started automatically. Do you want to continue?"
},
Expand Down
9 changes: 2 additions & 7 deletions static/skywire-manager-src/src/assets/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,7 @@
"menu": {
"terminal": "Terminal",
"config": "Configuração",
"update": "Atualizar",
"reboot": "Reiniciar"
},
"reboot": {
"confirmation": "Tem certeza de que deseja reiniciar o visor?",
"done": "O visor está reiniciando."
"update": "Atualizar"
},
"terminal-options": {
"full": "Terminal completo",
Expand Down Expand Up @@ -568,4 +563,4 @@
"tabs-window": {
"title": "Alterar guia"
}
}
}
7 changes: 1 addition & 6 deletions static/skywire-manager-src/src/assets/i18n/pt_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,7 @@
"menu": {
"terminal": "Terminal",
"config": "Configuration",
"update": "Update",
"reboot": "Reboot"
},
"reboot": {
"confirmation": "Are you sure you want to reboot the visor?",
"done": "The visor is restarting."
"update": "Update"
},
"terminal-options": {
"full": "Full terminal",
Expand Down

0 comments on commit a99b2a6

Please sign in to comment.