Fixed cache frontend issues related to editing/viewing
This commit is contained in:
@@ -702,7 +702,7 @@ class AppBase:
|
||||
except (KeyError, NameError) as e:
|
||||
self.logger.info(f"""Key/NameError in param handler for {param["name"]}: {e}""")
|
||||
|
||||
self.logger.info(f"[DEBUG] OUTER VALUE: {param_value}")
|
||||
#self.logger.info(f"[DEBUG] OUTER VALUE: {param_value}")
|
||||
if len(param_value) > 0:
|
||||
md5 = hashlib.md5(param_value.encode('utf-8')).hexdigest()
|
||||
values.append(md5)
|
||||
@@ -1578,7 +1578,7 @@ class AppBase:
|
||||
}
|
||||
|
||||
resultsurl = "%s/api/v1/streams/results" % (self.base_url)
|
||||
self.logger.info("[ERROR] Before FULLEXEC stream result url '%s'" % (resultsurl))
|
||||
#self.logger.info("[DEBUG] Before FULLEXEC stream result url '%s'" % (resultsurl))
|
||||
ret = requests.post(
|
||||
resultsurl,
|
||||
headers=headers,
|
||||
@@ -3736,9 +3736,9 @@ class AppBase:
|
||||
timeout_env = os.getenv("SHUFFLE_APP_SDK_TIMEOUT", timeout)
|
||||
try:
|
||||
timeout = int(timeout_env)
|
||||
self.logger.info(f"[DEBUG] Timeout set to {timeout} seconds")
|
||||
#self.logger.info(f"[DEBUG] Timeout set to {timeout} seconds")
|
||||
except Exception as e:
|
||||
self.logger.info(f"[WARNING] Failed parsing timeout to int: {e}")
|
||||
self.logger.info(f"[ERROR] Failed parsing timeout to int: {e}")
|
||||
|
||||
#timeout = 30
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@ const CacheView = (props) => {
|
||||
/>
|
||||
<ListItemText
|
||||
primary="Value"
|
||||
style={{ minWidth: 400, maxWidth: 400, }}
|
||||
style={{ minWidth: 400, maxWidth: 400, overflowX: "auto", overflowY: "hidden", }}
|
||||
/>
|
||||
<ListItemText
|
||||
primary="Actions"
|
||||
@@ -433,6 +433,8 @@ const CacheView = (props) => {
|
||||
style={{
|
||||
minWidth: 400,
|
||||
maxWidth: 400,
|
||||
overflowX: "auto",
|
||||
overflowY: "hidden",
|
||||
}}
|
||||
primary={validate.valid ?
|
||||
<ReactJson
|
||||
|
||||
@@ -1013,10 +1013,10 @@ const CodeEditor = (props) => {
|
||||
style: {
|
||||
zIndex: 12501,
|
||||
color: "white",
|
||||
minWidth: isMobile ? "100%" : isFileEditor ? 650 : 1100,
|
||||
minWidth: isMobile ? "100%" : isFileEditor ? 650 : 1165,
|
||||
maxWidth: isMobile ? "100%" : isFileEditor ? 650 : 1100,
|
||||
minHeight: isMobile ? "100%" : 620,
|
||||
maxHeight: isMobile ? "100%" : 620,
|
||||
minHeight: isMobile ? "100%" : 700,
|
||||
maxHeight: isMobile ? "100%" : 700,
|
||||
border: theme.palette.defaultBorder,
|
||||
padding: isMobile ? "25px 10px 25px 10px" : 25,
|
||||
},
|
||||
@@ -1308,7 +1308,7 @@ const CodeEditor = (props) => {
|
||||
handleItemClick([innerdata]);
|
||||
}}
|
||||
>
|
||||
<Paper style={{minHeight: 500, maxHeight: 500, minWidth: 275, maxWidth: 275, position: "fixed", top: menuPosition1.top-200, left: menuPosition1.left-270, padding: "10px 0px 10px 10px", backgroundColor: theme.palette.inputColor, overflow: "hidden", overflowY: "auto", border: "1px solid rgba(255,255,255,0.3)",}}>
|
||||
<Paper style={{minHeight: 550, maxHeight: 550, minWidth: 275, maxWidth: 275, position: "fixed", top: menuPosition1.top-200, left: menuPosition1.left-270, padding: "10px 0px 10px 10px", backgroundColor: theme.palette.inputColor, overflow: "hidden", overflowY: "auto", border: "1px solid rgba(255,255,255,0.3)",}}>
|
||||
<MenuItem
|
||||
key={innerdata.name}
|
||||
style={{
|
||||
@@ -1508,7 +1508,7 @@ const CodeEditor = (props) => {
|
||||
value={localcodedata}
|
||||
extensions={[python({ py: true })]}
|
||||
height={isFileEditor ? 450 : 450}
|
||||
width={isFileEditor ? 650 : 600}
|
||||
width={isFileEditor ? 650 : 550}
|
||||
style={{
|
||||
maxWidth: isFileEditor ? 450 : 600,
|
||||
maxHeight: 450,
|
||||
@@ -1549,116 +1549,10 @@ const CodeEditor = (props) => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/*editorPopupOpen ?
|
||||
<Paper
|
||||
style={{
|
||||
margin: 10,
|
||||
padding: 10,
|
||||
width: isMobile ? "100%" : 250,
|
||||
height: 95,
|
||||
overflowY: 'auto',
|
||||
// textOverflow: 'ellipsis'
|
||||
}}
|
||||
>
|
||||
{mainVariables.map((data, index) => {
|
||||
// console.log(data)
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
// textOverflow: 'ellipsis'
|
||||
}}
|
||||
>
|
||||
<button
|
||||
onClick={() => {
|
||||
replaceVariables(data.substring(1,))
|
||||
// console.log(currentCharacter, currentLine)
|
||||
}}
|
||||
style={{
|
||||
backgroundColor: 'transparent',
|
||||
color: 'white',
|
||||
border: 'none',
|
||||
padding: 7.5,
|
||||
cursor: 'pointer',
|
||||
width: '100%',
|
||||
textAlign: 'left'
|
||||
}}
|
||||
>
|
||||
{data.substring(0, 25)}
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</Paper>
|
||||
: null*/}
|
||||
|
||||
<div
|
||||
style={{
|
||||
}}
|
||||
>
|
||||
{/*
|
||||
<Typography
|
||||
variant = 'body2'
|
||||
color = 'textSecondary'
|
||||
style={{
|
||||
color: "white",
|
||||
paddingLeft: 340,
|
||||
width: 50,
|
||||
display: 'inline',
|
||||
}}
|
||||
>
|
||||
Line Wrap
|
||||
<Checkbox
|
||||
onClick={() => {
|
||||
if (linewrap) {
|
||||
setlinewrap(false)
|
||||
}
|
||||
if (!linewrap){
|
||||
setlinewrap(true)
|
||||
}
|
||||
}}
|
||||
defaultChecked
|
||||
size="small"
|
||||
sx={{
|
||||
color: orange[600],
|
||||
'&.Mui-checked': {
|
||||
color: orange[800],
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
|
||||
<Typography
|
||||
variant = 'body2'
|
||||
color = 'textSecondary'
|
||||
style={{
|
||||
color: "white",
|
||||
paddingLeft: 10,
|
||||
width: 100,
|
||||
display: 'inline',
|
||||
}}
|
||||
>
|
||||
Dark Theme
|
||||
<Checkbox
|
||||
onClick={() => {
|
||||
if (codeTheme === "gruvbox-dark") {
|
||||
setcodeTheme("duotone-light")
|
||||
}
|
||||
if (codeTheme === "duotone-light"){
|
||||
setcodeTheme("gruvbox-dark")
|
||||
}
|
||||
}}
|
||||
defaultChecked
|
||||
size="small"
|
||||
sx={{
|
||||
color: orange[600],
|
||||
'&.Mui-checked': {
|
||||
color: orange[800],
|
||||
},
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
*/}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1673,10 +1567,15 @@ const CodeEditor = (props) => {
|
||||
display: "flex",
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<span style={{color: "white"}}>
|
||||
Expected Output
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</DialogTitle>
|
||||
}
|
||||
<div style={{position: "relative", }}>
|
||||
<Tooltip title="Try it! This runs the Shuffle Tools 'repeat back to me' or 'execute python' action with what you see in the expected output window. Commonly used to test your Python scripts or Liquid filters, not requiring the full workflow to run again." placement="top">
|
||||
<Button
|
||||
variant="outlined"
|
||||
@@ -1684,7 +1583,9 @@ const CodeEditor = (props) => {
|
||||
color="primary"
|
||||
style={{
|
||||
border: `1px solid ${theme.palette.primary.main}`,
|
||||
marginLeft: 175,
|
||||
position: "absolute",
|
||||
top: 10,
|
||||
right: 10,
|
||||
maxHeight: 35,
|
||||
minWidth: 70,
|
||||
}}
|
||||
@@ -1701,9 +1602,6 @@ const CodeEditor = (props) => {
|
||||
</Button>
|
||||
</Tooltip>
|
||||
|
||||
</DialogTitle>
|
||||
}
|
||||
|
||||
{isMobile ? null :
|
||||
validation === true ?
|
||||
<ReactJson
|
||||
@@ -1747,7 +1645,7 @@ const CodeEditor = (props) => {
|
||||
maxHeight: 450,
|
||||
minHeight: 450,
|
||||
minWidth: 480,
|
||||
maxWidth: 480,
|
||||
maxWidth: "100%",
|
||||
overflow: "auto",
|
||||
whiteSpace: "pre-wrap",
|
||||
}}
|
||||
@@ -1755,6 +1653,7 @@ const CodeEditor = (props) => {
|
||||
{expOutput}
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
|
||||
{executionResult.valid === true ?
|
||||
<ReactJson
|
||||
@@ -1790,9 +1689,18 @@ const CodeEditor = (props) => {
|
||||
</Typography>
|
||||
</span>
|
||||
:
|
||||
|
||||
<div>
|
||||
<Typography
|
||||
variant = 'body2'
|
||||
color = 'textSecondary'
|
||||
>
|
||||
Output is based on the last VALID run of the node(s) you are referencing. Only updates when you refresh the Workflow Window.
|
||||
</Typography>
|
||||
<Typography variant="body2" style={{maxHeight: 150, overflow: "auto", marginTop: 20,}}>
|
||||
No test output yet.
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
{executionResult.errors !== undefined && executionResult.errors !== null && executionResult.errors.length > 0 ?
|
||||
<Typography variant="body2" style={{maxHeight: 100, overflow: "auto", color: "#f85a3e",}}>
|
||||
|
||||
@@ -9267,15 +9267,21 @@ const AngularWorkflow = (defaultprops) => {
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
const execution = workflowExecutions[executionKey]
|
||||
if (execution.execution_argument === undefined || execution.execution_argument === null || execution.execution_argument.length < 2) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (execution.execution_argument.includes("too large ")) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (availableArguments.includes(execution.execution_argument)) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
availableArguments.push(execution.execution_argument)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,59 +290,6 @@ const Settings = (props) => {
|
||||
}
|
||||
};
|
||||
|
||||
// const registerProviders = (userdata) => {
|
||||
// // Register hooks here
|
||||
// detectEthereumProvider().then((provider) => {
|
||||
// if (provider) {
|
||||
// if (!provider.isMetaMask) {
|
||||
// toast("Only MetaMask is supported as of now.");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // Find the ethereum network
|
||||
// // Get the users' account(s)
|
||||
// //toast("Connecting to MetaMask")
|
||||
// //console.log("Connected: ", provider.isConnected())
|
||||
|
||||
// if (!provider.isConnected()) {
|
||||
// toast("Metamask is not connected.");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// provider.on("message", (event) => {
|
||||
// toast("Ethereum message: ", event);
|
||||
// });
|
||||
|
||||
// provider.on("chainChanged", (chainId) => {
|
||||
// console.log("Changed chain to: ", chainId);
|
||||
|
||||
// const method = "eth_getBalance";
|
||||
// const params = [userdata.eth_info.account, "latest"];
|
||||
// provider
|
||||
// .request({
|
||||
// method: method,
|
||||
// params,
|
||||
// })
|
||||
// .then((result) => {
|
||||
// console.log("Got result: ", result);
|
||||
// if (result !== undefined && result !== null) {
|
||||
// userdata.eth_info.balance = result;
|
||||
// userdata.eth_info.parsed_balance = result / 1000000000000000000;
|
||||
// console.log("INFO: ", userdata);
|
||||
// setUserData(userdata);
|
||||
// } else {
|
||||
// toast("Couldn't find balance: ", result);
|
||||
// }
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// // If the request fails, the Promise will reject with an error.
|
||||
// toast("Failed getting info from ethereum API: " + error);
|
||||
// });
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
|
||||
// This should "always" have data
|
||||
useEffect(() => {
|
||||
if (firstrequest) {
|
||||
|
||||
@@ -1337,15 +1337,20 @@ const Workflows = (props) => {
|
||||
|
||||
const exportAllWorkflows = (allWorkflows) => {
|
||||
for (var i = 0; i < allWorkflows.length; i++) {
|
||||
console.log(allWorkflows[i])
|
||||
const wf = allWorkflows[i]
|
||||
|
||||
if (wf === undefined || wf.id === undefined) {
|
||||
continue
|
||||
}
|
||||
|
||||
console.log("Exporting workflow: ", wf)
|
||||
setTimeout(() => {
|
||||
console.log(allWorkflows[i])
|
||||
exportWorkflow(allWorkflows[i], false)
|
||||
}, i * 200);
|
||||
exportWorkflow(JSON.parse(JSON.stringify(wf)), false)
|
||||
}, i * 100);
|
||||
}
|
||||
|
||||
toast(`Exporting and keeping original for all ${allWorkflows.length} workflows`);
|
||||
};
|
||||
}
|
||||
|
||||
const deduplicateIds = (data, skip_sanitize) => {
|
||||
if (data.triggers !== null && data.triggers !== undefined) {
|
||||
@@ -1498,7 +1503,12 @@ const Workflows = (props) => {
|
||||
};
|
||||
|
||||
const exportWorkflow = (data, sanitize) => {
|
||||
try {
|
||||
data = JSON.parse(JSON.stringify(data));
|
||||
} catch (e) {
|
||||
console.log("Failed to parse JSON: ", e);
|
||||
}
|
||||
|
||||
let exportFileDefaultName = data.name + ".json";
|
||||
|
||||
if (sanitize === true) {
|
||||
|
||||
@@ -376,6 +376,8 @@ github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
|
||||
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||
github.com/shuffle/shuffle-shared v0.5.61 h1:Fkd7pvk8ypwaio1VvMOmJ6PQF9xCfNYx8RWjPnXjn5E=
|
||||
github.com/shuffle/shuffle-shared v0.5.61/go.mod h1:oIZkx93Z7EvtiTXty7xO+ax63Fjz8MQvjXMxDN0Qws0=
|
||||
github.com/shuffle/shuffle-shared v0.5.63 h1:Ukjj1ThyTvcoPCi0Hhxp+BbD8VfI1xr4Xyyhh3URb3Q=
|
||||
github.com/shuffle/shuffle-shared v0.5.63/go.mod h1:oIZkx93Z7EvtiTXty7xO+ax63Fjz8MQvjXMxDN0Qws0=
|
||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ=
|
||||
|
||||
Reference in New Issue
Block a user