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)} /> -