Dashboard Editor & Layout: - Full-screen visual editor for reorganizing cards - Drag-and-drop cards between sections - Toggle card visibility with persistence to localStorage - Reset to default layout option Alerts System: - Threshold-based alerts for CPU, memory, temperature, disk, GPU - Alert manager with duration requirements - AlertsCard component with settings UI - API endpoints for alerts CRUD New Collectors: - Docker container monitoring with parallel stats fetching - Systemd service status via D-Bus - Historical metrics storage (1 hour at 1s intervals) PWA Support: - Service worker with offline caching - Web app manifest with SVG icons - iOS PWA meta tags Mobile Responsive: - Collapsible hamburger menu on mobile - Adaptive grid layouts for all screen sizes - Touch-friendly hover states - Safe area insets for notched devices UI Enhancements: - Light/dark theme toggle with persistence - Keyboard shortcuts (T=theme, R=refresh, ?=help) - Per-process expandable details in ProcessesCard - Sparkline charts for historical data Performance Fixes: - Buffered SSE channels to prevent blocking - Parallel Docker stats collection with timeout - D-Bus timeout for systemd collector Tests: - Unit tests for CPU, memory, network collectors - Alert manager tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
43 lines
897 B
Go
43 lines
897 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"system-monitor/internal/api"
|
|
"system-monitor/internal/config"
|
|
"system-monitor/internal/sse"
|
|
)
|
|
|
|
func main() {
|
|
cfg := config.Load()
|
|
|
|
log.Printf("Starting system monitor backend on port %s", cfg.Port)
|
|
log.Printf("Reading from: proc=%s, sys=%s", cfg.ProcPath, cfg.SysPath)
|
|
log.Printf("Default refresh interval: %s", cfg.RefreshInterval)
|
|
|
|
if cfg.AuthEnabled {
|
|
log.Printf("Basic authentication enabled for user: %s", cfg.AuthUser)
|
|
}
|
|
|
|
if cfg.TLSEnabled {
|
|
log.Printf("TLS enabled with cert: %s", cfg.TLSCertFile)
|
|
}
|
|
|
|
broker := sse.NewBroker(cfg)
|
|
go broker.Run()
|
|
|
|
server := api.NewServer(cfg, broker)
|
|
|
|
var err error
|
|
if cfg.TLSEnabled {
|
|
log.Printf("Starting HTTPS server on port %s", cfg.Port)
|
|
err = server.RunTLS(cfg.TLSCertFile, cfg.TLSKeyFile)
|
|
} else {
|
|
err = server.Run()
|
|
}
|
|
|
|
if err != nil {
|
|
log.Fatalf("Failed to start server: %v", err)
|
|
}
|
|
}
|