diff --git a/backend/app_sdk/app_base.py b/backend/app_sdk/app_base.py index 3a8d2634..7a0a0747 100755 --- a/backend/app_sdk/app_base.py +++ b/backend/app_sdk/app_base.py @@ -534,6 +534,7 @@ class AppBase: try: finished = False + ret = {} for i in range (0, 10): # Random sleeptime between 0 and 1 second, with 0.1 increments sleeptime = float(random.randint(0, 10) / 10) @@ -541,13 +542,14 @@ class AppBase: try: ret = requests.post(url, headers=headers, json=action_result, timeout=10, verify=False, proxies=self.proxy_config) - self.logger.info(f"[DEBUG] Result: {ret.status_code} (break on 200 or 201)") + self.logger.info(f"""[DEBUG] Successful request result request: Status= {ret.status_code} (break on 200/201) & Response= {ret.text}. Action status: {action_result["status"]}""") if ret.status_code == 200 or ret.status_code == 201: finished = True break else: self.logger.info(f"[ERROR] Bad resp {ret.status_code}: {ret.text}") time.sleep(sleeptime) + # Proxyerrror except requests.exceptions.ProxyError as e: @@ -608,7 +610,6 @@ class AppBase: self.send_result(action_result, {"Content-Type": "application/json", "Authorization": "Bearer %s" % self.authorization}, "/api/v1/streams") return - self.logger.info(f"""[DEBUG] Successful request result request: Status= {ret.status_code} & Response= {ret.text}. Action status: {action_result["status"]}""") except requests.exceptions.ConnectionError as e: self.logger.info(f"[DEBUG] Unexpected ConnectionError happened: {e}") except TypeError as e: diff --git a/frontend/src/components/CacheView.jsx b/frontend/src/components/CacheView.jsx index 93d23b2f..97b06fcb 100644 --- a/frontend/src/components/CacheView.jsx +++ b/frontend/src/components/CacheView.jsx @@ -1,6 +1,7 @@ import React, { useState, useEffect } from "react"; import theme from "../theme.jsx"; import { toast } from 'react-toastify'; +import ReactJson from "react-json-view"; import { Tooltip, @@ -42,6 +43,7 @@ import { Visibility as VisibilityIcon, VisibilityOff as VisibilityOffIcon, } from "@mui/icons-material"; +import { validateJson, } from "../views/Workflows.jsx"; const scrollStyle1 = { height: 100, @@ -59,6 +61,7 @@ const scrollStyle2 = { overflow: "scroll", } + const CacheView = (props) => { const { globalUrl, userdata, serverside, orgId } = props; const [orgCache, setOrgCache] = React.useState(""); @@ -345,7 +348,7 @@ const CacheView = (props) => { return ( -
+
{modalView}

Shuffle Datastore

@@ -391,19 +394,18 @@ const CacheView = (props) => { - + {listCache === undefined || listCache === null @@ -413,58 +415,54 @@ const CacheView = (props) => { if (index % 2 === 0) { bgColor = "#1f2023"; } + + const validate = validateJson(data.value); + console.log("Past validate: ", validate); return ( -
- // setShow((prevState) => ({ ...prevState, [data.value]: true })) - // } - // onMouseLeave={() => - // setShow((prevState) => ({ ...prevState, [data.value]: false })) - // } - //primary={show[data.value] ? data.value : `${data.value.substring(0, 5)}...`} - primary={data.value} - /> -
+ style={{ + minWidth: 400, + maxWidth: 400, + }} + primary={validate.valid ? + { + //handleReactJsonClipboard(copy); + }} + displayDataTypes={false} + onSelect={(select) => { + //HandleJsonCopy(showResult, select, data.action.label); + //console.log("SELECTED!: ", select); + }} + name={"value"} + /> + : + data.value + } + /> - @@ -484,7 +482,7 @@ const CacheView = (props) => { @@ -504,6 +502,13 @@ const CacheView = (props) => { /> +
); })} diff --git a/frontend/src/theme.jsx b/frontend/src/theme.jsx index 8d13070c..37b32b4d 100644 --- a/frontend/src/theme.jsx +++ b/frontend/src/theme.jsx @@ -31,6 +31,7 @@ const theme = createTheme(adaptV4Theme({ borderRadius: 5, border: "1px solid rgba(255,255,255,0.7)", padding: 5, + width: "100%", }, textFieldStyle: { backgroundColor: "#383B40", diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 969a30c4..4fc4caaa 100755 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -1856,18 +1856,22 @@ const AngularWorkflow = (defaultprops) => { }) .then((responseJson) => { if (!responseJson.success) { - //toast("Failed to start: " + responseJson.reason); - toast(responseJson.reason); - //toast.error(responseJson.reason); - setExecutionRunning(false); - setExecutionRequestStarted(false); - stop(); + //toast("Failed to start: " + responseJson.reason); + toast(responseJson.reason); + //toast.error(responseJson.reason); + setExecutionRunning(false); + setExecutionRequestStarted(false); + stop(); for (let i = 0; i < curelements.length; i++) { curelements[i].removeClass("not-executing-highlight"); } return; } else { + if (responseJson.execution_id !== undefined && responseJson.execution_id !== null && responseJson.execution_id.length > 0) { + navigate(`?execution_id=${responseJson.execution_id}`) + } + setExecutionRunning(true); setExecutionRequestStarted(false); }