mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 19:34:34 +00:00
fix: output for Studio
This commit is contained in:
@@ -28,7 +28,12 @@ const Studio = () => {
|
|||||||
axios
|
axios
|
||||||
.post(`/SASjsApi/stp/run`, { code })
|
.post(`/SASjsApi/stp/run`, { code })
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
setLog(res.data)
|
const data =
|
||||||
|
typeof res.data === 'string'
|
||||||
|
? res.data
|
||||||
|
: `<pre><code>${JSON.stringify(res.data, null, 4)}</code></pre>`
|
||||||
|
|
||||||
|
setLog(data)
|
||||||
document?.getElementById('sas_log')?.scrollIntoView()
|
document?.getElementById('sas_log')?.scrollIntoView()
|
||||||
})
|
})
|
||||||
.catch((err) => console.log(err))
|
.catch((err) => console.log(err))
|
||||||
@@ -78,7 +83,14 @@ const Studio = () => {
|
|||||||
Run Selected SAS Code
|
Run Selected SAS Code
|
||||||
</Button>
|
</Button>
|
||||||
</Stack>
|
</Stack>
|
||||||
{log && <div id="sas_log" dangerouslySetInnerHTML={{ __html: log }} />}
|
{log && (
|
||||||
|
<>
|
||||||
|
<br />
|
||||||
|
<h2 id="sas_log">Output</h2>
|
||||||
|
<br />
|
||||||
|
<div dangerouslySetInnerHTML={{ __html: log }} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user