From ae07ee3d9f0427e7d6c9b1601c5e2d20cb080d9a Mon Sep 17 00:00:00 2001 From: jo-hnny Date: Fri, 28 Oct 2022 19:37:22 +0800 Subject: [PATCH] feat(console): add send status to alarm record table (#2135) * feat(console): change alertRepeatInterval default time * feat(console): add send status to alarm record table * feat(console): change text * feat(console): add failedReason --- web/console/package-lock.json | 11 ++++++++++- .../alarmRecord/components/AlarmRecordPanel.tsx | 14 ++++++++++++++ .../components/clusterManage/ConfigPromethus.tsx | 4 ++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/web/console/package-lock.json b/web/console/package-lock.json index 033b48889..9e2d5f6d1 100644 --- a/web/console/package-lock.json +++ b/web/console/package-lock.json @@ -1255,6 +1255,15 @@ "integrity": "sha1-Qx7DQqcZViL4Zoi72oLjFmzoyyg=", "dev": true }, + "@types/classnames": { + "version": "2.3.1", + "resolved": "http://r.tnpm.oa.com/@types%2fclassnames/-/classnames-2.3.1.tgz", + "integrity": "sha512-zeOWb0JGBoVmlQoznvqXbE0tEC/HONsnoUNH19Hc96NFsTAwTXbTqb8FMYkru1F/iqp7a18Ws3nWJvtA1sHD1A==", + "dev": true, + "requires": { + "classnames": "*" + } + }, "@types/eslint": { "version": "7.2.10", "resolved": "https://registry.npm.taobao.org/@types/eslint/download/@types/eslint-7.2.10.tgz?cache=0&sync_timestamp=1618425587304&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Feslint%2Fdownload%2F%40types%2Feslint-7.2.10.tgz", @@ -12963,4 +12972,4 @@ "dev": true } } -} \ No newline at end of file +} diff --git a/web/console/src/modules/alarmRecord/components/AlarmRecordPanel.tsx b/web/console/src/modules/alarmRecord/components/AlarmRecordPanel.tsx index f844266c7..2896eba6f 100644 --- a/web/console/src/modules/alarmRecord/components/AlarmRecordPanel.tsx +++ b/web/console/src/modules/alarmRecord/components/AlarmRecordPanel.tsx @@ -112,6 +112,20 @@ export const AlarmRecordPanel = () => { ); } + }, + + { + key: 'status.failedReason', + header: t('发送状态'), + render: item => { + const failedReason = item?.status?.failedReason; + + return ( + + {failedReason ? t('发送失败') : t('已发送')} + + ); + } } ]; diff --git a/web/console/src/modules/cluster/components/clusterManage/ConfigPromethus.tsx b/web/console/src/modules/cluster/components/clusterManage/ConfigPromethus.tsx index ee0ab2bfe..c3a32968d 100644 --- a/web/console/src/modules/cluster/components/clusterManage/ConfigPromethus.tsx +++ b/web/console/src/modules/cluster/components/clusterManage/ConfigPromethus.tsx @@ -40,7 +40,7 @@ export function ConfigPromethus({ route, actions }: RootProps) { }, runOnMaster: false, notifyWebhook: '', - alertRepeatInterval: 20 + alertRepeatInterval: 240 }); const { @@ -168,7 +168,7 @@ export function ConfigPromethus({ route, actions }: RootProps) { name="alertRepeatInterval" render={({ field }) => ( - + )} />