Updated code generator for Shuffle

This commit is contained in:
frikky
2020-06-14 18:40:55 +02:00
parent 76ce2bddee
commit d2d89d0bb9
6 changed files with 11 additions and 14 deletions
+2 -2
View File
@@ -21,8 +21,8 @@
## Related repositories
* Apps: https://github.com/frikky/shuffle-apps
* Workflows: https://github.com/frikky/shuffle-workflows (empty)
* Security OpenAPI apps: https://github.com/frikky/OpenAPI-security-definitions
* Workflows: https://github.com/frikky/shuffle-workflows
* Security OpenAPI apps: https://github.com/frikky/security-openapis
* Documentation: https://github.com/frikky/shuffle-docs
## Features
+2 -7
View File
@@ -73,12 +73,9 @@ class AppBase:
except requests.exceptions.ConnectionError as e:
print("Connectionerror: %s" % e)
return
#self.logger.info("AFTER initial stream result")
self.logger.info("THIS IS THE NEW UPDATE")
# Verify whether there are any parameters with ACTION_RESULT required
# If found, we get the full results list from backend
fullexecution = {}
try:
tmpdata = {
@@ -195,10 +192,9 @@ class AppBase:
# Regex to find all the things
if parameter["variant"] == "STATIC_VALUE":
data = parameter["value"]
self.logger.debug(f"\n\nHandle static data with JSON: {data}\n\n")
actualitem = re.findall(match, data, re.MULTILINE)
self.logger.info("STATIC PARSED: %s" % actualitem)
#self.logger.debug(f"\n\nHandle static data with JSON: {data}\n\n")
#self.logger.info("STATIC PARSED: %s" % actualitem)
if len(actualitem) > 0:
for replace in actualitem:
try:
@@ -487,7 +483,6 @@ class AppBase:
# With this parameter ready, add it to... a greater list of parameters. Rofl
multi_parameters[parameter["name"]] = resultarray
else:
print("Hello, in here?: %s" % value)
params[parameter["name"]] = value
multi_parameters[parameter["name"]] = value
+1
View File
@@ -243,6 +243,7 @@ func buildStructure(swagger *openapi3.Swagger, curHash string) (string, error) {
}
// This function generates the python code that's being used.
// This is really meta when you program it. Handling parameters is hard here.
func makePythoncode(swagger *openapi3.Swagger, name, url, method string, parameters, optionalQueries, headers []string) (string, string) {
method = strings.ToLower(method)
queryString := ""
+2 -1
View File
@@ -2281,6 +2281,7 @@ const AngularWorkflow = (props) => {
rows="5"
color="primary"
defaultValue={data.value}
type={placeholder.includes("***") ? "password" : "text"}
placeholder={placeholder}
onChange={(event) => {
changeActionParameter(event, count)
@@ -2585,7 +2586,7 @@ const AngularWorkflow = (props) => {
: null*/}
<Divider style={{marginTop: "20px", height: "1px", width: "100%", backgroundColor: "rgb(91, 96, 100)"}}/>
<div style={{flex: "6", marginTop: "20px"}}>
<div>
<div style={{marginBottom: 5}}>
<b>Actions</b>
</div>
<Select
+1 -1
View File
@@ -1020,7 +1020,7 @@ const AppCreator = (props) => {
// Url verification
if (currentAction.url.length === 0) {
errormessage.push("URL path can't be empty.")
} else if (!currentAction.url.startsWith("/")) {
} else if (!currentAction.url.startsWith("/") && baseUrl.length > 0) {
errormessage.push("URL must start with /")
}
+3 -3
View File
@@ -106,9 +106,9 @@ func deployWorker(cli *dockerclient.Client, image string, identifier string, env
err = cli.ContainerStart(context.Background(), cont.ID, types.ContainerStartOptions{})
if err != nil {
log.Printf("Failed to start container: %s", err)
log.Printf("Failed to start container in environment %s: %s", environment, err)
} else {
log.Printf("Container %s is created", cont.ID)
log.Printf("Container %s was created under environment %s", cont.ID, environment)
}
return nil
}
@@ -401,7 +401,7 @@ func main() {
//log.Println(string(body))
//log.Println(resultResp)
if len(toBeRemoved.Data) == len(executionRequests.Data) {
log.Println("Should remove ALL!")
//log.Println("Should remove ALL!")
} else {
log.Printf("NOT IMPLEMENTED: Should remove %d workflows from backend because they're executed!", len(toBeRemoved.Data))
}