diff --git a/jupyterlab-server-proxy/package.json b/jupyterlab-server-proxy/package.json index 669b074f..83699e3f 100644 --- a/jupyterlab-server-proxy/package.json +++ b/jupyterlab-server-proxy/package.json @@ -1,6 +1,6 @@ { "name": "jupyterlab-server-proxy", - "version": "1.0.0", + "version": "1.0.1-alpha.6", "description": "Launcher icons for proxied applications", "keywords": [ "jupyter", @@ -30,12 +30,12 @@ "watch": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^0.19.1", - "@jupyterlab/launcher": "^0.19.1" + "@jupyterlab/application": "^1.0.0-alpha.6", + "@jupyterlab/launcher": "^1.0.0-alpha.6" }, "devDependencies": { "rimraf": "^2.6.1", - "typescript": "~3.1.1" + "typescript": "~3.4.3" }, "jupyterlab": { "extension": true diff --git a/jupyterlab-server-proxy/src/index.ts b/jupyterlab-server-proxy/src/index.ts index a5f3115d..e64f21f9 100644 --- a/jupyterlab-server-proxy/src/index.ts +++ b/jupyterlab-server-proxy/src/index.ts @@ -1,44 +1,44 @@ -import { JupyterLab, JupyterLabPlugin } from '@jupyterlab/application'; +import { JupyterFrontEnd, JupyterFrontEndPlugin } from '@jupyterlab/application'; import { ILauncher } from '@jupyterlab/launcher'; import { PageConfig } from '@jupyterlab/coreutils'; import '../style/index.css'; -function addLauncherEntries(serverData: any, launcher: ILauncher, app: JupyterLab) { - for (let server_process of serverData.server_processes) { +function addLauncherEntries(serverData: any, launcher: ILauncher, app: JupyterFrontEnd) { + for (let server_process of serverData.server_processes) { - if (!server_process.launcher_entry.enabled) { - continue; - } + if (!server_process.launcher_entry.enabled) { + continue; + } - let commandId = 'server-proxy:' + server_process.name; + let commandId = 'server-proxy:' + server_process.name; - app.commands.addCommand(commandId, { - label: server_process.launcher_entry.title, - execute: () => { - let launch_url = PageConfig.getBaseUrl() + server_process.name + '/'; - window.open(launch_url, '_blank'); - } - }); - let command : ILauncher.IItemOptions = { - command: commandId, - category: 'Notebook' - }; - if (server_process.launcher_entry.icon_url) { - command.kernelIconUrl = server_process.launcher_entry.icon_url; + app.commands.addCommand(commandId, { + label: server_process.launcher_entry.title, + execute: () => { + let launch_url = PageConfig.getBaseUrl() + server_process.name + '/'; + window.open(launch_url, '_blank'); } - launcher.add(command); + }); + let command: ILauncher.IItemOptions = { + command: commandId, + category: 'Notebook' + }; + if (server_process.launcher_entry.icon_url) { + command.kernelIconUrl = server_process.launcher_entry.icon_url; } + launcher.add(command); + } } /** * Initialization data for the jupyterlab-server-proxy extension. */ -const extension: JupyterLabPlugin = { +const extension: JupyterFrontEndPlugin = { id: 'jupyterlab-server-proxy', autoStart: true, requires: [ILauncher], - activate: (app: JupyterLab, launcher: ILauncher) => { + activate: (app: JupyterFrontEnd, launcher: ILauncher) => { // FIXME: What the callback hell is this fetch(PageConfig.getBaseUrl() + 'server-proxy/servers-info').then( response => {