add new public repo

This commit is contained in:
Andras Bacsai
2023-04-25 14:43:35 +02:00
parent dd51b002b8
commit 6135c139da
42 changed files with 495 additions and 210 deletions

View File

@@ -0,0 +1,34 @@
@if ($type === 'checkbox')
<label for={{ $id }}>
@if ($label)
{{ $label }}
@else
{{ $id }}
@endif
@if ($required)
*
@endif
<input type="checkbox" id={{ $id }}
@if ($instantSave) wire:click='instantSave' wire:model.defer={{ $id }} @else wire:model.defer={{ $id }} @endif>
</label>
@error($id)
<span class="text-red-500">{{ $message }}</span>
@enderror
@else
<label for={{ $id }}>
@if ($label)
{{ $label }}
@else
{{ $id }}
@endif
@if ($required)
*
@endif
</label>
<input type={{ $type }} id={{ $id }} wire:model.defer={{ $id }}
@if ($required) required @endif
@if ($readonly) readOnly=true disabled=true @endif />
@error($id)
<div class="text-red-500">{{ $message }}</div>
@enderror
@endif

View File

@@ -1,33 +1,11 @@
@if ($type === 'checkbox')
<label for={{ $name }}>
@if ($label)
{{ $label }}
@else
{{ $name }}
@endif
@if ($required)
*
@endif
<input type="checkbox" id={{ $name }}
@if ($instantSave) wire:click='instantSave' wire:model.defer={{ $name }} @else wire:model.defer={{ $name }} @endif
name={{ $name }}>
</label>
@else
<label for={{ $name }}>
@if ($label)
{{ $label }}
@else
{{ $name }}
@endif
@if ($required)
*
@endif
</label>
<input type={{ $type }} id={{ $name }} wire:model.defer={{ $name }}
name={{ $name }} @if ($required) required @endif
@if ($readonly) readOnly=true disabled=true @endif />
@endif
@error($name)
<span class="text-red-500">{{ $message }}</span>
@enderror
<label for={{ $id }}>
@if ($label)
{{ $label }}
@else
{{ $id }}
@endif
@if ($required)
*
@endif
<input id={{ $id }} type={{ $type }} wire:model.defer={{ $id }}>
</label>

View File

@@ -1,5 +1,5 @@
<x-layout>
<h1>Projects <button><a class="no-underline" href="{{ route('project.new') }}">New</a></button></h1>
<h1>Projects <a href="{{ route('project.new') }}"><button>New</button></a></h1>
@forelse ($projects as $project)
<a href="{{ route('project.environments', [$project->uuid]) }}">{{ data_get($project, 'name') }}</a>
@empty

View File

@@ -1,37 +1,38 @@
<div>
<form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex flex-col xl:flex-row gap-2">
<div class="flex-col flex w-96">
<x-input name="application.name" label="Name" required />
<x-input name="application.fqdn" label="FQDN" />
<div class="flex flex-col gap-2 xl:flex-row">
<div class="flex flex-col w-96">
<x-form-input id="application.name" label="Name" required />
<x-form-input id="application.fqdn" label="FQDN" />
</div>
<div class="flex-col flex w-96">
<x-input name="application.install_command" label="Install Command" />
<x-input name="application.build_command" label="Build Command" />
<x-input name="application.start_command" label="Start Command" />
<x-input name="application.build_pack" label="Build Pack" />
<div class="flex flex-col w-96">
<x-form-input id="application.install_command" label="Install Command" />
<x-form-input id="application.build_command" label="Build Command" />
<x-form-input id="application.start_command" label="Start Command" />
<x-form-input id="application.build_pack" label="Build Pack" />
</div>
<div class="flex-col flex w-96">
<x-input name="application.base_directory" label="Base Directory" />
<x-input name="application.publish_directory" label="Publish Directory" />
<div class="flex flex-col w-96">
<x-form-input id="application.base_directory" label="Base Directory" />
<x-form-input id="application.publish_directory" label="Publish Directory" />
</div>
<div class="flex-col flex w-96">
<x-input name="application.ports_exposes" label="Ports Exposes" />
<div class="flex flex-col w-96">
<x-form-input id="application.ports_exposes" label="Ports Exposes" />
<x-form-input id="application.ports_mappings" label="Ports Mappings" />
</div>
</div>
<button class="flex mx-auto mt-4" type="submit">
Submit
</button>
</form>
<div class="flex flex-col pt-4 w-52 text-right">
<x-input instantSave type="checkbox" name="is_auto_deploy" label="Auto Deploy?" />
<x-input instantSave type="checkbox" name="is_dual_cert" label="Dual Certs?" />
<x-input instantSave type="checkbox" name="is_previews" label="Previews?" />
<x-input instantSave type="checkbox" name="is_bot" label="Is Bot?" />
<x-input instantSave type="checkbox" name="is_custom_ssl" label="Is Custom SSL?" />
<x-input instantSave type="checkbox" name="is_http2" label="Is Http2?" />
<x-input instantSave type="checkbox" name="is_git_submodules_allowed" label="Git Submodules Allowed?" />
<x-input instantSave type="checkbox" name="is_git_lfs_allowed" label="Git LFS Allowed?" />
<x-input instantSave type="checkbox" name="is_debug" label="Debug" />
<div class="flex flex-col pt-4 text-right w-52">
<x-form-input instantSave type="checkbox" id="is_auto_deploy" label="Auto Deploy?" />
<x-form-input instantSave type="checkbox" id="is_dual_cert" label="Dual Certs?" />
<x-form-input instantSave type="checkbox" id="is_previews" label="Previews?" />
<x-form-input instantSave type="checkbox" id="is_bot" label="Is Bot?" />
<x-form-input instantSave type="checkbox" id="is_custom_ssl" label="Is Custom SSL?" />
<x-form-input instantSave type="checkbox" id="is_http2" label="Is Http2?" />
<x-form-input instantSave type="checkbox" id="is_git_submodules_allowed" label="Git Submodules Allowed?" />
<x-form-input instantSave type="checkbox" id="is_git_lfs_allowed" label="Git LFS Allowed?" />
<x-form-input instantSave type="checkbox" id="is_debug" label="Debug" />
</div>
</div>

View File

@@ -1,9 +1,9 @@
<div>
<p>Source Name: {{ data_get($application,'source.name') }}</p>
<p>Is Public Source: {{ data_get($application,'source.is_public') }}</p>
<div class="flex-col flex w-96">
<x-input name="application.git_repository" label="Git Repository" readonly />
<x-input name="application.git_branch" label="Git Branch" readonly />
<x-input name="application.git_commit_sha" label="Git Commit SHA" readonly />
<div class="flex flex-col w-96">
<x-form-input id="application.git_repository" label="Git Repository" readonly />
<x-form-input id="application.git_branch" label="Git Branch" readonly />
<x-form-input id="application.git_commit_sha" label="Git Commit SHA" readonly />
</div>
</div>

View File

@@ -1,11 +0,0 @@
<div>
<div class="flex flex-col w-64 gap-2">
<button>Repository (any git)</button>
<button>Repository through GitHub App</button>
<button>Repository through GitLab App</button>
<button>Repository through Bitbucket App</button>
<button>Deploy Database</button>
<button>Deploy Service</button>
<button>Empty Project</button>
</div>
</div>

View File

@@ -0,0 +1,31 @@
<div>
@forelse ($servers as $server)
<button @if ($chosenServer == $server->id) class="bg-blue-500" @endif
wire:click="chooseServer({{ $server->id }})">{{ $server->name }}</button>
@empty
No servers
@endforelse
@isset($chosenServer)
<div>
@foreach ($standalone_docker as $standalone)
<button @if ($chosenDestination?->uuid == $standalone->uuid) class="bg-blue-500" @endif
wire:click="setDestination('{{ $standalone->uuid }}','StandaloneDocker')">{{ $standalone->network }}</button>
@endforeach
@foreach ($swarm_docker as $standalone)
<button @if ($chosenDestination?->uuid == $standalone->uuid) class="bg-blue-500" @endif
wire:click="setDestination('{{ $standalone->uuid }}','SwarmDocker')">{{ $standalone->uuid }}</button>
@endforeach
</div>
@endisset
@isset($chosenDestination)
<form wire:submit.prevent='submit'>
<x-form-input id="public_repository_url" label="Repository URL" />
<x-form-input type="number" id="port" label="Port" />
<button type="submit">
Submit
</button>
</form>
@endisset
</div>

View File

@@ -2,13 +2,13 @@
<form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex flex-col gap-2 xl:flex-row">
<div class="flex flex-col w-96">
<x-input name="server.name" label="Name" required />
<x-input name="server.description" label="Description" />
<x-form-input id="server.name" label="Name" required />
<x-form-input id="server.description" label="Description" />
</div>
<div class="flex flex-col w-96">
<x-input name="server.ip" label="IP Address" required />
<x-input name="server.user" label="User" required />
<x-input type="number" name="server.port" label="Port" required />
<x-form-input id="server.ip" label="IP Address" required />
<x-form-input id="server.user" label="User" required />
<x-form-input type="number" id="server.port" label="Port" required />
</div>
</div>
<button class="w-16 mt-4" type="submit">

View File

@@ -2,12 +2,12 @@
<form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex flex-col gap-2 xl:flex-row">
<div class="flex flex-col w-96">
<x-input name="settings.fqdn" label="FQDN" />
<x-input name="settings.wildcard_domain" label="Wildcard Domain" />
<x-form-input id="settings.fqdn" label="FQDN" />
<x-form-input id="settings.wildcard_domain" label="Wildcard Domain" />
</div>
<div class="flex flex-col w-96">
<x-input type="number" name="settings.public_port_min" label="Public Port Min" />
<x-input type="number" name="settings.public_port_max" label="Public Port Max" />
<x-form-input type="number" id="settings.public_port_min" label="Public Port Min" />
<x-form-input type="number" id="settings.public_port_max" label="Public Port Max" />
</div>
</div>
<button class="w-16 mt-4" type="submit">
@@ -15,9 +15,9 @@
</button>
</form>
<div class="flex flex-col pt-4 text-right w-52">
<x-input instantSave type="checkbox" name="do_not_track" label="Do Not Track" />
<x-input instantSave type="checkbox" name="is_auto_update_enabled" label="Auto Update?" />
<x-input instantSave type="checkbox" name="is_registration_enabled" label="Registration Enabled?" />
<x-input instantSave type="checkbox" name="is_https_forced" label="Force https?" />
<x-form-input instantSave type="checkbox" id="do_not_track" label="Do Not Track" />
<x-form-input instantSave type="checkbox" id="is_auto_update_enabled" label="Auto Update?" />
<x-form-input instantSave type="checkbox" id="is_registration_enabled" label="Registration Enabled?" />
<x-form-input instantSave type="checkbox" id="is_https_forced" label="Force https?" />
</div>
</div>

View File

@@ -1,4 +1,26 @@
<x-layout>
<h1>New Project</h1>
<livewire:project.new-project />
<div x-data="{ tab: window.location.hash ? window.location.hash.substring(1) : 'choose' }">
<div class="flex flex-col w-64 gap-2 mb-10">
<button @click.prevent="tab = 'public-repo'; window.location.hash = 'public-repo'">Public Repository
</button>
<button @click.prevent="tab = 'github-private-repo'; window.location.hash = 'github-private-repo'">Private
Repository (GitHub App)</button>
<button @click.prevent="tab = 'empty-project'; window.location.hash = 'empty-project'">Empty
Project</button>
</div>
<div x-cloak x-show="tab === 'public-repo'">
<livewire:project.new.public-git-repository />
</div>
<div x-cloak x-show="tab === 'github-private-repo'">
github-private-repo
</div>
<div x-cloak x-show="tab === 'empty-project'">
empty-project
</div>
<div x-cloak x-show="tab === 'choose'">
Choose any option
</div>
</div>
</x-layout>