mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-28 07:36:38 +08:00
9de240f034
- Add NodeMetric/TunnelMetric/ServiceMonitor models and repository methods - Implement metrics ingestion service with per-minute bucket aggregation - Add health checker for node connectivity monitoring - Wire node metrics from WebSocket SystemInfo messages - Add tunnel metrics ingestion from flow upload endpoint - Create monitoring REST API endpoints for nodes, tunnels, services - Implement service monitor CRUD and execution (TCP/ICMP checks) - Add MonitorPermission for non-admin access control - Create frontend monitor page with node/tunnel/service views - Add tunnel metrics ingestion from agent flow reports - Include schema migration for tunnel_metric unique index - Fix tunnel entry port conflict validation to use transaction Entire-Checkpoint: 030821a7c8e3
1.8 KiB
1.8 KiB
040 - Service Monitor Limits Config + UI Hints
Goal
Make service monitor interval/timeout constraints configurable (instead of hard-coded clamps) and make the UI clearly communicate the effective limits.
Current Pain
- Backend clamps
intervalSecandtimeoutSecwith hard-coded constants. - Checker scan cadence is also hard-coded, so users can set values that will never be honored.
- Frontend form does not explain allowed ranges or why values may change.
Approach
- Add frontend-configurable limits stored in
vite_config(with safe defaults matching current behavior). - Backend always normalizes using the configured limits.
- Expose the current limits via a monitoring endpoint so the UI can render accurate hints.
- Frontend shows min/max and validates before submit.
- Admin can edit the limits on
/config.
Config Keys (vite_config)
service_monitor_checker_scan_interval_sec(default: 30)service_monitor_min_interval_sec(default: 30; auto-raised to at least scan interval)service_monitor_default_interval_sec(default: 60)service_monitor_min_timeout_sec(default: 1)service_monitor_default_timeout_sec(default: 5)service_monitor_max_timeout_sec(default: 60)
Checklist
Backend:
- Introduce shared
ServiceMonitorLimitsconfig loader. - Use limits for create/update normalization.
- Use limits in checker (scan interval + timeout clamp).
- Add
GET /api/v1/monitor/services/limitsto return current limits.
Frontend:
- Fetch limits once and render input descriptions.
- Validate interval/timeout client-side and show inline errors.
- Add
/configitems to edit thevite_configkeys.
Verification:
cd go-backend && go test ./... -count=1cd vite-frontend && npm run lint && npm run build