- The migration process requires passwords for the following databases to proceed.
+ The migration process requires passwords for
+ the following databases to proceed.
-
+
{#if errorMessage}
-
+
Error: {errorMessage}
{/if}
-
-
+
{/if}
-
\ No newline at end of file
+
diff --git a/frontend/src/components/TaskList.svelte b/frontend/src/components/TaskList.svelte
index 4b2154f..a57c928 100644
--- a/frontend/src/components/TaskList.svelte
+++ b/frontend/src/components/TaskList.svelte
@@ -11,8 +11,11 @@
import { formatDistanceToNow } from 'date-fns';
import { t } from '../lib/i18n';
- export let tasks: Array = [];
- export let loading: boolean = false;
+ let {
+ tasks = [],
+ loading = false,
+ } = $props();
+
const dispatch = createEventDispatcher();
diff --git a/frontend/src/components/TaskLogViewer.svelte b/frontend/src/components/TaskLogViewer.svelte
index 1bbbfa8..3225622 100644
--- a/frontend/src/components/TaskLogViewer.svelte
+++ b/frontend/src/components/TaskLogViewer.svelte
@@ -23,60 +23,47 @@
import { t } from "../lib/i18n";
import TaskLogPanel from "./tasks/TaskLogPanel.svelte";
- export let show = false;
- export let inline = false;
- export let taskId = null;
- export let taskStatus = null;
- export let realTimeLogs = [];
+ let {
+ show = $bindable(false),
+ inline = false,
+ taskId = null,
+ taskStatus = null,
+ realTimeLogs = [],
+ } = $props();
const dispatch = createEventDispatcher();
- let logs = [];
- let loading = false;
- let error = "";
+ let logs = $state([]);
+ let loading = $state(false);
+ let error = $state("");
let interval;
- let autoScroll = true;
+ let autoScroll = $state(true);
- $: shouldShow = inline || show;
+ let shouldShow = $derived(inline || show);
// [DEF:handleRealTimeLogs:Action]
- /** @PURPOSE Append real-time logs as they arrive from WebSocket, preventing duplicates */
- $: if (realTimeLogs && realTimeLogs.length > 0) {
- const lastLog = realTimeLogs[realTimeLogs.length - 1];
- const exists = logs.some(
- (l) =>
- l.timestamp === lastLog.timestamp &&
- l.message === lastLog.message,
- );
- if (!exists) {
- logs = [...logs, lastLog];
- console.log(
- `[TaskLogViewer][Action] Appended real-time log, total=${logs.length}`,
+ $effect(() => {
+ if (realTimeLogs && realTimeLogs.length > 0) {
+ const lastLog = realTimeLogs[realTimeLogs.length - 1];
+ const exists = logs.some(
+ (l) =>
+ l.timestamp === lastLog.timestamp &&
+ l.message === lastLog.message,
);
+ if (!exists) {
+ logs = [...logs, lastLog];
+ }
}
- }
+ });
// [/DEF:handleRealTimeLogs:Action]
// [DEF:fetchLogs:Function]
- /**
- * @PURPOSE Fetches logs for the current task from API (polling fallback).
- * @PRE taskId must be set.
- * @POST logs array is updated with data from taskService.
- * @SIDE_EFFECT Updates logs, loading, and error state.
- */
async function fetchLogs() {
if (!taskId) return;
- console.log(`[TaskLogViewer][Action] Fetching logs for task=${taskId}`);
try {
logs = await getTaskLogs(taskId);
- console.log(
- `[TaskLogViewer][Coherence:OK] Logs fetched count=${logs.length}`,
- );
} catch (e) {
error = e.message;
- console.error(
- `[TaskLogViewer][Coherence:Failed] Error: ${e.message}`,
- );
} finally {
loading = false;
}
@@ -85,34 +72,31 @@
function handleFilterChange(event) {
const { source, level } = event.detail;
- console.log(
- `[TaskLogViewer][Action] Filter changed: source=${source}, level=${level}`,
- );
}
function handleRefresh() {
- console.log(`[TaskLogViewer][Action] Manual refresh`);
fetchLogs();
}
- // React to changes in show/taskId/taskStatus
- $: if (shouldShow && taskId) {
- if (interval) clearInterval(interval);
- logs = [];
- loading = true;
- error = "";
- fetchLogs();
+ $effect(() => {
+ if (shouldShow && taskId) {
+ if (interval) clearInterval(interval);
+ logs = [];
+ loading = true;
+ error = "";
+ fetchLogs();
- if (
- taskStatus === "RUNNING" ||
- taskStatus === "AWAITING_INPUT" ||
- taskStatus === "AWAITING_MAPPING"
- ) {
- interval = setInterval(fetchLogs, 5000);
+ if (
+ taskStatus === "RUNNING" ||
+ taskStatus === "AWAITING_INPUT" ||
+ taskStatus === "AWAITING_MAPPING"
+ ) {
+ interval = setInterval(fetchLogs, 5000);
+ }
+ } else {
+ if (interval) clearInterval(interval);
}
- } else {
- if (interval) clearInterval(interval);
- }
+ });
onDestroy(() => {
if (interval) clearInterval(interval);
@@ -121,18 +105,25 @@
{#if shouldShow}
{#if inline}
-