-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update notebook execution timestamps and fix styling in TextResult.js (…
- Loading branch information
1 parent
c3dc8c3
commit 48013eb
Showing
24 changed files
with
250 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
import Cell from './cell/Cell'; | ||
import NotebookModel from '../../../models/NotebookModel'; | ||
import NotebookToolbar from './NotebookToolbar'; | ||
import config from '../../../config'; | ||
import { Box, Button, Tooltip, Card } from '@mui/material'; | ||
|
||
const Code = ({ | ||
notebook, | ||
notebookState, | ||
cellStatuses, | ||
setCellStatus, | ||
cellExecutedStatuses, | ||
setCellExecutedStatus, | ||
handleChangeCell, | ||
handleDeleteCell, | ||
handleChangeCellType, | ||
handleMoveCell, | ||
handleRunCodeCell, | ||
handleCopyCell, | ||
handleCreateCell, | ||
kernelId, | ||
setKernelId, | ||
runAllCells, | ||
saveNotebook, | ||
deleteNotebook | ||
}) => { | ||
|
||
const jupyterBaseUrl= `${config.jupyterBaseUrl}` | ||
const baseUrl = `${jupyterBaseUrl}/api/contents/` | ||
|
||
return ( | ||
<Box sx={{ display: 'flex' }}> | ||
|
||
<NotebookToolbar | ||
notebook={notebook} | ||
runAllCells={runAllCells} | ||
saveNotebook={saveNotebook} | ||
deleteNotebook={deleteNotebook}/> | ||
|
||
<Box sx={{ | ||
width: '100%', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
marginTop: '50px', | ||
}}> | ||
{notebookState.content && | ||
notebookState.content.cells && | ||
notebookState.content.cells.map((cell, index) => ( | ||
<Box style={{ position: 'relative' }}> | ||
<Cell | ||
cell={cell} | ||
index={index} | ||
key={index} | ||
notebookState={notebookState} | ||
cellStatus={cellStatuses[index]} | ||
setCellStatus={status => setCellStatus(index, status)} | ||
cellExecutedStatus={cellExecutedStatuses[index]} | ||
setCellExecutedStatus={executed => setCellExecutedStatus(index, executed)} | ||
handleChangeCell={handleChangeCell} | ||
handleDeleteCell={handleDeleteCell} | ||
handleChangeCellType={handleChangeCellType} | ||
handleMoveCell={handleMoveCell} | ||
handleRunCodeCell={handleRunCodeCell} | ||
handleCopyCell={handleCopyCell} | ||
handelRunAllAboveCells={ | ||
(index) => NotebookModel.runAllAboveCells( | ||
index, | ||
jupyterBaseUrl, | ||
notebookState, | ||
kernelId, | ||
setKernelId, | ||
cellStatuses, | ||
setCellStatus, | ||
cellExecutedStatuses, | ||
setCellExecutedStatus)}/> | ||
<div | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'center'}}> | ||
<Tooltip title="Add Code Cell" | ||
sx={{fontSize: 11, | ||
color: "grey"}}> | ||
<Button onClick={() => handleCreateCell('code', index + 1)}> | ||
+ Code | ||
</Button> | ||
</Tooltip> | ||
<Tooltip title="Add Code Cell" | ||
sx={{fontSize: 11, | ||
color: "grey"}}> | ||
<Button onClick={() => handleCreateCell('markdown', index + 1)}> | ||
+ Markdown | ||
</Button> | ||
</Tooltip> | ||
</div> | ||
</Box> | ||
))}</Box> | ||
</Box> | ||
); | ||
} | ||
|
||
export default Code; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const ContentType = { | ||
CODE: 'code', | ||
Runs: 'runs', | ||
}; |
Oops, something went wrong.