feat(memory): add memory threshold alerts (#5366)

* feat(memory): add memory threshold alerts

Add memory (RAM) threshold alerts following the same architecture as
CPU alerts: CheckMemJob with @every 1m cadence, memoryAlarmWanted gate,
tgMemory/smtpMemory per-subscriber settings (default 80%), EventBusCheckboxes
with inline threshold input, i18n for en-US/ru-RU with English defaults.

# Conflicts:
#	internal/web/translation/ar-EG.json
#	internal/web/translation/es-ES.json
#	internal/web/translation/fa-IR.json
#	internal/web/translation/id-ID.json
#	internal/web/translation/ja-JP.json
#	internal/web/translation/pt-BR.json
#	internal/web/translation/ru-RU.json
#	internal/web/translation/tr-TR.json
#	internal/web/translation/uk-UA.json
#	internal/web/translation/vi-VN.json
#	internal/web/translation/zh-CN.json
#	internal/web/translation/zh-TW.json

* fix: address code review findings for memory alerts

- Remove dead settingService field from CheckMemJob
- Fix cpuThreshold double-emoji in 12 locale files (code prepends 🔴)
- Align TgCpu/TgMemory fields in entity.go
- Add missing SetTgMemory function

* fix: restore settingService in CheckMemJob for consistency with CheckCpuJob
This commit is contained in:
Sentiago
2026-06-21 17:45:33 +02:00
committed by GitHub
parent 648fc69cb1
commit 891d3a8759
28 changed files with 267 additions and 39 deletions
+5 -3
View File
@@ -1309,6 +1309,7 @@
"smtpErrorRelay": "伺服器拒絕從此地址傳送",
"smtpErrorEof": "連線已被伺服器關閉",
"smtpErrorUnknown": "SMTP 錯誤:{{ .Error }}",
"eventMemoryHigh": "記憶體使用率高 (%)",
"remarkTemplate": "備註範本",
"remarkTemplateDesc": "設定後,這將取代每個訂閱連結的備註模型——使用變數標記撰寫您自己的格式(使用按鈕來插入)。留空則使用上方的模型。"
},
@@ -1865,7 +1866,7 @@
"idDesc": "顯示您的 Telegram ID"
},
"messages": {
"cpuThreshold": "🔴 CPU 使用率為 {{ .Percent }}%,超過閾值 {{ .Threshold }}%",
"cpuThreshold": "CPU 使用率為 {{ .Percent }}%,超過閾值 {{ .Threshold }}%",
"selectUserFailed": "❌ 使用者選擇錯誤!",
"userSaved": "✅ 電報使用者已儲存。",
"loginSuccess": "✅ 成功登入到面板。\r\n",
@@ -1940,7 +1941,8 @@
"eventNodeUp": "節點 {{ .Name }} 已上線",
"eventCPUHigh": "CPU 偏高",
"eventCPUHighDetail": "CPU{{ .Detail }}",
"eventLoginFallback": "來自 {{ .Source }} 的登入失敗"
"eventLoginFallback": "來自 {{ .Source }} 的登入失敗",
"memoryThreshold": "記憶體使用率 {{ .Percent }}% 超過閾值 {{ .Threshold }}%"
},
"buttons": {
"closeKeyboard": "❌ 關閉鍵盤",
@@ -2043,4 +2045,4 @@
"statusDown": "中斷",
"statusUp": "恢復"
}
}
}