Added file category listing with new app options to work with detections in the future
This commit is contained in:
@@ -123,6 +123,7 @@ const openApiFieldDesc = "Generated by OpenAPI body example";
|
||||
const ParsedAction = (props) => {
|
||||
const {
|
||||
workflow,
|
||||
files,
|
||||
setWorkflow,
|
||||
setAction,
|
||||
setSelectedAction,
|
||||
@@ -1300,6 +1301,7 @@ const ParsedAction = (props) => {
|
||||
data.value = data.example;
|
||||
}
|
||||
|
||||
|
||||
if (data.value.length === 0) {
|
||||
if (data.name.toLowerCase() === "headers") {
|
||||
console.log("Should show headers field instead with + and -!")
|
||||
@@ -1878,6 +1880,14 @@ const ParsedAction = (props) => {
|
||||
|
||||
// Basic helpertext
|
||||
|
||||
if (data.name.toLowerCase() === "file_category") {
|
||||
//selectedActionParameters[count].options.length > 0
|
||||
console.log("FileS: ", files)
|
||||
if (files.namespaces !== undefined && files.namespaces !== null && files.namespaces.length > 0) {
|
||||
data.options = files.namespaces
|
||||
}
|
||||
}
|
||||
|
||||
//const keywords = ["len", "lower", "upper", "trim", "split", "length", "number", "parse", "join"]
|
||||
if (
|
||||
selectedActionParameters[count].schema !== undefined &&
|
||||
@@ -1942,16 +1952,22 @@ const ParsedAction = (props) => {
|
||||
}
|
||||
*/
|
||||
} else if (
|
||||
selectedActionParameters[count].options !== undefined &&
|
||||
(data.options !== undefined &&
|
||||
data.options !== null &&
|
||||
data.options.length > 0)
|
||||
||
|
||||
(selectedActionParameters[count].options !== undefined &&
|
||||
selectedActionParameters[count].options !== null &&
|
||||
selectedActionParameters[count].options.length > 0
|
||||
selectedActionParameters[count].options.length > 0)
|
||||
) {
|
||||
const parsedoptions = data.options !== undefined ? data.options : selectedActionParameters[count].options
|
||||
|
||||
if (selectedActionParameters[count].value === "") {
|
||||
// && selectedActionParameters[count].required) {
|
||||
// Rofl, dirty workaround :)
|
||||
const e = {
|
||||
target: {
|
||||
value: selectedActionParameters[count].options[0],
|
||||
value: parsedoptions.options[0],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1982,7 +1998,7 @@ const ParsedAction = (props) => {
|
||||
borderRadius: theme.palette.borderRadius,
|
||||
}}
|
||||
>
|
||||
{selectedActionParameters[count].options.map(
|
||||
{parsedoptions.map(
|
||||
(data, index) => {
|
||||
const split_data = data.split("||");
|
||||
var viewed_data = data;
|
||||
@@ -2014,6 +2030,7 @@ const ParsedAction = (props) => {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// Shows nested list of nodes > their JSON lists
|
||||
const ActionlistWrapper = (props) => {
|
||||
const handleMenuClose = () => {
|
||||
|
||||
@@ -51,7 +51,7 @@ import { useNavigate, Link, useParams } from "react-router-dom";
|
||||
|
||||
const liquidFilters = [
|
||||
{"name": "Size", "value": "size", "example": ""},
|
||||
{"name": "Date", "value": `date: "%Y%M%d"`, "example": `{{ "now" | date: "%s" }}`},
|
||||
{"name": "Date", "value": `date: "%Y%m%d"`, "example": `{{ "now" | date: "%s" }}`},
|
||||
{"name": "Escape String", "value": `{{ \"\"\"'string with weird'" quotes\"\"\" | escape_string }}`, "example": ``},
|
||||
{"name": "Flatten", "value": `flatten`, "example": `{{ [1, [1, 2], [2, 3, 4]] | flatten }}`},
|
||||
]
|
||||
|
||||
@@ -513,7 +513,7 @@ const WelcomeForm = (props) => {
|
||||
}}>
|
||||
Phishing
|
||||
</Button>
|
||||
<Button disabled={true} variant={defaultSearch === "Detection" ? "contained" : "outlined"} startIcon={<NewReleasesIcon />} style={newButtonStyle} onClick={() => {
|
||||
<Button variant={defaultSearch === "Detection" ? "contained" : "outlined"} startIcon={<NewReleasesIcon />} style={newButtonStyle} onClick={() => {
|
||||
setDefaultSearch("Detection")
|
||||
setSelectionOpen(false)
|
||||
|
||||
@@ -525,7 +525,7 @@ const WelcomeForm = (props) => {
|
||||
}}>
|
||||
Detection
|
||||
</Button>
|
||||
<Button disabled={true} variant={defaultSearch === "Response" ? "contained" : "outlined"} startIcon={<NewReleasesIcon />} style={newButtonStyle} onClick={() => {
|
||||
<Button variant={defaultSearch === "Response" ? "contained" : "outlined"} startIcon={<NewReleasesIcon />} style={newButtonStyle} onClick={() => {
|
||||
setDefaultSearch("Response")
|
||||
setSelectionOpen(false)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user