Fixed instaloop autocomplete
This commit is contained in:
@@ -391,14 +391,14 @@ class AppBase:
|
||||
return newvalue, True
|
||||
elif len(actualitem) > 0:
|
||||
# FIXME: This is absolutely not perfect.
|
||||
print("IN HERE: ", actualitem)
|
||||
print("In recursion v2: ", actualitem)
|
||||
|
||||
newvalue = []
|
||||
firstitem = actualitem[0][0]
|
||||
seconditem = actualitem[0][1]
|
||||
if seconditem == "":
|
||||
print("In first")
|
||||
basejson = basejson[int(firstitem)]
|
||||
newvalue = basejson[int(firstitem)]
|
||||
else:
|
||||
if seconditem == "max":
|
||||
seconditem = len(basejson)
|
||||
@@ -868,7 +868,7 @@ class AppBase:
|
||||
actionname = action["name"]
|
||||
#print("Multicheck ", actualitem)
|
||||
print("Actual item: %s" % actualitem)
|
||||
print("ITEM: %d" % len(actualitem))
|
||||
print("LENGTH: %d" % len(actualitem))
|
||||
if len(actualitem) > 0:
|
||||
multiexecution = True
|
||||
|
||||
@@ -985,7 +985,7 @@ class AppBase:
|
||||
print("KeyError: %s" % e)
|
||||
baseparams[key] = "KeyError: %s" % e
|
||||
|
||||
#print("Running with params %s" % baseparams)
|
||||
print("Running with params %s" % baseparams)
|
||||
ret = await func(**baseparams)
|
||||
if isinstance(ret, dict) or isinstance(ret, list):
|
||||
results.append(ret)
|
||||
|
||||
@@ -3117,7 +3117,6 @@ func getSpecificWorkflow(resp http.ResponseWriter, request *http.Request) {
|
||||
//} else {
|
||||
// //log.Printf("Set cache for %s", item.Key)
|
||||
//}
|
||||
log.Println(workflow.IsValid)
|
||||
|
||||
resp.WriteHeader(200)
|
||||
resp.Write(body)
|
||||
|
||||
@@ -2513,6 +2513,10 @@ const AngularWorkflow = (props) => {
|
||||
// Look for the ID
|
||||
const found = false
|
||||
for (var key in workflowExecutions) {
|
||||
if (workflowExecutions[key].results === undefined || workflowExecutions[key].results === null) {
|
||||
continue
|
||||
}
|
||||
|
||||
const foundResult = workflowExecutions[key].results.find(result => result.action.id === item.id)
|
||||
if (foundResult === undefined) {
|
||||
continue
|
||||
@@ -3939,7 +3943,6 @@ const AngularWorkflow = (props) => {
|
||||
<DialogContent style={{display: "flex"}}>
|
||||
<Tooltip color="primary" title={conditionValue.configuration ? "Negated" : "Default"} placement="top">
|
||||
<Button color="primary" variant={conditionValue.configuration ? "contained" : "outlined"} style={{margin: "auto", height: 50, marginBottom: "auto", marginTop: "auto", marginRight: 5}} onClick={(e) => {
|
||||
console.log("VALUE: ", conditionValue.configuration)
|
||||
conditionValue.configuration = !conditionValue.configuration
|
||||
setConditionValue(conditionValue)
|
||||
setUpdate(Math.random())
|
||||
|
||||
@@ -43,21 +43,34 @@ const inputColor = "#383B40"
|
||||
|
||||
// Parses JSON data into keys that can be used everywhere :)
|
||||
export const GetParsedPaths = (inputdata, basekey) => {
|
||||
const splitkey = " => "
|
||||
const splitkey = " > "
|
||||
var parsedValues = []
|
||||
if (typeof(inputdata) !== "object") {
|
||||
return parsedValues
|
||||
}
|
||||
|
||||
for (const [key, value] of Object.entries(inputdata)) {
|
||||
|
||||
// Check if loop or JSON
|
||||
const extra = basekey.length > 0 ? splitkey : ""
|
||||
const basekeyname = `${basekey.slice(1,basekey.length).split(".").join(splitkey)}${extra}${key}`
|
||||
const basekeyname = `${basekey.slice(1, basekey.length).split(".").join(splitkey)}${extra}${key}`
|
||||
|
||||
// Handle direct loop!
|
||||
if (!isNaN(key) && basekey === "") {
|
||||
console.log("Handling direct loop.")
|
||||
parsedValues.push({"type": "object", "name": "Node", "autocomplete": `${basekey}`})
|
||||
parsedValues.push({"type": "list", "name": `${splitkey}list`, "autocomplete": `${basekey}.#`})
|
||||
const returnValues = GetParsedPaths(value, `${basekey}.#`)
|
||||
for (var subkey in returnValues) {
|
||||
parsedValues.push(returnValues[subkey])
|
||||
}
|
||||
|
||||
return parsedValues
|
||||
}
|
||||
|
||||
console.log("KEY: ", key, "VALUE: ", value, "BASEKEY: ", basekeyname)
|
||||
if (typeof(value) === 'object') {
|
||||
if (Array.isArray(value)) {
|
||||
// Check if each item is object
|
||||
console.log("VALUE: ", value)
|
||||
parsedValues.push({"type": "object", "name": basekeyname, "autocomplete": `${basekey}.${key}`})
|
||||
parsedValues.push({"type": "list", "name": `${basekeyname}${splitkey}list`, "autocomplete": `${basekey}.${key}.#`})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user