category
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
maltegrosse 2023-01-24 09:57:19 +01:00
parent eaadc037ad
commit cd0e16fe2a
2 changed files with 46 additions and 45 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "jupyterlab-training", "name": "jupyterlab-training",
"version": "0.1.2", "version": "0.1.3",
"description": "Training Data Pipeline", "description": "Training Data Pipeline",
"keywords": [ "keywords": [
"jupyter", "jupyter",

View File

@ -6,21 +6,21 @@ import {
ICommandPalette, ICommandPalette,
MainAreaWidget MainAreaWidget
} from '@jupyterlab/apputils'; } from '@jupyterlab/apputils';
import { TrainingIcon } from './images'; import { TrainingIcon } from './images';
import { ISettingRegistry } from '@jupyterlab/settingregistry'; import { ISettingRegistry } from '@jupyterlab/settingregistry';
import { LabIcon } from '@jupyterlab/ui-components'; import { LabIcon } from '@jupyterlab/ui-components';
//import { requestAPI } from './handler'; //import { requestAPI } from './handler';
import { ILauncher} from '@jupyterlab/launcher'; import { ILauncher } from '@jupyterlab/launcher';
import {TrainingWidget} from "./widget" import { TrainingWidget } from "./widget"
const plugin: JupyterFrontEndPlugin<void> = { const plugin: JupyterFrontEndPlugin<void> = {
id: 'jupyterlab-training:plugin', id: 'jupyterlab-training:plugin',
autoStart: true, autoStart: true,
optional: [ISettingRegistry, ILauncher, ICommandPalette], optional: [ISettingRegistry, ILauncher, ICommandPalette],
activate: (app: JupyterFrontEnd, settingRegistry: ISettingRegistry | null, launcher:ILauncher,palette: ICommandPalette) => { activate: (app: JupyterFrontEnd, settingRegistry: ISettingRegistry | null, launcher: ILauncher, palette: ICommandPalette) => {
// console.log('JupyterLab extension jupyterlab-data-pool is activated!'); // console.log('JupyterLab extension jupyterlab-data-pool is activated!');
if (settingRegistry) { if (settingRegistry) {
// settingRegistry // settingRegistry
@ -42,48 +42,49 @@ const plugin: JupyterFrontEndPlugin<void> = {
// `The jupyterlab-data-pool server extension appears to be missing.\n${reason}` // `The jupyterlab-data-pool server extension appears to be missing.\n${reason}`
// ); // );
// }); // });
const webDavIcon = new LabIcon({ name: 'ui-components:training-icon', svgstr: TrainingIcon}); 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 label = "Training"
const command: string = 'jupyterlab-training:open' const content = new TrainingWidget(label);
app.commands.addCommand(command, { const widget = new MainAreaWidget({ content });
label: label, widget.id = 'jupyterlab-training:plugin';
icon: webDavIcon, widget.title.label = label
execute: () => { widget.title.closable = true;
if (!widget.isAttached) { widget.title.icon = webDavIcon
app.shell.add(widget, 'main');
}
content.update(); const command: string = 'jupyterlab-training:open'
app.shell.activateById(widget.id); app.commands.addCommand(command, {
label: label,
icon: webDavIcon,
execute: () => {
if (!widget.isAttached) {
app.shell.add(widget, 'main');
} }
}); content.update();
const launcher_item : ILauncher.IItemOptions = { app.shell.activateById(widget.id);
command: command, }
args: { });
url: "#", const launcher_item: ILauncher.IItemOptions = {
newBrowserTab: true, command: command,
title: 'Training', args: {
id: 'training' url: "#",
}, newBrowserTab: true,
category: 'Other', title: 'Training',
rank: 2, id: 'training'
},
category: 'Sandbox',
rank: 2,
}; };
launcher.add(launcher_item) launcher.add(launcher_item)
palette.addItem({ command, category: 'Share' }); palette.addItem({ command, category: 'Share' });
} }
}; };