Commit Graph

95 Commits (10e646a26acae0a43d5b2190cc7ef990a30d6c98)

Author SHA1 Message Date
mirivlad 10e646a26a Fix skipChart logic for JS generation 2026-04-26 19:35:09 +08:00
mirivlad 474836e077 Fix missing endif for nested if 2026-04-26 19:32:35 +08:00
mirivlad b54b3a55d5 Fix Twig syntax in JS code generation 2026-04-26 18:26:32 +08:00
mirivlad 45c40aa86c Add null checks before getContext calls 2026-04-26 18:26:05 +08:00
mirivlad 08a137fdf0 Fix JS syntax in temperature chart loop 2026-04-26 18:24:41 +08:00
mirivlad 3f94d84d7c Fix Chart.js CDN link with version 2026-04-26 18:23:14 +08:00
mirivlad b5dca74101 Fix template endif/endfor structure 2026-04-26 18:20:39 +08:00
mirivlad eed4dbd6f9 Fix: temperature/network/disk chart display and simplify tooltips 2026-04-26 18:19:22 +08:00
mirivlad e4b037d02c Exclude net_*, temp_*, disk_used_* from main metrics section 2026-04-26 16:53:05 +08:00
mirivlad fb6c7d544f Fix network/temp charts - use displayMetrics for selection
- Network: iterate over displayMetrics to find interfaces
- Temperature: filter by displayMetrics before rendering
- Show all selected temps on single chart
2026-04-26 16:44:03 +08:00
mirivlad 53ecf8bc9a Fix temperature - always show if 1+ temp selected 2026-04-26 15:42:42 +08:00
mirivlad 0f519960c3 Fix template endif structure - match if/endif count 2026-04-26 15:30:01 +08:00
mirivlad 023c441e66 Fix metric display: remove fallback, add displayMetrics check
- Remove hardcoded fallback metrics in visibleMetrics
- Add message 'Choose metrics in server settings' if displayMetrics is empty
- Update disk/temp/network sections to use displayMetrics
- Add grouped metrics (diskMetrics, tempMetrics, netInMetrics, netOutMetrics)
- Only display metrics that user selected in server settings
2026-04-26 15:19:36 +08:00
mirivlad c4f3a1388d Fix query and display metrics
- Remove LIMIT 200000 from SQL - GROUP BY handles aggregation
- Pass displayMetrics to template
- Replace hardcoded filters with visibleMetrics array
- If displayMetrics is set in server settings, show only selected metrics
- Otherwise show default metrics (backward compatibility)
2026-04-26 14:13:36 +08:00
mirivlad 393edebee6 Fix json_decode in Twig - decode in controller instead 2026-04-25 19:58:22 +08:00
mirivlad e20354e89d Add display_metrics setting per server
- 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
2026-04-25 19:54:00 +08:00
mirivlad 9b7e5afd4f Fix dynamic zoom loading and tooltips
- 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
2026-04-25 19:00:44 +08:00
mirivlad 36ace1e9d2 Add dynamic metric loading on chart zoom
- 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
2026-04-25 16:45:09 +08:00
mirivlad 66d4d021ba Fix tooltips and uptime chart issues
- 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
2026-04-25 16:36:14 +08:00
mirivlad 3fecc21565 feat: Fix CPU tooltip, add uptime widget, exclude uptime from charts
- Fix CPU tooltip to show percentage value
- Add uptime widget to server detail page (right column)
- Exclude uptime metric from charts in two places
2026-04-20 11:54:00 +08:00
mirivlad cb74973a90 fix: Icon picker modal reopens after selection
- Use Bootstrap event dispatch instead of manual hide
- Let Bootstrap manage modal state properly
- Clean backdrop only in hidden.bs.modal event
2026-04-17 19:50:32 +08:00
mirivlad 6e54615d54 fix: Use Bootstrap API and delayed backdrop removal 2026-04-17 19:48:57 +08:00
mirivlad 4f407c0d46 fix: Modal backdrop not removed after icon selection
- Manually remove backdrop and modal classes on selectIcon
- Add hidden.bs.modal listener to clean up backdrop
2026-04-17 19:46:59 +08:00
mirivlad d652e24ad0 fix: Icon picker duplicate variable declaration
- Add guard to prevent double initialization
- Remove duplicate currentTargetInput declaration
2026-04-17 19:43:37 +08:00
mirivlad e9d2fcf1c0 fix: Delete via GET instead of AJAX
- Use GET /{id}/delete instead of DELETE
- Simple link with confirm() instead of fetch
- Removed CSRF for delete routes
2026-04-17 19:05:47 +08:00
mirivlad d5318f7e16 fix: Delete groups/servers using fetch with CSRF header
- Create CsrfHeaderMiddleware to read X-CSRF-TOKEN header
- Replace form submit with JavaScript fetch for DELETE operations
- Send CSRF token in X-CSRF-TOKEN header
- Fix groups/index.twig and servers/index.twig delete buttons
2026-04-17 18:59:12 +08:00
mirivlad 1ab4bcd697 feat: Visual icon picker for groups
- 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
2026-04-17 18:50:09 +08:00
mirivlad e8e922b845 fix: Add missing 'fas' prefix to group icon class 2026-04-17 17:38:11 +08:00
mirivlad 4766d4511e fix: Accordion toggle with proper cookie handling 2026-04-17 17:36:05 +08:00
mirivlad 32894447f3 fix: Manual accordion toggle without Bootstrap events
- 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
2026-04-17 17:32:51 +08:00
mirivlad 68cb135322 fix: Add Bootstrap JS for collapse to work
- Added bootstrap.bundle.min.js to layout.twig
- Added debug logging to accordion JS
- Fixed icon update logic
2026-04-17 17:30:49 +08:00
mirivlad 98f6244eb3 fix: Accordion icon toggle using Bootstrap events
- 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
2026-04-17 17:26:34 +08:00
mirivlad 4a8a2d66fb feat: Store accordion state in cookies
- 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
2026-04-17 17:23:25 +08:00
mirivlad 3872d1df30 feat: Enhanced dashboard with group colors, metric icons and AJAX update
- 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
2026-04-17 16:52:13 +08:00
mirivlad d5338b1fc2 fix: Dashboard twig empty check 2026-04-17 16:26:36 +08:00
mirivlad 5f42375195 feat: Redesign dashboard with compact cards and groups
- 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
2026-04-17 16:19:17 +08:00
mirivlad d03aff714f feat: Add offline monitoring and default settings
- Add offline_timeout and notify_on_offline fields to servers table
- Create default_settings table for configurable defaults
- Create offline_alerts table for tracking offline events
- Add sendOfflineNotification/sendOnlineNotification methods
- Create check_offline.php CRON script for periodic checks
- Add admin page for default settings management
- Add offline settings to server edit form
- Apply default values when creating new servers

Usage: Add to CRON - * * * * * php /var/www/mon/public/check_offline.php
2026-04-17 15:22:17 +08:00
mirivlad c8d0bc4a40 security: Require explicit token for agent downloads
- 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()
2026-04-17 09:55:45 +08:00
mirivlad bce4c2e2d0 fix: Update agent install, disk metrics, fallback blocks, and dynamic thresholds
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
2026-04-17 09:25:43 +08:00
mirivlad 99761ca5d8 feat: добавить установку Windows-агента через .bat (обход ExecutionPolicy, двойной клик)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 04:54:25 +08:00
mirivlad c2c9934ff8 feat: добавить установку агента для Windows Server 2012+ (PowerShell скрипт, Scheduled Task, авт. установка Python)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 04:31:20 +08:00
mirivlad 808b7c7d1e feat: добавить фавикон (монитор с графиком)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 04:07:49 +08:00
mirivlad ade719f3e0 fix: сохранять пороги частично (warning/critical отдельно), flash сообщение с подробностями
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 03:37:13 +08:00
mirivlad ce577c5d51 feat: объединить все температурные метрики (temp_*) в один график с разными цветами, вернуть сетевые графики
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 03:13:03 +08:00
mirivlad dbd71e3485 fix: removed network rx/tx charts, ensured single temp chart
- Excluded network_rx and network_tx metrics from main metrics loop
- Removed separate network interface charts
- Verified single combined Temperatures chart (chart-temperatures) exists and is initialized
2026-04-14 01:52:03 +08:00
mirivlad de34962360 feat: добавлен мониторинг температур (CPU, GPU, HDD/SSD)
- Обновлен скрипт установки агента (добавлены lm-sensors, smartmontools)
- Агент теперь собирает температуры: CPU (через psutil), Диски (smartctl), GPU (nvidia-smi)
- Бэкенд автоматически определяет единицу измерения °C для метрик temp_*
- Добавлен общий график Температуры на страницу сервера
2026-04-14 01:21:59 +08:00
mirivlad 8d4a789e00 feat(dashboard): бесшовное обновление данных без перезагрузки страницы
- Добавлен API endpoint /api/dashboard/stats
- Реализована замена location.reload() на fetch() каждые 30 секунд
- Добавлены ID к элементам метрик для точечного обновления
- Убрано мерцание страницы при обновлении
2026-04-14 00:38:43 +08:00
mirivlad e985bb2c34 fix(dashboard): скрытие блока диска если метрики отсутствуют
- Исправлена проверка diskMetric: теперь проверяется реальное наличие значения, а не только defined
- Блок диска больше не показывается для серверов без метрик (например Work_PC)
2026-04-14 00:19:18 +08:00
mirivlad 7c597457ce fix: очистка поля пароля при редактировании пользователя 2026-04-13 23:49:09 +08:00
mirivlad 741fd56879 fix(dashboard): исправлен синтаксис Twig для отображения корневого раздела
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 23:19:02 +08:00