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.

feat: shows the latest deployment commit + message on status

Andras Bacsai10fde1b1efa3
diff --git a/app/Livewire/Project/Application/Heading.php b/app/Livewire/Project/Application/Heading.php
index 06b9a3c3c1..619be693dc 100644
--- a/app/Livewire/Project/Application/Heading.php
+++ b/app/Livewire/Project/Application/Heading.php
@@ -5,7 +5,7 @@ namespace App\Livewire\Project\Application;
use App\Actions\Application\StopApplication;
use App\Actions\Docker\GetContainersStatus;
use App\Events\ApplicationStatusChanged;
- use App\Jobs\ContainerStatusJob;
+use App\Jobs\ContainerStatusJob;
use App\Jobs\ServerStatusJob;
use App\Models\Application;
use Livewire\Component;
@@ -14,6 +14,8 @@ use Visus\Cuid2\Cuid2;
class Heading extends Component
{
public Application $application;
+ public ?string $lastDeploymentInfo = null;
+ public ?string $lastDeploymentLink = null;
public array $parameters;
protected string $deploymentUuid;
@@ -28,6 +30,9 @@ class Heading extends Component
public function mount()
{
$this->parameters = get_route_parameters();
+ $lastDeployment = $this->application->get_last_successful_deployment();
+ $this->lastDeploymentInfo = data_get_str($lastDeployment, 'commit')->limit(7) . ' ' . data_get($lastDeployment, 'commit_message');
+ $this->lastDeploymentLink = $this->application->gitCommitLink(data_get($lastDeployment, 'commit'));
}
public function check_status($showNotification = false)
diff --git a/app/Models/Application.php b/app/Models/Application.php
index fd3faa166a..63ae132b1d 100644
--- a/app/Models/Application.php
+++ b/app/Models/Application.php
@@ -454,6 +454,10 @@ class Application extends BaseModel
}
return false;
}
+ public function get_last_successful_deployment()
+ {
+ return ApplicationDeploymentQueue::where('application_id', $this->id)->where('status', 'finished')->orderBy('created_at', 'desc')->first();
+ }
public function get_last_days_deployments()
{
return ApplicationDeploymentQueue::where('application_id', $this->id)->where('created_at', '>=', now()->subDays(7))->orderBy('created_at', 'desc')->get();
diff --git a/resources/views/components/resources/breadcrumbs.blade.php b/resources/views/components/resources/breadcrumbs.blade.php
index 1e5aaa9972..90477810ca 100644
--- a/resources/views/components/resources/breadcrumbs.blade.php
+++ b/resources/views/components/resources/breadcrumbs.blade.php
@@ -1,5 +1,5 @@
<nav class="flex pt-2 pb-10">
- <ol class="flex items-center flex-wrap gap-y-1">
+ <ol class="flex flex-wrap items-center gap-y-1">
<li class="inline-flex items-center">
<div class="flex items-center">
<a wire:navigate class="text-xs truncate lg:text-sm"
@@ -40,7 +40,7 @@
@if ($resource->getMorphClass() == 'App\Models\Service')
<x-status.services :service="$resource" />
@else
- <x-status.index :resource="$resource" />
+ <x-status.index :resource="$resource" :lastDeploymentInfo="$lastDeploymentInfo" :lastDeploymentLink="$lastDeploymentLink" />
@endif
</ol>
</nav>
diff --git a/resources/views/components/status/index.blade.php b/resources/views/components/status/index.blade.php
index 4ee3319ffa..c8a9f9b55c 100644
--- a/resources/views/components/status/index.blade.php
+++ b/resources/views/components/status/index.blade.php
@@ -1,9 +1,13 @@
+@props([
+ 'lastDeploymentInfo' => null,
+ 'lastDeploymentLink' => null,
+])
@if (str($resource->status)->startsWith('running'))
- <x-status.running :status="$resource->status" />
+ <x-status.running :status="$resource->status" :lastDeploymentInfo="$lastDeploymentInfo" :lastDeploymentLink="$lastDeploymentLink" />
@elseif(str($resource->status)->startsWith('restarting') ||
str($resource->status)->startsWith('starting') ||
str($resource->status)->startsWith('degraded'))
- <x-status.restarting :status="$resource->status" />
+ <x-status.restarting :status="$resource->status" :lastDeploymentInfo="$lastDeploymentInfo" :lastDeploymentLink="$lastDeploymentLink" />
@else
<x-status.stopped :status="$resource->status" />
@endif
diff --git a/resources/views/components/status/restarting.blade.php b/resources/views/components/status/restarting.blade.php
index bb555c745f..f269b4a5a3 100644
--- a/resources/views/components/status/restarting.blade.php
+++ b/resources/views/components/status/restarting.blade.php
@@ -1,12 +1,20 @@
@props([
'status' => 'Restarting',
+ 'lastDeploymentInfo' => null,
+ 'lastDeploymentLink' => null,
])
<div class="flex items-center">
<x-loading wire:loading.delay.longer />
<span wire:loading.remove.delay.longer class="flex items-center">
<div class="badge badge-warning "></div>
- <div class="pl-2 pr-1 text-xs font-bold tracking-wider dark:text-warning">
- {{ str($status)->before(':')->headline() }}
+ <div class="pl-2 pr-1 text-xs font-bold tracking-wider dark:text-warning" @if($lastDeploymentInfo) title="{{$lastDeploymentInfo}}" @endif>
+ @if ($lastDeploymentLink)
+ <a href="{{ $lastDeploymentLink }}" class="underline cursor-pointer">
+ {{ str($status)->before(':')->headline() }}
+ </a>
+ @else
+ {{ str($status)->before(':')->headline() }}
+ @endif
</div>
@if (!str($status)->startsWith('Proxy') && !str($status)->contains('('))
<div class="text-xs dark:text-warning">({{ str($status)->after(':') }})</div>
diff --git a/resources/views/components/status/running.blade.php b/resources/views/components/status/running.blade.php
index 52758303b3..b22f2d057e 100644
--- a/resources/views/components/status/running.blade.php
+++ b/resources/views/components/status/running.blade.php
@@ -1,12 +1,20 @@
@props([
'status' => 'Running',
+ 'lastDeploymentInfo' => null,
+ 'lastDeploymentLink' => null,
])
<div class="flex items-center">
<x-loading wire:loading.delay.longer />
<span wire:loading.remove.delay.longer class="flex items-center">
<div class="badge badge-success "></div>
- <div class="pl-2 pr-1 text-xs font-bold tracking-wider text-success">
+ <div class="pl-2 pr-1 text-xs font-bold tracking-wider text-success @if($lastDeploymentInfo) title="{{$lastDeploymentInfo}}" @endif>
+ @if ($lastDeploymentLink)
+ <a href="{{ $lastDeploymentLink }}" class="underline cursor-pointer">
+ {{ str($status)->before(':')->headline() }}
+ </a>
+ @else
{{ str($status)->before(':')->headline() }}
+ @endif
</div>
@if (!str($status)->startsWith('Proxy') && !str($status)->contains('('))
@if (str($status)->contains('unhealthy'))
@@ -17,8 +25,6 @@
</svg>
</x-slot:icon>
</x-helper>
- {{-- @else
- <div class="text-xs dark:text-success">({{ str($status)->after(':') }})</div> --}}
@endif
@endif
</span>
diff --git a/resources/views/livewire/project/application/heading.blade.php b/resources/views/livewire/project/application/heading.blade.php
index 7cd686d831..2f0bba535d 100644
--- a/resources/views/livewire/project/application/heading.blade.php
+++ b/resources/views/livewire/project/application/heading.blade.php
@@ -1,5 +1,5 @@
<nav wire:poll.5000ms="check_status">
- <x-resources.breadcrumbs :resource="$application" :parameters="$parameters" />
+ <x-resources.breadcrumbs :resource="$application" :parameters="$parameters" :lastDeploymentInfo="$lastDeploymentInfo" :lastDeploymentLink="$lastDeploymentLink" />
<div class="navbar-main">
<nav class="flex items-center flex-shrink-0 gap-6 scrollbar min-h-10 whitespace-nowrap">
<a href="{{ route('project.application.configuration', $parameters) }}">