Skip to content

Commit

Permalink
Merge pull request #766 from Senyoret1/view-logs
Browse files Browse the repository at this point in the history
Add a view logs option to he UI
  • Loading branch information
jdknives authored May 15, 2021
2 parents ec8388d + 3cd0d58 commit 2542209
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ export class NodeActionsHelper {
name: 'actions.menu.update',
actionName: 'update',
icon: 'get_app',
},
{
name: 'actions.menu.logs',
actionName: 'logs',
icon: 'subject',
}
];

Expand All @@ -92,12 +97,14 @@ export class NodeActionsHelper {
* Must be called when an option form the top bar is selected.
* @param actionName Name of the selected option, as defined in the options array.
*/
performAction(actionName: string) {
performAction(actionName: string, nodePk: string) {
// Call the adequate function if the user clicks any of the options.
if (actionName === 'terminal') {
this.terminal();
} else if (actionName === 'update') {
this.update();
} else if (actionName === 'logs') {
window.open(window.location.origin + '/api/visors/' + nodePk + '/runtime-logs', '_blank');
} else if (actionName === 'reboot') {
this.reboot();
} else if (actionName === null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export class NodeComponent implements OnInit, OnDestroy {
*/
performAction(actionName: string) {
// The helper object manages the event.
this.nodeActionsHelper.performAction(actionName);
this.nodeActionsHelper.performAction(actionName, NodeComponent.currentNodeKey);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion static/skywire-manager-src/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@
"terminal": "Terminal",
"config": "Configuration",
"update": "Update",
"reboot": "Reboot"
"reboot": "Reboot",
"logs": "View logs"
},
"reboot": {
"confirmation": "Are you sure you want to reboot the visor?",
Expand Down
3 changes: 2 additions & 1 deletion static/skywire-manager-src/src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@
"terminal": "Terminal",
"config": "Configuración",
"update": "Actualizar",
"reboot": "Reiniciar"
"reboot": "Reiniciar",
"logs": "Ver logs"
},
"reboot": {
"confirmation": "¿Seguro que desea reiniciar el visor?",
Expand Down
3 changes: 2 additions & 1 deletion static/skywire-manager-src/src/assets/i18n/es_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@
"terminal": "Terminal",
"config": "Configuration",
"update": "Update",
"reboot": "Reboot"
"reboot": "Reboot",
"logs": "View logs"
},
"reboot": {
"confirmation": "Are you sure you want to reboot the visor?",
Expand Down

0 comments on commit 2542209

Please sign in to comment.