This commit is contained in:
Andras Bacsai
2023-05-30 15:52:17 +02:00
parent 6e72889294
commit 0f50d1accd
36 changed files with 715 additions and 273 deletions

View File

@@ -126,4 +126,7 @@ a {
}
.bg-coollabs-gradient {
@apply text-transparent bg-clip-text bg-gradient-to-r from-purple-500 via-pink-500 to-red-500;
}
.bold-helper {
@apply inline-block font-bold text-warning
}

View File

@@ -1 +1 @@
<img class="inline-flex w-3 h-3 mb-1 ml-2" src="{{ asset('svgs/external-link.svg') }}">
<img class="inline-flex w-3 h-3" src="{{ asset('svgs/external-link.svg') }}">

View File

@@ -0,0 +1,3 @@
<div>
<x-forms.button wire:click="cancel" isHighlighted>Cancel</x-forms.button>
</div>

View File

@@ -6,17 +6,30 @@
<a @class([
'bg-coolgray-200 p-2 border-l border-dashed transition-colors hover:no-underline',
'cursor-not-allowed hover:bg-coolgray-200' =>
$deployment->status === 'queued' ||
$deployment->status === 'cancelled by system',
data_get($deployment, 'status') === 'queued' ||
data_get($deployment, 'status') === 'cancelled by system',
'border-warning hover:bg-warning hover:text-black' =>
$deployment->status === 'in_progress',
'border-error hover:bg-error' => $deployment->status === 'error',
'border-success hover:bg-success' => $deployment->status === 'finished',
]) @if ($deployment->status !== 'cancelled by system' && $deployment->status !== 'queued')
href="{{ $current_url . '/' . $deployment->extra_attributes['deployment_uuid'] }}"
data_get($deployment, 'status') === 'in_progress',
'border-error hover:bg-error' =>
data_get($deployment, 'status') === 'error',
'border-success hover:bg-success' =>
data_get($deployment, 'status') === 'finished',
]) @if (data_get($deployment, 'status') !== 'cancelled by system' && data_get($deployment, 'status') !== 'queued')
href="{{ $current_url . '/' . data_get($deployment, 'deployment_uuid') }}"
@endif
class="hover:no-underline">
<div class="flex flex-col justify-start">
@if (data_get($deployment, 'pull_request_id'))
<div>Pull Request #{{ data_get($deployment, 'pull_request_id') }}</div>
@else
<div>Commit:
@if (data_get($deployment, 'commit'))
{{ data_get($deployment, 'commit') }}
@else
HEAD
@endif
</div>
@endif
<div>
{{ $deployment->status }}
</div>

View File

@@ -11,7 +11,7 @@
<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 placeholder="https://coolify.io" class="w-full" id="application.fqdn" label="Domains"
helper="You can specify one domain with path or more with comma.<br><span class='inline-block font-bold text-warning'>Example</span>- http://app.coolify.io, https://cloud.coolify.io/dashboard<br>- http://app.coolify.io/api/v3" />
helper="You can specify one domain with path or more with comma.<br><span class='bold-helper'>Example</span>- http://app.coolify.io, https://cloud.coolify.io/dashboard<br>- http://app.coolify.io/api/v3" />
</div>
@if ($wildcard_domain)

View File

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

View File

@@ -1,8 +1,55 @@
<div>
<h2>Previews</h2>
<div class="flex gap-2">
@foreach ($application->previews as $preview)
<div class="box">{{ $preview['pullRequestId'] }} | {{ $preview['branch'] }}</div>
@endforeach
<livewire:project.application.preview.form :application="$application" />
<h3>Pull Requests on Git</h3>
<div>
<x-forms.button wire:loading.remove wire:target='load_prs' wire:click="load_prs">Load Pull Requests
</x-forms.button>
@isset($rate_limit_remaining)
<div class="text-sm">Requests remaning till rate limited: {{ $rate_limit_remaining }}</div>
@endisset
<div wire:loading.remove wire:target='load_prs' class="pt-4">
@if (count($pull_requests) > 0)
@foreach ($pull_requests as $pull_request)
<div>
<div>PR #{{ data_get($pull_request, 'number') }} | {{ data_get($pull_request, 'title') }}</div>
<x-forms.button wire:click="deploy({{ data_get($pull_request, 'number') }})">Deploy
</x-forms.button>
</div>
@endforeach
@endif
</div>
<div wire:loading wire:target='load_prs'>
<x-loading />
</div>
</div>
@if ($application->previews->count() > 0)
<h3>Preview Deployments</h3>
<div class="flex gap-6 text-sm">
@foreach ($application->previews as $preview)
<div class="flex flex-col" x-init="$wire.loadStatus({{ data_get($preview, 'pull_request_id') }})">
<div>PR #{{ data_get($preview, 'pull_request_id') }} | {{ data_get($preview, 'status') }}
@if (data_get($preview, 'status') !== 'exited')
| <a target="_blank" href="{{ data_get($preview, 'fqdn') }}">Open Preview
<x-external-link />
</a>
@endif
</div>
<div class="flex gap-2 pt-2">
<x-forms.button isHighlighted wire:click="deploy({{ data_get($preview, 'pull_request_id') }})">
@if (data_get($preview, 'status') === 'exited')
Deploy
@else
Redeploy
@endif
</x-forms.button>
@if (data_get($preview, 'status') !== 'exited')
<x-forms.button wire:click="stop({{ data_get($preview, 'pull_request_id') }})">Stop
</x-forms.button>
@endif
</div>
</div>
@endforeach
</div>
@endif
</div>

View File

@@ -4,7 +4,7 @@
<x-forms.checkbox instantSave id="is_static" label="Is it a static site?" />
<div class="flex gap-2">
<x-forms.input id="repository_url" label="Repository URL"
helper="<span class='inline-block font-bold text-warning'>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="<span class='bold-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" />
@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." />

View File

@@ -29,6 +29,9 @@
<a :class="activeTab === 'storages' && 'text-white'"
@click.prevent="activeTab = 'storages'; window.location.hash = 'storages'" href="#">Storages
</a>
<a :class="activeTab === 'previews' && 'text-white'"
@click.prevent="activeTab = 'previews'; window.location.hash = 'previews'" href="#">Previews
</a>
<a :class="activeTab === 'rollback' && 'text-white'"
@click.prevent="activeTab = 'rollback'; window.location.hash = 'rollback'" href="#">Rollback
</a>
@@ -59,6 +62,9 @@
<div x-cloak x-show="activeTab === 'storages'">
<livewire:project.application.storages.all :application="$application" />
</div>
<div x-cloak x-show="activeTab === 'previews'">
<livewire:project.application.previews :application="$application" />
</div>
<div x-cloak x-show="activeTab === 'rollback'">
<livewire:project.application.rollback :application="$application" />
</div>

View File

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