Added header control on generated apps
This commit is contained in:
@@ -2,7 +2,7 @@ module shuffle
|
|||||||
|
|
||||||
go 1.13
|
go 1.13
|
||||||
|
|
||||||
//replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared
|
replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared
|
||||||
|
|
||||||
//replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi
|
//replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi
|
||||||
|
|
||||||
|
|||||||
@@ -155,6 +155,8 @@ github.com/frikky/shuffle-shared v0.0.46 h1:L52pyEVKZujM136qzD7LnarJIq0iXyfpDqhG
|
|||||||
github.com/frikky/shuffle-shared v0.0.46/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
|
github.com/frikky/shuffle-shared v0.0.46/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
|
||||||
github.com/frikky/shuffle-shared v0.0.47 h1:fywEmbJGbD/VT9LdkHvLWPGh9HEt8ipFDzoGHRe+QgA=
|
github.com/frikky/shuffle-shared v0.0.47 h1:fywEmbJGbD/VT9LdkHvLWPGh9HEt8ipFDzoGHRe+QgA=
|
||||||
github.com/frikky/shuffle-shared v0.0.47/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
|
github.com/frikky/shuffle-shared v0.0.47/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
|
||||||
|
github.com/frikky/shuffle-shared v0.0.49 h1:fChF0Nh/bMuXZg67Pt9XXn9+mH4IlKgB3dAzhqwQF5o=
|
||||||
|
github.com/frikky/shuffle-shared v0.0.49/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
|
||||||
github.com/fsouza/go-dockerclient v1.7.2 h1:bBEAcqLTkpq205jooP5RVroUKiVEWgGecHyeZc4OFjo=
|
github.com/fsouza/go-dockerclient v1.7.2 h1:bBEAcqLTkpq205jooP5RVroUKiVEWgGecHyeZc4OFjo=
|
||||||
github.com/fsouza/go-dockerclient v1.7.2/go.mod h1:+ugtMCVRwnPfY7d8/baCzZ3uwB0BrG5DB8OzbtxaRz8=
|
github.com/fsouza/go-dockerclient v1.7.2/go.mod h1:+ugtMCVRwnPfY7d8/baCzZ3uwB0BrG5DB8OzbtxaRz8=
|
||||||
github.com/getkin/kin-openapi v0.8.0 h1:a6TQjTqwkyscC4/hShJX7WhCVE+4bi9lzw61XHQW5hE=
|
github.com/getkin/kin-openapi v0.8.0 h1:a6TQjTqwkyscC4/hShJX7WhCVE+4bi9lzw61XHQW5hE=
|
||||||
|
|||||||
+2
-1
@@ -63,7 +63,6 @@ services:
|
|||||||
- ENVIRONMENT_NAME=${ENVIRONMENT_NAME}
|
- ENVIRONMENT_NAME=${ENVIRONMENT_NAME}
|
||||||
- BASE_URL=http://${OUTER_HOSTNAME}:${BACKEND_PORT}
|
- BASE_URL=http://${OUTER_HOSTNAME}:${BACKEND_PORT}
|
||||||
- DOCKER_API_VERSION=1.40
|
- DOCKER_API_VERSION=1.40
|
||||||
- SHUFFLE_ORBORUS_EXECUTION_TIMEOUT=600
|
|
||||||
- SHUFFLE_BASE_IMAGE_NAME=${SHUFFLE_BASE_IMAGE_NAME}
|
- SHUFFLE_BASE_IMAGE_NAME=${SHUFFLE_BASE_IMAGE_NAME}
|
||||||
- SHUFFLE_BASE_IMAGE_REGISTRY=${SHUFFLE_BASE_IMAGE_REGISTRY}
|
- SHUFFLE_BASE_IMAGE_REGISTRY=${SHUFFLE_BASE_IMAGE_REGISTRY}
|
||||||
- SHUFFLE_BASE_IMAGE_TAG_SUFFIX=${SHUFFLE_BASE_IMAGE_TAG_SUFFIX}
|
- SHUFFLE_BASE_IMAGE_TAG_SUFFIX=${SHUFFLE_BASE_IMAGE_TAG_SUFFIX}
|
||||||
@@ -71,6 +70,8 @@ services:
|
|||||||
- HTTPS_PROXY=${SHUFFLE_HTTPS_PROXY}
|
- HTTPS_PROXY=${SHUFFLE_HTTPS_PROXY}
|
||||||
- SHUFFLE_PASS_WORKER_PROXY=${SHUFFLE_PASS_WORKER_PROXY}
|
- SHUFFLE_PASS_WORKER_PROXY=${SHUFFLE_PASS_WORKER_PROXY}
|
||||||
- SHUFFLE_PASS_APP_PROXY=${SHUFFLE_PASS_APP_PROXY}
|
- SHUFFLE_PASS_APP_PROXY=${SHUFFLE_PASS_APP_PROXY}
|
||||||
|
- SHUFFLE_ORBORUS_EXECUTION_TIMEOUT=600
|
||||||
|
- SHUFFLE_ORBORUS_EXECUTION_CONCURRENCY=50
|
||||||
- CLEANUP=${SHUFFLE_CONTAINER_AUTO_CLEANUP}
|
- CLEANUP=${SHUFFLE_CONTAINER_AUTO_CLEANUP}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
opensearch:
|
opensearch:
|
||||||
|
|||||||
@@ -597,6 +597,14 @@ const ParsedAction = (props) => {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (selectedApp.generated && data.name === "headers") {
|
||||||
|
console.log("HEADER: ", data)
|
||||||
|
//if (data.value.length === 0) {
|
||||||
|
|
||||||
|
//}
|
||||||
|
//setSelectedActionParameters(selectedActionParameters)
|
||||||
|
}
|
||||||
|
|
||||||
if (selectedApp.generated && data.name === "body") {
|
if (selectedApp.generated && data.name === "body") {
|
||||||
const regex = /\${(\w+)}/g
|
const regex = /\${(\w+)}/g
|
||||||
const found = placeholder.match(regex)
|
const found = placeholder.match(regex)
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ const Admin = (props) => {
|
|||||||
response.json().then(responseJson => {
|
response.json().then(responseJson => {
|
||||||
console.log("RESP: ", responseJson)
|
console.log("RESP: ", responseJson)
|
||||||
if (responseJson["success"] === false) {
|
if (responseJson["success"] === false) {
|
||||||
alert.error("Failed stopping schedule")
|
alert.error("Failed deleting auth")
|
||||||
} else {
|
} else {
|
||||||
getAppAuthentication()
|
getAppAuthentication()
|
||||||
alert.success("Successfully deleted authentication!")
|
alert.success("Successfully deleted authentication!")
|
||||||
@@ -880,7 +880,7 @@ const Admin = (props) => {
|
|||||||
.then((responseJson) => {
|
.then((responseJson) => {
|
||||||
if (responseJson.success) {
|
if (responseJson.success) {
|
||||||
//console.log(responseJson.data)
|
//console.log(responseJson.data)
|
||||||
console.log(responseJson)
|
//console.log(responseJson)
|
||||||
setAuthentication(responseJson.data)
|
setAuthentication(responseJson.data)
|
||||||
} else {
|
} else {
|
||||||
alert.error("Failed getting authentications")
|
alert.error("Failed getting authentications")
|
||||||
@@ -1001,7 +1001,7 @@ const Admin = (props) => {
|
|||||||
6: "categories",
|
6: "categories",
|
||||||
}
|
}
|
||||||
const setConfig = (event, newValue) => {
|
const setConfig = (event, newValue) => {
|
||||||
console.log("Value: ", newValue)
|
//console.log("Value: ", newValue)
|
||||||
|
|
||||||
setCurTab(parseInt(newValue))
|
setCurTab(parseInt(newValue))
|
||||||
if (newValue === 1) {
|
if (newValue === 1) {
|
||||||
|
|||||||
@@ -5664,6 +5664,7 @@ const AngularWorkflow = (props) => {
|
|||||||
id="webhook_uri_field"
|
id="webhook_uri_field"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
var copyText = document.getElementById("webhook_uri_field")
|
var copyText = document.getElementById("webhook_uri_field")
|
||||||
|
if (copyText !== undefined && copyText !== null) {
|
||||||
navigator.clipboard.writeText(copyText.value)
|
navigator.clipboard.writeText(copyText.value)
|
||||||
copyText.select()
|
copyText.select()
|
||||||
copyText.setSelectionRange(0, 99999) /* For mobile devices */
|
copyText.setSelectionRange(0, 99999) /* For mobile devices */
|
||||||
@@ -5671,6 +5672,9 @@ const AngularWorkflow = (props) => {
|
|||||||
/* Copy the text inside the text field */
|
/* Copy the text inside the text field */
|
||||||
document.execCommand("copy")
|
document.execCommand("copy")
|
||||||
alert.success("Copied Webhook URL")
|
alert.success("Copied Webhook URL")
|
||||||
|
} else {
|
||||||
|
console.log("Couldn't find webhook URI field: ", copyText)
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
style:{
|
style:{
|
||||||
@@ -6848,6 +6852,8 @@ const AngularWorkflow = (props) => {
|
|||||||
/* Copy the text inside the text field */
|
/* Copy the text inside the text field */
|
||||||
document.execCommand("copy")
|
document.execCommand("copy")
|
||||||
alert.success("Copied data")
|
alert.success("Copied data")
|
||||||
|
} else {
|
||||||
|
console.log("Failed to copy from "+elementName+": ", copyText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { makeStyles } from '@material-ui/styles';
|
|||||||
import {BrowserView, MobileView} from "react-device-detect";
|
import {BrowserView, MobileView} from "react-device-detect";
|
||||||
|
|
||||||
import {Paper, Typography, FormControlLabel, Button, Divider, Select, MenuItem, FormControl, Switch, Dialog, DialogTitle, DialogContent, DialogActions, TextField, Tooltip, Breadcrumbs, CircularProgress, Chip} from '@material-ui/core';
|
import {Paper, Typography, FormControlLabel, Button, Divider, Select, MenuItem, FormControl, Switch, Dialog, DialogTitle, DialogContent, DialogActions, TextField, Tooltip, Breadcrumbs, CircularProgress, Chip} from '@material-ui/core';
|
||||||
import {CheckCircle as CheckCircleIcon, AttachFile as AttachFileIcon, Apps as AppsIcon, ErrorOutline as ErrorOutlineIcon} from '@material-ui/icons';
|
import {Add as AddIcon, CheckCircle as CheckCircleIcon, AttachFile as AttachFileIcon, Apps as AppsIcon, ErrorOutline as ErrorOutlineIcon} from '@material-ui/icons';
|
||||||
|
|
||||||
|
|
||||||
import {Link} from 'react-router-dom';
|
import {Link} from 'react-router-dom';
|
||||||
@@ -230,6 +230,12 @@ const AppCreator = (props) => {
|
|||||||
const [extraBodyFields, setExtraBodyFields] = useState([])
|
const [extraBodyFields, setExtraBodyFields] = useState([])
|
||||||
const [fileUploadEnabled, setFileUploadEnabled] = useState(false)
|
const [fileUploadEnabled, setFileUploadEnabled] = useState(false)
|
||||||
const [actionAmount, setActionAmount] = useState(increaseAmount)
|
const [actionAmount, setActionAmount] = useState(increaseAmount)
|
||||||
|
const defaultAuth = {
|
||||||
|
"name": "",
|
||||||
|
"type": "header",
|
||||||
|
"example": "hello",
|
||||||
|
}
|
||||||
|
const [extraAuth, setExtraAuth] = useState([defaultAuth])
|
||||||
|
|
||||||
//const [actions, setActions] = useState([{
|
//const [actions, setActions] = useState([{
|
||||||
// "name": "Get workflows",
|
// "name": "Get workflows",
|
||||||
@@ -1413,6 +1419,98 @@ const AppCreator = (props) => {
|
|||||||
//console.log("Option: ", authenticationOption)
|
//console.log("Option: ", authenticationOption)
|
||||||
//console.log("Location: ", parameterLocation)
|
//console.log("Location: ", parameterLocation)
|
||||||
//console.log("Name: ", parameterName)
|
//console.log("Name: ", parameterName)
|
||||||
|
const extraKeys =
|
||||||
|
<div style={{marginTop: 25}}>
|
||||||
|
{extraAuth.map((value, index) => {
|
||||||
|
return (
|
||||||
|
<span style={{display: "flex"}}>
|
||||||
|
<TextField
|
||||||
|
required
|
||||||
|
style={{height: 50, flex: 2, backgroundColor: inputColor, marginRight: 5, }}
|
||||||
|
fullWidth={true}
|
||||||
|
placeholder="Name"
|
||||||
|
id="standard-required"
|
||||||
|
margin="normal"
|
||||||
|
variant="outlined"
|
||||||
|
defaultValue={extraAuth[index].name}
|
||||||
|
onChange={e => {
|
||||||
|
extraAuth[index].name = e.target.value
|
||||||
|
setExtraAuth(extraAuth)
|
||||||
|
}}
|
||||||
|
InputProps={{
|
||||||
|
//classes: {
|
||||||
|
// notchedOutline: classes.notchedOutline,
|
||||||
|
//},
|
||||||
|
style:{
|
||||||
|
color: "white",
|
||||||
|
minHeight: 50,
|
||||||
|
marginLeft: 5,
|
||||||
|
maxWidth: "95%",
|
||||||
|
fontSize: "1em",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TextField
|
||||||
|
required
|
||||||
|
style={{height: 50, flex: 2, backgroundColor: inputColor, marginRight: 5,}}
|
||||||
|
fullWidth={true}
|
||||||
|
placeholder="Field Name (not token)"
|
||||||
|
type="name"
|
||||||
|
id="standard-required"
|
||||||
|
margin="normal"
|
||||||
|
variant="outlined"
|
||||||
|
defaultValue={extraAuth[index].example}
|
||||||
|
onChange={e => {
|
||||||
|
extraAuth[index].example = e.target.value
|
||||||
|
setExtraAuth(extraAuth)
|
||||||
|
}}
|
||||||
|
InputProps={{
|
||||||
|
style:{
|
||||||
|
color: "white",
|
||||||
|
minHeight: 50,
|
||||||
|
marginLeft: 5,
|
||||||
|
maxWidth: "95%",
|
||||||
|
fontSize: "1em",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Select
|
||||||
|
fullWidth
|
||||||
|
onChange={(e) => {
|
||||||
|
//console.log(e.target.value)
|
||||||
|
//setParameterLocation(e.target.value)
|
||||||
|
extraAuth[index].type = e.target.value
|
||||||
|
setExtraAuth(extraAuth)
|
||||||
|
}}
|
||||||
|
value={extraAuth[index].type}
|
||||||
|
style={{flex: 1, backgroundColor: inputColor, paddingLeft: "10px", color: "white", height: 50, borderRadius: 5, }}
|
||||||
|
inputProps={{
|
||||||
|
name: 'age',
|
||||||
|
id: 'outlined-age-simple',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MenuItem key={index} style={{backgroundColor: inputColor, color: "white"}} value={"header"}>
|
||||||
|
Header
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem key={index} style={{backgroundColor: inputColor, color: "white"}} value={"query"}>
|
||||||
|
Query
|
||||||
|
</MenuItem>
|
||||||
|
</Select>
|
||||||
|
{index === extraAuth.length-1 ?
|
||||||
|
<Button color="primary" style={{maxWidth: 50, }} variant="contained" onClick={() => {
|
||||||
|
console.log("ADD NEW!")
|
||||||
|
extraAuth.push(defaultAuth)
|
||||||
|
setExtraAuth(extraAuth)
|
||||||
|
setUpdate(Math.random())
|
||||||
|
}}>
|
||||||
|
<AddIcon style={{}}/>
|
||||||
|
</Button>
|
||||||
|
: <span style={{width: 50, }}/>}
|
||||||
|
</span>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
|
||||||
const apiKey = authenticationOption === "API key" ?
|
const apiKey = authenticationOption === "API key" ?
|
||||||
<div style={{color: "white", marginTop: 20, }}>
|
<div style={{color: "white", marginTop: 20, }}>
|
||||||
<Typography variant="body1">API key authentication</Typography>
|
<Typography variant="body1">API key authentication</Typography>
|
||||||
@@ -1447,7 +1545,7 @@ const AppCreator = (props) => {
|
|||||||
setParameterLocation(e.target.value)
|
setParameterLocation(e.target.value)
|
||||||
}}
|
}}
|
||||||
value={parameterLocation}
|
value={parameterLocation}
|
||||||
style={{backgroundColor: inputColor, paddingLeft: "10px", color: "white", height: "50px"}}
|
style={{borderRadius: 5, backgroundColor: inputColor, paddingLeft: "10px", color: "white", height: "50px"}}
|
||||||
inputProps={{
|
inputProps={{
|
||||||
name: 'age',
|
name: 'age',
|
||||||
id: 'outlined-age-simple',
|
id: 'outlined-age-simple',
|
||||||
@@ -2628,6 +2726,7 @@ const AppCreator = (props) => {
|
|||||||
{basicAuth}
|
{basicAuth}
|
||||||
{bearerAuth}
|
{bearerAuth}
|
||||||
{apiKey}
|
{apiKey}
|
||||||
|
{extraKeys}
|
||||||
|
|
||||||
{/*authenticationOption === "No authentication" ? null :
|
{/*authenticationOption === "No authentication" ? null :
|
||||||
<FormControlLabel
|
<FormControlLabel
|
||||||
|
|||||||
Reference in New Issue
Block a user