Skip to content

Commit

Permalink
chore: kill script
Browse files Browse the repository at this point in the history
  • Loading branch information
echarles committed Sep 24, 2023
1 parent eb99ce8 commit 605111e
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 13 deletions.
10 changes: 0 additions & 10 deletions dev/sh/kill-webpack.sh

This file was deleted.

1 change: 1 addition & 0 deletions dev/sh/kill-jupyter-server.sh → dev/sh/kill.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ function kill_port() {
lsof -i TCP:$1 | grep LISTEN | awk '{print $2}' | xargs kill -9
}

kill_port 3063
kill_port 8686
kill_port 8888
2 changes: 2 additions & 0 deletions dev/sh/start-jupyter-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ echo

export CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

trap $CURR_DIR/kill.sh EXIT

jupyter server \
--config=${CURR_DIR}/../config/jupyter_server_config.py --autoreload
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"watch": "run-p watch:src watch:labextension",
"watch:src": "tsc -w",
"watch:labextension": "jupyter labextension watch .",
"kill": "./dev/sh/kill-jupyter-server.sh || true"
"kill": "./dev/sh/kill.sh || true"
},
"dependencies": {
"@datalayer/jupyter-react": "0.7.7",
Expand Down
4 changes: 2 additions & 2 deletions src/Datalayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState, useEffect } from 'react';
import { JupyterFrontEnd } from '@jupyterlab/application';
import { ThemeProvider, BaseStyles, Box, } from '@primer/react';
import { UnderlineNav } from '@primer/react/drafts';
import { DatalayerGreenIcon, JupyterBaseIcon } from '@datalayer/icons-react';
import { DatalayerGreenIcon, JupyterLabIcon } from '@datalayer/icons-react';
import AboutTab from './tabs/AboutTab';
import JupyterLabTab from './tabs/JupyterLabTab';
import { requestAPI } from './jupyterlab/handler';
Expand Down Expand Up @@ -33,7 +33,7 @@ const Datalayer = (props: JupyterFrontEndProps) => {
<Box>
<Box>
<UnderlineNav aria-label="datalayer">
<UnderlineNav.Item aria-label="jupyterlab" aria-current={tab === 1 ? "page" : undefined} icon={() => <JupyterBaseIcon colored/>} onSelect={e => {e.preventDefault(); setTab(1);}}>
<UnderlineNav.Item aria-label="jupyterlab" aria-current={tab === 1 ? "page" : undefined} icon={() => <JupyterLabIcon colored/>} onSelect={e => {e.preventDefault(); setTab(1);}}>
JupyterLab
</UnderlineNav.Item>
<UnderlineNav.Item aria-label="about" aria-current={tab === 2 ? "page" : undefined} icon={() => <DatalayerGreenIcon colored/>} onSelect={e => {e.preventDefault(); setTab(2);}}>
Expand Down
30 changes: 30 additions & 0 deletions src/DatalayerJupyterLab.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { createRoot } from 'react-dom/client';
import { Jupyter, JupyterLabApp, JupyterLabPluginsCore } from '@datalayer/jupyter-react';
import * as collaborationExtension from '@jupyter/collaboration-extension';
import * as datalayerExtension from './jupyterlab';

const { extensionsPromises, mimeExtensionsPromises } = JupyterLabPluginsCore;

const DatalayerJupyterLab = () => (
<JupyterLabApp
extensions={[
datalayerExtension,
collaborationExtension,
]}
extensionPromises={extensionsPromises}
mimeExtensionsPromises={mimeExtensionsPromises}
position="absolute"
hostId="jupyterlab-app-id"
height="100vh"
/>
)

const div = document.createElement('div');
document.body.appendChild(div);
const root = createRoot(div);

root.render(
<Jupyter startDefaultKernel={false} disableCssLoading={true}>
<DatalayerJupyterLab/>
</Jupyter>
);
Empty file added src/index.ts
Empty file.

0 comments on commit 605111e

Please sign in to comment.