diff --git a/frontend/src/components/TaskLogViewer.svelte b/frontend/src/components/TaskLogViewer.svelte index e4fdfe58..2553213b 100644 --- a/frontend/src/components/TaskLogViewer.svelte +++ b/frontend/src/components/TaskLogViewer.svelte @@ -39,6 +39,7 @@ import { getTaskLogs } from "../services/taskService.js"; import { t } from "../lib/i18n"; import TaskLogPanel from "./tasks/TaskLogPanel.svelte"; + import Icon from "../lib/ui/Icon.svelte"; let { show = $bindable(false), @@ -153,21 +154,23 @@
{#if loading && logs.length === 0}
- {$t.tasks?.loading} + {$t.tasks?.loading}
{:else if error}
- - {error} +
+ ⚠ +
+ {error}
@@ -197,7 +200,7 @@ class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0" > + +
-
+
+ +
-
+
{#if loading && logs.length === 0} -

- {$t.tasks?.loading} -

+
+
+

+ {$t.tasks?.loading} +

+
{:else if error} -

{error}

+
+
+ +
+

+ {error} +

+ +
{:else} {/if} {/if} -// [/DEF:showModal:Component] + diff --git a/frontend/src/lib/components/layout/TaskDrawer.svelte b/frontend/src/lib/components/layout/TaskDrawer.svelte index a2f82192..b49d881f 100644 --- a/frontend/src/lib/components/layout/TaskDrawer.svelte +++ b/frontend/src/lib/components/layout/TaskDrawer.svelte @@ -41,6 +41,7 @@ import { assistantChatStore } from "$lib/stores/assistantChat.js"; import TaskLogViewer from "../../../components/TaskLogViewer.svelte"; import PasswordPrompt from "../../../components/PasswordPrompt.svelte"; + import { getReportTypeProfile } from "../reports/reportTypeProfiles.js"; import { t } from "$lib/i18n"; import { api } from "$lib/api.js"; import Icon from "$lib/ui/Icon.svelte"; @@ -129,12 +130,25 @@ function llmValidationBadgeClass(tone) { if (tone === "fail") - return "text-rose-700 bg-rose-100 border border-rose-200"; + return "text-red-700 bg-red-100 ring-1 ring-red-200"; if (tone === "warn") - return "text-amber-700 bg-amber-100 border border-amber-200"; + return "text-amber-700 bg-amber-100 ring-1 ring-amber-200"; if (tone === "pass") - return "text-emerald-700 bg-emerald-100 border border-emerald-200"; - return "text-slate-700 bg-slate-100 border border-slate-200"; + return "text-green-700 bg-green-100 ring-1 ring-green-200"; + return "text-slate-700 bg-slate-100 ring-1 ring-slate-200"; + } + + function getStatusClass(status) { + const s = status?.toLowerCase(); + if (s === "success" || s === "completed") + return "bg-green-100 text-green-700 ring-1 ring-green-200"; + if (s === "failed" || s === "error") + return "bg-red-100 text-red-700 ring-1 ring-red-200"; + if (s === "running" || s === "in_progress") + return "bg-blue-100 text-blue-700 ring-1 ring-blue-200"; + if (s === "partial" || s === "partial_success") + return "bg-amber-100 text-amber-700 ring-1 ring-amber-200"; + return "bg-slate-100 text-slate-700 ring-1 ring-slate-200"; } function stopTaskDetailsPolling() { @@ -342,10 +356,14 @@ const diffPayload = await gitService.getDiff( derivedTaskSummary.primaryDashboardId, ); - diffText = - typeof diffPayload === "string" - ? diffPayload - : diffPayload?.diff || JSON.stringify(diffPayload, null, 2); + if (typeof diffPayload === "string") { + diffText = diffPayload; + } else if (diffPayload && typeof diffPayload === "object") { + diffText = + diffPayload.diff || JSON.stringify(diffPayload, null, 2); + } else { + diffText = ""; + } } catch (err) { addToast(err?.message || "Failed to load diff", "error"); diffText = ""; @@ -525,7 +543,7 @@ {#if isOpen} {:else if recentTasks.length > 0} -
-

- {$t.tasks?.recent} -

- {#each recentTasks as task} - {@const taskValidation = resolveLlmValidationStatus(task)} - - {/each} +
+ {#if taskValidation} + + {taskValidation.label} + + {/if} + + {task.status || $t.common?.unknown} + +
+
+ +
+

+ {task.params?.dashboard_id || + (task.plugin_id === 'superset-migration' ? $t.nav?.migration : task.plugin_id) || + $t.common?.not_available} +

+

+ {task.result?.summary || task.id} +

+
+ +
+
+ + {task.id?.substring(0, 8) || 'N/A'} +
+
+ + {task.updated_at ? new Date(task.updated_at).toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}) : ''} +
+
+ + {/each} +
{:else}
-
-

+

+

{$t.tasks?.footer_text}