mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-03-27 00:17:27 +01:00
Add ability to rename camera groups (#14339)
* Add ability to rename camera groups * clean up * ampersand consistency
This commit is contained in:
parent
0ee32cf110
commit
dd7a07bd0d
@ -643,6 +643,11 @@ export function CameraGroupEdit({
|
|||||||
|
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
|
|
||||||
|
let renamingQuery = "";
|
||||||
|
if (editingGroup && editingGroup[0] !== values.name) {
|
||||||
|
renamingQuery = `camera_groups.${editingGroup[0]}&`;
|
||||||
|
}
|
||||||
|
|
||||||
const order =
|
const order =
|
||||||
editingGroup === undefined
|
editingGroup === undefined
|
||||||
? currentGroups.length + 1
|
? currentGroups.length + 1
|
||||||
@ -655,9 +660,12 @@ export function CameraGroupEdit({
|
|||||||
.join("");
|
.join("");
|
||||||
|
|
||||||
axios
|
axios
|
||||||
.put(`config/set?${orderQuery}&${iconQuery}${cameraQueries}`, {
|
.put(
|
||||||
requires_restart: 0,
|
`config/set?${renamingQuery}${orderQuery}&${iconQuery}${cameraQueries}`,
|
||||||
})
|
{
|
||||||
|
requires_restart: 0,
|
||||||
|
},
|
||||||
|
)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
toast.success(`Camera group (${values.name}) has been saved.`, {
|
toast.success(`Camera group (${values.name}) has been saved.`, {
|
||||||
@ -712,7 +720,6 @@ export function CameraGroupEdit({
|
|||||||
<Input
|
<Input
|
||||||
className="text-md w-full border border-input bg-background p-2 hover:bg-accent hover:text-accent-foreground dark:[color-scheme:dark]"
|
className="text-md w-full border border-input bg-background p-2 hover:bg-accent hover:text-accent-foreground dark:[color-scheme:dark]"
|
||||||
placeholder="Enter a name..."
|
placeholder="Enter a name..."
|
||||||
disabled={editingGroup !== undefined}
|
|
||||||
{...field}
|
{...field}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
|
Loading…
Reference in New Issue
Block a user