Commit Graph

27 Commits

Author SHA1 Message Date
rcourtman 1d35f1df91 refactor: remove alert escalation system
Remove escalation functionality from alert management system including:
- Remove escalationTime configuration from alert rules
- Remove escalation checking and processing logic
- Remove escalation UI indicators and notifications
- Clean up escalation-related state management
- Remove escalation socket events and handlers

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-13 09:01:37 +01:00
rcourtman ef20ca2540 refactor: consolidate alert acknowledgements and fix hot reload triggers
- Eliminate redundant acknowledgements.json file by storing acknowledgement data in active-alerts.json
- Update alert manager to load acknowledgements from active alerts on startup
- Remove acknowledgements.json from hot reload ignore patterns
- Reduce file I/O operations and eliminate data duplication in alert system

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-11 16:54:06 +01:00
rcourtman 11a0107ddf fix: resolve circular reference errors and add acknowledgment tracking
- Add missing createSafeRuleCopy method to prevent circular references in alert serialization
- Add acknowledgment events to alert history for visibility in recent activity
- Enhance email configuration loading and alert system reliability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-11 14:57:01 +01:00
rcourtman e16b520f15 feat: remove severity levels and simplify alert system
Eliminate all severity classifications (warning, critical, info) to create a simpler, more focused alert system where alerts are treated uniformly.

Changes:
- Remove severity-based logic from server-side alert processing
- Simplify email and webhook notifications to use consistent styling
- Remove severity dropdowns and badges from UI components
- Update alert display to use unified red styling for all alerts
- Eliminate severity-based filtering and escalation logic
- Simplify custom threshold system to single threshold values
- Remove severity validation and defaults from rule creation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 23:30:42 +01:00
rcourtman d34ebeac53 feat: comprehensive alert system simplification and UI improvements
- Simplified alert rules: removed warning/critical levels, now one rule per metric type
- Unified alert editing: all rules (built-in and custom) use same modal template
- Enhanced UI: show actual thresholds/conditions in rules list without clicking edit
- Fixed Create Rule button: changed from event listener to direct onclick approach
- Fixed disabled rules visibility: disabled rules now stay in list with toggle off
- Removed redundant labels: eliminated "Enabled/Disabled" badges (toggle shows state)
- Updated alert summary cards: replaced Critical/Warning/Info with Active/Acknowledged/Rules/Status
- Improved UX: consistent editing experience across all alert types
- Cleaned up duplicate code: removed separate modal templates for system vs custom alerts

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-10 18:17:08 +01:00
rcourtman e37963e4ff feat: comprehensive alert system improvements and UI enhancements
- Fixed circular reference errors preventing WebSocket communication
- Added alert count badges to all alert rules (system and custom)
- Made global email/webhook toggles act as true master switches
- Fixed email toggle not saving to .env file
- Added proper notification channel indicators for both system and custom alerts
- Fixed system alert enable/disable functionality with correct ID mapping
- Improved alert display clarity:
  - Shows actual rule names for custom alerts
  - Displays rule conditions to identify which rule triggered
  - Removed redundant details button and popup
  - Added triggered time and escalation status directly to cards
- Fixed email configuration not displaying in UI
- Made notification checkboxes disable when global settings are off
- Improved UI text clarity (removed confusing 'optional overrides' language)
- Enhanced auto-refresh for real-time alert updates

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 22:23:17 +01:00
rcourtman 4452b27655 fix: resolve circular reference errors in alert system
- Fixed undefined guest.type errors in generateAlertMessage by adding proper null checks
- Separated notification status from alert objects to prevent circular references during serialization
- Added comprehensive error handling with fallback data when alert serialization fails
- Improved alert state management to track notification status separately
- Fixed alert display issues in UI by ensuring proper data structure
- Added debugging helpers for troubleshooting serialization issues
- Cleaned up console logging and removed development artifacts

These changes resolve the "Converting circular structure to JSON" errors that were
preventing alerts from being properly displayed and managed in the UI.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-09 16:15:56 +01:00
root 33412d4f8e feat: enhance alert system with improved debugging and reliability
## Major Improvements

### Alert Threshold Calculation Fix
- Fixed compound threshold rules to properly calculate disk usage percentages
- Resolved issue where raw bytes were compared against percentage thresholds
- Consistent behavior between single-metric and compound threshold rules

### Enhanced Debugging & Error Handling
- Added environment-controlled debug logging with ALERT_DEBUG=true
- Comprehensive error messages with specific property validation context
- New /api/alerts/debug endpoint for threshold evaluation testing
- Clear feedback on missing/invalid threshold properties

### Alert Management UI Fixes
- Fixed alert editing to properly pre-populate form values
- Support for both old (type/value) and new (metric/threshold) property formats
- Unified threshold population logic for dashboard presets and existing alerts
- Clean alert message display with correct percentage values

### Hot Reload Improvements
- Excluded runtime data files (alert-rules.json, acknowledgements.json) from hot reload
- Prevents page refreshes when creating/deleting alerts
- Better development experience with targeted file watching

### Code Quality & Maintainability
- Consistent property naming throughout (metric/condition/threshold)
- Input validation with descriptive error messages
- Backward compatibility maintained for existing alerts
- Production-ready with clean, optimized code

## Technical Changes
- Server: Enhanced AlertManager validation and evaluation logic
- Client: Fixed threshold population and property mapping
- Debug: Environment-based logging and API endpoints
- DevEx: Improved hot reload exclusions

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-07 18:36:19 +01:00
root 15519bf54f fix: correct disk usage percentage calculation in compound threshold rules
- Fixed evaluateThresholdCondition() to calculate disk percentage using (disk / maxdisk) * 100
- Fixed getThresholdCurrentValue() to display disk percentage correctly in alerts
- Updated formatCompoundThresholdMessage() to pass guest parameter for accurate calculations
- Now compound threshold rules properly compare percentage values against percentage thresholds
- Resolves issue where 78% disk threshold wasn't triggering due to comparing raw bytes vs percentage

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-07 18:04:55 +01:00
courtmanr@gmail.com bd9a976100 feat: enhance system reliability with DNS resilience and advanced alerting
- Implement resilient DNS resolution for API calls with fallback mechanisms
- Add compound threshold alert rules with multi-metric evaluation
- Enable immediate alert evaluation when rules are enabled
- Add alert rules file watching for dynamic configuration updates
- Improve alert state management with proper resolution handling
- Include comprehensive testing and documentation for DNS features

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-07 15:46:04 +01:00
courtmanr@gmail.com 648dd5f9e0 feat: implement immediate alert evaluation when enabling rules
- Enhanced refreshRules() to trigger immediate evaluation of current state
- Added evaluateCurrentState() method to check existing conditions without duration delays
- Added API endpoints for alert evaluation and rule reloading
- Improved alert management modal with better status loading and configuration
- Fixed async handling in config API for rule refreshing
- Added immediate alert creation for down alerts when re-enabling rules

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-05 22:31:59 +01:00
courtmanr@gmail.com 47c4541a51 feat: refine threshold alert system with improved UI and functionality
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-05 09:48:22 +01:00
courtmanr@gmail.com 6b0024f1ee feat: implement dynamic threshold alerts with unified rule system
- Add visual threshold-to-alert conversion feature in dashboard filtering UI
- Implement compound threshold rules that support multiple metrics with AND logic
- Enhance existing AlertManager to handle both single-metric and compound threshold rules
- Add dynamic alert rule creation modal with step-by-step configuration
- Implement comprehensive rule management (view, enable/disable, delete)
- Add real-time evaluation of compound threshold rules in main metrics processing loop
- Create compound rule API endpoints integrated with existing alerts system
- Add smart threshold summary display and button state management
- Support email/webhook notifications for compound threshold rule violations
- Maintain backward compatibility with existing single-metric alert rules

This bridges the gap between visual filtering and automated alerting, allowing users to
convert their threshold filtering criteria into persistent monitoring rules with a
seamless user experience.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-04 20:37:36 +01:00
courtmanr@gmail.com a8fc9e0d61 feat: enhance email notifications setup with user-friendly provider selection
- Add step-by-step email configuration with provider presets (Gmail, Outlook, Yahoo)
- Implement auto-detection of email providers based on email domain
- Provide provider-specific setup instructions and App Password guidance
- Add collapsible advanced settings to hide technical SMTP details
- Fix SSL/TLS configuration for Gmail (use STARTTLS instead of SSL)
- Improve SMTP transporter configuration with requireTLS and better error handling
- Add comprehensive provider help sections with clear instructions
- Fix configuration persistence by properly including SMTP settings in config API
- Enhance security by not exposing passwords in API responses

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-04 20:11:31 +01:00
courtmanr@gmail.com bb4a06d1bb feat: implement sudoless update system with polkit integration
- Add polkit rule for sudoless service management
- Improve update manager with multi-strategy restart approach
- Fix npm dependency conflicts in update process
- Add comprehensive test suite for update system
- Enhance frontend update progress tracking
- Update install script with automatic polkit setup
2025-06-04 15:20:00 +01:00
courtmanr@gmail.com ce9b1bb2e1 feat: improve alert manager functionality and testing 2025-06-04 10:52:10 +01:00
courtmanr@gmail.com 3237f24610 fix: webhook configuration persistence and Discord 400 errors
- Add webhook configuration to structured config response in configApi
- Update settings UI to properly display webhook enabled state
- Fix Discord webhook 400 errors by sending platform-specific payloads
- Detect webhook type (Discord/Slack) and send appropriate format
- Preserve webhook settings when saving configuration
- Update both test webhook and alert webhook sending logic

Fixes #119

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-03 19:31:07 +01:00
courtmanr@gmail.com f4aaea1f53 fix: enhance webhook timestamp validation and add comprehensive tests
- Add robust timestamp validation with getValidTimestamp() method
- Handle invalid timestamp values gracefully with fallback to current time
- Prevent RangeError when Date constructor receives invalid values
- Add comprehensive AlertManager test suite with 12 test cases
- Test webhook payload structure, timestamp handling, and error scenarios
- Verify Discord/Slack compatibility and email notification fixes
- Increase AlertManager test coverage from 0% to 40.11%

Fixes #114 completely with bulletproof timestamp handling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-02 18:05:26 +01:00
courtmanr@gmail.com 78d6f7ff15 fix: resolve remaining Teams webhook timestamp errors
- Fix remaining alert.timestamp references in email notifications and Discord/Slack embeds
- Replace with alert.triggeredAt || alert.lastUpdate || Date.now() pattern
- Resolves RangeError when sending webhook notifications to Teams
- Fixes issue #114 completely

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-02 18:01:21 +01:00
courtmanr@gmail.com 3775b4d68a fix: resolve webhook notification timestamp error and improve scroll timing
- Fix RangeError in AlertManager by using correct timestamp fields (triggeredAt/lastUpdate) instead of non-existent alert.timestamp
- Replace Promise.resolve() with requestAnimationFrame() for better scroll position restoration timing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-02 16:53:49 +01:00
courtmanr@gmail.com ab88beee2e feat: add dynamic alert rule management with cleanup for disabled types
- Add refreshRules() method to AlertManager for dynamic rule updates
- Add cleanupAlertsForRule() to remove active alerts when rules are disabled
- Modify configuration reload to trigger alert rule refresh
- Add getAlertManager() method to state module for consistent access
- Existing alerts are now properly cleaned up when global alert types are disabled
- Changes take effect immediately without requiring server restart

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-01 22:35:30 +01:00
courtmanr@gmail.com 7c21d73844 feat: implement webhook notifications for alerts
- Add comprehensive webhook support for Discord, Slack, Teams
- Rich embeds with color-coded severity and inline fields
- Webhook configuration UI with test functionality
- Dual payload format (Discord embeds + Slack attachments)
- Error handling with timeout and proper HTTP responses
- Test webhook endpoint with sample alert data

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-01 21:16:47 +01:00
courtmanr@gmail.com cacad13af9 fix: correct nodemailer method name from createTransporter to createTransport
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-01 21:08:16 +01:00
courtmanr@gmail.com 29889e5e10 feat: implement email notifications for alerts
- Add nodemailer dependency for SMTP email sending
- Implement email notification channel in AlertManager
- Add rich HTML email templates with alert details
- Create email configuration UI in settings page
- Add test email functionality with validation
- Support for multiple recipients and Gmail app passwords
- Addresses feature request in issue #111

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-01 21:03:28 +01:00
courtmanr@gmail.com bdf7bc926f feat: consolidate alert functionality into unified Alert Configuration tab
• Merge separate "Alerts" and "Custom Thresholds" tabs into single "Alert Configuration" tab
• Improve UX by organizing all alert settings in one logical location
• Add comprehensive custom per-VM/LXC threshold management system with migration support
• Include blue "T" badges for VMs with custom thresholds in dashboard
• Implement full CRUD operations for threshold configurations via REST API
• Support migration-aware threshold keys (endpointId:vmid) for cluster environments

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-31 11:32:16 +01:00
courtmanr@gmail.com fa450522a8 feat: add remaining updates from development
- Update alert manager functionality
- Update HTML structure and components
- Enhance main.js initialization
- Improve socket handler communication
- Update nodes UI component

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-28 00:20:31 +01:00
courtmanr@gmail.com d99272d665 Feat: Add new modules for server-side alerting, metrics history, and frontend chart/alert handling 2025-05-24 22:02:25 +01:00