feat: camera config link in settings, fix all json tags, go2rtc auto-start
This commit is contained in:
parent
8bf32396f6
commit
e93074e459
2 changed files with 11 additions and 9 deletions
16
config.go
16
config.go
|
|
@ -20,15 +20,15 @@ type Config struct {
|
||||||
|
|
||||||
// ServerConfig holds HTTP server settings.
|
// ServerConfig holds HTTP server settings.
|
||||||
type ServerConfig struct {
|
type ServerConfig struct {
|
||||||
Port string `yaml:"port"`
|
Port string `yaml:"port" json:"port"`
|
||||||
BindHost string `yaml:"bind_host"`
|
BindHost string `yaml:"bind_host" json:"bind_host"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// StorageConfig holds recording and retention settings.
|
// StorageConfig holds recording and retention settings.
|
||||||
type StorageConfig struct {
|
type StorageConfig struct {
|
||||||
RecordingsPath string `yaml:"recordings_path"`
|
RecordingsPath string `yaml:"recordings_path" json:"recordings_path"`
|
||||||
RetentionDays int `yaml:"retention_days"`
|
RetentionDays int `yaml:"retention_days" json:"retention_days"`
|
||||||
CleanupIntervalMins int `yaml:"cleanup_interval_mins"`
|
CleanupIntervalMins int `yaml:"cleanup_interval_mins" json:"cleanup_interval_mins"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CameraConfig represents a single camera's configuration.
|
// CameraConfig represents a single camera's configuration.
|
||||||
|
|
@ -48,9 +48,9 @@ type CameraConfig struct {
|
||||||
|
|
||||||
// Go2RTCConfig holds go2rtc child process settings.
|
// Go2RTCConfig holds go2rtc child process settings.
|
||||||
type Go2RTCConfig struct {
|
type Go2RTCConfig struct {
|
||||||
Enabled bool `yaml:"enabled"`
|
Enabled bool `yaml:"enabled" json:"enabled"`
|
||||||
Port string `yaml:"port"`
|
Port string `yaml:"port" json:"port"`
|
||||||
Binary string `yaml:"binary"`
|
Binary string `yaml:"binary" json:"binary"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// APIResponse wraps all JSON API responses.
|
// APIResponse wraps all JSON API responses.
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,9 @@ async function renderCameraCards() {
|
||||||
}
|
}
|
||||||
container.innerHTML = cameras.map(c => `
|
container.innerHTML = cameras.map(c => `
|
||||||
<div class="camera-card" data-id="${c.id}">
|
<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.id)}" data-field="id">
|
||||||
<input type="hidden" value="${escAttr(c.ip)}" data-field="ip">
|
<input type="hidden" value="${escAttr(c.ip)}" data-field="ip">
|
||||||
<input type="hidden" value="${c.onvif_port || 80}" data-field="onvif_port">
|
<input type="hidden" value="${c.onvif_port || 80}" data-field="onvif_port">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue