A lot of things
This commit is contained in:
@@ -1914,7 +1914,6 @@ class AppBase:
|
|||||||
c_parentheses = parse_nested_param(parse_string, 0)[0]
|
c_parentheses = parse_nested_param(parse_string, 0)[0]
|
||||||
match_string = re.escape(c_parentheses)
|
match_string = re.escape(c_parentheses)
|
||||||
custom_casting = re.findall(fr"({wrapper_group})\({match_string}", parse_string)
|
custom_casting = re.findall(fr"({wrapper_group})\({match_string}", parse_string)
|
||||||
print("[DEBUG] In ELSE: %s" % custom_casting)
|
|
||||||
# check if a wrapper was found
|
# check if a wrapper was found
|
||||||
if len(custom_casting) != 0:
|
if len(custom_casting) != 0:
|
||||||
inner_result = parse_type(c_parentheses, custom_casting[0])
|
inner_result = parse_type(c_parentheses, custom_casting[0])
|
||||||
@@ -2093,7 +2092,6 @@ class AppBase:
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
newvalue, is_loop = (tmpitem, parsersplit[outercnt+1:])
|
newvalue, is_loop = (tmpitem, parsersplit[outercnt+1:])
|
||||||
else:
|
else:
|
||||||
#print("[INFO] In ELSE - handling %s and %s" % (firstitem, seconditem))
|
|
||||||
if isinstance(firstitem, str):
|
if isinstance(firstitem, str):
|
||||||
if firstitem.lower() == "max" or firstitem.lower() == "last" or firstitem.lower() == "end":
|
if firstitem.lower() == "max" or firstitem.lower() == "last" or firstitem.lower() == "end":
|
||||||
firstitem = len(basejson)-1
|
firstitem = len(basejson)-1
|
||||||
|
|||||||
@@ -552,7 +552,9 @@ func handleGetStreamResults(resp http.ResponseWriter, request *http.Request) {
|
|||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
workflowExecution, err := shuffle.GetWorkflowExecution(ctx, actionResult.ExecutionId)
|
workflowExecution, err := shuffle.GetWorkflowExecution(ctx, actionResult.ExecutionId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[WARNING][%s] Failed getting execution (streamresult): %s", actionResult.ExecutionId, err)
|
if len(actionResult.ExecutionId) > 0 {
|
||||||
|
log.Printf("[WARNING][%s] Failed getting execution (streamresult): %s", actionResult.ExecutionId, err)
|
||||||
|
}
|
||||||
resp.WriteHeader(401)
|
resp.WriteHeader(401)
|
||||||
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Bad authorization key or execution_id might not exist."}`)))
|
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "Bad authorization key or execution_id might not exist."}`)))
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -40,12 +40,12 @@ cytoscape.use(edgehandles);
|
|||||||
export const findSpecificApp = (framework, inputcategory) => {
|
export const findSpecificApp = (framework, inputcategory) => {
|
||||||
// Get the frameworkinfo for the org and fill in
|
// Get the frameworkinfo for the org and fill in
|
||||||
if (framework === undefined || framework === null) {
|
if (framework === undefined || framework === null) {
|
||||||
console.log("findSpecificApp: framework is null")
|
//console.log("findSpecificApp: framework is null")
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputcategory === undefined || inputcategory === null) {
|
if (inputcategory === undefined || inputcategory === null) {
|
||||||
console.log("findSpecificApp: category is null")
|
//console.log("findSpecificApp: category is null")
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,8 +118,8 @@ export const findSpecificApp = (framework, inputcategory) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: "EDR :default",
|
name: "IAM :default",
|
||||||
large_image: parsedDatatypeImages["EDR & AV"],
|
large_image: parsedDatatypeImages["IAM"],
|
||||||
count: 0,
|
count: 0,
|
||||||
description: "",
|
description: "",
|
||||||
id: "",
|
id: "",
|
||||||
@@ -654,7 +654,7 @@ const AppFramework = (props) => {
|
|||||||
|
|
||||||
|
|
||||||
const handleLoadNextSuggestion = (frameworkData) => {
|
const handleLoadNextSuggestion = (frameworkData) => {
|
||||||
console.log("Should check for next apps to load from App suggestion model")
|
//console.log("Should check for next apps to load from App suggestion model")
|
||||||
//fetch(globalUrl + "/api/v1/workflows/usecases", {
|
//fetch(globalUrl + "/api/v1/workflows/usecases", {
|
||||||
//credentials: "include",
|
//credentials: "include",
|
||||||
//cors: "no-cors",
|
//cors: "no-cors",
|
||||||
@@ -720,7 +720,7 @@ const AppFramework = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const showRecommendations = (changed, frameworkData) => {
|
const showRecommendations = (changed, frameworkData) => {
|
||||||
console.log("Inside recommendation loader")
|
//console.log("Inside recommendation loader")
|
||||||
setChangedApp(changed)
|
setChangedApp(changed)
|
||||||
handleLoadNextSuggestion(frameworkData)
|
handleLoadNextSuggestion(frameworkData)
|
||||||
|
|
||||||
@@ -761,7 +761,7 @@ const AppFramework = (props) => {
|
|||||||
//console.log("APptype, changed, framework: ", apptype.toLowerCase(), alternativeChanged.toLowerCase(), changed.toLowerCase(), frameworkData)
|
//console.log("APptype, changed, framework: ", apptype.toLowerCase(), alternativeChanged.toLowerCase(), changed.toLowerCase(), frameworkData)
|
||||||
if (changed.toLowerCase() === apptype.toLowerCase() || changed.toLowerCase().includes(apptype.toLowerCase()) || alternativeChanged.toLowerCase() === apptype.toLowerCase() || alternativeChanged.toLowerCase().includes(apptype.toLowerCase())) {
|
if (changed.toLowerCase() === apptype.toLowerCase() || changed.toLowerCase().includes(apptype.toLowerCase()) || alternativeChanged.toLowerCase() === apptype.toLowerCase() || alternativeChanged.toLowerCase().includes(apptype.toLowerCase())) {
|
||||||
potential = true
|
potential = true
|
||||||
console.log("Potential: !", apptype)
|
//console.log("Potential: !", apptype)
|
||||||
|
|
||||||
if (frameworkData[apptype] !== undefined && frameworkData[apptype].name !== undefined && frameworkData[apptype].name !== null && frameworkData[apptype].name.length > 0) {
|
if (frameworkData[apptype] !== undefined && frameworkData[apptype].name !== undefined && frameworkData[apptype].name !== null && frameworkData[apptype].name.length > 0) {
|
||||||
usecase.items[itemtype].app = frameworkData[apptype]
|
usecase.items[itemtype].app = frameworkData[apptype]
|
||||||
@@ -819,10 +819,10 @@ const AppFramework = (props) => {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log("No usecase to try to match it to (usecase.usecase_references in UsecaseSearch)")
|
//console.log("No usecase to try to match it to (usecase.usecase_references in UsecaseSearch)")
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Usecase: ", usecase)
|
//console.log("Usecase: ", usecase)
|
||||||
if (matches.length === usecase.items.length) {
|
if (matches.length === usecase.items.length) {
|
||||||
usecase.color = "#c51152"
|
usecase.color = "#c51152"
|
||||||
usecase.type = usecaseTypes[key].name
|
usecase.type = usecaseTypes[key].name
|
||||||
@@ -833,8 +833,8 @@ const AppFramework = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Check if a usecase has already been handled
|
// FIXME: Check if a usecase has already been handled
|
||||||
console.log("")
|
//console.log("")
|
||||||
console.log("GOT USECASES: ", showusecases)
|
//console.log("GOT USECASES: ", showusecases)
|
||||||
|
|
||||||
// FIXME: Just showing one usecase at a time for now
|
// FIXME: Just showing one usecase at a time for now
|
||||||
if (showusecases.length > 0) {
|
if (showusecases.length > 0) {
|
||||||
@@ -894,38 +894,37 @@ const AppFramework = (props) => {
|
|||||||
parsedUsecase.process.push(edge.data)
|
parsedUsecase.process.push(edge.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch(globalUrl + "/api/v1/workflows/usecases", {
|
fetch(globalUrl + "/api/v1/workflows/usecases", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify(parsedUsecase),
|
body: JSON.stringify(parsedUsecase),
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.status !== 200) {
|
if (response.status !== 200) {
|
||||||
console.log("Status not 200 for framework!");
|
console.log("Status not 200 for framework!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return response.json();
|
return response.json();
|
||||||
})
|
})
|
||||||
.then((responseJson) => {
|
.then((responseJson) => {
|
||||||
if (responseJson.success === false) {
|
if (responseJson.success === false) {
|
||||||
if (responseJson.reason !== undefined) {
|
if (responseJson.reason !== undefined) {
|
||||||
toast("Failed updating: " + responseJson.reason)
|
toast("Failed updating: " + responseJson.reason)
|
||||||
} else {
|
|
||||||
toast("Failed to update framework for your org.")
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
toast("Updated usecase.")
|
toast("Failed to update framework for your org.")
|
||||||
}
|
}
|
||||||
})
|
} else {
|
||||||
.catch((error) => {
|
toast("Updated usecase.")
|
||||||
toast(error.toString());
|
}
|
||||||
//setFrameworkLoaded(true)
|
})
|
||||||
})
|
.catch((error) => {
|
||||||
}
|
toast(error.toString());
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const activateApp = (appid) => {
|
const activateApp = (appid) => {
|
||||||
fetch(globalUrl+"/api/v1/apps/"+appid+"/activate", {
|
fetch(globalUrl+"/api/v1/apps/"+appid+"/activate", {
|
||||||
@@ -957,45 +956,54 @@ const AppFramework = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const setFrameworkItem = (data) => {
|
const setFrameworkItem = (data) => {
|
||||||
console.log("Setting framework item: ", data, isCloud)
|
|
||||||
if (!isCloud) {
|
if (!isCloud) {
|
||||||
activateApp(data.id)
|
activateApp(data.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch(globalUrl + "/api/v1/apps/frameworkConfiguration", {
|
fetch(globalUrl + "/api/v1/apps/frameworkConfiguration", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Accept: "application/json",
|
Accept: "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.status !== 200) {
|
if (response.status !== 200) {
|
||||||
console.log("Status not 200 for framework!");
|
console.log("Status not 200 for framework!");
|
||||||
}
|
}
|
||||||
|
|
||||||
return response.json();
|
return response.json();
|
||||||
})
|
})
|
||||||
.then((responseJson) => {
|
.then((responseJson) => {
|
||||||
if (responseJson.success === false) {
|
if (responseJson.success === false) {
|
||||||
if (responseJson.reason !== undefined) {
|
if (responseJson.reason !== undefined) {
|
||||||
toast("Failed updating: " + responseJson.reason)
|
toast("Failed getting appframework: " + responseJson.reason)
|
||||||
} else {
|
} else {
|
||||||
toast("Failed to update framework for your org.")
|
toast("Failed to update framework for your org.")
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
if (data.id === "remove") {
|
||||||
|
frameworkData[data.type] = {}
|
||||||
|
frameworkData[data.type.toLowerCase()] = {}
|
||||||
|
} else {
|
||||||
|
frameworkData[data.type] = data
|
||||||
|
frameworkData[data.type.toLowerCase()] = data
|
||||||
|
}
|
||||||
|
|
||||||
//setFrameworkLoaded(true)
|
setDiscoveryData({})
|
||||||
//setFrameworkData(responseJson)
|
if (setFrameworkData !== undefined) {
|
||||||
})
|
setFrameworkData(frameworkData)
|
||||||
.catch((error) => {
|
}
|
||||||
toast(error.toString());
|
}
|
||||||
//setFrameworkLoaded(true)
|
})
|
||||||
})
|
.catch((error) => {
|
||||||
}
|
toast(error.toString());
|
||||||
|
//setFrameworkLoaded(true)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!window.location.pathname.includes("usecases")) {
|
if (!window.location.pathname.includes("usecases")) {
|
||||||
@@ -1058,7 +1066,6 @@ const AppFramework = (props) => {
|
|||||||
frameworkData[keys[key]] = submitValue
|
frameworkData[keys[key]] = submitValue
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Frameworkdata: ", frameworkData)
|
|
||||||
setFrameworkData(frameworkData)
|
setFrameworkData(frameworkData)
|
||||||
|
|
||||||
if (discoveryData.large_image !== undefined && discoveryData.large_image !== null && discoveryData.large_image.includes("storage.googleapis.com")) {
|
if (discoveryData.large_image !== undefined && discoveryData.large_image !== null && discoveryData.large_image.includes("storage.googleapis.com")) {
|
||||||
@@ -1076,8 +1083,6 @@ const AppFramework = (props) => {
|
|||||||
|
|
||||||
|
|
||||||
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 imgSize = 50;
|
const imgSize = 50;
|
||||||
var parsedFrameworkData = frameworkData === undefined ? {} : frameworkData
|
var parsedFrameworkData = frameworkData === undefined ? {} : frameworkData
|
||||||
|
|
||||||
@@ -1263,7 +1268,7 @@ const AppFramework = (props) => {
|
|||||||
|
|
||||||
var parsedStyle2 = {
|
var parsedStyle2 = {
|
||||||
"ghost": "yes",
|
"ghost": "yes",
|
||||||
"border-width": "7px",
|
"border-width": "7px",
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1399,7 +1404,6 @@ const AppFramework = (props) => {
|
|||||||
|
|
||||||
const onNodeSelect = (event) => {
|
const onNodeSelect = (event) => {
|
||||||
var data = event.target.data();
|
var data = event.target.data();
|
||||||
console.log("Node: ", data)
|
|
||||||
if (data.id === "SHUFFLE") {
|
if (data.id === "SHUFFLE") {
|
||||||
event.target.unselect()
|
event.target.unselect()
|
||||||
return
|
return
|
||||||
@@ -1465,6 +1469,15 @@ const AppFramework = (props) => {
|
|||||||
|
|
||||||
const foundMiddleImage = userdata !== undefined && userdata !== null && userdata.active_org !== undefined && userdata.active_org.image !== undefined && userdata.active_org.image !== null && userdata.active_org.image !== "" ? userdata.active_org.image : '/images/Shuffle_logo.png'
|
const foundMiddleImage = userdata !== undefined && userdata !== null && userdata.active_org !== undefined && userdata.active_org.image !== undefined && userdata.active_org.image !== null && userdata.active_org.image !== "" ? userdata.active_org.image : '/images/Shuffle_logo.png'
|
||||||
|
|
||||||
|
const siemcheck = parsedFrameworkData.SIEM.large_image === undefined || (parsedFrameworkData.SIEM.name !== undefined && parsedFrameworkData.SIEM.name !== null && parsedFrameworkData.SIEM.name.includes(":default"))
|
||||||
|
const iamcheck = parsedFrameworkData.IAM.large_image === undefined || (parsedFrameworkData.IAM.name !== undefined && parsedFrameworkData.IAM.name !== null && parsedFrameworkData.IAM.name.includes(":default"))
|
||||||
|
const casescheck = parsedFrameworkData.Cases.large_image === undefined || (parsedFrameworkData.Cases.name !== undefined && parsedFrameworkData.Cases.name !== null && parsedFrameworkData.Cases.name.includes(":default"))
|
||||||
|
const assetscheck = parsedFrameworkData.Assets.large_image === undefined || (parsedFrameworkData.Assets.name !== undefined && parsedFrameworkData.Assets.name !== null && parsedFrameworkData.Assets.name.includes(":default"))
|
||||||
|
const intelcheck = parsedFrameworkData.Intel.large_image === undefined || (parsedFrameworkData.Intel.name !== undefined && parsedFrameworkData.Intel.name !== null && parsedFrameworkData.Intel.name.includes(":default"))
|
||||||
|
const commscheck = parsedFrameworkData.Comms.large_image === undefined || (parsedFrameworkData.Comms.name !== undefined && parsedFrameworkData.Comms.name !== null && parsedFrameworkData.Comms.name.includes(":default"))
|
||||||
|
const edrcheck = parsedFrameworkData["EDR & AV"].large_image === undefined || (parsedFrameworkData["EDR & AV"].name !== undefined && parsedFrameworkData["EDR & AV"].name !== null && parsedFrameworkData["EDR & AV"].name.includes(":default"))
|
||||||
|
const networkcheck = parsedFrameworkData.Network.large_image === undefined || (parsedFrameworkData.Network.name !== undefined && parsedFrameworkData.Network.name !== null && parsedFrameworkData.Network.name.includes(":default"))
|
||||||
|
|
||||||
|
|
||||||
const fontSize = `${12*scale}px`
|
const fontSize = `${12*scale}px`
|
||||||
const defaultSize = `${85*scale}px`
|
const defaultSize = `${85*scale}px`
|
||||||
@@ -1484,11 +1497,11 @@ const AppFramework = (props) => {
|
|||||||
name: parsedFrameworkData.Cases.name === undefined ? "" : parsedFrameworkData.Cases.name,
|
name: parsedFrameworkData.Cases.name === undefined ? "" : parsedFrameworkData.Cases.name,
|
||||||
description: parsedFrameworkData.Cases.description === undefined ? "" : parsedFrameworkData.Cases.description,
|
description: parsedFrameworkData.Cases.description === undefined ? "" : parsedFrameworkData.Cases.description,
|
||||||
app_id: parsedFrameworkData.Cases.id === undefined ? "" : parsedFrameworkData.Cases.id,
|
app_id: parsedFrameworkData.Cases.id === undefined ? "" : parsedFrameworkData.Cases.id,
|
||||||
text_margin_y: parsedFrameworkData.Cases.large_image === undefined ? textMarginDefault : textMarginImage,
|
text_margin_y: casescheck ? textMarginDefault : textMarginImage,
|
||||||
margin_x: parsedFrameworkData.Cases.large_image === undefined ? `${32*scale}px` : "0px",
|
margin_x: casescheck ? `${32*scale}px` : "0px",
|
||||||
margin_y: parsedFrameworkData.Cases.large_image === undefined ? `${19*scale}px` : `0px`,
|
margin_y: casescheck ? `${19*scale}px` : `0px`,
|
||||||
width: parsedFrameworkData.Cases.large_image === undefined ? iconSize : defaultSize,
|
width: casescheck ? iconSize : defaultSize,
|
||||||
height: parsedFrameworkData.Cases.large_image === undefined ? iconSize : defaultSize,
|
height: casescheck ? iconSize : defaultSize,
|
||||||
large_image: parsedFrameworkData.Cases.large_image === undefined ? parsedDatatypeImages["CASES"] : parsedFrameworkData.Cases.large_image,
|
large_image: parsedFrameworkData.Cases.large_image === undefined ? parsedDatatypeImages["CASES"] : parsedFrameworkData.Cases.large_image,
|
||||||
|
|
||||||
label: securityFramework[0].text.toUpperCase(),
|
label: securityFramework[0].text.toUpperCase(),
|
||||||
@@ -1501,6 +1514,7 @@ const AppFramework = (props) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
||||||
group: "nodes",
|
group: "nodes",
|
||||||
data: {
|
data: {
|
||||||
font_size: fontSize,
|
font_size: fontSize,
|
||||||
@@ -1512,11 +1526,11 @@ const AppFramework = (props) => {
|
|||||||
name: parsedFrameworkData.IAM.name === undefined ? "" : parsedFrameworkData.IAM.name,
|
name: parsedFrameworkData.IAM.name === undefined ? "" : parsedFrameworkData.IAM.name,
|
||||||
description: parsedFrameworkData.IAM.description === undefined ? "" : parsedFrameworkData.IAM.description,
|
description: parsedFrameworkData.IAM.description === undefined ? "" : parsedFrameworkData.IAM.description,
|
||||||
app_id: parsedFrameworkData.IAM.id === undefined ? "" : parsedFrameworkData.IAM.id,
|
app_id: parsedFrameworkData.IAM.id === undefined ? "" : parsedFrameworkData.IAM.id,
|
||||||
text_margin_y: parsedFrameworkData.IAM.large_image === undefined ? textMarginDefault : textMarginImage,
|
text_margin_y: iamcheck ? textMarginDefault : textMarginImage,
|
||||||
margin_x: parsedFrameworkData.IAM.large_image === undefined ? `${32*scale}px` : "0px",
|
margin_x: iamcheck ? `${32*scale}px` : "0px",
|
||||||
margin_y: parsedFrameworkData.IAM.large_image === undefined ? `${19*scale}px` : `0px`,
|
margin_y: iamcheck ? `${19*scale}px` : `0px`,
|
||||||
width: parsedFrameworkData.IAM.large_image === undefined ? iconSize : defaultSize,
|
width: iamcheck ? iconSize : defaultSize,
|
||||||
height: parsedFrameworkData.IAM.large_image === undefined ? iconSize : defaultSize,
|
height: iamcheck ? iconSize : defaultSize,
|
||||||
large_image: parsedFrameworkData.IAM.large_image === undefined ? parsedDatatypeImages["IAM"] : parsedFrameworkData.IAM.large_image,
|
large_image: parsedFrameworkData.IAM.large_image === undefined ? parsedDatatypeImages["IAM"] : parsedFrameworkData.IAM.large_image,
|
||||||
|
|
||||||
label: securityFramework[3].text.toUpperCase(),
|
label: securityFramework[3].text.toUpperCase(),
|
||||||
@@ -1540,11 +1554,11 @@ const AppFramework = (props) => {
|
|||||||
name: parsedFrameworkData.Assets.name === undefined ? "" : parsedFrameworkData.Assets.name,
|
name: parsedFrameworkData.Assets.name === undefined ? "" : parsedFrameworkData.Assets.name,
|
||||||
description: parsedFrameworkData.Assets.description === undefined ? "" : parsedFrameworkData.Assets.description,
|
description: parsedFrameworkData.Assets.description === undefined ? "" : parsedFrameworkData.Assets.description,
|
||||||
app_id: parsedFrameworkData.Assets.id === undefined ? "" : parsedFrameworkData.Assets.id,
|
app_id: parsedFrameworkData.Assets.id === undefined ? "" : parsedFrameworkData.Assets.id,
|
||||||
text_margin_y: parsedFrameworkData.Assets.large_image === undefined ? textMarginDefault : textMarginImage,
|
text_margin_y: assetscheck ? textMarginDefault : textMarginImage,
|
||||||
margin_x: parsedFrameworkData.Assets.large_image === undefined ? `${32*scale}px` : "0px",
|
margin_x: assetscheck ? `${32*scale}px` : "0px",
|
||||||
margin_y: parsedFrameworkData.Assets.large_image === undefined ? `${19*scale}px` : `0px`,
|
margin_y: assetscheck ? `${19*scale}px` : `0px`,
|
||||||
width: parsedFrameworkData.Assets.large_image === undefined ? iconSize : defaultSize,
|
width: assetscheck ? iconSize : defaultSize,
|
||||||
height: parsedFrameworkData.Assets.large_image === undefined ? iconSize : defaultSize,
|
height: assetscheck ? iconSize : defaultSize,
|
||||||
large_image: parsedFrameworkData.Assets.large_image === undefined ? parsedDatatypeImages["ASSETS"] : parsedFrameworkData.Assets.large_image,
|
large_image: parsedFrameworkData.Assets.large_image === undefined ? parsedDatatypeImages["ASSETS"] : parsedFrameworkData.Assets.large_image,
|
||||||
|
|
||||||
label: securityFramework[2].text.toUpperCase(),
|
label: securityFramework[2].text.toUpperCase(),
|
||||||
@@ -1568,11 +1582,11 @@ const AppFramework = (props) => {
|
|||||||
name: parsedFrameworkData.Intel.name === undefined ? "" : parsedFrameworkData.Intel.name,
|
name: parsedFrameworkData.Intel.name === undefined ? "" : parsedFrameworkData.Intel.name,
|
||||||
description: parsedFrameworkData.Intel.description === undefined ? "" : parsedFrameworkData.Intel.description,
|
description: parsedFrameworkData.Intel.description === undefined ? "" : parsedFrameworkData.Intel.description,
|
||||||
app_id: parsedFrameworkData.Intel.id === undefined ? "" : parsedFrameworkData.Intel.id,
|
app_id: parsedFrameworkData.Intel.id === undefined ? "" : parsedFrameworkData.Intel.id,
|
||||||
text_margin_y: parsedFrameworkData.Intel.large_image === undefined ? textMarginDefault : textMarginImage,
|
text_margin_y: intelcheck ? textMarginDefault : textMarginImage,
|
||||||
margin_x: parsedFrameworkData.Intel.large_image === undefined ? `${32*scale}px` : "0px",
|
margin_x: intelcheck ? `${32*scale}px` : "0px",
|
||||||
margin_y: parsedFrameworkData.Intel.large_image === undefined ? `${19*scale}px` : `0px`,
|
margin_y: intelcheck ? `${19*scale}px` : `0px`,
|
||||||
width: parsedFrameworkData.Intel.large_image === undefined ? iconSize : defaultSize,
|
width: intelcheck ? iconSize : defaultSize,
|
||||||
height: parsedFrameworkData.Intel.large_image === undefined ? iconSize : defaultSize,
|
height: intelcheck ? iconSize : defaultSize,
|
||||||
large_image: parsedFrameworkData.Intel.large_image === undefined ? parsedDatatypeImages["INTEL"] : parsedFrameworkData.Intel.large_image,
|
large_image: parsedFrameworkData.Intel.large_image === undefined ? parsedDatatypeImages["INTEL"] : parsedFrameworkData.Intel.large_image,
|
||||||
|
|
||||||
label: securityFramework[4].text.toUpperCase(),
|
label: securityFramework[4].text.toUpperCase(),
|
||||||
@@ -1596,11 +1610,11 @@ const AppFramework = (props) => {
|
|||||||
name: parsedFrameworkData.Comms.name === undefined ? "" : parsedFrameworkData.Comms.name,
|
name: parsedFrameworkData.Comms.name === undefined ? "" : parsedFrameworkData.Comms.name,
|
||||||
description: parsedFrameworkData.Comms.description === undefined ? "" : parsedFrameworkData.Comms.description,
|
description: parsedFrameworkData.Comms.description === undefined ? "" : parsedFrameworkData.Comms.description,
|
||||||
app_id: parsedFrameworkData.Comms.id === undefined ? "" : parsedFrameworkData.Comms.id,
|
app_id: parsedFrameworkData.Comms.id === undefined ? "" : parsedFrameworkData.Comms.id,
|
||||||
text_margin_y: parsedFrameworkData.Comms.large_image === undefined ? textMarginDefault : textMarginImage,
|
text_margin_y: commscheck ? textMarginDefault : textMarginImage,
|
||||||
margin_x: parsedFrameworkData.Comms.large_image === undefined ? `${32*scale}px` : "0px",
|
margin_x: commscheck ? `${32*scale}px` : "0px",
|
||||||
margin_y: parsedFrameworkData.Comms.large_image === undefined ? `${19*scale}px` : `0px`,
|
margin_y: commscheck ? `${19*scale}px` : `0px`,
|
||||||
width: parsedFrameworkData.Comms.large_image === undefined ? iconSize : defaultSize,
|
width: commscheck ? iconSize : defaultSize,
|
||||||
height: parsedFrameworkData.Comms.large_image === undefined ? iconSize : defaultSize,
|
height: commscheck ? iconSize : defaultSize,
|
||||||
large_image: parsedFrameworkData.Comms.large_image === undefined ? parsedDatatypeImages["COMMS"] : parsedFrameworkData.Comms.large_image,
|
large_image: parsedFrameworkData.Comms.large_image === undefined ? parsedDatatypeImages["COMMS"] : parsedFrameworkData.Comms.large_image,
|
||||||
|
|
||||||
label: securityFramework[5].text.toUpperCase(),
|
label: securityFramework[5].text.toUpperCase(),
|
||||||
@@ -1624,11 +1638,11 @@ const AppFramework = (props) => {
|
|||||||
name: parsedFrameworkData["EDR & AV"].name === undefined ? "" : parsedFrameworkData["EDR & AV"].name,
|
name: parsedFrameworkData["EDR & AV"].name === undefined ? "" : parsedFrameworkData["EDR & AV"].name,
|
||||||
description: parsedFrameworkData["EDR & AV"].description === undefined ? "" : parsedFrameworkData["EDR & AV"].description,
|
description: parsedFrameworkData["EDR & AV"].description === undefined ? "" : parsedFrameworkData["EDR & AV"].description,
|
||||||
app_id: parsedFrameworkData["EDR & AV"].id === undefined ? "" : parsedFrameworkData["EDR & AV"].id,
|
app_id: parsedFrameworkData["EDR & AV"].id === undefined ? "" : parsedFrameworkData["EDR & AV"].id,
|
||||||
text_margin_y: parsedFrameworkData["EDR & AV"].large_image === undefined ? textMarginDefault : textMarginImage,
|
text_margin_y: edrcheck ? textMarginDefault : textMarginImage,
|
||||||
margin_x: parsedFrameworkData["EDR & AV"].large_image === undefined ? `${32*scale}px` : "0px",
|
margin_x: edrcheck ? `${32*scale}px` : "0px",
|
||||||
margin_y: parsedFrameworkData["EDR & AV"].large_image === undefined ? `${19*scale}px` : `0px`,
|
margin_y: edrcheck ? `${19*scale}px` : `0px`,
|
||||||
width: parsedFrameworkData["EDR & AV"].large_image === undefined ? iconSize : defaultSize,
|
width: edrcheck ? iconSize : defaultSize,
|
||||||
height: parsedFrameworkData["EDR & AV"].large_image === undefined ? iconSize : defaultSize,
|
height: edrcheck ? iconSize : defaultSize,
|
||||||
large_image: parsedFrameworkData["EDR & AV"].large_image === undefined ? parsedDatatypeImages["EDR & AV"] : parsedFrameworkData["EDR & AV"].large_image,
|
large_image: parsedFrameworkData["EDR & AV"].large_image === undefined ? parsedDatatypeImages["EDR & AV"] : parsedFrameworkData["EDR & AV"].large_image,
|
||||||
|
|
||||||
label: securityFramework[7].text.toUpperCase(),
|
label: securityFramework[7].text.toUpperCase(),
|
||||||
@@ -1652,11 +1666,11 @@ const AppFramework = (props) => {
|
|||||||
name: parsedFrameworkData.Network.name === undefined ? "" : parsedFrameworkData.Network.name,
|
name: parsedFrameworkData.Network.name === undefined ? "" : parsedFrameworkData.Network.name,
|
||||||
description: parsedFrameworkData.Network.description === undefined ? "" : parsedFrameworkData.Network.description,
|
description: parsedFrameworkData.Network.description === undefined ? "" : parsedFrameworkData.Network.description,
|
||||||
app_id: parsedFrameworkData.Network.id === undefined ? "" : parsedFrameworkData.Network.id,
|
app_id: parsedFrameworkData.Network.id === undefined ? "" : parsedFrameworkData.Network.id,
|
||||||
text_margin_y: parsedFrameworkData.Network.large_image === undefined ? textMarginDefault : textMarginImage,
|
text_margin_y: networkcheck ? textMarginDefault : textMarginImage,
|
||||||
margin_x: parsedFrameworkData.Network.large_image === undefined ? `${32*scale}px` : "0px",
|
margin_x: networkcheck ? `${32*scale}px` : "0px",
|
||||||
margin_y: parsedFrameworkData.Network.large_image === undefined ? `${19*scale}px` : `0px`,
|
margin_y: networkcheck ? `${19*scale}px` : `0px`,
|
||||||
width: parsedFrameworkData.Network.large_image === undefined ? iconSize : defaultSize,
|
width: networkcheck ? iconSize : defaultSize,
|
||||||
height: parsedFrameworkData.Network.large_image === undefined ? iconSize : defaultSize,
|
height: networkcheck ? iconSize : defaultSize,
|
||||||
large_image: parsedFrameworkData.Network.large_image === undefined ? parsedDatatypeImages["NETWORK"] : parsedFrameworkData.Network.large_image,
|
large_image: parsedFrameworkData.Network.large_image === undefined ? parsedDatatypeImages["NETWORK"] : parsedFrameworkData.Network.large_image,
|
||||||
label: securityFramework[6].text.toUpperCase(),
|
label: securityFramework[6].text.toUpperCase(),
|
||||||
id: securityFramework[6].text.toUpperCase(),
|
id: securityFramework[6].text.toUpperCase(),
|
||||||
@@ -1679,11 +1693,11 @@ const AppFramework = (props) => {
|
|||||||
name: parsedFrameworkData.SIEM.name === undefined ? "" : parsedFrameworkData.SIEM.name,
|
name: parsedFrameworkData.SIEM.name === undefined ? "" : parsedFrameworkData.SIEM.name,
|
||||||
description: parsedFrameworkData.SIEM.description === undefined ? "" : parsedFrameworkData.SIEM.description,
|
description: parsedFrameworkData.SIEM.description === undefined ? "" : parsedFrameworkData.SIEM.description,
|
||||||
app_id: parsedFrameworkData.SIEM.id === undefined ? "" : parsedFrameworkData.SIEM.id,
|
app_id: parsedFrameworkData.SIEM.id === undefined ? "" : parsedFrameworkData.SIEM.id,
|
||||||
text_margin_y: parsedFrameworkData.SIEM.large_image === undefined ? textMarginDefault : textMarginImage,
|
text_margin_y: siemcheck ? textMarginDefault : textMarginImage,
|
||||||
margin_x: parsedFrameworkData.SIEM.large_image === undefined ? `${32*scale}px` : "0px",
|
margin_x: siemcheck ? `${32*scale}px` : "0px",
|
||||||
margin_y: parsedFrameworkData.SIEM.large_image === undefined ? `${19*scale}px` : `0px`,
|
margin_y: siemcheck ? `${19*scale}px` : `0px`,
|
||||||
width: parsedFrameworkData.SIEM.large_image === undefined ? iconSize : defaultSize,
|
width: siemcheck ? iconSize : defaultSize,
|
||||||
height: parsedFrameworkData.SIEM.large_image === undefined ? iconSize : defaultSize,
|
height: siemcheck ? iconSize : defaultSize,
|
||||||
large_image: parsedFrameworkData.SIEM.large_image === undefined ? parsedDatatypeImages["SIEM"] : parsedFrameworkData.SIEM.large_image,
|
large_image: parsedFrameworkData.SIEM.large_image === undefined ? parsedDatatypeImages["SIEM"] : parsedFrameworkData.SIEM.large_image,
|
||||||
label: securityFramework[1].text.toUpperCase(),
|
label: securityFramework[1].text.toUpperCase(),
|
||||||
id: securityFramework[1].text.toUpperCase(),
|
id: securityFramework[1].text.toUpperCase(),
|
||||||
@@ -1988,6 +2002,7 @@ const AppFramework = (props) => {
|
|||||||
const bgColor = color === undefined || color === null || color.length === 0 ? theme.palette.surfaceColor : color
|
const bgColor = color === undefined || color === null || color.length === 0 ? theme.palette.surfaceColor : color
|
||||||
return (
|
return (
|
||||||
<div style={{margin: "auto", backgroundColor: bgColor, position: "relative", }}>
|
<div style={{margin: "auto", backgroundColor: bgColor, position: "relative", }}>
|
||||||
|
{/*
|
||||||
<div style={{position: "absolute"}}>
|
<div style={{position: "absolute"}}>
|
||||||
|
|
||||||
<SuggestedWorkflows
|
<SuggestedWorkflows
|
||||||
@@ -1999,9 +2014,11 @@ const AppFramework = (props) => {
|
|||||||
inputSearch={changedApp}
|
inputSearch={changedApp}
|
||||||
apps={apps}
|
apps={apps}
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
|
|
||||||
{injectedApps.map((apps, appindex) => {
|
</div>
|
||||||
|
*/}
|
||||||
|
|
||||||
|
{/*injectedApps.map((apps, appindex) => {
|
||||||
var categoryTop = 100
|
var categoryTop = 100
|
||||||
var categoryLeft = 100
|
var categoryLeft = 100
|
||||||
|
|
||||||
@@ -2028,8 +2045,11 @@ const AppFramework = (props) => {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const scale = 0.9
|
||||||
|
const offsetTop = -70
|
||||||
|
const offsetLeft = 0
|
||||||
return (
|
return (
|
||||||
<div key={appindex} style={{display: "flex", position: "absolute", top: categoryTop, left: categoryLeft, zIndex: 10010, }}>
|
<div key={appindex} style={{display: "flex", position: "absolute", top: categoryTop+offsetTop, left: categoryLeft+offsetLeft, zIndex: 10010, }}>
|
||||||
{apps.map((app, appIndex) => {
|
{apps.map((app, appIndex) => {
|
||||||
return (
|
return (
|
||||||
<Chip
|
<Chip
|
||||||
@@ -2059,7 +2079,6 @@ const AppFramework = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (setFrameworkData !== undefined) {
|
if (setFrameworkData !== undefined) {
|
||||||
console.log("Setting frameworkdata")
|
|
||||||
// Find discoveryData.id
|
// Find discoveryData.id
|
||||||
var keys = []
|
var keys = []
|
||||||
for (const [key, value] of Object.entries(frameworkData)) {
|
for (const [key, value] of Object.entries(frameworkData)) {
|
||||||
@@ -2088,7 +2107,7 @@ const AppFramework = (props) => {
|
|||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})}
|
})*/}
|
||||||
|
|
||||||
{showOptions === false ? null :
|
{showOptions === false ? null :
|
||||||
<div style={{textAlign: "center",}}>
|
<div style={{textAlign: "center",}}>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import {
|
|||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
|
|
||||||
const AppSearchButtons = (props) => {
|
const AppSearchButtons = (props) => {
|
||||||
const { userdata, globalUrl, appFramework, moreButton, finishedApps, appType, totalApps, index, onNodeSelect, setDiscoveryData, appName, AppImage, setDefaultSearch, discoveryData, checkLogin, setMissing, } = props
|
const { userdata, globalUrl, appFramework, moreButton, finishedApps, appType, totalApps, index, onNodeSelect, setDiscoveryData, appName, AppImage, setDefaultSearch, discoveryData, checkLogin, setMissing, getAppFramework, } = props
|
||||||
|
|
||||||
const ref = useRef()
|
const ref = useRef()
|
||||||
let navigate = useNavigate();
|
let navigate = useNavigate();
|
||||||
@@ -48,8 +48,6 @@ const AppSearchButtons = (props) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (newSelectedApp !== undefined && setMissing != undefined) {
|
if (newSelectedApp !== undefined && setMissing != undefined) {
|
||||||
console.log("AppSearchButtons: setMissing is defined!")
|
|
||||||
|
|
||||||
const submitAppFramework = {
|
const submitAppFramework = {
|
||||||
"description": newSelectedApp.description,
|
"description": newSelectedApp.description,
|
||||||
"id": newSelectedApp.objectID,
|
"id": newSelectedApp.objectID,
|
||||||
@@ -60,11 +58,17 @@ const AppSearchButtons = (props) => {
|
|||||||
|
|
||||||
setFrameworkItem(submitAppFramework)
|
setFrameworkItem(submitAppFramework)
|
||||||
setMissing(newSelectedApp)
|
setMissing(newSelectedApp)
|
||||||
|
|
||||||
|
if (getAppFramework !== undefined) {
|
||||||
|
setTimeout(() => {
|
||||||
|
getAppFramework()
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, [newSelectedApp])
|
}, [newSelectedApp])
|
||||||
|
|
||||||
if (appType === undefined) {
|
if (appType === undefined) {
|
||||||
console.log("Apptype is required in AppSearchButtons")
|
//console.log("Apptype is required in AppSearchButtons")
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,10 +77,8 @@ const ConfigureWorkflow = (props) => {
|
|||||||
const [checkStarted, setCheckStarted] = React.useState(false);
|
const [checkStarted, setCheckStarted] = React.useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("Required actions: ", requiredActions)
|
//console.log("Configure Workflow: Required actions: ", requiredActions)
|
||||||
if (requiredActions.length === 0) {
|
if (requiredActions.length === 0) {
|
||||||
console.log("No more actions? Set parent to done?")
|
|
||||||
|
|
||||||
if (setConfigurationFinished !== undefined) {
|
if (setConfigurationFinished !== undefined) {
|
||||||
setConfigurationFinished(true)
|
setConfigurationFinished(true)
|
||||||
}
|
}
|
||||||
@@ -731,6 +729,7 @@ const ConfigureWorkflow = (props) => {
|
|||||||
|
|
||||||
parsedName = (parsedName.charAt(0).toUpperCase() + parsedName.slice(1)).replaceAll("_", " ");
|
parsedName = (parsedName.charAt(0).toUpperCase() + parsedName.slice(1)).replaceAll("_", " ");
|
||||||
|
|
||||||
|
console.log("AUTH Action: ", action)
|
||||||
return (
|
return (
|
||||||
<ListItem
|
<ListItem
|
||||||
style={{padding: 0, display: "flex", flexDirection: "column", }}
|
style={{padding: 0, display: "flex", flexDirection: "column", }}
|
||||||
|
|||||||
@@ -146,8 +146,6 @@ const EditWorkflow = (props) => {
|
|||||||
|
|
||||||
const newWorkflow = isEditing === true ? false : true
|
const newWorkflow = isEditing === true ? false : true
|
||||||
const priority = userdata === undefined || userdata === null ? null : userdata.priorities.find(prio => prio.type === "usecase" && prio.active === true)
|
const priority = userdata === undefined || userdata === null ? null : userdata.priorities.find(prio => prio.type === "usecase" && prio.active === true)
|
||||||
console.log("PRIO: ", priority)
|
|
||||||
|
|
||||||
var upload = "";
|
var upload = "";
|
||||||
var total_count = 0
|
var total_count = 0
|
||||||
|
|
||||||
@@ -485,7 +483,7 @@ const EditWorkflow = (props) => {
|
|||||||
|
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|
||||||
<DialogActions style={{paddingRight: 100, }}>
|
<DialogActions style={{paddingRight: 100, marginBottom: 100, }}>
|
||||||
<Button
|
<Button
|
||||||
style={{}}
|
style={{}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -1040,22 +1040,28 @@ const ParsedAction = (props) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const returnHelperText = (name, value) => {
|
const returnHelperText = (name, value) => {
|
||||||
if (name === undefined || value === undefined) {
|
if (name === undefined || value === undefined || name === null || value === null || name === "" || value === "") {
|
||||||
return ""
|
//console.log("RETURNING EMPTY")
|
||||||
}
|
return ""
|
||||||
|
|
||||||
var helperText = ""
|
|
||||||
//console.log("DATA: ", name, value)
|
|
||||||
if (name.includes("url")) {
|
|
||||||
if (value.includes("localhost") || value.includes("127.0.0.1")) {
|
|
||||||
helperText = "Can't use localhost. Please change to an external IP or hostname."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return helperText
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var helperText = ""
|
||||||
|
//console.log("DATA: ", name, value)
|
||||||
|
if (name.includes("url")) {
|
||||||
|
if (value.includes("localhost") || value.includes("127.0.0.1")) {
|
||||||
|
helperText = "Can't use localhost. Please change to your external IP."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helpertext for openapi fields
|
||||||
|
//if (helperText === "" && name === "body" && selectedApp.generated && selectedApp.activated) {
|
||||||
|
// helperText = <span style={{color: "white", marginBottom: 5, marginleft: 5}}>
|
||||||
|
//}
|
||||||
|
|
||||||
|
return helperText
|
||||||
|
}
|
||||||
|
|
||||||
//console.log("AUTH: ", authenticationType)
|
//console.log("AUTH: ", authenticationType)
|
||||||
if (authenticationType !== undefined && authenticationType !== null && authenticationType.type === "oauth2") {
|
if (authenticationType !== undefined && authenticationType !== null && authenticationType.type === "oauth2") {
|
||||||
/*
|
/*
|
||||||
@@ -1297,17 +1303,13 @@ const ParsedAction = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var placeholder = "Value";
|
var placeholder = "Value";
|
||||||
if (
|
if (data.example !== undefined && data.example !== null && data.example.length > 0) {
|
||||||
data.example !== undefined &&
|
|
||||||
data.example !== null &&
|
|
||||||
data.example.length > 0
|
|
||||||
) {
|
|
||||||
placeholder = data.example;
|
placeholder = data.example;
|
||||||
|
|
||||||
if (data.name === "url" && data.value !== undefined && data.value !== null && data.value.length === 0) {
|
if (data.name === "url" && data.value !== undefined && data.value !== null && data.value.length === 0) {
|
||||||
data.value = data.example;
|
data.value = data.example;
|
||||||
}
|
}
|
||||||
|
|
||||||
// In case of data.example
|
// In case of data.example
|
||||||
if (data.value === undefined || data.value === null) {
|
if (data.value === undefined || data.value === null) {
|
||||||
data.value = ""
|
data.value = ""
|
||||||
@@ -1642,7 +1644,6 @@ const ParsedAction = (props) => {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
multiline={data.name.startsWith("${") && data.name.endsWith("}") ? true : multiline}
|
multiline={data.name.startsWith("${") && data.name.endsWith("}") ? true : multiline}
|
||||||
helperText={returnHelperText(data.name, data.value)}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
/*
|
/*
|
||||||
setExpansionModalOpen(false);
|
setExpansionModalOpen(false);
|
||||||
@@ -1680,18 +1681,7 @@ const ParsedAction = (props) => {
|
|||||||
//changeActionParameterCodemirror(event, count, data)
|
//changeActionParameterCodemirror(event, count, data)
|
||||||
changeActionParameter(event, count, data);
|
changeActionParameter(event, count, data);
|
||||||
}}
|
}}
|
||||||
helperText={baseHelperText.length > 0 ? baseHelperText :
|
helperText={returnHelperText(data.name, data.value)}
|
||||||
selectedApp.generated &&
|
|
||||||
selectedApp.activated &&
|
|
||||||
data.name === "body" ? (
|
|
||||||
<span
|
|
||||||
style={{ color: "white", marginBottom: 5, marginleft: 5 }}
|
|
||||||
>
|
|
||||||
{openApiHelperText}
|
|
||||||
</span>
|
|
||||||
) : data.name.startsWith("${") && data.name.endsWith("}") ?
|
|
||||||
null : null
|
|
||||||
}
|
|
||||||
onBlur={(event) => {
|
onBlur={(event) => {
|
||||||
baseHelperText = calculateHelpertext(event.target.value)
|
baseHelperText = calculateHelpertext(event.target.value)
|
||||||
if (setLastSaved !== undefined) {
|
if (setLastSaved !== undefined) {
|
||||||
|
|||||||
@@ -75,9 +75,15 @@ const RuntimeDebugger = (props) => {
|
|||||||
|
|
||||||
setTotalCount(0)
|
setTotalCount(0)
|
||||||
|
|
||||||
|
var starttime = ""
|
||||||
|
var endtime = ""
|
||||||
var count = 0
|
var count = 0
|
||||||
var starttime = startTime === undefined || startTime === null || startTime === "" ? "" : new Date(startTime).toISOString()
|
try {
|
||||||
var endtime = endTime === undefined || endTime === null || endTime == "" ? "" : new Date(endTime).toISOString()
|
starttime = startTime === undefined || startTime === null || startTime === "" ? "" : new Date(startTime).toISOString()
|
||||||
|
endtime = endTime === undefined || endTime === null || endTime == "" ? "" : new Date(endTime).toISOString()
|
||||||
|
} catch (e) {
|
||||||
|
toast("Invalid date format", { type: "error" })
|
||||||
|
}
|
||||||
|
|
||||||
var maxworkflows = 5
|
var maxworkflows = 5
|
||||||
|
|
||||||
@@ -88,6 +94,11 @@ const RuntimeDebugger = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const workflowId = workflows[key].id
|
const workflowId = workflows[key].id
|
||||||
|
|
||||||
|
if (workflowId === undefined || workflowId === null || workflowId === "") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Fetch the data for the workflow
|
// Fetch the data for the workflow
|
||||||
var url = `${globalUrl}/api/v1/workflows/${workflowId}/executions/count`
|
var url = `${globalUrl}/api/v1/workflows/${workflowId}/executions/count`
|
||||||
if (starttime !== "") {
|
if (starttime !== "") {
|
||||||
@@ -133,7 +144,6 @@ const RuntimeDebugger = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log("Setting total count: ", count)
|
|
||||||
setTotalCount(count)
|
setTotalCount(count)
|
||||||
}, maxworkflows*300)
|
}, maxworkflows*300)
|
||||||
}
|
}
|
||||||
@@ -578,7 +588,7 @@ const RuntimeDebugger = (props) => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
window.open(`${globalUrl}/api/v1/workflows/search/${params.row.id}`, "_blank")
|
window.open(`${globalUrl}/api/v1/workflows/search/${params.row.id}`, "_blank")
|
||||||
}}
|
}}
|
||||||
disabled={!userdata.support}
|
disabled={userdata.region_url !== "https://shuffler.io"}
|
||||||
>
|
>
|
||||||
<InsightsIcon fontSize="small" />
|
<InsightsIcon fontSize="small" />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import WorkflowTemplatePopup2 from "./WorkflowTemplatePopup.jsx";
|
|||||||
import ConfigureWorkflow from "../components/ConfigureWorkflow.jsx";
|
import ConfigureWorkflow from "../components/ConfigureWorkflow.jsx";
|
||||||
|
|
||||||
const WorkflowTemplatePopup = (props) => {
|
const WorkflowTemplatePopup = (props) => {
|
||||||
const { userdata, appFramework, globalUrl, img1, srcapp, img2, dstapp, title, description, visualOnly, apps, isLoggedIn, isHomePage } = props;
|
const { userdata, appFramework, globalUrl, img1, srcapp, img2, dstapp, title, description, visualOnly, apps, isLoggedIn, isHomePage, getAppFramework, } = props;
|
||||||
|
|
||||||
const [isActive, setIsActive] = useState(false);
|
const [isActive, setIsActive] = useState(false);
|
||||||
const [isHovered, setIsHovered] = useState(false);
|
const [isHovered, setIsHovered] = useState(false);
|
||||||
@@ -39,17 +39,39 @@ const WorkflowTemplatePopup = (props) => {
|
|||||||
const [workflow, setWorkflow] = useState({});
|
const [workflow, setWorkflow] = useState({});
|
||||||
const [showLoginButton, setShowLoginButton] = useState(false);
|
const [showLoginButton, setShowLoginButton] = useState(false);
|
||||||
const [appAuthentication, setAppAuthentication] = React.useState(undefined);
|
const [appAuthentication, setAppAuthentication] = React.useState(undefined);
|
||||||
|
|
||||||
const [missingSource, setMissingSource] = React.useState(undefined)
|
const [missingSource, setMissingSource] = React.useState(undefined)
|
||||||
const [missingDestination, setMissingDestination] = React.useState(undefined);
|
const [missingDestination, setMissingDestination] = React.useState(undefined);
|
||||||
|
|
||||||
const [configurationFinished, setConfigurationFinished] = React.useState(false);
|
const [configurationFinished, setConfigurationFinished] = React.useState(false);
|
||||||
|
const [appSetupDone, setAppSetupDone] = React.useState(false)
|
||||||
useEffect(() => {
|
|
||||||
}, [missingSource, missingDestination])
|
const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io";
|
||||||
|
|
||||||
const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io";
|
|
||||||
let navigate = useNavigate();
|
let navigate = useNavigate();
|
||||||
|
useEffect(() => {
|
||||||
|
if (modalOpen !== true) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!srcapp.includes(":default") && !dstapp.includes(":default")) {
|
||||||
|
if (appSetupDone === false && setAppSetupDone !== undefined) {
|
||||||
|
setAppSetupDone(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
getGeneratedWorkflow()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (missingSource !== undefined && missingDestination !== undefined) {
|
||||||
|
if (appSetupDone === false && setAppSetupDone !== undefined) {
|
||||||
|
setAppSetupDone(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getAppFramework !== undefined) {
|
||||||
|
setTimeout(() => {
|
||||||
|
getAppFramework()
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
}, [modalOpen, missingSource, missingDestination])
|
||||||
|
|
||||||
|
|
||||||
const imagestyleWrapper = {
|
const imagestyleWrapper = {
|
||||||
height: 40,
|
height: 40,
|
||||||
@@ -310,8 +332,6 @@ const WorkflowTemplatePopup = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const url = isCloud ? `${globalUrl}/api/v1/workflows/merge` : `https://shuffler.io/api/v1/workflows/merge`
|
const url = isCloud ? `${globalUrl}/api/v1/workflows/merge` : `https://shuffler.io/api/v1/workflows/merge`
|
||||||
//const url = `https://shuffler.io/api/v1/workflows/merge`
|
|
||||||
|
|
||||||
fetch(url, {
|
fetch(url, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -370,6 +390,16 @@ const WorkflowTemplatePopup = (props) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (modalOpen === true && !srcapp.includes(":default") && !dstapp.includes(":default")) {
|
||||||
|
if (appSetupDone === false && setAppSetupDone !== undefined) {
|
||||||
|
setAppSetupDone(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (workflow.id === undefined && workflowLoading === false && errorMessage === "") {
|
||||||
|
getGeneratedWorkflow()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const isFinished = () => {
|
const isFinished = () => {
|
||||||
// Look for configuration fields being done in the current modal
|
// Look for configuration fields being done in the current modal
|
||||||
// 1. Start by finding the modal
|
// 1. Start by finding the modal
|
||||||
@@ -388,6 +418,10 @@ const WorkflowTemplatePopup = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const ModalView = () => {
|
const ModalView = () => {
|
||||||
|
if (modalOpen === false) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Drawer
|
<Drawer
|
||||||
anchor={"left"}
|
anchor={"left"}
|
||||||
@@ -475,9 +509,9 @@ const WorkflowTemplatePopup = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
{(missingSource !== undefined || missingDestination !== undefined) ?
|
{(appSetupDone === false && missingSource !== undefined || missingDestination !== undefined) ?
|
||||||
<Typography variant="body1" style={{marginTop: 75, marginBottom: 10, }}>
|
<Typography variant="body1" style={{marginTop: 75, marginBottom: 10, }}>
|
||||||
{"Find relevevant Apps for this Usecase"}
|
{"Find relevant Apps for this Usecase"}
|
||||||
</Typography>
|
</Typography>
|
||||||
: null}
|
: null}
|
||||||
|
|
||||||
@@ -491,6 +525,8 @@ const WorkflowTemplatePopup = (props) => {
|
|||||||
AppImage={missingSource.image}
|
AppImage={missingSource.image}
|
||||||
|
|
||||||
setMissing={setMissingSource}
|
setMissing={setMissingSource}
|
||||||
|
|
||||||
|
getAppFramework={getAppFramework}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
: null}
|
: null}
|
||||||
@@ -505,6 +541,8 @@ const WorkflowTemplatePopup = (props) => {
|
|||||||
AppImage={missingDestination.image}
|
AppImage={missingDestination.image}
|
||||||
|
|
||||||
setMissing={setMissingDestination}
|
setMissing={setMissingDestination}
|
||||||
|
|
||||||
|
getAppFramework={getAppFramework}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
: null}
|
: null}
|
||||||
|
|||||||
@@ -4406,7 +4406,7 @@ If you're interested, please let me know a time that works for you, or set up a
|
|||||||
/>
|
/>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary="Default"
|
primary="Default"
|
||||||
style={{ minWidth: 100, maxWidth: 100 }}
|
style={{ minWidth: 110, maxWidth: 110, }}
|
||||||
/>
|
/>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
primary="Actions"
|
primary="Actions"
|
||||||
@@ -4550,8 +4550,8 @@ If you're interested, please let me know a time that works for you, or set up a
|
|||||||
/>
|
/>
|
||||||
<ListItemText
|
<ListItemText
|
||||||
style={{
|
style={{
|
||||||
minWidth: 80,
|
minWidth: 100,
|
||||||
maxWidth: 80,
|
maxWidth: 100,
|
||||||
overflow: "hidden",
|
overflow: "hidden",
|
||||||
}}
|
}}
|
||||||
primary={environment.default ? "true" : null}
|
primary={environment.default ? "true" : null}
|
||||||
@@ -4559,7 +4559,7 @@ If you're interested, please let me know a time that works for you, or set up a
|
|||||||
{environment.default ? null : (
|
{environment.default ? null : (
|
||||||
<Button
|
<Button
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
style={{ marginLeft: 0, marginRight: 0, }}
|
style={{ marginLeft: 0, marginRight: 0, maxWidth: 150, }}
|
||||||
onClick={() => setDefaultEnvironment(environment)}
|
onClick={() => setDefaultEnvironment(environment)}
|
||||||
color="primary"
|
color="primary"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -13362,6 +13362,67 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
</Link>
|
</Link>
|
||||||
<h2 style={{ margin: 0 }}>{workflow.name}</h2>
|
<h2 style={{ margin: 0 }}>{workflow.name}</h2>
|
||||||
</Breadcrumbs>
|
</Breadcrumbs>
|
||||||
|
|
||||||
|
{workflow.public === true || userdata.active_org.id === undefined || userdata.active_org.id === null || workflow.org_id === null || workflow.org_id === undefined || workflow.org_id.length === 0 || userdata.active_org.id === workflow.org_id ? null :
|
||||||
|
<Typography variant="body1">
|
||||||
|
<b>Warning</b>: Change <span
|
||||||
|
style={{color: "#f85a3e", cursor: "pointer"}}
|
||||||
|
onClick={() => {
|
||||||
|
toast("Changing to correct organization. Please wait a few seconds.")
|
||||||
|
|
||||||
|
localStorage.setItem("globalUrl", "");
|
||||||
|
localStorage.setItem("getting_started_sidebar", "open");
|
||||||
|
fetch(`${globalUrl}/api/v1/orgs/${workflow.org_id}/change`, {
|
||||||
|
mode: "cors",
|
||||||
|
credentials: "include",
|
||||||
|
crossDomain: true,
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({"org_id": workflow.org_id}),
|
||||||
|
withCredentials: true,
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then(function (response) {
|
||||||
|
if (response.status !== 200) {
|
||||||
|
console.log("Error in response");
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then(function (responseJson) {
|
||||||
|
console.log("In here?")
|
||||||
|
if (responseJson.success === true) {
|
||||||
|
if (responseJson.region_url !== undefined && responseJson.region_url !== null && responseJson.region_url.length > 0) {
|
||||||
|
console.log("Region Change: ", responseJson.region_url);
|
||||||
|
localStorage.setItem("globalUrl", responseJson.region_url);
|
||||||
|
//globalUrl = responseJson.region_url
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
window.location.reload();
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
|
toast("Successfully changed active organization - refreshing!");
|
||||||
|
} else {
|
||||||
|
if (responseJson.reason !== undefined && responseJson.reason !== null && responseJson.reason.length > 0) {
|
||||||
|
toast(responseJson.reason);
|
||||||
|
} else {
|
||||||
|
toast("Failed changing org. Try again or contact support@shuffler.io if this persists.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.log("error changing: ", error);
|
||||||
|
//removeCookie("session_token", {path: "/"})
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}}
|
||||||
|
>Active Organization</span> to edit this Workflow.
|
||||||
|
</Typography>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div style={{display: "flex", marginLeft: 10, }}>
|
<div style={{display: "flex", marginLeft: 10, }}>
|
||||||
{parentWorkflows.slice(0,5).map((wf, index) => {
|
{parentWorkflows.slice(0,5).map((wf, index) => {
|
||||||
@@ -13740,9 +13801,64 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
</div>
|
</div>
|
||||||
: null
|
: null
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const RightsideBar = () => {
|
const RightsideBar = () => {
|
||||||
const [hovered, setHovered] = useState(false)
|
const [hovered, setHovered] = useState(false)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handleKeyDown = (event) => {
|
||||||
|
if ((event.metaKey || event.ctrlKey) && event.key === '/') {
|
||||||
|
event.preventDefault(); // Prevent default browser behavior (like opening search bar)
|
||||||
|
if (!workflow.public && !executionRequestStarted) {
|
||||||
|
executeWorkflow(executionText, workflow.start, lastSaved);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((event.ctrlKey || event.metaKey) && event.key === "'") {
|
||||||
|
// Check if Ctrl (Windows/Linux) or Command (Mac) key is pressed along with '/'
|
||||||
|
if (!workflow.public && !executionModalOpen) {
|
||||||
|
setExecutionModalOpen(true);
|
||||||
|
getWorkflowExecution(props.match.params.key, "");
|
||||||
|
} else if (!workflow.public && executionModalOpen) {
|
||||||
|
setExecutionModalOpen(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((event.ctrlKey || event.metaKey) && event.key === "]") {
|
||||||
|
console.log("Show workflow revisions key pressed")
|
||||||
|
if (!workflow.public) {
|
||||||
|
setShowWorkflowRevisions(true)
|
||||||
|
setSelectedRevision(workflow)
|
||||||
|
//setOriginalWorkflow(workflow)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (( event.ctrlKey || event.metaKey ) && event.key === ";") {
|
||||||
|
if (!workflow.public && executionModalOpen) {
|
||||||
|
getWorkflowExecution(props.match.params.key, "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (( event.ctrlKey || event.metaKey ) && event.shiftKey) {
|
||||||
|
console.log("Shift key pressed")
|
||||||
|
if (!workflow.public && executionModalOpen) {
|
||||||
|
setExecutionRunning(false);
|
||||||
|
stop()
|
||||||
|
const cursearch = typeof window === "undefined" || window.location === undefined ? "" : window.location.search;
|
||||||
|
const newitem = removeParam("execution_id", cursearch);
|
||||||
|
navigate(curpath + newitem)
|
||||||
|
setExecutionModalView(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
document.removeEventListener('keydown', handleKeyDown);
|
||||||
|
};
|
||||||
|
}, [executeWorkflow, executionText, workflow, lastSaved, executionRequestStarted]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@@ -13798,7 +13914,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
</span>
|
</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
) : (
|
) : (
|
||||||
<Tooltip color="primary" title="Test Execution" placement="top">
|
<Tooltip color="primary" title="Test Execution (Ctrl + /)" placement="top">
|
||||||
<span>
|
<span>
|
||||||
<Button
|
<Button
|
||||||
disabled={
|
disabled={
|
||||||
@@ -13996,7 +14112,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
color="secondary"
|
color="secondary"
|
||||||
title={`Show executions (${workflowExecutions.length})`}
|
title={`Show executions (${workflowExecutions.length}) (Ctrl + ')`}
|
||||||
placement="top-start"
|
placement="top-start"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
@@ -14065,7 +14181,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
color="secondary"
|
color="secondary"
|
||||||
title="Show Workflow Revision History (Beta)"
|
title="Show Workflow Revision History (Beta) (Ctrl + ])"
|
||||||
placement="top"
|
placement="top"
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
@@ -14076,8 +14192,8 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
variant={"outlined"}
|
variant={"outlined"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setShowWorkflowRevisions(true)
|
setShowWorkflowRevisions(true)
|
||||||
setSelectedRevision(workflow)
|
setSelectedRevision(workflow)
|
||||||
//setOriginalWorkflow(workflow)
|
//setOriginalWorkflow(workflow)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<RestoreIcon />
|
<RestoreIcon />
|
||||||
@@ -14279,6 +14395,52 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
//return null;
|
//return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const unPublishWorkflow = (data) => {
|
||||||
|
if (!isCloud) {
|
||||||
|
toast("Function only supported on cloud")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.public !== true) {
|
||||||
|
toast("Workflow is not public. Can't unpublish");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// This ALWAYS talks to Shuffle cloud
|
||||||
|
data = JSON.parse(JSON.stringify(data));
|
||||||
|
const url = `${globalUrl}/api/v1/workflows/${data.id}/unpublish`;
|
||||||
|
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 workflow publish :O!");
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then((responseJson) => {
|
||||||
|
if (responseJson.reason !== undefined) {
|
||||||
|
toast("Unpublishing: "+responseJson.reason)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (responseJson.success === true) {
|
||||||
|
workflow.public = false
|
||||||
|
setWorkflow(workflow)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
toast("Failed publishing: is the workflow valid? Remember to save the workflow first.")
|
||||||
|
console.log(error.toString())
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// This can execute a workflow with firestore. Used for test, as datastore is old and stuff
|
// This can execute a workflow with firestore. Used for test, as datastore is old and stuff
|
||||||
// Too much work to move everything over alone, so won't touch it for now
|
// Too much work to move everything over alone, so won't touch it for now
|
||||||
//<Button style={{borderRadius: "0px"}} color="primary" variant="contained" onClick={() => {
|
//<Button style={{borderRadius: "0px"}} color="primary" variant="contained" onClick={() => {
|
||||||
@@ -14534,8 +14696,8 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
color="secondary"
|
color="secondary"
|
||||||
disabled
|
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
|
disabled={workflow.public !== true}
|
||||||
fullWidth
|
fullWidth
|
||||||
style={{ marginTop: 15, }}
|
style={{ marginTop: 15, }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -14543,6 +14705,8 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
// workflow.public = false
|
// workflow.public = false
|
||||||
// setWorkflow(workflow)
|
// setWorkflow(workflow)
|
||||||
// setUpdate(Math.random());
|
// setUpdate(Math.random());
|
||||||
|
toast("Unpublishing this workflow from the search engine. It will remain public until it is deleted, as it is a copy of the original workflow.")
|
||||||
|
unPublishWorkflow(workflow)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Unpublish Workflow
|
Unpublish Workflow
|
||||||
@@ -15108,6 +15272,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
</a>
|
</a>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
|
<Tooltip title="Refresh runs (Ctrl + ;)" arrow>
|
||||||
<Button
|
<Button
|
||||||
style={{ borderRadius: "0px" }}
|
style={{ borderRadius: "0px" }}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
@@ -15120,6 +15285,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
<CachedIcon style={{ marginRight: 10 }} />
|
<CachedIcon style={{ marginRight: 10 }} />
|
||||||
Refresh Runs
|
Refresh Runs
|
||||||
</Button>
|
</Button>
|
||||||
|
</Tooltip>
|
||||||
<Divider
|
<Divider
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: "rgba(255,255,255,0.5)",
|
backgroundColor: "rgba(255,255,255,0.5)",
|
||||||
@@ -15347,48 +15513,51 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div style={{ padding: isMobile ? "0px 10px 25px 10px" : "25px 15px 25px 15px", maxWidth: isMobile ? "100%" : 400, overflowX: "hidden" }}>
|
<div style={{ padding: isMobile ? "0px 10px 25px 10px" : "25px 15px 25px 15px", maxWidth: isMobile ? "100%" : 400, overflowX: "hidden" }}>
|
||||||
<Breadcrumbs
|
|
||||||
aria-label="breadcrumb"
|
<Breadcrumbs
|
||||||
separator="›"
|
aria-label="breadcrumb"
|
||||||
style={{ color: "white", fontSize: 16 }}
|
separator="›"
|
||||||
>
|
style={{ color: "white", fontSize: 16 }}
|
||||||
<span
|
|
||||||
style={{ color: "rgba(255,255,255,0.5)", display: "flex" }}
|
|
||||||
onClick={() => {
|
|
||||||
setExecutionRunning(false);
|
|
||||||
stop();
|
|
||||||
getWorkflowExecution(props.match.params.key, "");
|
|
||||||
setExecutionModalView(0);
|
|
||||||
setLastExecution(executionData.execution_id);
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<IconButton
|
<span
|
||||||
style={{
|
style={{ color: "rgba(255,255,255,0.5)", display: "flex" }}
|
||||||
paddingLeft: 0,
|
onClick={() => {
|
||||||
marginTop: "auto",
|
setExecutionRunning(false);
|
||||||
marginBottom: "auto",
|
stop();
|
||||||
}}
|
getWorkflowExecution(props.match.params.key, "");
|
||||||
onClick={() => {
|
setExecutionModalView(0);
|
||||||
setExecutionRunning(false);
|
setLastExecution(executionData.execution_id);
|
||||||
stop()
|
}}
|
||||||
}}
|
>
|
||||||
>
|
<IconButton
|
||||||
<ArrowBackIcon style={{ color: "rgba(255,255,255,0.5)" }} />
|
style={{
|
||||||
</IconButton>
|
paddingLeft: 0,
|
||||||
<h2
|
marginTop: "auto",
|
||||||
style={{ color: "rgba(255,255,255,0.5)", cursor: "pointer" }}
|
marginBottom: "auto",
|
||||||
onClick={() => {
|
}}
|
||||||
const cursearch = typeof window === "undefined" || window.location === undefined ? "" : window.location.search;
|
onClick={() => {
|
||||||
const newitem = removeParam("execution_id", cursearch);
|
setExecutionRunning(false);
|
||||||
navigate(curpath + newitem)
|
stop()
|
||||||
setExecutionRunning(false);
|
}}
|
||||||
stop()
|
>
|
||||||
}}
|
<ArrowBackIcon style={{ color: "rgba(255,255,255,0.5)" }} />
|
||||||
>
|
</IconButton>
|
||||||
See more runs
|
<Tooltip title="See more runs (Ctrl + Shift)" arrow>
|
||||||
</h2>
|
<h2
|
||||||
</span>
|
style={{ color: "rgba(255,255,255,0.5)", cursor: "pointer" }}
|
||||||
</Breadcrumbs>
|
onClick={() => {
|
||||||
|
const cursearch = typeof window === "undefined" || window.location === undefined ? "" : window.location.search;
|
||||||
|
const newitem = removeParam("execution_id", cursearch);
|
||||||
|
navigate(curpath + newitem)
|
||||||
|
setExecutionRunning(false);
|
||||||
|
stop()
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
See more runs
|
||||||
|
</h2>
|
||||||
|
</Tooltip>
|
||||||
|
</span>
|
||||||
|
</Breadcrumbs>
|
||||||
<Divider
|
<Divider
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: "rgba(255,255,255,0.6)",
|
backgroundColor: "rgba(255,255,255,0.6)",
|
||||||
@@ -15452,15 +15621,19 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
color="primary"
|
color="primary"
|
||||||
title="Explore logs for the workflow"
|
title="Explore logs for the workflow"
|
||||||
placement="top"
|
placement="top"
|
||||||
style={{ zIndex: 50000 }}
|
style={{ zIndex: 50000, }}
|
||||||
>
|
>
|
||||||
<span style={{}}>
|
<span style={{}}>
|
||||||
<Button
|
<Button
|
||||||
color="primary"
|
color="primary"
|
||||||
style={{ float: "right", marginTop: 20, marginLeft: 10 }}
|
style={{ float: "right", marginTop: 20, marginLeft: 10 }}
|
||||||
disabled={!userdata.support}
|
disabled={userdata.region_url !== "https://shuffler.io"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
window.open(`/api/v1/workflows/search/${executionData.execution_id}`, "_blank")
|
toast("Opening logs in a new tab")
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
window.open(`/api/v1/workflows/search/${executionData.execution_id}`, "_blank")
|
||||||
|
}, 250)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<InsightsIcon color="secondary" />
|
<InsightsIcon color="secondary" />
|
||||||
@@ -17851,42 +18024,45 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var newrevision = JSON.parse(JSON.stringify(revision))
|
||||||
|
|
||||||
// Make unix timestamp into ISO timestamp in the format July 27th, 3:05 AM
|
// Make unix timestamp into ISO timestamp in the format July 27th, 3:05 AM
|
||||||
// Format: July 27th, 3:05 AM
|
// Format: July 27th, 3:05 AM
|
||||||
console.log("Edited time: ", revision.edited)
|
//console.log("Edited time: ", revision.edited)
|
||||||
// Convert 1692128391 to valid timestamp
|
// Convert 1692128391 to valid timestamp
|
||||||
const validTimestamp = revision.edited.toString().length === 10 ? revision.edited * 1000 : revision.edited
|
const validTimestamp = newrevision.edited.toString().length === 10 ? newrevision.edited * 1000 : newrevision.edited
|
||||||
const translatedDate = new Date(validTimestamp).toLocaleString('en-US', { month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', hour12: true })
|
const translatedDate = new Date(validTimestamp).toLocaleString('en-US', { month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', hour12: true })
|
||||||
|
|
||||||
var workflowStatus = revision.status !== undefined && revision.status !== null && revision.status !== "" ? revision.status : "test"
|
var workflowStatus = newrevision.status !== undefined && newrevision.status !== null && newrevision.status !== "" ? newrevision.status : "test"
|
||||||
if (revision.name !== undefined && revision.name !== null && revision.name !== "") {
|
if (newrevision.name !== undefined && newrevision.name !== null && newrevision.name !== "") {
|
||||||
if (revision.name.toLowerCase().includes("test")) {
|
if (newrevision.name.toLowerCase().includes("test")) {
|
||||||
workflowStatus = "test"
|
workflowStatus = "test"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (revision.name.toLowerCase().includes("dev") || revision.name.toLowerCase().includes("staging") || revision.name.toLowerCase().includes("rollback")) {
|
if (newrevision.name.toLowerCase().includes("dev") || newrevision.name.toLowerCase().includes("staging") || newrevision.name.toLowerCase().includes("rollback")) {
|
||||||
workflowStatus = "dev"
|
workflowStatus = "dev"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (revision.name.toLowerCase().includes("prod") || revision.name.toLowerCase().includes("main")) {
|
if (newrevision.name.toLowerCase().includes("prod") || newrevision.name.toLowerCase().includes("main")) {
|
||||||
workflowStatus = "prod"
|
workflowStatus = "prod"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Paper
|
<Paper
|
||||||
style={{padding: "15px 15px 15px 25px", minHeight: 105, maxHeight: 105, cursor: "pointer", backgroundColor: revision.edited === selectedRevision.edited ? "rgba(255,255,255,0.3)" : theme.palette.surfaceColor, border: "1px solid rgba(255,255,255,0.3)", marginBottom: 10,
|
style={{padding: "15px 15px 15px 25px", minHeight: 105, maxHeight: 105, cursor: "pointer", backgroundColor: newrevision.edited === selectedRevision.edited ? "rgba(255,255,255,0.3)" : theme.palette.surfaceColor, border: "1px solid rgba(255,255,255,0.3)", marginBottom: 10,
|
||||||
}} onClick={(e) => {
|
}} onClick={(e) => {
|
||||||
if (revision.edited === selectedRevision.edited) {
|
if (newrevision.edited === selectedRevision.edited) {
|
||||||
console.log("Same revision! No setting.")
|
console.log("Same revision! No setting.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Should render if it's not the same as workflow.edited
|
// Should render if it's not the same as workflow.edited
|
||||||
console.log("Clicked revision: ", revision)
|
console.log("Clicked revision: ", newrevision)
|
||||||
setLastSaved(false)
|
setLastSaved(false)
|
||||||
setSelectedRevision(revision)
|
setSelectedRevision(newrevision)
|
||||||
setWorkflow(revision)
|
setWorkflow(newrevision)
|
||||||
setSelectedAction({});
|
setSelectedAction({});
|
||||||
setSelectedApp({})
|
setSelectedApp({})
|
||||||
|
|
||||||
@@ -17906,7 +18082,7 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
cy.removeListener("cxttap");
|
cy.removeListener("cxttap");
|
||||||
}
|
}
|
||||||
|
|
||||||
setupGraph(revision)
|
setupGraph(newrevision)
|
||||||
|
|
||||||
// Re-adding cytoscape triggers
|
// Re-adding cytoscape triggers
|
||||||
if (cy !== undefined && cy !== null) {
|
if (cy !== undefined && cy !== null) {
|
||||||
@@ -17932,8 +18108,20 @@ const AngularWorkflow = (defaultprops) => {
|
|||||||
cy.on("free", "node", (e) => onNodeDragStop(e, selectedAction));
|
cy.on("free", "node", (e) => onNodeDragStop(e, selectedAction));
|
||||||
|
|
||||||
cy.on("cxttap", "node", (e) => onCtxTap(e));
|
cy.on("cxttap", "node", (e) => onCtxTap(e));
|
||||||
|
|
||||||
|
|
||||||
|
if (selectedAction.id !== undefined && selectedAction.id !== null && selectedAction.id !== "") {
|
||||||
|
setTimeout(() => {
|
||||||
|
const foundaction = cy.$id(selectedAction.id)
|
||||||
|
if (foundaction !== undefined && foundaction !== null) {
|
||||||
|
foundaction.select()
|
||||||
|
}
|
||||||
|
}, 250)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Need to run through graph setup with this one
|
// Need to run through graph setup with this one
|
||||||
}}>
|
}}>
|
||||||
<div style={{display: "flex", }}>
|
<div style={{display: "flex", }}>
|
||||||
|
|||||||
@@ -96,7 +96,8 @@ const useStyles = makeStyles({
|
|||||||
|
|
||||||
|
|
||||||
const UsecaseListComponent = (props) => {
|
const UsecaseListComponent = (props) => {
|
||||||
const { keys, userdata, isCloud, globalUrl, frameworkData, isLoggedIn, workflows, setWorkflows, } = props
|
const { keys, userdata, isCloud, globalUrl, frameworkData, isLoggedIn, workflows, setWorkflows, getFramework, setFrameworkData, } = props
|
||||||
|
|
||||||
|
|
||||||
const [expandedIndex, setExpandedIndex] = useState(-1);
|
const [expandedIndex, setExpandedIndex] = useState(-1);
|
||||||
const [expandedItem, setExpandedItem] = useState(-1);
|
const [expandedItem, setExpandedItem] = useState(-1);
|
||||||
@@ -114,11 +115,13 @@ const UsecaseListComponent = (props) => {
|
|||||||
const [firstLoad, setFirstLoad] = useState(true)
|
const [firstLoad, setFirstLoad] = useState(true)
|
||||||
const [apps, setApps] = useState([])
|
const [apps, setApps] = useState([])
|
||||||
|
|
||||||
|
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
let navigate = useNavigate();
|
let navigate = useNavigate();
|
||||||
|
|
||||||
const [mitreTags, setMitreTags] = useState([]);
|
const [mitreTags, setMitreTags] = useState([]);
|
||||||
|
|
||||||
|
|
||||||
const parseUsecase = (subcase) => {
|
const parseUsecase = (subcase) => {
|
||||||
const srcdata = findSpecificApp(frameworkData, subcase.type)
|
const srcdata = findSpecificApp(frameworkData, subcase.type)
|
||||||
const dstdata = findSpecificApp(frameworkData, subcase.last)
|
const dstdata = findSpecificApp(frameworkData, subcase.last)
|
||||||
@@ -137,13 +140,11 @@ const UsecaseListComponent = (props) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log("In frameworkData useEffect: frameworkData: ", frameworkData)
|
//console.log("Frameworkdata changed. Use to set inputUsecase: ", frameworkData, prevSubcase)
|
||||||
if (frameworkData === undefined || prevSubcase === undefined) {
|
if (frameworkData === undefined || prevSubcase === undefined) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("PAST!")
|
|
||||||
|
|
||||||
var parsedUsecase = inputUsecase
|
var parsedUsecase = inputUsecase
|
||||||
const subcase = parseUsecase(prevSubcase)
|
const subcase = parseUsecase(prevSubcase)
|
||||||
|
|
||||||
@@ -917,6 +918,9 @@ const UsecaseListComponent = (props) => {
|
|||||||
description={inputUsecase.description}
|
description={inputUsecase.description}
|
||||||
|
|
||||||
apps={apps}
|
apps={apps}
|
||||||
|
getAppFramework={getFramework}
|
||||||
|
//appSetupDone={appSetupDone}
|
||||||
|
//setAppSetupDone={setAppSetupDone}
|
||||||
/>
|
/>
|
||||||
: null}
|
: null}
|
||||||
</span>
|
</span>
|
||||||
@@ -990,13 +994,15 @@ const UsecaseListComponent = (props) => {
|
|||||||
}}>
|
}}>
|
||||||
<AppFramework
|
<AppFramework
|
||||||
inputUsecase={inputUsecase}
|
inputUsecase={inputUsecase}
|
||||||
frameworkData={frameworkData}
|
|
||||||
selectedOption={"Draw"}
|
selectedOption={"Draw"}
|
||||||
showOptions={false}
|
showOptions={false}
|
||||||
isLoaded={true}
|
isLoaded={true}
|
||||||
isLoggedIn={true}
|
isLoggedIn={true}
|
||||||
globalUrl={globalUrl}
|
globalUrl={globalUrl}
|
||||||
size={0.6}
|
size={0.6}
|
||||||
|
|
||||||
|
frameworkData={frameworkData}
|
||||||
|
setFrameworkData={setFrameworkData}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1713,12 +1719,15 @@ const Dashboard = (props) => {
|
|||||||
<UsecaseListComponent
|
<UsecaseListComponent
|
||||||
userdata={userdata}
|
userdata={userdata}
|
||||||
isLoggedIn={isLoggedIn}
|
isLoggedIn={isLoggedIn}
|
||||||
frameworkData={frameworkData}
|
|
||||||
keys={selectedUsecases}
|
keys={selectedUsecases}
|
||||||
isCloud={isCloud}
|
isCloud={isCloud}
|
||||||
globalUrl={globalUrl}
|
globalUrl={globalUrl}
|
||||||
workflows={workflows}
|
workflows={workflows}
|
||||||
setWorkflows={setWorkflows}
|
setWorkflows={setWorkflows}
|
||||||
|
|
||||||
|
frameworkData={frameworkData}
|
||||||
|
setFrameworkData={setFrameworkData}
|
||||||
|
getFramework={getFramework}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{treeKeys.length > 0 ?
|
{treeKeys.length > 0 ?
|
||||||
|
|||||||
Reference in New Issue
Block a user