Merge branch '2.0.0' of github.com:satti-hari-krishna-reddy/Shuffle into 2.0.0
This commit is contained in:
@@ -15416,7 +15416,7 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
toast("please stop the trigger to edit the configuration");
|
||||
return;
|
||||
} else {
|
||||
setSelectedOption("Sigma Rulesearch");
|
||||
setSelectedOption("SigmaRule");
|
||||
setTenzirConfigModalOpen(true);
|
||||
}}}
|
||||
style={{
|
||||
@@ -15432,8 +15432,8 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Radio
|
||||
checked={selectedOption === "Sigma Rulesearch"}
|
||||
onChange={() => setSelectedOption("Sigma Rulesearch")}
|
||||
checked={selectedOption === "SigmaRule"}
|
||||
onChange={() => setSelectedOption("SigmaRule")}
|
||||
value={"Sigma Rulesearch"}
|
||||
name="option"
|
||||
/>
|
||||
@@ -21193,25 +21193,23 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
</Dialog>
|
||||
) : null;
|
||||
|
||||
const tenzirConfigModal = () => {
|
||||
if (!tenzirConfigModalOpen) return null;
|
||||
|
||||
const [loading, setLoading] = useState(true);
|
||||
const TenzirConfigModal = () => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [selectedRules, setSelectedRules] = useState([]);
|
||||
|
||||
|
||||
const handleRuleChange = (event) => {
|
||||
setSelectedRules(event.target.value);
|
||||
};
|
||||
|
||||
|
||||
const handleSelectAll = () => {
|
||||
const allEnabledRules = rules.filter(rule => rule.is_enabled).map(rule => rule.file_id);
|
||||
setSelectedRules(allEnabledRules);
|
||||
};
|
||||
|
||||
|
||||
const handleClose = () => {
|
||||
setTenzirConfigModalOpen(false);
|
||||
};
|
||||
|
||||
|
||||
const handleSubmit = () => {
|
||||
const selectedRuleFiles = rules
|
||||
.filter(rule => selectedRules.includes(rule.file_id));
|
||||
@@ -21239,85 +21237,90 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
},[])
|
||||
|
||||
const enabledSigmaInfo = rules.filter(rule => rule.is_enabled);
|
||||
|
||||
<Dialog
|
||||
PaperComponent={PaperComponent}
|
||||
hideBackdrop={true}
|
||||
disableEnforceFocus={true}
|
||||
disableBackdropClick={true}
|
||||
style={{ pointerEvents: "none" }}
|
||||
open={tenzirConfigModalOpen}
|
||||
PaperProps={{
|
||||
style: {
|
||||
pointerEvents: "auto",
|
||||
color: "white",
|
||||
minWidth: 600,
|
||||
minHeight: 200,
|
||||
maxHeight: 200,
|
||||
padding: 15,
|
||||
overflow: "hidden",
|
||||
zIndex: 10012,
|
||||
border: theme.palette.defaultBorder,
|
||||
},
|
||||
}}
|
||||
>
|
||||
{loading ? (
|
||||
<CircularProgress />
|
||||
) : (
|
||||
<div
|
||||
style={{
|
||||
flex: 2,
|
||||
padding: 0,
|
||||
minHeight: isMobile ? "90%" : 700,
|
||||
maxHeight: isMobile ? "90%" : 700,
|
||||
overflowY: "auto",
|
||||
overflowX: isMobile ? "auto" : "hidden",
|
||||
}}
|
||||
>
|
||||
<DialogContent>
|
||||
{selectedOption === 'sigmaRule' && (
|
||||
<>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel>Select Sigma Rules</InputLabel>
|
||||
<Select
|
||||
multiple
|
||||
value={selectedRules}
|
||||
onChange={handleRuleChange}
|
||||
renderValue={(selected) => selected.join(', ')}
|
||||
>
|
||||
{enabledSigmaInfo.map(rule => (
|
||||
<MenuItem key={rule.file_id} value={rule.file_id}>
|
||||
<Checkbox checked={selectedRules.indexOf(rule.file_id) > -1} />
|
||||
<ListItemText primary={rule.title} />
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
<Button onClick={handleSelectAll}>Select All</Button>
|
||||
</>
|
||||
)}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button style={{ borderRadius: "0px" }} onClick={handleClose} color="primary">Cancel</Button>
|
||||
<Button style={{ borderRadius: "0px" }} onClick={handleSubmit} color="primary">Submit</Button>
|
||||
</DialogActions>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<IconButton
|
||||
style={{
|
||||
zIndex: 5000,
|
||||
position: "absolute",
|
||||
top: 14,
|
||||
right: 18,
|
||||
color: "grey",
|
||||
|
||||
if (!tenzirConfigModalOpen) return null;
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
PaperComponent={PaperComponent}
|
||||
hideBackdrop={true}
|
||||
disableEnforceFocus={true}
|
||||
disableBackdropClick={true}
|
||||
style={{ pointerEvents: "none" }}
|
||||
open={tenzirConfigModalOpen}
|
||||
PaperProps={{
|
||||
style: {
|
||||
pointerEvents: "auto",
|
||||
color: "white",
|
||||
minWidth: 600,
|
||||
minHeight: 200,
|
||||
maxHeight: 200,
|
||||
padding: 15,
|
||||
overflow: "hidden",
|
||||
zIndex: 10012,
|
||||
border: theme.palette.defaultBorder,
|
||||
},
|
||||
}}
|
||||
onClick={handleClose}
|
||||
>
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</Dialog>
|
||||
}
|
||||
{loading ? (
|
||||
<CircularProgress />
|
||||
) : (
|
||||
<div
|
||||
style={{
|
||||
flex: 2,
|
||||
padding: 0,
|
||||
minHeight: isMobile ? "90%" : 700,
|
||||
maxHeight: isMobile ? "90%" : 700,
|
||||
overflowY: "auto",
|
||||
overflowX: isMobile ? "auto" : "hidden",
|
||||
}}
|
||||
>
|
||||
<DialogContent>
|
||||
{selectedOption === 'SigmaRule' && (
|
||||
<>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel>Select Sigma Rules</InputLabel>
|
||||
<Select
|
||||
multiple
|
||||
value={selectedRules}
|
||||
onChange={handleRuleChange}
|
||||
renderValue={(selected) => selected.join(', ')}
|
||||
>
|
||||
{enabledSigmaInfo.map(rule => (
|
||||
<MenuItem key={rule.file_id} value={rule.file_id}>
|
||||
<Checkbox checked={selectedRules.indexOf(rule.file_id) > -1} />
|
||||
<ListItemText primary={rule.title} />
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
<Button onClick={handleSelectAll}>Select All</Button>
|
||||
</>
|
||||
)}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button style={{ borderRadius: "0px" }} onClick={handleClose} color="primary">Cancel</Button>
|
||||
<Button style={{ borderRadius: "0px" }} onClick={handleSubmit} color="primary">Submit</Button>
|
||||
</DialogActions>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<IconButton
|
||||
style={{
|
||||
zIndex: 5000,
|
||||
position: "absolute",
|
||||
top: 14,
|
||||
right: 18,
|
||||
color: "grey",
|
||||
}}
|
||||
onClick={handleClose}
|
||||
>
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21897,7 +21900,7 @@ const releaseToConnectLabel = "Release to Connect"
|
||||
{codePopoutModal}
|
||||
{workflowRevisions}
|
||||
{authenticationModal}
|
||||
{tenzirConfigModal}
|
||||
{<TenzirConfigModal/>}
|
||||
{/*editWorkflowModal*/}
|
||||
{authgroupModal}
|
||||
{executionArgumentModal}
|
||||
|
||||
Reference in New Issue
Block a user