This commit is contained in:
Andras Bacsai
2023-06-05 13:50:34 +02:00
parent 6b82a9ef11
commit 6a599c53d7
10 changed files with 162 additions and 101 deletions

View File

@@ -1,19 +1,19 @@
<div>
<div>
<h1>Select a private key</h1>
@foreach ($private_keys as $key)
@if ($private_key_id == $key->id)
<x-forms.button class="bg-blue-500" wire:click.defer="setPrivateKey('{{ $key->id }}')">
{{ $key->name }}</x-forms.button>
@else
<x-forms.button wire:click.defer="setPrivateKey('{{ $key->id }}')">{{ $key->name }}
</x-forms.button>
@endif
@endforeach
</div>
<h1>New Application</h1>
<div class="pb-4 text-sm">Deploy any public or private git repositories through a Deploy Key.</div>
<h3 class="py-2">Select a private key</h3>
@foreach ($private_keys as $key)
@if ($private_key_id == $key->id)
<x-forms.button class="bg-coollabs hover:bg-coollabs-100"
wire:click.defer="setPrivateKey('{{ $key->id }}')">
{{ $key->name }}</x-forms.button>
@else
<x-forms.button wire:click.defer="setPrivateKey('{{ $key->id }}')">{{ $key->name }}
</x-forms.button>
@endif
@endforeach
@isset($private_key_id)
<h1>Choose a repository</h1>
<form wire:submit.prevent='submit'>
<form class="pt-6" wire:submit.prevent='submit'>
<div class="flex items-end gap-2 pb-2">
<x-forms.input class="w-96" id="repository_url" label="Repository URL" />
@if ($is_static)
@@ -21,10 +21,10 @@
@else
<x-forms.input type="number" id="port" label="Port" :readonly="$is_static" />
@endif
<x-forms.input instantSave type="checkbox" id="is_static" label="Static Site?" />
<x-forms.checkbox instantSave id="is_static" label="Static Site?" />
</div>
<x-forms.button type="submit">
Submit
Add New Application
</x-forms.button>
</form>
@endisset

View File

@@ -1,45 +1,75 @@
<div>
<h1>New Application</h1>
<div class="pb-4 text-sm">Deploy any public or private git repositories through a GitHub App.</div>
@if ($github_apps->count() > 0)
<h1>Choose a GitHub App</h1>
@foreach ($github_apps as $ghapp)
<x-forms.button wire:key="{{ $ghapp->id }}" wire:click="loadRepositories({{ $ghapp->id }})">
{{ $ghapp->name }}
</x-forms.button>
@endforeach
<div>
@if ($repositories->count() > 0)
<h3>Choose a Repository</h3>
<select wire:model.defer="selected_repository_id">
@foreach ($repositories as $repo)
@if ($loop->first)
<option selected value="{{ data_get($repo, 'id') }}">{{ data_get($repo, 'name') }}</option>
<form class="flex flex-col" wire:submit.prevent='submit'>
<h3 class="py-2">Select a GitHub App</h3>
@foreach ($github_apps as $ghapp)
@if ($selected_github_app_id == $ghapp->id)
<x-forms.button class="bg-coollabs hover:bg-coollabs-100 h-7" wire:key="{{ $ghapp->id }}"
wire:click.prevent="loadRepositories({{ $ghapp->id }})">
{{ $ghapp->name }}
</x-forms.button>
@else
<x-forms.button wire:key="{{ $ghapp->id }}"
wire:click.prevent="loadRepositories({{ $ghapp->id }})">
{{ $ghapp->name }}
</x-forms.button>
@endif
@endforeach
<div class="flex flex-col">
@if ($repositories->count() > 0)
<div class="flex items-end gap-2">
<x-forms.select class="w-full" label="Repository URL" helper="{!! __('repository.url') !!}"
wire:model.defer="selected_repository_id">
@foreach ($repositories as $repo)
@if ($loop->first)
<option selected value="{{ data_get($repo, 'id') }}">{{ data_get($repo, 'name') }}
</option>
@else
<option value="{{ data_get($repo, 'id') }}">{{ data_get($repo, 'name') }}</option>
@endif
@endforeach
</x-forms.select>
<x-forms.button class="h-8 hover:bg-coolgray-400 bg-coolgray-200"
wire:click.prevent="loadBranches"> Check
repository</x-forms.button>
</div>
@endif
</div>
<div>
@if ($branches->count() > 0)
<div class="flex gap-2">
<x-forms.select id="selected_branch_name" label="Branch">
<option value="default" disabled selected>Select a branch</option>
@foreach ($branches as $branch)
@if ($loop->first)
<option selected value="{{ data_get($branch, 'name') }}">
{{ data_get($branch, 'name') }}
</option>
@else
<option value="{{ data_get($branch, 'name') }}">{{ data_get($branch, 'name') }}
</option>
@endif
@endforeach
</x-forms.select>
@if ($is_static)
<x-forms.input class="h-8" id="publish_directory" label="Publish Directory"
helper="If there is a build process involved (like Svelte, React, Next, etc..), please specify the output directory for the build assets." />
@else
<option value="{{ data_get($repo, 'id') }}">{{ data_get($repo, 'name') }}</option>
<x-forms.input class="h-8" type="number" id="port" label="Port" :readonly="$is_static"
helper="The port your application listens on." />
@endif
@endforeach
</select>
<x-forms.button wire:click="loadBranches">Select Repository</x-forms.button>
@endif
</div>
<div>
@if ($branches->count() > 0)
<h3>Choose a Branch</h3>
<select wire:model.defer="selected_branch_name">
<option disabled>Choose a branch</option>
@foreach ($branches as $branch)
@if ($loop->first)
<option selected value="{{ data_get($branch, 'name') }}">{{ data_get($branch, 'name') }}
</option>
@else
<option value="{{ data_get($branch, 'name') }}">{{ data_get($branch, 'name') }}</option>
@endif
@endforeach
</select>
<x-forms.button wire:click="submit">Save</x-forms.button>
@endif
</div>
</div>
<x-forms.checkbox instantSave id="is_static" label="Is it a static site?"
helper="If your application is a static site or the final build assets should be served as a static site, enable this." />
<x-forms.button class="w-full mt-8" type="submit">
Save New Application
</x-forms.button>
@endif
</div>
</form>
@else
Add new github app
@endif
</div>

View File

@@ -1,47 +1,39 @@
<div>
<h1>Enter a public repository URL</h1>
<h1>New Application</h1>
<div class="pb-4 text-sm">Deploy any public git repositories.</div>
<form class="flex flex-col gap-2" wire:submit.prevent='submit'>
<div class="flex flex-col gap-2">
<div class="flex flex-col">
<div class="flex items-end gap-2">
<x-forms.input wire:keypress.enter='load_branches' id="repository_url" label="Repository URL"
helper="<span class='text-helper'>Example</span>https://github.com/coollabsio/coolify-examples => main branch will be selected<br>https://github.com/coollabsio/coolify-examples/tree/nodejs-fastify => nodejs-fastify branch will be selected" />
helper="{!! __('repository.url') !!}" />
<x-forms.button wire:click.prevent="load_branches">
Check repository
</x-forms.button>
</div>
@if (count($branches) > 0)
<x-forms.select id="selected_branch" label="Branch">
<option value="default" disabled selected>Select a branch</option>
@foreach ($branches as $branch)
<option value="{{ $branch }}">{{ $branch }}</option>
@endforeach
</x-forms.select>
@else
<x-forms.select id="branch" label="Branch" disabled>
<option value="default" selected>Set a repository first</option>
</x-forms.select>
<div class="flex gap-2">
<x-forms.select id="selected_branch" label="Branch">
<option value="default" disabled selected>Select a branch</option>
@foreach ($branches as $branch)
<option value="{{ $branch }}">{{ $branch }}</option>
@endforeach
</x-forms.select>
@if ($is_static)
<x-forms.input class="h-8" id="publish_directory" label="Publish Directory"
helper="If there is a build process involved (like Svelte, React, Next, etc..), please specify the output directory for the build assets." />
@else
<x-forms.input class="h-8" type="number" id="port" label="Port" :readonly="$is_static"
helper="The port your application listens on." />
@endif
</div>
<x-forms.checkbox instantSave id="is_static" label="Is it a static site?"
helper="If your application is a static site or the final build assets should be served as a static site, enable this." />
<x-forms.button class="mt-8" type="submit">
Save New Application
</x-forms.button>
@endif
</div>
@if ($is_static)
<x-forms.input id="publish_directory" label="Publish Directory"
helper="If there is a build process involved (like Svelte, React, Next, etc..), please specify the output directory for the build assets." />
@else
<x-forms.input type="number" id="port" label="Port" :readonly="$is_static"
helper="The port your application listens on." />
@endif
</div>
<x-forms.checkbox instantSave id="is_static" label="Is it a static site?" />
@if (count($branches) > 0)
<x-forms.button type="submit">
Save
</x-forms.button>
@else
<x-forms.button disabled type="submit">
Save
</x-forms.button>
@endif
</form>
</div>