Synced over files and go.mod

This commit is contained in:
Frikky
2024-03-14 09:47:01 +01:00
parent 98200b7445
commit 625d681fe5
9 changed files with 309 additions and 130 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ require (
github.com/gorilla/mux v1.8.0
github.com/h2non/filetype v1.1.3
github.com/satori/go.uuid v1.2.0
github.com/shuffle/shuffle-shared v0.5.88
github.com/shuffle/shuffle-shared v0.5.91
golang.org/x/crypto v0.16.0
google.golang.org/api v0.125.0
google.golang.org/grpc v1.55.0
+2
View File
@@ -461,6 +461,8 @@ github.com/shuffle/shuffle-shared v0.5.81 h1:pt4lT42FrXN/kd/vlYtm7nXShZI0mOamXUM
github.com/shuffle/shuffle-shared v0.5.81/go.mod h1:Lg6/+qjQlWzNKwj4/4ATpvScyP2JQGLkTPlNlRM6RJk=
github.com/shuffle/shuffle-shared v0.5.88 h1:YNM6xtnKg0BoMmw2pqV/LnNAsMWMrAzYIAy+o+ChdfI=
github.com/shuffle/shuffle-shared v0.5.88/go.mod h1:Lg6/+qjQlWzNKwj4/4ATpvScyP2JQGLkTPlNlRM6RJk=
github.com/shuffle/shuffle-shared v0.5.91 h1:CN2K4iDt2zjx7MR9B+u5Yb7tA8IEw5lk8+Ab+Wia11Q=
github.com/shuffle/shuffle-shared v0.5.91/go.mod h1:Lg6/+qjQlWzNKwj4/4ATpvScyP2JQGLkTPlNlRM6RJk=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
+95 -1
View File
@@ -49,12 +49,14 @@ import {
} from '@mui/x-date-pickers'
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
import { useStyles } from '../views/AppCreator.jsx'
import {
ExpandLess as ExpandLessIcon,
ExpandMore as ExpandMoreIcon,
Publish as PublishIcon,
OpenInNew as OpenInNewIcon,
Add as AddIcon,
} from "@mui/icons-material";
const EditWorkflow = (props) => {
@@ -74,6 +76,10 @@ const EditWorkflow = (props) => {
const [name, setName] = React.useState(workflow.name !== undefined ? workflow.name : "")
const [dueDate, setDueDate] = React.useState(workflow.due_date !== undefined && workflow.due_date !== null && workflow.due_date !== 0 ? dayjs(workflow.due_date*1000) : dayjs().subtract(1, 'day'))
const [inputFields, setInputFields] = React.useState([])
const classes = useStyles();
// Gets the generated workflow
const getGeneratedWorkflow = (workflow_id) => {
fetch(globalUrl + "/api/v1/workflows/" + workflow_id, {
@@ -352,6 +358,9 @@ const EditWorkflow = (props) => {
{showMoreClicked === true ?
<span style={{marginTop: 25, }}>
<div style={{display: "flex"}}>
<FormControl style={{marginTop: 15, }}>
<FormLabel id="demo-row-radio-buttons-group-label">Status</FormLabel>
@@ -467,9 +476,94 @@ const EditWorkflow = (props) => {
margin="dense"
fullWidth
/>
{/*
<Typography variant="h6">
Input fields
</Typography>
<Typography variant="body1">
Input fields are fields that will be used during the startup of the workflow. These will be formatted in JSON and is most commonly used from the <a href={`/workflows/${workflow.id}/run`} rel="noopener noreferrer" target="_blank" style={{ textDecoration: "none", color: "#f86a3e" }}>workflow run page</a>.
</Typography>
{inputFields.length === 0 ?
<Button
color="primary"
style={{ maxWidth: 50, marginLeft: 15 }}
variant="outlined"
onClick={() => {
inputFields.push({
"name": "",
"required": false
})
setInputFields(inputFields)
setUpdate(Math.random());
}}
>
<AddIcon style={{}} />
</Button>
: null}
{inputFields.map((data, index) => {
console.log("Inputfield: ", data)
return (
<div style={{display: "flex", }}>
<TextField
required={data.required}
style={{
height: 50,
flex: 2,
marginTop: 0,
marginBottom: 0,
backgroundColor: theme.palette.inputColor,
marginRight: 5,
}}
fullWidth={true}
placeholder="Name"
id="standard-required"
margin="normal"
variant="outlined"
defaultValue={data.value}
onChange={(e) => {
inputFields[index].name = e.target.value
setInputFields(inputFields)
setUpdate(Math.random());
}}
InputProps={{
classes: {
notchedOutline: classes.notchedOutline,
},
style: {
color: "white",
minHeight: 50,
},
}}
/>
<Button
color="primary"
style={{ maxWidth: 50, marginLeft: 15 }}
variant="outlined"
onClick={() => {
inputFields.push({
"name": "",
"required": false
})
setInputFields(inputFields)
setUpdate(Math.random());
}}
>
<AddIcon style={{}} />
</Button>
</div>
)
})}
*/}
</span>
: null}
<Tooltip color="primary" title={"Add more details"} placement="top">
<Tooltip color="primary" title={"Add more details"} placement="top">
<IconButton
style={{ color: "white", margin: "auto", marginTop: 10, textAlign: "center", width: 50,}}
onClick={() => {
+61 -71
View File
@@ -2234,23 +2234,23 @@ const ParsedAction = (props) => {
parsedPaths = GetParsedPaths(innerdata.example, "");
}
const coverColor = "#82ccc3"
//menuPosition.left -= 50
//menuPosition.top -= 250
//console.log("POS: ", menuPosition1)
var menuPosition1 = menuPosition
if (menuPosition1 === null) {
menuPosition1 = {
"left": 0,
"top": 0,
}
} else if (menuPosition1.top === null || menuPosition1.top === undefined) {
menuPosition1.top = 0
} else if (menuPosition1.left === null || menuPosition1.left === undefined) {
menuPosition1.left = 0
}
const coverColor = "#82ccc3"
//menuPosition.left -= 50
//menuPosition.top -= 250
//console.log("POS: ", menuPosition1)
var menuPosition1 = menuPosition
if (menuPosition1 === null) {
menuPosition1 = {
"left": 0,
"top": 0,
}
} else if (menuPosition1.top === null || menuPosition1.top === undefined) {
menuPosition1.top = 0
} else if (menuPosition1.left === null || menuPosition1.left === undefined) {
menuPosition1.left = 0
}
//console.log("POS1: ", menuPosition1)
//console.log("POS1: ", menuPosition1)
return parsedPaths.length > 0 ? (
<NestedMenuItem
@@ -2274,11 +2274,10 @@ const ParsedAction = (props) => {
handleItemClick([innerdata]);
}}
>
<Paper style={{minHeight: 500, maxHeight: 500, minWidth: 275, maxWidth: 275, position: "fixed", top: menuPosition1.top-200, left: menuPosition1.left-455, padding: "10px 0px 10px 10px", overflow: "hidden", overflowY: "auto", border: "1px solid rgba(255,255,255,0.3)",}}>
<Paper style={{minHeight: 500, maxHeight: 500, minWidth: 275, maxWidth: 275, position: "fixed", top: menuPosition1.top-200, left: menuPosition1.left-450, padding: "10px 0px 10px 10px", overflow: "hidden", overflowY: "auto", border: "1px solid rgba(255,255,255,0.3)",}}>
<MenuItem
key={innerdata.name}
style={{
backgroundColor: theme.palette.inputColor,
marginLeft: 15,
color: "white",
minWidth: 250,
@@ -2303,29 +2302,28 @@ const ParsedAction = (props) => {
//<VpnKeyIcon style={iconStyle} />
const icon =
pathdata.type === "value" ? (
<span style={{marginLeft: 9, }} />
<span style={{marginLeft: 9, }} />
) : pathdata.type === "list" ? (
<FormatListNumberedIcon style={{marginLeft: 9, marginRight: 10, }} />
) : (
<CircleIcon style={{marginLeft: 9, marginRight: 10, color: coverColor}}/>
<CircleIcon style={{marginLeft: 9, marginRight: 10, color: coverColor}}/>
);
//<ExpandMoreIcon style={iconStyle} />
const indentation_count = (pathdata.name.match(/\./g) || []).length+1
const baseIndent = <div style={{marginLeft: 20, height: 30, width: 1, backgroundColor: coverColor,}} />
//const boxPadding = pathdata.type === "object" ? "10px 0px 0px 0px" : 0
const boxPadding = 0
const namesplit = pathdata.name.split(".")
const newname = namesplit[namesplit.length-1]
return (
const indentation_count = (pathdata.name.match(/\./g) || []).length+1
const baseIndent = <div style={{marginLeft: 20, height: 30, width: 1, backgroundColor: coverColor,}} />
//const boxPadding = pathdata.type === "object" ? "10px 0px 0px 0px" : 0
const boxPadding = 0
const namesplit = pathdata.name.split(".")
const newname = namesplit[namesplit.length-1]
return (
<MenuItem
key={pathdata.name}
style={{
backgroundColor: theme.palette.inputColor,
color: "white",
minWidth: 250,
maxWidth: 250,
padding: boxPadding,
padding: boxPadding,
}}
value={pathdata}
onMouseOver={() => {
@@ -2341,35 +2339,31 @@ const ParsedAction = (props) => {
placement="left"
>
<div style={{ display: "flex", height: 30, }}>
{Array(indentation_count).fill().map((subdata, subindex) => {
return (
baseIndent
)
})}
{icon} {newname}
{pathdata.type === "list" ? <SquareFootIcon style={{marginleft: 10, }} onClick={(e) => {
e.preventDefault()
e.stopPropagation()
{Array(indentation_count).fill().map((subdata, subindex) => {
return (
baseIndent
)
})}
{icon} {newname}
{pathdata.type === "list" ? <SquareFootIcon style={{marginleft: 10, }} onClick={(e) => {
e.preventDefault()
e.stopPropagation()
console.log("INNER: ", innerdata, pathdata)
// Removing .list from autocomplete
var newname = pathdata.name
if (newname.length > 5) {
newname = newname.slice(0, newname.length-5)
}
selectedActionParameters[count].value += `{{ $${innerdata.name}.${newname} | size }}`
selectedAction.parameters[count].value = selectedActionParameters[count].value;
setSelectedAction(selectedAction);
setUpdate(Math.random());
setShowDropdown(false);
setMenuPosition(null);
// innerdata.name
// pathdata.name
//handleItemClick([innerdata, newpathdata])
//console.log("CLICK LENGTH!")
}} /> : null}
console.log("INNER: ", innerdata, pathdata)
// Removing .list from autocomplete
var newname = pathdata.name
if (newname.length > 5) {
newname = newname.slice(0, newname.length-5)
}
selectedActionParameters[count].value += `{{ $${innerdata.name}.${newname} | size }}`
selectedAction.parameters[count].value = selectedActionParameters[count].value;
setSelectedAction(selectedAction);
setUpdate(Math.random());
setShowDropdown(false);
setMenuPosition(null);
}} /> : null}
</div>
</Tooltip>
</MenuItem>
@@ -2747,7 +2741,6 @@ const ParsedAction = (props) => {
paddingRight: 0,
}}
onClick={() => {
console.log("FIND EXAMPLE RESULTS FOR ", selectedAction);
if (workflowExecutions.length > 0) {
// Look for the ID
const found = false;
@@ -2756,11 +2749,6 @@ const ParsedAction = (props) => {
continue;
}
// Enforces it to show at least one
//if (workflowExecutions[key].execution_argument.includes("too large") && key !== workflowExecutions.length - 1) {
// continue
//}
var foundResult = workflowExecutions[key].results.find(
(result) => result.action.id === selectedAction.id
)
@@ -2769,14 +2757,14 @@ const ParsedAction = (props) => {
continue;
}
const oldstartnode = cy.getElementById(selectedAction.id);
console.log("FOUND NODe: ", oldstartnode)
if (oldstartnode !== undefined && oldstartnode !== null) {
const foundname = oldstartnode.data("label")
if (foundname !== undefined && foundname !== null) {
foundResult.action.label = foundname
}
}
const oldstartnode = cy.getElementById(selectedAction.id);
console.log("FOUND NODe: ", oldstartnode)
if (oldstartnode !== undefined && oldstartnode !== null) {
const foundname = oldstartnode.data("label")
if (foundname !== undefined && foundname !== null) {
foundResult.action.label = foundname
}
}
setSelectedResult(foundResult);
if (setCodeModalOpen !== undefined) {
@@ -3354,6 +3342,8 @@ const ParsedAction = (props) => {
style={{
backgroundColor: theme.palette.inputColor,
color: "white",
maxWidth: 500,
overflowX: "auto",
}}
value={data}
>
@@ -61,10 +61,11 @@ import { tags as t } from '@lezer/highlight';
const liquidFilters = [
{"name": "Size", "value": "size", "example": ""},
{"name": "Date", "value": `date: "%Y%m%d"`, "example": `{{ "now" | date: "%s" }}`},
{"name": "Default", "value": `default: []`, "example": `{{ "" | default: "no input" }}`},
{"name": "Split", "value": `split: ","`, "example": `{{ "this,can,become,a,list" | split: "," }}`},
{"name": "Join", "value": `join: ","`, "example": `{{ ["this","can","become","a","string"] | join: "," }}`},
{"name": "Size", "value": "size", "example": ""},
{"name": "Date", "value": `date: "%Y%m%d"`, "example": `{{ "now" | date: "%s" }}`},
{"name": "Escape String", "value": `{{ \"\"\"'string with weird'" quotes\"\"\" | escape_string }}`, "example": ``},
{"name": "Flatten", "value": `flatten`, "example": `{{ [1, [1, 2], [2, 3, 4]] | flatten }}`},
{"name": "URL encode", "value": `url_encode`, "example": `{{ "https://www.google.com/search?q=hello world" | url_encode }}`},
+130 -51
View File
@@ -80,6 +80,7 @@ import {
Visibility as VisibilityIcon,
Done as DoneIcon,
Close as CloseIcon,
DragIndicator as DragIndicatorIcon,
Error as ErrorIcon,
Warning as WarningIcon,
ArrowLeft as ArrowLeftIcon,
@@ -250,6 +251,7 @@ function useWindowSize() {
function updateSize() {
setSize([window.innerWidth, window.innerHeight]);
}
window.addEventListener("resize", updateSize);
updateSize();
return () => window.removeEventListener("resize", updateSize);
@@ -598,9 +600,29 @@ const AngularWorkflow = (defaultprops) => {
const unloadText = "Are you sure you want to leave without saving (CTRL+S)?";
const classes = useStyles();
const [bodyWidth, bodyHeight] = useWindowSize()
//console.log("Mobile: ", isMobile, bodyWidth, bodyHeight)
var [bodyWidth, bodyHeight] = useWindowSize()
const cytoscapeWidth = isMobile ? bodyWidth - leftBarSize : bodyWidth - leftBarSize - 25
/*
// Zoom testing to try autofixing for small screens
if (document !== undefined && document !== null && !isMobile) {
const currentZoom = document.body.style.zoom;
if (bodyWidth < 1367 || bodyHeight < 769) {
console.log("LOWER ZOOM")
document.body.style.zoom = "80%"
bodyWidth = bodyWidth*0.8
bodyHeight = bodyHeight*0.8
} else {
console.log("RESET ZOOM")
document.body.style.zoom = "100%"
}
}
console.log("Width, height: ", bodyWidth, bodyHeight)
*/
//console.log("Mobile: ", isMobile, bodyWidth, bodyHeight)
const [elements, setElements] = useState([]);
const [loopRunning, setLoopRunning] = useState(false)
@@ -7691,7 +7713,7 @@ const AngularWorkflow = (defaultprops) => {
marginTop: 1,
overflowY: "auto",
overflowX: "hidden",
};
}
const handleAppDrag = (e, app) => {
const cycontainer = cy.container();
@@ -8426,6 +8448,7 @@ const AngularWorkflow = (defaultprops) => {
</div>
)
})}
{visibleApps.length <= 4 ? (
<div
style={{ textAlign: "center", width: leftBarSize, marginTop: 40, maxWidth: 340, overflow: "hidden", }}
@@ -8444,7 +8467,10 @@ const AngularWorkflow = (defaultprops) => {
</Index>
</InstantSearch>
</div>
) : null}
) :
<div
style={{marginTop: 100, }}
/>}
</div>
) : apps.length > 0 ? (
<div
@@ -8993,7 +9019,7 @@ const AngularWorkflow = (defaultprops) => {
const AppConditionHandler = (props) => {
const { tmpdata, type } = props;
const [data] = useState({...tmpdata});
const [data] = useState(tmpdata);
const [multiline, setMultiline] = useState(false);
const [showAutocomplete, setShowAutocomplete] = React.useState(false);
const [actionlist, setActionlist] = React.useState([]);
@@ -9595,9 +9621,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem
style={menuItemStyle}
onClick={(e) => {
const newConditionValue = { ...conditionValue };
newConditionValue.value = "equals";
setConditionValue(newConditionValue);
conditionValue.value = "equals";
setConditionValue(conditionValue);
setVariableAnchorEl(null);
}}
key={"equals"}
@@ -9607,9 +9632,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem
style={menuItemStyle}
onClick={(e) => {
const newConditionValue = { ...conditionValue };
newConditionValue.value = "does not equal";
setConditionValue(newConditionValue);
conditionValue.value = "does not equal";
setConditionValue(conditionValue);
setVariableAnchorEl(null);
}}
key={"does not equal"}
@@ -9619,9 +9643,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem
style={menuItemStyle}
onClick={(e) => {
const newConditionValue = { ...conditionValue };
newConditionValue.value = "startswith";
setConditionValue(newConditionValue);
conditionValue.value = "startswith";
setConditionValue(conditionValue);
setVariableAnchorEl(null);
}}
key={"starts with"}
@@ -9631,9 +9654,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem
style={menuItemStyle}
onClick={(e) => {
const newConditionValue = { ...conditionValue };
newConditionValue.value = "endswith";
setConditionValue(newConditionValue);
conditionValue.value = "endswith";
setConditionValue(conditionValue);
setVariableAnchorEl(null);
}}
key={"ends with"}
@@ -9643,9 +9665,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem
style={menuItemStyle}
onClick={(e) => {
const newConditionValue = { ...conditionValue };
newConditionValue.value = "contains";
setConditionValue(newConditionValue);
conditionValue.value = "contains";
setConditionValue(conditionValue);
setVariableAnchorEl(null);
}}
key={"contains"}
@@ -9655,9 +9676,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem
style={menuItemStyle}
onClick={(e) => {
const newConditionValue = { ...conditionValue };
newConditionValue.value = "contains_any_of";
setConditionValue(newConditionValue);
conditionValue.value = "contains_any_of";
setConditionValue(conditionValue);
setVariableAnchorEl(null);
}}
key={"contains_any_of"}
@@ -9667,9 +9687,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem
style={menuItemStyle}
onClick={(e) => {
const newConditionValue = { ...conditionValue };
newConditionValue.value = "matches regex";
setConditionValue(newConditionValue);
conditionValue.value = "matches regex";
setConditionValue(conditionValue);
setVariableAnchorEl(null);
}}
key={"matches regex"}
@@ -9679,9 +9698,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem
style={menuItemStyle}
onClick={(e) => {
const newConditionValue = { ...conditionValue };
newConditionValue.value = "larger than";
setConditionValue(newConditionValue);
conditionValue.value = "larger than";
setConditionValue(conditionValue);
setVariableAnchorEl(null);
}}
key={"larger than"}
@@ -9691,9 +9709,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem
style={menuItemStyle}
onClick={(e) => {
const newConditionValue = { ...conditionValue };
newConditionValue.value = "less than";
setConditionValue(newConditionValue);
conditionValue.value = "less than";
setConditionValue(conditionValue);
setVariableAnchorEl(null);
}}
key={"less than"}
@@ -9703,9 +9720,8 @@ const AngularWorkflow = (defaultprops) => {
<MenuItem
style={menuItemStyle}
onClick={(e) => {
const newConditionValue = { ...conditionValue };
newConditionValue.value = "is empty";
setConditionValue(newConditionValue);
conditionValue.value = "is empty";
setConditionValue(conditionValue);
setVariableAnchorEl(null);
}}
key={"is empty"}
@@ -9873,8 +9889,6 @@ const AngularWorkflow = (defaultprops) => {
marginTop: "15px",
marginLeft: "10px",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
maxWidth: 72,
}}
>
@@ -9894,7 +9908,7 @@ const AngularWorkflow = (defaultprops) => {
flex: 1,
textAlign: "center",
marginTop: "15px",
overflow: "hidden",
overflow: "hidden",
maxWidth: 72,
}}
onClick={() => { }}
@@ -9918,8 +9932,6 @@ const AngularWorkflow = (defaultprops) => {
marginBottom: "auto",
marginLeft: "10px",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
maxWidth: 72,
}}
>
@@ -13582,16 +13594,14 @@ const AngularWorkflow = (defaultprops) => {
},
}}
disabled={
workflow.triggers[selectedTriggerIndex].status === "running"
workflow.triggers[selectedTriggerIndex] === null || workflow.triggers[selectedTriggerIndex] === undefined ? false : workflow.triggers[selectedTriggerIndex].status === "running"
}
fullWidth
rows="6"
multiline
color="primary"
defaultValue={
workflow.triggers[selectedTriggerIndex] !== undefined && workflow.triggers[selectedTriggerIndex].parameters !== undefined && workflow.triggers[selectedTriggerIndex].parameters !== null && workflow.triggers[selectedTriggerIndex].parameters.length > 1 ?
workflow.triggers[selectedTriggerIndex].parameters[1].value
: ""
workflow.triggers[selectedTriggerIndex] !== undefined && workflow.triggers[selectedTriggerIndex].parameters !== undefined && workflow.triggers[selectedTriggerIndex].parameters !== null && workflow.triggers[selectedTriggerIndex].parameters.length > 1 ? workflow.triggers[selectedTriggerIndex].parameters[1].value : ""
}
placeholder='{"example": {"json": "is cool"}}'
onBlur={(e) => {
@@ -13661,11 +13671,16 @@ const AngularWorkflow = (defaultprops) => {
top: isMobile ? 30 : appBarSize + 20,
};
const TopCytoscapeBar = (props) => {
if (workflow.public === true) {
return null
}
const isCorrectOrg = workflow.public === true || userdata.active_org.id === undefined || userdata.active_org.id === null || workflow.org_id === null || workflow.org_id === undefined || workflow.org_id.length === 0 || userdata.active_org.id === workflow.org_id
return (
<div style={topBarStyle}>
<div style={{ margin: "0px 10px 0px 10px" }}>
@@ -13691,7 +13706,7 @@ const AngularWorkflow = (defaultprops) => {
<h2 style={{ margin: 0 }}>{workflow.name}</h2>
</Breadcrumbs>
{workflow.public === true || userdata.active_org.id === undefined || userdata.active_org.id === null || workflow.org_id === null || workflow.org_id === undefined || workflow.org_id.length === 0 || userdata.active_org.id === workflow.org_id ? null :
{isCorrectOrg ? null :
<Typography variant="body1">
<b>Warning</b>: Change <span
style={{color: "#f85a3e", cursor: "pointer"}}
@@ -14053,7 +14068,6 @@ const AngularWorkflow = (defaultprops) => {
)
}
const showErrors = !isMobile && !workflow.public && workflow.errors !== undefined && workflow.errors !== null && workflow.errors.length > 0 ?
<div
style={{
@@ -14068,6 +14082,8 @@ const AngularWorkflow = (defaultprops) => {
>
<Typography variant="body22">
{/*<WarningIcon style={{marginRight: 5, height: 15, width: 15, }} />*/}
<b>Workflow Issues:</b> {workflow.errors.length}
</Typography>
<Typography
@@ -16630,6 +16646,41 @@ const AngularWorkflow = (defaultprops) => {
}
var draggingDisabled = false;
// Should probably put this on the backend instead when notifications are made :))
const getErrorSuggestion = (result) => {
if (result === undefined || result === null) {
return ""
}
if (result.success !== false) {
return ""
}
var stringjson = result
try {
stringjson = JSON.stringify(result)
} catch (e) {
}
console.log("JSON: ", stringjson)
stringjson = stringjson.toLowerCase()
if (stringjson.includes("localhost")) {
return "You can't use localhost in apps. Use the external ip or url of the server instead"
}
if (stringjson.includes("connectionerror")) {
return "Your URL is most likely incorrect."
}
if (stringjson.includes("result too large to handle")) {
return "Execution loading failed. Reload the execution by closing it and clicking it again"
}
return ""
}
const currentSuggestion = getErrorSuggestion(validate.result)
const codePopoutModal = !codeModalOpen ? null : (
<Dialog
PaperComponent={PaperComponent}
@@ -16791,13 +16842,33 @@ const AngularWorkflow = (defaultprops) => {
<VisibilityIcon style={{ color: "white" }} />
</IconButton>
</Tooltip>
<Tooltip
title="Move window"
placement="top"
style={{ zIndex: 10011 }}
>
<IconButton
id="draggable-dialog-title"
style={{
zIndex: 5000,
position: "absolute",
top: 4,
right: 34,
cursor: "move",
}}
onClick={(e) => {
}}
>
<DragIndicatorIcon style={{ color: "white" }} />
</IconButton>
</Tooltip>
<Tooltip
title="Close window"
placement="top"
style={{ zIndex: 10011 }}
>
<IconButton
style={{ zIndex: 5000, position: "absolute", top: 4, right: 34 }}
style={{ zIndex: 5000, position: "absolute", top: 4, right: 4, }}
onClick={(e) => {
e.preventDefault();
setCodeModalOpen(false);
@@ -16836,12 +16907,20 @@ const AngularWorkflow = (defaultprops) => {
>
<b>{selectedResult.action.label.replaceAll("_", " ")}</b>
</div>
<div style={{ fontSize: 14 }}>{selectedResult.action.name}</div>
<div style={{ fontSize: 14, color: "rgba(255,255,255,0.6)", }}>{selectedResult.action.name}</div>
</div>
</div>
<div style={{ marginBottom: 5 }}>
<b>Status </b> {selectedResult.status}
</div>
{currentSuggestion.length > 0 ?
<div style={{ marginBottom: 5 }}>
<b style={{color: "rgba(214,110,117)", }}>Debug Info:</b> {currentSuggestion}
</div>
:
<div style={{ marginBottom: 5 }}>
<b>Status </b> {selectedResult.status}
</div>
}
{validate.valid ? (
<ReactJson
+1 -1
View File
@@ -103,7 +103,7 @@ const appIconStyle = {
marginLeft: "5px",
};
const useStyles = makeStyles({
export const useStyles = makeStyles({
notchedOutline: {
borderColor: "#f85a3e !important",
},
+3 -3
View File
@@ -715,7 +715,7 @@ const Docs = (defaultprops) => {
margin: "auto",
marginTop: 50,
}}>
<Typography variant="h4" style={{ textAlign: "center", }}>
<Typography variant="h4" style={{ textAlign: "center", marginTop: 20 }}>
Documentation
</Typography>
<div style={{ display: "flex", marginTop: 25, }}>
@@ -938,7 +938,7 @@ const Docs = (defaultprops) => {
<Divider
style={{
marginTop: "10px",
marginBottom: "10px",
marginBottom: 30,
backgroundColor: dividerColor,
}}
/>
@@ -957,7 +957,7 @@ const Docs = (defaultprops) => {
// Padding and zIndex etc set because of footer in cloud.
const loadedCheck = (
<div style={{ minHeight: 1000, paddingBottom: 100, zIndex: 50000, maxWidth: 1920, minWidth: 1366, margin: "auto", }}>
<div style={{ minHeight: 1000, paddingBottom: 100, zIndex: 50000, maxWidth: 1920, minWidth: isMobile ? null : 1366, margin: "auto", }}>
<BrowserView>{postDataBrowser}</BrowserView>
<MobileView>{postDataMobile}</MobileView>
</div>
+13
View File
@@ -333,6 +333,19 @@ const RunWorkflow = (defaultprops) => {
"execution_argument": executionArgument
}
if (workflow.start !== undefined && workflow.start !== null && workflow.start.length > 0) {
data.start = workflow.start
} else {
if (workflow.actions !== undefined && workflow.actions !== null && workflow.actions.length > 0) {
for (let actionkey in workflow.actions) {
if (workflow.actions[actionkey].isStartNode) {
data.start = workflow.actions[actionkey].id
break
}
}
}
}
var url = `${globalUrl}/api/v1/workflows/${props.match.params.key}/execute`
var fetchBody = {
headers: {