mirror of
https://github.com/ershisan99/coolify.git
synced 2026-01-31 21:02:04 +00:00
feat: Follow logs
This commit is contained in:
@@ -33,8 +33,6 @@
|
||||
export let buildCount;
|
||||
|
||||
let buildId;
|
||||
let followingBuild;
|
||||
$: buildId;
|
||||
|
||||
let skip = 0;
|
||||
let noMoreBuilds = buildCount < 5 || buildCount <= skip;
|
||||
@@ -86,15 +84,6 @@
|
||||
buildId = build;
|
||||
goto(`/applications/${id}/logs/build?buildId=${buildId}`);
|
||||
}
|
||||
|
||||
function followBuild() {
|
||||
followingBuild = !followingBuild;
|
||||
if (followingBuild) {
|
||||
const logEl = document.getElementById('logs');
|
||||
logEl.scrollTop = logEl.scrollHeight;
|
||||
window.scrollTo(0, document.body.scrollHeight);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex space-x-1 p-6 font-bold">
|
||||
@@ -138,39 +127,16 @@
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
<button
|
||||
on:click={followBuild}
|
||||
data-tooltip="Follow logs"
|
||||
class={followingBuild && 'text-green-500'}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="h-6 w-6"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
stroke="currentColor"
|
||||
<div class="flex space-x-2">
|
||||
<button disabled={buildCount > 0 && !noMoreBuilds} class="w-full" on:click={loadMoreBuilds}
|
||||
>Load More</button
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M15 13l-3 3m0 0l-3-3m3 3V8m0 13a9 9 0 110-18 9 9 0 010 18z"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
{#if buildCount > 0 && !noMoreBuilds}
|
||||
<button class="w-full" on:click={loadMoreBuilds}>Load More</button>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-1 md:w-96">
|
||||
{#if buildId}
|
||||
{#key buildId}
|
||||
<svelte:component
|
||||
this={BuildLog}
|
||||
{buildId}
|
||||
{followingBuild}
|
||||
on:updateBuildStatus={updateBuildStatus}
|
||||
/>
|
||||
<svelte:component this={BuildLog} {buildId} on:updateBuildStatus={updateBuildStatus} />
|
||||
{/key}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user