update notification service

This commit is contained in:
MacRimi
2026-03-25 23:13:11 +01:00
parent 92c0e6ff09
commit cdc2d7bbcb
6 changed files with 15 additions and 5 deletions

View File

@@ -88,7 +88,7 @@ cp "$SCRIPT_DIR/flask_proxmenux_routes.py" "$APP_DIR/usr/bin/" 2>/dev/null || ec
cp "$SCRIPT_DIR/flask_terminal_routes.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ flask_terminal_routes.py not found"
cp "$SCRIPT_DIR/hardware_monitor.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ hardware_monitor.py not found"
cp "$SCRIPT_DIR/proxmox_storage_monitor.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ proxmox_storage_monitor.py not found"
cp "$SCRIPT_DIR/flask_script_runner.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo " flask_script_runner.py not found"
cp "$SCRIPT_DIR/flask_script_runner.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "<EFBFBD><EFBFBD><EFBFBD> flask_script_runner.py not found"
cp "$SCRIPT_DIR/security_manager.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ security_manager.py not found"
cp "$SCRIPT_DIR/flask_security_routes.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ flask_security_routes.py not found"
cp "$SCRIPT_DIR/notification_manager.py" "$APP_DIR/usr/bin/" 2>/dev/null || echo "⚠️ notification_manager.py not found"

View File

@@ -876,6 +876,10 @@ def _health_collector_loop():
'updates': 'System Updates',
'security': 'Security',
}
# Categories to suppress during startup grace period (transient issues)
_STARTUP_GRACE_CATEGORIES = {'storage', 'vms', 'network', 'services'}
_STARTUP_GRACE_SECONDS = 300 # 5 minutes
_collector_start_time = time.time()
while True:
try:
@@ -933,6 +937,12 @@ def _health_collector_loop():
skip_notification = True
break
# Startup grace period: skip transient issues from categories
# that typically need time to stabilize after boot
in_grace_period = (time.time() - _collector_start_time) < _STARTUP_GRACE_SECONDS
if in_grace_period and cat_key in _STARTUP_GRACE_CATEGORIES:
skip_notification = True
if not skip_notification:
degraded.append({
'category': cat_name,

View File

@@ -1135,7 +1135,7 @@ class HealthPersistence:
# This avoids redundant subprocess calls and ensures immediate detection
# when the user adds new ZFS/LVM storage via Proxmox.
# ─── User Settings ─────────────────────────────────────────
# ─── User Settings ────────────────────────<EFBFBD><EFBFBD>─────────────────
def get_setting(self, key: str, default: Optional[str] = None) -> Optional[str]:
"""Get a user setting value by key."""

View File

@@ -221,7 +221,7 @@ def capture_journal_context(keywords: list, lines: int = 30,
return ""
# ─── Journal Watcher (Real-time) ───<EFBFBD><EFBFBD>─────────────────────────────
# ─── Journal Watcher (Real-time) ────────────────────────────────
class JournalWatcher:
"""Watches journald in real-time for critical system events.

View File

@@ -1841,7 +1841,7 @@ class NotificationManager:
notification_manager = NotificationManager()
# ─── CLI Interface ───────────────────────────────────────────────
# ─── CLI Interface ───────────────────────────────────────<EFBFBD><EFBFBD><EFBFBD>────────
def _print_result(result: Dict, as_json: bool):
"""Print CLI result in human-readable or JSON format."""

View File

@@ -1612,7 +1612,7 @@ A blank line must be completely empty — no emoji, no spaces.
💥 Disk I/O error on /dev/sda: 1 sector currently unreadable (pending)
🏷️ Container CT 9005: ❌ failed to start
🏷 Container CT 9004: ❌ failed to start
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Container CT 9004: ❌ failed to start
🏷️ Container CT 9002: ❌ failed to start"""