diff --git a/client/app/pages/alert/Alert.jsx b/client/app/pages/alert/Alert.jsx
index 9aac679f9..877646b61 100644
--- a/client/app/pages/alert/Alert.jsx
+++ b/client/app/pages/alert/Alert.jsx
@@ -16,6 +16,7 @@ import MenuButton from "./components/MenuButton";
import AlertView from "./AlertView";
import AlertEdit from "./AlertEdit";
import AlertNew from "./AlertNew";
+import notifications from "@/services/notifications";
const MODES = {
NEW: 0,
@@ -178,6 +179,17 @@ class Alert extends React.Component {
});
};
+ evaluate = () => {
+ const { alert } = this.state;
+ return AlertService.evaluate(alert)
+ .then(() => {
+ notification.success("Alert evaluated. Refresh page for updated status.");
+ })
+ .catch(() => {
+ notifications.error("Failed to evaluate alert.");
+ });
+ };
+
mute = () => {
const { alert } = this.state;
return AlertService.mute(alert)
@@ -224,7 +236,14 @@ class Alert extends React.Component {
const { queryResult, mode, canEdit, pendingRearm } = this.state;
const menuButton = (
-
+
);
const commonProps = {
diff --git a/client/app/pages/alert/components/MenuButton.jsx b/client/app/pages/alert/components/MenuButton.jsx
index ce1a0b839..1aeb64bda 100644
--- a/client/app/pages/alert/components/MenuButton.jsx
+++ b/client/app/pages/alert/components/MenuButton.jsx
@@ -11,7 +11,7 @@ import LoadingOutlinedIcon from "@ant-design/icons/LoadingOutlined";
import EllipsisOutlinedIcon from "@ant-design/icons/EllipsisOutlined";
import PlainButton from "@/components/PlainButton";
-export default function MenuButton({ doDelete, canEdit, mute, unmute, muted }) {
+export default function MenuButton({ doDelete, canEdit, mute, unmute, evaluate, muted }) {
const [loading, setLoading] = useState(false);
const execute = useCallback(action => {
@@ -55,6 +55,9 @@ export default function MenuButton({ doDelete, canEdit, mute, unmute, muted }) {
Delete
+
+ execute(evaluate)}>Evaluate
+
}>