diff --git a/frontend/src/pages/LlmLogs.tsx b/frontend/src/pages/LlmLogs.tsx index b98d2a3..9288763 100644 --- a/frontend/src/pages/LlmLogs.tsx +++ b/frontend/src/pages/LlmLogs.tsx @@ -1,4 +1,4 @@ -import { type Component, createSignal, onMount, For, Show } from 'solid-js'; +import { type Component, createResource, For, Show } from 'solid-js'; import { useParams, A } from '@solidjs/router'; import { useI18n } from '~/i18n'; import { llmLogsApi } from '~/api/llmLogs'; @@ -36,20 +36,7 @@ const LlmLogs: Component = () => { const { t } = useI18n(); const params = useParams<{ jobId: string }>(); - const [logs, setLogs] = createSignal([]); - const [loading, setLoading] = createSignal(true); - const [error, setError] = createSignal(null); - - onMount(async () => { - try { - const data = await llmLogsApi.getByJobId(params.jobId); - setLogs(data); - } catch { - setError(t('common.error')); - } finally { - setLoading(false); - } - }); + const [logs] = createResource(() => params.jobId, llmLogsApi.getByJobId); return (
@@ -64,23 +51,23 @@ const LlmLogs: Component = () => {

{t('llmLogs.title')}

- }> - + }> +
- {error()} + {t('common.error')}
0} + when={(logs() ?? []).length > 0} fallback={ - +

{t('llmLogs.empty')}

} >
- + {(entry) => (
diff --git a/frontend/src/pages/Settings.tsx b/frontend/src/pages/Settings.tsx index c6f1751..3d54d33 100644 --- a/frontend/src/pages/Settings.tsx +++ b/frontend/src/pages/Settings.tsx @@ -8,6 +8,7 @@ import { createEffect, } from 'solid-js'; import { Settings as SettingsIcon, Save, Plus, Trash2, Info, Download, Upload } from 'lucide-solid'; +import Button from '~/components/ui/Button'; import { settingsApi } from '~/api/settings'; import { configApi } from '~/api/config'; import { apiKeysApi } from '~/api/apiKeys'; @@ -640,21 +641,13 @@ const Settings: Component = () => { {/* Save button */}
- +
diff --git a/frontend/src/pages/Sources.tsx b/frontend/src/pages/Sources.tsx index 19be72c..41aba23 100644 --- a/frontend/src/pages/Sources.tsx +++ b/frontend/src/pages/Sources.tsx @@ -13,6 +13,7 @@ import { Download, Upload, } from 'lucide-solid'; +import Button from '~/components/ui/Button'; import { sourcesApi } from '~/api/sources'; import { useI18n } from '~/i18n'; import { isApiError } from '~/types'; @@ -307,21 +308,13 @@ const Sources: Component = () => { onInput={(e) => setNewUrl(e.currentTarget.value)} />
- + {(msg) => (