Skip to content
Snippets Groups Projects
Commit 037eec72 authored by ali asaria's avatar ali asaria
Browse files

button to refresh prompt log

parent 72701fe6
No related branches found
No related tags found
No related merge requests found
...@@ -7,13 +7,17 @@ import { ...@@ -7,13 +7,17 @@ import {
AccordionGroup, AccordionGroup,
AccordionSummary, AccordionSummary,
Box, Box,
Button,
IconButton,
Sheet, Sheet,
Stack,
Typography, Typography,
} from '@mui/joy'; } from '@mui/joy';
import * as chatAPI from 'renderer/lib/transformerlab-api-sdk'; import * as chatAPI from 'renderer/lib/transformerlab-api-sdk';
import useSWR from 'swr'; import useSWR from 'swr';
import { RotateCcwIcon } from 'lucide-react';
const fetcher = (url) => fetch(url).then((res) => res.text()); const fetcher = (url) => fetch(url).then((res) => res.text());
...@@ -71,7 +75,7 @@ function renderJSONLinesLog(logs) { ...@@ -71,7 +75,7 @@ function renderJSONLinesLog(logs) {
} }
export default function Logs({}) { export default function Logs({}) {
const { data } = useSWR(chatAPI.Endpoints.Global.PromptLog, fetcher); const { data, mutate } = useSWR(chatAPI.Endpoints.Global.PromptLog, fetcher);
React.useEffect(() => { React.useEffect(() => {
// Scroll to bottom // Scroll to bottom
...@@ -88,7 +92,16 @@ export default function Logs({}) { ...@@ -88,7 +92,16 @@ export default function Logs({}) {
paddingBottom: '1rem', paddingBottom: '1rem',
}} }}
> >
<h1>Prompt Log</h1> <Stack direction="row" spacing={1} justifyContent="space-between">
<h1>Prompt Log</h1>
<IconButton
onClick={() => {
mutate();
}}
>
<RotateCcwIcon style={{ width: '18px', height: '18px' }} />
</IconButton>
</Stack>
<Box <Box
id="logs_accordion" id="logs_accordion"
style={{ style={{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment