From e93074e459901337e463401c55a5384c5223344d Mon Sep 17 00:00:00 2001 From: cclohmar Date: Wed, 5 Aug 2026 12:22:40 +0100 Subject: [PATCH] feat: camera config link in settings, fix all json tags, go2rtc auto-start --- config.go | 16 ++++++++-------- public/app.js | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/config.go b/config.go index e02aa66..bd2116b 100644 --- a/config.go +++ b/config.go @@ -20,15 +20,15 @@ type Config struct { // ServerConfig holds HTTP server settings. type ServerConfig struct { - Port string `yaml:"port"` - BindHost string `yaml:"bind_host"` + Port string `yaml:"port" json:"port"` + BindHost string `yaml:"bind_host" json:"bind_host"` } // StorageConfig holds recording and retention settings. type StorageConfig struct { - RecordingsPath string `yaml:"recordings_path"` - RetentionDays int `yaml:"retention_days"` - CleanupIntervalMins int `yaml:"cleanup_interval_mins"` + RecordingsPath string `yaml:"recordings_path" json:"recordings_path"` + RetentionDays int `yaml:"retention_days" json:"retention_days"` + CleanupIntervalMins int `yaml:"cleanup_interval_mins" json:"cleanup_interval_mins"` } // CameraConfig represents a single camera's configuration. @@ -48,9 +48,9 @@ type CameraConfig struct { // Go2RTCConfig holds go2rtc child process settings. type Go2RTCConfig struct { - Enabled bool `yaml:"enabled"` - Port string `yaml:"port"` - Binary string `yaml:"binary"` + Enabled bool `yaml:"enabled" json:"enabled"` + Port string `yaml:"port" json:"port"` + Binary string `yaml:"binary" json:"binary"` } // APIResponse wraps all JSON API responses. diff --git a/public/app.js b/public/app.js index 2567b73..139f0ff 100644 --- a/public/app.js +++ b/public/app.js @@ -238,7 +238,9 @@ async function renderCameraCards() { } container.innerHTML = cameras.map(c => `
-

📷 ${c.name || 'Unnamed'} ${c.ip}

+

📷 ${c.name || 'Unnamed'} ${c.ip} + ⚙️ Config +