diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 1a177a90b..b0c6680d9 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -19,7 +19,7 @@ public function environments() return view('project.environments', ['project' => $project]); } - public function resources_new() + public function new() { $project = session('currentTeam')->load(['projects'])->projects->where('uuid', request()->route('project_uuid'))->first(); if (!$project) { @@ -29,7 +29,12 @@ public function resources_new() if (!$environment) { return redirect()->route('dashboard'); } - return view('project.new', ['project' => $project, 'environment' => $environment, 'type' => 'resource']); + + $type = request()->query('type'); + + return view('project.new', [ + 'type' => $type + ]); } public function resources() { diff --git a/app/Http/Livewire/Project/New/GithubPrivateRepository.php b/app/Http/Livewire/Project/New/GithubPrivateRepository.php index c70d27c25..9ffc144ac 100644 --- a/app/Http/Livewire/Project/New/GithubPrivateRepository.php +++ b/app/Http/Livewire/Project/New/GithubPrivateRepository.php @@ -6,6 +6,8 @@ use App\Models\GithubApp; use App\Models\Project; use App\Models\Server; +use App\Models\StandaloneDocker; +use App\Models\SwarmDocker; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Log; @@ -16,6 +18,7 @@ class GithubPrivateRepository extends Component public $github_apps; public GithubApp $github_app; public $parameters; + public $query; public $type; public int $selected_repository_id; @@ -24,16 +27,10 @@ class GithubPrivateRepository extends Component public string $selected_branch_name = 'main'; - public int $selected_server_id; - public int $selected_destination_id; - public string $selected_destination_class; - public string $token; protected int $page = 1; - public $servers; - public $destinations; public $repositories; public int $total_repositories_count = 0; @@ -42,7 +39,6 @@ class GithubPrivateRepository extends Component protected function loadRepositoryByPage() { - Log::info('Loading page ' . $this->page); $response = Http::withToken($this->token)->get("{$this->github_app->api_url}/installation/repositories?per_page=100&page={$this->page}"); $json = $response->json(); if ($response->status() !== 200) { @@ -96,55 +92,37 @@ public function loadBranches() } } } - public function loadServers() - { - try { - $this->servers = Server::validated(); - $this->selected_server_id = $this->servers[0]['id']; - } catch (\Exception $e) { - return generalErrorHandler($e); - } - } - public function loadDestinations() - { - try { - $server = $this->servers->where('id', $this->selected_server_id)->first(); - if ($server->standaloneDockers->count() === 0 && $server->swarmDockers->count() === 0) { - $this->destinations = 0; - } - $this->destinations = $server->standaloneDockers->merge($server->swarmDockers); - $this->selected_destination_id = $this->destinations[0]['id']; - $this->selected_destination_class = $this->destinations[0]->getMorphClass(); - } catch (\Exception $e) { - return generalErrorHandler($e); - } - } public function submit() { try { - if ($this->type === 'project') { - $project = Project::create([ - 'name' => generateRandomName(), - 'team_id' => session('currentTeam')->id - ]); - $environment = $project->load(['environments'])->environments->first(); - } else { - $project = Project::where('uuid', $this->parameters['project_uuid'])->first(); - $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first(); + $destination_uuid = $this->query['destination']; + $destination = StandaloneDocker::where('uuid', $destination_uuid)->first(); + if (!$destination) { + $destination = SwarmDocker::where('uuid', $destination_uuid)->first(); } + if (!$destination) { + throw new \Exception('Destination not found. What?!'); + } + $destination_class = $destination->getMorphClass(); + + + $project = Project::where('uuid', $this->parameters['project_uuid'])->first(); + $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first(); + $application = Application::create([ 'name' => generateRandomName() . "-{$this->selected_repository_owner}/{$this->selected_repository_repo}:{$this->selected_branch_name}", - 'project_id' => $this->selected_repository_id, + 'repository_project_id' => $this->selected_repository_id, 'git_repository' => "{$this->selected_repository_owner}/{$this->selected_repository_repo}", 'git_branch' => $this->selected_branch_name, 'build_pack' => 'nixpacks', 'ports_exposes' => '3000', 'environment_id' => $environment->id, - 'destination_id' => $this->selected_destination_id, - 'destination_type' => $this->selected_destination_class, + 'destination_id' => $destination->id, + 'destination_type' => $destination_class, 'source_id' => $this->github_app->id, 'source_type' => GithubApp::class, ]); + redirect()->route('project.application.configuration', [ 'application_uuid' => $application->uuid, 'project_uuid' => $project->uuid, @@ -157,7 +135,8 @@ public function submit() public function mount() { $this->parameters = getParameters(); - $this->repositories = $this->branches = $this->servers = $this->destinations = collect(); + $this->query = request()->query(); + $this->repositories = $this->branches = collect(); $this->github_apps = GithubApp::private(); } } diff --git a/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php b/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php index cd9679de7..325d55a45 100644 --- a/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php +++ b/app/Http/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php @@ -13,16 +13,11 @@ class GithubPrivateRepositoryDeployKey extends Component { public $parameters; + public $query; public $private_keys; public int $private_key_id; public string $repository_url; - public $servers; - public $standalone_docker; - public $swarm_docker; - public $chosenServer; - public $chosenDestination; - public int $port = 3000; public string $type; @@ -40,20 +35,8 @@ public function mount() $this->repository_url = 'https://github.com/coollabsio/coolify-examples/tree/nodejs-fastify'; } $this->parameters = getParameters(); + $this->query = request()->query(); $this->private_keys = PrivateKey::where('team_id', session('currentTeam')->id)->get(); - $this->servers = session('currentTeam')->load(['servers'])->servers; - } - public function chooseServer($server) - { - $this->chosenServer = $server; - $this->standalone_docker = StandaloneDocker::where('server_id', $server['id'])->get(); - $this->swarm_docker = SwarmDocker::where('server_id', $server['id'])->get(); - } - public function setDestination($destination_uuid, $destination_type) - { - $class = "App\Models\\{$destination_type}"; - $instance = new $class; - $this->chosenDestination = $instance::where('uuid', $destination_uuid)->first(); } public function instantSave() { @@ -71,43 +54,49 @@ public function setPrivateKey($private_key_id) } public function submit() { - $this->validate(); - $url = Url::fromString($this->repository_url); - $git_host = $url->getHost(); - $git_repository = $url->getSegment(1) . '/' . $url->getSegment(2); - $git_branch = $url->getSegment(4) ?? 'main'; + try { + $this->validate(); + $url = Url::fromString($this->repository_url); + $git_host = $url->getHost(); + $git_repository = $url->getSegment(1) . '/' . $url->getSegment(2); + $git_branch = $url->getSegment(4) ?? 'main'; - if ($this->type === 'project') { - $project = Project::create([ - 'name' => generateRandomName(), - 'team_id' => session('currentTeam')->id, + $destination_uuid = $this->query['destination']; + $destination = StandaloneDocker::where('uuid', $destination_uuid)->first(); + if (!$destination) { + $destination = SwarmDocker::where('uuid', $destination_uuid)->first(); + } + if (!$destination) { + throw new \Exception('Destination not found. What?!'); + } + $destination_class = $destination->getMorphClass(); + + $project = Project::where('uuid', $this->parameters['project_uuid'])->first(); + $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first(); + $application_init = [ + 'name' => generateRandomName() . "-{$git_repository}:{$git_branch}", + 'git_repository' => $git_repository, + 'git_branch' => $git_branch, + 'git_full_url' => "git@$git_host:$git_repository.git", + 'build_pack' => 'nixpacks', + 'ports_exposes' => $this->port, + 'publish_directory' => $this->publish_directory, + 'environment_id' => $environment->id, + 'destination_id' => $destination->id, + 'destination_type' => $destination_class, + 'private_key_id' => $this->private_key_id, + ]; + $application = Application::create($application_init); + $application->settings->is_static = $this->is_static; + $application->settings->save(); + + return redirect()->route('project.application.configuration', [ + 'project_uuid' => $project->uuid, + 'environment_name' => $environment->name, + 'application_uuid' => $application->uuid, ]); - $environment = $project->environments->first(); - } else { - $project = Project::where('uuid', $this->parameters['project_uuid'])->firstOrFail(); - $environment = $project->environments->where('name', $this->parameters['environment_name'])->firstOrFail(); + } catch (\Exception $e) { + return generalErrorHandler($e, $this); } - $application_init = [ - 'name' => generateRandomName() . "-{$git_repository}:{$git_branch}", - 'git_repository' => $git_repository, - 'git_branch' => $git_branch, - 'git_full_url' => "git@$git_host:$git_repository.git", - 'build_pack' => 'nixpacks', - 'ports_exposes' => $this->port, - 'publish_directory' => $this->publish_directory, - 'environment_id' => $environment->id, - 'destination_id' => $this->chosenDestination->id, - 'destination_type' => $this->chosenDestination->getMorphClass(), - 'private_key_id' => $this->private_key_id, - ]; - $application = Application::create($application_init); - $application->settings->is_static = $this->is_static; - $application->settings->save(); - - return redirect()->route('project.application.configuration', [ - 'project_uuid' => $project->uuid, - 'environment_name' => $environment->name, - 'application_uuid' => $application->uuid, - ]); } } diff --git a/app/Http/Livewire/Project/New/PublicGitRepository.php b/app/Http/Livewire/Project/New/PublicGitRepository.php index 262c66a24..d238a63d5 100644 --- a/app/Http/Livewire/Project/New/PublicGitRepository.php +++ b/app/Http/Livewire/Project/New/PublicGitRepository.php @@ -8,7 +8,6 @@ use App\Models\Project; use App\Models\StandaloneDocker; use App\Models\SwarmDocker; -use Illuminate\Support\Facades\Route; use Livewire\Component; use Spatie\Url\Url; @@ -18,12 +17,8 @@ class PublicGitRepository extends Component public int $port = 3000; public string $type; public $parameters; + public $query; - public $servers; - public $standalone_docker; - public $swarm_docker; - public $chosenServer; - public $chosenDestination; public $github_apps; public $gitlab_apps; @@ -43,19 +38,7 @@ public function mount() $this->port = 3000; } $this->parameters = getParameters(); - $this->servers = session('currentTeam')->load(['servers'])->servers; - } - public function chooseServer($server) - { - $this->chosenServer = $server; - $this->standalone_docker = StandaloneDocker::where('server_id', $server['id'])->get(); - $this->swarm_docker = SwarmDocker::where('server_id', $server['id'])->get(); - } - public function setDestination($destination_uuid, $destination_type) - { - $class = "App\Models\\{$destination_type}"; - $instance = new $class; - $this->chosenDestination = $instance::where('uuid', $destination_uuid)->first(); + $this->query = request()->query(); } public function instantSave() @@ -72,49 +55,58 @@ public function instantSave() public function submit() { - $this->validate(); - $url = Url::fromString($this->repository_url); - $git_host = $url->getHost(); - $git_repository = $url->getSegment(1) . '/' . $url->getSegment(2); - $git_branch = $url->getSegment(4) ?? 'main'; + try { + $this->validate(); - if ($this->type === 'project') { - $project = Project::create([ - 'name' => generateRandomName(), - 'team_id' => session('currentTeam')->id, + $url = Url::fromString($this->repository_url); + $git_host = $url->getHost(); + $git_repository = $url->getSegment(1) . '/' . $url->getSegment(2); + $git_branch = $url->getSegment(4) ?? 'main'; + + $destination_uuid = $this->query['destination']; + $destination = StandaloneDocker::where('uuid', $destination_uuid)->first(); + if (!$destination) { + $destination = SwarmDocker::where('uuid', $destination_uuid)->first(); + } + if (!$destination) { + throw new \Exception('Destination not found. What?!'); + } + $destination_class = $destination->getMorphClass(); + + $project = Project::where('uuid', $this->parameters['project_uuid'])->first(); + $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first(); + + + $application_init = [ + 'name' => generateRandomName() . "-{$git_repository}:{$git_branch}", + 'git_repository' => $git_repository, + 'git_branch' => $git_branch, + 'build_pack' => 'nixpacks', + 'ports_exposes' => $this->port, + 'publish_directory' => $this->publish_directory, + 'environment_id' => $environment->id, + 'destination_id' => $destination->id, + 'destination_type' => $destination_class, + ]; + if ($git_host == 'github.com') { + $application_init['source_id'] = GithubApp::where('name', 'Public GitHub')->first()->id; + $application_init['source_type'] = GithubApp::class; + } elseif ($git_host == 'gitlab.com') { + $application_init['source_id'] = GitlabApp::where('name', 'Public GitLab')->first()->id; + $application_init['source_type'] = GitlabApp::class; + } elseif ($git_host == 'bitbucket.org') { + } + $application = Application::create($application_init); + $application->settings->is_static = $this->is_static; + $application->settings->save(); + + return redirect()->route('project.application.configuration', [ + 'project_uuid' => $project->uuid, + 'environment_name' => $environment->name, + 'application_uuid' => $application->uuid, ]); - $environment = $project->environments->first(); - } else { - $project = Project::where('uuid', $this->parameters['project_uuid'])->firstOrFail(); - $environment = $project->environments->where('name', $this->parameters['environment_name'])->firstOrFail(); + } catch (\Exception $e) { + return generalErrorHandler($e); } - $application_init = [ - 'name' => generateRandomName() . "-{$git_repository}:{$git_branch}", - 'git_repository' => $git_repository, - 'git_branch' => $git_branch, - 'build_pack' => 'nixpacks', - 'ports_exposes' => $this->port, - 'publish_directory' => $this->publish_directory, - 'environment_id' => $environment->id, - 'destination_id' => $this->chosenDestination->id, - 'destination_type' => $this->chosenDestination->getMorphClass(), - ]; - if ($git_host == 'github.com') { - $application_init['source_id'] = GithubApp::where('name', 'Public GitHub')->first()->id; - $application_init['source_type'] = GithubApp::class; - } elseif ($git_host == 'gitlab.com') { - $application_init['source_id'] = GitlabApp::where('name', 'Public GitLab')->first()->id; - $application_init['source_type'] = GitlabApp::class; - } elseif ($git_host == 'bitbucket.org') { - } - $application = Application::create($application_init); - $application->settings->is_static = $this->is_static; - $application->settings->save(); - - return redirect()->route('project.application.configuration', [ - 'project_uuid' => $project->uuid, - 'environment_name' => $environment->name, - 'application_uuid' => $application->uuid, - ]); } } diff --git a/app/Models/Server.php b/app/Models/Server.php index fd337bb69..eae23c55a 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -28,6 +28,7 @@ protected static function booted() 'extra_attributes' => SchemalessAttributes::class, ]; + public function standaloneDockers() { return $this->hasMany(StandaloneDocker::class); @@ -57,4 +58,11 @@ static public function validated() { return Server::where('team_id', session('currentTeam')->id)->whereRelation('settings', 'is_validated', true)->get(); } + static public function destinations($server_uuid) + { + $server = Server::where('team_id', session('currentTeam')->id)->where('uuid', $server_uuid)->firstOrFail(); + $standaloneDocker = collect($server->standaloneDockers->all()); + $swarmDocker = collect($server->swarmDockers->all()); + return $standaloneDocker->concat($swarmDocker); + } } diff --git a/bootstrap/helpers.php b/bootstrap/helpers.php index b6899f52d..aecb5d879 100644 --- a/bootstrap/helpers.php +++ b/bootstrap/helpers.php @@ -17,22 +17,31 @@ if (!function_exists('generalErrorHandler')) { - function generalErrorHandler(\Throwable $e, $that = null) + function generalErrorHandler(\Throwable $e, $that = null, $isJson = false) { - if ($that) { + try { if ($e instanceof QueryException) { if ($e->errorInfo[0] === '23505') { - $that->emit('error', 'Duplicate entry found.'); + throw new \Exception('Duplicate entry found.', '23505'); } else if (count($e->errorInfo) === 4) { - $that->emit('error', $e->errorInfo[3]); + throw new \Exception($e->errorInfo[3]); } else { - $that->emit('error', $e->errorInfo[2]); + throw new \Exception($e->errorInfo[2]); } } else { - $that->emit('error', $e->getMessage()); + throw new \Exception($e->getMessage()); + } + } catch (\Throwable $error) { + if ($that) { + $that->emit('error', $error); + } elseif ($isJson) { + return response()->json([ + 'code' => $error->getCode(), + 'error' => $error->getMessage(), + ]); + } else { + dump('Duplicate entry found.'); } - } else { - dump($e); } } } diff --git a/composer.lock b/composer.lock index 8754c8015..565627d32 100644 --- a/composer.lock +++ b/composer.lock @@ -1422,16 +1422,16 @@ }, { "name": "laravel/fortify", - "version": "v1.17.1", + "version": "v1.17.2", "source": { "type": "git", "url": "https://github.com/laravel/fortify.git", - "reference": "76908639d6c58a4996ce8bbacea9ec7f610b2ec6" + "reference": "fc4b9b00b0d657dd035751b286f412976596ba32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/fortify/zipball/76908639d6c58a4996ce8bbacea9ec7f610b2ec6", - "reference": "76908639d6c58a4996ce8bbacea9ec7f610b2ec6", + "url": "https://api.github.com/repos/laravel/fortify/zipball/fc4b9b00b0d657dd035751b286f412976596ba32", + "reference": "fc4b9b00b0d657dd035751b286f412976596ba32", "shasum": "" }, "require": { @@ -1482,20 +1482,20 @@ "issues": "https://github.com/laravel/fortify/issues", "source": "https://github.com/laravel/fortify" }, - "time": "2023-04-19T15:48:59+00:00" + "time": "2023-04-26T13:35:07+00:00" }, { "name": "laravel/framework", - "version": "v10.9.0", + "version": "v10.10.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "35078125f61ef0b125edf524de934f108d4b47fd" + "reference": "0da22a8d179f79b49d4e71f4822f759651f35012" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/35078125f61ef0b125edf524de934f108d4b47fd", - "reference": "35078125f61ef0b125edf524de934f108d4b47fd", + "url": "https://api.github.com/repos/laravel/framework/zipball/0da22a8d179f79b49d4e71f4822f759651f35012", + "reference": "0da22a8d179f79b49d4e71f4822f759651f35012", "shasum": "" }, "require": { @@ -1682,7 +1682,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-04-25T13:47:18+00:00" + "time": "2023-05-09T13:08:05+00:00" }, { "name": "laravel/horizon", @@ -2283,19 +2283,20 @@ }, { "name": "league/flysystem", - "version": "3.14.0", + "version": "3.15.1", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "e2a279d7f47d9098e479e8b21f7fb8b8de230158" + "reference": "a141d430414fcb8bf797a18716b09f759a385bed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/e2a279d7f47d9098e479e8b21f7fb8b8de230158", - "reference": "e2a279d7f47d9098e479e8b21f7fb8b8de230158", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a141d430414fcb8bf797a18716b09f759a385bed", + "reference": "a141d430414fcb8bf797a18716b09f759a385bed", "shasum": "" }, "require": { + "league/flysystem-local": "^3.0.0", "league/mime-type-detection": "^1.0.0", "php": "^8.0.2" }, @@ -2354,7 +2355,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.14.0" + "source": "https://github.com/thephpleague/flysystem/tree/3.15.1" }, "funding": [ { @@ -2366,7 +2367,67 @@ "type": "github" } ], - "time": "2023-04-11T18:11:47+00:00" + "time": "2023-05-04T09:04:26+00:00" + }, + { + "name": "league/flysystem-local", + "version": "3.15.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem-local.git", + "reference": "543f64c397fefdf9cfeac443ffb6beff602796b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/543f64c397fefdf9cfeac443ffb6beff602796b3", + "reference": "543f64c397fefdf9cfeac443ffb6beff602796b3", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "league/flysystem": "^3.0.0", + "league/mime-type-detection": "^1.0.0", + "php": "^8.0.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\Flysystem\\Local\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Local filesystem adapter for Flysystem.", + "keywords": [ + "Flysystem", + "file", + "files", + "filesystem", + "local" + ], + "support": { + "issues": "https://github.com/thephpleague/flysystem-local/issues", + "source": "https://github.com/thephpleague/flysystem-local/tree/3.15.0" + }, + "funding": [ + { + "url": "https://ecologi.com/frankdejonge", + "type": "custom" + }, + { + "url": "https://github.com/frankdejonge", + "type": "github" + } + ], + "time": "2023-05-02T20:02:14+00:00" }, { "name": "league/mime-type-detection", @@ -3910,16 +3971,16 @@ }, { "name": "psy/psysh", - "version": "v0.11.16", + "version": "v0.11.17", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "151b145906804eea8e5d71fea23bfb470c904bfb" + "reference": "3dc5d4018dabd80bceb8fe1e3191ba8460569f0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/151b145906804eea8e5d71fea23bfb470c904bfb", - "reference": "151b145906804eea8e5d71fea23bfb470c904bfb", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/3dc5d4018dabd80bceb8fe1e3191ba8460569f0a", + "reference": "3dc5d4018dabd80bceb8fe1e3191ba8460569f0a", "shasum": "" }, "require": { @@ -3980,9 +4041,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.16" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.17" }, - "time": "2023-04-26T12:53:57+00:00" + "time": "2023-05-05T20:02:42+00:00" }, { "name": "ralouphie/getallheaders", @@ -4364,16 +4425,16 @@ }, { "name": "spatie/laravel-data", - "version": "3.4.4", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-data.git", - "reference": "d0208dbc6d49ca44ef3ba0dd542cd83ba15bcbc4" + "reference": "4c3c31d7d9a515125bfa219099c4df563e4422a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-data/zipball/d0208dbc6d49ca44ef3ba0dd542cd83ba15bcbc4", - "reference": "d0208dbc6d49ca44ef3ba0dd542cd83ba15bcbc4", + "url": "https://api.github.com/repos/spatie/laravel-data/zipball/4c3c31d7d9a515125bfa219099c4df563e4422a8", + "reference": "4c3c31d7d9a515125bfa219099c4df563e4422a8", "shasum": "" }, "require": { @@ -4435,7 +4496,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-data/issues", - "source": "https://github.com/spatie/laravel-data/tree/3.4.4" + "source": "https://github.com/spatie/laravel-data/tree/3.5.0" }, "funding": [ { @@ -4443,7 +4504,7 @@ "type": "github" } ], - "time": "2023-04-14T08:24:46+00:00" + "time": "2023-05-05T15:24:41+00:00" }, { "name": "spatie/laravel-package-tools", @@ -7807,16 +7868,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v7.1.3", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "f394bb33b2bb7a4120b531e8991409b7aa62fc43" + "reference": "153e68eb9e697baa3acf1db1d8ae1d1eb19fb816" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/f394bb33b2bb7a4120b531e8991409b7aa62fc43", - "reference": "f394bb33b2bb7a4120b531e8991409b7aa62fc43", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/153e68eb9e697baa3acf1db1d8ae1d1eb19fb816", + "reference": "153e68eb9e697baa3acf1db1d8ae1d1eb19fb816", "shasum": "" }, "require": { @@ -7827,25 +7888,25 @@ "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1", "jean85/pretty-package-versions": "^2.0.5", "php": "~8.1.0 || ~8.2.0", - "phpunit/php-code-coverage": "^10.1.0", + "phpunit/php-code-coverage": "^10.1.1", "phpunit/php-file-iterator": "^4.0.1", "phpunit/php-timer": "^6.0", - "phpunit/phpunit": "^10.1.0", + "phpunit/phpunit": "^10.1.2", "sebastian/environment": "^6.0.1", - "symfony/console": "^6.2.8", - "symfony/process": "^6.2.8" + "symfony/console": "^6.2.10", + "symfony/process": "^6.2.10" }, "require-dev": { - "doctrine/coding-standard": "^11.1.0", + "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "infection/infection": "^0.26.19", - "phpstan/phpstan": "^1.10.13", + "infection/infection": "^0.26.21", + "phpstan/phpstan": "^1.10.14", "phpstan/phpstan-deprecation-rules": "^1.1.3", "phpstan/phpstan-phpunit": "^1.3.11", "phpstan/phpstan-strict-rules": "^1.5.1", "squizlabs/php_codesniffer": "^3.7.2", - "symfony/filesystem": "^6.2.7" + "symfony/filesystem": "^6.2.10" }, "bin": [ "bin/paratest", @@ -7886,7 +7947,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.1.3" + "source": "https://github.com/paratestphp/paratest/tree/v7.1.4" }, "funding": [ { @@ -7898,7 +7959,7 @@ "type": "paypal" } ], - "time": "2023-04-14T06:17:37+00:00" + "time": "2023-05-05T09:09:30+00:00" }, { "name": "fakerphp/faker", @@ -9202,16 +9263,16 @@ }, { "name": "phpunit/php-file-iterator", - "version": "4.0.1", + "version": "4.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd" + "reference": "5647d65443818959172645e7ed999217360654b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/fd9329ab3368f59fe1fe808a189c51086bd4b6bd", - "reference": "fd9329ab3368f59fe1fe808a189c51086bd4b6bd", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/5647d65443818959172645e7ed999217360654b6", + "reference": "5647d65443818959172645e7ed999217360654b6", "shasum": "" }, "require": { @@ -9250,7 +9311,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.1" + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.0.2" }, "funding": [ { @@ -9258,7 +9320,7 @@ "type": "github" } ], - "time": "2023-02-10T16:53:14+00:00" + "time": "2023-05-07T09:13:23+00:00" }, { "name": "phpunit/php-invoker", @@ -10568,16 +10630,16 @@ }, { "name": "spatie/ignition", - "version": "1.6.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/spatie/ignition.git", - "reference": "fbcfcabc44e506e40c4d72fd4ddf465e272a600e" + "reference": "f747d83c6d7cb6229b462f3ddbb3a82dc0db0f78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/ignition/zipball/fbcfcabc44e506e40c4d72fd4ddf465e272a600e", - "reference": "fbcfcabc44e506e40c4d72fd4ddf465e272a600e", + "url": "https://api.github.com/repos/spatie/ignition/zipball/f747d83c6d7cb6229b462f3ddbb3a82dc0db0f78", + "reference": "f747d83c6d7cb6229b462f3ddbb3a82dc0db0f78", "shasum": "" }, "require": { @@ -10647,20 +10709,20 @@ "type": "github" } ], - "time": "2023-04-27T08:40:07+00:00" + "time": "2023-05-04T13:20:26+00:00" }, { "name": "spatie/laravel-ignition", - "version": "2.1.0", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/spatie/laravel-ignition.git", - "reference": "3718dfb91bc5aff340af26507a61f0f9605f81e8" + "reference": "2f99fa6b732a6049e78ed34e4608ce589605ae54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/3718dfb91bc5aff340af26507a61f0f9605f81e8", - "reference": "3718dfb91bc5aff340af26507a61f0f9605f81e8", + "url": "https://api.github.com/repos/spatie/laravel-ignition/zipball/2f99fa6b732a6049e78ed34e4608ce589605ae54", + "reference": "2f99fa6b732a6049e78ed34e4608ce589605ae54", "shasum": "" }, "require": { @@ -10739,7 +10801,7 @@ "type": "github" } ], - "time": "2023-04-12T09:26:00+00:00" + "time": "2023-05-09T07:19:31+00:00" }, { "name": "symfony/http-client", diff --git a/database/migrations/2023_03_27_081716_create_applications_table.php b/database/migrations/2023_03_27_081716_create_applications_table.php index f79dd6f4e..e3b0d8fb0 100644 --- a/database/migrations/2023_03_27_081716_create_applications_table.php +++ b/database/migrations/2023_03_27_081716_create_applications_table.php @@ -13,7 +13,7 @@ public function up(): void { Schema::create('applications', function (Blueprint $table) { $table->id(); - $table->integer('project_id')->nullable(); + $table->integer('repository_project_id')->nullable(); $table->string('uuid')->unique(); $table->string('name'); diff --git a/database/seeders/ApplicationSeeder.php b/database/seeders/ApplicationSeeder.php index 78f7b63fe..fe95c6cc2 100644 --- a/database/seeders/ApplicationSeeder.php +++ b/database/seeders/ApplicationSeeder.php @@ -25,7 +25,7 @@ public function run(): void Application::create([ 'name' => 'coollabsio/coolify-examples:nodejs-fastify', - 'project_id' => 603035348, + 'repository_project_id' => 603035348, 'git_repository' => 'coollabsio/coolify-examples', 'git_branch' => 'nodejs-fastify', 'build_pack' => 'nixpacks', diff --git a/resources/views/components/magic-search-bar.blade.php b/resources/views/components/magic-search-bar.blade.php index 4e086a6cb..a50f26a7a 100644 --- a/resources/views/components/magic-search-bar.blade.php +++ b/resources/views/components/magic-search-bar.blade.php @@ -1,68 +1,339 @@ -@props(['data' => []])
- -
+ {{-- Main --}} + +
+ {{-- Servers --}} +
+ +
+ +
+
+ {{-- Destinations --}} +
+ +
+ +
+
+ {{-- Projects --}} +
+ +
+
+ New Project + +
+ +
+
+ {{-- Environments --}} +
+ +
+
+ New Environment + +
+ +
+