Added Docs update, missing images and Tenzir pipelines
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -0,0 +1,30 @@
|
||||
<svg width="65" height="65" viewBox="0 0 65 65" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g filter="url(#filter0_d_664_86)">
|
||||
<path d="M20.8949 0.10511L44.3722 0.215745L60.8949 16.8949L60.7843 40.3722L44.1051 56.8949L20.6278 56.7843L4.10509 40.1051L4.21573 16.6278L20.8949 0.10511Z" fill="white"/>
|
||||
<path d="M26.9991 33.4724C26.9991 33.4724 26.3275 34.4036 25.8817 35.2943C25.4359 36.1851 25.1401 36.9702 25.9567 37.9138C26.7733 38.8573 28.8845 41.4235 28.8845 41.4235C29.2593 41.7748 29.7876 41.9749 30.3423 41.9749C31.417 41.9749 33.1747 41.9749 34.9146 41.9749C37.2892 41.9749 38.8723 40.2744 38.8723 38.5739C38.8723 38.5739 38.8723 33.6344 38.8723 32.1768" fill="white"/>
|
||||
<path d="M26.9991 33.4724C26.9991 33.4724 26.3275 34.4036 25.8817 35.2943C25.4359 36.1851 25.1401 36.9702 25.9567 37.9138C26.7733 38.8573 28.8845 41.4235 28.8845 41.4235C29.2593 41.7748 29.7876 41.9749 30.3423 41.9749C31.417 41.9749 33.1747 41.9749 34.9146 41.9749C37.2892 41.9749 38.8723 40.2744 38.8723 38.5739C38.8723 38.5739 38.8723 33.6344 38.8723 32.1768" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M35.9043 32.533C35.9043 32.533 35.9043 32.416 35.9043 31.9986C35.9043 29.8608 38.8726 29.8608 38.8726 31.9986" fill="white"/>
|
||||
<path d="M35.9043 32.533C35.9043 32.533 35.9043 32.416 35.9043 31.9986C35.9043 29.8608 38.8726 29.8608 38.8726 31.9986" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M32.9355 31.6424C32.9355 31.6424 32.9355 31.4108 32.9355 30.576C32.9355 28.4382 35.9038 28.4382 35.9038 30.576C35.9038 30.7847 35.9038 30.8992 35.9038 31.108C35.9038 31.5254 35.9038 33.2048 35.9038 33.2048" fill="white"/>
|
||||
<path d="M32.9355 31.6424C32.9355 31.6424 32.9355 31.4108 32.9355 30.576C32.9355 28.4382 35.9038 28.4382 35.9038 30.576C35.9038 30.7847 35.9038 30.8992 35.9038 31.108C35.9038 31.5254 35.9038 33.2048 35.9038 33.2048" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M29.9678 33.0877C29.9678 33.0877 29.9678 30.7582 29.9678 29.7147C29.9678 27.5769 32.9361 27.5769 32.9361 29.7147C32.9361 29.7147 32.9361 29.8303 32.9361 30.039C32.9361 30.8738 32.9361 33.0877 32.9361 33.0877" fill="white"/>
|
||||
<path d="M29.9678 33.0877C29.9678 33.0877 29.9678 30.7582 29.9678 29.7147C29.9678 27.5769 32.9361 27.5769 32.9361 29.7147C32.9361 29.7147 32.9361 29.8303 32.9361 30.039C32.9361 30.8738 32.9361 33.0877 32.9361 33.0877" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M29.9673 33.0877C29.9673 33.0877 29.9673 30.3477 29.9673 29.3041C29.9673 28.2207 29.9673 27.1211 29.9673 26.0074C29.9673 25.2326 29.3028 24.6055 28.4832 24.6055C27.6635 24.6055 26.999 25.2336 26.999 26.0084V33.5129V36.3187" fill="white"/>
|
||||
<path d="M29.9673 33.0877C29.9673 33.0877 29.9673 30.3477 29.9673 29.3041C29.9673 28.2207 29.9673 27.1211 29.9673 26.0074C29.9673 25.2326 29.3028 24.6055 28.4832 24.6055C27.6635 24.6055 26.999 25.2336 26.999 26.0084V33.5129V36.3187" stroke="black" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M21.4712 22.328C20.6431 25.2768 21.928 28.2116 24.89 29.0452C25.1191 29.1096 25.3619 28.9736 25.4262 28.7446C25.4905 28.5155 25.3541 28.2728 25.125 28.2083C22.6374 27.5083 21.6073 25.0613 22.3087 22.5636C23.0083 20.0724 25.6067 18.616 28.1003 19.3177C30.5939 20.0195 32.0537 22.6178 31.3541 25.1091C31.2898 25.3381 31.4262 25.5809 31.6553 25.6453C31.8844 25.7098 32.1272 25.5738 32.1915 25.3448C33.0212 22.3905 31.2921 19.313 28.3353 18.4809C25.3785 17.6488 22.3009 19.3737 21.4712 22.328Z" fill="black" stroke="black" stroke-width="0.1"/>
|
||||
<line x1="32.3496" y1="23.7195" x2="38.6004" y2="23.7195" stroke="black"/>
|
||||
<circle cx="41.7252" cy="23.5946" r="4.37557" fill="black"/>
|
||||
</g>
|
||||
<defs>
|
||||
<filter id="filter0_d_664_86" x="0" y="0" width="65" height="65" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
||||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
||||
<feOffset dy="4"/>
|
||||
<feGaussianBlur stdDeviation="2"/>
|
||||
<feComposite in2="hardAlpha" operator="out"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
|
||||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_664_86"/>
|
||||
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_664_86" result="shape"/>
|
||||
</filter>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.3 KiB |
@@ -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)}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ paddingLeft: "30px", paddingRight: '30px' }}>
|
||||
Value
|
||||
<div style={{ paddingLeft: 30, paddingRight: 30 }}>
|
||||
<div style={{display: "flex", }}>
|
||||
<Typography style={{marginTop: 25, marginBottom: 0, flex: 20, }}>
|
||||
Value - ({isValidJson.valid === true ? "Valid" : "Invalid"} JSON)
|
||||
</Typography>
|
||||
<Tooltip title="Auto Fix JSON" placement="right">
|
||||
<IconButton
|
||||
style={{flex: 1, }}
|
||||
onClick={() => {
|
||||
autoFixJson(value)
|
||||
}}
|
||||
>
|
||||
<AutoFixHighIcon />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<TextField
|
||||
color="primary"
|
||||
style={{ backgroundColor: theme.palette.inputColor }}
|
||||
style={{ backgroundColor: theme.palette.inputColor, marginTop: 0, }}
|
||||
InputProps={{
|
||||
style: {
|
||||
height: "50px",
|
||||
color: "white",
|
||||
fontSize: "1em",
|
||||
},
|
||||
@@ -320,14 +347,22 @@ const CacheView = (props) => {
|
||||
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)}
|
||||
/>
|
||||
</div>
|
||||
<DialogActions style={{ paddingLeft: "30px", paddingRight: '30px' }}>
|
||||
<Button
|
||||
style={{ borderRadius: "0px" }}
|
||||
onClick={() => setModalOpen(false)}
|
||||
onClick={() => {
|
||||
setModalOpen(false)
|
||||
setValue("")
|
||||
setDataValue({})
|
||||
}}
|
||||
color="primary"
|
||||
>
|
||||
Cancel
|
||||
@@ -337,6 +372,9 @@ const CacheView = (props) => {
|
||||
style={{ borderRadius: "0px" }}
|
||||
onClick={() => {
|
||||
{editCache ? editOrgCache(orgId) : addOrgCache(orgId)}
|
||||
|
||||
setValue("")
|
||||
setDataValue({})
|
||||
}}
|
||||
color="primary"
|
||||
>
|
||||
@@ -371,8 +409,9 @@ const CacheView = (props) => {
|
||||
onClick={() =>{
|
||||
setEditCache(false)
|
||||
setModalOpen(true)
|
||||
}
|
||||
}
|
||||
|
||||
setValue("")
|
||||
}}
|
||||
>
|
||||
Add Cache
|
||||
</Button>
|
||||
@@ -417,10 +456,8 @@ const CacheView = (props) => {
|
||||
}
|
||||
|
||||
const validate = validateJson(data.value);
|
||||
console.log("Past validate: ", validate);
|
||||
|
||||
return (
|
||||
<ListItem key={index} style={{ backgroundColor: bgColor }}>
|
||||
<ListItem key={index} style={{ backgroundColor: bgColor, maxHeight: 300, overflow: "hidden", }}>
|
||||
<ListItemText
|
||||
style={{
|
||||
maxWidth: 250,
|
||||
@@ -458,8 +495,8 @@ const CacheView = (props) => {
|
||||
/>
|
||||
<ListItemText
|
||||
style={{
|
||||
maxWidth: 150,
|
||||
minWidth: 150,
|
||||
maxWidth: 200,
|
||||
minWidth: 200,
|
||||
marginLeft: 50,
|
||||
}}
|
||||
primary=<span style={{ display: "inline" }}>
|
||||
@@ -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) => {
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
title={"Public URL (types: text, raw, json)"}
|
||||
style={{ marginLeft: 0, }}
|
||||
aria-label={"Public URL"}
|
||||
>
|
||||
<span>
|
||||
<IconButton
|
||||
style={{ padding: "6px" }}
|
||||
disabled={data.public_authorization === undefined || data.public_authorization === null || data.public_authorization === "" ? true : false}
|
||||
onClick={() => {
|
||||
window.open(`${globalUrl}/api/v1/orgs/${orgId}/cache/${data.key}?type=text&authorization=${data.public_authorization}`, "_blank");
|
||||
}}
|
||||
>
|
||||
<LinkIcon
|
||||
/>
|
||||
</IconButton>
|
||||
</span>
|
||||
</Tooltip>
|
||||
<Tooltip
|
||||
title={"Delete item"}
|
||||
style={{ marginLeft: 15, }}
|
||||
style={{ marginLeft: 25, }}
|
||||
aria-label={"Delete"}
|
||||
>
|
||||
<span>
|
||||
|
||||
@@ -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
|
||||
<Button
|
||||
variant={"outlined"}
|
||||
style={{ }}
|
||||
disabled={isCloud && environment.Name.toLowerCase() !== "cloud"}
|
||||
onClick={() => {
|
||||
console.log("Should clear executions for: ", environment);
|
||||
|
||||
|
||||
@@ -162,7 +162,6 @@ export const triggers = [
|
||||
environment: "onprem",
|
||||
long_description: "Create a schedule based on cron",
|
||||
},
|
||||
|
||||
{
|
||||
name: "Office365",
|
||||
type: "TRIGGER",
|
||||
@@ -218,6 +217,19 @@ export const triggers = [
|
||||
environment: "cloud",
|
||||
long_description: "Take user input to continue execution",
|
||||
},
|
||||
{
|
||||
name: "Pipelines by Tenzir",
|
||||
type: "TRIGGER",
|
||||
status: "uninitialized",
|
||||
description: "BETA: Support only",
|
||||
trigger_type: "PIPELINE",
|
||||
errors: null,
|
||||
is_valid: true,
|
||||
label: "Pipeline",
|
||||
environment: "onprem",
|
||||
large_image: "/images/workflows/tenzir2.png",
|
||||
long_description: "Controls a pipeline to run things",
|
||||
},
|
||||
];
|
||||
// is_valid: cloudSyncEnabled || isCloud ? true : false,
|
||||
|
||||
@@ -4104,24 +4116,12 @@ const AngularWorkflow = (defaultprops) => {
|
||||
(a) => a.id === data.id
|
||||
);
|
||||
|
||||
//console.log("Trigger: ", data, trigger_index)
|
||||
if (trigger_index === -1) {
|
||||
workflow.triggers.push(data)
|
||||
trigger_index = workflow.triggers.length - 1
|
||||
setWorkflow(workflow)
|
||||
}
|
||||
|
||||
//console.log("Trigger2: ", data, trigger_index)
|
||||
//if (data.id !== undefined && data.app_name !== undefined) {
|
||||
// //newapps.push(data)
|
||||
// workflow.actions.push(data)
|
||||
// curaction = data
|
||||
//} else {
|
||||
// toast("Action not found. Please remake it.");
|
||||
// event.target.remove();
|
||||
// return;
|
||||
//}
|
||||
|
||||
if (data.app_name === "Shuffle Workflow" || data.app_name === "User Input") {
|
||||
|
||||
// Check if public workflow
|
||||
@@ -4147,8 +4147,30 @@ const AngularWorkflow = (defaultprops) => {
|
||||
})
|
||||
}
|
||||
}
|
||||
} else if (data.app_name === "Pipeline") {
|
||||
|
||||
// Check if environment is set
|
||||
if (data.environment === undefined || data.environment === null || data.environment === "" || data.environment.toLowerCase() === "cloud") {
|
||||
for (var envKey in environments) {
|
||||
if (environments[envKey].archived === true) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (environments[envKey].Name.toLowerCase() === "cloud") {
|
||||
continue
|
||||
}
|
||||
|
||||
workflow.triggers[trigger_index].environment = environments[envKey].Name
|
||||
data.environment = environments[envKey].Name
|
||||
//setSelectedTrigger(data)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
console.log("TRIGGER: ", data)
|
||||
|
||||
setSelectedTriggerIndex(trigger_index);
|
||||
setSelectedTrigger(data);
|
||||
setSelectedActionEnvironment(data.env);
|
||||
@@ -4175,6 +4197,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
"open": false,
|
||||
"attachedTo": "",
|
||||
});
|
||||
|
||||
sendStreamRequest({
|
||||
"item": "node",
|
||||
"type": "select",
|
||||
@@ -4684,7 +4707,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
newdst !== null
|
||||
) {
|
||||
const dstdata = RunAutocompleter(newdst.data());
|
||||
console.log("DST Autocompleter: ", dstdata);
|
||||
//console.log("DST Autocompleter: ", dstdata);
|
||||
}
|
||||
|
||||
var newbranch = {
|
||||
@@ -6841,11 +6864,68 @@ const AngularWorkflow = (defaultprops) => {
|
||||
setWorkflow(workflow);
|
||||
saveWorkflow(workflow);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("Stop schedule error: ", error.toString())
|
||||
})
|
||||
}
|
||||
|
||||
const submitPipeline = (trigger, triggerindex, usecase) => {
|
||||
if (trigger.name.length <= 0) {
|
||||
toast("Error: name can't be empty");
|
||||
return;
|
||||
}
|
||||
|
||||
var mappedStartnode = ""
|
||||
const alledges = cy.edges().jsons()
|
||||
if (alledges !== undefined && alledges !== null && alledges.length > 0) {
|
||||
for (let edgekey in alledges) {
|
||||
const tmp = alledges[edgekey]
|
||||
console.log("TMP: ", tmp, tmp.data.source)
|
||||
if (tmp.data.source === trigger.id) {
|
||||
mappedStartnode = tmp.data.target
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
toast("Creating pipeline")
|
||||
const data = usecase
|
||||
const url = `${globalUrl}/api/v1/triggers/pipeline`
|
||||
fetch(url, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
credentials: "include",
|
||||
}
|
||||
)
|
||||
.then((response) => {
|
||||
if (response.status !== 200) {
|
||||
console.log("Status not 200 for stream results :O!");
|
||||
}
|
||||
|
||||
return response.json();
|
||||
})
|
||||
.then((responseJson) => {
|
||||
if (!responseJson.success) {
|
||||
toast("Failed to set pipeline: " + responseJson.reason);
|
||||
} else {
|
||||
toast("Successfully created pipeline");
|
||||
workflow.triggers[triggerindex].status = "running";
|
||||
trigger.status = "running";
|
||||
setSelectedTrigger(trigger);
|
||||
setWorkflow(workflow);
|
||||
console.log("Should set the status to running and save");
|
||||
saveWorkflow(workflow);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
//toast(error.toString());
|
||||
console.log("Stop schedule error: ", error.toString());
|
||||
console.log("Get schedule error: ", error.toString());
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
const submitSchedule = (trigger, triggerindex) => {
|
||||
if (trigger.name.length <= 0) {
|
||||
@@ -6904,7 +6984,6 @@ const AngularWorkflow = (defaultprops) => {
|
||||
trigger.status = "running";
|
||||
setSelectedTrigger(trigger);
|
||||
setWorkflow(workflow);
|
||||
console.log("Should set the status to running and save");
|
||||
saveWorkflow(workflow);
|
||||
}
|
||||
})
|
||||
@@ -7317,6 +7396,13 @@ const AngularWorkflow = (defaultprops) => {
|
||||
<div style={triggersViewStyle}>
|
||||
<div style={appScrollStyle}>
|
||||
{triggers.map((trigger, index) => {
|
||||
|
||||
if (trigger.trigger_type === "PIPELINE") {
|
||||
if (userdata.support !== true) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
const imagesize = isMobile ? 40 : trigger.large_image.includes("svg") ? 80 : 80
|
||||
var imageline = trigger.large_image.length === 0 ? <img alt="" style={{ borderRadius: theme.palette.borderRadius, width: isMobile ? 40 : 80, pointerEvents: "none" }} />
|
||||
:
|
||||
@@ -7589,10 +7675,11 @@ const AngularWorkflow = (defaultprops) => {
|
||||
parsedApp = {};
|
||||
};
|
||||
|
||||
const barHeight = bodyHeight - appBarSize - 50;
|
||||
const appScrollStyle = {
|
||||
overflow: "scroll",
|
||||
maxHeight: isMobile ? bodyHeight - appBarSize * 4 : bodyHeight - appBarSize - 55 - 50,
|
||||
minHeight: isMobile ? bodyHeight - appBarSize * 4 : bodyHeight - appBarSize - 55 - 50,
|
||||
maxHeight: isMobile ? bodyHeight - appBarSize * 4 : barHeight,
|
||||
minHeight: isMobile ? bodyHeight - appBarSize * 4 : barHeight,
|
||||
marginTop: 1,
|
||||
overflowY: "auto",
|
||||
overflowX: "hidden",
|
||||
@@ -12843,7 +12930,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
workflow.triggers !== undefined && workflow.triggers !== null && workflow.triggers[selectedTriggerIndex].parameters !== undefined && workflow.triggers[selectedTriggerIndex].parameters.length > 0 && workflow.triggers[selectedTriggerIndex].parameters[0] !== undefined && workflow.triggers[selectedTriggerIndex].parameters[0].value !== undefined ? workflow.triggers[selectedTriggerIndex].parameters[0].value : ""
|
||||
}
|
||||
color="primary"
|
||||
placeholder="defaultValue"
|
||||
placeholder=""
|
||||
onBlur={(e) => {
|
||||
setTriggerTextInformationWrapper(e.target.value);
|
||||
}}
|
||||
@@ -13065,13 +13152,209 @@ const AngularWorkflow = (defaultprops) => {
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
return null
|
||||
}
|
||||
|
||||
const PipelineSidebar = Object.getOwnPropertyNames(selectedTrigger).length === 0 || workflow.triggers[selectedTriggerIndex] === undefined && selectedTrigger.trigger_type !== "SCHEDULE" ? null : !userdata.support === true ? null :
|
||||
<div style={appApiViewStyle}>
|
||||
<h3 style={{ marginBottom: "5px" }}>
|
||||
{selectedTrigger.app_name}: {selectedTrigger.status}
|
||||
</h3>
|
||||
<a
|
||||
rel="noopener noreferrer"
|
||||
target="_blank"
|
||||
href="https://shuffler.io/docs/triggers#pipelines"
|
||||
style={{ textDecoration: "none", color: "#f85a3e" }}
|
||||
>
|
||||
What are pipelines?
|
||||
</a>
|
||||
<Divider
|
||||
style={{
|
||||
marginBottom: "10px",
|
||||
marginTop: "10px",
|
||||
height: "1px",
|
||||
width: "100%",
|
||||
backgroundColor: "rgb(91, 96, 100)",
|
||||
}}
|
||||
/>
|
||||
<div>Name</div>
|
||||
<TextField
|
||||
style={{
|
||||
backgroundColor: theme.palette.inputColor,
|
||||
borderRadius: theme.palette.borderRadius,
|
||||
}}
|
||||
InputProps={{
|
||||
style: {
|
||||
},
|
||||
}}
|
||||
fullWidth
|
||||
color="primary"
|
||||
placeholder={selectedTrigger.label}
|
||||
onChange={selectedTriggerChange}
|
||||
/>
|
||||
|
||||
<div style={{ marginTop: "20px" }}>
|
||||
<Typography>Environment</Typography>
|
||||
<Select
|
||||
MenuProps={{
|
||||
disableScrollLock: true,
|
||||
}}
|
||||
value={selectedTrigger.environment}
|
||||
disabled={selectedTrigger.status === "running"}
|
||||
SelectDisplayProps={{}}
|
||||
fullWidth
|
||||
onChange={(e) => {
|
||||
selectedTrigger.environment = e.target.value
|
||||
setSelectedTrigger(selectedTrigger)
|
||||
|
||||
setWorkflow(workflow)
|
||||
setUpdate(Math.random())
|
||||
}}
|
||||
style={{
|
||||
backgroundColor: theme.palette.inputColor,
|
||||
color: "white",
|
||||
height: 50,
|
||||
}}
|
||||
>
|
||||
{environments.map((data) => {
|
||||
if (data.archived) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (data.Name.toLowerCase() === "cloud") {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<MenuItem
|
||||
key={data.id}
|
||||
style={{ backgroundColor: theme.palette.inputColor, color: "white" }}
|
||||
value={data.Name}
|
||||
>
|
||||
{data.Name}
|
||||
</MenuItem>
|
||||
);
|
||||
})}
|
||||
</Select>
|
||||
</div>
|
||||
<Divider
|
||||
style={{
|
||||
marginTop: "20px",
|
||||
height: "1px",
|
||||
width: "100%",
|
||||
backgroundColor: "rgb(91, 96, 100)",
|
||||
}}
|
||||
/>
|
||||
<div style={{ flex: "6", marginTop: 20, }}>
|
||||
<div>
|
||||
<b>Parameters</b>
|
||||
|
||||
{/*
|
||||
<div
|
||||
style={{
|
||||
border: "1px solid rgba(255,255,255,0.3)",
|
||||
borderRadius: theme.palette.borderRadius,
|
||||
padding: 10,
|
||||
cursor: "pointer",
|
||||
|
||||
}}
|
||||
onClick={() => {
|
||||
const pipelineConfig = {
|
||||
"name": "HTTP Testing",
|
||||
"type": "create",
|
||||
"command": "from http://192.168.86.44:5002/api/v1/orgs/7e9b9007-5df2-4b47-bca5-c4d267ef2943/cache/CIDR%20ranges?type=text&authorization=cec9d01f-09b2-4419-8a0a-76c6046e3fef read lines | to http://192.168.86.44:5002/api/v1/hooks/webhook_665ace5f-f27b-496a-a365-6e07eb61078c write lines",
|
||||
"environment": selectedTrigger.environment,
|
||||
}
|
||||
|
||||
submitPipeline(selectedTrigger, selectedTriggerIndex, pipelineConfig)
|
||||
}}
|
||||
>
|
||||
Run HTTP Request
|
||||
</div>
|
||||
*/}
|
||||
|
||||
<div
|
||||
style={{
|
||||
border: "1px solid rgba(255,255,255,0.3)",
|
||||
borderRadius: theme.palette.borderRadius,
|
||||
padding: 10,
|
||||
cursor: "pointer",
|
||||
marginTop: 5,
|
||||
|
||||
}}
|
||||
onClick={() => {
|
||||
const pipelineConfig = {
|
||||
"name": selectedTrigger.label,
|
||||
"type": "create",
|
||||
"command": "load tcp://0.0.0.0:514 | read syslog | to http://api.com X-Token:Secret",
|
||||
"environment": selectedTrigger.environment,
|
||||
}
|
||||
|
||||
submitPipeline(selectedTrigger, selectedTriggerIndex, pipelineConfig)
|
||||
}}
|
||||
>
|
||||
Start Syslog listener
|
||||
</div>
|
||||
|
||||
<div
|
||||
style={{
|
||||
border: "1px solid rgba(255,255,255,0.3)",
|
||||
borderRadius: theme.palette.borderRadius,
|
||||
padding: 10,
|
||||
cursor: "pointer",
|
||||
marginTop: 5,
|
||||
|
||||
}}
|
||||
onClick={() => {
|
||||
const pipelineConfig = {
|
||||
"name": selectedTrigger.label,
|
||||
"type": "create",
|
||||
"command": "from kafka://1.2.3.4 --topic foo | to http://api.com X-Token:Secret",
|
||||
"environment": selectedTrigger.environment,
|
||||
}
|
||||
|
||||
submitPipeline(selectedTrigger, selectedTriggerIndex, pipelineConfig)
|
||||
}}
|
||||
>
|
||||
Follow Kafka Queue
|
||||
</div>
|
||||
|
||||
<div
|
||||
style={{
|
||||
marginTop: "20px",
|
||||
marginBottom: "7px",
|
||||
display: "flex",
|
||||
}}
|
||||
>
|
||||
<Button
|
||||
style={{ flex: "1" }}
|
||||
variant="contained"
|
||||
disabled={selectedTrigger.status === "running"}
|
||||
onClick={() => {
|
||||
toast("Should start. But it doesn't")
|
||||
}}
|
||||
color="primary"
|
||||
>
|
||||
Start
|
||||
</Button>
|
||||
<Button
|
||||
style={{ flex: "1" }}
|
||||
variant="contained"
|
||||
disabled={selectedTrigger.status !== "running"}
|
||||
onClick={() => {
|
||||
toast("Should stop triggert")
|
||||
}}
|
||||
color="primary"
|
||||
>
|
||||
Stop
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
const ScheduleSidebar = Object.getOwnPropertyNames(selectedTrigger).length === 0 || workflow.triggers[selectedTriggerIndex] === undefined && selectedTrigger.trigger_type !== "SCHEDULE" ? null :
|
||||
<div style={appApiViewStyle}>
|
||||
@@ -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,8 +14084,6 @@ const AngularWorkflow = (defaultprops) => {
|
||||
</div>
|
||||
: null
|
||||
|
||||
|
||||
|
||||
const RightsideBar = () => {
|
||||
const [hovered, setHovered] = useState(false)
|
||||
|
||||
@@ -13856,9 +14137,8 @@ const AngularWorkflow = (defaultprops) => {
|
||||
|
||||
return () => {
|
||||
document.removeEventListener('keydown', handleKeyDown);
|
||||
};
|
||||
}, [executeWorkflow, executionText, workflow, lastSaved, executionRequestStarted]);
|
||||
|
||||
}
|
||||
}, [executeWorkflow, executionText, workflow, lastSaved, executionRequestStarted])
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
@@ -13896,8 +14176,6 @@ const AngularWorkflow = (defaultprops) => {
|
||||
}
|
||||
|
||||
const boxSize = isMobile ? 50 : 100;
|
||||
|
||||
|
||||
const executionButton = executionRunning ? (
|
||||
<Tooltip color="primary" title="Stop execution" placement="top">
|
||||
<span>
|
||||
@@ -14333,6 +14611,8 @@ const AngularWorkflow = (defaultprops) => {
|
||||
defaultReturn = null
|
||||
} else if (selectedTrigger.trigger_type === "SUBFLOW") {
|
||||
defaultReturn = <SubflowSidebar />
|
||||
// } else if (selectedTrigger.trigger_type === "PIPELINE") {
|
||||
// defaultReturn = <PipelineSidebar />
|
||||
} else if (selectedTrigger.trigger_type === "EMAIL") {
|
||||
defaultReturn = <EmailSidebar />
|
||||
} 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) => {
|
||||
},
|
||||
}}
|
||||
>
|
||||
<span id="top_bar">
|
||||
{/* Have a sticky top bar */}
|
||||
<span id="top_bar" style={{ position: "sticky", top: -30, zIndex: 12000, }}>
|
||||
<Tooltip
|
||||
title="Suggest solution"
|
||||
placement="top"
|
||||
style={{ zIndex: 50000 }}
|
||||
>
|
||||
<IconButton
|
||||
disabled
|
||||
style={{
|
||||
zIndex: 5000,
|
||||
position: "absolute",
|
||||
top: 34,
|
||||
top: 4,
|
||||
right: 210,
|
||||
}}
|
||||
onClick={(e) => {
|
||||
@@ -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 }}
|
||||
>
|
||||
<IconButton
|
||||
style={{ zIndex: 5000, position: "absolute", top: 34, right: 98 }}
|
||||
style={{ zIndex: 5000, position: "absolute", top: 4, right: 98 }}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
const executionIndex = workflowExecutions.findIndex((data) => data.execution_id === selectedResult.execution_id);
|
||||
@@ -16470,7 +16752,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
style={{ zIndex: 10011 }}
|
||||
>
|
||||
<IconButton
|
||||
style={{ zIndex: 5000, position: "absolute", top: 34, right: 34 }}
|
||||
style={{ zIndex: 5000, position: "absolute", top: 4, right: 34 }}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
setCodeModalOpen(false);
|
||||
@@ -16481,8 +16763,8 @@ const AngularWorkflow = (defaultprops) => {
|
||||
</Tooltip>
|
||||
</span>
|
||||
|
||||
<div style={{ marginBottom: 40 }}>
|
||||
<div style={{ display: "flex", marginBottom: 15 }}>
|
||||
<div style={{ marginBottom: 40, }}>
|
||||
<div style={{ display: "flex", marginBottom: 15, position: "sticky", top: -31, zIndex: 10000, backgroundColor: "rgba(56,56,56, 1)", }}>
|
||||
{curapp === null ? null : (
|
||||
<img
|
||||
alt={selectedResult.action.app_name}
|
||||
@@ -16681,11 +16963,13 @@ const AngularWorkflow = (defaultprops) => {
|
||||
{/* 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") ?
|
||||
<div id="rightside_actions" style={rightsidebarStyle}>
|
||||
{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}
|
||||
<VariablesModal variableInfo={variableInfo} setVariableInfo={setVariableInfo} />
|
||||
<ExecutionVariableModal variableInfo={variableInfo} setVariableInfo={setVariableInfo} />
|
||||
{executionArgumentModal}
|
||||
{aiQueryModal}
|
||||
{conditionsModal}
|
||||
{authenticationModal}
|
||||
{codePopoutModal}
|
||||
{configureWorkflowModal}
|
||||
{/*editWorkflowModal*/}
|
||||
{workflowRevisions}
|
||||
{authenticationModal}
|
||||
{/*editWorkflowModal*/}
|
||||
{executionArgumentModal}
|
||||
{configureWorkflowModal}
|
||||
<SuggestionBoxUi />
|
||||
|
||||
{codeEditorModalOpen ?
|
||||
|
||||
@@ -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 (
|
||||
<span style={{backgroundColor: theme.palette.inputColor, display: "inline", whiteSpace: "pre-wrap", padding: "6px 3px 6px 3px", }}>
|
||||
{newprop}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
@@ -145,6 +154,8 @@ export const CodeHandler = (props) => {
|
||||
maxWidth: "100%",
|
||||
backgroundColor: theme.palette.inputColor,
|
||||
overflowY: "auto",
|
||||
// Have it inline
|
||||
borderRadius: theme.palette.borderRadius,
|
||||
}}
|
||||
>
|
||||
{validate.valid === true ?
|
||||
|
||||
@@ -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" {
|
||||
|
||||
Reference in New Issue
Block a user