diff --git a/frontend/src/components/Layout/AIModels/AIModelEditor/AIModelEditor.js b/frontend/src/components/Layout/AIModels/AIModelEditor/AIModelEditor.js index fd7d0af5..294a7723 100644 --- a/frontend/src/components/Layout/AIModels/AIModelEditor/AIModelEditor.js +++ b/frontend/src/components/Layout/AIModels/AIModelEditor/AIModelEditor.js @@ -25,7 +25,6 @@ import FeedbackToast from "./FeedbackToast"; import FeedbackPopup from "./FeedbackPopup"; import FormGroup from "@mui/material/FormGroup"; - const AIModelEditor = (props) => { let { id } = useParams(); const [error, setError] = useState(null); @@ -72,9 +71,13 @@ const AIModelEditor = (props) => { setPopupOpen(true); }; - const { data, isLoading, refetch } = useQuery("getModelById", getModelById, { - refetchInterval: 60000, - }); + const { data, isLoading, refetch } = useQuery( + "getModelById" + id, + getModelById, + { + refetchInterval: 60000, + } + ); const getFeedbackCount = async () => { try { const response = await axios.get( @@ -111,7 +114,7 @@ const AIModelEditor = (props) => { const body = { epochs: epochs, batch_size: batchSize, - freeze_layers:freezeLayers, + freeze_layers: freezeLayers, model: id, zoom_level: zoomLevel, description: description, @@ -124,8 +127,8 @@ const AIModelEditor = (props) => { if (res.error) { setError( res.error.response.statusText + - " / " + - JSON.stringify(res.error.response.data) + " / " + + JSON.stringify(res.error.response.data) ); return; } @@ -292,8 +295,6 @@ const AIModelEditor = (props) => { - - { /> - + diff --git a/frontend/src/components/Layout/AIModels/AIModelEditor/DatasetCurrent.js b/frontend/src/components/Layout/AIModels/AIModelEditor/DatasetCurrent.js index 91d16529..8242c89c 100644 --- a/frontend/src/components/Layout/AIModels/AIModelEditor/DatasetCurrent.js +++ b/frontend/src/components/Layout/AIModels/AIModelEditor/DatasetCurrent.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useEffect } from "react"; import { useQuery } from "react-query"; import axios from "../../../../axios"; @@ -9,9 +9,9 @@ const DatasetCurrent = (props) => { // if (!accessToken) return; try { const res = await axios.get(`/workspace/dataset_${props.datasetId}/`); - + console.log(`/workspace/dataset_${props.datasetId}/`, res); if (res.error) { - // setMapError(res.error.response.statusText); + console.log("isError", res.error); } else { return res.data; } @@ -20,15 +20,24 @@ const DatasetCurrent = (props) => { } finally { } }; - const { data, isLoading } = useQuery("getDatasetSepcs", getDatasetSepcs, { - refetchInterval: 120000, - }); + const { data, isLoading } = useQuery( + "getDatasetSepcs" + props.datasetId, + getDatasetSepcs, + { + refetchInterval: 30000, + } + ); + useEffect(() => { + return () => {}; + }, []); + return ( <> {isLoading && "Loading ..."} {data && data.dir && data.dir.input && ( {data.dir.input.len - 1} images )} + {data === undefined && Not downloaded yet} ); };