Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(deployments): use full-height deployment logs layout

Andras Bacsai33f260a6557e
diff --git a/resources/views/livewire/project/application/deployment/show.blade.php b/resources/views/livewire/project/application/deployment/show.blade.php
index c17cda55fa..d6294f3c81 100644
--- a/resources/views/livewire/project/application/deployment/show.blade.php
+++ b/resources/views/livewire/project/application/deployment/show.blade.php
@@ -1,4 +1,4 @@
-<div>
+<div class="flex h-[calc(100vh-10rem)] min-h-[50rem] flex-col overflow-hidden">
<x-slot:title>
{{ data_get_str($application, 'name')->limit(10) }} > Deployment | Coolify
</x-slot>
@@ -165,13 +165,13 @@
this.scheduleScroll();
}
}
- }">
+ }" class="flex flex-1 min-h-0 flex-col overflow-hidden">
<livewire:project.application.deployment-navbar
:application_deployment_queue="$application_deployment_queue" />
- <div id="screen" :class="fullscreen ? 'fullscreen flex flex-col' : 'mt-4 relative'">
+ <div id="screen" :class="fullscreen ? 'fullscreen flex flex-col' : 'mt-4 flex flex-1 min-h-0 flex-col overflow-hidden'">
<div @if ($isKeepAliveOn) wire:poll.2000ms="polling" @endif
- class="flex flex-col w-full bg-white dark:text-white dark:bg-coolgray-100 dark:border-coolgray-300"
- :class="fullscreen ? 'h-full' : 'border border-dotted rounded-sm'">
+ class="flex min-h-0 flex-col w-full overflow-hidden bg-white dark:text-white dark:bg-coolgray-100 dark:border-coolgray-300"
+ :class="fullscreen ? 'h-full' : 'flex-1 border border-dotted rounded-sm'">
<div
class="flex flex-wrap items-center justify-between gap-2 px-4 py-2 border-b dark:border-coolgray-300 border-neutral-200 shrink-0">
<div class="flex items-center gap-3">
@@ -328,8 +328,7 @@
</div>
</div>
<div id="logsContainer"
- class="flex flex-col overflow-y-auto p-2 px-4 min-h-4 scrollbar"
- :class="fullscreen ? 'flex-1' : 'max-h-[30rem]'">
+ class="flex min-h-40 flex-1 flex-col overflow-y-auto p-2 px-4 scrollbar">
<div id="logs" class="flex flex-col font-logs">
<div x-show="searchQuery.trim() && matchCount === 0"
class="text-gray-500 dark:text-gray-400 py-2">
@@ -363,4 +362,4 @@
</div>
</div>
</div>
-</div>
\ No newline at end of file
+</div>
diff --git a/tests/Feature/DeploymentLogsLayoutTest.php b/tests/Feature/DeploymentLogsLayoutTest.php
new file mode 100644
index 0000000000..a905b8d15e
--- /dev/null
+++ b/tests/Feature/DeploymentLogsLayoutTest.php
@@ -0,0 +1,79 @@
+<?php
+
+use App\Enums\ApplicationDeploymentStatus;
+use App\Models\Application;
+use App\Models\ApplicationDeploymentQueue;
+use App\Models\Environment;
+use App\Models\InstanceSettings;
+use App\Models\Project;
+use App\Models\Server;
+use App\Models\StandaloneDocker;
+use App\Models\Team;
+use App\Models\User;
+use Illuminate\Foundation\Testing\RefreshDatabase;
+
+uses(RefreshDatabase::class);
+
+beforeEach(function () {
+ $this->user = User::factory()->create();
+ $this->team = Team::factory()->create();
+ $this->team->members()->attach($this->user->id, ['role' => 'owner']);
+
+ InstanceSettings::unguarded(function () {
+ InstanceSettings::query()->create([
+ 'id' => 0,
+ 'is_registration_enabled' => true,
+ ]);
+ });
+
+ $this->actingAs($this->user);
+ session(['currentTeam' => $this->team]);
+
+ $this->server = Server::factory()->create(['team_id' => $this->team->id]);
+ $this->destination = StandaloneDocker::query()->where('server_id', $this->server->id)->firstOrFail();
+ $this->project = Project::factory()->create(['team_id' => $this->team->id]);
+ $this->environment = Environment::factory()->create(['project_id' => $this->project->id]);
+ $this->application = Application::factory()->create([
+ 'environment_id' => $this->environment->id,
+ 'destination_id' => $this->destination->id,
+ 'destination_type' => $this->destination->getMorphClass(),
+ 'status' => 'running',
+ ]);
+});
+
+it('renders deployment logs in a full-height layout', function () {
+ $deployment = ApplicationDeploymentQueue::create([
+ 'application_id' => $this->application->id,
+ 'deployment_uuid' => 'deploy-layout-test',
+ 'server_id' => $this->server->id,
+ 'status' => ApplicationDeploymentStatus::FINISHED->value,
+ 'logs' => json_encode([
+ [
+ 'command' => null,
+ 'output' => 'rolling update started',
+ 'type' => 'stdout',
+ 'timestamp' => now()->toISOString(),
+ 'hidden' => false,
+ 'batch' => 1,
+ 'order' => 1,
+ ],
+ ], JSON_THROW_ON_ERROR),
+ ]);
+
+ $response = $this->get(route('project.application.deployment.show', [
+ 'project_uuid' => $this->project->uuid,
+ 'environment_uuid' => $this->environment->uuid,
+ 'application_uuid' => $this->application->uuid,
+ 'deployment_uuid' => $deployment->deployment_uuid,
+ ]));
+
+ $response->assertSuccessful();
+ $response->assertSee('rolling update started');
+ $response->assertSee('flex h-[calc(100vh-10rem)] min-h-40 flex-col overflow-hidden', false);
+ $response->assertSee('flex flex-1 min-h-0 flex-col overflow-hidden', false);
+ $response->assertSee('mt-4 flex flex-1 min-h-0 flex-col overflow-hidden', false);
+ $response->assertSee('flex min-h-0 flex-col w-full overflow-hidden bg-white', false);
+ $response->assertSee('flex min-h-40 flex-1 flex-col overflow-y-auto p-2 px-4 scrollbar', false);
+
+ expect($response->getContent())->not->toContain('max-h-[30rem]');
+});