From 7f170c80797a9252c21d3e61fa97b8a82b81b372 Mon Sep 17 00:00:00 2001 From: mawkone Date: Sun, 14 Jun 2026 15:03:20 -0700 Subject: [PATCH] fix(logs): add immediate loading state clearing and append timestamps to database log tails --- .../app/[workspace]/project/[projectId]/(home)/logs/page.tsx | 1 + vibn-frontend/app/api/mcp/route.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vibn-frontend/app/[workspace]/project/[projectId]/(home)/logs/page.tsx b/vibn-frontend/app/[workspace]/project/[projectId]/(home)/logs/page.tsx index bf948697..43e85efe 100644 --- a/vibn-frontend/app/[workspace]/project/[projectId]/(home)/logs/page.tsx +++ b/vibn-frontend/app/[workspace]/project/[projectId]/(home)/logs/page.tsx @@ -81,6 +81,7 @@ export default function LogsPage() { name: string; }) => { setLogsLoading(true); + setLogs(null); // Clear previous logs immediately so user sees it loading try { let action = "apps.logs"; let payloadParams: Record = { uuid: item.id, lines: 100 }; diff --git a/vibn-frontend/app/api/mcp/route.ts b/vibn-frontend/app/api/mcp/route.ts index 1cc182ea..20498662 100644 --- a/vibn-frontend/app/api/mcp/route.ts +++ b/vibn-frontend/app/api/mcp/route.ts @@ -5294,7 +5294,8 @@ async function toolDatabasesLogs( const lines = Number.isFinite(linesRaw) ? linesRaw : 200; try { - const cmd = `cid=$(docker ps -a --filter name=${uuid} --format '{{.Names}}' | head -1); if [ -z "$cid" ]; then echo "NO_CONTAINER"; exit 0; fi; docker logs --tail ${lines} "$cid" 2>&1`; + // We add --timestamps (or -t) to get timestamps at the start of each row + const cmd = `cid=$(docker ps -a --filter name=${uuid} --format '{{.Names}}' | head -1); if [ -z "$cid" ]; then echo "NO_CONTAINER"; exit 0; fi; docker logs --timestamps --tail ${lines} "$cid" 2>&1`; const res = await runOnCoolifyHost(cmd, { timeoutMs: 15_000 }); if (res.code !== 0) {