mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-21 06:02:49 +03:00
Implement UI for managing multiple models (#24023)
* Implement hardware detection and UI management * Cleanup Frigate+ detection * Don't count model as changed * Fixes for audio map error * Add descriptions * Enforce that all model must exist * Fix hardware picking * Docs fixes * WebUI cleanup * Cleanup handling of scenes * UI refinement * Cleanup recommended UI * test fixews
This commit is contained in:
@@ -220,6 +220,26 @@ export function buildOverrides(
|
||||
) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// Same-length arrays get compared element by element rather than by
|
||||
// identity, so an item carrying an explicit null where the base simply
|
||||
// omits the key does not read as a change. `/api/config` serializes with
|
||||
// exclude_none, so every nullable field a form materializes would
|
||||
// otherwise look edited the moment the page opens.
|
||||
if (Array.isArray(base) && base.length === current.length) {
|
||||
const baseItems = base;
|
||||
const defaultItems = Array.isArray(defaults) ? defaults : undefined;
|
||||
const unchanged = current.every(
|
||||
(item, index) =>
|
||||
buildOverrides(item, baseItems[index], defaultItems?.[index]) ===
|
||||
undefined,
|
||||
);
|
||||
|
||||
if (unchanged) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
return current;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user