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

Toolbar kernel actions buttons #94

Open
DenisaCG opened this issue Aug 20, 2024 · 0 comments
Open

Toolbar kernel actions buttons #94

DenisaCG opened this issue Aug 20, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@DenisaCG
Copy link
Member

DenisaCG commented Aug 20, 2024

The toolbar buttons for the kernel actions can be added, so it's easier for users to access them.

Screenshot from 2024-08-20 11-50-11

Currently the actions are only present inside the Kernel Menu. The commands are defined here:

// Register kernel commands.
commands.addCommand(CommandIDs.interruptKernel, {
label: 'Interrupt Kernel',
execute: args => {
const current = getCurrent(args);
if (!current) {
return;
}
const kernel = current.context.sessionContext.session?.kernel;
if (kernel) {
return kernel.interrupt();
}
return Promise.resolve(void 0);
},
isEnabled
});
commands.addCommand(CommandIDs.restartKernel, {
label: 'Restart Kernel…',
execute: args => {
const current = getCurrent(args);
if (!current) {
return;
}
const kernel = current.context.sessionContext.session?.kernel;
if (kernel) {
return kernel.restart();
}
return Promise.resolve(void 0);
},
isEnabled
});
commands.addCommand(CommandIDs.shutdownKernel, {
label: 'Shut Down Kernel',
execute: args => {
const current = getCurrent(args);
if (!current) {
return;
}
return current.context.sessionContext.shutdown();
}
});
commands.addCommand(CommandIDs.reconnectToKernel, {
label: 'Reconnect to Kernel',
execute: args => {
const current = getCurrent(args);
if (!current) {
return;
}
const kernel = current.context.sessionContext.session?.kernel;
if (kernel) {
return kernel.reconnect();
}
return Promise.resolve(void 0);
}
});

@DenisaCG DenisaCG added enhancement New feature or request good first issue Good for newcomers labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant