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": "✅ Telegramユーザーが保存されました。",
"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": "アップ"
}
}
}