Commit Graph

16 Commits (d5318f7e1657a5fac4dbe84c6a5aae7d1920f471)

Author SHA1 Message Date
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 7c15ed82a0 fix: Dashboard route now passes groups to template
The / route was using anonymous function that passed $servers
but template expected $groups. Now both use the same logic.
2026-04-17 16:43:25 +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 5b3f5a9483 fix: Agent download endpoint and install script URL
- 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
2026-04-17 09:47:18 +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 9a4106a201 fix: исправлен синтаксис index.php и добавлен API маршрут дашборда
- Восстановлен корректный index.php из чистого коммита
- Добавлен маршрут /api/dashboard/stats для бесшовного обновления
- Исправлена ошибка парсинга PHP
2026-04-14 00:52:53 +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 f3ddb65fcd feat: doughnut графики разделов дисков, timezone fix, crosshair removal
- Добавлены doughnut графики для disk_used_root/home/boot/mnt_data
- Удалён общий disk_used line chart (заменён doughnut)
- Исключён crosshair плагин (конфликт с Chart.js)
- Установлена timezone Asia/Irkutsk (+8) для корректных запросов
- cmdline в тултипах процессов

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 13:23:29 +08:00
mirivlad b875e57e4c fix: исправление тултипов Chart.js и обновление проекта
- Исправлено скрытие тултипов при уходе курсора влево/вправо
  - Добавлена проверка всех 4 границ chartArea (caretX + caretY)
  - Добавлен глобальный mousemove обработчик (crosshair overlay перехватывал mouseleave)
- Добавлен плагин chartjs-plugin-crosshair.min.js
- Обновлён дамп БД: только структура + примеры данных (без реальных данных)
- Добавлены: FlashMiddleware, NotificationService, .gitignore
- Обновлены: контроллеры, модели, middlewares, шаблоны
- Удалены: detail.twig.bak файлы

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 00:59:19 +08:00
mirivlad 353b562626 Fix CSRF: add generateToken() call in /csrf-token endpoint 2026-02-15 11:59:47 +00:00
mirivlad 3f3eacaefc Properly add process tooltip function 2026-02-14 17:31:26 +00:00
mirivlad ce3ccf6fe9 Add API endpoint for top processes and DB dump update 2026-02-14 17:09:04 +00:00
mirivlad 6c05e4e10f Fix period filter buttons and exclude API from CSRF validation 2026-02-14 16:56:11 +00:00
mirivlad c7fdaa5660 Initial commit - mon.mirv.top monitoring system 2026-02-14 15:08:14 +00:00