Major enhancements to backup monitoring accuracy and user experience:
## Core Fixes
- **Fix timestamp precision loss**: PVE/PBS age filtering now shows correct times (17h vs incorrect 36h)
- **Server-side deduplication**: Shared storage backups no longer counted multiple times
- **Client-side deduplication**: Calendar drill-down shows each guest only once per date
- **Clean UI**: Removed redundant backup count numbers when type badges are shown
## Technical Implementation
- Added `latestTimes` object with type-specific timestamps to guest data structure
- Implemented `deduplicateStorageBackups()` function using volid-based deduplication
- Enhanced calendar-heatmap processing to merge duplicate guest entries by vmid
- Updated backup detail card to use direct timestamp lookup instead of date aggregation
## Files Modified
- `server/dataFetcher.js`: Added shared storage deduplication logic
- `src/public/js/ui/backups.js`: Enhanced guest data with type-specific latest times
- `src/public/js/ui/backup-detail-card.js`: Fixed age calculation and removed redundant counts
- `src/public/js/ui/calendar-heatmap.js`: Implemented client-side guest deduplication
- `docs/BACKUP_ARCHITECTURE.md`: Documented pragmatic solution approach
## Result
- Accurate backup ages when filtering by PVE/PBS/Snapshots
- No more duplicate counting from shared storage (NFS, Ceph, etc.)
- Clean calendar view with single guest entries per date
- Foundation for future backup system enhancements
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Major Development Environment Improvements
### Integrated Development Mode
- Modified systemd service to use 'npm run dev' for complete development stack
- Concurrently runs both development server and Tailwind CSS watcher
- Automatic CSS rebuilding when Tailwind classes change
- Seamless hot reload for frontend, backend, and CSS changes
### Hot Reload Enhancements
- Always attempt to load chokidar for development convenience
- Enhanced file watcher initialization with better error messaging
- Added debug logging for NODE_ENV detection and chokidar availability
- Improved development experience with real-time change detection
### Development vs Production Distinction
- Development: systemd runs 'npm run dev' with NODE_ENV=development
- Production: installer creates service running 'node server/index.js' with NODE_ENV=production
- Clear separation between development and production environments
- Updated CLAUDE.md with integrated development mode documentation
### UI and Configuration Updates
- Removed DEV branding from title and header (development-specific cleanup)
- Added CLAUDE.md to .gitignore (development reference file)
- Restored proper RC branding for release candidate version
### Development Workflow Optimization
- No more manual 'npm run build:css' commands needed
- Complete hot reload: frontend JS → browser reload, CSS changes → auto-rebuild → browser reload
- Production-ready systemd service management with PolicyKit
- Optimal development experience with automatic toolchain management
This creates a seamless development environment where any change to Tailwind classes
automatically rebuilds CSS and triggers browser reload, while maintaining proper
production deployment through the existing install script.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Update PBS connectivity check endpoint for better compatibility
- Make alert checking asynchronous to prevent blocking
- Update test expectations for webhook error messages with retry counts
- Enhance alerts handler with better event listeners and error handling
- Improve PBS UI by replacing symbols with clearer text labels
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
## 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>
- 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>
- 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>
- 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>
The smart cluster handling prevented endpoint duplication but individual
node resource fetching was still sequential and blocking. This adds:
- Promise.allSettled for parallel node resource fetching
- 8-second timeouts on individual resource requests
- Proper error handling for failed resources
This should completely eliminate dashboard freezes when nodes go offline.
Addresses issue #104 follow-up
- 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>
- 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>
- Fix host/port field confusion with clear guidance text
- Implement form data preservation between PVE and PBS tab switches
- Add smart URL parsing to extract hostnames from full URLs
- Ensure save button captures configuration from all tabs
- Improve configuration loading to handle both structured and flat formats
- Fix Docker config directory detection logic
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add cluster membership detection to identify same-cluster endpoints
- Implement endpoint prioritization with failover support
- Eliminate data duplication by using only one endpoint per cluster
- Maintain backward compatibility with existing configurations
- Add caching for cluster membership detection (5min TTL)
This resolves the core issue where users configure multiple endpoints
for the same cluster, causing blocking timeouts and data duplication.
Now only the primary endpoint is used, with automatic failover to
backup endpoints when needed.
Addresses issue #104
- Updated /api/version endpoint to use UpdateManager instead of hardcoded stable-only checks
- Removed obsolete checkLatestVersion() function that only checked stable releases
- Footer now correctly shows updates only for user's selected channel (stable or RC)
- Eliminates false "update available" notifications when RC versions exist but user is on stable channel
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Removed UPDATE_CHANNEL from main .env file to eliminate conflicts with frontend settings management
- Updated configLoader.js to read UPDATE_CHANNEL from config/.env (where frontend saves settings) instead of main .env
- Now defaults to 'stable' channel when no frontend setting is configured
- Frontend can fully manage update channel preference without .env conflicts
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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
- Skip npm install since release tarballs already include node_modules
- Better validation of update package structure
- Improved error handling and logging
- Use Node.js fs operations instead of shell commands for better cross-platform support
This should eliminate npm errors during auto-update process.
- Changed Promise.all to Promise.allSettled to prevent one offline endpoint from blocking all others
- Added intelligent node deduplication that prefers online nodes with fresh data
- Implemented 5-second timeout for discovery calls to fail fast
- Added 1-minute cache to preserve node state during brief outages
- Fixed transition states to avoid "red dot with online status" issue
This addresses issue #104 where:
- Dashboard would freeze when primary node went offline
- Nodes were duplicated when multiple endpoints pointed to same cluster
- Dashboard stopped updating during node reboots
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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>
Fixes two webhook-related problems reported in issue #119:
- Webhook checkbox not persisting after save due to config not being included in API response
- 400 errors during webhook testing due to incorrect form data binding
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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>
- 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>
Enhanced backup health status calculations with more accurate age-based
categorization and improved UI filtering. Added comprehensive backup data
validation test suite and ground truth testing framework.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
## Test Coverage Achievements
- **apiClients.js**: 100% statement coverage ✅
- **configLoader.js**: 100% statement coverage ✅
- **pbsUtils.js**: 100% statement coverage ✅
- **Overall coverage**: 77.97% (up from 77.83%)
- **All tests passing**: 116/116 ✅
## Key Improvements
### Jest Configuration
- Fix Jest configuration to use V8 coverage provider instead of Babel
- Resolve Babel/Istanbul errors that were preventing tests from running
- Add `testEnvironment: "node"` and `coverageProvider: "v8"` settings
### Test Coverage Enhancements
- **pbsUtils.js**: Export and test `categorizeAndCountTasks` function for complete coverage
- **configLoader.js**: Add test for config directory loading path
- **dataFetcher.js**: Add defensive null checking for API clients and comprehensive test fixes
- **All test files**: Update test expectations to match current application behavior
### Test Reliability
- Fix config tests to match new setup mode behavior instead of error throwing
- Update dataFetcher tests for correct API call sequences and error messages
- Add proper mock data for backup functionality testing
- Resolve test flakiness with proper async handling
### Code Quality
- Add null safety check in dataFetcher for missing API client endpoints
- Export previously internal function for better testability
- Maintain backward compatibility while improving robustness
## Files Changed
- `package.json`: Update Jest configuration
- `server/pbsUtils.js`: Export categorizeAndCountTasks function
- `server/dataFetcher.js`: Add null client validation
- `server/tests/*.test.js`: Comprehensive test updates and additions
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix PVE backup task classification logic that incorrectly defaulted to PBS when log parsing failed
- Implement proper separation between PVE backups (actual backup files) and snapshots (point-in-time states)
- Add cross-node backup matching within clusters while maintaining cross-cluster isolation
- Resolve duplicate guest display issue caused by identical guest IDs across different Proxmox clusters
- Remove reliance on unparseable job-level backup tasks in favor of actual backup file detection
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- 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>
- 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>
- 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>
- Client now uses 'auto-detect' placeholder when node can't be determined
- Server handles node auto-detection by looking up VM/LXC in current state
- Fixes 'Please select a VM/LXC from the dropdown first' error in v3.17.3
- Addresses issue #110
- Add sanitization for name fields in Proxmox and PBS configurations
- Sanitize PBS node_name values to prevent leaking actual node names
- Improve URL sanitization to handle URLs without protocols
- Use clearer redaction patterns (REDACTED-IP, REDACTED-HOST)
- Add more aggressive fallback sanitization for malformed URLs
This prevents exposure of sensitive infrastructure details when diagnostic
reports are shared for debugging purposes.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Fix download URL property mismatch (downloadUrl vs browser_download_url)
- Add comprehensive error logging for update failures
- Create test mode for update mechanism (UPDATE_TEST_MODE=true)
- Add test script for easy update testing without releases
- Improve restart logic for different deployment environments
- Add tar package dependency for creating update packages
- Update .gitignore to exclude backup and temp directories
- Add documentation for update testing workflow
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Change config loader to set name to null instead of host address when no custom name is provided
- This ensures discovered node names are used by default
- Custom names are only applied when PROXMOX_NODE_NAME is explicitly set
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add support for custom display names via PROXMOX_NODE_NAME configuration
- Handle multi-node clusters properly by prefixing node names with endpoint name
- Fix dashboard and nodes views to show configured display names
- Fix non-sequential endpoint numbering issue in settings (node_2, node_8, node_14)
- Improve endpoint configuration loading to handle any index number
Fixes#100🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Strip http:// or https:// from PBS_HOST values in settings form
- Update placeholders to show IP/hostname format without protocol
- Fix discovery cycle to trigger for PBS-only configurations
- Resolves issue where PBS data wouldn't load due to malformed host URL
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Previously, the config loader required sequential numbering (2, 3, 4...) for additional Proxmox/PBS endpoints. If a user had PROXMOX_HOST_2 and PROXMOX_HOST_4 (skipping 3), only endpoint 2 would be loaded.
This fix scans all environment variables to find any PROXMOX_HOST_N or PBS_HOST_N patterns, regardless of numbering sequence. Now users can have endpoints numbered 2, 5, 10, etc. and all will be properly loaded.
Fixes#96🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add validation to prevent API calls with missing nodeId/vmid parameters
- Implement proper guest selector initialization for edit modal
- Add server-side error handlers to return JSON instead of HTML for API routes
- Include debug logging for threshold configuration troubleshooting
- Ensure dropdown selection properly populates all required hidden fields
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
• 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>
Previously, configuration created via the web UI was lost when containers were
recreated or updated, requiring users to reconfigure each time. This was due to
the .env file being stored inside the container filesystem.
Changes:
- Add persistent volume mount for configuration directory in docker-compose.yml
- Update ConfigApi to auto-detect Docker vs development environment
- Configure dotenv loading to use persistent config path when available
- Update file watcher to monitor correct .env file location
- Remove conflicting host .env file mount
- Update README with new volume configuration instructions
Configuration now persists across container updates, eliminating the need for
users to reconfigure after updates.
Fixes#94🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Previously, adding additional PVE credentials would remove all existing PBS
credentials from the .env file, and vice versa. This was caused by the credential
removal logic not checking if the new configuration actually contained endpoints
of the same type before removing existing ones.
The fix ensures that:
- PBS credentials are preserved when adding additional PVE endpoints
- PVE credentials are preserved when adding additional PBS endpoints
- Existing endpoints are only removed when explicitly managing that endpoint type
Fixes#91🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements comprehensive solution for GitHub issue #80 where PVE backups stored on local node storage weren't appearing in the backup tab. Adds intelligent node discovery system that creates direct connections to access node-local storage while maintaining backward compatibility with shared storage setups.
Key improvements:
- Hybrid discovery approach with automatic node IP detection and connection caching
- Fixed data structure mismatches and key collision issues for duplicate VMIDs across nodes
- Corrected PVE backup filtering logic in summary cards and calendar views
- Enhanced API token permission documentation for storage content access
- Optimized connection handling with reduced timeouts for faster discovery cycles
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>