1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-02 04:50:04 +00:00

fix(web): updated STUDIO log and webout

This commit is contained in:
Saad Jutt
2022-03-30 00:55:38 +05:00
parent 8b4b4b91ab
commit f700561e1a

View File

@@ -50,25 +50,9 @@ const Studio = () => {
.map((logLine: any) => logLine.line) .map((logLine: any) => logLine.line)
.join('\n') .join('\n')
setLog(`<div><h2>SAS Log</h2><pre>${parsedLog}</pre></div>`) setLog(parsedLog)
let weboutString: string setWebout(`${res.data?._webout}`)
try {
weboutString = res.data._webout
.split('>>weboutBEGIN<<')[1]
.split('>>weboutEND<<')[0]
} catch (_) {
weboutString = res?.data?._webout ?? ''
}
let webout: string
try {
webout = JSON.stringify(JSON.parse(weboutString), null, 4)
} catch (_) {
webout = weboutString
}
setWebout(`<pre><code>${webout}</code></pre>`)
setTab('2') setTab('2')
// Scroll to bottom of log // Scroll to bottom of log
@@ -100,6 +84,7 @@ const Studio = () => {
}, [location.search]) }, [location.search])
const classes = useStyles() const classes = useStyles()
return ( return (
<> <>
<br /> <br />
@@ -152,17 +137,15 @@ const Studio = () => {
</Stack> </Stack>
</TabPanel> </TabPanel>
<TabPanel value="2"> <TabPanel value="2">
<div <div style={{ marginTop: '50px' }}>
id="sas_log" <h2>SAS Log</h2>
style={{ marginTop: '50px' }} <pre>{log}</pre>
dangerouslySetInnerHTML={{ __html: log }} </div>
/>
</TabPanel> </TabPanel>
<TabPanel value="3"> <TabPanel value="3">
<div <div style={{ marginTop: '50px' }}>
style={{ marginTop: '50px' }} <pre>{webout}</pre>
dangerouslySetInnerHTML={{ __html: webout }} </div>
/>
</TabPanel> </TabPanel>
</TabContext> </TabContext>
</Box> </Box>