diff --git a/apps/api/src/routes/api/v1/applications/handlers.ts b/apps/api/src/routes/api/v1/applications/handlers.ts index 588ad98be..686eea8cc 100644 --- a/apps/api/src/routes/api/v1/applications/handlers.ts +++ b/apps/api/src/routes/api/v1/applications/handlers.ts @@ -1243,7 +1243,10 @@ export async function getApplicationLogs(request: FastifyRequestLogs
  • handleDeploySubmit(false)} > + {#if $status.application.overallStatus !== 'degraded'} - {$status.application.overallStatus === 'degraded' ? 'Restart Degraded Services' : 'Deploy'} + {:else} + + + + + + {/if} + {$status.application.overallStatus === 'degraded' ? 'Restart Degraded Stack' : 'Deploy'} {/if} {#if $location && $status.application.overallStatus === 'healthy'} diff --git a/apps/ui/src/routes/applications/[id]/logs/index.svelte b/apps/ui/src/routes/applications/[id]/logs/index.svelte index a0ef249b2..a716f0788 100644 --- a/apps/ui/src/routes/applications/[id]/logs/index.svelte +++ b/apps/ui/src/routes/applications/[id]/logs/index.svelte @@ -5,8 +5,6 @@ import { errorNotification } from '$lib/common'; import { onMount, onDestroy } from 'svelte'; import Tooltip from '$lib/components/Tooltip.svelte'; - import { status } from '$lib/store'; - import { goto } from '$app/navigation'; let application: any = {}; let logsLoading = false; @@ -19,6 +17,8 @@ let position = 0; let services: any = []; let selectedService: any = null; + let noContainer = false; + const { id } = $page.params; onMount(async () => { const response = await get(`/applications/${id}`); @@ -33,7 +33,7 @@ name: '' } ]; - await selectService('') + await selectService(''); } }); onDestroy(() => { @@ -50,27 +50,17 @@ } return tempdockerComposeServices; } - async function loadAllLogs() { - try { - logsLoading = true; - const data: any = await get(`/applications/${id}/logs`); - if (data?.logs) { - lastLog = data.logs[data.logs.length - 1]; - logs = data.logs; - } - } catch (error) { - return errorNotification(error); - } finally { - logsLoading = false; - } - } async function loadLogs() { if (logsLoading) return; try { const newLogs: any = await get( `/applications/${id}/logs/${selectedService}?since=${lastLog?.split(' ')[0] || 0}` ); - + if (newLogs.noContainer) { + noContainer = true; + } else { + noContainer = false; + } if (newLogs?.logs && newLogs.logs[newLogs.logs.length - 1] !== logs[logs.length - 1]) { logs = logs.concat(newLogs.logs); lastLog = newLogs.logs[newLogs.logs.length - 1]; @@ -103,7 +93,7 @@ } } async function selectService(service: any, init: boolean = false) { - if (services.length === 1 && init) return + if (services.length === 1 && init) return; if (loadLogsInterval) clearInterval(loadLogsInterval); if (followingInterval) clearInterval(followingInterval); @@ -143,7 +133,9 @@ {#if selectedService}
    {#if logs.length === 0} -
    {$t('application.build.waiting_logs')}
    + {#if noContainer} +
    Container not found / exited.
    + {/if} {:else}