Skip to content

Commit

Permalink
add refresh button to jobs preview
Browse files Browse the repository at this point in the history
  • Loading branch information
aliasaria committed Dec 11, 2024
1 parent 84a3aca commit 037458c
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/renderer/components/TransformerLabSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand All @@ -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 (
<>
Expand Down Expand Up @@ -126,7 +128,10 @@ export default function TransformerLabSettings({}) {
</Button>
<Divider sx={{ mt: 2, mb: 2 }} />{' '}
<Typography level="title-lg" marginBottom={2}>
View Jobs (debug):
View Jobs (debug):{' '}
<IconButton onClick={() => jobsMutate()}>
<RotateCcwIcon size="14px" />
</IconButton>
</Typography>
<Select
sx={{ width: '400px' }}
Expand Down

0 comments on commit 037458c

Please sign in to comment.