diff --git a/app/Livewire/Tags/Deployments.php b/app/Livewire/Tags/Deployments.php index 5c43edfb1..07034ed5d 100644 --- a/app/Livewire/Tags/Deployments.php +++ b/app/Livewire/Tags/Deployments.php @@ -26,6 +26,7 @@ public function get_deployments() "server_id", "status" ])->sortBy('id')->groupBy('server_name')->toArray(); + $this->dispatch('deployments', $this->deployments_per_tag_per_server); } catch (\Exception $e) { return handleError($e, $this); } diff --git a/app/Livewire/Tags/Index.php b/app/Livewire/Tags/Index.php index d04bb53f9..c2b2a5928 100644 --- a/app/Livewire/Tags/Index.php +++ b/app/Livewire/Tags/Index.php @@ -20,6 +20,12 @@ class Index extends Component public $webhook = null; public $deployments_per_tag_per_server = []; + protected $listeners = ['deployments' => 'update_deployments']; + + public function update_deployments($deployments) + { + $this->deployments_per_tag_per_server = $deployments; + } public function tag_updated() { if ($this->tag == "") { @@ -39,14 +45,13 @@ public function tag_updated() public function redeploy_all() { try { - $message = collect([]); - $this->applications->each(function ($resource) use ($message) { + $this->applications->each(function ($resource){ $deploy = new Deploy(); - $message->push($deploy->deploy_resource($resource)); + $deploy->deploy_resource($resource); }); - $this->services->each(function ($resource) use ($message) { + $this->services->each(function ($resource) { $deploy = new Deploy(); - $message->push($deploy->deploy_resource($resource)); + $deploy->deploy_resource($resource); }); $this->dispatch('success', 'Mass deployment started.'); } catch (\Exception $e) { diff --git a/resources/css/app.css b/resources/css/app.css index 5858f5cc9..bb05b783b 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -203,7 +203,7 @@ .box-boarding { @apply flex lg:flex-row flex-col p-2 transition-colors cursor-pointer min-h-[4rem] dark:bg-coolgray-100 dark:text-white bg-neutral-50 border border-neutral-200 dark:border-black hover:bg-neutral-100 dark:hover:bg-coollabs-100 dark:hover:text-white hover:text-black hover:no-underline text-black; } .box-without-bg { - @apply flex p-2 transition-colors dark:hover:text-white hover:no-underline min-h-[4rem] border border-neutral-200 dark:border-black; + @apply flex p-2 transition-colors dark:hover:text-white hover:no-underline min-h-[4rem] border border-neutral-200 dark:border-black; } .box-without-bg-without-border { @apply flex p-2 transition-colors dark:hover:text-white hover:no-underline min-h-[4rem]; diff --git a/resources/views/livewire/tags/deployments.blade.php b/resources/views/livewire/tags/deployments.blade.php index 4d8581f79..03da021f9 100644 --- a/resources/views/livewire/tags/deployments.blade.php +++ b/resources/views/livewire/tags/deployments.blade.php @@ -1,25 +1,24 @@ -
+
@forelse ($deployments_per_tag_per_server as $server_name => $deployments)

{{ $server_name }}

-
+
@foreach ($deployments as $deployment) -
data_get($deployment, 'status') === 'queued', - 'border-yellow-500' => data_get($deployment, 'status') === 'in_progress', + 'dark:border-yellow-500' => + data_get($deployment, 'status') === 'in_progress', ])> - - +
+ @endforeach
@empty diff --git a/resources/views/livewire/tags/index.blade.php b/resources/views/livewire/tags/index.blade.php index 1fd62cefe..f91d4f00e 100644 --- a/resources/views/livewire/tags/index.blade.php +++ b/resources/views/livewire/tags/index.blade.php @@ -2,7 +2,7 @@

Tags

Tags help you to perform actions on multiple resources.
-
+
@if ($tags->count() === 0)
No tags yet defined yet. Go to a resource and add a tag there.
@else