Skip to content

Commit c93d229

Browse files
authored
feat: Agent nodes offline, alert through the main node (#8303)
1 parent eaefac4 commit c93d229

File tree

12 files changed

+87
-3
lines changed

12 files changed

+87
-3
lines changed

agent/constant/alert.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ const (
44
AlertEnable = "Enable"
55
AlertDisable = "Disable"
66
AlertSuccess = "Success"
7+
AlertPushing = "Pushing"
78
AlertError = "Error"
89
AlertSyncError = "SyncError"
910
AlertPushError = "PushError"
1011
AlertPushSuccess = "PushSuccess"
11-
)
12+
)

frontend/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"codemirror": "^6.0.1",
3939
"crypto-js": "^4.2.0",
4040
"echarts": "^5.5.0",
41-
"element-plus": "^2.7.5",
41+
"element-plus": "^2.9.7",
4242
"fit2cloud-ui-plus": "^1.2.0",
4343
"highlight.js": "^11.9.0",
4444
"js-base64": "^3.7.7",
@@ -62,6 +62,7 @@
6262
},
6363
"devDependencies": {
6464
"@types/node": "^20.14.8",
65+
"@types/uuid": "^10.0.0",
6566
"@typescript-eslint/eslint-plugin": "^5.62.0",
6667
"@typescript-eslint/parser": "^5.22.0",
6768
"@vitejs/plugin-vue": "^5.0.5",

frontend/src/lang/modules/en.ts

+10
Original file line numberDiff line numberDiff line change
@@ -3359,6 +3359,8 @@ const message = {
33593359
pushSuccess: 'Push Successful',
33603360
syncError: 'Sync Failed',
33613361
success: 'Alert Successful',
3362+
pushing: 'Pushing...',
3363+
error: 'Alert Failed',
33623364
cleanLog: 'Clean Logs',
33633365
cleanAlertLogs: 'Clean Alert Logs',
33643366
daily: 'Daily Alert Count: {0}',
@@ -3415,6 +3417,14 @@ const message = {
34153417
defaultPhone: 'Default to license-bound account phone number',
34163418
noticeAlert: 'Notice Alert',
34173419
resourceAlert: 'Resource Alert',
3420+
syncToNode: 'Sync to Node',
3421+
syncToNodeHelper: 'Sync alert settings to other nodes',
3422+
nodes: 'Node',
3423+
selectNode: 'Select Node',
3424+
selectNodeError: 'Please select a node',
3425+
syncToNodeClose: 'After closing, set the async alert settings to another node. Do you want to continue?',
3426+
agentOfflineAlertHelper:
3427+
'The child node offline alert will be scanned and executed by the main node every 30 minutes',
34183428
},
34193429
theme: {
34203430
lingXiaGold: 'Ling Xia Gold',

frontend/src/lang/modules/ja.ts

+10
Original file line numberDiff line numberDiff line change
@@ -3210,6 +3210,8 @@ const message = {
32103210
pushSuccess: 'プッシュ成功',
32113211
syncError: '同期失敗',
32123212
success: 'アラート成功',
3213+
pushing: 'プッシュ中...',
3214+
error: 'アラート失敗',
32133215
cleanLog: 'ログをクリア',
32143216
cleanAlertLogs: 'アラートログをクリア',
32153217
daily: '1日のアラート数:{0}',
@@ -3266,6 +3268,14 @@ const message = {
32663268
defaultPhone: 'ライセンスに紐付けられたアカウントの電話番号をデフォルトにする',
32673269
noticeAlert: '通知アラート',
32683270
resourceAlert: 'リソースアラート',
3271+
syncToNode: '子ノードに同期',
3272+
syncToNodeHelper: '他のノードにアラート設定を同期',
3273+
nodes: 'ノード',
3274+
selectNode: 'ノードを選択',
3275+
selectNodeError: 'ノードを選択してください',
3276+
syncToNodeClose: '閉じると他のノードへのアラート設定は同期されません。続行しますか?',
3277+
agentOfflineAlertHelper:
3278+
'子ノードのオフラインアラートは、メインノードが 30 分ごとにスキャンしてアラートタスクを実行します',
32693279
},
32703280
theme: {
32713281
lingXiaGold: '凌霞金',

frontend/src/lang/modules/ko.ts

+9
Original file line numberDiff line numberDiff line change
@@ -3155,6 +3155,8 @@ const message = {
31553155
pushSuccess: '푸시 성공',
31563156
syncError: '동기화 실패',
31573157
success: '알림 성공',
3158+
pushing: '푸시 중...',
3159+
error: '알림 실패',
31583160
cleanLog: '로그 정리',
31593161
cleanAlertLogs: '알림 로그 정리',
31603162
daily: '일일 알림 수: {0}',
@@ -3211,6 +3213,13 @@ const message = {
32113213
defaultPhone: '기본적으로 라이선스에 묶인 계정의 전화번호 사용',
32123214
noticeAlert: '공지 알림',
32133215
resourceAlert: '리소스 알림',
3216+
syncToNode: '자식 노드로 동기화',
3217+
syncToNodeHelper: '다른 노드로 알림 설정 동기화',
3218+
nodes: '노드',
3219+
selectNode: '노드 선택',
3220+
selectNodeError: '노드를 선택해 주세요',
3221+
syncToNodeClose: '닫으면 다른 노드로 알림 설정이 동기화되지 않습니다. 계속하시겠습니까?',
3222+
agentOfflineAlertHelper: '자식 노드 오프라인 알림은 메인 노드가 30분마다 스캔하여 실행합니다',
32143223
},
32153224
theme: {
32163225
lingXiaGold: '링샤 골드',

frontend/src/lang/modules/ms.ts

+11
Original file line numberDiff line numberDiff line change
@@ -3289,6 +3289,8 @@ const message = {
32893289
pushSuccess: 'Tekanan Berjaya',
32903290
syncError: 'Penyelarasan Gagal',
32913291
success: 'Amaran Berjaya',
3292+
pushing: 'Sedang menghantar...',
3293+
error: 'Amaran gagal',
32923294
cleanLog: 'Bersihkan Log',
32933295
cleanAlertLogs: 'Bersihkan Log Amaran',
32943296
daily: 'Bilangan Amaran Harian: {0}',
@@ -3345,6 +3347,15 @@ const message = {
33453347
defaultPhone: 'Secara lalai ke nombor telefon akaun terikat lesen',
33463348
noticeAlert: 'Amaran Pemberitahuan',
33473349
resourceAlert: 'Amaran Sumber',
3350+
syncToNode: 'Penyegerakan ke nod anak',
3351+
syncToNodeHelper: 'Penyegerakan tetapan amaran ke nod lain',
3352+
nodes: 'Nod',
3353+
selectNode: 'Pilih nod',
3354+
selectNodeError: 'Sila pilih nod',
3355+
syncToNodeClose:
3356+
'Menutup ini tidak akan menyegerakkan tetapan amaran ke nod lain. Adakah anda ingin meneruskan?',
3357+
agentOfflineAlertHelper:
3358+
'Amaran luar talian nod anak akan diimbas dan dilaksanakan oleh nod utama setiap 30 minit',
33483359
},
33493360
theme: {
33503361
lingXiaGold: 'Ling Xia Emas',

frontend/src/lang/modules/pt-br.ts

+11
Original file line numberDiff line numberDiff line change
@@ -3290,6 +3290,8 @@ const message = {
32903290
pushSuccess: 'Envio Bem-sucedido',
32913291
syncError: 'Sincronização Falhou',
32923292
success: 'Alerta Bem-sucedido',
3293+
pushing: 'Enviando...',
3294+
error: 'Falha no alerta',
32933295
cleanLog: 'Limpar Registros',
32943296
cleanAlertLogs: 'Limpar Registros de Alertas',
32953297
daily: 'Contagem Diária de Alertas: {0}',
@@ -3346,6 +3348,15 @@ const message = {
33463348
defaultPhone: 'Número de telefone padrão vinculado à conta de licença',
33473349
noticeAlert: 'Alerta de Notificação',
33483350
resourceAlert: 'Alerta de Recursos',
3351+
syncToNode: 'Sincronizar para o nó filho',
3352+
syncToNodeHelper: 'Sincronizar configurações de alerta para outros nós',
3353+
nodes: 'Nós',
3354+
selectNode: 'Selecionar nó',
3355+
selectNodeError: 'Por favor, selecione um nó',
3356+
syncToNodeClose:
3357+
'Ao fechar, as configurações de alerta não serão sincronizadas para outros nós. Deseja continuar?',
3358+
agentOfflineAlertHelper:
3359+
'O alerta de offline do nó filho será verificado e executado pelo nó principal a cada 30 minutos',
33493360
},
33503361
theme: {
33513362
lingXiaGold: 'Ling Xia Gold',

frontend/src/lang/modules/ru.ts

+11
Original file line numberDiff line numberDiff line change
@@ -3280,6 +3280,8 @@ const message = {
32803280
pushSuccess: 'Отправка успешна',
32813281
syncError: 'Ошибка синхронизации',
32823282
success: 'Уведомление успешно',
3283+
pushing: 'В процессе отправки...',
3284+
error: 'Ошибка оповещения',
32833285
cleanLog: 'Очистить логи',
32843286
cleanAlertLogs: 'Очистить журналы уведомлений',
32853287
daily: 'Ежедневное количество уведомлений: {0}',
@@ -3341,6 +3343,15 @@ const message = {
33413343
defaultPhone: 'По умолчанию используется номер телефона, привязанный к лицензии',
33423344
noticeAlert: 'Уведомление',
33433345
resourceAlert: 'Уведомление о Ресурсах',
3346+
syncToNode: 'Синхронизация с дочерним узлом',
3347+
syncToNodeHelper: 'Синхронизация настроек оповещений с другими узлами',
3348+
nodes: 'Узлы',
3349+
selectNode: 'Выберите узел',
3350+
selectNodeError: 'Пожалуйста, выберите узел',
3351+
syncToNodeClose:
3352+
'После закрытия настройки оповещений не будут синхронизированы с другими узлами. Продолжить?',
3353+
agentOfflineAlertHelper:
3354+
'Оповещение об отключении дочернего узла. Главный узел будет сканировать и выполнять задачу оповещения каждые 30 минут',
33443355
},
33453356
theme: {
33463357
lingXiaGold: 'Лин Ся Золотой',

frontend/src/lang/modules/zh-Hant.ts

+9
Original file line numberDiff line numberDiff line change
@@ -3112,6 +3112,8 @@ const message = {
31123112
pushSuccess: '推送成功',
31133113
syncError: '同步失敗',
31143114
success: '告警成功',
3115+
pushing: '推送中...',
3116+
error: '告警失敗',
31153117
cleanLog: '清空日誌',
31163118
cleanAlertLogs: '清空告警日誌',
31173119
daily: '當日第 {0} 次告警',
@@ -3168,6 +3170,13 @@ const message = {
31683170
defaultPhone: '預設使用與許可證綁定的帳戶手機號',
31693171
noticeAlert: '通知告警',
31703172
resourceAlert: '資源告警',
3173+
syncToNode: '同步至子節點',
3174+
syncToNodeHelper: '同步告警設置至其他節點',
3175+
nodes: '節點',
3176+
selectNode: '選擇節點',
3177+
selectNodeError: '請選擇節點',
3178+
syncToNodeClose: '關閉後將不同步告警設置到其他節點,是否繼續?',
3179+
agentOfflineAlertHelper: '子節點離線告警,將由主節點每半小時掃描執行一次告警任務',
31713180
},
31723181
theme: {
31733182
lingXiaGold: '凌霞金',

frontend/src/lang/modules/zh.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -3081,7 +3081,7 @@ const message = {
30813081
allDiskTitle: '磁盘占用过高告警',
30823082

30833083
timeRule: '剩余时间小于 {0} 天 (如未处理,次日会重新发送)',
3084-
panelUpdateRule: '检测到面板有新版本时发vb送一次 (如未处理,次日会重新发送)',
3084+
panelUpdateRule: '检测到面板有新版本时发送一次 (如未处理,次日会重新发送)',
30853085
avgRule: '{0} 分钟内平均{1}占用超过 {2}% 触发,每天发送 {3} 次',
30863086
diskRule: '挂载目录「 {0} 」的磁盘占用超过 {1}{2} 触发,每天发送 {3} 次',
30873087
allDiskRule: '磁盘占用超过 {0}{1} 触发,每天发送 {2} 次',
@@ -3097,6 +3097,8 @@ const message = {
30973097
pushSuccess: '推送成功',
30983098
syncError: '同步失败',
30993099
success: '告警成功',
3100+
pushing: '推送中...',
3101+
error: '告警失败',
31003102
cleanLog: '清空日志',
31013103
cleanAlertLogs: '清空告警日志',
31023104
daily: '当日第 {0} 次告警',
@@ -3150,6 +3152,13 @@ const message = {
31503152
defaultPhone: '默认使用与许可证绑定的账户手机号',
31513153
noticeAlert: '通知告警',
31523154
resourceAlert: '资源告警',
3155+
syncToNode: '同步至子节点',
3156+
syncToNodeHelper: '同步告警设置至其他节点',
3157+
nodes: '节点',
3158+
selectNode: '选择节点',
3159+
selectNodeError: '请选择节点',
3160+
syncToNodeClose: '关闭后将不同步告警设置到其他节点,是否继续?',
3161+
agentOfflineAlertHelper: '子节点离线告警,会通过主节点每半小时扫描执行一次告警任务',
31533162
},
31543163
theme: {
31553164
lingXiaGold: '凌霞金',

frontend/src/store/interface/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export interface GlobalState {
4141
errStatus: string;
4242

4343
currentNode: string;
44+
isOffline: boolean;
4445
}
4546

4647
export interface MenuState {

frontend/src/store/modules/global.ts

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const GlobalStore = defineStore({
4444
errStatus: '',
4545

4646
currentNode: 'local',
47+
isOffline: false,
4748
}),
4849
getters: {
4950
isDarkTheme: (state) =>

0 commit comments

Comments
 (0)