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.

wip

Andras Bacsaiae144588cc22
diff --git a/app/Http/Livewire/Project/Application/Revert.php b/app/Http/Livewire/Project/Application/Revert.php
index f1917ef850..0008fa3b72 100644
--- a/app/Http/Livewire/Project/Application/Revert.php
+++ b/app/Http/Livewire/Project/Application/Revert.php
@@ -11,6 +11,10 @@ class Revert extends Component
public Application $application;
public $images = [];
public string $current;
+ public function revertImage($tag)
+ {
+ dd("Reverting to {$this->application->uuid}:{$tag}");
+ }
public function loadImages()
{
try {
@@ -29,11 +33,12 @@ class Revert extends Component
})->map(function ($item) {
$item = Str::of($item)->explode('#');
if ($item[1] === $this->current) {
- $item[1] = $item[1] . " (current)";
+ $is_current = true;
}
return [
'tag' => $item[1],
- 'createdAt' => $item[2],
+ 'created_at' => $item[2],
+ 'is_current' => $is_current ?? null,
];
})->toArray();
} catch (\Throwable $e) {
diff --git a/resources/views/livewire/project/application/revert.blade.php b/resources/views/livewire/project/application/revert.blade.php
index 2ca8e5e291..514238add6 100644
--- a/resources/views/livewire/project/application/revert.blade.php
+++ b/resources/views/livewire/project/application/revert.blade.php
@@ -2,18 +2,23 @@
<div wire:loading wire:target='loadImages'>
<x-loading />
</div>
- <div wire:loading.remove>
+ <div wire:loading.remove wire:target='loadImages'>
<div class="flex flex-wrap">
@forelse ($images as $image)
<div class="w-1/2 p-2">
- <div class="rounded-lg shadow-lg bg-coolgray-200 ">
+ <div class="rounded-lg shadow-lg bg-coolgray-200">
<div class="p-2">
- <div class="text-sm font-bold">{{ data_get($image, 'tag') }}</div>
- <div class="text-xs">{{ data_get($image, 'createdAt') }}</div>
+ <div class="text-sm">
+ @if (data_get($image, 'is_current'))
+ <span class="font-bold text-coollabs">LIVE</span>
+ @endif
+ | {{ data_get($image, 'tag') }}
+ </div>
+
+ <div class="text-xs">{{ data_get($image, 'created_at') }}</div>
</div>
<div class="flex justify-end p-2">
- <x-inputs.button
- wire:click="revertImage('{{ data_get($image, 'name') }}', '{{ data_get($image, 'tag') }}')">
+ <x-inputs.button wire:click="revertImage('{{ data_get($image, 'tag') }}')">
Revert
</x-inputs.button>
</div>