mostly css

This commit is contained in:
Andras Bacsai 2023-05-31 10:19:29 +02:00
parent 40bab90946
commit 232d2ccf79
21 changed files with 138 additions and 90 deletions

View File

@ -39,9 +39,9 @@ class Previews extends Component
{ {
['rate_limit_remaining' => $rate_limit_remaining, 'data' => $data] = get_from_git_api($this->application->source, "/repos/{$this->application->git_repository}/pulls"); ['rate_limit_remaining' => $rate_limit_remaining, 'data' => $data] = get_from_git_api($this->application->source, "/repos/{$this->application->git_repository}/pulls");
$this->rate_limit_remaining = $rate_limit_remaining; $this->rate_limit_remaining = $rate_limit_remaining;
$this->pull_requests = $data; $this->pull_requests = $data->sortBy('number')->values();
} }
public function deploy(int $pull_request_id) public function deploy(int $pull_request_id, string|null $pull_request_html_url)
{ {
try { try {
$this->set_deployment_uuid(); $this->set_deployment_uuid();
@ -50,6 +50,7 @@ class Previews extends Component
ApplicationPreview::create([ ApplicationPreview::create([
'application_id' => $this->application->id, 'application_id' => $this->application->id,
'pull_request_id' => $pull_request_id, 'pull_request_id' => $pull_request_id,
'pull_request_html_url' => $pull_request_html_url
]); ]);
} }
queue_application_deployment( queue_application_deployment(
@ -58,6 +59,11 @@ class Previews extends Component
force_rebuild: true, force_rebuild: true,
pull_request_id: $pull_request_id, pull_request_id: $pull_request_id,
); );
return redirect()->route('project.application.deployments', [
'project_uuid' => $this->parameters['project_uuid'],
'application_uuid' => $this->parameters['application_uuid'],
'environment_name' => $this->parameters['environment_name'],
]);
} catch (\Throwable $th) { } catch (\Throwable $th) {
return general_error_handler($th, $this); return general_error_handler($th, $this);
} }

View File

@ -7,6 +7,7 @@ class ApplicationPreview extends BaseModel
protected $fillable = [ protected $fillable = [
'uuid', 'uuid',
'pull_request_id', 'pull_request_id',
'pull_request_html_url',
'fqdn', 'fqdn',
'status', 'status',
'application_id', 'application_id',

View File

@ -15,6 +15,7 @@ return new class extends Migration
$table->id(); $table->id();
$table->string('uuid')->unique(); $table->string('uuid')->unique();
$table->integer('pull_request_id'); $table->integer('pull_request_id');
$table->string('pull_request_html_url');
$table->string('fqdn')->unique()->nullable(); $table->string('fqdn')->unique()->nullable();
$table->string('status')->default('exited'); $table->string('status')->default('exited');

View File

@ -40,10 +40,10 @@ select {
@apply text-warning opacity-100; @apply text-warning opacity-100;
} }
button[type="button"] { button[type="button"] {
@apply btn btn-xs bg-coolgray-200 no-animation normal-case text-white rounded-none; @apply btn btn-xs mt-1 bg-coolgray-200 no-animation normal-case text-white rounded;
} }
button[type="submit"] { button[type="submit"] {
@apply btn btn-xs no-animation normal-case text-white btn-primary rounded-none; @apply btn btn-xs mt-1 no-animation normal-case text-white btn-primary rounded;
} }
button[isWarning] { button[isWarning] {
@apply text-error; @apply text-error;
@ -74,7 +74,7 @@ a {
@apply text-white; @apply text-white;
} }
.box { .box {
@apply flex items-center justify-center text-sm rounded-none cursor-pointer h-14 bg-coolgray-200 hover:bg-coollabs-100 hover:text-white p-2 hover:no-underline transition-colors; @apply flex items-center justify-center text-sm rounded-none min-h-12 bg-coolgray-200 hover:bg-coollabs-100 hover:text-white p-2 hover:no-underline transition-colors;
} }
.main-menu { .main-menu {

View File

@ -1,4 +1,4 @@
<nav class="flex gap-4 py-2 border-b-2 border-solid border-coolgray-200"> <nav class="flex items-center gap-4 py-2 border-b-2 border-solid border-coolgray-200">
<a class="{{ request()->routeIs('project.application.configuration') ? 'text-white' : '' }}" <a class="{{ request()->routeIs('project.application.configuration') ? 'text-white' : '' }}"
href="{{ route('project.application.configuration', [ href="{{ route('project.application.configuration', [
'project_uuid' => Route::current()->parameters()['project_uuid'], 'project_uuid' => Route::current()->parameters()['project_uuid'],
@ -18,18 +18,18 @@
<div class="flex-1"></div> <div class="flex-1"></div>
<div class="dropdown dropdown-bottom"> <div class="dropdown dropdown-bottom">
<button tabindex="0" <x-forms.button tabindex="0">
class="flex items-center justify-center h-full text-white normal-case bg-transparent border-none rounded btn btn-xs no-animation">
Open Open
<x-chevron-down /> <x-chevron-down />
</button> </x-forms.button>
<ul tabindex="0" <ul tabindex="0"
class="text-xs text-white normal-case rounded min-w-max dropdown-content menu bg-coolgray-200"> class="mt-1 text-xs text-white normal-case rounded min-w-max dropdown-content menu bg-coolgray-200">
@if (data_get($application, 'fqdn')) @if (data_get($application, 'fqdn'))
<li> <li>
<a class="text-xs hover:no-underline hover:bg-coollabs" target="_blank" <a class="text-xs hover:no-underline hover:bg-coollabs" target="_blank"
href="{{ $application->fqdn }}"> href="{{ $application->fqdn }}">
{{ $application->fqdn }} {{ $application->fqdn }}
<x-external-link />
</a> </a>
</li> </li>
@endif @endif
@ -40,13 +40,16 @@
<a class="text-xs hover:no-underline hover:bg-coollabs" target="_blank" <a class="text-xs hover:no-underline hover:bg-coollabs" target="_blank"
href="http://localhost:{{ explode(':', $port)[0] }}">Port href="http://localhost:{{ explode(':', $port)[0] }}">Port
{{ explode(':', $port)[0] }} {{ explode(':', $port)[0] }}
<x-external-link />
</a> </a>
</li> </li>
@else @else
<li> <li>
<a class="text-xs hover:no-underline hover:bg-coollabs" target="_blank" <a class="text-xs hover:no-underline hover:bg-coollabs" target="_blank"
href="http://{{ $application->destination->server->ip }}:{{ explode(':', $port)[0] }}">Port href="http://{{ $application->destination->server->ip }}:{{ explode(':', $port)[0] }}">Port
{{ $port }}</a> {{ $port }}
<x-external-link />
</a>
</li> </li>
@endif @endif
@endforeach @endforeach

View File

@ -1,5 +1,9 @@
<div x-data="{ deleteApplication: false }"> <div x-data="{ deleteApplication: false }">
<h2>Danger Zone</h2> <h2 class="pb-0">Danger Zone</h2>
<div class="text-sm">Woah. I hope you know what are you doing.</div>
<h3 class="pb-0">Delete Application</h3>
<div class="text-sm">This will stop your containers, delete all related data, etc. Beware! There is no coming back!
</div>
<x-naked-modal show="deleteApplication" /> <x-naked-modal show="deleteApplication" />
<x-forms.button x-on:click.prevent="deleteApplication = true">Delete this application</x-forms.button> <x-forms.button x-on:click.prevent="deleteApplication = true">Delete</x-forms.button>
</div> </div>

View File

@ -1,13 +1,12 @@
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
@if ($application->status === 'running') @if ($application->status === 'running')
<div class="dropdown dropdown-bottom"> <div class="dropdown dropdown-bottom">
<button tabindex="0" <x-forms.button isHighlighted tabindex="0" class="">
class="flex items-center justify-center h-full text-white normal-case rounded-none bg-primary btn btn-xs hover:bg-primary no-animation">
Actions Actions
<x-chevron-down /> <x-chevron-down />
</button> </x-forms.button>
<ul tabindex="0" <ul tabindex="0"
class="text-xs text-white normal-case rounded min-w-max dropdown-content menu bg-coolgray-200"> class="mt-1 text-xs text-white normal-case rounded min-w-max dropdown-content menu bg-coolgray-200">
<li> <li>
<div class="hover:bg-coollabs" wire:click='deploy'>Restart</div> <div class="hover:bg-coollabs" wire:click='deploy'>Restart</div>
</li> </li>
@ -21,13 +20,12 @@
</div> </div>
@else @else
<div class="dropdown dropdown-bottom"> <div class="dropdown dropdown-bottom">
<button tabindex="0" <x-forms.button isHighlighted tabindex="0" class="">
class="flex items-center justify-center h-full text-white normal-case rounded-none bg-primary btn btn-xs hover:bg-primary no-animation">
Actions Actions
<x-chevron-down /> <x-chevron-down />
</button> </x-forms.button>
<ul tabindex="0" <ul tabindex="0"
class="text-xs text-white normal-case rounded min-w-max dropdown-content menu bg-coolgray-200"> class="mt-1 text-xs text-white normal-case rounded min-w-max dropdown-content menu bg-coolgray-200">
<li> <li>
<div class="hover:bg-coollabs" wire:click='deploy'>Deploy</div> <div class="hover:bg-coollabs" wire:click='deploy'>Deploy</div>
</li> </li>

View File

@ -1,6 +1,7 @@
<div> <div>
<h2>Destination</h2> <h2 class="pb-0">Destination</h2>
<div> <div class="text-sm">The destination server / network where your application will be deployed to.</div>
<div class="py-4">
<p>Server: {{ data_get($destination, 'server.name') }}</p> <p>Server: {{ data_get($destination, 'server.name') }}</p>
<p>Destination: {{ $destination->network }}</p> <p>Destination: {{ $destination->network }}</p>
</div> </div>

View File

@ -1,5 +1,10 @@
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<h2>Environment Variables</h2> <div>
<h2 class="pb-0">Environment Variables</h2>
<div class="text-sm">Environment (secrets) configuration. You can set variables for your Preview Deployments as
well
here.</div>
</div>
@forelse ($application->environment_variables as $env) @forelse ($application->environment_variables as $env)
<livewire:project.application.environment-variable.show wire:key="environment-{{ $env->id }}" <livewire:project.application.environment-variable.show wire:key="environment-{{ $env->id }}"
:env="$env" /> :env="$env" />

View File

@ -1,13 +1,13 @@
<div> <div>
<form wire:submit.prevent='submit' class="flex flex-col"> <form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex gap-2"> <div class="flex gap-2">
<h2>General</h2> <h2 class="pb-0">General</h2>
<x-forms.button type="submit"> <x-forms.button type="submit">
Save Save
</x-forms.button> </x-forms.button>
</div> </div>
<x-forms.checkbox instantSave id="is_static" label="Static website?" /> <div class="text-sm">General configuration for your application.</div>
<div class="flex flex-col gap-2 pb-4"> <div class="flex flex-col gap-2 py-4">
<div class="flex flex-col items-end gap-2 xl:flex-row"> <div class="flex flex-col items-end gap-2 xl:flex-row">
<x-forms.input class="w-full" id="application.name" label="Name" required /> <x-forms.input class="w-full" id="application.name" label="Name" required />
<x-forms.input placeholder="https://coolify.io" class="w-full" id="application.fqdn" label="Domains" <x-forms.input placeholder="https://coolify.io" class="w-full" id="application.fqdn" label="Domains"
@ -32,13 +32,15 @@
<option disabled value="docker">Docker</option> <option disabled value="docker">Docker</option>
<option disabled value="compose">Compose</option> <option disabled value="compose">Compose</option>
</x-forms.select> </x-forms.select>
<x-forms.checkbox instantSave id="is_static" label="Static website?" />
@if ($application->settings->is_static) @if ($application->settings->is_static)
<x-forms.select id="application.static_image" label="Static Image" required> <x-forms.select id="application.static_image" label="Static Image" required>
<option value="nginx:alpine">nginx:alpine</option> <option value="nginx:alpine">nginx:alpine</option>
<option disabled value="apache:alpine">apache:alpine</option> <option disabled value="apache:alpine">apache:alpine</option>
</x-forms.select> </x-forms.select>
@endif @endif
<div class="flex flex-col gap-2 pb-6 xl:flex-row"> <h3>Build</h3>
<div class="flex flex-col gap-2 xl:flex-row">
<x-forms.input placeholder="pnpm install" id="application.install_command" label="Install Command" /> <x-forms.input placeholder="pnpm install" id="application.install_command" label="Install Command" />
<x-forms.input placeholder="pnpm build" id="application.build_command" label="Build Command" /> <x-forms.input placeholder="pnpm build" id="application.build_command" label="Build Command" />
<x-forms.input placeholder="pnpm start" id="application.start_command" label="Start Command" /> <x-forms.input placeholder="pnpm start" id="application.start_command" label="Start Command" />
@ -53,6 +55,7 @@
<x-forms.input placeholder="/" id="application.publish_directory" label="Publish Directory" /> <x-forms.input placeholder="/" id="application.publish_directory" label="Publish Directory" />
@endif @endif
</div> </div>
<h3>Network</h3>
<div class="flex flex-col gap-2 xl:flex-row"> <div class="flex flex-col gap-2 xl:flex-row">
@if ($application->settings->is_static) @if ($application->settings->is_static)
<x-forms.input id="application.ports_exposes" label="Ports Exposes" readonly /> <x-forms.input id="application.ports_exposes" label="Ports Exposes" readonly />
@ -72,10 +75,12 @@
helper="Your application will be available only on https if your domain starts with https://..." helper="Your application will be available only on https if your domain starts with https://..."
instantSave id="is_force_https" label="Force Https" /> instantSave id="is_force_https" label="Force Https" />
<x-forms.checkbox helper="Automatically deploy new commits based on Git webhooks." instantSave <x-forms.checkbox helper="Automatically deploy new commits based on Git webhooks." instantSave
id="is_auto_deploy" label="Auto Deploy?" /> id="is_auto_deploy" label="Auto Deploy" />
{{-- <x-forms.checkbox helper="Preview deployments" instantSave id="is_previews" label="Previews?" /> --}} {{-- <x-forms.checkbox helper="Preview deployments" instantSave id="is_previews" label="Previews?" /> --}}
<x-forms.checkbox instantSave id="is_git_submodules_allowed" label="Git Submodules Allowed?" /> <x-forms.checkbox instantSave id="is_git_submodules_allowed" label="Git Submodules"
<x-forms.checkbox instantSave id="is_git_lfs_allowed" label="Git LFS Allowed?" /> helper="Allow Git Submodules during build process." />
<x-forms.checkbox instantSave id="is_git_lfs_allowed" label="Git LFS"
helper="Allow Git LFS during build process." />
{{-- <x-forms.checkbox disabled instantSave id="is_dual_cert" label="Dual Certs?" /> {{-- <x-forms.checkbox disabled instantSave id="is_dual_cert" label="Dual Certs?" />
<x-forms.checkbox disabled instantSave id="is_custom_ssl" label="Is Custom SSL?" /> <x-forms.checkbox disabled instantSave id="is_custom_ssl" label="Is Custom SSL?" />
<x-forms.checkbox disabled instantSave id="is_http2" label="Is Http2?" /> --}} <x-forms.checkbox disabled instantSave id="is_http2" label="Is Http2?" /> --}}

View File

@ -1,9 +1,10 @@
<form wire:submit.prevent='submit'> <form wire:submit.prevent='submit'>
<div class="flex gap-2"> <div class="flex gap-2">
<h3 class="pt-0">Settings</h3> <h2 class="pb-0">Previews Deployments</h2>
<x-forms.button type="submit">Save</x-forms.button> <x-forms.button type="submit">Save</x-forms.button>
<x-forms.button wire:click="resetToDefault">Reset to default</x-forms.button> <x-forms.button wire:click="resetToDefault">Reset to default</x-forms.button>
</div> </div>
<div class="pb-4 text-sm">Preview Deployments based on pull requests are here.</div>
<div class="flex flex-col gap-2 pb-4"> <div class="flex flex-col gap-2 pb-4">
<x-forms.input id="application.preview_url_template" label="Preview URL Template" <x-forms.input id="application.preview_url_template" label="Preview URL Template"
helper="Templates:<span class='text-helper'>@@{{ random }}</span> to generate random sub-domain each time a PR is deployed, <span class='text-helper'>@@{{ pr_id }}</span> to use pull request ID as sub-domain or <span class='text-helper'>@@{{ domain }}</span> to replace the domain name with the application's domain name." /> helper="Templates:<span class='text-helper'>@@{{ random }}</span> to generate random sub-domain each time a PR is deployed, <span class='text-helper'>@@{{ pr_id }}</span> to use pull request ID as sub-domain or <span class='text-helper'>@@{{ domain }}</span> to replace the domain name with the application's domain name." />

View File

@ -1,41 +1,52 @@
<div> <div>
<h2>Previews</h2>
<livewire:project.application.preview.form :application="$application" /> <livewire:project.application.preview.form :application="$application" />
<h3>Pull Requests on Git</h3> <h3>Pull Requests on Git</h3>
<div> <div>
<x-forms.button wire:loading.remove wire:target='load_prs' wire:click="load_prs">Load Pull Requests <x-forms.button wire:click="load_prs">Load Pull Requests
</x-forms.button> </x-forms.button>
@isset($rate_limit_remaining) @isset($rate_limit_remaining)
<div class="text-sm">Requests remaning till rate limited: {{ $rate_limit_remaining }}</div> <div class="pt-1 text-sm">Requests remaning till rate limited by Git: {{ $rate_limit_remaining }}</div>
@endisset @endisset
<div wire:loading.remove wire:target='load_prs' class="pt-4"> @if (count($pull_requests) > 0)
@if (count($pull_requests) > 0) <div wire:loading.remove wire:target='load_prs' class="flex gap-4 py-8">
@foreach ($pull_requests as $pull_request) @foreach ($pull_requests as $pull_request)
<div> <div class="flex flex-col gap-4 p-4 text-sm bg-coolgray-200 hover:bg-coolgray-300">
<div>PR #{{ data_get($pull_request, 'number') }} | {{ data_get($pull_request, 'title') }}</div> <div class="text-base font-bold text-white">PR #{{ data_get($pull_request, 'number') }} |
<x-forms.button wire:click="deploy({{ data_get($pull_request, 'number') }})">Deploy {{ data_get($pull_request, 'title') }}</div>
</x-forms.button> <div class="flex items-center justify-start gap-2">
<x-forms.button isHighlighted
wire:click="deploy('{{ data_get($pull_request, 'number') }}', '{{ data_get($pull_request, 'html_url') }}')">
Deploy
</x-forms.button>
<a target="_blank" class="text-xs" href="{{ data_get($pull_request, 'html_url') }}">Open PR
on
Git
<x-external-link />
</a>
</div>
</div> </div>
@endforeach @endforeach
@endif </div>
</div> @endif
<div wire:loading wire:target='load_prs'>
<x-loading />
</div>
</div> </div>
@if ($application->previews->count() > 0) @if ($application->previews->count() > 0)
<h3>Preview Deployments</h3> <h3>Preview Deployments</h3>
<div class="flex gap-6 text-sm"> <div class="flex gap-6 text-sm">
@foreach ($application->previews as $preview) @foreach ($application->previews as $preview)
<div class="flex flex-col" x-init="$wire.loadStatus({{ data_get($preview, 'pull_request_id') }})"> <div class="flex flex-col p-4 bg-coolgray-200 " x-init="$wire.loadStatus('{{ data_get($preview, 'pull_request_id') }}')">
<div>PR #{{ data_get($preview, 'pull_request_id') }} | {{ data_get($preview, 'status') }} <div>PR #{{ data_get($preview, 'pull_request_id') }} | {{ data_get($preview, 'status') }}
@if (data_get($preview, 'status') !== 'exited') @if (data_get($preview, 'status') !== 'exited')
| <a target="_blank" href="{{ data_get($preview, 'fqdn') }}">Open Preview | <a target="_blank" href="{{ data_get($preview, 'fqdn') }}">Open Preview
<x-external-link /> <x-external-link />
</a> </a>
@endif @endif
|
<a target="_blank" href="{{ data_get($preview, 'pull_request_html_url') }}">Open PR on Git
<x-external-link />
</a>
</div> </div>
<div class="flex gap-2 pt-2"> <div class="flex items-center gap-2 pt-6">
<x-forms.button isHighlighted wire:click="deploy({{ data_get($preview, 'pull_request_id') }})"> <x-forms.button isHighlighted wire:click="deploy({{ data_get($preview, 'pull_request_id') }})">
@if (data_get($preview, 'status') === 'exited') @if (data_get($preview, 'status') === 'exited')
Deploy Deploy
@ -44,9 +55,11 @@
@endif @endif
</x-forms.button> </x-forms.button>
@if (data_get($preview, 'status') !== 'exited') @if (data_get($preview, 'status') !== 'exited')
<x-forms.button wire:click="stop({{ data_get($preview, 'pull_request_id') }})">Stop <x-forms.button wire:click="stop({{ data_get($preview, 'pull_request_id') }})">Remove
Preview
</x-forms.button> </x-forms.button>
@endif @endif
</div> </div>
</div> </div>
@endforeach @endforeach

View File

@ -1,20 +1,23 @@
<div> <div>
<form wire:submit.prevent='submit' class="flex flex-col"> <form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex gap-2"> <div class="flex gap-2">
<h2>Resource Limits</h2> <h2 class="pb-0">Resource Limits</h2>
<x-forms.button type='submit'>Save</x-forms.button> <x-forms.button type='submit'>Save</x-forms.button>
</div> </div>
<div>Limit your container resources by CPU & memory.</div> <div class="text-sm">Limit your container resources by CPU & memory.</div>
<h3>CPU</h3> <h3>Limit CPUs</h3>
<x-forms.input placeholder="1.5" label="Number of CPUs" id="application.limits_cpus" /> <x-forms.input placeholder="1.5" label="Number of CPUs" id="application.limits_cpus" />
<x-forms.input placeholder="0-2" label="CPU set to use" id="application.limits_cpuset" /> <x-forms.input placeholder="0-2" label="CPU sets to use" id="application.limits_cpuset" />
<x-forms.input placeholder="1024" label="CPU Weight" id="application.limits_cpu_shares" /> <x-forms.input placeholder="1024" label="CPU Weight" id="application.limits_cpu_shares" />
<h3>Memory</h3> <h3>Limit Memory</h3>
<x-forms.input placeholder="69b or 420k or 1337m or 1g" label="Limit" id="application.limits_memory" /> <x-forms.input placeholder="69b or 420k or 1337m or 1g" label="Soft Memory Limit"
<x-forms.input placeholder="69b or 420k or 1337m or 1g" label="Swap" id="application.limits_memory_swap" /> id="application.limits_memory_reservation" />
<x-forms.input placeholder="69b or 420k or 1337m or 1g" label="Maximum Memory Limit"
id="application.limits_memory" />
<x-forms.input placeholder="69b or 420k or 1337m or 1g" label="Maximum Swap Limit"
id="application.limits_memory_swap" />
<x-forms.input placeholder="0-100" type="number" min="0" max="100" label="Swappiness" <x-forms.input placeholder="0-100" type="number" min="0" max="100" label="Swappiness"
id="application.limits_memory_swappiness" /> id="application.limits_memory_swappiness" />
<x-forms.input placeholder="69b or 420k or 1337m or 1g" label="Soft Limit"
id="application.limits_memory_reservation" />
</form> </form>
</div> </div>

View File

@ -1,8 +1,9 @@
<div x-init="$wire.loadImages"> <div x-init="$wire.loadImages">
<div class="flex gap-2"> <div class="flex gap-2">
<h2>Rollback</h2> <h2 class="pb-0">Rollback</h2>
<x-forms.button isHighlighted wire:click='loadImages'>Refresh</x-forms.button> <x-forms.button isHighlighted wire:click='loadImages'>Reload Available Images</x-forms.button>
</div> </div>
<div class="pb-4 text-sm">You can easily rollback to a previously built image quickly.</div>
<div wire:loading wire:target='loadImages'> <div wire:loading wire:target='loadImages'>
<x-loading /> <x-loading />
</div> </div>
@ -10,7 +11,7 @@
<div class="flex flex-wrap"> <div class="flex flex-wrap">
@forelse ($images as $image) @forelse ($images as $image)
<div class="w-2/4 p-2"> <div class="w-2/4 p-2">
<div class="rounded-lg shadow-lg bg-coolgray-200"> <div class="rounded shadow-lg bg-coolgray-200">
<div class="p-2"> <div class="p-2">
<div class="text-sm"> <div class="text-sm">
@if (data_get($image, 'is_current')) @if (data_get($image, 'is_current'))
@ -27,7 +28,8 @@
Rollback Rollback
</x-forms.button> </x-forms.button>
@else @else
<x-forms.button wire:click="rollbackImage('{{ data_get($image, 'tag') }}')"> <x-forms.button isHighlighted
wire:click="rollbackImage('{{ data_get($image, 'tag') }}')">
Rollback Rollback
</x-forms.button> </x-forms.button>
@endif @endif

View File

@ -1,19 +1,25 @@
<div> <div>
<form wire:submit.prevent='submit' class="flex flex-col gap-2"> <form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex gap-4"> <div class="flex items-center gap-2">
<h2>Source</h2> <h2 class="pb-0">Source</h2>
<x-forms.button type="submit">Save</x-forms.button> <x-forms.button type="submit">Save</x-forms.button>
<a target="_blank" href="{{ $application->gitCommits }}"> </div>
Commits <div class="text-sm">Code source of your application.</div>
<x-external-link /> <div class="py-4 ">
<a target="_blank" class="hover:no-underline" href="{{ $application->gitCommits }}">
<x-forms.button>Open Commits on Git
<x-external-link />
</x-forms.button>
</a> </a>
<a target="_blank" href="{{ $application->gitBranchLocation }}"> <a target="_blank" class="hover:no-underline" href="{{ $application->gitBranchLocation }}">
Open Repository <x-forms.button>Open Repository on Git
<x-external-link /> <x-external-link />
</x-forms.button>
</a> </a>
</div> </div>
<x-forms.input placeholder="coollabsio/coolify-example" id="application.git_repository" label="Repository" /> <x-forms.input placeholder="coollabsio/coolify-example" id="application.git_repository" label="Repository" />
<x-forms.input placeholder="main" id="application.git_branch" label=" Branch" /> <x-forms.input placeholder="main" id="application.git_branch" label=" Branch" />
<x-forms.input placeholder="HEAD" id="application.git_commit_sha" placeholder="HEAD" label="Commit SHA" /> <x-forms.input placeholder="HEAD" id="application.git_commit_sha" placeholder="HEAD" label="Commit SHA" />
</form> </form>
</div> </div>

View File

@ -1,10 +1,8 @@
<form wire:submit.prevent='submit' class="flex flex-col px-2 pt-10 max-w-fit"> <form wire:submit.prevent='submit' class="flex flex-col px-2 pt-10 max-w-fit">
<div class="flex gap-2"> <div class="flex items-end gap-2">
<x-forms.input placeholder="pv-name" noDirty id="name" label="Name" required /> <x-forms.input placeholder="pv-name" noDirty id="name" label="Name" required />
<x-forms.input placeholder="/root" noDirty id="host_path" label="Source Path" /> <x-forms.input placeholder="/root" noDirty id="host_path" label="Source Path" />
<x-forms.input placeholder="/tmp/root" noDirty id="mount_path" label="Destination Path" required /> <x-forms.input placeholder="/tmp/root" noDirty id="mount_path" label="Destination Path" required />
</div>
<div class="pt-2">
<x-forms.button type="submit"> <x-forms.button type="submit">
Add Add
</x-forms.button> </x-forms.button>

View File

@ -1,9 +1,12 @@
<div class="flex flex-col gap-2"> <div>
<h2>Storages</h2> <h2 class="pb-0">Storages</h2>
@forelse ($application->persistentStorages as $storage) <div class="text-sm">Persistent storage to preserve data between deployments.</div>
<livewire:project.application.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage" /> <div class="flex flex-col gap-2 py-4">
@empty @forelse ($application->persistentStorages as $storage)
<p>There are no persistent storages attached for this application.</p> <livewire:project.application.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage" />
@endforelse @empty
<p>There are no persistent storages attached for this application.</p>
@endforelse
</div>
<livewire:project.application.storages.add /> <livewire:project.application.storages.add />
</div> </div>

View File

@ -1,11 +1,9 @@
<div x-data="{ deleteStorage: false }"> <div x-data="{ deleteStorage: false }">
<form wire:submit.prevent='submit' class="flex flex-col px-2 max-w-fit"> <form wire:submit.prevent='submit' class="flex flex-col px-2">
<div class="flex gap-2"> <div class="flex items-end gap-2">
<x-forms.input id="storage.name" label="Name" required /> <x-forms.input id="storage.name" label="Name" required />
<x-forms.input id="storage.host_path" label="Source Path" /> <x-forms.input id="storage.host_path" label="Source Path" />
<x-forms.input id="storage.mount_path" label="Destination Path" required /> <x-forms.input id="storage.mount_path" label="Destination Path" required />
</div>
<div class="pt-2">
<x-forms.button type="submit"> <x-forms.button type="submit">
Update Update
</x-forms.button> </x-forms.button>

View File

@ -18,7 +18,6 @@
<x-forms.input type="number" id="settings.public_port_min" label="Public Port Min" /> <x-forms.input type="number" id="settings.public_port_min" label="Public Port Min" />
<x-forms.input type="number" id="settings.public_port_max" label="Public Port Max" /> <x-forms.input type="number" id="settings.public_port_max" label="Public Port Max" />
</div> </div>
</div> </div>
</form> </form>

View File

@ -31,6 +31,7 @@
</a> </a>
<a :class="activeTab === 'previews' && 'text-white'" <a :class="activeTab === 'previews' && 'text-white'"
@click.prevent="activeTab = 'previews'; window.location.hash = 'previews'" href="#">Previews @click.prevent="activeTab = 'previews'; window.location.hash = 'previews'" href="#">Previews
Deployments
</a> </a>
<a :class="activeTab === 'rollback' && 'text-white'" <a :class="activeTab === 'rollback' && 'text-white'"
@click.prevent="activeTab = 'rollback'; window.location.hash = 'rollback'" href="#">Rollback @click.prevent="activeTab = 'rollback'; window.location.hash = 'rollback'" href="#">Rollback

View File

@ -12,10 +12,10 @@
</ul> </ul>
</div> </div>
<x-applications.navbar :application="$application" /> <x-applications.navbar :application="$application" />
<div class="pt-2 text-sm">{{ data_get($activity, 'properties.status') }}</div> <div class="pt-2 text-sm">Status: {{ data_get($activity, 'properties.status') }}</div>
@if (data_get($activity, 'properties.status') === 'in_progress' || @if (data_get($activity, 'properties.status') === 'in_progress' &&
data_get($deployment, 'metadata.status') !== 'error' || (data_get($deployment, 'metadata.status') !== 'error' ||
data_get($deployment, 'metadata.status') !== 'finished') data_get($deployment, 'metadata.status') !== 'finished'))
<livewire:project.application.deployment-cancel :activity="$activity" :application="$application" :deployment_uuid="$deployment_uuid" /> <livewire:project.application.deployment-cancel :activity="$activity" :application="$application" :deployment_uuid="$deployment_uuid" />
@endif @endif
<livewire:project.application.deployment-logs :activity="$activity" :deployment_uuid="$deployment_uuid" /> <livewire:project.application.deployment-logs :activity="$activity" :deployment_uuid="$deployment_uuid" />