diff --git a/src/components/molecules/RunContent.tsx b/src/components/molecules/RunContent.tsx index 8c493faf..5b219f16 100644 --- a/src/components/molecules/RunContent.tsx +++ b/src/components/molecules/RunContent.tsx @@ -7,7 +7,7 @@ import { TabPanel, TabContext } from "@mui/lab"; import SettingsIcon from '@mui/icons-material/Settings'; import ImageIcon from '@mui/icons-material/Image'; import ArticleIcon from '@mui/icons-material/Article'; -import {Buffer} from 'buffer'; +import { Buffer } from 'buffer'; import { useEffect } from "react"; import AssignmentIcon from '@mui/icons-material/Assignment'; @@ -19,7 +19,7 @@ interface RunContentProps { abortRunHandler: () => void, } -export const RunContent = ({row, currentLog, interpretationInProgress, logEndRef, abortRunHandler}: RunContentProps) => { +export const RunContent = ({ row, currentLog, interpretationInProgress, logEndRef, abortRunHandler }: RunContentProps) => { const [tab, setTab] = React.useState('log'); useEffect(() => { @@ -29,141 +29,142 @@ export const RunContent = ({row, currentLog, interpretationInProgress, logEndRef return ( - - setTab(newTab)} aria-label="run-content-tabs"> - - - - - - - -
- - {interpretationInProgress ? currentLog : row.log} - -
-
+ + setTab(newTab)} aria-label="run-content-tabs"> + + + + - {interpretationInProgress ? : null} - - - - - Interpreter settings - - { - Object.keys(row.interpreterSettings).map((setting, index) => { - if (setting === 'params') { - return ( -
- - - Recording parameters - - { - Object.keys(row.interpreterSettings.params).map((param, index) => { - return ( - - {/*@ts-ignore*/} - {param}: {row.interpreterSettings.params[param].toString()} - - ) - }) - } -
- ) - } - return ( - - {/*@ts-ignore*/} - {setting}: {row.interpreterSettings[setting].toString()} - - ) - }) - } -
- - { !row || !row.serializableOutput || !row.binaryOutput - || (Object.keys(row.serializableOutput).length === 0 && Object.keys(row.binaryOutput).length === 0) - ? The output is empty. : null } - - {row.serializableOutput && - Object.keys(row.serializableOutput).length !== 0 && -
- - - Serializable output - { Object.keys(row.serializableOutput).map((key) => { - return ( -
- - {key}: - Download - - -
-                    {row.serializableOutput[key] ? JSON.stringify(row.serializableOutput[key], null, 2)
-                    : 'The output is empty.'}
-                  
-
-
- ) - })} -
- } - {row.binaryOutput - && Object.keys(row.binaryOutput).length !== 0 && -
- - - Binary output - { Object.keys(row.binaryOutput).map((key) => { - try { - const binaryBuffer = JSON.parse(row.binaryOutput[key].data); - const b64 = Buffer.from(binaryBuffer.data).toString('base64'); + + +
+ + {interpretationInProgress ? currentLog : row.log} + +
+
+ + {interpretationInProgress ? : null} + + + + + Interpreter settings + + { + Object.keys(row.interpreterSettings).map((setting, index) => { + if (setting === 'params') { return ( - - - {key}: - Download +
+ + + Recording parameters - {key} - + { + Object.keys(row.interpreterSettings.params).map((param, index) => { + return ( + + {/*@ts-ignore*/} + {param}: {row.interpreterSettings.params[param].toString()} + + ) + }) + } +
) - } catch (e) { - console.log(e) - return - {key}: The image failed to render - } + return ( + + {/*@ts-ignore*/} + {setting}: {row.interpreterSettings[setting].toString()} + + ) + }) + } +
+ + {!row || !row.serializableOutput || !row.binaryOutput + || (Object.keys(row.serializableOutput).length === 0 && Object.keys(row.binaryOutput).length === 0) + ? The output is empty. : null} + + {row.serializableOutput && + Object.keys(row.serializableOutput).length !== 0 && +
+ + + Serializable output + {Object.keys(row.serializableOutput).map((key) => { + return ( +
+ + {key}: + Download + + +
+                        {row.serializableOutput[key] ? JSON.stringify(row.serializableOutput[key], null, 2)
+                          : 'The output is empty.'}
+                      
+
+
+ ) })} -
- } -
+
+ } + {row.binaryOutput + && Object.keys(row.binaryOutput).length !== 0 && +
+ + + Binary output + {Object.keys(row.binaryOutput).map((key) => { + try { + const binaryBuffer = JSON.parse(row.binaryOutput[key].data); + const b64 = Buffer.from(binaryBuffer.data).toString('base64'); + return ( + + + {key}: + Download + + {key} + + ) + } catch (e) { + console.log(e) + return + {key}: The image failed to render + + } + })} +
+ } +
);