From 4624a381b1ccac0f413ebfa308518ff172c448f5 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sat, 5 Oct 2024 20:55:23 +0200 Subject: [PATCH] new search input on "new resource" view --- app/Livewire/Project/New/Select.php | 115 +++ public/svgs/clickhouse.svg | 1 + public/svgs/postgresql.svg | 1 + .../views/components/resource-view.blade.php | 12 +- .../livewire/project/new/select.blade.php | 723 +++++------------- 5 files changed, 296 insertions(+), 556 deletions(-) create mode 100644 public/svgs/clickhouse.svg create mode 100644 public/svgs/postgresql.svg diff --git a/app/Livewire/Project/New/Select.php b/app/Livewire/Project/New/Select.php index 3c5f3901b..4c5c3a691 100644 --- a/app/Livewire/Project/New/Select.php +++ b/app/Livewire/Project/New/Select.php @@ -90,6 +90,121 @@ class Select extends Component // } // } + public function loadServices2() + { + $services = get_service_templates(true); + $services = collect($services)->map(function ($service, $key) { + return array_merge($service, [ + 'name' => str($key)->headline(), + 'logo' => asset($service['logo']), + ]); + })->all(); + $gitBasedApplications = [ + [ + 'id' => 'public', + 'name' => 'Public Repository', + 'description' => 'You can deploy any kind of public repositories from the supported git providers.', + 'logo' => asset('svgs/git.svg'), + ], + [ + 'id' => 'private-gh-app', + 'name' => 'Private Repository (with GitHub App)', + 'description' => 'You can deploy public & private repositories through your GitHub Apps.', + 'logo' => asset('svgs/github.svg'), + ], + [ + 'id' => 'private-deploy-key', + 'name' => 'Private Repository (with Deploy Key)', + 'description' => 'You can deploy private repositories with a deploy key.', + 'logo' => asset('svgs/git.svg'), + ], + ]; + $dockerBasedApplications = [ + [ + 'id' => 'dockerfile', + 'name' => 'Dockerfile', + 'description' => 'You can deploy a simple Dockerfile, without Git.', + 'logo' => asset('svgs/docker.svg'), + ], + [ + 'id' => 'docker-compose-empty', + 'name' => 'Docker Compose Empty', + 'description' => 'You can deploy complex application easily with Docker Compose, without Git.', + 'logo' => asset('svgs/docker.svg'), + ], + [ + 'id' => 'docker-image', + 'name' => 'Docker Image', + 'description' => 'You can deploy an existing Docker Image from any Registry, without Git.', + 'logo' => asset('svgs/docker.svg'), + ], + ]; + $databases = [ + [ + 'id' => 'postgresql', + 'name' => 'PostgreSQL', + 'description' => 'PostgreSQL is an object-relational database known for its robustness, advanced features, and strong standards compliance.', + 'logo' => ' +', + ], + [ + 'id' => 'mysql', + 'name' => 'MySQL', + 'description' => 'MySQL is an open-source relational database known for its simplicity and performance.', + 'logo' => ' + + + +', + + ], + [ + 'id' => 'mariadb', + 'name' => 'MariaDB', + 'description' => 'MariaDB is an open-source relational database known for its simplicity and performance.', + 'logo' => '', + ], + [ + 'id' => 'redis', + 'name' => 'Redis', + 'description' => 'Redis is an open-source in-memory data structure store known for its simplicity and performance.', + 'logo' => '', + ], + [ + 'id' => 'keydb', + 'name' => 'KeyDB', + 'description' => 'KeyDB is an open-source in-memory data structure store known for its simplicity and performance.', + 'logo' => '
', + ], + [ + 'id' => 'dragonfly', + 'name' => 'Dragonfly', + 'description' => 'Dragonfly is an open-source in-memory data structure store known for its simplicity and performance.', + 'logo' => '
', + ], + [ + 'id' => 'mongodb', + 'name' => 'MongoDB', + 'description' => 'MongoDB is an open-source document-oriented database known for its simplicity and performance.', + 'logo' => '', + ], + [ + 'id' => 'clickhouse', + 'name' => 'ClickHouse', + 'description' => 'ClickHouse is an open-source column-oriented database known for its simplicity and performance.', + 'logo' => '
', + ], + + ]; + + return [ + 'services' => $services, + 'gitBasedApplications' => $gitBasedApplications, + 'dockerBasedApplications' => $dockerBasedApplications, + 'databases' => $databases, + ]; + } + public function updatedSearch() { $this->loadServices(); diff --git a/public/svgs/clickhouse.svg b/public/svgs/clickhouse.svg new file mode 100644 index 000000000..d536536de --- /dev/null +++ b/public/svgs/clickhouse.svg @@ -0,0 +1 @@ + diff --git a/public/svgs/postgresql.svg b/public/svgs/postgresql.svg new file mode 100644 index 000000000..1ff223856 --- /dev/null +++ b/public/svgs/postgresql.svg @@ -0,0 +1 @@ + diff --git a/resources/views/components/resource-view.blade.php b/resources/views/components/resource-view.blade.php index a01e5ab53..741d8d476 100644 --- a/resources/views/components/resource-view.blade.php +++ b/resources/views/components/resource-view.blade.php @@ -2,8 +2,9 @@ 'transition-all duration-150 box-without-bg dark:bg-coolgray-100 bg-white group', 'hover:border-l-coollabs cursor-pointer' => !$upgrade, 'hover:border-l-red-500 cursor-not-allowed' => $upgrade, -]) @if (!$upgrade) wire:click={{ $wire }} @endif> +])>
+ {{ $logo }}
@@ -18,13 +19,4 @@ @endif
- @isset($documentation) -
- - @endisset
diff --git a/resources/views/livewire/project/new/select.blade.php b/resources/views/livewire/project/new/select.blade.php index c23c2e53b..9c2d30b3a 100644 --- a/resources/views/livewire/project/new/select.blade.php +++ b/resources/views/livewire/project/new/select.blade.php @@ -9,557 +9,189 @@ -
Deploy resources, like Applications, Databases, Services...
-
+
Deploy resources, like Applications, Databases, Services...
+
@if ($current_step === 'type') -

Applications

-

Git Based

+ +
Loading...
+

Applications

+

Git Based

- - Public Repository - - You can deploy any kind of public repositories from the supported git providers. - - - +
+ + + + + + + - - - - Private Repository (with GitHub App) - - You can deploy public & private repositories through your GitHub Apps. - - -
- - - - - - - -
-
-
- - Private Repository (with deploy key) - - You can deploy public & private repositories with a simple deploy key (SSH key). - - - - - -
-

Docker Based

-
- - Dockerfile - - You can deploy a simple Dockerfile, without Git. - - -
- - - - - - - - - - - - - - - - - - -
-
-
- - Docker Compose - - You can deploy complex application easily with Docker Compose, without Git. - - -
- - - - - - - - - - - - - - - - - - -
-
-
- - Existing Docker Image - - You can deploy an existing Docker Image from any Registry, without Git. - - -
- - - - - - - - - - - - - - - - - - -
-
-
-
-

Databases

-
- - PostgreSQL - - PostgreSQL is an object-relational database known for its - robustness, advanced features, and strong standards compliance. - - -
- - - - - - - - -
- -
-
- - Redis - - Redis is an open-source, in-memory data structure store, used as a database, cache, and message - broker. - - -
- - - - - - - - - - - - - -
-
-
- - DragonFly - - Dragonfly is a simple, performant, and cost-efficient in-memory data store, fully compatible - with Redis APIs but without the Redis management complexity. - - -
- - - - - -
-
-
- - KeyDB - - KeyDB is a fully open source database, backed by Snap, and a faster drop in alternative to - Redis. - - -
- - - - - - - - - - - - - - - - - - -
-
-
- - Clickhouse - - Clickhouse is an open-source column-oriented database management system. - - -
- - - - - - - - - -
-
-
- - MongoDB - - MongoDB is a source-available, NoSQL database that uses JSON-like documents with - optional schemas. - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - MySQL - - MySQL is a relational database known for its speed, reliability, and - flexibility. - - -
- - - - - -
-
-
- - Mariadb - - MariaDB is a relational database that serves as a drop-in - replacement for MySQL. - - -
- - - -
-
-
- - {{--
-
-
- Backup Existing PostgreSQL -
-
- Schedule a backup of an existing PostgreSQL database. -
+ :src="application.logo"> + +
-
--}} +
-
-

Services

- Reload List +

Docker Based

+
+
-
Trademarks Policy: The respective trademarks mentioned here are owned by the - respective - companies, and use of them does not imply any affiliation or endorsement.
Find more services here.
- - @if ($loadingServices) - - @else -
- @forelse ($services as $serviceName => $service) - @if (data_get($service, 'minversion') && version_compare(config('version'), data_get($service, 'minversion'), '<')) - - {{ Str::headline($serviceName) }} - - @if (data_get($service, 'slogan')) - {{ data_get($service, 'slogan') }} - @endif - - - @if (data_get($service, 'logo')) - - @endif - - - {{ data_get($service, 'documentation') }} - - - You need to upgrade Coolify to {{ data_get($service, 'minversion') }} to use this - service. - - - @else - - {{ Str::headline($serviceName) }} - - @if (data_get($service, 'slogan')) - {{ data_get($service, 'slogan') }} - @endif - - - @if (file_exists(public_path(data_get($service, 'logo')))) - - @endif - - - {{ data_get($service, 'documentation') }} - - - {{-- --}} - @endif - @empty -
No service found. Please try to reload the list!
- @endforelse + +

Databases

+
+ +
+
+
+

Services

+ Reload List
- @endif +
Trademarks Policy: The respective trademarks mentioned here are owned by the + respective + companies, and use of them does not imply any affiliation or endorsement.
Find more services here.
+ +
+ +
+
+
@endif @if ($current_step === 'servers') @@ -637,8 +269,7 @@