Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion agent/constant/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ const (
AlertEnable = "Enable"
AlertDisable = "Disable"
AlertSuccess = "Success"
AlertPushing = "Pushing"
AlertError = "Error"
AlertSyncError = "SyncError"
AlertPushError = "PushError"
AlertPushSuccess = "PushSuccess"
)
)
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"codemirror": "^6.0.1",
"crypto-js": "^4.2.0",
"echarts": "^5.5.0",
"element-plus": "^2.7.5",
"element-plus": "^2.9.7",
"fit2cloud-ui-plus": "^1.2.0",
"highlight.js": "^11.9.0",
"js-base64": "^3.7.7",
Expand All @@ -62,6 +62,7 @@
},
"devDependencies": {
"@types/node": "^20.14.8",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.22.0",
"@vitejs/plugin-vue": "^5.0.5",
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3359,6 +3359,8 @@ const message = {
pushSuccess: 'Push Successful',
syncError: 'Sync Failed',
success: 'Alert Successful',
pushing: 'Pushing...',
error: 'Alert Failed',
cleanLog: 'Clean Logs',
cleanAlertLogs: 'Clean Alert Logs',
daily: 'Daily Alert Count: {0}',
Expand Down Expand Up @@ -3415,6 +3417,14 @@ const message = {
defaultPhone: 'Default to license-bound account phone number',
noticeAlert: 'Notice Alert',
resourceAlert: 'Resource Alert',
syncToNode: 'Sync to Node',
syncToNodeHelper: 'Sync alert settings to other nodes',
nodes: 'Node',
selectNode: 'Select Node',
selectNodeError: 'Please select a node',
syncToNodeClose: 'After closing, set the async alert settings to another node. Do you want to continue?',
agentOfflineAlertHelper:
'The child node offline alert will be scanned and executed by the main node every 30 minutes',
},
theme: {
lingXiaGold: 'Ling Xia Gold',
Expand Down
10 changes: 10 additions & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3210,6 +3210,8 @@ const message = {
pushSuccess: 'プッシュ成功',
syncError: '同期失敗',
success: 'アラート成功',
pushing: 'プッシュ中...',
error: 'アラート失敗',
cleanLog: 'ログをクリア',
cleanAlertLogs: 'アラートログをクリア',
daily: '1日のアラート数:{0}',
Expand Down Expand Up @@ -3266,6 +3268,14 @@ const message = {
defaultPhone: 'ライセンスに紐付けられたアカウントの電話番号をデフォルトにする',
noticeAlert: '通知アラート',
resourceAlert: 'リソースアラート',
syncToNode: '子ノードに同期',
syncToNodeHelper: '他のノードにアラート設定を同期',
nodes: 'ノード',
selectNode: 'ノードを選択',
selectNodeError: 'ノードを選択してください',
syncToNodeClose: '閉じると他のノードへのアラート設定は同期されません。続行しますか?',
agentOfflineAlertHelper:
'子ノードのオフラインアラートは、メインノードが 30 分ごとにスキャンしてアラートタスクを実行します',
},
theme: {
lingXiaGold: '凌霞金',
Expand Down
9 changes: 9 additions & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3155,6 +3155,8 @@ const message = {
pushSuccess: '푸시 성공',
syncError: '동기화 실패',
success: '알림 성공',
pushing: '푸시 중...',
error: '알림 실패',
cleanLog: '로그 정리',
cleanAlertLogs: '알림 로그 정리',
daily: '일일 알림 수: {0}',
Expand Down Expand Up @@ -3211,6 +3213,13 @@ const message = {
defaultPhone: '기본적으로 라이선스에 묶인 계정의 전화번호 사용',
noticeAlert: '공지 알림',
resourceAlert: '리소스 알림',
syncToNode: '자식 노드로 동기화',
syncToNodeHelper: '다른 노드로 알림 설정 동기화',
nodes: '노드',
selectNode: '노드 선택',
selectNodeError: '노드를 선택해 주세요',
syncToNodeClose: '닫으면 다른 노드로 알림 설정이 동기화되지 않습니다. 계속하시겠습니까?',
agentOfflineAlertHelper: '자식 노드 오프라인 알림은 메인 노드가 30분마다 스캔하여 실행합니다',
},
theme: {
lingXiaGold: '링샤 골드',
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3289,6 +3289,8 @@ const message = {
pushSuccess: 'Tekanan Berjaya',
syncError: 'Penyelarasan Gagal',
success: 'Amaran Berjaya',
pushing: 'Sedang menghantar...',
error: 'Amaran gagal',
cleanLog: 'Bersihkan Log',
cleanAlertLogs: 'Bersihkan Log Amaran',
daily: 'Bilangan Amaran Harian: {0}',
Expand Down Expand Up @@ -3345,6 +3347,15 @@ const message = {
defaultPhone: 'Secara lalai ke nombor telefon akaun terikat lesen',
noticeAlert: 'Amaran Pemberitahuan',
resourceAlert: 'Amaran Sumber',
syncToNode: 'Penyegerakan ke nod anak',
syncToNodeHelper: 'Penyegerakan tetapan amaran ke nod lain',
nodes: 'Nod',
selectNode: 'Pilih nod',
selectNodeError: 'Sila pilih nod',
syncToNodeClose:
'Menutup ini tidak akan menyegerakkan tetapan amaran ke nod lain. Adakah anda ingin meneruskan?',
agentOfflineAlertHelper:
'Amaran luar talian nod anak akan diimbas dan dilaksanakan oleh nod utama setiap 30 minit',
},
theme: {
lingXiaGold: 'Ling Xia Emas',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no significant irregularities or optimization suggestions in the given code snippet compared to version 2021-09-01. The changes focus on adding new keys related to synchronization, user interface elements like node selection and close prompts, and additional alert messages. No performance optimizations were made based on the provided information.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code changes look generally consistent with updating messages to improve user experience and clarity. Here are some minor adjustments and recommendations:

  1. Consistency and Formatting:

    • Ensure that all entries for pushing and error are consistently formatted as they appear when the string is used in UI components.
    • Consider adding spaces around hyphens in long words (e.g., {0}) for better readability.
  2. Translation Accuracy:

    • Double-check for any typos or grammatical errors in translations, especially those related to node syncing functionality:
      • syncToNode: "Send to child node"
      • nodes: "Nodes"
      • selectNode: "Select node"
      • selectNodeError should match the context; it might be better to prompt the user more precisely if they select an invalid option.
      • agentOfflineAlertHelper: Ensure the translation maintains accurate meaning and tone regarding how out-of-limits alerts will be handled.

Optimal Changes

@@ -3289,6 +3289,8 @@ const message = {
+            pushing: 'Sedang menghantar...',
+            error: 'Amaran gagal',
             cleanLog: 'Bersihkan Log',
             cleanAlertLogs: 'Bersihkan Log Amaran',
             daily: 'Bilangan Amaran Harian: {0}',
@@ -3345,6 +3347,11 @@ const message = {
@@ -3456,3 +3459,3 @@

These adjustments make the translations and strings clearer and easier to implement in application interfaces.

Expand Down
11 changes: 11 additions & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3290,6 +3290,8 @@ const message = {
pushSuccess: 'Envio Bem-sucedido',
syncError: 'Sincronização Falhou',
success: 'Alerta Bem-sucedido',
pushing: 'Enviando...',
error: 'Falha no alerta',
cleanLog: 'Limpar Registros',
cleanAlertLogs: 'Limpar Registros de Alertas',
daily: 'Contagem Diária de Alertas: {0}',
Expand Down Expand Up @@ -3346,6 +3348,15 @@ const message = {
defaultPhone: 'Número de telefone padrão vinculado à conta de licença',
noticeAlert: 'Alerta de Notificação',
resourceAlert: 'Alerta de Recursos',
syncToNode: 'Sincronizar para o nó filho',
syncToNodeHelper: 'Sincronizar configurações de alerta para outros nós',
nodes: 'Nós',
selectNode: 'Selecionar nó',
selectNodeError: 'Por favor, selecione um nó',
syncToNodeClose:
'Ao fechar, as configurações de alerta não serão sincronizadas para outros nós. Deseja continuar?',
agentOfflineAlertHelper:
'O alerta de offline do nó filho será verificado e executado pelo nó principal a cada 30 minutos',
},
theme: {
lingXiaGold: 'Ling Xia Gold',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code provided contains several potential improvements for better readability, maintainability, and functionality:

  1. Code Formatting: The indentation level in the translations needs to be consistent for clarity.

  2. Variable Naming: Ensure that variable names are descriptive enough without being too long, such as defaultPhone, noticeAlert, etc.

  3. Functionality Enhancements:

    • Consider implementing more informative alerts or logs if errors occur during the syncing process.
    • Add a confirmation dialog when closing the node selection tab to avoid accidental data loss.
  4. Comments: Some parts of the code appear to have comments out but should either be removed or made meaningful.

Here's an updated version based on these suggestions:

const message = {
    pushSuccess: 'Envío Exitoso',
    syncError: 'Falha na Sincronização',
    success: 'Aviso bem-sucedido',
    pushing: 'Enviando...',
    error: 'Erro no aviso',
    cleanLog: 'Limpar Registros',
    cleanAlertLogs: 'Limpar Registros de Aviso',
    daily: 'Contagem diária de avisos: {0}',

    // Notifications
    noticeAlert: 'Notificação',

    // Resources
    resourceAlert: 'Aviso de Recurso',

    // Sync Settings
    syncToNode: 'Sincronizar com O Nó Filho',
    syncToNodeHelper:
        'Sincronizar configurações de alerta para outros nós. Certifique-se de que todos os membros do nó filho estejam configurados corretamente.',
    nodes: 'Nós Filhos',
    selectNode: 'Selecionar Nó Filho',
    selectNodeError: 'Selecione pelo menos um nodo filho.',
    syncToNodeClose:
        'Ao fechar esta janela, as configurações de alerta dos outros nodos filhos não serão automaticamente sincronizadas. Deseja prosseguir?',
    agentOfflineAlertHelper:
        'O alerta de estado-offline será verificado e atualizado automaticamente em até 30 minutos pelos nós principais.'

};

Changes Made:

  • Consistent indentation throughout all keys.
  • Used lowercase words for consistency (e.g., "success" instead of "Success").
  • Added a helper text for configuring other nodes when selecting one.
  • Removed unnecessary lines and comments while maintaining logical flow.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The differences provided appear to be minor corrections or additions. Here is a concise summary of the changes:

  1. Message Addition: Added two new messages: pushing for during sending and error for an alert error.

  2. Sync to Node Functionality:

    • Added descriptions for:
      • syncToNode: Synchronize with child node.
      • syncToNodeHelper: Helper text to indicate what it does (synchronizes alert configurations).
      • nodes, selectNode, selectNodeError: Descriptions for node-related elements.
      • syncToNodeClose: Confirmation prompt when closing to prevent synchronization.
      • agentOfflineAlertHelper: Description for checking offline alerts on child nodes.

These modifications improve clarity and functionality without introducing significant issues. If you need further assistance or optimizations, please let me know!

Expand Down
11 changes: 11 additions & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3280,6 +3280,8 @@ const message = {
pushSuccess: 'Отправка успешна',
syncError: 'Ошибка синхронизации',
success: 'Уведомление успешно',
pushing: 'В процессе отправки...',
error: 'Ошибка оповещения',
cleanLog: 'Очистить логи',
cleanAlertLogs: 'Очистить журналы уведомлений',
daily: 'Ежедневное количество уведомлений: {0}',
Expand Down Expand Up @@ -3341,6 +3343,15 @@ const message = {
defaultPhone: 'По умолчанию используется номер телефона, привязанный к лицензии',
noticeAlert: 'Уведомление',
resourceAlert: 'Уведомление о Ресурсах',
syncToNode: 'Синхронизация с дочерним узлом',
syncToNodeHelper: 'Синхронизация настроек оповещений с другими узлами',
nodes: 'Узлы',
selectNode: 'Выберите узел',
selectNodeError: 'Пожалуйста, выберите узел',
syncToNodeClose:
'После закрытия настройки оповещений не будут синхронизированы с другими узлами. Продолжить?',
agentOfflineAlertHelper:
'Оповещение об отключении дочернего узла. Главный узел будет сканировать и выполнять задачу оповещения каждые 30 минут',
},
theme: {
lingXiaGold: 'Лин Ся Золотой',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there are no irregularities or significant issues with the provided code changes. The suggested additions and improvements align well with standard practices for enhancing user experience and clarity in application interfaces.

The updates include:

  • Descriptions of various messages to users.
  • Placeholder text ({0}) where dynamic data should be inserted.
  • Explanation of specific actions (syncing between nodes), which enhances functionality.

These modifications improve the usability of the UI by providing context about what each button, option, and alert does. However, it's worth noting that if the "select node" feature isn't already implemented, consider adding documentation on how to use this feature effectively for users. Also, ensure all new strings are properly localized when applicable.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no significant irregularities, potential issues, or major optimization opportunities in the provided patch. The changes focus on adding new labels to the message object and updating existing ones while maintaining consistency. Overall, the additions improve localization and clarity of UI components related to notifications and configuration options.

Here’s a brief summary of the added content:

  • Added labels for "pushing" status, "error" handling, additional buttons ("clean Log", "sync logs"),
  • Updated messages and added new descriptions for:
    • "defaultPhone": Prompts users to use phone number associated with their license.
    • "noticeAlert" and "resourceAlert": Labels for different types of alerts.
    • New option under "Configuration Options":
      • "Sync to Node"
      • helper text for selecting nodes
      • notification when closing settings without syncing
    • Helper text for "Agent Offline Alert"

The patch maintains an organized structure with clear labels for all relevant actions in the user interface.

Expand Down
9 changes: 9 additions & 0 deletions frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3112,6 +3112,8 @@ const message = {
pushSuccess: '推送成功',
syncError: '同步失敗',
success: '告警成功',
pushing: '推送中...',
error: '告警失敗',
cleanLog: '清空日誌',
cleanAlertLogs: '清空告警日誌',
daily: '當日第 {0} 次告警',
Expand Down Expand Up @@ -3168,6 +3170,13 @@ const message = {
defaultPhone: '預設使用與許可證綁定的帳戶手機號',
noticeAlert: '通知告警',
resourceAlert: '資源告警',
syncToNode: '同步至子節點',
syncToNodeHelper: '同步告警設置至其他節點',
nodes: '節點',
selectNode: '選擇節點',
selectNodeError: '請選擇節點',
syncToNodeClose: '關閉後將不同步告警設置到其他節點,是否繼續?',
agentOfflineAlertHelper: '子節點離線告警,將由主節點每半小時掃描執行一次告警任務',
},
theme: {
lingXiaGold: '凌霞金',
Expand Down
11 changes: 10 additions & 1 deletion frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3081,7 +3081,7 @@ const message = {
allDiskTitle: '磁盘占用过高告警',

timeRule: '剩余时间小于 {0} 天 (如未处理,次日会重新发送)',
panelUpdateRule: '检测到面板有新版本时发vb送一次 (如未处理,次日会重新发送)',
panelUpdateRule: '检测到面板有新版本时发送一次 (如未处理,次日会重新发送)',
avgRule: '{0} 分钟内平均{1}占用超过 {2}% 触发,每天发送 {3} 次',
diskRule: '挂载目录「 {0} 」的磁盘占用超过 {1}{2} 触发,每天发送 {3} 次',
allDiskRule: '磁盘占用超过 {0}{1} 触发,每天发送 {2} 次',
Expand All @@ -3097,6 +3097,8 @@ const message = {
pushSuccess: '推送成功',
syncError: '同步失败',
success: '告警成功',
pushing: '推送中...',
error: '告警失败',
cleanLog: '清空日志',
cleanAlertLogs: '清空告警日志',
daily: '当日第 {0} 次告警',
Expand Down Expand Up @@ -3150,6 +3152,13 @@ const message = {
defaultPhone: '默认使用与许可证绑定的账户手机号',
noticeAlert: '通知告警',
resourceAlert: '资源告警',
syncToNode: '同步至子节点',
syncToNodeHelper: '同步告警设置至其他节点',
nodes: '节点',
selectNode: '选择节点',
selectNodeError: '请选择节点',
syncToNodeClose: '关闭后将不同步告警设置到其他节点,是否继续?',
agentOfflineAlertHelper: '子节点离线告警,会通过主节点每半小时扫描执行一次告警任务',
},
theme: {
lingXiaGold: '凌霞金',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/store/interface/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface GlobalState {
errStatus: string;

currentNode: string;
isOffline: boolean;
}

export interface MenuState {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/store/modules/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const GlobalStore = defineStore({
errStatus: '',

currentNode: 'local',
isOffline: false,
}),
getters: {
isDarkTheme: (state) =>
Expand Down
Loading