feat: camera config link in settings, fix all json tags, go2rtc auto-start

This commit is contained in:
Claus Lohmar 2026-08-05 12:22:40 +01:00
parent 8bf32396f6
commit e93074e459
2 changed files with 11 additions and 9 deletions

View file

@ -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.

View file

@ -238,7 +238,9 @@ async function renderCameraCards() {
}
container.innerHTML = cameras.map(c => `
<div class="camera-card" data-id="${c.id}">
<h3>📷 ${c.name || 'Unnamed'} <span style="font-size:11px;color:var(--text-muted)">${c.ip}</span></h3>
<h3>📷 ${c.name || 'Unnamed'} <span style="font-size:11px;color:var(--text-muted)">${c.ip}</span>
<a href="http://${c.ip}" target="_blank" style="font-size:11px;color:var(--accent);margin-left:8px;text-decoration:none" title="Open camera web interface"> Config</a>
</h3>
<input type="hidden" value="${escAttr(c.id)}" data-field="id">
<input type="hidden" value="${escAttr(c.ip)}" data-field="ip">
<input type="hidden" value="${c.onvif_port || 80}" data-field="onvif_port">