mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 19:34:34 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a07f47a1ba | ||
|
|
2548c82dfe | ||
|
|
238aa1006f | ||
|
|
35cba97611 | ||
|
|
5f29dec16f | ||
|
|
e2a97fcb7c |
17
CHANGELOG.md
17
CHANGELOG.md
@@ -2,6 +2,23 @@
|
|||||||
|
|
||||||
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.68](https://github.com/sasjs/server/compare/v0.0.67...v0.0.68) (2022-05-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* using monaco editor locally ([2548c82](https://github.com/sasjs/server/commit/2548c82dfe1149e62a570a00546dddd9e30049b1))
|
||||||
|
|
||||||
|
### [0.0.67](https://github.com/sasjs/server/compare/v0.0.66...v0.0.67) (2022-05-01)
|
||||||
|
|
||||||
|
### [0.0.66](https://github.com/sasjs/server/compare/v0.0.64...v0.0.66) (2022-05-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* added swagger ui init file manually ([e2a97fc](https://github.com/sasjs/server/commit/e2a97fcb7c54a57a7ca118677cfce93fe9430d8f))
|
||||||
|
* consume swagger api with CSRF ([5aaac24](https://github.com/sasjs/server/commit/5aaac24080362d6ce0c5d1157798a9343f40ae2a))
|
||||||
|
|
||||||
### [0.0.65](https://github.com/sasjs/server/compare/v0.0.64...v0.0.65) (2022-05-01)
|
### [0.0.65](https://github.com/sasjs/server/compare/v0.0.64...v0.0.65) (2022-05-01)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
50
api/public/SASjsApi/swagger-ui-init.js
Normal file
50
api/public/SASjsApi/swagger-ui-init.js
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
window.onload = function () {
|
||||||
|
// Build a system
|
||||||
|
var url = window.location.search.match(/url=([^&]+)/)
|
||||||
|
if (url && url.length > 1) {
|
||||||
|
url = decodeURIComponent(url[1])
|
||||||
|
} else {
|
||||||
|
url = window.location.origin
|
||||||
|
}
|
||||||
|
var options = {
|
||||||
|
customOptions: {
|
||||||
|
url: '/swagger.yaml',
|
||||||
|
requestInterceptor: function (request) {
|
||||||
|
request.credentials = 'include'
|
||||||
|
var cookie = document.cookie
|
||||||
|
var startIndex = cookie.indexOf('XSRF-TOKEN')
|
||||||
|
var csrf = cookie.slice(startIndex + 11).split('; ')[0]
|
||||||
|
request.headers['X-XSRF-TOKEN'] = csrf
|
||||||
|
return request
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
url = options.swaggerUrl || url
|
||||||
|
var urls = options.swaggerUrls
|
||||||
|
var customOptions = options.customOptions
|
||||||
|
var spec1 = options.swaggerDoc
|
||||||
|
var swaggerOptions = {
|
||||||
|
spec: spec1,
|
||||||
|
url: url,
|
||||||
|
urls: urls,
|
||||||
|
dom_id: '#swagger-ui',
|
||||||
|
deepLinking: true,
|
||||||
|
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
|
||||||
|
plugins: [SwaggerUIBundle.plugins.DownloadUrl],
|
||||||
|
layout: 'StandaloneLayout'
|
||||||
|
}
|
||||||
|
for (var attrname in customOptions) {
|
||||||
|
swaggerOptions[attrname] = customOptions[attrname]
|
||||||
|
}
|
||||||
|
var ui = SwaggerUIBundle(swaggerOptions)
|
||||||
|
|
||||||
|
if (customOptions.oauth) {
|
||||||
|
ui.initOAuth(customOptions.oauth)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (customOptions.authAction) {
|
||||||
|
ui.authActions.authorize(customOptions.authAction)
|
||||||
|
}
|
||||||
|
|
||||||
|
window.ui = ui
|
||||||
|
}
|
||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.0.65",
|
"version": "0.0.68",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "server",
|
"name": "server",
|
||||||
"version": "0.0.65",
|
"version": "0.0.68",
|
||||||
"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.65",
|
"version": "0.0.68",
|
||||||
"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": {
|
||||||
|
|||||||
370
web/package-lock.json
generated
370
web/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emotion/react": "^11.4.1",
|
"@emotion/react": "^11.4.1",
|
||||||
"@emotion/styled": "^11.3.0",
|
"@emotion/styled": "^11.3.0",
|
||||||
"@monaco-editor/react": "^4.3.1",
|
|
||||||
"@mui/icons-material": "^5.0.3",
|
"@mui/icons-material": "^5.0.3",
|
||||||
"@mui/lab": "^5.0.0-alpha.50",
|
"@mui/lab": "^5.0.0-alpha.50",
|
||||||
"@mui/material": "^5.0.3",
|
"@mui/material": "^5.0.3",
|
||||||
@@ -21,8 +20,10 @@
|
|||||||
"@types/node": "^12.20.28",
|
"@types/node": "^12.20.28",
|
||||||
"@types/react": "^17.0.27",
|
"@types/react": "^17.0.27",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
|
"monaco-editor-webpack-plugin": "^7.0.1",
|
||||||
"react": "^17.0.2",
|
"react": "^17.0.2",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^17.0.2",
|
||||||
|
"react-monaco-editor": "^0.48.0",
|
||||||
"react-router-dom": "^5.3.0"
|
"react-router-dom": "^5.3.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
|
|||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
import Editor from '@monaco-editor/react'
|
import Editor from 'react-monaco-editor'
|
||||||
|
|
||||||
import Box from '@mui/material/Box'
|
import Box from '@mui/material/Box'
|
||||||
import Paper from '@mui/material/Paper'
|
import Paper from '@mui/material/Paper'
|
||||||
@@ -125,6 +125,7 @@ const Main = (props: Props) => {
|
|||||||
{!isLoading && props?.selectedFilePath && editMode && (
|
{!isLoading && props?.selectedFilePath && editMode && (
|
||||||
<Editor
|
<Editor
|
||||||
height="95%"
|
height="95%"
|
||||||
|
language="sas"
|
||||||
value={fileContent}
|
value={fileContent}
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
if (val) setFileContent(val)
|
if (val) setFileContent(val)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import axios from 'axios'
|
|||||||
import Box from '@mui/material/Box'
|
import Box from '@mui/material/Box'
|
||||||
import { Button, Paper, Stack, Tab, Tooltip } from '@mui/material'
|
import { Button, Paper, Stack, Tab, Tooltip } from '@mui/material'
|
||||||
import { makeStyles } from '@mui/styles'
|
import { makeStyles } from '@mui/styles'
|
||||||
import Editor, { OnMount } from '@monaco-editor/react'
|
import Editor, { EditorDidMount } from 'react-monaco-editor'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { TabContext, TabList, TabPanel } from '@mui/lab'
|
import { TabContext, TabList, TabPanel } from '@mui/lab'
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ const Studio = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const editorRef = useRef(null as any)
|
const editorRef = useRef(null as any)
|
||||||
const handleEditorDidMount: OnMount = (editor) => {
|
const handleEditorDidMount: EditorDidMount = (editor) => {
|
||||||
editor.focus()
|
editor.focus()
|
||||||
editorRef.current = editor
|
editorRef.current = editor
|
||||||
}
|
}
|
||||||
@@ -141,6 +141,7 @@ const Studio = () => {
|
|||||||
<Tooltip title="CTRL+ENTER will also run SAS code">
|
<Tooltip title="CTRL+ENTER will also run SAS code">
|
||||||
<Button onClick={handleRunBtnClick} className={classes.runButton}>
|
<Button onClick={handleRunBtnClick} className={classes.runButton}>
|
||||||
<img
|
<img
|
||||||
|
alt=""
|
||||||
draggable="false"
|
draggable="false"
|
||||||
style={{ width: '25px' }}
|
style={{ width: '25px' }}
|
||||||
src="/running-sas.png"
|
src="/running-sas.png"
|
||||||
@@ -161,8 +162,9 @@ const Studio = () => {
|
|||||||
>
|
>
|
||||||
<Editor
|
<Editor
|
||||||
height="98%"
|
height="98%"
|
||||||
|
language="sas"
|
||||||
value={fileContent}
|
value={fileContent}
|
||||||
onMount={handleEditorDidMount}
|
editorDidMount={handleEditorDidMount}
|
||||||
options={{ readOnly: ctrlPressed }}
|
options={{ readOnly: ctrlPressed }}
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
if (val) setFileContent(val)
|
if (val) setFileContent(val)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin'
|
||||||
import { Configuration } from 'webpack'
|
import { Configuration } from 'webpack'
|
||||||
import HtmlWebpackPlugin from 'html-webpack-plugin'
|
import HtmlWebpackPlugin from 'html-webpack-plugin'
|
||||||
import CopyPlugin from 'copy-webpack-plugin'
|
import CopyPlugin from 'copy-webpack-plugin'
|
||||||
@@ -53,7 +54,8 @@ const config: Configuration = {
|
|||||||
new CopyPlugin({
|
new CopyPlugin({
|
||||||
patterns: [{ from: 'public' }]
|
patterns: [{ from: 'public' }]
|
||||||
}),
|
}),
|
||||||
new dotenv()
|
new dotenv(),
|
||||||
|
new MonacoWebpackPlugin()
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user