Added header control on generated apps
This commit is contained in:
@@ -2,7 +2,7 @@ module shuffle
|
||||
|
||||
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
|
||||
|
||||
|
||||
@@ -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.47 h1:fywEmbJGbD/VT9LdkHvLWPGh9HEt8ipFDzoGHRe+QgA=
|
||||
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/go.mod h1:+ugtMCVRwnPfY7d8/baCzZ3uwB0BrG5DB8OzbtxaRz8=
|
||||
github.com/getkin/kin-openapi v0.8.0 h1:a6TQjTqwkyscC4/hShJX7WhCVE+4bi9lzw61XHQW5hE=
|
||||
|
||||
+2
-1
@@ -63,7 +63,6 @@ services:
|
||||
- ENVIRONMENT_NAME=${ENVIRONMENT_NAME}
|
||||
- BASE_URL=http://${OUTER_HOSTNAME}:${BACKEND_PORT}
|
||||
- DOCKER_API_VERSION=1.40
|
||||
- SHUFFLE_ORBORUS_EXECUTION_TIMEOUT=600
|
||||
- SHUFFLE_BASE_IMAGE_NAME=${SHUFFLE_BASE_IMAGE_NAME}
|
||||
- SHUFFLE_BASE_IMAGE_REGISTRY=${SHUFFLE_BASE_IMAGE_REGISTRY}
|
||||
- SHUFFLE_BASE_IMAGE_TAG_SUFFIX=${SHUFFLE_BASE_IMAGE_TAG_SUFFIX}
|
||||
@@ -71,6 +70,8 @@ services:
|
||||
- HTTPS_PROXY=${SHUFFLE_HTTPS_PROXY}
|
||||
- SHUFFLE_PASS_WORKER_PROXY=${SHUFFLE_PASS_WORKER_PROXY}
|
||||
- SHUFFLE_PASS_APP_PROXY=${SHUFFLE_PASS_APP_PROXY}
|
||||
- SHUFFLE_ORBORUS_EXECUTION_TIMEOUT=600
|
||||
- SHUFFLE_ORBORUS_EXECUTION_CONCURRENCY=50
|
||||
- CLEANUP=${SHUFFLE_CONTAINER_AUTO_CLEANUP}
|
||||
restart: unless-stopped
|
||||
opensearch:
|
||||
|
||||
@@ -597,6 +597,14 @@ const ParsedAction = (props) => {
|
||||
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") {
|
||||
const regex = /\${(\w+)}/g
|
||||
const found = placeholder.match(regex)
|
||||
|
||||
@@ -149,7 +149,7 @@ const Admin = (props) => {
|
||||
response.json().then(responseJson => {
|
||||
console.log("RESP: ", responseJson)
|
||||
if (responseJson["success"] === false) {
|
||||
alert.error("Failed stopping schedule")
|
||||
alert.error("Failed deleting auth")
|
||||
} else {
|
||||
getAppAuthentication()
|
||||
alert.success("Successfully deleted authentication!")
|
||||
@@ -880,7 +880,7 @@ const Admin = (props) => {
|
||||
.then((responseJson) => {
|
||||
if (responseJson.success) {
|
||||
//console.log(responseJson.data)
|
||||
console.log(responseJson)
|
||||
//console.log(responseJson)
|
||||
setAuthentication(responseJson.data)
|
||||
} else {
|
||||
alert.error("Failed getting authentications")
|
||||
@@ -1001,7 +1001,7 @@ const Admin = (props) => {
|
||||
6: "categories",
|
||||
}
|
||||
const setConfig = (event, newValue) => {
|
||||
console.log("Value: ", newValue)
|
||||
//console.log("Value: ", newValue)
|
||||
|
||||
setCurTab(parseInt(newValue))
|
||||
if (newValue === 1) {
|
||||
|
||||
@@ -5664,13 +5664,17 @@ const AngularWorkflow = (props) => {
|
||||
id="webhook_uri_field"
|
||||
onClick={() => {
|
||||
var copyText = document.getElementById("webhook_uri_field")
|
||||
navigator.clipboard.writeText(copyText.value)
|
||||
copyText.select()
|
||||
copyText.setSelectionRange(0, 99999) /* For mobile devices */
|
||||
if (copyText !== undefined && copyText !== null) {
|
||||
navigator.clipboard.writeText(copyText.value)
|
||||
copyText.select()
|
||||
copyText.setSelectionRange(0, 99999) /* For mobile devices */
|
||||
|
||||
/* Copy the text inside the text field */
|
||||
document.execCommand("copy")
|
||||
alert.success("Copied Webhook URL")
|
||||
/* Copy the text inside the text field */
|
||||
document.execCommand("copy")
|
||||
alert.success("Copied Webhook URL")
|
||||
} else {
|
||||
console.log("Couldn't find webhook URI field: ", copyText)
|
||||
}
|
||||
}}
|
||||
InputProps={{
|
||||
style:{
|
||||
@@ -6848,6 +6852,8 @@ const AngularWorkflow = (props) => {
|
||||
/* Copy the text inside the text field */
|
||||
document.execCommand("copy")
|
||||
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 {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';
|
||||
@@ -230,6 +230,12 @@ const AppCreator = (props) => {
|
||||
const [extraBodyFields, setExtraBodyFields] = useState([])
|
||||
const [fileUploadEnabled, setFileUploadEnabled] = useState(false)
|
||||
const [actionAmount, setActionAmount] = useState(increaseAmount)
|
||||
const defaultAuth = {
|
||||
"name": "",
|
||||
"type": "header",
|
||||
"example": "hello",
|
||||
}
|
||||
const [extraAuth, setExtraAuth] = useState([defaultAuth])
|
||||
|
||||
//const [actions, setActions] = useState([{
|
||||
// "name": "Get workflows",
|
||||
@@ -1413,6 +1419,98 @@ const AppCreator = (props) => {
|
||||
//console.log("Option: ", authenticationOption)
|
||||
//console.log("Location: ", parameterLocation)
|
||||
//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" ?
|
||||
<div style={{color: "white", marginTop: 20, }}>
|
||||
<Typography variant="body1">API key authentication</Typography>
|
||||
@@ -1447,7 +1545,7 @@ const AppCreator = (props) => {
|
||||
setParameterLocation(e.target.value)
|
||||
}}
|
||||
value={parameterLocation}
|
||||
style={{backgroundColor: inputColor, paddingLeft: "10px", color: "white", height: "50px"}}
|
||||
style={{borderRadius: 5, backgroundColor: inputColor, paddingLeft: "10px", color: "white", height: "50px"}}
|
||||
inputProps={{
|
||||
name: 'age',
|
||||
id: 'outlined-age-simple',
|
||||
@@ -2628,6 +2726,7 @@ const AppCreator = (props) => {
|
||||
{basicAuth}
|
||||
{bearerAuth}
|
||||
{apiKey}
|
||||
{extraKeys}
|
||||
|
||||
{/*authenticationOption === "No authentication" ? null :
|
||||
<FormControlLabel
|
||||
|
||||
Reference in New Issue
Block a user