ui: dev logs

This commit is contained in:
Andras Bacsai 2022-09-28 09:19:51 +02:00
parent 57c4d33bd3
commit d44047d109

View File

@ -7,6 +7,7 @@
import Tooltip from '$lib/components/Tooltip.svelte'; import Tooltip from '$lib/components/Tooltip.svelte';
import { day } from '$lib/dayjs'; import { day } from '$lib/dayjs';
import { selectedBuildId } from '$lib/store'; import { selectedBuildId } from '$lib/store';
import { dev } from '$app/env';
let logs: any = []; let logs: any = [];
let currentStatus: any; let currentStatus: any;
@ -104,7 +105,7 @@
}); });
</script> </script>
<div class="flex justify-start top-0 pb-2 space-x-2"> <div class="flex justify-start top-0 pb-2 space-x-2">
<button <button
on:click={followBuild} on:click={followBuild}
class="btn btn-sm bg-coollabs" class="btn btn-sm bg-coollabs"
@ -159,14 +160,14 @@
<button id="streaming" class="btn btn-sm bg-transparent border-none loading" /> <button id="streaming" class="btn btn-sm bg-transparent border-none loading" />
<Tooltip triggeredBy="#streaming">Streaming logs</Tooltip> <Tooltip triggeredBy="#streaming">Streaming logs</Tooltip>
{/if} {/if}
</div> </div>
{#if currentStatus === 'queued'} {#if currentStatus === 'queued'}
<div <div
class="font-mono w-full bg-coolgray-200 p-5 overflow-x-auto overflox-y-auto max-h-[80vh] rounded mb-20 flex flex-col whitespace-nowrap scrollbar-thumb-coollabs scrollbar-track-coolgray-200 scrollbar-w-1" class="font-mono w-full bg-coolgray-200 p-5 overflow-x-auto overflox-y-auto max-h-[80vh] rounded mb-20 flex flex-col whitespace-nowrap scrollbar-thumb-coollabs scrollbar-track-coolgray-200 scrollbar-w-1"
> >
{$t('application.build.queued_waiting_exec')} {$t('application.build.queued_waiting_exec')}
</div> </div>
{:else if logs.length > 0} {:else if logs.length > 0}
<div <div
bind:this={logsEl} bind:this={logsEl}
on:scroll={detect} on:scroll={detect}
@ -180,10 +181,10 @@
{/if} {/if}
{/each} {/each}
</div> </div>
{:else} {:else}
<div <div
class="font-mono w-full bg-coolgray-200 p-5 overflow-x-auto overflox-y-auto max-h-[80vh] rounded mb-20 flex flex-col whitespace-nowrap scrollbar-thumb-coollabs scrollbar-track-coolgray-200 scrollbar-w-1" class="font-mono w-full bg-coolgray-200 p-5 overflow-x-auto overflox-y-auto max-h-[80vh] rounded mb-20 flex flex-col whitespace-nowrap scrollbar-thumb-coollabs scrollbar-track-coolgray-200 scrollbar-w-1"
> >
No logs found yet. {dev ? 'In development, logs are shown in the console.' : 'No logs found yet.'}
</div> </div>
{/if} {/if}