diff --git a/frontend/src/components/DetectionRuleCard.jsx b/frontend/src/components/DetectionRuleCard.jsx
index 5fe2e908..f5a30f67 100644
--- a/frontend/src/components/DetectionRuleCard.jsx
+++ b/frontend/src/components/DetectionRuleCard.jsx
@@ -19,17 +19,19 @@ const RuleCard = ({ ruleName, description, file_id, globalUrl, folderDisabled, i
const handleSwitchChange = (event) => {
if (folderDisabled) {
- toast("enable the directory to enable individual rules");
+ toast.warn("Enable the directory to enable individual rules");
return;
}
+
if (!isTenzirActive) {
- toast("connect to the siem to enable/disable the rule");
+ toast.warn("Connect to the siem first to enable/disable the rule");
return;
}
+
const newIsEnabled = event.target.checked;
toggleRule(file_id, !newIsEnabled, globalUrl, () => {
setIsEnabled(newIsEnabled);
- });
+ })
};
const UpdateText = (text) => {
@@ -73,7 +75,6 @@ const RuleCard = ({ ruleName, description, file_id, globalUrl, folderDisabled, i
color: "white",
}}
>
-
HELO
{ruleName}
openEditBar(file_id, setOpenCodeEditor, setFileData, globalUrl)}>
@@ -82,7 +83,7 @@ const RuleCard = ({ ruleName, description, file_id, globalUrl, folderDisabled, i
@@ -107,7 +108,7 @@ const RuleCard = ({ ruleName, description, file_id, globalUrl, folderDisabled, i
const toggleRule = (fileId, isCurrentlyEnabled, globalUrl, callback) => {
const action = isCurrentlyEnabled ? "disable" : "enable";
- const url = `${globalUrl}/api/v1/files/detection/${fileId}/${action}_rule`;
+ const url = `${globalUrl}/api/v1/detections/${fileId}/${action}_rule`;
fetch(url, {
method: "PUT",
diff --git a/frontend/src/components/NewHeader.jsx b/frontend/src/components/NewHeader.jsx
index 9c7a45c4..3dc07460 100644
--- a/frontend/src/components/NewHeader.jsx
+++ b/frontend/src/components/NewHeader.jsx
@@ -456,15 +456,19 @@ const Header = (props) => {
Use Cases
-
-
-
+
+ {userdata?.public_username === undefined || userdata?.public_username === null || userdata?.public_username.length <= 0 ? null :
+
+
+
+ }
+