This commit is contained in:
Andras Bacsai
2023-06-30 15:57:40 +02:00
parent b370826624
commit 55d5b1e8da
13 changed files with 560 additions and 75 deletions

View File

@@ -1,18 +1,32 @@
<div class="pt-4">
<livewire:project.application.deployment-navbar :activity="$activity" :application="$application" :deployment_uuid="$deployment_uuid" />
@if (data_get($activity, 'properties.status') === 'in_progress')
<livewire:project.application.deployment-navbar :application_deployment_queue="$application_deployment_queue" />
@if (data_get($application_deployment_queue, 'status') === 'in_progress')
<div class="flex items-center gap-1 pt-2 ">Deployment is
<div class="text-warning"> {{ Str::headline(data_get($activity, 'properties.status')) }}.</div>
<div class="text-warning"> {{ Str::headline(data_get($this->application_deployment_queue, 'status')) }}.
</div>
<x-loading class="loading-ring" />
</div>
<div class="">Logs will be updated automatically.</div>
@else
<div class="pt-2 ">Deployment is <span
class="text-warning">{{ Str::headline(data_get($activity, 'properties.status')) }}</span>.
class="text-warning">{{ Str::headline(data_get($application_deployment_queue, 'status')) }}</span>.
</div>
@endif
<div
class="scrollbar flex flex-col-reverse w-full overflow-y-auto border border-solid rounded border-coolgray-300 max-h-[32rem] p-4 mt-4 text-xs text-white">
<pre class="font-mono whitespace-pre-wrap" @if ($isKeepAliveOn) wire:poll.2000ms="polling" @endif>{{ \App\Actions\CoolifyTask\RunRemoteProcess::decodeOutput($activity) }}</pre>
<div @if ($isKeepAliveOn) wire:poll.2000ms="polling" @endif
class="scrollbar flex flex-col-reverse w-full overflow-y-auto border border-dotted rounded border-coolgray-400 max-h-[32rem] p-2 px-4 mt-4 text-xs">
<span class="flex flex-col">
@if (decode_remote_command_output($application_deployment_queue)->count() > 0)
@foreach (decode_remote_command_output($application_deployment_queue) as $line)
<span @class([
'font-mono break-all',
'text-neutral-400' => $line['type'] == 'stdout',
'text-error' => $line['type'] == 'stderr',
])>
[{{ $line['timestamp'] }}] {{ $line['output'] }}</span>
@endforeach
@else
<span class="font-mono text-neutral-400">No logs yet.</span>
@endif
</span>
</div>
</div>

View File

@@ -1,6 +1,8 @@
<div class="flex items-center gap-2 pb-4">
<h2>Logs</h2>
@if (data_get($activity, 'properties.status') === 'in_progress' || data_get($activity, 'properties.status') === 'queued')
<x-forms.button wire:click.prevent="show_debug">Show Debug Logs</x-forms.button>
@if (data_get($application_deployment_queue, 'status') === 'in_progress' ||
data_get($application_deployment_queue, 'status') === 'queued')
<x-forms.button wire:click.prevent="cancel">Cancel deployment</x-forms.button>
@endif
</div>