From 408738e08def21a1ae99781c345997d827000b91 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 12 Jan 2024 11:31:51 +0100 Subject: [PATCH] Add service status to Index.php and update resource display in index.blade.php --- app/Livewire/Project/Resource/Index.php | 1 + .../livewire/project/resource/index.blade.php | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/app/Livewire/Project/Resource/Index.php b/app/Livewire/Project/Resource/Index.php index 6a170ace8..718b5003c 100644 --- a/app/Livewire/Project/Resource/Index.php +++ b/app/Livewire/Project/Resource/Index.php @@ -103,6 +103,7 @@ class Index extends Component 'environment_name' => data_get($service, 'environment.name'), 'service_uuid' => data_get($service, 'uuid') ]); + $service->status = serviceStatus($service); } return $service; }); diff --git a/resources/views/livewire/project/resource/index.blade.php b/resources/views/livewire/project/resource/index.blade.php index ca2325419..921e9c360 100644 --- a/resources/views/livewire/project/resource/index.blade.php +++ b/resources/views/livewire/project/resource/index.blade.php @@ -150,6 +150,23 @@ + @@ -164,6 +181,7 @@ mongodbs: @js($mongodbs), mysqls: @js($mysqls), mariadbs: @js($mariadbs), + services: @js($services), get filteredApplications() { if (this.search === '') { return this.applications; @@ -225,6 +243,16 @@ item.description?.toLowerCase().includes(this.search.toLowerCase()); }); }, + get filteredServices() { + if (this.search === '') { + return this.services; + } + this.services = Object.values(this.services); + return this.services.filter(item => { + return item.name.toLowerCase().includes(this.search.toLowerCase()) || + item.description?.toLowerCase().includes(this.search.toLowerCase()); + }); + }, }; }