Add Frigate config merging and camera database updates

- Refactor Frigate generator to support adding cameras to existing configs
- Add text-based YAML parsing to preserve formatting and comments
- Implement duplicate camera/stream name detection and auto-numbering
- Add support for inserting cameras into existing go2rtc and cameras sections
- Update UI: add textarea for existing config input and generate button
- Preserve user's existing configuration when adding new cameras
- Add example config template for new users
- Update ConfigPanel to initialize Frigate tab instead of auto-generating
- Add FrigateGenerator import to main.js
- Add custom styles for Frigate config input and output sections
- Support both empty config (create from scratch) and existing config (merge) modes

Camera database updates:
- Add OpenIPC firmware camera support (257 models)
- Add Yi-Hack firmware variants (v4, v5, Allwinner, MStar)
- Add Fang-Hacks firmware support
- Add OpenMiko firmware support
- Update Sonoff camera models
- Update Thingino firmware camera models
This commit is contained in:
eduard256
2025-11-11 22:32:59 +03:00
parent 5d0b3e6527
commit 627409cf56
14 changed files with 1660 additions and 132 deletions
+47 -3
View File
@@ -21,15 +21,59 @@ export class ConfigPanel {
document.getElementById('selected-sub-url').textContent = this.maskCredentials(subStream.url);
}
// Generate configs
// Generate configs for URL and Go2RTC (as before)
const urlConfig = this.generateURLConfig();
const go2rtcConfig = Go2RTCGenerator.generate(mainStream, subStream);
const frigateConfig = FrigateGenerator.generate(mainStream, subStream);
// Update config displays
document.getElementById('config-url').textContent = urlConfig;
document.getElementById('config-go2rtc').textContent = go2rtcConfig;
document.getElementById('config-frigate').textContent = frigateConfig;
// For Frigate: initialize the tab instead of generating automatically
this.initializeFrigateTab();
}
/**
* Initialize Frigate tab with example config
*/
initializeFrigateTab() {
const textarea = document.getElementById('existing-frigate-config');
const outputSection = document.getElementById('frigate-output-section');
// Show example config if field is empty
if (!textarea.value || textarea.value.trim() === '') {
textarea.value = this.getExampleConfig();
}
// Hide output section
outputSection.classList.add('hidden');
document.getElementById('config-frigate').textContent = '';
}
/**
* Get example Frigate config
*/
getExampleConfig() {
return `mqtt:
enabled: false
# Global Recording Settings
record:
enabled: true
retain:
days: 7
mode: motion # Record only on motion detection
# Go2RTC Configuration (Frigate built-in)
go2rtc:
streams:
# Your existing streams will be preserved here
# Frigate Camera Configuration
cameras:
# Your existing cameras will be preserved here
version: 0.16-0`;
}
generateURLConfig() {