feat: container logs

This commit is contained in:
Andras Bacsai
2023-10-02 13:38:16 +02:00
parent fd9c13009f
commit 97027875bf
10 changed files with 225 additions and 39 deletions

View File

@@ -0,0 +1,18 @@
<div x-init="$wire.getLogs">
<div class="flex gap-2">
<h2>Logs</h2>
@if ($streamLogs)
<span wire:poll.1000ms='getLogs(true)' class="loading loading-xs text-warning loading-spinner"></span>
@endif
</div>
<div class="w-32">
<x-forms.checkbox instantSave label="Stream Logs" id="streamLogs"></x-forms.checkbox>
</div>
<div class="container w-full pt-4 mx-auto">
<div
class="scrollbar flex flex-col-reverse w-full overflow-y-auto border border-solid rounded border-coolgray-300 max-h-[32rem] p-4 pt-6 text-xs text-white">
<pre class="font-mono whitespace-pre-wrap">{{ $outputs }}</pre>
</div>
</div>
</div>

View File

@@ -0,0 +1,41 @@
<x-layout>
@if ($type === 'application')
<h1>Logs</h1>
<livewire:project.application.heading :application="$resource" />
<div class="pt-4">
@if (Str::of($status)->startsWith('running'))
<livewire:project.shared.get-logs :server="$server" :container="$container" />
@else
Application is not running.
@endif
</div>
@elseif ($type === 'database')
<h1>Logs</h1>
<livewire:project.database.heading :database="$resource" />
<div class="pt-4">
@if (Str::of($status)->startsWith('running'))
<livewire:project.shared.get-logs :server="$server" :container="$container" />
@else
Database is not running.
@endif
</div>
@elseif ($type === 'service')
<livewire:project.service.navbar :service="$resource" :parameters="$parameters" :query="$query" />
<div class="flex gap-4 pt-6">
<div>
<a class="{{ request()->routeIs('project.service.show') ? 'text-white' : '' }}"
href="{{ route('project.service.show', $parameters) }}">
<button><- Back</button>
</a>
</div>
<div class="flex-1 pl-8">
@if (Str::of($status)->startsWith('running'))
<livewire:project.shared.get-logs :server="$server" :container="$container" />
@else
Service is not running.
@endif
</div>
</div>
@endif
</x-layout>