From 492c3c3258293a88c96c450fbf6f197c49688d93 Mon Sep 17 00:00:00 2001 From: Frikky Date: Tue, 31 Oct 2023 18:57:36 +0100 Subject: [PATCH] Frontend fixes for release --- frontend/src/components/AppFramework.jsx | 3 +- frontend/src/components/AppSearchButtons.jsx | 425 ++++-------------- frontend/src/components/AppSelection.jsx | 154 ++++--- frontend/src/components/ConfigureWorkflow.jsx | 6 +- frontend/src/components/Newsletter.jsx | 21 +- frontend/src/components/Priority.jsx | 6 +- .../src/components/WorkflowTemplatePopup.jsx | 35 +- frontend/src/views/AngularWorkflow.jsx | 45 +- frontend/src/views/AppCreator.jsx | 12 +- frontend/src/views/Dashboard.jsx | 81 ++-- frontend/src/views/Welcome.jsx | 7 +- frontend/src/views/Workflows.jsx | 10 +- functions/onprem/orborus/orborus.go | 12 +- 13 files changed, 324 insertions(+), 493 deletions(-) diff --git a/frontend/src/components/AppFramework.jsx b/frontend/src/components/AppFramework.jsx index 13f85fb1..ecff205f 100644 --- a/frontend/src/components/AppFramework.jsx +++ b/frontend/src/components/AppFramework.jsx @@ -39,7 +39,6 @@ cytoscape.use(edgehandles); export const findSpecificApp = (framework, inputcategory) => { // Get the frameworkinfo for the org and fill in - // if (framework === undefined || framework === null) { console.log("findSpecificApp: framework is null") return null @@ -52,7 +51,7 @@ export const findSpecificApp = (framework, inputcategory) => { const category = inputcategory.toLowerCase().split(":")[0].trim() - console.log("findSpecificApp: ", category, framework) + //console.log("findSpecificApp: ", category, framework) if (category === "edr" || category === "eradication" || category === "edr & av") { if (framework["EDR & AV"] !== undefined && framework["EDR & AV"].name !== undefined) { return framework["EDR & AV"] diff --git a/frontend/src/components/AppSearchButtons.jsx b/frontend/src/components/AppSearchButtons.jsx index d739b96c..324da856 100644 --- a/frontend/src/components/AppSearchButtons.jsx +++ b/frontend/src/components/AppSearchButtons.jsx @@ -3,25 +3,26 @@ import theme from '../theme.jsx'; import ReactGA from 'react-ga4'; import { useNavigate, Link } from 'react-router-dom'; -import { Search as SearchIcon, CloudQueue as CloudQueueIcon, Code as CodeIcon, Close as CloseIcon, Folder as FolderIcon, LibraryBooks as LibraryBooksIcon } from '@mui/icons-material'; +import { Search as Searchicon, CloudQueue as CloudQueueicon, Code as Codeicon, Close as Closeicon, Folder as Foldericon, LibraryBooks as LibraryBooksicon } from '@mui/icons-material'; import aa from 'search-insights' -import DeleteIcon from '@mui/icons-material/Delete'; -import ShowChartIcon from '@mui/icons-material/ShowChart'; -import ExploreIcon from '@mui/icons-material/Explore'; -import LightbulbIcon from "@mui/icons-material/Lightbulb"; -import NewReleasesIcon from "@mui/icons-material/NewReleases"; -import ExtensionIcon from "@mui/icons-material/Extension"; -import EmailIcon from "@mui/icons-material/Email"; -import FingerprintIcon from '@mui/icons-material/Fingerprint'; +import Deleteicon from '@mui/icons-material/Delete'; +import ShowCharticon from '@mui/icons-material/ShowChart'; +import Exploreicon from '@mui/icons-material/Explore'; +import Lightbulbicon from "@mui/icons-material/Lightbulb"; +import NewReleasesicon from "@mui/icons-material/NewReleases"; +import Extensionicon from "@mui/icons-material/Extension"; +import Emailicon from "@mui/icons-material/Email"; +import Fingerprinticon from '@mui/icons-material/Fingerprint'; import AppSearch from "../components/Appsearch.jsx"; import { toast } from 'react-toastify'; +import { findSpecificApp } from "../components/AppFramework.jsx"; import { Zoom, Grid, Paper, TextField, Collapse, - IconButton, + iconButton, Avatar, ButtonBase, InputAdornment, @@ -35,367 +36,105 @@ import { } from '@mui/material'; const AppSearchButtons = (props) => { - const { userdata, globalUrl, appFramework, defaultSearch, finishedApps, onNodeSelect, setDiscoveryData, appName, AppImage, setDefaultSearch, discoveryData } = props + const { userdata, globalUrl, appFramework, finishedApps, appType, totalApps, index, onNodeSelect, setDiscoveryData, appName, AppImage, setDefaultSearch, discoveryData } = props + const ref = useRef() - const [moreButton, setMoreButton] = useState(false); let navigate = useNavigate(); - const sizing = moreButton ? 510 : 480; + const [isHover, setIsHover] = useState(false); + const [localSearchOpen, setLocalSearchOpen] = useState(false) + + if (appType === undefined) { + console.log("Apptype is required in AppSearchButtons") + return null; + } + const buttonWidth = 450; const buttonMargin = 10; - const bottomButtonStyle = { - borderRadius: 200, - marginTop: moreButton ? 44 : "", - height: 51, - width: 510, - fontSize: 16, - // background: "linear-gradient(89.83deg, #FF8444 0.13%, #F2643B 99.84%)", - background: "linear-gradient(90deg, #F86744 0%, #F34475 100%)", - padding: "16px 24px", - // top: 20, - // margin: "auto", - textTransform: 'capitalize', - itemAlign: "center", - // marginTop: 25 - // marginLeft: "65px", - }; - const buttonStyle = { - flex: 1, - width: 224, - padding: 25, - margin: buttonMargin, - color: "var(--White-text, #F1F1F1)", - fontWeight: 400, - fontSize: 17, - background: "rgba(33, 33, 33, 1)", - textTransform: 'capitalize', - border: "1px solid rgba(33, 33, 33, 1)", - borderRadius: 8, - marginRight: 8, - }; - const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io"; + const handleMouseEnter = () => { + setIsHover(true); + }; + + const handleMouseLeave = () => { + setIsHover(false); + }; - const mouseOver = (e) => { - e.target.style.border = "1px solid #f85a3e"; + + const foundApp = findSpecificApp(appFramework, appType) + if (foundApp === undefined || foundApp === null) { + console.log("AppSearchButtons: App not found in appFramework") + return null + } + + const icon = foundApp.large_image + let xsValue = 12; + if (index !== undefined && index !== 0) { + xsValue = 6; } - const mouseOut = (e) => { - e.target.style.border = "1px solid rgb(33, 33, 33)"; + + if (index === totalApps - 4 && totalApps % 2 === 1) { + xsValue = 12; + } + + if (index === totalApps - 1 || index === totalApps - 2 || index === totalApps - 3) { + xsValue = 4; } return ( - - - {/*Find your integrations!*/} - {/*
- -
-
- - -
-
- - -
- {moreButton ? ( -
- - - -
- ) - : -
- -
} */} -
+
-
} onClick={(event) => { - onNodeSelect("CASES"); - setDefaultSearch(discoveryData.label) + if (onNodeSelect !== undefined) { + onNodeSelect(appType); + } else { + setLocalSearchOpen(true) + } + + if (setDefaultSearch !== undefined) { + setDefaultSearch(appType) + } }} > -
- {AppImage === undefined || AppImage === undefined || - AppImage === null || AppImage === null || AppImage.length === 0 ? +
+ {AppImage === undefined || AppImage === null || AppImage.length === 0 ?
- +
- : } + : + + }
- Case Management + + {appType} + {appName === undefined || appName === undefined || appName === null || appName === null || appName.length === 0 ? "" : - {appName}} + {appName.split('_').join(' ')}}
-
+
) diff --git a/frontend/src/components/AppSelection.jsx b/frontend/src/components/AppSelection.jsx index d5f212df..c56b9d0f 100644 --- a/frontend/src/components/AppSelection.jsx +++ b/frontend/src/components/AppSelection.jsx @@ -50,6 +50,7 @@ const AppSelection = props => { const [newSelectedApp, setNewSelectedApp] = React.useState({}) const [finishedApps, setFinishedApps] = React.useState([]) const [appButtons, setAppButtons] = useState([]) + const [lastPosted, setLastPosted] = useState([]) const [apps, setApps] = useState([]) const [appName, setAppName] = React.useState(); const [moreButton, setMoreButton] = useState(false); @@ -75,7 +76,7 @@ const AppSelection = props => { body: JSON.stringify(data), credentials: "include", }) - .then((response) => { + .then(async (response) => { if (response.status !== 200) { console.log("Status not 200 for framework!"); } @@ -84,7 +85,13 @@ const AppSelection = props => { checkLogin() } - return response.json(); + let resp = response.json(); + let respAwaited = await resp; + + if (respAwaited.success === true) { + setLastPosted(data) + } + return resp; }) .then((responseJson) => { if (responseJson.success === false) { @@ -153,7 +160,6 @@ const AppSelection = props => { // if (setDiscoveryWrapper !== undefined) { // setDiscoveryWrapper({ id: label }); // } - if (isCloud) { ReactGA.event({ category: "welcome", @@ -161,41 +167,13 @@ const AppSelection = props => { label: "", }); } + setDiscoveryData(label) setSelectionOpen(true) setNewSelectedApp({}) setDefaultSearch(label.charAt(0).toUpperCase() + (label.substring(1)).toLowerCase()) }; - useEffect(() => { - var tempApps = [] - if (tempApps.length === 0) { - const tempApps = - [{ - "description": newSelectedApp.description, - "id": newSelectedApp.objectID, - "large_image": newSelectedApp.image_url, - "name": newSelectedApp.name, - "type": discoveryData - }, - //{ - // // description: newSelectedApp.siem.description, - // id: newSelectedApp.siem.objectID, - // large_image: newSelectedApp.siem.image_url, - // name: newSelectedApp.siem.name, - // type: discoveryData.siem - // },{ - // // description: newSelectedApp.edr.description, - // id: newSelectedApp.edr.objectID, - // large_image: newSelectedApp.edr.image_url, - // name: newSelectedApp.edr.name, - // type: discoveryData.edr - // } - ] - setAppButtons(tempApps) - GetApps() - } - }, []) useEffect(() => { if (newSelectedApp.objectID === undefined || newSelectedApp.objectID === undefined || newSelectedApp.objectID.length === 0) { @@ -237,48 +215,94 @@ const AppSelection = props => { console.log("Selected app changed (effect)"); }, [newSelectedApp]); - const sizing = moreButton ? 510 : 480; + useEffect(() => { + var tempApps = [] + if (tempApps.length === 0) { + // Object.entries(appFramework).forEach(([key, value]) => { + // value.type = key; + // tempApps.push(value); + // }); + + // // Define the custom sorting order + // const customSortingOrder = ["CASES", "SIEM", "ENDPOINT", "INTEL", "EMAIL"]; + + const lastApps = {} + let endTypes = ["network", "assets", "iam"] + + if (appFramework === undefined || appFramework === null || Object.keys(appFramework).length === 0) { + window.location.href = "/welcome" + return + } + + Object.entries(appFramework).forEach(([key, value]) => { + if (key.toLowerCase() === "other" || key.toLowerCase() === "communication") { + return + } + + value.type = key; + + if (endTypes.includes(value.type.toLowerCase())) { + lastApps[value.type] = value + return + } + + if (lastPosted.type === value.type) { + value = lastPosted + } + + tempApps.push(value); + }); + + tempApps.sort((a, b) => { + if (a.type.length > b.type.length) { + return -1; + } else if (a.type.length < b.type.length) { + return 1; + } + }); + + let lastType = lastPosted.type === undefined ? "" : lastPosted.type.toLowerCase() + + if (endTypes.includes(lastType)) { + lastApps[lastPosted.type] = lastPosted + } + + if (moreButton) { + tempApps.push(lastApps["network"]) + tempApps.push(lastApps["assets"]) + tempApps.push(lastApps["iam"]) + } + + setAppButtons(tempApps) + console.log("Updated appButtons: ", appButtons) + GetApps() + } + }, [lastPosted, moreButton]) + + // const sizing = moreButton ? 510 : 480; const buttonWidth = 450; const buttonMargin = 10; const bottomButtonStyle = { borderRadius: 200, marginTop: moreButton ? 44 : "", height: 51, - width: 510, + width: 500, fontSize: 16, - // background: "linear-gradient(89.83deg, #FF8444 0.13%, #F2643B 99.84%)", background: "linear-gradient(90deg, #F86744 0%, #F34475 100%)", padding: "16px 24px", - // top: 20, - // margin: "auto", textTransform: 'capitalize', itemAlign: "center", - // marginTop: 25 - // marginLeft: "65px", }; - const buttonStyle = { - flex: 1, - width: 224, - padding: 25, - margin: buttonMargin, - color: "var(--White-text, #F1F1F1)", - fontWeight: 400, - fontSize: 17, - background: "rgba(33, 33, 33, 1)", - textTransform: 'capitalize', - border: "1px solid rgba(33, 33, 33, 1)", - borderRadius: 8, - marginRight: 8, - }; - // console.log("appFramework",appFramework.cases.name) + return (
{selectionOpen ? ( @@ -311,7 +335,7 @@ const AppSelection = props => { style={{ flex: 1, // width: 224, - marginLeft: discoveryData === ('ERADICATION') ? 120 : 177, + marginLeft: discoveryData === ("communication") ? 112 : 200, width: "100%", marginBottom: 23, fontSize: 16, @@ -394,6 +418,7 @@ const AppSelection = props => { > Select the apps you work with and we will connect the for you. + {appButtons.map((appData, index) => { const appName = appData.name @@ -401,11 +426,12 @@ const AppSelection = props => { const appType = appData.type return ( - { setDiscoveryData={setDiscoveryData} setDefaultSearch={setDefaultSearch} apps={apps} + setMoreButton={setMoreButton} + moreButton={moreButton} /> ) })} +
+ {!moreButton ? ( +
+ { + setMoreButton(true) + }} + >See More Apps +
): ""}
+ +
{msg}
diff --git a/frontend/src/components/Priority.jsx b/frontend/src/components/Priority.jsx index 3f167982..947a837d 100644 --- a/frontend/src/components/Priority.jsx +++ b/frontend/src/components/Priority.jsx @@ -31,10 +31,10 @@ const Priority = (props) => { let newdescription = priority.description const descsplit = priority.description.split("&") if (appFramework !== undefined && descsplit.length === 5 && priority.description.includes(":default")) { - console.log("descsplit: ", descsplit) + //console.log("descsplit: ", descsplit) if (descsplit[1] === "") { const item = findSpecificApp(appFramework, descsplit[0]) - console.log("item: ", item) + //console.log("item: ", item) if (item !== null) { descsplit[1] = item.large_image descsplit[0] = descsplit[0].split(":")[0] @@ -45,7 +45,7 @@ const Priority = (props) => { if (descsplit[3] === "") { const item = findSpecificApp(appFramework, descsplit[2]) - console.log("item: ", item) + //console.log("item: ", item) if (item !== null) { descsplit[3] = item.large_image descsplit[2] = descsplit[2].split(":")[0] diff --git a/frontend/src/components/WorkflowTemplatePopup.jsx b/frontend/src/components/WorkflowTemplatePopup.jsx index f1367092..e7deea1d 100644 --- a/frontend/src/components/WorkflowTemplatePopup.jsx +++ b/frontend/src/components/WorkflowTemplatePopup.jsx @@ -3,6 +3,7 @@ import React, { useState, useEffect } from "react"; import { toast } from "react-toastify" import theme from '../theme.jsx'; import { useNavigate, Link, useParams } from "react-router-dom"; +import AppSearchButtons from "../components/AppSearchButtons.jsx"; import { Button, Typography, @@ -26,7 +27,7 @@ import WorkflowTemplatePopup2 from "./WorkflowTemplatePopup.jsx"; import ConfigureWorkflow from "../components/ConfigureWorkflow.jsx"; const WorkflowTemplatePopup = (props) => { - const { userdata, globalUrl, img1, srcapp, img2, dstapp, title, description, visualOnly, apps } = props; + const { userdata, appFramework, globalUrl, img1, srcapp, img2, dstapp, title, description, visualOnly, apps, isLoggedIn } = props; const [isActive, setIsActive] = useState(false); const [isHovered, setIsHovered] = useState(false); @@ -36,6 +37,9 @@ const WorkflowTemplatePopup = (props) => { const [workflow, setWorkflow] = useState({}); const [appAuthentication, setAppAuthentication] = React.useState(undefined); + const [missingSource, setMissingSource] = React.useState(undefined) + const [missingDestination, setMissingDestination] = React.useState(undefined); + const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io"; let navigate = useNavigate(); @@ -108,8 +112,10 @@ const WorkflowTemplatePopup = (props) => { } const loadAppAuth = () => { - if (userdata === undefined || userdata === null) { + // Check if it exists, and has keys + if (userdata === undefined || userdata === null || Object.keys(userdata).length === 0) { setErrorMessage("You need to be logged in to try usecases. Redirecting in 5 seconds...") + // Send the user to the login screen after 3 seconds setTimeout(() => { // Make it cancel if the state modalOpen changes @@ -174,6 +180,21 @@ const WorkflowTemplatePopup = (props) => { if (srcapp.includes(":default") || dstapp.includes(":default")) { toast("You need to select both a source and destination app before generating this workflow.") + + if (srcapp.includes(":default")) { + setMissingSource({ + "img": "https://shuffler.io/images/apps/" + srcapp + ".png", + "type": srcapp.split(":")[0], + }) + } + + if (dstapp.includes(":default")) { + setMissingDestination({ + "name": dstapp, + "img": "https://shuffler.io/images/apps/" + dstapp + ".png", + }) + } + return } @@ -322,6 +343,16 @@ const WorkflowTemplatePopup = (props) => {
} + {!isLoggedIn || missingSource === undefined ? null : +
+ +
+ } { > - +
+
+ +
) : null; diff --git a/frontend/src/views/AppCreator.jsx b/frontend/src/views/AppCreator.jsx index 16dfdf23..eae7910f 100755 --- a/frontend/src/views/AppCreator.jsx +++ b/frontend/src/views/AppCreator.jsx @@ -929,9 +929,9 @@ const AppCreator = (defaultprops) => { } } - if (path === "/files/{file_id}/content") { - //console.log("FILE DOWNLOAD Method: ", path, method, methodvalue) - } + if (path === "/files/{file_id}/content") { + //console.log("FILE DOWNLOAD Method: ", path, method, methodvalue) + } // Typescript? I think not ;) @@ -2137,7 +2137,7 @@ const AppCreator = (defaultprops) => { } if (queryitem.name.toLowerCase() == "file_id") { - item.queries[querykey].name = "fileid" + item.queries[querykey].name = "fileid" continue; //skipped = true //break @@ -2525,8 +2525,8 @@ const AppCreator = (defaultprops) => { for (let authkey in extraAuth) { const curauth = extraAuth[authkey]; - if (curauth.name.toLowerCase() == "url") { - toast("Can't add extra auth with Name URL"); + if (curauth.name.length === 0 || curauth.name.toLowerCase() == "url") { + toast("Can't add extra auth with empty name or Name URL"); setAppBuilding(false); return; } diff --git a/frontend/src/views/Dashboard.jsx b/frontend/src/views/Dashboard.jsx index 94317c55..41443966 100755 --- a/frontend/src/views/Dashboard.jsx +++ b/frontend/src/views/Dashboard.jsx @@ -95,7 +95,9 @@ const useStyles = makeStyles({ -const UsecaseListComponent = ({userdata, keys, isCloud, globalUrl, frameworkData, isLoggedIn, workflows, setWorkflows}) => { +const UsecaseListComponent = (props) => { + const { keys, userdata, isCloud, globalUrl, frameworkData, isLoggedIn, workflows, setWorkflows, } = props + const [expandedIndex, setExpandedIndex] = useState(-1); const [expandedItem, setExpandedItem] = useState(-1); const [inputUsecase, setInputUsecase] = useState({}); @@ -165,12 +167,12 @@ const UsecaseListComponent = ({userdata, keys, isCloud, globalUrl, frameworkData const parseUsecase = (subcase) => { - console.log("parseUsecase: ", subcase) + //console.log("parseUsecase: ", subcase) const srcdata = findSpecificApp(frameworkData, subcase.type) const dstdata = findSpecificApp(frameworkData, subcase.last) - console.log("srcdata: ", srcdata) - console.log("dstdata: ", dstdata) + //console.log("srcdata: ", srcdata) + //console.log("dstdata: ", dstdata) if (srcdata !== undefined && srcdata !== null) { subcase.srcimg = srcdata.large_image @@ -185,6 +187,7 @@ const UsecaseListComponent = ({userdata, keys, isCloud, globalUrl, frameworkData return subcase } + const getUsecase = (subcase, index, subindex) => { subcase = parseUsecase(subcase) @@ -209,7 +212,7 @@ const UsecaseListComponent = ({userdata, keys, isCloud, globalUrl, frameworkData return response.json(); }) .then((responseJson) => { - console.log("In responseJson for usecase: ", responseJson) + //console.log("In responseJson for usecase: ", responseJson) var parsedUsecase = responseJson if (responseJson.success === false) { @@ -229,19 +232,21 @@ const UsecaseListComponent = ({userdata, keys, isCloud, globalUrl, frameworkData setExpandedItem(subindex) setTimeout(() => { - //console.log("Scroll!") const found = document.getElementById("selected_box"); if (found !== undefined && found !== null) { //console.log("FOUND!!") - found.scrollTo({ - top: 100, - behavior: "smooth", - }) + + //found.scrollTo({ + // top: 100, + // behavior: "smooth", + //}) + } else { + //console.log("NOT FOUND!!") } setFirstLoad(true) setSelectedWorkflows([]) - }, 100); + }, 100) }) .catch((error) => { //toast(error.toString()); @@ -784,7 +789,6 @@ const UsecaseListComponent = ({userdata, keys, isCloud, globalUrl, frameworkData borderRadius: theme.palette.borderRadius, }} onChange={(event, newValue) => { - console.log("CLICK: ", newValue) //handleWorkflowSelectionUpdate({ target: { value: newValue} }) //setSelectedWorkflows= //var newvalue = [] @@ -801,7 +805,6 @@ const UsecaseListComponent = ({userdata, keys, isCloud, globalUrl, frameworkData if (workflows[key]["usecase_ids"] !== undefined && workflows[key]["usecase_ids"] !== null && workflows[key]["usecase_ids"].includes(subcase.name)) { const filtered = workflows[key]["usecase_ids"].filter(data => data !== subcase.name) if (filtered !== undefined && filtered !== null) { - //console.log("Removing: ", workflows[key].name, workflows[key]) workflows[key]["usecase_ids"] = filtered setWorkflow(workflows[key]) @@ -813,19 +816,16 @@ const UsecaseListComponent = ({userdata, keys, isCloud, globalUrl, frameworkData if (workflows[key]["usecase_ids"] === undefined || workflows[key]["usecase_ids"] === null) { workflows[key]["usecase_ids"] = [subcase.name] - console.log("Setting: ", workflows[key].name) setWorkflow(workflows[key]) } else if (!workflows[key]["usecase_ids"].includes(subcase.name)) { workflows[key]["usecase_ids"].push(subcase.name) - console.log("Adding: ", workflows[key].name) setWorkflow(workflows[key]) } } setWorkflows(workflows) - console.log("New: ", newValue) setSelectedWorkflows(newValue) //setUpdate(Math.random()) }} @@ -888,6 +888,8 @@ const UsecaseListComponent = ({userdata, keys, isCloud, globalUrl, frameworkData Try it out: { // This is the start of a dashboard that can be used. // What data do we fill in here? Idk const Dashboard = (props) => { - const { globalUrl, isLoggedIn } = props; + const { globalUrl, isLoggedIn, userdata } = props; //const alert = useAlert(); const [bigChartData, setBgChartData] = useState("data1"); const [dayAmount, setDayAmount] = useState(7); @@ -1176,7 +1178,7 @@ const Dashboard = (props) => { const foundQuery2 = params["selected_object"] if (foundQuery2 !== null && foundQuery2 !== undefined) { - console.log("Got selected_object: ", foundQuery2) + //console.log("Got selected_object: ", foundQuery2) const queryName = foundQuery2.toLowerCase().replaceAll("_", " ") // Waiting a bit for it to render @@ -1184,6 +1186,15 @@ const Dashboard = (props) => { const foundItem = document.getElementById(queryName) if (foundItem !== undefined && foundItem !== null) { foundItem.click() + // Scroll to it + + setTimeout(() => { + foundItem.scrollIntoView({ + behavior: "smooth", + block: "center", + inline: "center" + }) + }, 100) } else { //console.log("Couldn't find item with name ", queryName) } @@ -1194,12 +1205,12 @@ const Dashboard = (props) => { useEffect(() => { if (usecases.length > 0) { - console.log(usecases) + //console.log(usecases) checkSelectedParams() } }, [usecases]) - const getFramework = () => { + const getFramework = () => { fetch(globalUrl + "/api/v1/apps/frameworkConfiguration", { method: "GET", headers: { @@ -1216,20 +1227,29 @@ const Dashboard = (props) => { return response.json(); }) .then((responseJson) => { - if (responseJson.success === false) { - if (responseJson.reason !== undefined) { - //toast("Failed loading: " + responseJson.reason) - } else { - //toast("Failed to load framework for your org.") - } - } else { - setFrameworkData(responseJson) + if (responseJson.success === false) { + const preparedData = { + "siem": findSpecificApp({}, "SIEM"), + "communication": findSpecificApp({}, "COMMUNICATION"), + "assets": findSpecificApp({}, "ASSETS"), + "cases": findSpecificApp({}, "CASES"), + "network": findSpecificApp({}, "NETWORK"), + "intel": findSpecificApp({}, "INTEL"), + "edr": findSpecificApp({}, "EDR"), + "iam": findSpecificApp({}, "IAM"), + "email": findSpecificApp({}, "EMAIL"), } - }) + + console.log("Got error for framework! ", preparedData) + setFrameworkData(preparedData) + } else { + setFrameworkData(responseJson) + } + }) .catch((error) => { toast(error.toString()); }) - } + } const getAvailableWorkflows = () => { fetch(globalUrl + "/api/v1/workflows", { @@ -1659,6 +1679,7 @@ const Dashboard = (props) => { : null} { } }, [activeStep]) - const isCloud = - window.location.host === "localhost:3002" || - window.location.host === "shuffler.io"; - + const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io"; const [steps, setSteps] = useState([ "Help us get to know you", "Find your Apps", @@ -512,7 +509,7 @@ const Welcome = (props) => { navigate("/workflows?message=Skipped intro") }}> - + Experienced diff --git a/frontend/src/views/Workflows.jsx b/frontend/src/views/Workflows.jsx index 67998211..bf32b52e 100755 --- a/frontend/src/views/Workflows.jsx +++ b/frontend/src/views/Workflows.jsx @@ -530,6 +530,7 @@ export const validateJson = (showResult) => { const Workflows = (props) => { const { globalUrl, isLoggedIn, isLoaded, userdata, checkLogin } = props; + document.title = "Shuffle - Workflows"; let navigate = useNavigate(); @@ -3419,11 +3420,11 @@ const Workflows = (props) => { > { {foundPriority != null && workflows.length < 6 ? 0 { + env = append(env, fmt.Sprintf("SHUFFLE_SKIPSSL_VERIFY=%s", os.Getenv("SHUFFLE_SKIPSSL_VERIFY"))) + } + + if len(os.Getenv("SHUFFLE_DEBUG_MEMORY")) > 0 { + env = append(env, fmt.Sprintf("SHUFFLE_DEBUG_MEMORY=%s", os.Getenv("SHUFFLE_DEBUG_MEMORY"))) + } + err = deployWorker(workerImage, containerName, env, execution) zombiecounter += 1 if err == nil {