Add private_keys array initialization and define additional private properties
This commit is contained in:
		@@ -9,6 +9,7 @@ use App\Models\PrivateKey;
 | 
				
			|||||||
use App\Models\Project;
 | 
					use App\Models\Project;
 | 
				
			||||||
use App\Models\StandaloneDocker;
 | 
					use App\Models\StandaloneDocker;
 | 
				
			||||||
use App\Models\SwarmDocker;
 | 
					use App\Models\SwarmDocker;
 | 
				
			||||||
 | 
					use Illuminate\Support\Collection;
 | 
				
			||||||
use Livewire\Component;
 | 
					use Livewire\Component;
 | 
				
			||||||
use Spatie\Url\Url;
 | 
					use Spatie\Url\Url;
 | 
				
			||||||
use Illuminate\Support\Str;
 | 
					use Illuminate\Support\Str;
 | 
				
			||||||
@@ -18,7 +19,7 @@ class GithubPrivateRepositoryDeployKey extends Component
 | 
				
			|||||||
    public $current_step = 'private_keys';
 | 
					    public $current_step = 'private_keys';
 | 
				
			||||||
    public $parameters;
 | 
					    public $parameters;
 | 
				
			||||||
    public $query;
 | 
					    public $query;
 | 
				
			||||||
    public $private_keys;
 | 
					    public $private_keys =[];
 | 
				
			||||||
    public int $private_key_id;
 | 
					    public int $private_key_id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public int $port = 3000;
 | 
					    public int $port = 3000;
 | 
				
			||||||
@@ -33,6 +34,11 @@ class GithubPrivateRepositoryDeployKey extends Component
 | 
				
			|||||||
    public $build_pack = 'nixpacks';
 | 
					    public $build_pack = 'nixpacks';
 | 
				
			||||||
    public bool $show_is_static = true;
 | 
					    public bool $show_is_static = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    private object $repository_url_parsed;
 | 
				
			||||||
 | 
					    private GithubApp|GitlabApp|string $git_source = 'other';
 | 
				
			||||||
 | 
					    private ?string $git_host = null;
 | 
				
			||||||
 | 
					    private string $git_repository;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    protected $rules = [
 | 
					    protected $rules = [
 | 
				
			||||||
        'repository_url' => 'required',
 | 
					        'repository_url' => 'required',
 | 
				
			||||||
        'branch' => 'required|string',
 | 
					        'branch' => 'required|string',
 | 
				
			||||||
@@ -49,10 +55,7 @@ class GithubPrivateRepositoryDeployKey extends Component
 | 
				
			|||||||
        'publish_directory' => 'Publish directory',
 | 
					        'publish_directory' => 'Publish directory',
 | 
				
			||||||
        'build_pack' => 'Build pack',
 | 
					        'build_pack' => 'Build pack',
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
    private object $repository_url_parsed;
 | 
					
 | 
				
			||||||
    private GithubApp|GitlabApp|string $git_source = 'other';
 | 
					 | 
				
			||||||
    private ?string $git_host = null;
 | 
					 | 
				
			||||||
    private string $git_repository;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function mount()
 | 
					    public function mount()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,7 @@
 | 
				
			|||||||
                <li class="step">Select a Repository, Branch & Save</li>
 | 
					                <li class="step">Select a Repository, Branch & Save</li>
 | 
				
			||||||
            </ul>
 | 
					            </ul>
 | 
				
			||||||
            <div class="flex flex-col justify-center gap-2 text-left xl:flex-row">
 | 
					            <div class="flex flex-col justify-center gap-2 text-left xl:flex-row">
 | 
				
			||||||
                @foreach ($private_keys as $key)
 | 
					                @forelse ($private_keys as $key)
 | 
				
			||||||
                    @if ($private_key_id == $key->id)
 | 
					                    @if ($private_key_id == $key->id)
 | 
				
			||||||
                        <div class="gap-2 py-4 cursor-pointer group hover:bg-coollabs bg-coolgray-200"
 | 
					                        <div class="gap-2 py-4 cursor-pointer group hover:bg-coollabs bg-coolgray-200"
 | 
				
			||||||
                            wire:click.defer="setPrivateKey('{{ $key->id }}')" wire:key="{{ $key->id }}">
 | 
					                            wire:click.defer="setPrivateKey('{{ $key->id }}')" wire:key="{{ $key->id }}">
 | 
				
			||||||
@@ -32,7 +32,16 @@
 | 
				
			|||||||
                            </div>
 | 
					                            </div>
 | 
				
			||||||
                        </div>
 | 
					                        </div>
 | 
				
			||||||
                    @endif
 | 
					                    @endif
 | 
				
			||||||
                @endforeach
 | 
					                @empty
 | 
				
			||||||
 | 
					                    <div class="flex flex-col items-center justify-center gap-2">
 | 
				
			||||||
 | 
					                        <div class="text-neutral-500">
 | 
				
			||||||
 | 
					                            No private keys found.
 | 
				
			||||||
 | 
					                        </div>
 | 
				
			||||||
 | 
					                        <a href="{{ route('security.private-key.index') }}">
 | 
				
			||||||
 | 
					                            <x-forms.button>Create a new private key</x-forms.button>
 | 
				
			||||||
 | 
					                        </a>
 | 
				
			||||||
 | 
					                    </div>
 | 
				
			||||||
 | 
					                @endforelse
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
        @endif
 | 
					        @endif
 | 
				
			||||||
        @if ($current_step === 'repository')
 | 
					        @if ($current_step === 'repository')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user