Skip to content

Commit

Permalink
Small fix for the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Senyoret1 committed Jun 1, 2022
1 parent d2d54db commit 974ee3b
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export class NodeActionsHelper {
private canBeUpdated = false;
private canBeRestarted = false;

options: MenuOptionData[] = [];

returnButtonText: string;

private rebootSubscription: Subscription;
Expand All @@ -51,13 +53,15 @@ export class NodeActionsHelper {

this.showingFullList = showingFullList;
this.returnButtonText = !showingFullList ? 'nodes.title' : 'node.title';

this.updateOptions();
}

/**
* Options for the menu shown in the top bar.
*/
get options(): MenuOptionData[] {
const response = [
private updateOptions() {
this.options = [
{
name: 'actions.menu.terminal',
actionName: 'terminal',
Expand All @@ -71,22 +75,20 @@ export class NodeActionsHelper {
];

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

if (this.canBeUpdated) {
response.push({
this.options.push({
name: 'actions.menu.update',
actionName: 'update',
icon: 'get_app',
});
}

return response;
}

/**
Expand All @@ -102,6 +104,8 @@ export class NodeActionsHelper {
this.canBeUpdated = false;
this.canBeRestarted = false;
}

this.updateOptions();
}

/**
Expand Down

0 comments on commit 974ee3b

Please sign in to comment.