Merge branch 'v4-next' into notifications

This commit is contained in:
Andras Bacsai
2023-06-01 08:22:07 +02:00
204 changed files with 5744 additions and 2545 deletions

View File

@@ -1,8 +1,8 @@
<div>
@if ($this->activity)
<div
class="flex flex-col-reverse w-full overflow-y-auto border border-solid rounded border-coolgray-300 max-h-[32rem] p-4">
<pre class="whitespace-pre-wrap" @if ($isPollingActive) wire:poll.750ms="polling" @endif>{{ \App\Actions\CoolifyTask\RunRemoteProcess::decodeOutput($this->activity) }}</pre>
class="scrollbar flex flex-col-reverse w-full overflow-y-auto border border-solid rounded border-coolgray-300 max-h-[32rem] p-4 text-xs text-white">
<pre class="font-mono whitespace-pre-wrap" @if ($isPollingActive) wire:poll.2000ms="polling" @endif>{{ \App\Actions\CoolifyTask\RunRemoteProcess::decodeOutput($this->activity) }}</pre>
{{-- @else
<pre class="whitespace-pre-wrap">Output will be here...</pre> --}}
</div>

View File

@@ -1,6 +1,6 @@
<div>
<x-inputs.button wire:click='checkUpdate' type="submit">
Check Update</x-inputs.button>
<x-forms.button wire:click='checkUpdate' type="submit">
Check Update</x-forms.button>
@if ($updateAvailable)
Update available
@endif

View File

@@ -1,18 +1,18 @@
<div x-data="{ deleteDestination: false }">
<x-naked-modal show="deleteDestination" message='Are you sure you would like to delete this destination?' />
<form class="flex flex-col gap-4" wire:submit.prevent='submit'>
<x-inputs.input id="destination.name" label="Name" />
<x-inputs.input id="destination.server.ip" label="Server IP" readonly />
<x-forms.input id="destination.name" label="Name" />
<x-forms.input id="destination.server.ip" label="Server IP" readonly />
@if ($destination->getMorphClass() === 'App\Models\StandaloneDocker')
<x-inputs.input id="destination.network" label="Docker Network" readonly />
<x-forms.input id="destination.network" label="Docker Network" readonly />
@endif
<div>
<x-inputs.button type="submit">
<x-forms.button type="submit">
Save
</x-inputs.button>
<x-inputs.button x-on:click.prevent="deleteDestination = true">
</x-forms.button>
<x-forms.button x-on:click.prevent="deleteDestination = true">
Delete
</x-inputs.button>
</x-forms.button>
</div>
</form>
</div>

View File

@@ -1,15 +1,19 @@
<div>
<form class="flex items-end gap-4" wire:submit.prevent='submit'>
<x-inputs.input id="name" label="Name" required />
<x-inputs.input id="network" label="Network" required />
<x-inputs.select id="server_id" label="Select a server" required>
<form class="flex flex-col gap-4" wire:submit.prevent='submit'>
<div class="flex gap-2">
<h1>New Destination</h1>
<x-forms.button type="submit">
Save
</x-forms.button>
</div>
<x-forms.input id="name" label="Name" required />
<x-forms.input id="network" label="Network" required />
<x-forms.select id="server_id" label="Select a server" required>
@foreach ($servers as $server)
<option disabled>Select a server</option>
<option value="{{ $server->id }}">{{ $server->name }}</option>
@endforeach
</x-inputs.select>
<x-inputs.button type="submit">
Submit
</x-inputs.button>
</x-forms.select>
</form>
</div>

View File

@@ -1,3 +1,75 @@
<a href="#" class="justify-between font-normal link link-hover hover:bg-transparent hover:text-white"
wire:click='upgrade'>Force
Upgrade</a>
<div class="flex gap-10 text-xs text-white" x-data="{ visible: @entangle('visible') }">
<button x-cloak x-show="!visible"
class="gap-2 text-white normal-case btn btn-ghost hover:no-underline bg-coollabs hover:bg-coollabs-100"
wire:click='upgrade'>
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"
fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M10 20.777a8.942 8.942 0 0 1 -2.48 -.969" />
<path d="M14 3.223a9.003 9.003 0 0 1 0 17.554" />
<path d="M4.579 17.093a8.961 8.961 0 0 1 -1.227 -2.592" />
<path d="M3.124 10.5c.16 -.95 .468 -1.85 .9 -2.675l.169 -.305" />
<path d="M6.907 4.579a8.954 8.954 0 0 1 3.093 -1.356" />
<path d="M12 9l-2 3h4l-2 3" />
</svg>Force Upgrade
</button>
<template x-if="visible">
<div class="bg-coollabs-gradient">
<svg xmlns="http://www.w3.org/2000/svg" class="w-10 h-10 mx-auto text-pink-500 lds-heart"
viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M19.5 13.572l-7.5 7.428l-7.5 -7.428m0 0a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" />
</svg> Upgrading, please wait...
<script>
function checkHealth() {
console.log('Checking server\'s health...')
checkHealthInterval = setInterval(async () => {
try {
const res = await fetch('/api/health');
if (res.ok) {
console.log('Server is back online. Reloading...')
if (checkHealthInterval) clearInterval(checkHealthInterval);
window.location.reload();
}
} catch (error) {
console.log('Waiting for server to come back from dead...');
}
return;
}, 2000);
}
function checkIfIamDead() {
console.log('Checking server\'s pulse...')
checkIfIamDeadInterval = setInterval(async () => {
try {
const res = await fetch('/api/health');
if (res.ok) {
console.log('I\'m alive. Waiting for server to be dead...');
}
} catch (error) {
console.log('I\'m dead. Charging... Standby... Bzz... Bzz...')
checkHealth();
if (checkIfIamDeadInterval) clearInterval(checkIfIamDeadInterval);
}
return;
}, 2000);
}
let checkHealthInterval = null;
let checkIfIamDeadInterval = null;
console.log('Update initiated. Waiting for server to be dead...')
checkIfIamDead();
</script>
</div>
<svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 mx-auto lds-heart" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M19.5 12.572l-7.5 7.428l-7.5 -7.428a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" />
<path d="M12 6l-2 4l4 3l-2 4v3" />
</svg>
</template>
{{-- <livewire:upgrading /> --}}
</div>

View File

@@ -1,16 +1,16 @@
<div x-data="{ deletePrivateKey: false }">
<x-naked-modal show="deletePrivateKey" message='Are you sure you would like to delete this private key?' />
<form class="flex flex-col gap-2" wire:submit.prevent='changePrivateKey'>
<x-inputs.input id="private_key.name" label="Name" required />
<x-inputs.input id="private_key.description" label="Description" />
<x-inputs.textarea rows="10" id="private_key.private_key" label="Private Key" required />
<x-forms.input id="private_key.name" label="Name" required />
<x-forms.input id="private_key.description" label="Description" />
<x-forms.textarea rows="10" id="private_key.private_key" label="Private Key" required />
<div>
<x-inputs.button type="submit">
<x-forms.button type="submit">
Save
</x-inputs.button>
<x-inputs.button x-on:click.prevent="deletePrivateKey = true">
</x-forms.button>
<x-forms.button x-on:click.prevent="deletePrivateKey = true">
Delete
</x-inputs.button>
</x-forms.button>
</div>
</form>
</div>

View File

@@ -1,10 +1,11 @@
<div>
<form class="flex flex-col gap-2 " wire:submit.prevent='createPrivateKey'>
<x-inputs.input id="name" label="Name" required />
<x-inputs.input id="description" label="Description" />
<x-inputs.input type="textarea" id="value" label="Private Key" required />
<x-inputs.button type="submit" wire.click.prevent>
<x-forms.input id="name" label="Name" required />
<x-forms.input id="description" label="Description" />
<x-forms.textarea id="value" rows="10" placeholder="-----BEGIN OPENSSH PRIVATE KEY-----"
label="Private Key" required />
<x-forms.button type="submit" wire.click.prevent>
Save
</x-inputs.button>
</x-forms.button>
</form>
</div>

View File

@@ -0,0 +1,10 @@
<div>
<form wire:submit.prevent='submit'>
<div class="flex items-center gap-2">
<h3>Profile</h3>
<x-forms.button type="submit" label="Save">Save</x-forms.button>
</div>
<x-forms.input id="name" label="Name" required />
<x-forms.input id="email" label="Email" readonly />
</form>
</div>

View File

@@ -1,5 +1,9 @@
<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-inputs.button isWarning x-on:click.prevent="deleteApplication = true">Delete this application</x-inputs.button>
<x-forms.button x-on:click.prevent="deleteApplication = true">Delete</x-forms.button>
</div>

View File

@@ -1,38 +1,40 @@
<div class="flex items-center gap-2">
@if ($application->status === 'running')
<div class="btn-group">
<x-inputs.button isWarning wire:click='stop'>Stop</x-inputs.button>
<div class="border-none dropdown dropdown-hover btn btn-xs bg-coollabs hover:bg-coollabs-100 no-animation">
<button tabindex="0" class="flex items-center justify-center h-full">👇</button>
<ul tabindex="0"
class="text-xs text-white normal-case rounded min-w-max dropdown-content menu bg-coolgray-200">
<li>
<div wire:click='forceRebuild'>Force deploy without cache</div>
</li>
</ul>
</div>
<div class="dropdown dropdown-bottom">
<x-forms.button isHighlighted tabindex="0" class="">
Actions
<x-chevron-down />
</x-forms.button>
<ul tabindex="0"
class="mt-1 text-xs text-white normal-case rounded min-w-max dropdown-content menu bg-coolgray-200">
<li>
<div class="hover:bg-coollabs" wire:click='deploy'>Restart</div>
</li>
<li>
<div class="hover:bg-coollabs" wire:click='deploy(true)'>Force deploy without cache</div>
</li>
<li>
<div class="hover:bg-red-500" wire:click='stop'>Stop</div>
</li>
</ul>
</div>
@else
<div class="btn-group">
<x-inputs.button isHighlighted wire:click='start'>Deploy</x-inputs.button>
<div class="border-none dropdown dropdown-hover btn btn-xs bg-coollabs hover:bg-coollabs-100 no-animation">
<button tabindex="0" class="flex items-center justify-center h-full">👇</button>
<ul tabindex="0"
class="text-xs text-white normal-case rounded min-w-max dropdown-content menu bg-coolgray-200">
<li>
<div wire:click='forceRebuild'>Deploy without cache</div>
</li>
</ul>
</div>
<div class="dropdown dropdown-bottom">
<label tabindex="0">
<x-forms.button isHighlighted>
Actions
<x-chevron-down />
</x-forms.button>
</label>
<ul tabindex="0"
class="mt-1 text-xs text-white normal-case rounded min-w-max dropdown-content menu bg-coolgray-200">
<li>
<div class="hover:bg-coollabs" wire:click='deploy'>Deploy</div>
</li>
<li>
<div class="hover:bg-coollabs" wire:click='deploy(true)'>Deploy without cache</div>
</li>
</ul>
</div>
@endif
<span wire:poll.5000ms='pollingStatus'>
{{-- @if ($application->status === 'running')
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
<span class="text-green-500" wire:loading.remove.delay.longer>{{ $application->status }}</span>
@else
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
<span class="text-red-500" wire:loading.remove.delay.longer>{{ $application->status }}</span>
@endif --}}
</span>
</div>

View File

@@ -0,0 +1,18 @@
<div>
<livewire:project.application.deployment-navbar :activity="$activity" :application="$application" :deployment_uuid="$deployment_uuid" />
<h3 class="pb-0">Logs</h3>
@if (data_get($activity, 'properties.status') === 'in_progress')
<div class="pt-2 text-sm">Deployment is
<span class="text-warning">{{ Str::headline(data_get($activity, 'properties.status')) }}</span>. Logs will
be updated
automatically.
</div>
@else
<div class="pt-2 text-sm">Deployment is <span
class="text-warning">{{ Str::headline(data_get($activity, 'properties.status')) }}</span>.</div>
@endif
<div
class="scrollbar flex flex-col-reverse w-full overflow-y-auto border border-solid rounded border-coolgray-300 max-h-[32rem] p-4 mt-4 text-xs text-white">
<pre class="font-mono whitespace-pre-wrap" @if ($isKeepAliveOn) wire:poll.2000ms="polling" @endif>{{ \App\Actions\CoolifyTask\RunRemoteProcess::decodeOutput($activity) }}</pre>
</div>
</div>

View File

@@ -0,0 +1,8 @@
<div>
<h3>Actions</h3>
@if (data_get($activity, 'properties.status') === 'in_progress')
<x-forms.button wire:click.prevent="cancel">Cancel deployment</x-forms.button>
@else
<x-forms.button disabled>Cancel deployment</x-forms.button>
@endif
</div>

View File

@@ -0,0 +1,95 @@
<div class="flex flex-col gap-2" wire:init='load_deployments'
@if ($skip == 0) wire:poll.5000ms='reload_deployments' @endif>
<div>
<h3>Actions</h3>
@if ($show_next)
<x-forms.button isHighlighted wire:click="load_deployments({{ $default_take }})">Load Previous
Deployments</x-forms.button>
@else
<x-forms.button disabled>No More Deployments</x-forms.button>
@endif
</div>
<h3>Deployments <span class="text-xs">({{ $deployments_count }})</span></h3>
@foreach ($deployments as $deployment)
<a @class([
'bg-coolgray-200 p-2 border-l border-dashed transition-colors hover:no-underline',
'cursor-not-allowed hover:bg-coolgray-200' =>
data_get($deployment, 'status') === 'queued' ||
data_get($deployment, 'status') === 'cancelled by system',
'border-warning hover:bg-warning hover:text-black' =>
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">
<div>
{{ $deployment->id }} <span class="text-sm text-warning">></span> {{ $deployment->deployment_uuid }} <span
class="text-sm text-warning">></span>
{{ $deployment->status }}
</div>
@if (data_get($deployment, 'pull_request_id'))
<div>
Pull Request #{{ data_get($deployment, 'pull_request_id') }}
@if (data_get($deployment, 'is_webhook'))
(Webhook)
@endif
</div>
@elseif (data_get($deployment, 'is_webhook'))
<div>Webhook (sha
@if (data_get($deployment, 'commit'))
{{ data_get($deployment, 'commit') }})
@else
HEAD)
@endif
</div>
@endif
<div class="flex flex-col" x-data="elapsedTime('{{ $deployment->deployment_uuid }}', '{{ $deployment->status }}', '{{ $deployment->created_at }}', '{{ $deployment->updated_at }}')">
<div>Finished <span x-text="measure_since_started()">0s</span> in <span class="font-bold"
x-text="measure_finished_time()">0s</span></div>
</div>
</div>
</a>
@endforeach
<script src="https://cdn.jsdelivr.net/npm/dayjs@1/dayjs.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/utc.js"></script>
<script src="https://cdn.jsdelivr.net/npm/dayjs@1/plugin/relativeTime.js"></script>
<script>
document.addEventListener('alpine:init', () => {
let timers = {};
dayjs.extend(window.dayjs_plugin_utc);
dayjs.extend(window.dayjs_plugin_relativeTime);
Alpine.data('elapsedTime', (uuid, status, created_at, updated_at) => ({
finished_time: '0s',
started_time: '0s',
init() {
if (timers[uuid]) {
clearInterval(timers[uuid]);
}
if (status === 'in_progress') {
timers[uuid] = setInterval(() => {
this.finished_time = dayjs().diff(dayjs.utc(created_at),
'second') + 's'
}, 1000);
} else {
let seconds = dayjs.utc(updated_at).diff(dayjs.utc(created_at), 'second')
this.finished_time = seconds + 's';
}
},
measure_finished_time() {
return this.finished_time;
},
measure_since_started() {
return dayjs.utc(created_at).fromNow();
}
}))
})
</script>
</div>

View File

@@ -1,8 +1,8 @@
<div>
<h2>Destination</h2>
<p>Server Name: {{ data_get($destination, 'server.name') }}</p>
@if (data_get($destination, 'server.description'))
<p>Description: {{ data_get($destination, 'server.description') }}</p>
@endif
<p>Docker Network: {{ $destination->network }}</p>
<h2 class="pb-0">Destination</h2>
<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>Destination: {{ $destination->network }}</p>
</div>
</div>

View File

@@ -1,12 +1,12 @@
<form wire:submit.prevent='submit' class="flex flex-col px-2 max-w-fit">
<form wire:submit.prevent='submit' class="flex flex-col max-w-fit">
<div class="flex gap-2">
<x-inputs.input placeholder="NODE_ENV" noDirty id="key" label="Name" required />
<x-inputs.input placeholder="production" noDirty id="value" label="Value" required />
<x-inputs.checkbox noDirty class="flex-col items-center" id="is_build_time" label="Build Variable?" />
<x-forms.input placeholder="NODE_ENV" noDirty id="key" label="Name" required />
<x-forms.input placeholder="production" noDirty id="value" label="Value" required />
<x-forms.checkbox noDirty class="flex-col items-center" id="is_build_time" label="Build Variable?" />
</div>
<div class="pt-2">
<x-inputs.button type="submit">
<x-forms.button type="submit">
Add
</x-inputs.button>
</x-forms.button>
</div>
</form>

View File

@@ -1,5 +1,10 @@
<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)
<livewire:project.application.environment-variable.show wire:key="environment-{{ $env->id }}"
:env="$env" />

View File

@@ -1,17 +1,17 @@
<div x-data="{ deleteEnvironment: false }">
<form wire:submit.prevent='submit' class="flex flex-col px-2 max-w-fit">
<form wire:submit.prevent='submit' class="flex flex-col max-w-fit">
<div class="flex gap-2">
<x-inputs.input label="Name" id="env.key" />
<x-inputs.input label="Value" id="env.value" />
<x-inputs.checkbox disabled class="flex-col items-center" id="env.is_build_time" label="Build Variable?" />
<x-forms.input label="Name" id="env.key" />
<x-forms.input label="Value" id="env.value" />
<x-forms.checkbox disabled class="flex-col items-center" id="env.is_build_time" label="Build Variable?" />
</div>
<div class="pt-2">
<x-inputs.button type="submit">
<x-forms.button type="submit">
Update
</x-inputs.button>
<x-inputs.button x-on:click.prevent="deleteEnvironment = true">
</x-forms.button>
<x-forms.button x-on:click.prevent="deleteEnvironment = true">
Delete
</x-inputs.button>
</x-forms.button>
</div>
</form>
<x-naked-modal show="deleteEnvironment" message="Are you sure you want to delete {{ $env->key }}?" />

View File

@@ -1,66 +1,91 @@
<div>
<form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex gap-2">
<h2>General</h2>
<x-inputs.button type="submit">
<h2 class="pb-0">General</h2>
<x-forms.button type="submit">
Save
</x-inputs.button>
</x-forms.button>
</div>
<div class="flex flex-col gap-2 pb-4">
<div class="flex flex-col gap-2 xl:flex-row">
<x-inputs.input class="w-full" id="application.name" label="Name" required />
<x-inputs.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" />
<div class="text-sm">General configuration for your application.</div>
<div class="flex flex-col gap-2 py-4">
<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='text-helper'>Example</span>- http://app.coolify.io, https://cloud.coolify.io/dashboard<br>- http://app.coolify.io/api/v3" />
</div>
<x-inputs.select id="application.build_pack" label="Build Pack" required>
@if ($wildcard_domain)
<div class="pb-6">
<div class="text-sm">Set Random Domain</div>
@if ($global_wildcard_domain)
<x-forms.button isHighlighted wire:click="generateGlobalRandomDomain">Global Wildcard
</x-forms.button>
@endif
@if ($project_wildcard_domain)
<x-forms.button isHighlighted wire:click="generateProjectRandomDomain">Project Wildcard
</x-forms.button>
@endif
</div>
@endif
<x-forms.select id="application.build_pack" label="Build Pack" required>
<option value="nixpacks">Nixpacks</option>
<option disabled value="docker">Docker</option>
<option disabled value="compose">Compose</option>
</x-inputs.select>
</x-forms.select>
<x-forms.checkbox instantSave id="is_static" label="Static website?" />
@if ($application->settings->is_static)
<x-inputs.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 disabled value="apache:alpine">apache:alpine</option>
</x-inputs.select>
</x-forms.select>
@endif
<h3>Build</h3>
<div class="flex flex-col gap-2 xl:flex-row">
<x-inputs.input placeholder="pnpm install" id="application.install_command" label="Install Command" />
<x-inputs.input placeholder="pnpm build" id="application.build_command" label="Build Command" />
<x-inputs.input placeholder="pnpm start" id="application.start_command" label="Start 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 start" id="application.start_command" label="Start Command" />
</div>
<div class="flex flex-col gap-2 xl:flex-row">
<x-inputs.input placeholder="/" id="application.base_directory" label="Base Directory"
<x-forms.input placeholder="/" id="application.base_directory" label="Base Directory"
helper="Directory to use as root. Useful for monorepos." />
@if ($application->settings->is_static)
<x-inputs.input placeholder="/dist" id="application.publish_directory" label="Publish Directory"
<x-forms.input placeholder="/dist" id="application.publish_directory" label="Publish Directory"
required />
@else
<x-inputs.input placeholder="/" id="application.publish_directory" label="Publish Directory" />
<x-forms.input placeholder="/" id="application.publish_directory" label="Publish Directory" />
@endif
</div>
<h3>Network</h3>
<div class="flex flex-col gap-2 xl:flex-row">
@if ($application->settings->is_static)
<x-inputs.input id="application.ports_exposes" label="Ports Exposes" readonly />
<x-forms.input id="application.ports_exposes" label="Ports Exposes" readonly />
@else
<x-inputs.input placeholder="3000,3001" id="application.ports_exposes" label="Ports Exposes"
required helper="A comma separated list of ports you would like to expose for the proxy." />
<x-forms.input placeholder="3000,3001" id="application.ports_exposes" label="Ports Exposes" required
helper="A comma separated list of ports you would like to expose for the proxy." />
@endif
<x-inputs.input placeholder="3000:3000" id="application.ports_mappings" label="Ports Mappings"
<x-forms.input placeholder="3000:3000" id="application.ports_mappings" label="Ports Mappings"
helper="A comma separated list of ports you would like to map to the host system. Useful when you do not want to use domains.<br><span class='inline-block font-bold text-warning'>Example</span>3000:3000,3002:3002" />
</div>
</div>
<h3>Advanced</h3>
<div class="flex flex-col">
<x-inputs.checkbox helper="More logs will be visible during a deployment." instantSave id="is_debug"
<x-forms.checkbox helper="More logs will be visible during a deployment." instantSave id="is_debug_enabled"
label="Debug" />
<x-inputs.checkbox instantSave id="is_static" label="Static website?" />
<x-inputs.checkbox helper="Git Webhooks won't deploy your application is you turn it off." instantSave
id="is_auto_deploy" label="Auto Deploy?" />
<x-inputs.checkbox helper="Preview deployments" instantSave id="is_previews" label="Previews?" />
<x-inputs.checkbox instantSave id="is_git_submodules_allowed" label="Git Submodules Allowed?" />
<x-inputs.checkbox instantSave id="is_git_lfs_allowed" label="Git LFS Allowed?" />
{{-- <x-inputs.checkbox disabled instantSave id="is_dual_cert" label="Dual Certs?" />
<x-inputs.checkbox disabled instantSave id="is_custom_ssl" label="Is Custom SSL?" />
<x-inputs.checkbox disabled instantSave id="is_http2" label="Is Http2?" /> --}}
<x-forms.checkbox
helper="Your application will be available only on https if your domain starts with https://..."
instantSave id="is_force_https_enabled" label="Force Https" />
<x-forms.checkbox helper="Automatically deploy new commits based on Git webhooks." instantSave
id="is_auto_deploy_enabled" label="Auto Deploy" />
<x-forms.checkbox
helper="Automatically deploy Preview Deployments for all opened PR's. Closed PRs deletes Preview Deployments."
instantSave id="is_preview_deployments_enabled" label="Auto Previews Deployments" />
<x-forms.checkbox instantSave id="is_git_submodules_enabled" label="Git Submodules"
helper="Allow Git Submodules during build process." />
<x-forms.checkbox instantSave id="is_git_lfs_enabled" 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_custom_ssl" label="Is Custom SSL?" />
<x-forms.checkbox disabled instantSave id="is_http2" label="Is Http2?" /> --}}
</div>
</form>
</div>

View File

@@ -1,6 +0,0 @@
<div>
<a @if ($status === 'in_progress' || $status === 'queued') wire:poll='polling' @endif href="{{ url()->current() }}/{{ $deployment_uuid }}">
{{ $created_at }}
{{ $deployment_uuid }}</a>
{{ $status }}
</div>

View File

@@ -1,4 +0,0 @@
<div
class="flex flex-col-reverse w-full overflow-y-auto border border-solid rounded border-coolgray-300 max-h-[32rem] p-4">
<pre @if ($isKeepAliveOn) wire:poll.750ms="polling" @endif>{{ \App\Actions\CoolifyTask\RunRemoteProcess::decodeOutput($activity) }}</pre>
</div>

View File

@@ -0,0 +1,13 @@
<form wire:submit.prevent='submit'>
<div class="flex gap-2">
<h2 class="pb-0">Previews Deployments</h2>
<x-forms.button type="submit">Save</x-forms.button>
<x-forms.button wire:click="resetToDefault">Reset to default</x-forms.button>
</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">
<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." />
<div class="text-sm">Domain Preview: {{ $preview_url_template }}</div>
</div>
</form>

View File

@@ -1,8 +1,67 @@
<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:click="load_prs">Load Opened Pull Requests
</x-forms.button>
@isset($rate_limit_remaining)
<div class="pt-1 text-sm">Requests remaning till rate limited by Git: {{ $rate_limit_remaining }}</div>
@endisset
@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)
<div class="flex flex-col gap-4 p-4 text-sm bg-coolgray-200 hover:bg-coolgray-300">
<div class="text-base font-bold text-white">PR #{{ data_get($pull_request, 'number') }} |
{{ data_get($pull_request, 'title') }}</div>
<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>
@endforeach
</div>
@endif
</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 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') }}
@if (data_get($preview, 'status') !== 'exited')
| <a target="_blank" href="{{ data_get($preview, 'fqdn') }}">Open Preview
<x-external-link />
</a>
@endif
|
<a target="_blank" href="{{ data_get($preview, 'pull_request_html_url') }}">Open PR on Git
<x-external-link />
</a>
</div>
<div class="flex items-center gap-2 pt-6">
<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') }})">Remove
Preview
</x-forms.button>
@endif
</div>
</div>
@endforeach
</div>
@endif
</div>

View File

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

View File

@@ -1,31 +1,38 @@
<div x-init="$wire.loadImages">
<div class="flex gap-2">
<h2>Rollback</h2>
<x-inputs.button isHighlighted wire:click='loadImages'>Refresh</x-inputs.button>
<h2 class="pb-0">Rollback</h2>
<x-forms.button isHighlighted wire:click='loadImages'>Reload Available Images</x-forms.button>
</div>
<div class="pb-4 text-sm">You can easily rollback to a previously built image quickly.</div>
<div wire:loading wire:target='loadImages'>
<x-loading />
</div>
<div wire:loading.remove wire:target='loadImages'>
<div class="flex flex-wrap">
@forelse ($images as $image)
<div class="w-1/2 p-2">
<div class="rounded-lg shadow-lg bg-coolgray-200">
<div class="w-2/4 p-2">
<div class="rounded shadow-lg bg-coolgray-200">
<div class="p-2">
<div class="text-sm">
@if (data_get($image, 'is_current'))
<span class="font-bold text-coollabs">LIVE</span>
<span class="font-bold text-warning">LIVE</span>
|
@endif
{{ data_get($image, 'tag') }}
SHA: {{ data_get($image, 'tag') }}
</div>
<div class="text-xs">{{ data_get($image, 'created_at') }}</div>
</div>
<div class="flex justify-end p-2">
<x-inputs.button wire:click="revertImage('{{ data_get($image, 'tag') }}')">
Revert
</x-inputs.button>
@if (data_get($image, 'is_current'))
<x-forms.button disabled tooltip="This image is currently running.">
Rollback
</x-forms.button>
@else
<x-forms.button isHighlighted
wire:click="rollbackImage('{{ data_get($image, 'tag') }}')">
Rollback
</x-forms.button>
@endif
</div>
</div>
</div>

View File

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

View File

@@ -0,0 +1,15 @@
<div wire:poll.5000ms='applicationStatusChanged'>
@if ($application->status === 'running')
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
<div class="flex items-center gap-2 text-sm" wire:loading.remove.delay.longer>
<span class="flex w-3 h-3 rounded-full bg-success"></span>
<span class="text-green-500">Running</span>
</div>
@else
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
<div class="flex items-center gap-2 text-sm" wire:loading.remove.delay.longer>
<span class="flex w-3 h-3 rounded-full bg-error"></span>
<span class="text-error">Stopped</span>
</div>
@endif
</div>

View File

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

View File

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

View File

@@ -1,17 +1,15 @@
<div x-data="{ deleteStorage: false }">
<form wire:submit.prevent='submit' class="flex flex-col px-2 max-w-fit">
<div class="flex gap-2">
<x-inputs.input id="storage.name" label="Name" required />
<x-inputs.input id="storage.host_path" label="Source Path" />
<x-inputs.input id="storage.mount_path" label="Destination Path" required />
</div>
<div class="pt-2">
<x-inputs.button type="submit">
<form wire:submit.prevent='submit' class="flex flex-col px-2">
<div class="flex items-end gap-2">
<x-forms.input id="storage.name" label="Name" required />
<x-forms.input id="storage.host_path" label="Source Path" />
<x-forms.input id="storage.mount_path" label="Destination Path" required />
<x-forms.button type="submit">
Update
</x-inputs.button>
<x-inputs.button x-on:click.prevent="deleteStorage = true">
</x-forms.button>
<x-forms.button x-on:click.prevent="deleteStorage = true">
Delete
</x-inputs.button>
</x-forms.button>
</div>
</form>
<x-naked-modal show="deleteStorage" message="Are you sure you want to delete {{ $storage->name }}?" />

View File

@@ -0,0 +1,12 @@
<div x-data="{ deleteEnvironment: false }">
<x-naked-modal show="deleteEnvironment" message='Are you sure you would like to delete this environment?' />
@if ($resource_count > 0)
<x-forms.button tooltip="First delete all resources." disabled>
Delete
</x-forms.button>
@else
<x-forms.button x-on:click.prevent="deleteEnvironment = true">
Delete
</x-forms.button>
@endif
</div>

View File

@@ -1,13 +1,12 @@
<div x-data="{ deleteProject: false }">
<x-naked-modal show="deleteProject" message='Are you sure you would like to delete this project?' />
@if ($resource_count > 0)
<x-inputs.button disabled="First delete all resources.">
<x-forms.button disabled="First delete all resources.">
Delete
</x-inputs.button>
</x-forms.button>
@else
<x-inputs.button x-on:click.prevent="deleteProject = true">
<x-forms.button x-on:click.prevent="deleteProject = true">
Delete
</x-inputs.button>
</x-forms.button>
@endif
</div>

View File

@@ -1 +1 @@
<x-inputs.button wire:click='createEmptyProject'>Empty Project</x-inputs.button>
<x-forms.button wire:click='createEmptyProject'>Empty Project</x-forms.button>

View File

@@ -3,11 +3,11 @@
<h1>Select a private key</h1>
@foreach ($private_keys as $key)
@if ($private_key_id == $key->id)
<x-inputs.button class="bg-blue-500" wire:click.defer="setPrivateKey('{{ $key->id }}')">
{{ $key->name }}</x-inputs.button>
<x-forms.button class="bg-blue-500" wire:click.defer="setPrivateKey('{{ $key->id }}')">
{{ $key->name }}</x-forms.button>
@else
<x-inputs.button wire:click.defer="setPrivateKey('{{ $key->id }}')">{{ $key->name }}
</x-inputs.button>
<x-forms.button wire:click.defer="setPrivateKey('{{ $key->id }}')">{{ $key->name }}
</x-forms.button>
@endif
@endforeach
</div>
@@ -15,17 +15,17 @@
<h1>Choose a repository</h1>
<form wire:submit.prevent='submit'>
<div class="flex items-end gap-2 pb-2">
<x-inputs.input class="w-96" id="repository_url" label="Repository URL" />
<x-forms.input class="w-96" id="repository_url" label="Repository URL" />
@if ($is_static)
<x-inputs.input id="publish_directory" label="Publish Directory" />
<x-forms.input id="publish_directory" label="Publish Directory" />
@else
<x-inputs.input type="number" id="port" label="Port" :readonly="$is_static" />
<x-forms.input type="number" id="port" label="Port" :readonly="$is_static" />
@endif
<x-inputs.input instantSave type="checkbox" id="is_static" label="Static Site?" />
<x-forms.input instantSave type="checkbox" id="is_static" label="Static Site?" />
</div>
<x-inputs.button type="submit">
<x-forms.button type="submit">
Submit
</x-inputs.button>
</x-forms.button>
</form>
@endisset
</div>

View File

@@ -2,9 +2,9 @@
@if ($github_apps->count() > 0)
<h1>Choose a GitHub App</h1>
@foreach ($github_apps as $ghapp)
<x-inputs.button wire:key="{{ $ghapp->id }}" wire:click="loadRepositories({{ $ghapp->id }})">
<x-forms.button wire:key="{{ $ghapp->id }}" wire:click="loadRepositories({{ $ghapp->id }})">
{{ $ghapp->name }}
</x-inputs.button>
</x-forms.button>
@endforeach
<div>
@if ($repositories->count() > 0)
@@ -18,7 +18,7 @@
@endif
@endforeach
</select>
<x-inputs.button wire:click="loadBranches">Select Repository</x-inputs.button>
<x-forms.button wire:click="loadBranches">Select Repository</x-forms.button>
@endif
</div>
<div>
@@ -35,7 +35,7 @@
@endif
@endforeach
</select>
<x-inputs.button wire:click="submit">Save</x-inputs.button>
<x-forms.button wire:click="submit">Save</x-forms.button>
@endif
</div>
@else

View File

@@ -1,20 +1,20 @@
<div>
<h1>Enter a public repository URL</h1>
<form class="flex flex-col gap-2" wire:submit.prevent='submit'>
<x-inputs.checkbox instantSave id="is_static" label="Is it a static site?" />
<x-forms.checkbox instantSave id="is_static" label="Is it a static site?" />
<div class="flex gap-2">
<x-inputs.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" />
<x-forms.input 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" />
@if ($is_static)
<x-inputs.input id="publish_directory" label="Publish Directory"
<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-inputs.input type="number" id="port" label="Port" :readonly="$is_static"
<x-forms.input type="number" id="port" label="Port" :readonly="$is_static"
helper="The port your application listens on." />
@endif
</div>
<x-inputs.button type="submit">
<x-forms.button type="submit">
Submit
</x-inputs.button>
</x-forms.button>
</form>
</div>

View File

@@ -1,7 +1,9 @@
<div>
<h1 class="pb-2">Command Center</h1>
<div class="pb-4 text-sm">Outputs are not saved at the moment, only available until you refresh or navigate.</div>
<form class="flex items-end justify-center gap-2" wire:submit.prevent='runCommand'>
<x-inputs.input placeholder="ls -l" autofocus noDirty noLabel id="command" label="Command" required />
<select wire:model.defer="server">
<x-forms.input placeholder="ls -l" autofocus noDirty id="command" label="Command" required />
<x-forms.select label="Server" id="server" required>
@foreach ($servers as $server)
@if ($loop->first)
<option selected value="{{ $server->uuid }}">{{ $server->name }}</option>
@@ -9,8 +11,8 @@
<option value="{{ $server->uuid }}">{{ $server->name }}</option>
@endif
@endforeach
</select>
<x-inputs.button class="btn-xl" type="submit">Run</x-inputs.button>
</x-forms.select>
<x-forms.button class="btn-xl" type="submit">Run</x-forms.button>
</form>
<div class="container w-full pt-10 mx-auto">
<livewire:activity-monitor />

View File

@@ -1,44 +1,54 @@
<div x-data="{ deleteServer: false }">
<h2>General</h2>
<x-naked-modal show="deleteServer" message='Are you sure you would like to delete this server?' />
<form wire:submit.prevent='submit' class="flex flex-col">
<div class="flex gap-2">
<h2>General</h2>
<x-forms.button type="submit">Save</x-forms.button>
@if ($server_id !== 0)
<x-forms.button x-on:click.prevent="deleteServer = true">
Delete
</x-forms.button>
@endif
</div>
<div class="flex flex-col gap-2 xl:flex-row">
<div class="flex flex-col w-96">
<x-inputs.input id="server.name" label="Name" required />
<x-inputs.input id="server.description" label="Description" />
<x-inputs.checkbox disabled type="checkbox" id="server.settings.is_part_of_swarm"
label="Is it part of a Swarm cluster?" />
</div>
<div class="flex flex-col w-96">
@if ($server->id === 0)
<x-inputs.input id="server.ip" label="IP Address" readonly />
<x-inputs.input id="server.user" label="User" readonly />
<x-inputs.input type="number" id="server.port" label="Port" readonly />
<x-forms.input id="server.name" label="Name" readonly required />
<x-forms.input id="server.description" label="Description" readonly />
@else
<x-inputs.input id="server.ip" label="IP Address" required readonly />
<x-inputs.input id="server.user" label="User" required />
<x-inputs.input type="number" id="server.port" label="Port" required />
<x-forms.input id="server.name" label="Name" required />
<x-forms.input id="server.description" label="Description" />
@endif
{{-- <x-forms.checkbox disabled type="checkbox" id="server.settings.is_part_of_swarm"
label="Is it part of a Swarm cluster?" /> --}}
</div>
<div class="flex flex-col">
@if ($server->id === 0)
<x-forms.input id="server.ip" label="IP Address" readonly required />
<x-forms.input id="server.user" label="User" readonly required />
<x-forms.input type="number" id="server.port" label="Port" readonly required />
@else
<x-forms.input id="server.ip" label="IP Address" readonly required />
<div class="flex gap-2">
<x-forms.input id="server.user" label="User" required />
<x-forms.input type="number" id="server.port" label="Port" required />
</div>
@endif
</div>
</div>
<h3>Quick Actions</h3>
<div class="flex items-center gap-2">
<x-inputs.button type="submit">Save</x-inputs.button>
<x-inputs.button wire:click.prevent='validateServer'>
<x-forms.button wire:click.prevent='validateServer'>
@if ($server->settings->is_validated)
Check Connection
@else
Validate Server
@endif
</x-inputs.button>
{{-- <x-inputs.button wire:click.prevent='installDocker'>Install Docker</x-inputs.button> --}}
<x-inputs.button x-on:click.prevent="deleteServer = true">
Delete
</x-inputs.button>
</x-forms.button>
{{-- <x-forms.button wire:click.prevent='installDocker'>Install Docker</x-forms.button> --}}
</div>
<div class="pt-3">
<div class="pt-3 text-sm">
@isset($uptime)
<p>Uptime: {{ $uptime }}</p>
@endisset
@@ -51,27 +61,25 @@
</div>
</form>
<div class="flex items-center gap-2 py-4">
<div class="font-bold">Private Key</div>
<a class="px-2"
href="{{ route('private-key.show', ['private_key_uuid' => data_get($server, 'privateKey.uuid')]) }}">
{{ data_get($server, 'privateKey.uuid') }}
</a>
<h3>Private Key</h3>
<a href="{{ route('server.private-key', ['server_uuid' => $server->uuid]) }}">
<x-inputs.button>Change</x-inputs.button>
<x-forms.button>Change</x-forms.button>
</a>
</div>
<a href="{{ route('private-key.show', ['private_key_uuid' => data_get($server, 'privateKey.uuid')]) }}">
<button class="text-white btn-link">{{ data_get($server, 'privateKey.name') }}</button>
</a>
<div class="flex items-center gap-2 py-4">
<div class="font-bold">Destinations</div>
<div>
@foreach ($server->standaloneDockers as $docker)
<a class="px-2"
href="{{ route('destination.show', ['destination_uuid' => data_get($docker, 'uuid')]) }}">
{{ data_get($docker, 'network') }}
</a>
@endforeach
</div>
<h3>Destinations</h3>
<a href="{{ route('destination.new', ['server_id' => $server->id]) }}">
<x-inputs.button>Add</x-inputs.button>
<x-forms.button>Add</x-forms.button>
</a>
</div>
<div>
@foreach ($server->standaloneDockers as $docker)
<a href="{{ route('destination.show', ['destination_uuid' => data_get($docker, 'uuid')]) }}">
<button class="text-white btn-link">{{ data_get($docker, 'network') }}</button>
</a>
@endforeach
</div>
</div>

View File

@@ -1,13 +1,19 @@
<div>
<form class="flex flex-col gap-1" wire:submit.prevent='submit'>
<h1>New Server</h1>
<x-inputs.input id="name" label="Name" required />
<x-inputs.input id="description" label="Description" />
<x-inputs.input id="ip" label="IP Address" required />
<x-inputs.input id="user" label="User" />
<x-inputs.input type="number" id="port" label="Port" />
<div class="flex items-center gap-2">
<h1>New Server</h1>
<x-forms.button type="submit">
Save
</x-forms.button>
</div>
<x-forms.input id="name" label="Name" required />
<x-forms.input id="description" label="Description" />
<x-forms.input id="ip" label="IP Address" required
helper="Could be IP Address (127.0.0.1) or Domain Name (duckduckgo.com)." />
<x-forms.input id="user" label="User" required />
<x-forms.input type="number" id="port" label="Port" required />
<label>Private Key</label>
<x-inputs.select wire:model.defer="private_key_id">
<x-forms.select wire:model.defer="private_key_id">
<option disabled>Select a private key</option>
@foreach ($private_keys as $key)
@if ($loop->first)
@@ -16,11 +22,8 @@
<option value="{{ $key->id }}">{{ $key->name }}</option>
@endif
@endforeach
</x-inputs.select>
<x-inputs.input instantSave noDirty type="checkbox" id="is_part_of_swarm"
label="Is it part of a Swarm cluster?" />
<x-inputs.button type="submit">
Save
</x-inputs.button>
</x-forms.select>
<x-forms.checkbox instantSave noDirty id="is_part_of_swarm" label="Is it part of a Swarm cluster?" />
</form>
</div>

View File

@@ -1,6 +1,9 @@
<div>
<div class="flex flex-wrap gap-2">
@forelse ($private_keys as $private_key)
<x-inputs.button wire:click='setPrivateKey({{ $private_key->id }})'>{{ $private_key->name }}</x-inputs.button>
<div class="w-64 box">
<button wire:click='setPrivateKey({{ $private_key->id }})'>{{ $private_key->name }}
</button>
</div>
@empty
<p>No private keys found</p>
@endforelse

View File

@@ -2,53 +2,61 @@
<x-naked-modal show="stopProxy" action="stopProxy"
message='Are you sure you would like to stop the proxy? All resources will be unavailable.' />
@if ($server->settings->is_validated)
<div class="flex items-center gap-2 mb-4">
<h2>Proxy</h2>
<div>{{ $server->extra_attributes->proxy_status }}</div>
<div class="flex items-center gap-2 mb-2">
<h2 class="pb-0">Proxy</h2>
@if ($server->extra_attributes->proxy_type)
<x-forms.button isHighlighted wire:click.prevent="installProxy">
Start/Reconfigure Proxy
</x-forms.button>
<x-forms.button x-on:click.prevent="stopProxy = true">Stop
</x-forms.button>
<div wire:poll.5000ms="proxyStatus">
@if (
$server->extra_attributes->last_applied_proxy_settings &&
$server->extra_attributes->last_saved_proxy_settings !== $server->extra_attributes->last_applied_proxy_settings)
<div class="text-red-500">Configuration out of sync.</div>
@endif
</div>
@endif
@if ($server->extra_attributes->proxy_status === 'running')
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
<div class="flex items-center gap-2 text-sm" wire:loading.remove.delay.longer>
<span class="flex w-3 h-3 rounded-full bg-success"></span>
<span class="text-green-500">Running</span>
</div>
@else
<span class="text-xs text-pink-600" wire:loading.delay.longer>Loading current status...</span>
<div class="flex items-center gap-2 text-sm" wire:loading.remove.delay.longer>
<span class="flex w-3 h-3 rounded-full bg-error"></span>
<span class="text-error">Stopped</span>
</div>
@endif
</div>
<livewire:activity-monitor />
@if ($server->extra_attributes->proxy_type)
<div wire:poll="proxyStatus">
@if (
$server->extra_attributes->last_applied_proxy_settings &&
$server->extra_attributes->last_saved_proxy_settings !== $server->extra_attributes->last_applied_proxy_settings)
<div class="text-red-500">Configuration out of sync.</div>
<x-inputs.button wire:click="installProxy">
Reconfigure
</x-inputs.button>
@endif
@if ($server->extra_attributes->proxy_status !== 'running')
<x-inputs.button wire:click="installProxy">
Start
</x-inputs.button>
@else
<x-inputs.button x-on:click.prevent="stopProxy = true">Stop
</x-inputs.button>
@endif
<div class="py-4">
<livewire:activity-monitor />
</div>
<div x-init="$wire.checkProxySettingsInSync">
<div wire:loading wire:target="checkProxySettingsInSync">
<x-loading />
</div>
@isset($proxy_settings)
<h3>Configuration</h3>
@if ($selectedProxy->value === 'TRAEFIK_V2')
<form wire:submit.prevent='saveConfiguration'>
<div class="py-2 pb-8">
<x-inputs.button type="submit">Save</x-inputs.button>
<x-inputs.button wire:click.prevent="resetProxy">
Reset Configuration
</x-inputs.button>
</div>
<h4>traefik.conf</h4>
<x-inputs.textarea noDirty name="proxy_settings" wire:model.defer="proxy_settings"
rows="30" />
</form>
@endif
@endisset
<div x-init="$wire.checkProxySettingsInSync">
<div wire:loading wire:target="checkProxySettingsInSync">
<x-loading />
</div>
@isset($proxy_settings)
@if ($selectedProxy->value === 'TRAEFIK_V2')
<form wire:submit.prevent='saveConfiguration'>
<div class="flex items-center gap-2">
<h3>Configuration</h3>
<x-forms.button type="submit">Save</x-forms.button>
<x-forms.button wire:click.prevent="resetProxy">
Reset Configuration
</x-forms.button>
</div>
<h4>traefik.conf</h4>
<x-forms.textarea class="text-xs" noDirty name="proxy_settings"
wire:model.defer="proxy_settings" rows="30" />
</form>
@endif
@endisset
</div>
@else
<select wire:model="selectedProxy">
@@ -56,10 +64,9 @@
{{ \App\Enums\ProxyTypes::TRAEFIK_V2 }}
</option>
</select>
<x-inputs.button wire:click="setProxy">Set Proxy</x-inputs.button>
<x-forms.button wire:click="setProxy">Set Proxy</x-forms.button>
@endif
@else
<p>Server is not validated. Validate first.</p>
@endif
</div>

View File

@@ -1,23 +1,36 @@
<div>
<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-inputs.input id="settings.fqdn" label="FQDN" />
<x-inputs.input id="settings.wildcard_domain" label="Wildcard Domain" />
<div class="flex gap-2">
<h1 class="pb-2">Settings</h1>
<x-forms.button type="submit">
Save
</x-forms.button>
</div>
<div class="pb-4 text-sm">Instance wide settings for Coolify.
</div>
<div class="flex flex-col gap-2">
<div class="flex gap-2">
<x-forms.input id="settings.fqdn" label="Coolify's Domain" />
<x-forms.input id="settings.wildcard_domain" label="Wildcard Domain"
helper="Wildcard domain for your applications. If you set this, you will get a random generated domain for your new applications.<br><span class='font-bold text-white'>Example</span>In case you set:<span class='text-helper'>https://example.com</span>your applications will get: <span class='text-helper'>https://randomId.example.com</span>" />
<x-forms.input id="settings.default_redirect_404" label="Default Redirect 404"
helper="All urls that has no service available will be redirected to this domain.<span class='text-helper'>You can set to your main marketing page or your social media link.</span>" />
</div>
<div class="flex flex-col w-96">
<x-inputs.input type="number" id="settings.public_port_min" label="Public Port Min" />
<x-inputs.input type="number" id="settings.public_port_max" label="Public Port Max" />
<div class="flex gap-2 ">
<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" />
</div>
</div>
<x-inputs.button class="w-16 mt-4" type="submit">
Submit
</x-inputs.button>
</form>
<div class="flex flex-col pt-4 text-right w-52">
<x-inputs.input instantSave type="checkbox" id="do_not_track" label="Do Not Track" />
<x-inputs.input instantSave type="checkbox" id="is_auto_update_enabled" label="Auto Update?" />
<x-inputs.input instantSave type="checkbox" id="is_registration_enabled" label="Registration Enabled?" />
<x-inputs.input instantSave type="checkbox" id="is_https_forced" label="Force https?" />
<h3>Advanced</h3>
<div class="flex flex-col text-right w-52">
<x-forms.checkbox instantSave id="is_auto_update_enabled" label="Auto Update Coolify" />
<x-forms.checkbox instantSave id="is_registration_enabled" label="Registration Allowed" />
{{-- <x-forms.checkbox instantSave id="is_https_forced" label="Force https?" /> --}}
<x-forms.checkbox instantSave id="do_not_track" label="Do Not Track" />
</div>
@if (auth()->user()->isPartOfRootTeam())
<livewire:force-upgrade />
@endif
</div>

View File

@@ -1,16 +0,0 @@
<div>
<form wire:submit.prevent='createGitHubApp'>
<x-inputs.button type="submit">
Submit
</x-inputs.button>
<h3 class="pt-4">General</h3>
<x-inputs.input id="name" label="Name" required />
<x-inputs.input helper="If empty, your user will be used." id="organization" label="Organization" />
<h3 class="pt-4">Advanced</h3>
<x-inputs.input id="html_url" label="HTML Url" required />
<x-inputs.input id="api_url" label="API Url" required />
<x-inputs.input id="custom_user" label="Custom Git User" required />
<x-inputs.input id="custom_port" label="Custom Git Port" required />
<x-inputs.checkbox class="pt-2" id="is_system_wide" label="System Wide" />
</form>
</div>

View File

@@ -5,12 +5,12 @@
<h1>GitHub App</h1>
<div class="flex gap-2 ">
@if ($github_app->app_id)
<x-inputs.button type="submit">Save</x-inputs.button>
<x-inputs.button x-on:click.prevent="deleteSource = true">
<x-forms.button type="submit">Save</x-forms.button>
<x-forms.button x-on:click.prevent="deleteSource = true">
Delete
</x-inputs.button>
</x-forms.button>
<a href="{{ $installation_url }}">
<x-inputs.button>
<x-forms.button>
@if ($github_app->installation_id)
Update Repositories
<x-external-link />
@@ -18,43 +18,54 @@
Install Repositories
<x-external-link />
@endif
</x-inputs.button>
</x-forms.button>
</a>
@else
<x-inputs.button disabled type="submit">Save</x-inputs.button>
<x-inputs.button x-on:click.prevent="deleteSource = true">
<x-forms.button disabled type="submit">Save</x-forms.button>
<x-forms.button x-on:click.prevent="deleteSource = true">
Delete
</x-inputs.button>
<form x-data>
<x-inputs.button isHighlighted x-on:click.prevent="createGithubApp">Create GitHub Application
</x-inputs.button>
</form>
</x-forms.button>
@endif
</div>
</div>
<x-inputs.input id="github_app.name" label="App Name" required />
@if (!$github_app->app_id)
<div class="pb-4">
<div class="text-sm">You need to register a GitHub App before using this source!</div>
<form>
<x-forms.button isHighlighted x-on:click.prevent="createGithubApp">Register a GitHub
Application
</x-forms.button>
</form>
</div>
@endif
<x-forms.input id="github_app.name" label="App Name" required />
@if ($github_app->app_id)
<x-inputs.input id="github_app.organization" label="Organization" disabled
<x-forms.input id="github_app.organization" label="Organization" disabled
placeholder="Personal user if empty" />
@else
<x-inputs.input id="github_app.organization" label="Organization" placeholder="Personal user if empty" />
<x-forms.input id="github_app.organization" label="Organization" placeholder="Personal user if empty" />
@endif
<x-forms.input id="github_app.html_url" label="HTML Url" disabled />
<x-forms.input id="github_app.api_url" label="API Url" disabled />
@if ($github_app->html_url === 'https://github.com')
<x-forms.input id="github_app.custom_user" label="User" disabled />
<x-forms.input type="number" id="github_app.custom_port" label="Port" disabled />
@else
<x-forms.input id="github_app.custom_user" label="User" required />
<x-forms.input type="number" id="github_app.custom_port" label="Port" required />
@endif
<x-inputs.input id="github_app.api_url" label="API Url" disabled />
<x-inputs.input id="github_app.html_url" label="HTML Url" disabled />
<x-inputs.input id="github_app.custom_user" label="User" required />
<x-inputs.input type="number" id="github_app.custom_port" label="Port" required />
@if ($github_app->app_id)
<x-inputs.input type="number" id="github_app.app_id" label="App Id" disabled />
<x-inputs.input type="number" id="github_app.installation_id" label="Installation Id" disabled />
<x-inputs.input id="github_app.client_id" label="Client Id" type="password" disabled />
<x-inputs.input id="github_app.client_secret" label="Client Secret" type="password" disabled />
<x-inputs.input id="github_app.webhook_secret" label="Webhook Secret" type="password" disabled />
<x-inputs.checkbox noDirty label="System Wide?" instantSave id="is_system_wide" />
<x-forms.input type="number" id="github_app.app_id" label="App Id" disabled />
<x-forms.input type="number" id="github_app.installation_id" label="Installation Id" disabled />
<x-forms.input id="github_app.client_id" label="Client Id" type="password" disabled />
<x-forms.input id="github_app.client_secret" label="Client Secret" type="password" disabled />
<x-forms.input id="github_app.webhook_secret" label="Webhook Secret" type="password" disabled />
<x-forms.checkbox noDirty label="System Wide?" instantSave id="is_system_wide" />
@else
<x-inputs.checkbox noDirty label="System Wide?" instantSave id="is_system_wide" />
<x-forms.checkbox noDirty label="System Wide?" instantSave id="is_system_wide" />
<div class="py-2">
</div>

View File

@@ -0,0 +1,18 @@
<div>
<form wire:submit.prevent='createGitHubApp'>
<div class="flex items-start gap-2 pt-6">
<h2 class="">General</h2>
<x-forms.button type="submit">
Save
</x-forms.button>
</div>
<x-forms.input id="name" label="Name" required />
<x-forms.input helper="If empty, your GitHub user will be used." id="organization" label="Organization" />
<h3 class="pt-4">Advanced</h3>
<x-forms.input id="html_url" label="HTML Url" required />
<x-forms.input id="api_url" label="API Url" required />
<x-forms.input id="custom_user" label="Custom Git User" required />
<x-forms.input id="custom_port" label="Custom Git Port" required />
<x-forms.checkbox class="pt-2" id="is_system_wide" label="System Wide" />
</form>
</div>

View File

@@ -1,10 +1,12 @@
<div class="pt-4">
<h3>Other Teams</h3>
<div class="flex flex-col gap-2">
@foreach (auth()->user()->otherTeams() as $team)
<x-inputs.button wire:key="{{ $team->id }}" wire:click="switch_to('{{ $team->id }}')">Switch
to:
{{ $team->name }}</x-inputs.button>
@endforeach
</div>
<h3>Switch Team</h3>
@if (auth()->user()->otherTeams()->count() > 0)
<div class="flex gap-2">
@foreach (auth()->user()->otherTeams() as $team)
<x-forms.button isHighlighted wire:key="{{ $team->id }}"
wire:click="switch_to('{{ $team->id }}')">
{{ $team->name }}</x-forms.button>
@endforeach
</div>
@endif
</div>

View File

@@ -0,0 +1,58 @@
<div x-data="{ visible: @entangle('visible') }" class="flex text-xs text-white">
<template x-if="visible">
<div class="bg-coollabs-gradient">
<svg xmlns="http://www.w3.org/2000/svg" class="w-10 h-10 mx-auto text-pink-500 lds-heart" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M19.5 13.572l-7.5 7.428l-7.5 -7.428m0 0a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" />
</svg> Upgrading, please wait...
<script>
function checkHealth() {
console.log('Checking server\'s health...')
checkHealthInterval = setInterval(async () => {
try {
const res = await fetch('/api/health');
if (res.ok) {
console.log('Server is back online. Reloading...')
if (checkHealthInterval) clearInterval(checkHealthInterval);
window.location.reload();
}
} catch (error) {
console.log('Waiting for server to come back from dead...');
}
return;
}, 2000);
}
function checkIfIamDead() {
console.log('Checking server\'s pulse...')
checkIfIamDeadInterval = setInterval(async () => {
try {
const res = await fetch('/api/health');
if (res.ok) {
console.log('I\'m alive. Waiting for server to be dead...');
}
} catch (error) {
console.log('I\'m dead. Charging... Standby... Bzz... Bzz...')
checkHealth();
if (checkIfIamDeadInterval) clearInterval(checkIfIamDeadInterval);
}
return;
}, 2000);
}
let checkHealthInterval = null;
let checkIfIamDeadInterval = null;
console.log('Update initiated. Waiting for server to be dead...')
checkIfIamDead();
</script>
</div>
<svg xmlns="http://www.w3.org/2000/svg" class="w-8 h-8 mx-auto lds-heart" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M19.5 12.572l-7.5 7.428l-7.5 -7.428a5 5 0 1 1 7.5 -6.566a5 5 0 1 1 7.5 6.572" />
<path d="M12 6l-2 4l4 3l-2 4v3" />
</svg>
</template>
</div>