diff --git a/app/Livewire/Project/New/GithubPrivateRepository.php b/app/Livewire/Project/New/GithubPrivateRepository.php index 9ae9aeb57..012325ff1 100644 --- a/app/Livewire/Project/New/GithubPrivateRepository.php +++ b/app/Livewire/Project/New/GithubPrivateRepository.php @@ -39,6 +39,8 @@ class GithubPrivateRepository extends Component public bool $is_static = false; public string|null $publish_directory = null; protected int $page = 1; + public $build_pack = 'nixpacks'; + public bool $show_is_static = true; public function mount() @@ -49,6 +51,20 @@ class GithubPrivateRepository extends Component $this->repositories = $this->branches = collect(); $this->github_apps = GithubApp::private(); } + public function updatedBuildPack() + { + if ($this->build_pack === 'nixpacks') { + $this->show_is_static = true; + $this->port = 3000; + } else if ($this->build_pack === 'static') { + $this->show_is_static = false; + $this->is_static = false; + $this->port = 80; + } else { + $this->show_is_static = false; + $this->is_static = false; + } + } public function loadRepositories($github_app_id) { $this->repositories = collect(); diff --git a/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php b/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php index ba403ca1c..723d4bb60 100644 --- a/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php +++ b/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php @@ -29,12 +29,17 @@ class GithubPrivateRepositoryDeployKey extends Component public string $repository_url; public string $branch; + + public $build_pack = 'nixpacks'; + public bool $show_is_static = true; + protected $rules = [ 'repository_url' => 'required', 'branch' => 'required|string', 'port' => 'required|numeric', 'is_static' => 'required|boolean', 'publish_directory' => 'nullable|string', + 'build_pack' => 'required|string', ]; protected $validationAttributes = [ 'repository_url' => 'Repository', @@ -42,6 +47,7 @@ class GithubPrivateRepositoryDeployKey extends Component 'port' => 'Port', 'is_static' => 'Is static', 'publish_directory' => 'Publish directory', + 'build_pack' => 'Build pack', ]; private object $repository_url_parsed; private GithubApp|GitlabApp|string $git_source = 'other'; @@ -62,6 +68,20 @@ class GithubPrivateRepositoryDeployKey extends Component } } + public function updatedBuildPack() + { + if ($this->build_pack === 'nixpacks') { + $this->show_is_static = true; + $this->port = 3000; + } else if ($this->build_pack === 'static') { + $this->show_is_static = false; + $this->is_static = false; + $this->port = 80; + } else { + $this->show_is_static = false; + $this->is_static = false; + } + } public function instantSave() { if ($this->is_static) { diff --git a/resources/views/livewire/project/new/github-private-repository-deploy-key.blade.php b/resources/views/livewire/project/new/github-private-repository-deploy-key.blade.php index f7fe57ac2..ed18da484 100644 --- a/resources/views/livewire/project/new/github-private-repository-deploy-key.blade.php +++ b/resources/views/livewire/project/new/github-private-repository-deploy-key.blade.php @@ -40,23 +40,29 @@
Public repositories: https://...
Private repositories: git@...
Preselect branch: Dockerfile -