diff --git a/ts/jupyter_extension/src/index.ts b/ts/jupyter_extension/src/index.ts index d406f040d4..e8eae6ef6a 100644 --- a/ts/jupyter_extension/src/index.ts +++ b/ts/jupyter_extension/src/index.ts @@ -2,6 +2,17 @@ import { JupyterFrontEnd, JupyterFrontEndPlugin } from '@jupyterlab/application' import { ICommandPalette, IFrame } from '@jupyterlab/apputils'; import { PageConfig } from '@jupyterlab/coreutils'; import { ILauncher } from '@jupyterlab/launcher'; +import { LabIcon } from '@jupyterlab/ui-components'; + +const nniIconSvg = ` + + + + + + +`; +const nniIcon = new LabIcon({ name: 'nni', svgstr: nniIconSvg }); class NniWidget extends IFrame { constructor() { @@ -14,6 +25,7 @@ class NniWidget extends IFrame { this.url = PageConfig.getBaseUrl() + 'nni/index'; this.id = 'nni'; this.title.label = 'NNI'; + this.title.icon = nniIcon; this.title.closable = true; } } @@ -27,7 +39,7 @@ async function activate(app: JupyterFrontEnd, palette: ICommandPalette, launcher commands.addCommand(command, { label: 'NNI', caption: 'NNI', - iconClass: (args) => (args.isPalette ? null : 'jp-Launcher-kernelIcon'), + icon: (args) => (args.isPalette ? null : nniIcon), execute: () => { shell.add(new NniWidget(), 'main'); } @@ -36,11 +48,7 @@ async function activate(app: JupyterFrontEnd, palette: ICommandPalette, launcher palette.addItem({ command, category }); if (launcher) { - launcher.add({ - command, - category, - kernelIconUrl: '/nni/icon.png' // FIXME: this field only works for "Notebook" category - }); + launcher.add({ command, category }); } }