diff --git a/frontend/src/components/workload-logs-panel.tsx b/frontend/src/components/workload-logs-panel.tsx
index 225a37a..e72eb59 100644
--- a/frontend/src/components/workload-logs-panel.tsx
+++ b/frontend/src/components/workload-logs-panel.tsx
@@ -50,6 +50,11 @@ export function WorkloadLogsPanel({
refetchInterval: showLogs && logTab === 'pod' ? 3000 : false,
});
+ // Only keep polling while a build is still in progress; once it reaches a
+ // terminal state (running/failed/cancelled/…) the log is final, so stop.
+ const buildInProgress = (status?: string) =>
+ !status || status === 'pending' || status === 'building' || status === 'deploying';
+
const { data: buildLogsData } = useQuery<{
buildLog: string | null;
status: string;
@@ -58,9 +63,14 @@ export function WorkloadLogsPanel({
queryKey: ['build-logs', appId],
queryFn: () => api.get(`/deployments/applications/${appId}/build-logs`).then((r) => r.data),
enabled: showBuildLogs && showLogs && logTab === 'build',
- refetchInterval: showBuildLogs && showLogs && logTab === 'build' ? 5000 : false,
+ refetchInterval: (query) =>
+ showBuildLogs && showLogs && logTab === 'build' && buildInProgress(query.state.data?.status)
+ ? 5000
+ : false,
});
+ const buildIsLive = showBuildLogs && showLogs && logTab === 'build' && buildInProgress(buildLogsData?.status);
+
const podPlaceholder =
emptyPodMessage ||
(isRunning
@@ -82,7 +92,7 @@ export function WorkloadLogsPanel({
{wl.liveEvery3s}
)}
- {showBuildLogs && showLogs && logTab === 'build' && (
+ {buildIsLive && (
{wl.autoEvery5s}
@@ -147,7 +157,7 @@ export function WorkloadLogsPanel({
{buildLogsData.version}
- {statusLabel(buildLogsData.status)}
+ {buildLogsData.status === 'running' ? wl.buildDone : statusLabel(buildLogsData.status)}
)}
diff --git a/frontend/src/i18n/dictionaries/en.ts b/frontend/src/i18n/dictionaries/en.ts
index bcd8702..e6dc96a 100644
--- a/frontend/src/i18n/dictionaries/en.ts
+++ b/frontend/src/i18n/dictionaries/en.ts
@@ -233,6 +233,7 @@ const en: Dictionary = {
buildPending: 'Build is pending...',
noDeployments: 'No deployments yet. Deploy your app to see build logs.',
noBuildLogs: 'No build logs available for this deployment.',
+ buildDone: 'Done',
},
externalAccess: {
title: 'External access',
diff --git a/frontend/src/i18n/dictionaries/fa.ts b/frontend/src/i18n/dictionaries/fa.ts
index f01545a..39e94a2 100644
--- a/frontend/src/i18n/dictionaries/fa.ts
+++ b/frontend/src/i18n/dictionaries/fa.ts
@@ -232,6 +232,7 @@ const fa = {
buildPending: 'بیلد در صف است…',
noDeployments: 'هنوز دیپلویی نیست. برای دیدن لاگ بیلد اپت را منتشر کن.',
noBuildLogs: 'لاگ بیلدی برای این دیپلوی موجود نیست.',
+ buildDone: 'انجام شده',
},
externalAccess: {
title: 'دسترسی خارجی',