mirror of
https://github.com/sasjs/server.git
synced 2025-12-14 20:54:34 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92e0b8a088 | ||
|
|
b484306ed8 | ||
| 5e08aacc51 | |||
| a9e4eb685d | |||
| 31b09f27cc | |||
| 9f3ec92f8e | |||
| 6c9e449614 | |||
| 68e84b0994 | |||
| f0bb51a0d5 | |||
| b93a0da3a3 | |||
|
|
e5facbf54c | ||
|
|
cb2bebbe76 |
@@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [0.0.51](https://github.com/sasjs/server/compare/v0.0.50...v0.0.51) (2022-04-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* run button running man, sub menu added ([68e84b0](https://github.com/sasjs/server/commit/68e84b0994a3fa6ff56b07635c637c6e3a57bfda))
|
||||||
|
* running code with CTRL+ENTER ([b93a0da](https://github.com/sasjs/server/commit/b93a0da3a380926c87548b69309b2d0c1b7e617f))
|
||||||
|
|
||||||
### [0.0.50](https://github.com/sasjs/server/compare/v0.0.49...v0.0.50) (2022-04-07)
|
### [0.0.50](https://github.com/sasjs/server/compare/v0.0.49...v0.0.50) (2022-04-07)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -52,6 +52,7 @@ Example contents of a `.env` file:
|
|||||||
MODE=
|
MODE=
|
||||||
|
|
||||||
# options: [disable|enable] default: `disable` for `server` & `enable` for `desktop`
|
# options: [disable|enable] default: `disable` for `server` & `enable` for `desktop`
|
||||||
|
# If enabled, be sure to also configure the WHITELIST of third party servers.
|
||||||
CORS=
|
CORS=
|
||||||
|
|
||||||
# options: <http://localhost:3000 https://abc.com ...> space separated urls
|
# options: <http://localhost:3000 https://abc.com ...> space separated urls
|
||||||
@@ -84,6 +85,15 @@ ACCESS_TOKEN_SECRET=<secret>
|
|||||||
REFRESH_TOKEN_SECRET=<secret>
|
REFRESH_TOKEN_SECRET=<secret>
|
||||||
AUTH_CODE_SECRET=<secret>
|
AUTH_CODE_SECRET=<secret>
|
||||||
DB_CONNECT=mongodb+srv://<DB_USERNAME>:<DB_PASSWORD>@<CLUSTER>/<DB_NAME>?retryWrites=true&w=majority
|
DB_CONNECT=mongodb+srv://<DB_USERNAME>:<DB_PASSWORD>@<CLUSTER>/<DB_NAME>?retryWrites=true&w=majority
|
||||||
|
|
||||||
|
# SAS Options
|
||||||
|
# On windows use SAS_OPTIONS and on unix use SASV9_OPTIONS
|
||||||
|
# Any options set here are automatically applied in the SAS session
|
||||||
|
# See: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostunx/p0wrdmqp8k0oyyn1xbx3bp3qy2wl.htm
|
||||||
|
# And: https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostwin/p0drw76qo0gig2n1kcoliekh605k.htm#p09y7hx0grw1gin1giuvrjyx61m6
|
||||||
|
SAS_OPTIONS= -NOXCMD
|
||||||
|
SASV9_OPTIONS= -NOXCMD
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Persisting the Session
|
## Persisting the Session
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.0.50",
|
"version": "0.0.51",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.0.50",
|
"version": "0.0.51",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"prettier": "^2.3.1",
|
"prettier": "^2.3.1",
|
||||||
"standard-version": "^9.3.2"
|
"standard-version": "^9.3.2"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.0.50",
|
"version": "0.0.51",
|
||||||
"description": "NodeJS wrapper for calling the SAS binary executable",
|
"description": "NodeJS wrapper for calling the SAS binary executable",
|
||||||
"repository": "https://github.com/sasjs/server",
|
"repository": "https://github.com/sasjs/server",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
BIN
web/public/running-sas.png
Normal file
BIN
web/public/running-sas.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -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'
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -15,6 +15,17 @@ const useStyles = makeStyles(() => ({
|
|||||||
'&.Mui-selected': {
|
'&.Mui-selected': {
|
||||||
color: 'black'
|
color: 'black'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
subMenu: {
|
||||||
|
marginTop: '25px',
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'center'
|
||||||
|
},
|
||||||
|
runButton: {
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
padding: '5px 5px',
|
||||||
|
minWidth: 'unset'
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
@@ -22,8 +33,10 @@ const Studio = () => {
|
|||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const [fileContent, setFileContent] = useState('')
|
const [fileContent, setFileContent] = useState('')
|
||||||
const [log, setLog] = useState('')
|
const [log, setLog] = useState('')
|
||||||
|
const [ctrlPressed, setCtrlPressed] = useState(false)
|
||||||
const [webout, setWebout] = useState('')
|
const [webout, setWebout] = useState('')
|
||||||
const [tab, setTab] = React.useState('1')
|
const [tab, setTab] = React.useState('1')
|
||||||
|
|
||||||
const handleTabChange = (_e: any, newValue: string) => {
|
const handleTabChange = (_e: any, newValue: string) => {
|
||||||
setTab(newValue)
|
setTab(newValue)
|
||||||
}
|
}
|
||||||
@@ -61,6 +74,21 @@ const Studio = () => {
|
|||||||
.catch((err) => console.log(err))
|
.catch((err) => console.log(err))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleKeyDown = (event: any) => {
|
||||||
|
if (event.ctrlKey) {
|
||||||
|
if (event.key === 'v') {
|
||||||
|
setCtrlPressed(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.key === 'Enter') runCode(getSelection() || fileContent)
|
||||||
|
if (!ctrlPressed) setCtrlPressed(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleKeyUp = (event: any) => {
|
||||||
|
if (!event.ctrlKey && ctrlPressed) setCtrlPressed(false)
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const content = localStorage.getItem('fileContent') ?? ''
|
const content = localStorage.getItem('fileContent') ?? ''
|
||||||
setFileContent(content)
|
setFileContent(content)
|
||||||
@@ -86,7 +114,11 @@ const Studio = () => {
|
|||||||
const classes = useStyles()
|
const classes = useStyles()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box sx={{ width: '100%', typography: 'body1', marginTop: '50px' }}>
|
<Box
|
||||||
|
onKeyUp={handleKeyUp}
|
||||||
|
onKeyDown={handleKeyDown}
|
||||||
|
sx={{ width: '100%', typography: 'body1', marginTop: '50px' }}
|
||||||
|
>
|
||||||
<TabContext value={tab}>
|
<TabContext value={tab}>
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@@ -103,12 +135,24 @@ const Studio = () => {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
</TabList>
|
</TabList>
|
||||||
</Box>
|
</Box>
|
||||||
<TabPanel value="1">
|
|
||||||
|
<TabPanel style={{ paddingBottom: 0 }} value="1">
|
||||||
|
<div className={classes.subMenu}>
|
||||||
|
<Tooltip title="CTRL+ENTER will also run SAS code">
|
||||||
|
<Button onClick={handleRunBtnClick} className={classes.runButton}>
|
||||||
|
<img
|
||||||
|
draggable="false"
|
||||||
|
style={{ width: '25px' }}
|
||||||
|
src="/running-sas.png"
|
||||||
|
></img>
|
||||||
|
<span style={{ fontSize: '12px' }}>RUN</span>
|
||||||
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
{/* <Toolbar /> */}
|
{/* <Toolbar /> */}
|
||||||
<Paper
|
<Paper
|
||||||
sx={{
|
sx={{
|
||||||
height: '70vh',
|
height: 'calc(100vh - 170px)',
|
||||||
marginTop: '50px',
|
|
||||||
padding: '10px',
|
padding: '10px',
|
||||||
overflow: 'auto',
|
overflow: 'auto',
|
||||||
position: 'relative'
|
position: 'relative'
|
||||||
@@ -116,23 +160,27 @@ const Studio = () => {
|
|||||||
elevation={3}
|
elevation={3}
|
||||||
>
|
>
|
||||||
<Editor
|
<Editor
|
||||||
height="95%"
|
height="98%"
|
||||||
value={fileContent}
|
value={fileContent}
|
||||||
onMount={handleEditorDidMount}
|
onMount={handleEditorDidMount}
|
||||||
|
options={{ readOnly: ctrlPressed }}
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
if (val) setFileContent(val)
|
if (val) setFileContent(val)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Paper>
|
<p
|
||||||
<Stack
|
style={{
|
||||||
spacing={3}
|
position: 'absolute',
|
||||||
direction="row"
|
left: 0,
|
||||||
sx={{ justifyContent: 'center', marginTop: '20px' }}
|
right: 0,
|
||||||
|
bottom: -10,
|
||||||
|
textAlign: 'center',
|
||||||
|
fontSize: '13px'
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Button variant="contained" onClick={handleRunBtnClick}>
|
Press CTRL + ENTER to run SAS code
|
||||||
Run SAS Code
|
</p>
|
||||||
</Button>
|
</Paper>
|
||||||
</Stack>
|
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel value="2">
|
<TabPanel value="2">
|
||||||
<div style={{ marginTop: '50px' }}>
|
<div style={{ marginTop: '50px' }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user