- minor big fixes

- default settings toggled
-update camera zoom need to test
This commit is contained in:
2025-11-04 13:38:06 +00:00
parent 76643cc84c
commit 61894c0c42
9 changed files with 43 additions and 51 deletions

View File

@@ -1,8 +1,4 @@
import {
useMutation,
useQuery,
type QueryFunctionContext,
} from "@tanstack/react-query";
import { useMutation, useQuery, type QueryFunctionContext } from "@tanstack/react-query";
import { CAM_BASE } from "../utils/config";
import type { zoomConfig, ZoomInOptions } from "../types/types";
import { toast } from "sonner";
@@ -10,7 +6,7 @@ import { useEffect } from "react";
async function zoomIn(options: ZoomInOptions) {
const response = await fetch(
`${CAM_BASE}/Ip${options.camera}-command?magnification=${options.multiplier}x`,
`${CAM_BASE}/Ip${options.camera}-command?magnification=${options.multiplierText?.toLowerCase()}`,
{
signal: AbortSignal.timeout(500),
}
@@ -22,11 +18,9 @@ async function zoomIn(options: ZoomInOptions) {
return response.json();
}
async function fetchZoomInConfig({
queryKey,
}: QueryFunctionContext<[string, zoomConfig]>) {
async function fetchZoomInConfig({ queryKey }: QueryFunctionContext<[string, zoomConfig]>) {
const [, { camera }] = queryKey;
const response = await fetch(`${CAM_BASE}/Ip${camera}-inspect`, {
const response = await fetch(`${CAM_BASE}/Ip${camera}-command`, {
signal: AbortSignal.timeout(500),
});
if (!response.ok) {