From d6f1b0e3ae6280e2188bb2058269e8a685c8b19d Mon Sep 17 00:00:00 2001 From: frikky Date: Sun, 6 Jun 2021 13:43:51 +0200 Subject: [PATCH] Added frontend bugfixes for workflow view --- backend/app_sdk/app_base.py | 2 +- frontend/src/components/ParsedAction.jsx | 2 +- frontend/src/views/AngularWorkflow.jsx | 33 ++++++++++++++----- frontend/src/views/Workflows.jsx | 2 +- .../extensions/scripts/disable_disk_check.sh | 11 +++++++ 5 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 functions/extensions/scripts/disable_disk_check.sh diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index 7c3b7ea2..88e5a4a3 100644 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -2265,7 +2265,7 @@ class AppBase: print("[INFO] Running normal execution\n") #newres = await func(**params) - print("PARAMS: %s" % params) + #print("PARAMS: %s" % params) while True: try: newres = await func(**params) diff --git a/frontend/src/components/ParsedAction.jsx b/frontend/src/components/ParsedAction.jsx index 9794d0f6..6faf26d3 100644 --- a/frontend/src/components/ParsedAction.jsx +++ b/frontend/src/components/ParsedAction.jsx @@ -758,7 +758,7 @@ const ParsedAction = (props) => { }} /> - console.log("FIELD VALUE: ", data.value) + //console.log("FIELD VALUE: ", data.value) //const regexp = new RegExp("\W+\.", "g") //let match //while ((match = regexp.exec(data.value)) !== null) { diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 8951a295..610f269b 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -536,7 +536,7 @@ const AngularWorkflow = (props) => { if (response.status !== 200) { console.log("Status not 200 for ABORT EXECUTION :O!") } else { - alert.success("Execution aborted") + //alert.success("Execution aborted") } return response.json() @@ -1108,10 +1108,10 @@ const AngularWorkflow = (props) => { // This can be used to only show prioritzed ones later // Right now, it can prioritize authenticated ones + //"Testing", const internalIds = [ "Shuffle Tools", - "Testing", - "Http", + "http", ] const getAppAuthentication = (reset) => { @@ -4231,7 +4231,22 @@ const AngularWorkflow = (props) => { const runSearch = (value) => { if (value.length > 0) { - const newApps = allApps.filter(app => (app.name.toLowerCase().includes(value.trim().toLowerCase() || app.description.toLowerCase().includes(value.trim().toLowerCase()))) && !(!app.activated && app.generated)) + var newApps = allApps.filter(app => (app.name.toLowerCase().includes(value.trim().toLowerCase() || app.description.toLowerCase().includes(value.trim().toLowerCase()))) && !(!app.activated && app.generated)) + + // Extend search + if (newApps.length === 0) { + const searchvalue = value.trim().toLowerCase() + newApps = allApps.filter(app => { + for (var key in app.actions) { + const inneraction = app.actions[key] + if (inneraction.name.toLowerCase().includes(searchvalue)) { + return true + } + } + + return false + }) + } //setFilteredApps(responseJson.filter(app => !internalIds.includes(app.name) && !(!app.activated && app.generated))) //console.log("FOUND: ", newApps) @@ -7874,11 +7889,11 @@ const AngularWorkflow = (props) => { } if (data.action.app_name === "Shuffle Tools") { - console.log("APP (TOOLS): ", data.action) + //console.log("APP (TOOLS): ", data.action) const nodedata = cy.getElementById(data.action.id).data() - if (nodedata.fillstyle === "linear-gradient") { - console.log("LINEAR :D") + if (nodedata !== undefined && nodedata !== null && nodedata.fillstyle === "linear-gradient") { + //console.log("LINEAR :D") var imgStyle = { marginRight: 20, width: imgsize, @@ -7888,7 +7903,7 @@ const AngularWorkflow = (props) => { background: `linear-gradient(to right, ${nodedata.fillGradient})` } - console.log("STYLE: ", imgStyle) + //console.log("STYLE: ", imgStyle) actionimg = {nodedata.label} } @@ -8595,7 +8610,7 @@ const AngularWorkflow = (props) => { {/*selectedApp.link.length > 0 ?
: null*/}
{selectedApp.authentication.parameters.map((data, index) => { - console.log("AUTH: ", data) + //console.log("AUTH: ", data) return (
diff --git a/frontend/src/views/Workflows.jsx b/frontend/src/views/Workflows.jsx index 4cbba6fa..d75ff690 100644 --- a/frontend/src/views/Workflows.jsx +++ b/frontend/src/views/Workflows.jsx @@ -88,7 +88,7 @@ export const GetIconInfo = (action) => { {"key": "cache_get", "values": ["get_cache"]}, {"key": "filter", "values": ["filter"]}, {"key": "merge", "values": ["join", "merge"]}, - {"key": "search", "values": ["search", "find", "locate"]}, + {"key": "search", "values": ["search", "find", "locate", "index",]}, {"key": "list", "values": ["list", "head", "options"]}, {"key": "download", "values": ["get", "download", "return", "hello_world", "curl",]}, {"key": "add", "values": ["add"]}, diff --git a/functions/extensions/scripts/disable_disk_check.sh b/functions/extensions/scripts/disable_disk_check.sh new file mode 100644 index 00000000..3b3ddcc6 --- /dev/null +++ b/functions/extensions/scripts/disable_disk_check.sh @@ -0,0 +1,11 @@ +curl -XPUT http://localhost:9200/_cluster/settings -H "Content-Type:application/json" -d \ +'{ + "transient": { + "cluster.routing.allocation.disk.threshold_enabled": false + } +}' + +curl -XPUT http://localhost:9200/_all/_settings -H "Content-Type: application/json" -d \ +'{ + "index.blocks.read_only_allow_delete": null +}'