From 69790c3742bfdab4dbaa08c5331060e1a35c0834 Mon Sep 17 00:00:00 2001 From: xuwenyihust Date: Sun, 9 Jun 2024 23:51:11 +0800 Subject: [PATCH] Refactor notebook code to fix syntax errors and update components --- examples/notebook.ipynb | 23 ++++++++++++------- resources/images/logo_black.svg | 1 + webapp/src/assets/logo_#333.svg | 2 +- .../notebook/cell/header/CellHeader.js | 3 ++- webapp/src/components/sidebar/Sidebar.js | 22 ++++++++++++++---- 5 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 resources/images/logo_black.svg diff --git a/examples/notebook.ipynb b/examples/notebook.ipynb index 3b6a0b3..24ba274 100644 --- a/examples/notebook.ipynb +++ b/examples/notebook.ipynb @@ -10,11 +10,18 @@ "# My Notebook" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, { "cell_type": "code", "execution_count": 1, - "lastExecutionResult": "error", - "lastExecutionTime": "2024-06-09 15:24:10", + "lastExecutionResult": null, + "lastExecutionTime": null, "metadata": {}, "outputs": [ { @@ -36,8 +43,8 @@ { "cell_type": "code", "execution_count": null, - "lastExecutionResult": "success", - "lastExecutionTime": "2024-06-09 15:24:15", + "lastExecutionResult": null, + "lastExecutionTime": null, "metadata": {}, "outputs": [], "source": [ @@ -48,8 +55,8 @@ { "cell_type": "code", "execution_count": null, - "lastExecutionResult": "success", - "lastExecutionTime": "2024-06-09 15:24:15", + "lastExecutionResult": null, + "lastExecutionTime": null, "metadata": {}, "outputs": [ { @@ -67,8 +74,8 @@ { "cell_type": "code", "execution_count": null, - "lastExecutionResult": "success", - "lastExecutionTime": "2024-06-09 15:24:15", + "lastExecutionResult": null, + "lastExecutionTime": null, "metadata": {}, "outputs": [], "source": [] diff --git a/resources/images/logo_black.svg b/resources/images/logo_black.svg new file mode 100644 index 0000000..f73e642 --- /dev/null +++ b/resources/images/logo_black.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webapp/src/assets/logo_#333.svg b/webapp/src/assets/logo_#333.svg index 141b564..f73e642 100644 --- a/webapp/src/assets/logo_#333.svg +++ b/webapp/src/assets/logo_#333.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/webapp/src/components/notebook/cell/header/CellHeader.js b/webapp/src/components/notebook/cell/header/CellHeader.js index fb927d6..be7ae68 100644 --- a/webapp/src/components/notebook/cell/header/CellHeader.js +++ b/webapp/src/components/notebook/cell/header/CellHeader.js @@ -40,7 +40,8 @@ function CellHeader({ cell.lastExecutionResult === null ? null : (cell.lastExecutionResult === CellExecuteResultType.SUCCESS ? : - )} + (cell.lastExecutionResult === CellExecuteResultType.ERROR ? + : null))} {cellStatus === CellStatus.IDLE && + height: '80px', + width: '160px' }} /> @@ -98,7 +98,10 @@ function Sidebar({ @@ -111,7 +114,7 @@ function Sidebar({ fontFamily: 'Roboto', fontSize: '15px', color: 'lightgrey', - marginLeft: '-30px' + marginLeft: '-30px' }}> Create @@ -131,6 +134,9 @@ function Sidebar({ sx={{ '&:hover': { backgroundColor: '#555' + }, + '&:hover .MuiTypography-root': { + color: 'white', } }}> @@ -168,6 +174,9 @@ function Sidebar({ sx={{ '&:hover': { backgroundColor: '#555' + }, + '&:hover .MuiTypography-root': { + color: 'white', } }}> @@ -191,6 +200,9 @@ function Sidebar({ sx={{ '&:hover': { backgroundColor: '#555' + }, + '&:hover .MuiTypography-root': { + color: 'white', } }}>