- Add display_metrics JSON field to servers table
- Update server edit form with metric checkboxes
- ServerDetailController now uses server's display_metrics setting
- If no metrics selected - show all (backward compatibility)
- Removed hardcoded metric names from queries
- Use subquery to limit raw rows before aggregation
- Filter only essential metrics (not all 66)
- Add LIMIT 200000 to inner query for large date ranges
- Improves 7d and 30d query time from 40s to 4s
- Use subquery to limit raw data before aggregation
- Prevents loading millions of rows for 30d view
- Limit 5000 rows for non-aggregated queries
- Fixes 504 timeout errors
- Fix API date parsing for d.m H:i format
- Update labels variable after loading new data for tooltips
- Ensure tooltips work correctly after zoom reload
- Add onZoomComplete callback to charts
- When zoomed to < 100 points, load detailed data from API
- Add loadDetailedMetrics function per chart
- API returns aggregated data (max 500 points) for zoomed range
- Improves performance while preserving detail on zoom
- Fix tooltip data access: use chart data instead of API response
- Exclude uptime from metrics charts (SQL and template filters)
- Fix fetchProcesses() time format handling
- Add try-catch and proper Response handling in getProcesses API
- Fix Slim Response write() chaining issue
- Add last_seen to server query
- Add icon-picker-modal partial with 200+ Font Awesome icons
- Search filter with typeahead functionality
- Grid layout (6 icons per row)
- Click icon to select and close modal
- Icon preview updates in real-time
- Integrated into group create/edit forms
- Removed data-bs-toggle="collapse" to prevent Bootstrap interference
- Handle click manually: toggle class "show" and update icon
- Cookie stores 'expanded'/'collapsed' state per group
- Chevron icon updates correctly on click
- Use hidden.bs.collapse and shown.bs.collapse events instead of click
- Icons now toggle correctly between up/down chevrons
- Cookie state properly saved on toggle
- Accordion state (collapsed/expanded) saved to cookies per group
- Chevron icon toggles correctly (up/down)
- State persists across page reloads for 30 days
- First accordion group opens by default
- Accordion header color matches group color from settings
- CPU/RAM/DISK now use Font Awesome icons (microchip, memory, hdd)
- Icon colors change based on threshold status (red/yellow/green)
- AJAX refresh updates values every 30 seconds without page reload
- Added IDs to metric elements for targeted updates
- Add uptime metric collection in agent.py
- Group servers by groups with accordion
- Compact cards layout (4-6 per row)
- Status dot indicator (green/yellow/red)
- CPU/RAM/Disk mini progress bars
- Uptime display (days/hours/minutes)
- Color-coded left border by status
- Remove auto-creation of thresholds for new metrics
- Only apply defaults when threshold record exists but value is NULL
- Delete erroneous alerts for GB/Network metrics
- Initialize _prev_net_io on first call for all interfaces
- Calculate metrics from second call onwards
- This ensures metrics are captured starting from cycle 2
Network:
- Remove speed > 0 check in _is_real_interface()
- Use 1000 Mbps default for interfaces with speed=0
- This allows virtual interfaces (ens3) to be detected
- Remove network_rx/network_tx (no longer needed)
Disk:
- Rewrite get_disk_metrics() to detect unique devices
- If only one device (/) - create only disk_used_root
- If multiple devices - create for each
- This fixes VPS with single disk showing same % for all mounts
- Remove server_id auto-resolution from validateAndGetToken()
- Links in edit.twig now use token instead of server_id
- Add agent_token retrieval in ServerController::edit()
- Add validateAndGetToken() method for token validation
- All install scripts (sh, ps1, bat) now require valid token
- Also update Windows scripts to use /get-agent endpoint with token
- Move /get-agent route before auth groups to ensure it's public
- Fix path resolution in downloadAgent() - dirname(__DIR__, 2) from controller = /var/www/mon/
- Fix withStatus() return value issue in downloadAgent()
- Use /get-agent endpoint instead of /agent/agent.py (nginx issue with .py files)
- Update install.sh to use /get-agent URL
Problem: PHP was interpolating bash variables like $INSTALL_DIR
as empty PHP variables. Fixed by using PHP variables in single
quotes: '{$installDir}' instead of "$INSTALL_DIR"
BREAKING: install.sh now downloads agent from server instead of embedding it
Changes:
- AgentController: downloadAgent() method for serving agent.py with token auth
- AgentController: rewrite generateInstallScript() to curl agent from server
- agent.py: copy production version from server (with temp, disk, network metrics)
- agent.py: fix get_disk_metrics() to use priority mountpoints (/, /home, etc)
- agent.py: fix disk_total_gb collection to use priority mountpoints
- detail.twig: add fallback blocks for temperatures (alert-info)
- detail.twig: add fallback blocks for disk doughnuts (alert-warning)
- detail.twig: add fallback blocks for network graphs (alert-warning)
- detail.twig: add null check for ramTotalGB in tooltip
- detail.twig: improve thresholds form with human-readable labels and units
- ServerDetailController: query only metrics that exist on server and display on graphs
For server 3 (mirv.top):
- After deploy, download new install.sh and reinstall agent
- This will add disk_used_root, ram_total_gb, temperatures support
- deploy.sh: auto-install docker, generate random passwords, start
- .env removed from git, added to .gitignore and .dockerignore
- Secrets are now local-only
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>