Skip to content

Commit a384d36

Browse files
author
Cairry
committed
update
1 parent c9919c0 commit a384d36

1 file changed

Lines changed: 29 additions & 2 deletions

File tree

src/pages/event/currentEvent.jsx

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,16 @@ export const AlertCurrentEvent = (props) => {
350350
const menu = (
351351
<Menu>
352352
<Menu.Item onClick={() => {handleClaimOne(record)}} >
353-
去认领
353+
认领它
354354
</Menu.Item>
355355
{record.status !== "silenced" && (
356356
<Menu.Item onClick={() => {handleSilenceModalOpen(record)}} >
357-
去静默
357+
静默它
358358
</Menu.Item>
359359
)}
360+
<Menu.Item onClick={() => {handleDeleteOne(record)}} >
361+
删除它
362+
</Menu.Item>
360363
<Menu.Item onClick={() => openAiAnalyze(record)} disabled={analyzeLoading}>
361364
{analyzeLoading ? "Ai 分析中" : "Ai 分析"}
362365
</Menu.Item>
@@ -740,6 +743,30 @@ export const AlertCurrentEvent = (props) => {
740743
})
741744
}
742745

746+
// 单条删除
747+
const handleDeleteOne = (record) => {
748+
Modal.confirm({
749+
title: "确认删除",
750+
content: `确定要删除规则 "${record.rule_name}" 的事件吗?`,
751+
onOk: async () => {
752+
try {
753+
setBatchProcessing(true)
754+
const params = {
755+
faultCenterId: id,
756+
fingerprints: [record.fingerprint],
757+
}
758+
await DeleteAlertEvent(params)
759+
message.success("删除成功")
760+
handleCurrentEventList(currentPagination.pageIndex, currentPagination.pageSize)
761+
} catch (error) {
762+
message.error("删除失败: " + error.message)
763+
} finally {
764+
setBatchProcessing(false)
765+
}
766+
},
767+
})
768+
}
769+
743770
// 清除所有过滤条件
744771
const clearAllFilters = () => {
745772
setSearchQuery("")

0 commit comments

Comments
 (0)