From f1f1e47f76e637e07656a07bbab9f6116e736872 Mon Sep 17 00:00:00 2001 From: Saad Jutt Date: Wed, 29 Dec 2021 01:00:53 +0500 Subject: [PATCH] chore(web): display webout as well --- web/src/containers/Studio/index.tsx | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/web/src/containers/Studio/index.tsx b/web/src/containers/Studio/index.tsx index b0326b5..cdd7d64 100644 --- a/web/src/containers/Studio/index.tsx +++ b/web/src/containers/Studio/index.tsx @@ -22,6 +22,7 @@ const Studio = () => { const location = useLocation() const [fileContent, setFileContent] = useState('') const [log, setLog] = useState('') + const [webout, setWebout] = useState('') const [tab, setTab] = React.useState('1') const handleTabChange = (_e: any, newValue: string) => { @@ -45,7 +46,17 @@ const Studio = () => { axios .post(`/SASjsApi/code/execute`, { code }) .then((res: any) => { - setLog(res.data) + setLog(`

SAS Log

${res?.data?.log}
`) + + const webout = res?.data?.webout + ? JSON.parse( + res.data.webout + .split('>>weboutBEGIN<<')[1] + .split('>>weboutEND<<')[0] + ) + : '' + + setWebout(`
${JSON.stringify(webout, null, 4)}
`) setTab('2') }) .catch((err) => console.log(err)) @@ -74,6 +85,7 @@ const Studio = () => { + @@ -110,10 +122,11 @@ const Studio = () => { -

Result

-
+ +
+