diff --git a/package.json b/package.json index ad56411..bac0953 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jupyterlab-training", - "version": "0.1.2", + "version": "0.1.3", "description": "Training Data Pipeline", "keywords": [ "jupyter", diff --git a/src/index.ts b/src/index.ts index e6212c3..8bc9495 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,21 +6,21 @@ import { ICommandPalette, MainAreaWidget } from '@jupyterlab/apputils'; -import { TrainingIcon } from './images'; +import { TrainingIcon } from './images'; import { ISettingRegistry } from '@jupyterlab/settingregistry'; -import { LabIcon } from '@jupyterlab/ui-components'; +import { LabIcon } from '@jupyterlab/ui-components'; //import { requestAPI } from './handler'; -import { ILauncher} from '@jupyterlab/launcher'; -import {TrainingWidget} from "./widget" +import { ILauncher } from '@jupyterlab/launcher'; +import { TrainingWidget } from "./widget" const plugin: JupyterFrontEndPlugin = { id: 'jupyterlab-training:plugin', autoStart: true, - optional: [ISettingRegistry, ILauncher, ICommandPalette], - activate: (app: JupyterFrontEnd, settingRegistry: ISettingRegistry | null, launcher:ILauncher,palette: ICommandPalette) => { - // console.log('JupyterLab extension jupyterlab-data-pool is activated!'); + optional: [ISettingRegistry, ILauncher, ICommandPalette], + activate: (app: JupyterFrontEnd, settingRegistry: ISettingRegistry | null, launcher: ILauncher, palette: ICommandPalette) => { + // console.log('JupyterLab extension jupyterlab-data-pool is activated!'); if (settingRegistry) { // settingRegistry @@ -42,48 +42,49 @@ const plugin: JupyterFrontEndPlugin = { // `The jupyterlab-data-pool server extension appears to be missing.\n${reason}` // ); // }); - const webDavIcon = new LabIcon({ name: 'ui-components:training-icon', svgstr: TrainingIcon}); - - const label = "Training" - const content = new TrainingWidget(label); - const widget = new MainAreaWidget({content}); - widget.id = 'jupyterlab-training:plugin'; - widget.title.label = label - widget.title.closable = true; - widget.title.icon = webDavIcon + const webDavIcon = new LabIcon({ name: 'ui-components:training-icon', svgstr: TrainingIcon }); - - const command: string = 'jupyterlab-training:open' - app.commands.addCommand(command, { - label: label, - icon: webDavIcon, - execute: () => { - if (!widget.isAttached) { - app.shell.add(widget, 'main'); - } - content.update(); - app.shell.activateById(widget.id); + const label = "Training" + const content = new TrainingWidget(label); + const widget = new MainAreaWidget({ content }); + widget.id = 'jupyterlab-training:plugin'; + widget.title.label = label + widget.title.closable = true; + widget.title.icon = webDavIcon + + + const command: string = 'jupyterlab-training:open' + app.commands.addCommand(command, { + label: label, + icon: webDavIcon, + execute: () => { + if (!widget.isAttached) { + app.shell.add(widget, 'main'); } - }); - const launcher_item : ILauncher.IItemOptions = { - command: command, - args: { - url: "#", - newBrowserTab: true, - title: 'Training', - id: 'training' - }, - category: 'Other', - rank: 2, + content.update(); + app.shell.activateById(widget.id); + } + }); + const launcher_item: ILauncher.IItemOptions = { + command: command, + args: { + url: "#", + newBrowserTab: true, + title: 'Training', + id: 'training' + }, + category: 'Sandbox', + rank: 2, + }; launcher.add(launcher_item) - + palette.addItem({ command, category: 'Share' }); - - - - - + + + + + } };