@datalayer/jupyter-react 0.8.3 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/tabs/ComponentsTab.js +1 -1
- package/lib/app/tabs/ComponentsTab.js.map +1 -1
- package/lib/app/tabs/components/CellComponent.js +3 -3
- package/lib/app/tabs/components/CellComponent.js.map +1 -1
- package/lib/app/tabs/components/NotebookComponent.js +2 -2
- package/lib/app/tabs/components/NotebookComponent.js.map +1 -1
- package/lib/app/tabs/components/ViewerComponent.js +2 -2
- package/lib/app/tabs/components/ViewerComponent.js.map +1 -1
- package/lib/components/cell/Cell.d.ts +6 -0
- package/lib/components/cell/Cell.js +4 -31
- package/lib/components/cell/Cell.js.map +1 -1
- package/lib/components/cell/CellAdapter.js +1 -1
- package/lib/components/cell/CellAdapter.js.map +1 -1
- package/lib/components/cell/CellCommands.js +1 -1
- package/lib/components/codemirror/CodeMirrorEditor.js +1 -2
- package/lib/components/codemirror/CodeMirrorEditor.js.map +1 -1
- package/lib/components/codemirror/CodeMirrorOutputToolbar.js +1 -1
- package/lib/components/codemirror/CodeMirrorOutputToolbar.js.map +1 -1
- package/lib/components/commands/Commands.js +1 -1
- package/lib/components/commands/Commands.js.map +1 -1
- package/lib/components/console/Console.d.ts +12 -1
- package/lib/components/console/Console.js +11 -7
- package/lib/components/console/Console.js.map +1 -1
- package/lib/components/console/ConsoleAdapter.d.ts +23 -2
- package/lib/components/console/ConsoleAdapter.js +27 -13
- package/lib/components/console/ConsoleAdapter.js.map +1 -1
- package/lib/components/dialog/Dialog.js +1 -1
- package/lib/components/dialog/Dialog.js.map +1 -1
- package/lib/components/filemanager/FileManagerJupyterLab.js +1 -1
- package/lib/components/filemanager/FileManagerJupyterLab.js.map +1 -1
- package/lib/components/jupyterlab/JupyterLabApp.d.ts +1 -1
- package/lib/components/jupyterlab/JupyterLabAppCss.d.ts +1 -1
- package/lib/components/kernel/KernelActionMenu.d.ts +8 -0
- package/lib/components/kernel/KernelActionMenu.js +21 -0
- package/lib/components/kernel/KernelActionMenu.js.map +1 -0
- package/lib/components/kernel/KernelInspector.d.ts +6 -0
- package/lib/components/kernel/KernelInspector.js +31 -0
- package/lib/components/kernel/KernelInspector.js.map +1 -0
- package/lib/components/kernel/KernelLauncher.d.ts +2 -0
- package/lib/components/kernel/KernelLauncher.js +11 -0
- package/lib/components/kernel/KernelLauncher.js.map +1 -0
- package/lib/components/kernel/KernelLogs.d.ts +2 -0
- package/lib/components/kernel/KernelLogs.js +11 -0
- package/lib/components/kernel/KernelLogs.js.map +1 -0
- package/lib/components/kernel/KernelProgressBar.d.ts +2 -0
- package/lib/components/kernel/KernelProgressBar.js +26 -0
- package/lib/components/kernel/KernelProgressBar.js.map +1 -0
- package/lib/components/kernel/KernelSelector.d.ts +8 -0
- package/lib/components/kernel/KernelSelector.js +40 -0
- package/lib/components/kernel/KernelSelector.js.map +1 -0
- package/lib/components/kernel/KernelStatus.d.ts +27 -0
- package/lib/components/kernel/KernelStatus.js +67 -0
- package/lib/components/kernel/KernelStatus.js.map +1 -0
- package/lib/components/kernel/KernelUsage.d.ts +6 -0
- package/lib/components/kernel/KernelUsage.js +100 -0
- package/lib/components/kernel/KernelUsage.js.map +1 -0
- package/lib/components/kernel/KernelVariables.d.ts +6 -0
- package/lib/components/kernel/KernelVariables.js +23 -0
- package/lib/components/kernel/KernelVariables.js.map +1 -0
- package/lib/components/kernel/Kernels.d.ts +2 -0
- package/lib/components/kernel/Kernels.js +88 -0
- package/lib/components/kernel/Kernels.js.map +1 -0
- package/lib/components/kernel/index.d.ts +10 -0
- package/lib/components/kernel/index.js +16 -0
- package/lib/components/kernel/index.js.map +1 -0
- package/lib/components/kernel/inspector/kernelinspector.css +68 -0
- package/lib/components/kernel/inspector/model.d.ts +56 -0
- package/lib/components/kernel/inspector/model.js +201 -0
- package/lib/components/kernel/inspector/model.js.map +1 -0
- package/lib/components/kernel/inspector/widget.d.ts +40 -0
- package/lib/components/kernel/inspector/widget.js +190 -0
- package/lib/components/kernel/inspector/widget.js.map +1 -0
- package/lib/components/kernel/variables/handler.d.ts +86 -0
- package/lib/components/kernel/variables/handler.js +262 -0
- package/lib/components/kernel/variables/handler.js.map +1 -0
- package/lib/components/kernel/variables/inspectorscripts.d.ts +20 -0
- package/lib/components/kernel/variables/inspectorscripts.js +349 -0
- package/lib/components/kernel/variables/inspectorscripts.js.map +1 -0
- package/lib/components/kernel/variables/kernelconnector.d.ts +37 -0
- package/lib/components/kernel/variables/kernelconnector.js +76 -0
- package/lib/components/kernel/variables/kernelconnector.js.map +1 -0
- package/lib/components/kernel/variables/manager.d.ts +26 -0
- package/lib/components/kernel/variables/manager.js +70 -0
- package/lib/components/kernel/variables/manager.js.map +1 -0
- package/lib/components/kernel/variables/tokens.d.ts +48 -0
- package/lib/{jupyter/lab/JupyterLabTheme.js → components/kernel/variables/tokens.js} +1 -1
- package/lib/components/kernel/variables/tokens.js.map +1 -0
- package/lib/components/kernel/variables/variablesinspector.css +110 -0
- package/lib/components/kernel/variables/variablesinspector.d.ts +5 -0
- package/lib/components/kernel/variables/variablesinspector.js +85 -0
- package/lib/components/kernel/variables/variablesinspector.js.map +1 -0
- package/lib/components/kernel/variables/widget.d.ts +33 -0
- package/lib/components/kernel/variables/widget.js +391 -0
- package/lib/components/kernel/variables/widget.js.map +1 -0
- package/lib/components/lumino/Lumino.js.map +1 -0
- package/lib/components/lumino/LuminoBox.js.map +1 -0
- package/lib/components/lumino/LuminoDetached.js.map +1 -0
- package/lib/components/lumino/LuminoObservable.js.map +1 -0
- package/lib/components/lumino/LuminoRedux.js.map +1 -0
- package/lib/components/lumino/ReactPortalWidget.js.map +1 -0
- package/lib/components/notebook/Notebook.js +11 -7
- package/lib/components/notebook/Notebook.js.map +1 -1
- package/lib/components/notebook/NotebookAdapter.d.ts +3 -1
- package/lib/components/notebook/NotebookAdapter.js +43 -39
- package/lib/components/notebook/NotebookAdapter.js.map +1 -1
- package/lib/components/notebook/NotebookCommands.d.ts +23 -21
- package/lib/components/notebook/NotebookCommands.js +51 -26
- package/lib/components/notebook/NotebookCommands.js.map +1 -1
- package/lib/components/notebook/cell/metadata/CellMetadataEditor.js +1 -1
- package/lib/components/notebook/cell/metadata/CellMetadataEditor.js.map +1 -1
- package/lib/components/notebook/cell/metadata/NbGraderCells.js +10 -10
- package/lib/components/notebook/cell/prompt/Countdown.js +1 -1
- package/lib/components/notebook/cell/prompt/Countdown.js.map +1 -1
- package/lib/components/notebook/cell/prompt/CountdownOutputPrompt.js.map +1 -1
- package/lib/components/notebook/cell/sidebar/CellSidebarWidget.d.ts +1 -1
- package/lib/components/notebook/cell/sidebar/CellSidebarWidget.js +1 -1
- package/lib/components/notebook/cell/sidebar/CellSidebarWidget.js.map +1 -1
- package/lib/components/notebook/marked/marked.js +1 -1
- package/lib/components/output/Output.d.ts +11 -10
- package/lib/components/output/Output.js +32 -57
- package/lib/components/output/Output.js.map +1 -1
- package/lib/components/output/OutputAdapter.d.ts +1 -1
- package/lib/components/output/OutputAdapter.js +14 -12
- package/lib/components/output/OutputAdapter.js.map +1 -1
- package/lib/components/output/OutputRenderer.js +4 -2
- package/lib/components/output/OutputRenderer.js.map +1 -1
- package/lib/components/output/OutputZustand.d.ts +5 -0
- package/lib/components/output/OutputZustand.js +5 -0
- package/lib/components/output/OutputZustand.js.map +1 -1
- package/lib/components/output/ipywidgets/IPyWidgetsAttached.js +1 -1
- package/lib/components/output/ipywidgets/IPyWidgetsAttached.js.map +1 -1
- package/lib/components/output/ipywidgets/IPyWidgetsViewManager.js +7 -6
- package/lib/components/output/ipywidgets/IPyWidgetsViewManager.js.map +1 -1
- package/lib/components/settings/Settings.js +1 -1
- package/lib/components/settings/Settings.js.map +1 -1
- package/lib/components/terminal/Terminal.d.ts +4 -0
- package/lib/components/terminal/Terminal.js +1 -1
- package/lib/components/terminal/Terminal.js.map +1 -1
- package/lib/components/terminal/TerminalAdapter.js +12 -3
- package/lib/components/terminal/TerminalAdapter.js.map +1 -1
- package/lib/components/viewer/Viewer.d.ts +2 -1
- package/lib/components/viewer/Viewer.js +16 -3
- package/lib/components/viewer/Viewer.js.map +1 -1
- package/lib/components/viewer/input/CodemirrorViewer.js +2 -2
- package/lib/components/viewer/input/CodemirrorViewer.js.map +1 -1
- package/lib/components/viewer/input/InputViewer.js +1 -4
- package/lib/components/viewer/input/InputViewer.js.map +1 -1
- package/lib/components/viewer/output/OutputAdapter.js +2 -2
- package/lib/components/viewer/output/OutputAdapter.js.map +1 -1
- package/lib/components/viewer/output/OutputViewer.js +1 -1
- package/lib/components/viewer/output/OutputViewer.js.map +1 -1
- package/lib/examples/All.js +5 -4
- package/lib/examples/All.js.map +1 -1
- package/lib/examples/Bqplot.js +7 -1
- package/lib/examples/Bqplot.js.map +1 -1
- package/lib/examples/CellLite.js +16 -0
- package/lib/examples/CellLite.js.map +1 -0
- package/lib/examples/Console.js +1 -1
- package/lib/examples/Console.js.map +1 -1
- package/lib/examples/ConsoleLite.js +3 -1
- package/lib/examples/ConsoleLite.js.map +1 -1
- package/lib/examples/Deno.js +18 -0
- package/lib/examples/Deno.js.map +1 -0
- package/lib/examples/IPyLeaflet.js +7 -3
- package/lib/examples/IPyLeaflet.js.map +1 -1
- package/lib/examples/IPyReact.js +7 -3
- package/lib/examples/IPyReact.js.map +1 -1
- package/lib/examples/JupyterLabHeadlessApp.js +1 -1
- package/lib/examples/JupyterLabHeadlessApp.js.map +1 -1
- package/lib/examples/KernelExecResult.d.ts +1 -0
- package/lib/examples/KernelExecResult.js +40 -0
- package/lib/examples/KernelExecResult.js.map +1 -0
- package/lib/examples/KernelExecutor.js +20 -10
- package/lib/examples/KernelExecutor.js.map +1 -1
- package/lib/examples/Kernels.d.ts +1 -0
- package/lib/examples/Kernels.js +78 -0
- package/lib/examples/Kernels.js.map +1 -0
- package/lib/examples/Lumino.js +1 -1
- package/lib/examples/Lumino.js.map +1 -1
- package/lib/examples/Matplotlib.js +11 -7
- package/lib/examples/Matplotlib.js.map +1 -1
- package/lib/examples/NotebookCellSidebar.js +9 -5
- package/lib/examples/NotebookCellSidebar.js.map +1 -1
- package/lib/examples/NotebookColorMode.js +18 -12
- package/lib/examples/NotebookColorMode.js.map +1 -1
- package/lib/examples/NotebookExternalContent.js +9 -5
- package/lib/examples/NotebookExternalContent.js.map +1 -1
- package/lib/examples/NotebookInit.js +8 -4
- package/lib/examples/NotebookInit.js.map +1 -1
- package/lib/examples/NotebookKernelChange.js +4 -3
- package/lib/examples/NotebookKernelChange.js.map +1 -1
- package/lib/examples/NotebookLite.d.ts +1 -0
- package/lib/examples/NotebookLite.js +20 -0
- package/lib/examples/NotebookLite.js.map +1 -0
- package/lib/examples/NotebookNbFormat.js +9 -5
- package/lib/examples/NotebookNbFormat.js.map +1 -1
- package/lib/examples/NotebookNbFormatChange.d.ts +1 -0
- package/lib/examples/{NotebookModelChange.js → NotebookNbFormatChange.js} +12 -8
- package/lib/examples/NotebookNbFormatChange.js.map +1 -0
- package/lib/examples/NotebookPath.js +9 -5
- package/lib/examples/NotebookPath.js.map +1 -1
- package/lib/examples/NotebookPathChange.js +9 -5
- package/lib/examples/NotebookPathChange.js.map +1 -1
- package/lib/examples/NotebookSkeleton.d.ts +1 -0
- package/lib/examples/NotebookSkeleton.js +28 -0
- package/lib/examples/NotebookSkeleton.js.map +1 -0
- package/lib/examples/NotebookTheme.js +20 -13
- package/lib/examples/NotebookTheme.js.map +1 -1
- package/lib/examples/NotebookUnmount.js +5 -4
- package/lib/examples/NotebookUnmount.js.map +1 -1
- package/lib/examples/ObservableHQ.d.ts +1 -0
- package/lib/examples/ObservableHQ.js +18 -0
- package/lib/examples/ObservableHQ.js.map +1 -0
- package/lib/examples/Outputs.js +2 -2
- package/lib/examples/Outputs.js.map +1 -1
- package/lib/examples/RunningSessions.js +1 -1
- package/lib/examples/RunningSessions.js.map +1 -1
- package/lib/examples/Viewer.js +6 -68
- package/lib/examples/Viewer.js.map +1 -1
- package/lib/examples/lumino/LuminoWidget.js +3 -3
- package/lib/examples/lumino/LuminoWidget.js.map +1 -1
- package/lib/examples/toolbars/NotebookToolbar.js +7 -4
- package/lib/examples/toolbars/NotebookToolbar.js.map +1 -1
- package/lib/examples/toolbars/NotebookToolbarAutoSave.js +1 -1
- package/lib/examples/toolbars/NotebookToolbarAutoSave.js.map +1 -1
- package/lib/index.d.ts +33 -24
- package/lib/index.js +53 -36
- package/lib/index.js.map +1 -1
- package/lib/jupyter/Jupyter.d.ts +6 -1090
- package/lib/jupyter/Jupyter.js +23 -18
- package/lib/jupyter/Jupyter.js.map +1 -1
- package/lib/jupyter/JupyterConfig.js +1 -1
- package/lib/jupyter/JupyterConfig.js.map +1 -1
- package/lib/jupyter/JupyterContext.d.ts +118 -23
- package/lib/jupyter/JupyterContext.js +115 -100
- package/lib/jupyter/JupyterContext.js.map +1 -1
- package/lib/jupyter/ipywidgets/cache/semvercache.d.ts +3 -1
- package/lib/jupyter/ipywidgets/cache/semvercache.js.map +1 -1
- package/lib/jupyter/ipywidgets/classic/IPyWidgetsClassicManager.d.ts +5 -3
- package/lib/jupyter/ipywidgets/classic/IPyWidgetsClassicManager.js +14 -14
- package/lib/jupyter/ipywidgets/classic/IPyWidgetsClassicManager.js.map +1 -1
- package/lib/jupyter/ipywidgets/lab/manager.js +4 -5
- package/lib/jupyter/ipywidgets/lab/manager.js.map +1 -1
- package/lib/jupyter/ipywidgets/lab/plugin.js +2 -2
- package/lib/jupyter/ipywidgets/lab/plugin.js.map +1 -1
- package/lib/jupyter/ipywidgets/lab/renderer.js.map +1 -1
- package/lib/jupyter/ipywidgets/plotly/Figure.js +180 -169
- package/lib/jupyter/ipywidgets/plotly/Figure.js.map +1 -1
- package/lib/jupyter/kernel/Kernel.d.ts +69 -19
- package/lib/jupyter/kernel/Kernel.js +62 -44
- package/lib/jupyter/kernel/Kernel.js.map +1 -1
- package/lib/jupyter/kernel/KernelExecutor.d.ts +16 -6
- package/lib/jupyter/kernel/KernelExecutor.js +61 -27
- package/lib/jupyter/kernel/KernelExecutor.js.map +1 -1
- package/lib/jupyter/kernel/index.d.ts +2 -0
- package/lib/jupyter/kernel/index.js +8 -0
- package/lib/jupyter/kernel/index.js.map +1 -0
- package/lib/jupyter/lab/JupyterLabColorMode.js +7 -0
- package/lib/jupyter/lab/JupyterLabColorMode.js.map +1 -0
- package/lib/jupyter/lab/JupyterLabCss.d.ts +5 -2
- package/lib/jupyter/lab/JupyterLabCss.js +35 -7
- package/lib/jupyter/lab/JupyterLabCss.js.map +1 -1
- package/lib/jupyter/lab/index.d.ts +2 -2
- package/lib/jupyter/lab/index.js +1 -2
- package/lib/jupyter/lab/index.js.map +1 -1
- package/lib/jupyter/lab/notebook/content/CountdownContentFactory.d.ts +3 -8
- package/lib/jupyter/lab/notebook/content/CountdownContentFactory.js +6 -12
- package/lib/jupyter/lab/notebook/content/CountdownContentFactory.js.map +1 -1
- package/lib/jupyter/lab/notebook/content/plugin.js +2 -2
- package/lib/jupyter/lab/notebook/content/plugin.js.map +1 -1
- package/lib/jupyter/lite/LiteServer.d.ts +11 -2
- package/lib/jupyter/lite/LiteServer.js +41 -66
- package/lib/jupyter/lite/LiteServer.js.map +1 -1
- package/lib/jupyter/renderers/plotly/PlotlyRenderer.js +4 -4
- package/lib/jupyter/renderers/plotly/PlotlyRenderer.js.map +1 -1
- package/lib/jupyter/theme.js +3 -2
- package/lib/jupyter/theme.js.map +1 -1
- package/lib/utils/Utils.d.ts +3 -2
- package/lib/utils/Utils.js +45 -1
- package/lib/utils/Utils.js.map +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +2 -0
- package/lib/utils/index.js.map +1 -0
- package/package.json +170 -86
- package/lib/examples/NotebookModelChange.js.map +0 -1
- package/lib/examples/ViewerFile.js +0 -19
- package/lib/examples/ViewerFile.js.map +0 -1
- package/lib/jupyter/lab/JupyterLabTheme.js.map +0 -1
- package/lib/jupyter/lumino/Lumino.js.map +0 -1
- package/lib/jupyter/lumino/LuminoBox.js.map +0 -1
- package/lib/jupyter/lumino/LuminoDetached.js.map +0 -1
- package/lib/jupyter/lumino/LuminoObservable.js.map +0 -1
- package/lib/jupyter/lumino/LuminoRedux.js.map +0 -1
- package/lib/jupyter/lumino/ReactPortalWidget.js.map +0 -1
- /package/lib/{jupyter → components}/lumino/Lumino.d.ts +0 -0
- /package/lib/{jupyter → components}/lumino/Lumino.js +0 -0
- /package/lib/{jupyter → components}/lumino/LuminoBox.d.ts +0 -0
- /package/lib/{jupyter → components}/lumino/LuminoBox.js +0 -0
- /package/lib/{jupyter → components}/lumino/LuminoDetached.d.ts +0 -0
- /package/lib/{jupyter → components}/lumino/LuminoDetached.js +0 -0
- /package/lib/{jupyter → components}/lumino/LuminoObservable.d.ts +0 -0
- /package/lib/{jupyter → components}/lumino/LuminoObservable.js +0 -0
- /package/lib/{jupyter → components}/lumino/LuminoRedux.d.ts +0 -0
- /package/lib/{jupyter → components}/lumino/LuminoRedux.js +0 -0
- /package/lib/{jupyter → components}/lumino/ReactPortalWidget.d.ts +0 -0
- /package/lib/{jupyter → components}/lumino/ReactPortalWidget.js +0 -0
- /package/lib/examples/{NotebookModelChange.d.ts → CellLite.d.ts} +0 -0
- /package/lib/examples/{ViewerFile.d.ts → Deno.d.ts} +0 -0
- /package/lib/jupyter/lab/{JupyterLabTheme.d.ts → JupyterLabColorMode.d.ts} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { ActionMenu, ActionList, IconButton } from '@primer/react';
|
|
8
|
+
import { KebabHorizontalIcon, StopIcon, PaintbrushIcon, } from '@primer/octicons-react';
|
|
9
|
+
import { RestartIcon } from '@datalayer/icons-react';
|
|
10
|
+
export const KernelActionMenu = (props) => {
|
|
11
|
+
const { kernel, outputAdapter } = props;
|
|
12
|
+
return (_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(IconButton, { "aria-labelledby": "", icon: KebabHorizontalIcon, variant: "invisible" }) }), _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { children: [kernel && (_jsxs(ActionList.Item, { onSelect: e => {
|
|
13
|
+
kernel.interrupt();
|
|
14
|
+
}, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(StopIcon, {}) }), "Interrupt kernel"] })), kernel && (_jsxs(ActionList.Item, { onSelect: e => {
|
|
15
|
+
kernel.restart();
|
|
16
|
+
}, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(RestartIcon, {}) }), "Restart kernel"] })), outputAdapter && (_jsxs(ActionList.Item, { variant: "danger", onSelect: e => {
|
|
17
|
+
outputAdapter.clear();
|
|
18
|
+
}, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(PaintbrushIcon, {}) }), "Clear outputs"] }))] }) })] }));
|
|
19
|
+
};
|
|
20
|
+
export default KernelActionMenu;
|
|
21
|
+
//# sourceMappingURL=KernelActionMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KernelActionMenu.js","sourceRoot":"","sources":["../../../src/components/kernel/KernelActionMenu.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EACL,mBAAmB,EACnB,QAAQ,EACR,cAAc,GACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AASrD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAY,EAAE,EAAE;IAC/C,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IACxC,OAAO,CACL,MAAC,UAAU,eACT,KAAC,UAAU,CAAC,MAAM,cAChB,KAAC,UAAU,uBACO,EAAE,EAClB,IAAI,EAAE,mBAAmB,EACzB,OAAO,EAAC,WAAW,GACnB,GACgB,EACpB,KAAC,UAAU,CAAC,OAAO,cACjB,MAAC,UAAU,eACR,MAAM,IAAI,CACT,MAAC,UAAU,CAAC,IAAI,IACd,QAAQ,EAAE,CAAC,CAAC,EAAE;gCACZ,MAAM,CAAC,SAAS,EAAE,CAAC;4BACrB,CAAC,aAED,KAAC,UAAU,CAAC,aAAa,cACvB,KAAC,QAAQ,KAAG,GACa,wBAEX,CACnB,EACA,MAAM,IAAI,CACT,MAAC,UAAU,CAAC,IAAI,IACd,QAAQ,EAAE,CAAC,CAAC,EAAE;gCACZ,MAAM,CAAC,OAAO,EAAE,CAAC;4BACnB,CAAC,aAED,KAAC,UAAU,CAAC,aAAa,cACvB,KAAC,WAAW,KAAG,GACU,sBAEX,CACnB,EACA,aAAa,IAAI,CAChB,MAAC,UAAU,CAAC,IAAI,IACd,OAAO,EAAC,QAAQ,EAChB,QAAQ,EAAE,CAAC,CAAC,EAAE;gCACZ,aAAa,CAAC,KAAK,EAAE,CAAC;4BACxB,CAAC,aAED,KAAC,UAAU,CAAC,aAAa,cACvB,KAAC,cAAc,KAAG,GACO,qBAEX,CACnB,IACU,GACM,IACV,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
import Lumino from '../lumino/Lumino';
|
|
9
|
+
import { KernelSpyView } from './inspector/widget';
|
|
10
|
+
import { Box } from '@primer/react';
|
|
11
|
+
export const KernelInspector = (props) => {
|
|
12
|
+
const { kernel } = props;
|
|
13
|
+
const [kernelSpyView, setKernelSpyView] = useState();
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
kernel?.ready.then(() => {
|
|
16
|
+
const kernelSpyView = new KernelSpyView(kernel?.connection);
|
|
17
|
+
setKernelSpyView(kernelSpyView);
|
|
18
|
+
});
|
|
19
|
+
}, [kernel]);
|
|
20
|
+
return kernelSpyView ? (_jsx(Box, { sx: {
|
|
21
|
+
'& dla-KernelInspector-view': {
|
|
22
|
+
height: '1000px',
|
|
23
|
+
},
|
|
24
|
+
'& .dla-KernelInspector-messagelog': {
|
|
25
|
+
height: '100px',
|
|
26
|
+
minHeight: '100px',
|
|
27
|
+
},
|
|
28
|
+
}, children: _jsx(Lumino, { children: kernelSpyView }) })) : (_jsx(_Fragment, {}));
|
|
29
|
+
};
|
|
30
|
+
export default KernelInspector;
|
|
31
|
+
//# sourceMappingURL=KernelInspector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KernelInspector.js","sourceRoot":"","sources":["../../../src/components/kernel/KernelInspector.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAMpC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAY,EAAE,EAAE;IAC9C,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,EAAiB,CAAC;IACpE,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YACtB,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YAC5D,gBAAgB,CAAC,aAAa,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACb,OAAO,aAAa,CAAC,CAAC,CAAC,CACrB,KAAC,GAAG,IACF,EAAE,EAAE;YACF,4BAA4B,EAAE;gBAC5B,MAAM,EAAE,QAAQ;aACjB;YACD,mCAAmC,EAAE;gBACnC,MAAM,EAAE,OAAO;gBACf,SAAS,EAAE,OAAO;aACnB;SACF,YAED,KAAC,MAAM,cAAE,aAAa,GAAU,GAC5B,CACP,CAAC,CAAC,CAAC,CACF,mBAAK,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
export const KernelLauncher = () => {
|
|
8
|
+
return _jsx(_Fragment, {});
|
|
9
|
+
};
|
|
10
|
+
export default KernelLauncher;
|
|
11
|
+
//# sourceMappingURL=KernelLauncher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KernelLauncher.js","sourceRoot":"","sources":["../../../src/components/kernel/KernelLauncher.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE;IACjC,OAAO,mBAAK,CAAC;AACf,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
export const KernelLogs = () => {
|
|
8
|
+
return _jsx(_Fragment, {});
|
|
9
|
+
};
|
|
10
|
+
export default KernelLogs;
|
|
11
|
+
//# sourceMappingURL=KernelLogs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KernelLogs.js","sourceRoot":"","sources":["../../../src/components/kernel/KernelLogs.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC7B,OAAO,mBAAK,CAAC;AACf,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
import { ProgressBar } from '@primer/react';
|
|
9
|
+
export const KernelProgressBar = () => {
|
|
10
|
+
const [progress, setProgress] = useState(0);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const interval = setInterval(() => {
|
|
13
|
+
setProgress((oldValue) => {
|
|
14
|
+
let newValue = oldValue + 1;
|
|
15
|
+
if (newValue > 100) {
|
|
16
|
+
newValue = 0;
|
|
17
|
+
}
|
|
18
|
+
return newValue;
|
|
19
|
+
});
|
|
20
|
+
}, 100);
|
|
21
|
+
return () => clearInterval(interval);
|
|
22
|
+
}, []);
|
|
23
|
+
return _jsx(ProgressBar, { progress: progress, barSize: "small" });
|
|
24
|
+
};
|
|
25
|
+
export default KernelProgressBar;
|
|
26
|
+
//# sourceMappingURL=KernelProgressBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KernelProgressBar.js","sourceRoot":"","sources":["../../../src/components/kernel/KernelProgressBar.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;YAChC,WAAW,CAAC,CAAC,QAAgB,EAAE,EAAE;gBAC/B,IAAI,QAAQ,GAAG,QAAQ,GAAG,CAAC,CAAC;gBAC5B,IAAI,QAAQ,GAAG,GAAG,EAAE;oBAClB,QAAQ,GAAG,CAAC,CAAC;iBACd;gBACD,OAAO,QAAQ,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,GAAG,CAAC,CAAC;QACR,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,KAAC,WAAW,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAC,OAAO,GAAG,CAAC;AAC7D,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IModel } from '@jupyterlab/services/lib/kernel/kernel';
|
|
2
|
+
import { ISpecModel } from '@jupyterlab/services/lib/kernelspec/kernelspec';
|
|
3
|
+
type Props = {
|
|
4
|
+
selectKernel: (kernelModel: IModel) => void;
|
|
5
|
+
selectKernelSpec: (kernelSpecModel: ISpecModel) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const KernelSelector: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default KernelSelector;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
import { ActionMenu, ActionList, IconButton } from '@primer/react';
|
|
9
|
+
import { JupyterKernelIcon, JupyterKernelGalileoIcon, } from '@datalayer/icons-react';
|
|
10
|
+
import { useJupyter } from '../../jupyter/JupyterContext';
|
|
11
|
+
export const KernelSelector = (props) => {
|
|
12
|
+
const { selectKernel, selectKernelSpec } = props;
|
|
13
|
+
const { serviceManager } = useJupyter();
|
|
14
|
+
const [kernels, setKernels] = useState();
|
|
15
|
+
const [kernelSpecs, setKernelSpecs] = useState();
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
serviceManager?.ready.then(() => {
|
|
18
|
+
serviceManager.kernelspecs.refreshSpecs().then(() => {
|
|
19
|
+
const kernelSpecs = serviceManager.kernelspecs.specs?.kernelspecs;
|
|
20
|
+
setKernelSpecs(kernelSpecs);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
serviceManager?.kernels.refreshRunning().then(() => {
|
|
24
|
+
const kernels = Array.from(serviceManager.kernels.running());
|
|
25
|
+
setKernels(kernels);
|
|
26
|
+
});
|
|
27
|
+
}, [serviceManager]);
|
|
28
|
+
return (_jsx(_Fragment, { children: _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(IconButton, { "aria-labelledby": "", icon: JupyterKernelGalileoIcon, variant: "invisible" }) }), _jsx(ActionMenu.Overlay, { width: "large", children: _jsxs(ActionList, { showDividers: true, children: [kernels && (_jsx(ActionList.Group, { title: "Connect to a running Kernel", children: kernels.map(kernel => {
|
|
29
|
+
return (_jsxs(ActionList.Item, { onSelect: e => {
|
|
30
|
+
selectKernel(kernel);
|
|
31
|
+
}, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(JupyterKernelIcon, {}) }), kernel.name, _jsx(ActionList.Description, { variant: "block", children: kernel.id })] }));
|
|
32
|
+
}) })), _jsx(ActionList.Group, { title: "Launch a new Kernel", children: kernelSpecs &&
|
|
33
|
+
Object.values(kernelSpecs).map(specModel => {
|
|
34
|
+
return (_jsxs(ActionList.Item, { onSelect: e => {
|
|
35
|
+
selectKernelSpec(specModel);
|
|
36
|
+
}, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(JupyterKernelGalileoIcon, {}) }), specModel?.name, _jsx(ActionList.Description, { variant: "block", children: specModel?.display_name })] }));
|
|
37
|
+
}) })] }) })] }) }));
|
|
38
|
+
};
|
|
39
|
+
export default KernelSelector;
|
|
40
|
+
//# sourceMappingURL=KernelSelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KernelSelector.js","sourceRoot":"","sources":["../../../src/components/kernel/KernelSelector.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAa1D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAY,EAAE,EAAE;IAC7C,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAC;IACjD,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,EAAE,CAAC;IACxC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAY,CAAC;IACnD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,EAAe,CAAC;IAC9D,SAAS,CAAC,GAAG,EAAE;QACb,cAAc,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YAC9B,cAAc,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;gBAClD,MAAM,WAAW,GAAG,cAAc,CAAC,WA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,SAAS,CAAC,EAAE;wCACzC,OAAO,CACL,MAAC,UAAU,CAAC,IAAI,IACd,QAAQ,EAAE,CAAC,CAAC,EAAE;gDACZ,gBAAgB,CAAC,SAAU,CAAC,CAAC;4CAC/B,CAAC,aAED,KAAC,UAAU,CAAC,aAAa,cACvB,KAAC,wBAAwB,KAAG,GACH,EAC1B,SAAS,EAAE,IAAI,EAChB,KAAC,UAAU,CAAC,WAAW,IAAC,OAAO,EAAC,OAAO,YACpC,SAAS,EAAE,YAAY,GACD,IACT,CACnB,CAAC;oCACJ,CAAC,CAAC,GACa,IACR,GACM,IACV,GACZ,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import Kernel from '../../jupyter/kernel/Kernel';
|
|
3
|
+
type KernelState = string;
|
|
4
|
+
/**
|
|
5
|
+
* The valid kernel connection states.
|
|
6
|
+
*
|
|
7
|
+
* #### Notes
|
|
8
|
+
* The status states are:
|
|
9
|
+
* * `connected`: The kernel connection is live.
|
|
10
|
+
* * `connecting`: The kernel connection is not live, but we are attempting
|
|
11
|
+
* to reconnect to the kernel.
|
|
12
|
+
* * `disconnected`: The kernel connection is permanently down, we will not
|
|
13
|
+
* try to reconnect.
|
|
14
|
+
*
|
|
15
|
+
* When a kernel connection is `connected`, the kernel status should be
|
|
16
|
+
* valid. When a kernel connection is either `connecting` or `disconnected`,
|
|
17
|
+
* the kernel status will be `unknown` unless the kernel status was `dead`,
|
|
18
|
+
* in which case it stays `dead`.
|
|
19
|
+
*
|
|
20
|
+
* Status = 'unknown' | 'starting' | 'idle' | 'busy' | 'terminating' | 'restarting' | 'autorestarting' | 'dead';
|
|
21
|
+
*/
|
|
22
|
+
export declare const KERNEL_STATES: Map<KernelState, ReactElement>;
|
|
23
|
+
type Props = {
|
|
24
|
+
kernel?: Kernel;
|
|
25
|
+
};
|
|
26
|
+
export declare const KernelStatus: (props: Props) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export default KernelStatus;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
import { Tooltip } from '@primer/react';
|
|
9
|
+
import { CircleYellowIcon, CircleGreenIcon, CircleBlackIcon, CircleBrownIcon, CircleHollowRedIcon, CircleOrangeIcon, CirclePurpleIcon, CircleRedIcon, CircleWhiteIcon, CircledMIcon, SquareWhiteLargeIcon, } from '@datalayer/icons-react';
|
|
10
|
+
/**
|
|
11
|
+
* The valid kernel connection states.
|
|
12
|
+
*
|
|
13
|
+
* #### Notes
|
|
14
|
+
* The status states are:
|
|
15
|
+
* * `connected`: The kernel connection is live.
|
|
16
|
+
* * `connecting`: The kernel connection is not live, but we are attempting
|
|
17
|
+
* to reconnect to the kernel.
|
|
18
|
+
* * `disconnected`: The kernel connection is permanently down, we will not
|
|
19
|
+
* try to reconnect.
|
|
20
|
+
*
|
|
21
|
+
* When a kernel connection is `connected`, the kernel status should be
|
|
22
|
+
* valid. When a kernel connection is either `connecting` or `disconnected`,
|
|
23
|
+
* the kernel status will be `unknown` unless the kernel status was `dead`,
|
|
24
|
+
* in which case it stays `dead`.
|
|
25
|
+
*
|
|
26
|
+
* Status = 'unknown' | 'starting' | 'idle' | 'busy' | 'terminating' | 'restarting' | 'autorestarting' | 'dead';
|
|
27
|
+
*/
|
|
28
|
+
export const KERNEL_STATES = new Map([
|
|
29
|
+
['connecting', _jsx(CircleBlackIcon, {})],
|
|
30
|
+
['connected-unknown', _jsx(CircledMIcon, {})],
|
|
31
|
+
['connected-starting', _jsx(CircleYellowIcon, {})],
|
|
32
|
+
['connected-idle', _jsx(CircleGreenIcon, {})],
|
|
33
|
+
['connected-busy', _jsx(CircleOrangeIcon, {})],
|
|
34
|
+
['connected-terminating', _jsx(CircleWhiteIcon, {})],
|
|
35
|
+
['connected-restarting', _jsx(CirclePurpleIcon, {})],
|
|
36
|
+
['connected-autorestarting', _jsx(CircleHollowRedIcon, {})],
|
|
37
|
+
['connected-dead', _jsx(CircleRedIcon, {})],
|
|
38
|
+
['disconnecting', _jsx(CircleBrownIcon, {})],
|
|
39
|
+
['undefined', _jsx(SquareWhiteLargeIcon, {})],
|
|
40
|
+
]);
|
|
41
|
+
export const KernelStatus = (props) => {
|
|
42
|
+
const { kernel } = props;
|
|
43
|
+
const [connectionStatus, setConnectionStatus] = useState();
|
|
44
|
+
const [status, setStatus] = useState();
|
|
45
|
+
const toState = (connectionStatus, status) => {
|
|
46
|
+
if (connectionStatus === 'connecting' ||
|
|
47
|
+
connectionStatus === 'disconnected') {
|
|
48
|
+
return connectionStatus;
|
|
49
|
+
}
|
|
50
|
+
return connectionStatus + '-' + status;
|
|
51
|
+
};
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (kernel && kernel.connection) {
|
|
54
|
+
setConnectionStatus(kernel.connection?.connectionStatus);
|
|
55
|
+
setStatus(kernel.connection?.status);
|
|
56
|
+
kernel.connection.connectionStatusChanged.connect((_, connectionStatus) => {
|
|
57
|
+
setConnectionStatus(connectionStatus);
|
|
58
|
+
});
|
|
59
|
+
kernel.connection.statusChanged.connect((_, status) => {
|
|
60
|
+
setStatus(status);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}, [kernel, kernel?.connection]);
|
|
64
|
+
return connectionStatus && status ? (_jsx(Tooltip, { "aria-label": `${connectionStatus} - ${status}`, children: KERNEL_STATES.get(toState(connectionStatus, status)) })) : (_jsx(Tooltip, { "aria-label": "Undefined state", children: KERNEL_STATES.get('undefined') }));
|
|
65
|
+
};
|
|
66
|
+
export default KernelStatus;
|
|
67
|
+
//# sourceMappingURL=KernelStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
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e,YAAY,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
import { useInterval } from 'usehooks-ts';
|
|
9
|
+
import { Sparklines, SparklinesLine, SparklinesSpots, SparklinesBars, } from 'react-sparklines';
|
|
10
|
+
import { Text, Box } from '@primer/react';
|
|
11
|
+
const MAX_ITEMS = 20;
|
|
12
|
+
const REQUEST_USAGE = `
|
|
13
|
+
import psutil
|
|
14
|
+
|
|
15
|
+
processes: dict[str, psutil.Process] = {}
|
|
16
|
+
|
|
17
|
+
def get_process_metric_value(self, process, name, attribute=None):
|
|
18
|
+
"""Get the process metric value."""
|
|
19
|
+
try:
|
|
20
|
+
metric_value = getattr(process, name)()
|
|
21
|
+
if attribute is not None: # ... a named tuple
|
|
22
|
+
return getattr(metric_value, attribute)
|
|
23
|
+
# ... or a number
|
|
24
|
+
return metric_value
|
|
25
|
+
# Avoid littering logs with stack traces
|
|
26
|
+
# complaining about dead processes
|
|
27
|
+
except BaseException:
|
|
28
|
+
return 0
|
|
29
|
+
|
|
30
|
+
current_process = psutil.Process()
|
|
31
|
+
all_processes = [current_process, *current_process.children(recursive=True)]
|
|
32
|
+
# Ensure 1) self.processes is updated to only current subprocesses
|
|
33
|
+
# and 2) we reuse processes when possible (needed for accurate CPU)
|
|
34
|
+
processes = {
|
|
35
|
+
process.pid: processes.get(process.pid, process) # type:ignore[misc,call-overload]
|
|
36
|
+
for process in all_processes
|
|
37
|
+
}
|
|
38
|
+
kernel_cpu = sum(
|
|
39
|
+
[
|
|
40
|
+
get_process_metric_value(process, "cpu_percent", None)
|
|
41
|
+
for process in processes.values()
|
|
42
|
+
]
|
|
43
|
+
)
|
|
44
|
+
mem_info_type = "pss" if hasattr(current_process.memory_full_info(), "pss") else "rss"
|
|
45
|
+
kernel_memory = sum(
|
|
46
|
+
[
|
|
47
|
+
get_process_metric_value(process, "memory_full_info", mem_info_type)
|
|
48
|
+
for process in processes.values()
|
|
49
|
+
]
|
|
50
|
+
)
|
|
51
|
+
cpu_percent = psutil.cpu_percent()
|
|
52
|
+
# https://psutil.readthedocs.io/en/latest/index.html?highlight=cpu#psutil.cpu_percent
|
|
53
|
+
# The first time cpu_percent is called it will return a meaningless 0.0 value which you are supposed to ignore.
|
|
54
|
+
if cpu_percent is not None and cpu_percent != 0.0: # type:ignore[redundant-expr]
|
|
55
|
+
host_cpu_percent = cpu_percent
|
|
56
|
+
|
|
57
|
+
cpu_count = psutil.cpu_count(logical=True)
|
|
58
|
+
host_virtual_memory = dict(psutil.virtual_memory()._asdict())
|
|
59
|
+
|
|
60
|
+
print(f"""{{
|
|
61
|
+
"kernel_cpu": "{kernel_cpu}",
|
|
62
|
+
"cpu_count": "{cpu_count}",
|
|
63
|
+
"host_virtual_memory": {str(host_virtual_memory)}
|
|
64
|
+
}}""")
|
|
65
|
+
`;
|
|
66
|
+
export const KernelUsage = (props) => {
|
|
67
|
+
const { kernel } = props;
|
|
68
|
+
const [usage, setUsage] = useState({});
|
|
69
|
+
const [virtualMemoryTotal, setVirtualMemoryTotal] = useState();
|
|
70
|
+
const [virtualMemoryAvailable, setVirtualMemoryAvailable] = useState(new Array());
|
|
71
|
+
// { "kernel_cpu": "0", "cpu_count": "4", "host_virtual_memory": {"total": 15335940096, "available": 13279002624, "percent": 13.4, "used": 1704222720, "free": 11412717568, "active": 696995840, "inactive": 2084093952, "buffers": 237412352, "cached": 1981587456, "shared": 4796416, "slab": 989294592} }
|
|
72
|
+
const refreshUsage = async () => {
|
|
73
|
+
const result = await kernel.execute(REQUEST_USAGE)?.result;
|
|
74
|
+
if (result) {
|
|
75
|
+
const usage = JSON.parse(result.replaceAll("'", '"'));
|
|
76
|
+
const v = virtualMemoryAvailable.concat([
|
|
77
|
+
usage['host_virtual_memory']['available'] / 1000,
|
|
78
|
+
]);
|
|
79
|
+
if (v.length > MAX_ITEMS) {
|
|
80
|
+
v.shift();
|
|
81
|
+
}
|
|
82
|
+
setVirtualMemoryAvailable(v);
|
|
83
|
+
setVirtualMemoryTotal(usage['host_virtual_memory']['total'] / 1000);
|
|
84
|
+
setUsage(usage);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
kernel?.ready.then(async () => {
|
|
89
|
+
refreshUsage();
|
|
90
|
+
});
|
|
91
|
+
}, [kernel]);
|
|
92
|
+
useInterval(() => {
|
|
93
|
+
if (usage) {
|
|
94
|
+
refreshUsage();
|
|
95
|
+
}
|
|
96
|
+
}, 1000);
|
|
97
|
+
return usage ? (_jsxs(Box, { children: [_jsx(Box, { children: _jsx(Text, { children: "Virtual Memory Available" }) }), _jsx(Box, { children: _jsxs(Sparklines, { data: virtualMemoryAvailable, limit: MAX_ITEMS, svgHeight: 100, svgWidth: 200, min: 0, max: virtualMemoryTotal, children: [_jsx(SparklinesBars, { style: { stroke: 'white', fill: '#41c3f9', fillOpacity: '.25' } }), _jsx(SparklinesLine, { style: { stroke: '#41c3f9', fill: 'none' } }), _jsx(SparklinesSpots, {})] }) })] })) : (_jsx(_Fragment, {}));
|
|
98
|
+
};
|
|
99
|
+
export default KernelUsage;
|
|
100
|
+
//# sourceMappingURL=KernelUsage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KernelUsage.js","sourceRoot":"","sources":["../../../src/components/kernel/KernelUsage.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,kBAAkB,CAA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CAAC,CAAC;IACF,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;YAC5B,YAAY,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACb,WAAW,CAAC,GAAG,EAAE;QACf,IAAI,KAAK,EAAE;YACT,YAAY,EAAE,CAAC;SAChB;IACH,CAAC,EAAE,IAAI,CAAC,CAAC;IACT,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,MAAC,GAAG,eACF,KAAC,GAAG,cACF,KAAC,IAAI,2CAAgC,GACjC,EACN,KAAC,GAAG,cACF,MAAC,UAAU,IACT,IAAI,EAAE,sBAAsB,EAC5B,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,GAAG,EACd,QAAQ,EAAE,GAAG,EACb,GAAG,EAAE,CAAC,EACN,GAAG,EAAE,kBAAkB,aAEvB,KAAC,cAAc,IACb,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,GAC/D,EACF,KAAC,cAAc,IAAC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAI,EAC9D,KAAC,eAAe,KAAG,IACR,GACT,IACF,CACP,CAAC,CAAC,CAAC,CACF,mBAAK,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
import Lumino from '../lumino/Lumino';
|
|
9
|
+
import { createVariablesInspectorManager, registerKernel, } from './variables/variablesinspector';
|
|
10
|
+
export const KernelVariables = (props) => {
|
|
11
|
+
const { kernel } = props;
|
|
12
|
+
const [panel, setPanel] = useState();
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
kernel?.ready.then(() => {
|
|
15
|
+
const manager = createVariablesInspectorManager();
|
|
16
|
+
setPanel(manager.panel);
|
|
17
|
+
registerKernel(manager, kernel);
|
|
18
|
+
});
|
|
19
|
+
}, [kernel]);
|
|
20
|
+
return panel ? _jsx(Lumino, { children: panel }) : _jsx(_Fragment, {});
|
|
21
|
+
};
|
|
22
|
+
export default KernelVariables;
|
|
23
|
+
//# sourceMappingURL=KernelVariables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KernelVariables.js","sourceRoot":"","sources":["../../../src/components/kernel/KernelVariables.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,EACL,+BAA+B,EAC/B,cAAc,GACf,MAAM,gCAAgC,CAAC;AAOxC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAY,EAAE,EAAE;IAC9C,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAA0B,CAAC;IAC7D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YACtB,MAAM,OAAO,GAAG,+BAA+B,EAAE,CAAC;YAClD,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;YACxB,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACb,OAAO,KAAK,CAAC,CAAC,CAAC,KAAC,MAAM,cAAE,KAAK,GAAU,CAAC,CAAC,CAAC,mBAAK,CAAC;AAClD,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
4
|
+
*
|
|
5
|
+
* MIT License
|
|
6
|
+
*/
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
import { Table, DataTable, Blankslate } from '@primer/react/drafts';
|
|
9
|
+
import { Box, Text, IconButton, Spinner } from '@primer/react';
|
|
10
|
+
import { CrossMarkIcon, JupyterIcon, NotebookIcon, } from '@datalayer/icons-react';
|
|
11
|
+
import { JSONExt } from '@lumino/coreutils';
|
|
12
|
+
import { useJupyter } from '../../jupyter/JupyterContext';
|
|
13
|
+
export const Kernels = () => {
|
|
14
|
+
const { serviceManager } = useJupyter();
|
|
15
|
+
const [kernels, setKernels] = useState();
|
|
16
|
+
const [kernelSpecInfos, setKernelSpecInfos] = useState(new Map());
|
|
17
|
+
const refreshKernels = (serviceManager) => {
|
|
18
|
+
setKernels(Array.from(serviceManager.kernels.running()));
|
|
19
|
+
};
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
serviceManager?.kernels.refreshRunning().then(() => {
|
|
22
|
+
const kernels = Array.from(serviceManager.kernels.running());
|
|
23
|
+
setKernels(kernels);
|
|
24
|
+
});
|
|
25
|
+
serviceManager?.kernelspecs.refreshSpecs().then(() => {
|
|
26
|
+
const kernelSpecs = Object.values(serviceManager.kernelspecs.specs.kernelspecs);
|
|
27
|
+
// Look for new kernel specifications
|
|
28
|
+
const newSpecs = new Map();
|
|
29
|
+
kernelSpecs.forEach(kernelSpec => {
|
|
30
|
+
const kernelSpecName = kernelSpec?.name;
|
|
31
|
+
if (kernelSpecName?.startsWith('run-')) {
|
|
32
|
+
const metadata = kernelSpec?.metadata;
|
|
33
|
+
if (metadata) {
|
|
34
|
+
const oldInfo = kernelSpecInfos.get(kernelSpecName);
|
|
35
|
+
const newInfo = {
|
|
36
|
+
description: metadata['description'],
|
|
37
|
+
notebookExampleUrl: metadata['notebook_example_url'],
|
|
38
|
+
};
|
|
39
|
+
if (!JSONExt.deepEqual(oldInfo ?? {}, newInfo)) {
|
|
40
|
+
newSpecs.set(kernelSpecName, newInfo);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
const newSpecInfos = new Map([...kernelSpecInfos, ...newSpecs]);
|
|
46
|
+
if (newSpecs.size) {
|
|
47
|
+
setKernelSpecInfos(newSpecInfos);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}, [serviceManager]);
|
|
51
|
+
const deleteKernel = (serviceManager, kernelId) => {
|
|
52
|
+
serviceManager.kernels.shutdown(kernelId).then(() => {
|
|
53
|
+
console.log(`Kernel ${kernelId} is terminated.`);
|
|
54
|
+
refreshKernels(serviceManager);
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
return (_jsx(Box, { mt: 3, style: { width: '1000px' }, children: kernels ? (_jsxs(Table.Container, { children: [_jsx(Table.Title, { as: "h2", id: "images", children: "Kernels" }), _jsx(Table.Subtitle, { as: "p", id: "images-subtitle", children: "Available kernels." }), _jsx(DataTable, { "aria-labelledby": "running-kernels", "aria-describedby": "running-kernels-subtitle", data: kernels, columns: [
|
|
58
|
+
{
|
|
59
|
+
header: 'Name',
|
|
60
|
+
field: 'name',
|
|
61
|
+
renderCell: row => _jsx(Text, { children: row.name }),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
header: 'Description',
|
|
65
|
+
id: 'description',
|
|
66
|
+
renderCell: row => (_jsx(Text, { children: kernelSpecInfos.get(row.name)?.description })),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
header: 'State',
|
|
70
|
+
field: 'execution_state',
|
|
71
|
+
renderCell: row => _jsx(Text, { children: row.execution_state }),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
header: 'Example',
|
|
75
|
+
id: 'example-action',
|
|
76
|
+
renderCell: row => (_jsx(_Fragment, { children: _jsx(IconButton, { "aria-label": `Create an example notebook for kernel ${row.name}`, icon: NotebookIcon, size: "small", onClick: () => { } }) })),
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
header: 'Delete',
|
|
80
|
+
id: 'delete-action',
|
|
81
|
+
renderCell: row => (_jsx(_Fragment, { children: _jsx(IconButton, { "aria-label": `Delete the kernel ${row.name}`, icon: CrossMarkIcon, size: "small", onClick: () => {
|
|
82
|
+
deleteKernel(serviceManager, row.id);
|
|
83
|
+
} }) })),
|
|
84
|
+
},
|
|
85
|
+
] })] })) : (_jsxs(Blankslate, { border: true, children: [_jsx(Blankslate.Visual, { children: _jsx(JupyterIcon, { size: "medium" }) }), _jsx(Blankslate.Heading, { children: "Kernels" }), _jsx(Blankslate.Description, { children: _jsxs(Box, { sx: { textAlign: 'center' }, children: [_jsx(Box, { children: _jsx(Spinner, {}) }), _jsx(Box, { children: "No kernel found so far..." })] }) })] })) }));
|
|
86
|
+
};
|
|
87
|
+
export default Kernels;
|
|
88
|
+
//# sourceMappingURL=Kernels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Kernels.js","sourceRoot":"","sources":["../../../src/components/kernel/Kernels.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EACL,aAAa,EACb,WAAW,EACX,YAAY,GACb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE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H,CACJ;yBACF;qBACF,GACD,IACc,CACnB,CAAC,CAAC,CAAC,CACF,MAAC,UAAU,IAAC,MAAM,mBAChB,KAAC,UAAU,CAAC,MAAM,cAChB,KAAC,WAAW,IAAC,IAAI,EAAC,QAAQ,GAAG,GACX,EACpB,KAAC,UAAU,CAAC,OAAO,0BAA6B,EAChD,KAAC,UAAU,CAAC,WAAW,cACrB,MAAC,GAAG,IAAC,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,aAC9B,KAAC,GAAG,cACF,KAAC,OAAO,KAAG,GACP,EACN,KAAC,GAAG,4CAAgC,IAChC,GACiB,IACd,CACd,GACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './KernelActionMenu';
|
|
2
|
+
export * from './KernelInspector';
|
|
3
|
+
export * from './KernelLogs';
|
|
4
|
+
export * from './KernelLauncher';
|
|
5
|
+
export * from './KernelProgressBar';
|
|
6
|
+
export * from './Kernels';
|
|
7
|
+
export * from './KernelSelector';
|
|
8
|
+
export * from './KernelStatus';
|
|
9
|
+
export * from './KernelUsage';
|
|
10
|
+
export * from './KernelVariables';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*/
|
|
6
|
+
export * from './KernelActionMenu';
|
|
7
|
+
export * from './KernelInspector';
|
|
8
|
+
export * from './KernelLogs';
|
|
9
|
+
export * from './KernelLauncher';
|
|
10
|
+
export * from './KernelProgressBar';
|
|
11
|
+
export * from './Kernels';
|
|
12
|
+
export * from './KernelSelector';
|
|
13
|
+
export * from './KernelStatus';
|
|
14
|
+
export * from './KernelUsage';
|
|
15
|
+
export * from './KernelVariables';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/kernel/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC"}
|