Fixed webhook
This commit is contained in:
@@ -774,7 +774,7 @@ func handleWorkflowQueue(resp http.ResponseWriter, request *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("Checking results %d vs %d", len(workflowExecution.Results), len(workflowExecution.Workflow.Actions)+extraInputs)
|
//log.Printf("Checking results %d vs %d", len(workflowExecution.Results), len(workflowExecution.Workflow.Actions)+extraInputs)
|
||||||
if len(workflowExecution.Results) == len(workflowExecution.Workflow.Actions)+extraInputs {
|
if len(workflowExecution.Results) == len(workflowExecution.Workflow.Actions)+extraInputs {
|
||||||
finished := true
|
finished := true
|
||||||
for _, result := range workflowExecution.Results {
|
for _, result := range workflowExecution.Results {
|
||||||
@@ -1611,7 +1611,6 @@ func cleanupExecutions(resp http.ResponseWriter, request *http.Request) {
|
|||||||
func handleExecution(id string, workflow Workflow, request *http.Request) (WorkflowExecution, string, error) {
|
func handleExecution(id string, workflow Workflow, request *http.Request) (WorkflowExecution, string, error) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
if workflow.ID == "" || workflow.ID != id {
|
if workflow.ID == "" || workflow.ID != id {
|
||||||
log.Printf("UPDATING WORKFLOW")
|
|
||||||
tmpworkflow, err := getWorkflow(ctx, id)
|
tmpworkflow, err := getWorkflow(ctx, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Failed getting the workflow locally: %s", err)
|
log.Printf("Failed getting the workflow locally: %s", err)
|
||||||
@@ -1668,6 +1667,10 @@ func handleExecution(id string, workflow Workflow, request *http.Request) (Workf
|
|||||||
return WorkflowExecution{}, "", err
|
return WorkflowExecution{}, "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if execution.Start == "" && len(body) > 0 {
|
||||||
|
execution.ExecutionArgument = string(body)
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME - this should have "execution_argument" from executeWorkflow frontend
|
// FIXME - this should have "execution_argument" from executeWorkflow frontend
|
||||||
if len(execution.ExecutionArgument) > 0 {
|
if len(execution.ExecutionArgument) > 0 {
|
||||||
workflowExecution.ExecutionArgument = execution.ExecutionArgument
|
workflowExecution.ExecutionArgument = execution.ExecutionArgument
|
||||||
@@ -1835,7 +1838,6 @@ func handleExecution(id string, workflow Workflow, request *http.Request) (Workf
|
|||||||
onpremExecution := false
|
onpremExecution := false
|
||||||
environments := []string{}
|
environments := []string{}
|
||||||
for _, action := range workflowExecution.Workflow.Actions {
|
for _, action := range workflowExecution.Workflow.Actions {
|
||||||
log.Printf("ENV: %#v", action.Environment)
|
|
||||||
if action.Environment != cloudname {
|
if action.Environment != cloudname {
|
||||||
found := false
|
found := false
|
||||||
for _, env := range environments {
|
for _, env := range environments {
|
||||||
@@ -1859,8 +1861,6 @@ func handleExecution(id string, workflow Workflow, request *http.Request) (Workf
|
|||||||
return WorkflowExecution{}, "Failed getting workflowexecution", err
|
return WorkflowExecution{}, "Failed getting workflowexecution", err
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("Environments: %#v", environments)
|
|
||||||
|
|
||||||
// Adds queue for onprem execution
|
// Adds queue for onprem execution
|
||||||
// FIXME - add specifics to executionRequest, e.g. specific environment (can run multi onprem)
|
// FIXME - add specifics to executionRequest, e.g. specific environment (can run multi onprem)
|
||||||
if onpremExecution {
|
if onpremExecution {
|
||||||
|
|||||||
@@ -801,7 +801,6 @@ const AngularWorkflow = (props) => {
|
|||||||
workflow.start = node.data('id')
|
workflow.start = node.data('id')
|
||||||
setWorkflow(workflow)
|
setWorkflow(workflow)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onEdgeRemoved = (event) => {
|
const onEdgeRemoved = (event) => {
|
||||||
@@ -1642,8 +1641,6 @@ const AngularWorkflow = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
newNodeId = uuid.v4()
|
newNodeId = uuid.v4()
|
||||||
console.log(data)
|
|
||||||
|
|
||||||
const newposition = {
|
const newposition = {
|
||||||
"x": e.pageX-cycontainer.offsetLeft,
|
"x": e.pageX-cycontainer.offsetLeft,
|
||||||
"y": e.pageY-cycontainer.offsetTop,
|
"y": e.pageY-cycontainer.offsetTop,
|
||||||
@@ -1671,6 +1668,10 @@ const AngularWorkflow = (props) => {
|
|||||||
position: newposition,
|
position: newposition,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.trigger_type === "WEBHOOK") {
|
||||||
|
newAppData.status = "running"
|
||||||
|
}
|
||||||
|
|
||||||
// Can all the data be in here? hmm
|
// Can all the data be in here? hmm
|
||||||
const nodeToBeAdded = {
|
const nodeToBeAdded = {
|
||||||
group: "nodes",
|
group: "nodes",
|
||||||
@@ -1714,6 +1715,10 @@ const AngularWorkflow = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setWorkflow(workflow)
|
setWorkflow(workflow)
|
||||||
|
if (data.trigger_type === "WEBHOOK") {
|
||||||
|
newWebhook(newAppData)
|
||||||
|
saveWorkflow(workflow)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -575,9 +575,26 @@ const Workflows = (props) => {
|
|||||||
var starttime = new Date(selectedExecution.started_at*1000)
|
var starttime = new Date(selectedExecution.started_at*1000)
|
||||||
var endtime = new Date(selectedExecution.started_at*1000)
|
var endtime = new Date(selectedExecution.started_at*1000)
|
||||||
|
|
||||||
|
var parsedArgument = selectedExecution.execution_argument
|
||||||
|
if (selectedExecution.execution_argument !== undefined && selectedExecution.execution_argument.length > 0) {
|
||||||
|
parsedArgument = replaceAll(parsedArgument, " None", " \"None\"");
|
||||||
|
}
|
||||||
|
|
||||||
const arg = selectedExecution.execution_argument !== undefined && selectedExecution.execution_argument.length > 0 ?
|
const arg = selectedExecution.execution_argument !== undefined && selectedExecution.execution_argument.length > 0 ?
|
||||||
<div>
|
<div>
|
||||||
Argument: {selectedExecution.execution_argument}
|
Execution argument: {(parsedArgument.startsWith("{") && parsedArgument.endsWith("}")) || (parsedArgument.startsWith("[{") && parsedArgument.endsWith("}]")) ?
|
||||||
|
<div>
|
||||||
|
<ReactJson
|
||||||
|
src={JSON.parse(parsedArgument)}
|
||||||
|
theme="solarized"
|
||||||
|
collapsed={true}
|
||||||
|
displayDataTypes={false}
|
||||||
|
name={"Execution argument"}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
selectedExecution.execution_argument
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
: null
|
: null
|
||||||
/*
|
/*
|
||||||
@@ -603,9 +620,6 @@ const Workflows = (props) => {
|
|||||||
<div>
|
<div>
|
||||||
Finished: {endtime.toISOString()}
|
Finished: {endtime.toISOString()}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
Result: {selectedExecution.result}
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
Last node: {selectedExecution.last_node}
|
Last node: {selectedExecution.last_node}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user