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

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); |
|
} |
|
}); |
The toolbar buttons for the kernel actions can be added, so it's easier for users to access them.
Currently the actions are only present inside the
Kernel Menu. The commands are defined here:jupyterlab-blockly/packages/blockly-extension/src/index.ts
Lines 245 to 302 in 1f48117