From 037458c64c996175a9ee0de3a91fd032facef548 Mon Sep 17 00:00:00 2001 From: ali asaria Date: Wed, 11 Dec 2024 10:51:35 -0500 Subject: [PATCH] add refresh button to jobs preview --- .../components/TransformerLabSettings.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/TransformerLabSettings.tsx b/src/renderer/components/TransformerLabSettings.tsx index faf13e5..122282b 100644 --- a/src/renderer/components/TransformerLabSettings.tsx +++ b/src/renderer/components/TransformerLabSettings.tsx @@ -19,7 +19,7 @@ import { import * as chatAPI from 'renderer/lib/transformerlab-api-sdk'; import useSWR from 'swr'; -import { EyeIcon, EyeOffIcon } from 'lucide-react'; +import { EyeIcon, EyeOffIcon, RotateCcwIcon } from 'lucide-react'; const fetcher = (url) => fetch(url).then((res) => res.json()); @@ -36,10 +36,12 @@ export default function TransformerLabSettings({}) { ); const [showJobsOfType, setShowJobsOfType] = React.useState('NONE'); - const { data: jobs } = useSWR( - chatAPI.Endpoints.Jobs.GetJobsOfType(showJobsOfType, ''), - fetcher - ); + const { + data: jobs, + error: jobsError, + isLoading: jobsIsLoading, + mutate: jobsMutate, + } = useSWR(chatAPI.Endpoints.Jobs.GetJobsOfType(showJobsOfType, ''), fetcher); return ( <> @@ -126,7 +128,10 @@ export default function TransformerLabSettings({}) { {' '} - View Jobs (debug): + View Jobs (debug):{' '} + jobsMutate()}> + +