1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-11 03:34:35 +00:00

feat: run button running man, sub menu added

This commit is contained in:
2022-04-14 19:38:44 +02:00
parent f0bb51a0d5
commit 68e84b0994
5 changed files with 20 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
web/public/running-sas.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -28,10 +28,10 @@ const Header = (props: any) => {
> >
<Toolbar variant="dense"> <Toolbar variant="dense">
<img <img
src="logo-white.png" src="logo.png"
alt="logo" alt="logo"
style={{ style={{
width: '50px', width: '35px',
cursor: 'pointer', cursor: 'pointer',
marginRight: '25px' marginRight: '25px'
}} }}

View File

@@ -15,6 +15,9 @@ const useStyles = makeStyles(() => ({
'&.Mui-selected': { '&.Mui-selected': {
color: 'black' color: 'black'
} }
},
subMenu: {
marginTop: '25px'
} }
})) }))
@@ -65,6 +68,10 @@ const Studio = () => {
const handleKeyDown = (event: any) => { const handleKeyDown = (event: any) => {
if (event.ctrlKey) { if (event.ctrlKey) {
if (event.key === 'v') {
setCtrlPressed(false)
}
if (event.key === 'Enter') runCode(getSelection() || fileContent) if (event.key === 'Enter') runCode(getSelection() || fileContent)
if (!ctrlPressed) setCtrlPressed(true) if (!ctrlPressed) setCtrlPressed(true)
} }
@@ -116,12 +123,19 @@ const Studio = () => {
</Tooltip> </Tooltip>
</TabList> </TabList>
</Box> </Box>
<TabPanel value="1"> <TabPanel value="1">
<div className={classes.subMenu}>
<Tooltip title="CTRL+ENTER will also run SAS code">
<Button onClick={handleRunBtnClick} style={{ padding: 0, width: '35px', minWidth: 'unset' }}>
<img draggable="false" style={{ width: '100%' }} src="/running-sas.png"></img>
</Button>
</Tooltip>
</div>
{/* <Toolbar /> */} {/* <Toolbar /> */}
<Paper <Paper
sx={{ sx={{
height: '70vh', height: 'calc(100vh - 180px)',
marginTop: '50px',
padding: '10px', padding: '10px',
overflow: 'auto', overflow: 'auto',
position: 'relative' position: 'relative'
@@ -129,7 +143,7 @@ const Studio = () => {
elevation={3} elevation={3}
> >
<Editor <Editor
height="95%" height="98%"
value={fileContent} value={fileContent}
onMount={handleEditorDidMount} onMount={handleEditorDidMount}
options={{readOnly: ctrlPressed}} options={{readOnly: ctrlPressed}}
@@ -137,19 +151,8 @@ const Studio = () => {
if (val) setFileContent(val) if (val) setFileContent(val)
}} }}
/> />
<p style={{ position: 'absolute', left: 0, right: 0, bottom: -10, textAlign: 'center', fontSize: '13px' }}>Press CTRL + ENTER to run SAS code</p>
</Paper> </Paper>
<Stack
spacing={3}
direction="row"
style={{ position: 'relative' }}
sx={{ justifyContent: 'center', marginTop: '20px' }}
>
<Button variant="contained" onClick={handleRunBtnClick}>
Run SAS Code
</Button>
<p style={{ position: 'absolute', marginRight: '-300px', top: '9px', textAlign: 'center', fontSize: '13px' }}>Or press CTRL + ENTER</p>
</Stack>
</TabPanel> </TabPanel>
<TabPanel value="2"> <TabPanel value="2">
<div style={{ marginTop: '50px' }}> <div style={{ marginTop: '50px' }}>