Add build pack selection and update related fields

This commit is contained in:
Andras Bacsai
2024-01-25 15:57:04 +01:00
parent ae4b263810
commit 39647367a5
5 changed files with 84 additions and 34 deletions

View File

@@ -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();