feat: simple search functionality
This commit is contained in:
parent
c82e02218f
commit
b2d111e49a
@ -5,7 +5,7 @@ namespace App\Console\Commands;
|
|||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Symfony\Component\Yaml\Yaml;
|
use Symfony\Component\Yaml\Yaml;
|
||||||
|
|
||||||
class GenerateServiceTemplates extends Command
|
class ServicesGenerate extends Command
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The name and signature of the console command.
|
* The name and signature of the console command.
|
||||||
@ -80,6 +80,14 @@ class GenerateServiceTemplates extends Command
|
|||||||
$env_file = null;
|
$env_file = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tags = collect(preg_grep('/^# tags:/', explode("\n", $content)))->values();
|
||||||
|
if ($tags->count() > 0) {
|
||||||
|
$tags = str($tags[0])->after('# tags:')->trim()->explode(',')->map(function ($tag) {
|
||||||
|
return str($tag)->trim()->lower()->value();
|
||||||
|
})->values();
|
||||||
|
} else {
|
||||||
|
$tags = null;
|
||||||
|
}
|
||||||
$json = Yaml::parse($content);
|
$json = Yaml::parse($content);
|
||||||
$yaml = base64_encode(Yaml::dump($json, 10, 2));
|
$yaml = base64_encode(Yaml::dump($json, 10, 2));
|
||||||
$payload = [
|
$payload = [
|
||||||
@ -87,6 +95,7 @@ class GenerateServiceTemplates extends Command
|
|||||||
'documentation' => $documentation,
|
'documentation' => $documentation,
|
||||||
'slogan' => $slogan,
|
'slogan' => $slogan,
|
||||||
'compose' => $yaml,
|
'compose' => $yaml,
|
||||||
|
'tags' => $tags,
|
||||||
];
|
];
|
||||||
if ($env_file) {
|
if ($env_file) {
|
||||||
$env_file_content = file_get_contents(base_path("templates/compose/$env_file"));
|
$env_file_content = file_get_contents(base_path("templates/compose/$env_file"));
|
@ -21,14 +21,18 @@ class Select extends Component
|
|||||||
public Collection|array $swarmDockers = [];
|
public Collection|array $swarmDockers = [];
|
||||||
public array $parameters;
|
public array $parameters;
|
||||||
public Collection|array $services = [];
|
public Collection|array $services = [];
|
||||||
|
public Collection|array $allServices = [];
|
||||||
|
|
||||||
public bool $loadingServices = true;
|
public bool $loadingServices = true;
|
||||||
public bool $loading = false;
|
public bool $loading = false;
|
||||||
public $environments = [];
|
public $environments = [];
|
||||||
public ?string $selectedEnvironment = null;
|
public ?string $selectedEnvironment = null;
|
||||||
public ?string $existingPostgresqlUrl = null;
|
public ?string $existingPostgresqlUrl = null;
|
||||||
|
|
||||||
|
public ?string $search = null;
|
||||||
protected $queryString = [
|
protected $queryString = [
|
||||||
'server',
|
'server',
|
||||||
|
'search'
|
||||||
];
|
];
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
@ -41,6 +45,11 @@ class Select extends Component
|
|||||||
$this->environments = Project::whereUuid($projectUuid)->first()->environments;
|
$this->environments = Project::whereUuid($projectUuid)->first()->environments;
|
||||||
$this->selectedEnvironment = data_get($this->parameters, 'environment_name');
|
$this->selectedEnvironment = data_get($this->parameters, 'environment_name');
|
||||||
}
|
}
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$this->loadServices();
|
||||||
|
return view('livewire.project.new.select');
|
||||||
|
}
|
||||||
|
|
||||||
public function updatedSelectedEnvironment()
|
public function updatedSelectedEnvironment()
|
||||||
{
|
{
|
||||||
@ -49,6 +58,7 @@ class Select extends Component
|
|||||||
'environment_name' => $this->selectedEnvironment,
|
'environment_name' => $this->selectedEnvironment,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function addExistingPostgresql()
|
// public function addExistingPostgresql()
|
||||||
// {
|
// {
|
||||||
// try {
|
// try {
|
||||||
@ -59,19 +69,28 @@ class Select extends Component
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
public function loadThings()
|
public function loadServices(bool $force = false)
|
||||||
{
|
|
||||||
$this->loadServices();
|
|
||||||
$this->loadServers();
|
|
||||||
}
|
|
||||||
public function loadServices(bool $forceReload = false)
|
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if ($forceReload) {
|
if (count($this->allServices) > 0 && !$force) {
|
||||||
Cache::forget('services');
|
if (!$this->search) {
|
||||||
|
$this->services = $this->allServices;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
$this->services = getServiceTemplates();
|
$this->services = $this->allServices->filter(function ($service, $key) {
|
||||||
|
$tags = collect(data_get($service, 'tags', []));
|
||||||
|
return str_contains(strtolower($key), strtolower($this->search)) || $tags->contains(function ($tag) {
|
||||||
|
return str_contains(strtolower($tag), strtolower($this->search));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$this->search = null;
|
||||||
|
$this->allServices = getServiceTemplates();
|
||||||
|
$this->services = $this->allServices->filter(function ($service, $key) {
|
||||||
|
return str_contains(strtolower($key), strtolower($this->search));
|
||||||
|
});;
|
||||||
$this->emit('success', 'Successfully loaded services.');
|
$this->emit('success', 'Successfully loaded services.');
|
||||||
|
}
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div x-data x-init="$wire.loadThings">
|
<div x-data x-init="$wire.loadServers">
|
||||||
<div class="flex gap-2 ">
|
<div class="flex gap-2 ">
|
||||||
<h1>New Resource</h1>
|
<h1>New Resource</h1>
|
||||||
<div class="w-96">
|
<div class="w-96">
|
||||||
@ -128,12 +128,15 @@
|
|||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<h2 class="py-4">Services</h2>
|
<h2 class="py-4">Services</h2>
|
||||||
<x-forms.button wire:click='loadServices(true)'>Reload Services List</x-forms.button>
|
<x-forms.button wire:click='loadServices(true)'>Reload Services List</x-forms.button>
|
||||||
|
<input
|
||||||
|
class="w-full text-white rounded input input-sm bg-coolgray-200 disabled:bg-coolgray-200/50 disabled:border-none placeholder:text-coolgray-500 read-only:text-neutral-500 read-only:bg-coolgray-200/50"
|
||||||
|
wire:model.debounce.200ms="search" placeholder="Search..."></input>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid justify-start grid-cols-1 gap-2 text-left xl:grid-cols-3">
|
<div class="grid justify-start grid-cols-1 gap-2 text-left xl:grid-cols-3">
|
||||||
@if ($loadingServices)
|
@if ($loadingServices)
|
||||||
<span class="loading loading-xs loading-spinner"></span>
|
<span class="loading loading-xs loading-spinner"></span>
|
||||||
@else
|
@else
|
||||||
@foreach ($services as $serviceName => $service)
|
@forelse ($services as $serviceName => $service)
|
||||||
@if (data_get($service, 'disabled'))
|
@if (data_get($service, 'disabled'))
|
||||||
<button class="text-left cursor-not-allowed bg-coolgray-200/20 box-without-bg" disabled>
|
<button class="text-left cursor-not-allowed bg-coolgray-200/20 box-without-bg" disabled>
|
||||||
<div class="flex flex-col mx-6">
|
<div class="flex flex-col mx-6">
|
||||||
@ -158,7 +161,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@empty
|
||||||
|
<div>No service found.</div>
|
||||||
|
@endforelse
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div class="py-4 pb-10">Trademarks Policy: The respective trademarks mentioned here are owned by the
|
<div class="py-4 pb-10">Trademarks Policy: The respective trademarks mentioned here are owned by the
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://docs.appsmith.com
|
# documentation: https://docs.appsmith.com
|
||||||
# slogan: Appsmith is an open-source, self-hosted application development platform that enables you to build powerful web applications with ease.
|
# slogan: Appsmith is an open-source, self-hosted application development platform that enables you to build powerful web applications with ease.
|
||||||
|
# tags: lowcode,nocode,no,low,platform
|
||||||
|
|
||||||
services:
|
services:
|
||||||
appsmith:
|
appsmith:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# documentation: https://appwrite.io/docs
|
# documentation: https://appwrite.io/docs
|
||||||
# slogan: Appwrite is a self-hosted backend-as-a-service platform that simplifies the development of web and mobile applications by providing a range of features and APIs.
|
# slogan: Appwrite is a self-hosted backend-as-a-service platform that simplifies the development of web and mobile applications by providing a range of features and APIs.
|
||||||
# env_file: appwrite.env
|
# env_file: appwrite.env
|
||||||
|
# tags: backend-as-a-service, platform
|
||||||
|
|
||||||
|
|
||||||
x-logging: &x-logging
|
x-logging: &x-logging
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://docs.baby-buddy.net
|
# documentation: https://docs.baby-buddy.net
|
||||||
# slogan: Baby Buddy is an open-source web application that helps parents track their baby's daily activities, growth, and health with ease.
|
# slogan: Baby Buddy is an open-source web application that helps parents track their baby's daily activities, growth, and health with ease.
|
||||||
|
# tags: baby, parents, health, growth, activities
|
||||||
|
|
||||||
services:
|
services:
|
||||||
babybuddy:
|
babybuddy:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://coder.com/docs/code-server/latest/guide
|
# documentation: https://coder.com/docs/code-server/latest/guide
|
||||||
# slogan: Code-Server is a self-hosted, web-based code editor that enables remote coding and collaboration from any device, anywhere.
|
# slogan: Code-Server is a self-hosted, web-based code editor that enables remote coding and collaboration from any device, anywhere.
|
||||||
|
# tags: code, editor, remote, collaboration
|
||||||
|
|
||||||
services:
|
services:
|
||||||
code-server:
|
code-server:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://www.dokuwiki.org/faq
|
# documentation: https://www.dokuwiki.org/faq
|
||||||
# slogan: A lightweight and easy-to-use wiki platform for creating and managing documentation and knowledge bases with simplicity and flexibility.
|
# slogan: A lightweight and easy-to-use wiki platform for creating and managing documentation and knowledge bases with simplicity and flexibility.
|
||||||
|
# tags: wiki, documentation, knowledge, base
|
||||||
|
|
||||||
services:
|
services:
|
||||||
dokuwiki:
|
dokuwiki:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://fider.io/doc
|
# documentation: https://fider.io/doc
|
||||||
# slogan: Fider is an open-source feedback platform for collecting and managing user feedback, helping you prioritize improvements to your products and services.
|
# slogan: Fider is an open-source feedback platform for collecting and managing user feedback, helping you prioritize improvements to your products and services.
|
||||||
|
# tags: feedback, user-feedback
|
||||||
|
|
||||||
services:
|
services:
|
||||||
fider:
|
fider:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://ghost.org/docs
|
# documentation: https://ghost.org/docs
|
||||||
# slogan: Ghost is a popular open-source content management system (CMS) and blogging platform, known for its simplicity and focus on content creation.
|
# slogan: Ghost is a popular open-source content management system (CMS) and blogging platform, known for its simplicity and focus on content creation.
|
||||||
|
# tags: cms, blog, content, management, system
|
||||||
|
|
||||||
services:
|
services:
|
||||||
ghost:
|
ghost:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://github.com/linuxserver/Heimdall
|
# documentation: https://github.com/linuxserver/Heimdall
|
||||||
# slogan: Heimdall is a self-hosted dashboard for managing and organizing your server applications, providing a centralized and efficient interface.
|
# slogan: Heimdall is a self-hosted dashboard for managing and organizing your server applications, providing a centralized and efficient interface.
|
||||||
|
# tags: dashboard, server, applications, interface
|
||||||
|
|
||||||
services:
|
services:
|
||||||
heimdall:
|
heimdall:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://github.com/alexta69/metube
|
# documentation: https://github.com/alexta69/metube
|
||||||
# slogan: A web GUI for youtube-dl with playlist support. It enables you to effortlessly download videos from YouTube and dozens of other sites.
|
# slogan: A web GUI for youtube-dl with playlist support. It enables you to effortlessly download videos from YouTube and dozens of other sites.
|
||||||
|
# tags: youtube, download, videos, playlist
|
||||||
|
|
||||||
services:
|
services:
|
||||||
metube:
|
metube:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://docs.min.io/docs/minio-docker-quickstart-guide.html
|
# documentation: https://docs.min.io/docs/minio-docker-quickstart-guide.html
|
||||||
# slogan: MinIO is a high performance object storage server compatible with Amazon S3 APIs.
|
# slogan: MinIO is a high performance object storage server compatible with Amazon S3 APIs.
|
||||||
|
# tags: object, storage, server, s3, api
|
||||||
|
|
||||||
services:
|
services:
|
||||||
minio:
|
minio:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://github.com/schlagmichdoch/PairDrop/blob/master/docs/faq.md
|
# documentation: https://github.com/schlagmichdoch/PairDrop/blob/master/docs/faq.md
|
||||||
# slogan: Pairdrop is a self-hosted file sharing and collaboration platform, offering secure file sharing and collaboration capabilities for efficient teamwork.
|
# slogan: Pairdrop is a self-hosted file sharing and collaboration platform, offering secure file sharing and collaboration capabilities for efficient teamwork.
|
||||||
|
# tags: file, sharing, collaboration, teamwork
|
||||||
|
|
||||||
services:
|
services:
|
||||||
pairdrop:
|
pairdrop:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# ignore: true
|
# ignore: true
|
||||||
# documentation: https://plausible.io/docs/self-hosting
|
# documentation: https://plausible.io/docs/self-hosting
|
||||||
# slogan: "Plausible Analytics is a simple, open-source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics."
|
# slogan: "Plausible Analytics is a simple, open-source, lightweight (< 1 KB) and privacy-friendly web analytics alternative to Google Analytics."
|
||||||
|
# tags: analytics, privacy, google, alternative
|
||||||
|
|
||||||
version: "3.3"
|
version: "3.3"
|
||||||
services:
|
services:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://github.com/RobinLinus/snapdrop/blob/master/docs/faq.md
|
# documentation: https://github.com/RobinLinus/snapdrop/blob/master/docs/faq.md
|
||||||
# slogan: A self-hosted file-sharing service for secure and convenient file transfers, whether on a local network or the internet.
|
# slogan: A self-hosted file-sharing service for secure and convenient file transfers, whether on a local network or the internet.
|
||||||
|
# tags: file, sharing, transfer, local, network, internet
|
||||||
|
|
||||||
services:
|
services:
|
||||||
snapdrop:
|
snapdrop:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://umami.is/docs/getting-started
|
# documentation: https://umami.is/docs/getting-started
|
||||||
# slogan: Umami is a lightweight, self-hosted web analytics platform designed to provide website owners with insights into visitor behavior without compromising user privacy.
|
# slogan: Umami is a lightweight, self-hosted web analytics platform designed to provide website owners with insights into visitor behavior without compromising user privacy.
|
||||||
|
# tags: analytics, insights, privacy
|
||||||
|
|
||||||
services:
|
services:
|
||||||
umami:
|
umami:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://github.com/louislam/uptime-kuma/wiki
|
# documentation: https://github.com/louislam/uptime-kuma/wiki
|
||||||
# slogan: Uptime Kuma is a free, self-hosted monitoring tool for tracking the status and performance of your web services and applications in real-time.
|
# slogan: Uptime Kuma is a free, self-hosted monitoring tool for tracking the status and performance of your web services and applications in real-time.
|
||||||
|
# tags: monitoring, status, performance, web, services, applications, real-time
|
||||||
|
|
||||||
services:
|
services:
|
||||||
uptime-kuma:
|
uptime-kuma:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://wordpress.org/documentation/
|
# documentation: https://wordpress.org/documentation/
|
||||||
# slogan: "WordPress is open source software you can use to create a beautiful website, blog, or app."
|
# slogan: "WordPress is open source software you can use to create a beautiful website, blog, or app."
|
||||||
|
# tags: cms, blog, content, management, mariadb
|
||||||
|
|
||||||
services:
|
services:
|
||||||
wordpress:
|
wordpress:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://wordpress.org/documentation/
|
# documentation: https://wordpress.org/documentation/
|
||||||
# slogan: "WordPress is open source software you can use to create a beautiful website, blog, or app."
|
# slogan: "WordPress is open source software you can use to create a beautiful website, blog, or app."
|
||||||
|
# tags: cms, blog, content, management, mysql
|
||||||
|
|
||||||
services:
|
services:
|
||||||
wordpress:
|
wordpress:
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# documentation: https://wordpress.org/documentation/
|
# documentation: https://wordpress.org/documentation/
|
||||||
# slogan: "WordPress is open source software you can use to create a beautiful website, blog, or app."
|
# slogan: "WordPress is open source software you can use to create a beautiful website, blog, or app."
|
||||||
|
# tags: cms, blog, content, management
|
||||||
|
|
||||||
services:
|
services:
|
||||||
wordpress:
|
wordpress:
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user