- minor big fixes
- default settings toggled -update camera zoom need to test
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user