Added Docs update, missing images and Tenzir pipelines

This commit is contained in:
Frikky
2024-02-26 23:15:57 +01:00
parent 7c43245a88
commit e682a7d2a7
7 changed files with 461 additions and 75 deletions
+77 -18
View File
@@ -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>
+5 -3
View File
@@ -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
<Button
variant={"outlined"}
style={{ }}
disabled={isCloud && environment.Name.toLowerCase() !== "cloud"}
onClick={() => {
console.log("Should clear executions for: ", environment);
File diff suppressed because one or more lines are too long
+13 -2
View File
@@ -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 ?