Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function activate(app: JupyterLab, services: IServiceManager, restorer: ILayoutRestorer): void {
let running = new RunningSessions({ manager: services });
running.id = 'jp-running-sessions';
running.title.label = 'Running';
// Let the application restorer track the running panel for restoration of
// application state (e.g. setting the running panel as the current side bar
// widget).
restorer.add(running, 'running-sessions');
running.sessionOpenRequested.connect((sender, model) => {
let path = model.notebook.path;
let name = path.split('/').pop();
if (CONSOLE_REGEX.test(name)) {
app.commands.execute('console:open', { id: model.id });
} else {
app.commands.execute('file-operations:open', { path });
}
function activate(
app: JupyterFrontEnd,
restorer: ILayoutRestorer | null
): void {
let running = new RunningSessions({ manager: app.serviceManager });
running.id = 'jp-running-sessions';
running.title.iconClass = 'jp-RunningIcon jp-SideBar-tabIcon';
running.title.caption = 'Running Terminals and Kernels';
// Let the application restorer track the running panel for restoration of
// application state (e.g. setting the running panel as the current side bar
// widget).
if (restorer) {
restorer.add(running, 'running-sessions');
}
running.sessionOpenRequested.connect((sender, model) => {
let path = model.path;
if (model.type.toLowerCase() === 'console') {
void app.commands.execute('console:open', { path });
} else {
function activate(app: JupyterLab, services: IServiceManager, restorer: ILayoutRestorer): void {
let running = new RunningSessions({ manager: services });
running.id = 'jp-running-sessions';
running.title.label = 'Running';
// Let the application restorer track the running panel for restoration of
// application state (e.g. setting the running panel as the current side bar
// widget).
restorer.add(running, 'running-sessions');
running.sessionOpenRequested.connect((sender, model) => {
let path = model.path;
if (model.type.toLowerCase() === 'console') {
app.commands.execute('console:open', { path });
} else {
app.commands.execute('docmanager:open', { path });
}
});