Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a view logs option to he UI #766

Merged
merged 1 commit into from
May 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -242,7 +242,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 @@ -242,7 +242,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 @@ -242,7 +242,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