diff --git a/frontend/public/images/workflows/tenzir2.png b/frontend/public/images/workflows/tenzir2.png new file mode 100644 index 00000000..12c702bc Binary files /dev/null and b/frontend/public/images/workflows/tenzir2.png differ diff --git a/frontend/public/images/workflows/user_input.svg b/frontend/public/images/workflows/user_input.svg new file mode 100644 index 00000000..0ee42314 --- /dev/null +++ b/frontend/public/images/workflows/user_input.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/components/CacheView.jsx b/frontend/src/components/CacheView.jsx index 89cde359..607e0030 100644 --- a/frontend/src/components/CacheView.jsx +++ b/frontend/src/components/CacheView.jsx @@ -4,6 +4,7 @@ import { toast } from 'react-toastify'; import ReactJson from "react-json-view"; import { + Typography, Tooltip, Divider, TextField, @@ -21,6 +22,8 @@ import { } from "@mui/material"; import { + Link as LinkIcon, + AutoFixHigh as AutoFixHighIcon, Edit as EditIcon, FileCopy as FileCopyIcon, SelectAll as SelectAllIcon, @@ -79,7 +82,6 @@ const CacheView = (props) => { useEffect(() => { listOrgCache(orgId); - console.log("orgid", orgId); }, []); const listOrgCache = (orgId) => { @@ -189,8 +191,6 @@ const CacheView = (props) => { const editOrgCache = (orgId) => { const cache = { key: dataValue.key , value: value }; setCacheInput([cache]); - console.log("cache:", cache) - console.log("cache input: ", cacheInput) fetch(globalUrl + `/api/v1/orgs/${orgId}/set_cache`, { @@ -255,6 +255,20 @@ const CacheView = (props) => { }); }; + const isValidJson = validateJson(value) + const autoFixJson = (inputvalue) => { + console.log("inputvalue: ", inputvalue) + try { + var parsedjson = JSON.parse(inputvalue) + + // setValue() with the parsed json as string + setValue(JSON.stringify(parsedjson, null, 2)) + } catch (e) { + console.log("Error parsing JSON: ", e) + //return JSON.stringify(inputvalue); + } + } + const modalView = ( // console.log("key:", dataValue.key), //console.log("value:",dataValue.value), @@ -301,14 +315,27 @@ const CacheView = (props) => { onChange={(e) => setKey(e.target.value)} /> -
- Value +
+
+ + Value - ({isValidJson.valid === true ? "Valid" : "Invalid"} JSON) + + + { + autoFixJson(value) + }} + > + + + +
{ id="Valuefield" margin="normal" variant="outlined" - defaultValue={editCache ? dataValue.value : ""} + multiline + minRows={4} + maxRows={12} + //defaultValue={editCache ? dataValue.value : ""} + value={value} onChange={(e) => setValue(e.target.value)} />
@@ -417,10 +456,8 @@ const CacheView = (props) => { } const validate = validateJson(data.value); - console.log("Past validate: ", validate); - return ( - + { /> @@ -473,7 +510,11 @@ const CacheView = (props) => { style={{ padding: "6px" }} onClick={() => { setEditCache(true) - setDataValue({"key":data.key,"value":data.value}) + setDataValue({ + "key": data.key, + "value":data.value + }) + setValue(data.value) setModalOpen(true) }} > @@ -483,9 +524,27 @@ const CacheView = (props) => { + + + { + window.open(`${globalUrl}/api/v1/orgs/${orgId}/cache/${data.key}?type=text&authorization=${data.public_authorization}`, "_blank"); + }} + > + + + + diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index 984ebb30..2c5175eb 100755 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -1261,7 +1261,7 @@ If you're interested, please let me know a time that works for you, or set up a }; const rerunCloudWorkflows = (environment) => { - toast("Starting execution reruns. This can run in the background.") + toast("Starting execution reruns. This can run in the background.") fetch( `${globalUrl}/api/v1/environments/${environment.id}/rerun`, { @@ -1292,6 +1292,7 @@ If you're interested, please let me know a time that works for you, or set up a const abortEnvironmentWorkflows = (environment) => { //console.log("Aborting all workflows started >10 minutes ago, not finished"); + toast("Clearing the queue - this may take some time. A new will show up when finished.") fetch( `${globalUrl}/api/v1/environments/${environment.id}/stop?deleteall=true`, @@ -1306,7 +1307,9 @@ If you're interested, please let me know a time that works for you, or set up a toast("Failed aborting dangling workflows"); return; } else { - toast("Aborted all dangling workflows"); + toast("Successfully cleared the queue") + + getEnvironments() } return response.json(); @@ -4597,7 +4600,6 @@ If you're interested, please let me know a time that works for you, or set up a + +
+ + + const ScheduleSidebar = Object.getOwnPropertyNames(selectedTrigger).length === 0 || workflow.triggers[selectedTriggerIndex] === undefined && selectedTrigger.trigger_type !== "SCHEDULE" ? null :
@@ -13211,7 +13494,7 @@ const AngularWorkflow = (defaultprops) => { workflow.triggers[selectedTriggerIndex].parameters === undefined ? "" : workflow.triggers[selectedTriggerIndex].parameters[0].value } color="primary" - placeholder="defaultValue" + placeholder="" onBlur={(e) => { setTriggerCronWrapper(e.target.value); }} @@ -13801,10 +14084,8 @@ const AngularWorkflow = (defaultprops) => {
: null - - const RightsideBar = () => { - const [hovered, setHovered] = useState(false) + const [hovered, setHovered] = useState(false) useEffect(() => { const handleKeyDown = (event) => { @@ -13856,9 +14137,8 @@ const AngularWorkflow = (defaultprops) => { return () => { document.removeEventListener('keydown', handleKeyDown); - }; - }, [executeWorkflow, executionText, workflow, lastSaved, executionRequestStarted]); - + } + }, [executeWorkflow, executionText, workflow, lastSaved, executionRequestStarted]) return (
{ } const boxSize = isMobile ? 50 : 100; - - const executionButton = executionRunning ? ( @@ -14333,6 +14611,8 @@ const AngularWorkflow = (defaultprops) => { defaultReturn = null } else if (selectedTrigger.trigger_type === "SUBFLOW") { defaultReturn = + // } else if (selectedTrigger.trigger_type === "PIPELINE") { + // defaultReturn = } else if (selectedTrigger.trigger_type === "EMAIL") { defaultReturn = } else if (selectedTrigger.trigger_type === "USERINPUT") { @@ -16317,7 +16597,7 @@ const AngularWorkflow = (defaultprops) => { style: { pointerEvents: "auto", color: "white", - minWidth: isMobile ? "90%" : 650, + minWidth: isMobile ? "90%" : 750, padding: 30, maxHeight: 550, overflowY: "auto", @@ -16327,17 +16607,19 @@ const AngularWorkflow = (defaultprops) => { }, }} > - + {/* Have a sticky top bar */} + { @@ -16356,7 +16638,7 @@ const AngularWorkflow = (defaultprops) => { style={{ zIndex: 5000, position: "absolute", - top: 34, + top: 4, right: 170, }} onClick={(e) => { @@ -16400,7 +16682,7 @@ const AngularWorkflow = (defaultprops) => { style={{ zIndex: 5000, position: "absolute", - top: 34, + top: 4, right: 136, }} onClick={(e) => { @@ -16440,7 +16722,7 @@ const AngularWorkflow = (defaultprops) => { style={{ zIndex: 10011 }} > { e.preventDefault(); const executionIndex = workflowExecutions.findIndex((data) => data.execution_id === selectedResult.execution_id); @@ -16470,7 +16752,7 @@ const AngularWorkflow = (defaultprops) => { style={{ zIndex: 10011 }} > { e.preventDefault(); setCodeModalOpen(false); @@ -16481,8 +16763,8 @@ const AngularWorkflow = (defaultprops) => { -
-
+
+
{curapp === null ? null : ( {selectedResult.action.app_name} { {/* Looks for triggers" */} {/* Only fixed the ones that require scrolling on a small screen */} {/* Most important: Actions. But these are a lot more complex */} - {rightSideBarOpen && (selectedTrigger.trigger_type === "SCHEDULE" || selectedTrigger.trigger_type === "WEBHOOK") ? + {rightSideBarOpen && (selectedTrigger.trigger_type === "SCHEDULE" || selectedTrigger.trigger_type === "WEBHOOK" || selectedTrigger.trigger_type === "PIPELINE") ?
{Object.getOwnPropertyNames(selectedTrigger).length > 0 ? selectedTrigger.trigger_type === "SCHEDULE" ? ScheduleSidebar + : selectedTrigger.trigger_type === "PIPELINE" ? + PipelineSidebar : selectedTrigger.trigger_type === "WEBHOOK" ? WebhookSidebar : null @@ -18404,14 +18688,14 @@ const AngularWorkflow = (defaultprops) => { {newView} - {executionArgumentModal} - {aiQueryModal} + {aiQueryModal} {conditionsModal} - {authenticationModal} {codePopoutModal} - {configureWorkflowModal} - {/*editWorkflowModal*/} {workflowRevisions} + {authenticationModal} + {/*editWorkflowModal*/} + {executionArgumentModal} + {configureWorkflowModal} {codeEditorModalOpen ? diff --git a/frontend/src/views/Docs.jsx b/frontend/src/views/Docs.jsx index 027aad59..03d5ceda 100755 --- a/frontend/src/views/Docs.jsx +++ b/frontend/src/views/Docs.jsx @@ -118,8 +118,6 @@ export const Img = (props) => { export const CodeHandler = (props) => { const propvalue = props.value !== undefined && props.value !== null ? props.value : props.children !== undefined && props.children !== null && props.children.length > 0 ? props.children[0] : "" - - const validate = validateJson(propvalue) var newprop = propvalue @@ -137,6 +135,17 @@ export const CodeHandler = (props) => { //} } + // Need to check if it's singletick or multi + console.log("PROP: ", propvalue, props) + if (props.inline === true) { + // Show it inline + return ( + + {newprop} + + ) + } + return (
{ maxWidth: "100%", backgroundColor: theme.palette.inputColor, overflowY: "auto", + // Have it inline + borderRadius: theme.palette.borderRadius, }} > {validate.valid === true ? diff --git a/functions/onprem/orborus/orborus.go b/functions/onprem/orborus/orborus.go index 80ac4713..f175595e 100755 --- a/functions/onprem/orborus/orborus.go +++ b/functions/onprem/orborus/orborus.go @@ -1822,7 +1822,6 @@ func deployPipeline(image, identifier, command string) error { envVariables := []string{ } - config := &container.Config{ Image: image, Env: envVariables, @@ -1831,6 +1830,7 @@ func deployPipeline(image, identifier, command string) error { // Add label to container in case of zombies config.Labels = map[string]string{ + "name": identifier, "shuffle": "shuffle", } @@ -1920,7 +1920,7 @@ func handlePipeline(incRequest shuffle.ExecutionRequest) error { } image := "tenzir/tenzir:latest" - identifier := strings.ToLower(strings.ReplaceAll(incRequest.ExecutionSource, " ", "-")) + identifier := fmt.Sprintf("shuffle-%s", strings.ToLower(strings.ReplaceAll(incRequest.ExecutionSource, " ", "-"))) command := incRequest.ExecutionArgument if incRequest.Type == "PIPELINE_CREATE" {