diff --git a/app/Http/Livewire/Project/New/GithubPrivateRepository.php b/app/Http/Livewire/Project/New/GithubPrivateRepository.php index 1ca8cade6..4f78ba771 100644 --- a/app/Http/Livewire/Project/New/GithubPrivateRepository.php +++ b/app/Http/Livewire/Project/New/GithubPrivateRepository.php @@ -22,6 +22,7 @@ class GithubPrivateRepository extends Component public $type; public int $selected_repository_id; + public int $selected_github_app_id; public string $selected_repository_owner; public string $selected_repository_repo; @@ -37,6 +38,10 @@ class GithubPrivateRepository extends Component public $branches; public int $total_branches_count = 0; + public int $port = 3000; + public bool $is_static = false; + public string|null $publish_directory = null; + protected function loadRepositoryByPage() { $response = Http::withToken($this->token)->get("{$this->github_app->api_url}/installation/repositories?per_page=100&page={$this->page}"); @@ -67,6 +72,7 @@ class GithubPrivateRepository extends Component { $this->repositories = collect(); $this->page = 1; + $this->selected_github_app_id = $github_app_id; $this->github_app = GithubApp::where('id', $github_app_id)->first(); $this->token = generate_github_installation_token($this->github_app); $this->loadRepositoryByPage(); @@ -110,28 +116,42 @@ class GithubPrivateRepository extends Component $environment = $project->load(['environments'])->environments->where('name', $this->parameters['environment_name'])->first(); $application = Application::create([ - 'name' => generate_random_name(), + 'name' => generate_application_name($this->selected_repository_owner . '/' . $this->selected_repository_repo, $this->selected_branch_name), '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', + 'ports_exposes' => $this->port, + 'publish_directory' => $this->publish_directory, 'environment_id' => $environment->id, 'destination_id' => $destination->id, 'destination_type' => $destination_class, 'source_id' => $this->github_app->id, - 'source_type' => GithubApp::class, + 'source_type' => $this->github_app->getMorphClass() ]); + $application->settings->is_static = $this->is_static; + $application->settings->save(); redirect()->route('project.application.configuration', [ 'application_uuid' => $application->uuid, + 'environment_name' => $environment->name, 'project_uuid' => $project->uuid, - 'environment_name' => $environment->name ]); } catch (\Exception $e) { return general_error_handler($e, $this); } } + public function instantSave() + { + if ($this->is_static) { + $this->port = 80; + $this->publish_directory = '/dist'; + } else { + $this->port = 3000; + $this->publish_directory = null; + } + $this->emit('saved', 'Application settings updated!'); + } public function mount() { $this->parameters = get_parameters(); diff --git a/lang/en.json b/lang/en.json index 8ad587645..1ea0cc5f7 100644 --- a/lang/en.json +++ b/lang/en.json @@ -19,5 +19,6 @@ "input.password.again": "Password again", "input.code": "One-time code", "input.recovery_code": "Recovery code", - "button.save": "Save" + "button.save": "Save", + "repository.url": "Examples
https://github.com/coollabsio/coolify-examples main branch will be selected

https://github.com/coollabsio/coolify-examples/tree/nodejs-fastify nodejs-fastify branch will be selected" } \ No newline at end of file diff --git a/resources/css/app.css b/resources/css/app.css index be81da95b..b8ef2468b 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -21,7 +21,7 @@ input[type="checkbox"] { @apply toggle toggle-warning toggle-xs rounded; } input { - @apply input input-sm h-7 outline-none placeholder:text-neutral-700 text-white rounded-none; + @apply input input-sm h-7 outline-none placeholder:text-neutral-700 text-white rounded-none; } input[type="text"],[type="number"],[type="email"],[type="password"] { @apply read-only:opacity-40; @@ -34,7 +34,7 @@ textarea { @apply textarea placeholder:text-neutral-700 text-white rounded-none; } select { - @apply select select-sm disabled:bg-coolgray-200 border-none disabled:opacity-50 font-normal placeholder:text-neutral-700 text-white rounded-none; + @apply select select-sm text-sm disabled:bg-coolgray-200 border-none disabled:opacity-50 font-normal placeholder:text-neutral-700 text-white rounded-none; } .breadcrumbs > ul > li::before { @apply text-warning opacity-100; @@ -43,9 +43,6 @@ select { @apply w-4 text-warning; } -button[type="button"] { - @apply hover:bg-coolgray-400 btn h-7 btn-xs border-none bg-coolgray-200 no-animation normal-case text-white rounded; -} button[type="submit"] { @apply hover:bg-coolgray-400 btn h-7 btn-xs border-none bg-coolgray-200 no-animation normal-case text-white rounded; } diff --git a/resources/views/components/forms/button.blade.php b/resources/views/components/forms/button.blade.php index 306f1f1b6..6147da68d 100644 --- a/resources/views/components/forms/button.blade.php +++ b/resources/views/components/forms/button.blade.php @@ -22,7 +22,9 @@ {{ $slot }} @elseif($type === 'button') -