refactor(ui): enhance Docker Compose input handling and layout

This commit is contained in:
Andras Bacsai
2025-03-19 14:50:10 +01:00
parent 4e470c7f65
commit 62244fdbb6
6 changed files with 26 additions and 7 deletions
@@ -89,6 +89,7 @@ class GithubPrivateRepository extends Component
}
$this->getCoolifyConfig();
}
public function updatedSelectedBranchName()
{
$this->getCoolifyConfig();
@@ -103,6 +104,9 @@ class GithubPrivateRepository extends Component
$this->show_is_static = false;
$this->is_static = false;
$this->port = 80;
} elseif ($this->build_pack === 'dockercompose') {
$this->show_is_static = false;
$this->is_static = false;
} else {
$this->show_is_static = true;
$this->is_static = false;
@@ -214,7 +218,7 @@ class GithubPrivateRepository extends Component
DB::beginTransaction();
// Create and save the base application first
$cuid = new Cuid2();
$cuid = new Cuid2;
$application = new Application([
'name' => generate_application_name($this->selected_repository_owner.'/'.$this->selected_repository_repo, $this->selected_branch_name),
'repository_project_id' => $this->selected_repository_id,
@@ -96,6 +96,9 @@ class GithubPrivateRepositoryDeployKey extends Component
$this->show_is_static = false;
$this->is_static = false;
$this->port = 80;
} elseif ($this->build_pack === 'dockercompose') {
$this->show_is_static = false;
$this->is_static = false;
} else {
$this->show_is_static = false;
$this->is_static = false;
@@ -127,6 +127,9 @@ class PublicGitRepository extends Component
$this->show_is_static = false;
$this->isStatic = false;
$this->port = 80;
} elseif ($this->build_pack === 'dockercompose') {
$this->show_is_static = false;
$this->isStatic = false;
} else {
$this->show_is_static = true;
$this->isStatic = false;
@@ -67,8 +67,13 @@
<x-forms.input placeholder="/docker-compose.yaml" id="docker_compose_location"
label="Docker Compose Location"
helper="It is calculated together with the Base Directory:<br><span class='dark:text-warning'>{{ Str::start($base_directory . $docker_compose_location, '/') }}</span>" />
Compose file location in your repository:<span
class='dark:text-warning'>{{ Str::start($base_directory . $docker_compose_location, '/') }}</span>
<div class="flex gap-1">
Compose file location in your repository:<span
class='dark:text-warning'>{{ Str::start($base_directory . $docker_compose_location, '/') }}</span>
</div>
@else
<x-forms.input placeholder="/" wire:model.blur="base_directory" label="Base Directory"
helper="Directory to use as root. Useful for monorepos." />
@endif
@if ($show_is_static)
<x-forms.input type="number" required id="port" label="Port" :readonly="$is_static || $build_pack === 'static'" />
@@ -102,8 +102,10 @@
<x-forms.input placeholder="/docker-compose.yaml" id="docker_compose_location"
label="Docker Compose Location"
helper="It is calculated together with the Base Directory:<br><span class='dark:text-warning'>{{ Str::start($base_directory . $docker_compose_location, '/') }}</span>" />
Compose file location in your repository:<span
class='dark:text-warning'>{{ Str::start($base_directory . $docker_compose_location, '/') }}</span>
<div class="flex gap-1">
Compose file location in your repository:<span
class='dark:text-warning '>{{ Str::start($base_directory . $docker_compose_location, '/') }}</span>
</div>
@else
<x-forms.input wire:model.live.debounce.500ms="base_directory"
label="Base Directory"
@@ -54,8 +54,10 @@
wire:model.live.debounce.500ms="docker_compose_location"
label="Docker Compose Location"
helper="It is calculated together with the Base Directory:<br><span class='dark:text-warning'>{{ Str::start($base_directory . $docker_compose_location, '/') }}</span>" />
Compose file location in your repository:<span
class='dark:text-warning'>{{ Str::start($base_directory . $docker_compose_location, '/') }}</span>
<div class="flex gap-1">
Compose file location in your repository:<span
class='dark:text-warning'>{{ Str::start($base_directory . $docker_compose_location, '/') }}</span>
</div>
@else
<x-forms.input wire:model.live.debounce.500ms="base_directory" label="Base Directory"
helper="Directory to use as root. Useful for monorepos." />