lasthourcloud/resources/views/livewire/project/new/select.blade.php

318 lines
18 KiB
PHP
Raw Normal View History

2023-10-24 10:33:49 +00:00
<div x-data x-init="$wire.loadServers">
<div class="flex gap-4 ">
<h1>New Resource</h1>
<div class="w-96">
<x-forms.select wire:model="selectedEnvironment">
@foreach ($environments as $environment)
<option value="{{ $environment->name }}">Environment: {{ $environment->name }}</option>
@endforeach
</x-forms.select>
</div>
</div>
2023-08-07 17:25:32 +00:00
<div class="pb-4 ">Deploy resources, like Applications, Databases, Services...</div>
2024-03-22 11:47:19 +00:00
<div class="flex flex-col gap-4 pt-4">
@if ($current_step === 'type')
2023-08-11 20:41:47 +00:00
<h2>Applications</h2>
2024-03-22 11:47:19 +00:00
<h4>Git Based</h4>
<div class="grid justify-start grid-cols-1 gap-4 text-left xl:grid-cols-1">
<x-resource-view wire="setType('public')">
2024-02-20 14:07:12 +00:00
<x-slot:title>Public Repository</x-slot>
<x-slot:description>
You can deploy any kind of public repositories from the supported git providers.
</x-slot>
2024-02-20 14:42:30 +00:00
<x-slot:logo>
<img class="w-[4.5rem]
2024-02-21 13:30:32 +00:00
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
2024-02-20 14:42:30 +00:00
src="{{ asset('svgs/git.svg') }}">
</x-slot:logo>
2024-02-20 14:07:12 +00:00
</x-resource-view>
<x-resource-view wire="setType('private-gh-app')">
<x-slot:title>Private Repository (with GitHub App)</x-slot>
<x-slot:description>
You can deploy public & private repositories through your GitHub Apps.
</x-slot>
2024-02-20 14:42:30 +00:00
<x-slot:logo>
<img class="w-[4.5rem]
2024-02-21 13:30:32 +00:00
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
2024-02-20 14:42:30 +00:00
src="{{ asset('svgs/github.svg') }}">
</x-slot:logo>
2024-02-20 14:07:12 +00:00
</x-resource-view>
<x-resource-view wire="setType('private-deploy-key')">
<x-slot:title> Private Repository (with deploy key)</x-slot>
<x-slot:description>
You can deploy public & private repositories with a simple deploy key (SSH key).
</x-slot>
2024-02-20 14:42:30 +00:00
<x-slot:logo>
<img class="w-[4.5rem]
2024-02-21 13:30:32 +00:00
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
2024-02-20 14:42:30 +00:00
src="{{ asset('svgs/git.svg') }}">
</x-slot:logo>
2024-02-20 14:07:12 +00:00
</x-resource-view>
</div>
2024-03-22 11:47:19 +00:00
<h4>Docker Based</h4>
<div class="grid justify-start grid-cols-1 gap-4 text-left xl:grid-cols-3">
2024-02-20 14:07:12 +00:00
<x-resource-view wire="setType('dockerfile')">
2024-03-22 11:47:19 +00:00
<x-slot:title>Dockerfile</x-slot>
2024-02-20 14:07:12 +00:00
<x-slot:description>
You can deploy a simple Dockerfile, without Git.
</x-slot>
2024-02-20 14:42:30 +00:00
<x-slot:logo>
<img class="w-[4.5rem]
2024-02-21 13:30:32 +00:00
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
2024-02-20 14:42:30 +00:00
src="{{ asset('svgs/docker.svg') }}">
</x-slot:logo>
2024-02-20 14:07:12 +00:00
</x-resource-view>
<x-resource-view wire="setType('docker-compose-empty')">
2024-03-22 11:47:19 +00:00
<x-slot:title>Docker Compose</x-slot>
2024-02-20 14:07:12 +00:00
<x-slot:description>
You can deploy complex application easily with Docker Compose, without Git.
</x-slot>
2024-02-20 14:42:30 +00:00
<x-slot:logo>
<img class="w-[4.5rem]
2024-02-21 13:30:32 +00:00
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
2024-02-20 14:42:30 +00:00
src="{{ asset('svgs/docker.svg') }}">
</x-slot:logo>
2024-02-20 14:07:12 +00:00
</x-resource-view>
<x-resource-view wire="setType('docker-image')">
2024-03-22 11:47:19 +00:00
<x-slot:title>Existing Docker Image</x-slot>
2024-02-20 14:07:12 +00:00
<x-slot:description>
You can deploy an existing Docker Image from any Registry, without Git.
</x-slot>
2024-02-20 14:42:30 +00:00
<x-slot:logo>
<img class="w-[4.5rem]
2024-02-21 13:30:32 +00:00
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
2024-02-20 14:42:30 +00:00
src="{{ asset('svgs/docker.svg') }}">
</x-slot:logo>
2024-02-20 14:07:12 +00:00
</x-resource-view>
2023-08-11 20:41:47 +00:00
</div>
<h2 class="py-4">Databases</h2>
2024-03-22 11:47:19 +00:00
<div class="grid justify-start grid-cols-1 gap-4 text-left xl:grid-cols-2">
2024-02-20 14:07:12 +00:00
<x-resource-view wire="setType('postgresql')">
2024-03-22 11:47:19 +00:00
<x-slot:title>PostgreSQL</x-slot>
2024-02-20 14:07:12 +00:00
<x-slot:description>
2024-02-20 14:42:30 +00:00
PostgreSQL is an object-relational database known for its
2024-02-20 14:07:12 +00:00
robustness, advanced features, and strong standards compliance.
</x-slot>
2024-02-20 14:42:30 +00:00
<x-slot:logo>
<img class="w-[4.5rem]
2024-02-21 13:30:32 +00:00
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
2024-02-20 14:42:30 +00:00
src="{{ asset('svgs/postgres.svg') }}">
</x-slot:logo>
2024-02-20 14:07:12 +00:00
</x-resource-view>
<x-resource-view wire="setType('redis')">
2024-03-22 11:47:19 +00:00
<x-slot:title>Redis</x-slot>
2024-02-20 14:07:12 +00:00
<x-slot:description>
2024-02-20 14:42:30 +00:00
Redis is an open-source, in-memory data structure store, used as a database, cache, and message
broker.
2024-02-20 14:07:12 +00:00
</x-slot>
2024-02-20 14:42:30 +00:00
<x-slot:logo>
<img class="w-[4.5rem]
2024-02-21 13:30:32 +00:00
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
2024-02-20 14:42:30 +00:00
src="{{ asset('svgs/redis.svg') }}">
</x-slot:logo>
2024-02-20 14:07:12 +00:00
</x-resource-view>
<x-resource-view wire="setType('mongodb')">
2024-03-22 11:47:19 +00:00
<x-slot:title>MongoDB</x-slot>
2024-02-20 14:07:12 +00:00
<x-slot:description>
2024-02-20 14:42:30 +00:00
MongoDB is a source-available, NoSQL database that uses JSON-like documents with
optional schemas.
2024-02-20 14:07:12 +00:00
</x-slot>
2024-02-20 14:42:30 +00:00
<x-slot:logo>
<img class="w-[4.5rem]
2024-02-21 13:30:32 +00:00
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
2024-02-20 14:42:30 +00:00
src="{{ asset('svgs/mongodb.svg') }}">
</x-slot:logo>
2024-02-20 14:07:12 +00:00
</x-resource-view>
<x-resource-view wire="setType('mysql')">
2024-03-22 11:47:19 +00:00
<x-slot:title>MySQL</x-slot>
2024-02-20 14:07:12 +00:00
<x-slot:description>
2024-02-20 14:42:30 +00:00
MySQL is a relational database known for its speed, reliability, and
flexibility.
2024-02-20 14:07:12 +00:00
</x-slot>
2024-02-20 14:42:30 +00:00
<x-slot:logo>
<img class="w-[4.5rem]
2024-02-21 13:30:32 +00:00
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
2024-02-20 14:42:30 +00:00
src="{{ asset('svgs/mysql.svg') }}">
</x-slot:logo>
2024-02-20 14:07:12 +00:00
</x-resource-view>
<x-resource-view wire="setType('mariadb')">
2024-03-22 11:47:19 +00:00
<x-slot:title>Mariadb</x-slot>
2024-02-20 14:07:12 +00:00
<x-slot:description>
2024-02-20 14:42:30 +00:00
MariaDB is a relational database that serves as a drop-in
2024-02-20 14:07:12 +00:00
replacement for MySQL.
</x-slot>
2024-02-20 14:42:30 +00:00
<x-slot:logo>
<img class="w-[4.5rem]
2024-02-21 13:30:32 +00:00
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
2024-02-20 14:42:30 +00:00
src="{{ asset('svgs/mariadb.svg') }}">
</x-slot:logo>
2024-02-20 14:07:12 +00:00
</x-resource-view>
{{-- <div class="box group" wire="setType('existing-postgresql')">
2023-09-05 10:14:31 +00:00
<div class="flex flex-col mx-6">
2024-03-24 15:00:25 +00:00
<div class="group-hover:dark:text-white">
2023-09-05 10:14:31 +00:00
Backup Existing PostgreSQL
</div>
2024-03-24 15:00:25 +00:00
<div class="text-xs group-hover:dark:text-white">
2023-09-05 10:14:31 +00:00
Schedule a backup of an existing PostgreSQL database.
</div>
</div>
</div> --}}
2023-08-07 17:25:32 +00:00
</div>
<div class="flex items-center gap-4" wire:init='loadServices'>
2023-09-25 13:48:43 +00:00
<h2 class="py-4">Services</h2>
2024-02-20 14:07:12 +00:00
<x-forms.button wire:click="loadServices('force')">Reload List</x-forms.button>
2024-03-22 11:47:19 +00:00
<input class="input" autofocus wire:model.live.debounce.200ms="search" autofocus placeholder="Search...">
2023-09-25 13:48:43 +00:00
</div>
2024-03-22 11:47:19 +00:00
<div class="pb-4 text-xs">Trademarks Policy: The respective trademarks mentioned here are owned by the
respective
companies, and use of them does not imply any affiliation or endorsement.</div>
<div class="grid justify-start grid-cols-1 gap-4 text-left xl:grid-cols-2">
2023-09-25 13:48:43 +00:00
@if ($loadingServices)
<span class="loading loading-xs loading-spinner"></span>
@else
2023-10-24 10:33:49 +00:00
@forelse ($services as $serviceName => $service)
2024-02-22 10:53:25 +00:00
@if (data_get($service, 'minversion') && version_compare(config('version'), data_get($service, 'minversion'), '<'))
<x-resource-view wire="setType('one-click-service-{{ $serviceName }}')">
<x-slot:title> {{ Str::headline($serviceName) }}</x-slot>
<x-slot:description>
@if (data_get($service, 'slogan'))
{{ data_get($service, 'slogan') }}
@endif
2024-02-22 10:53:25 +00:00
</x-slot>
<x-slot:logo>
@if (data_get($service, 'logo'))
<img class="w-[4.5rem]
2024-02-22 10:53:25 +00:00
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
src="{{ asset(data_get($service, 'logo')) }}">
@endif
</x-slot:logo>
<x-slot:documentation>
{{ data_get($service, 'documentation') }}
</x-slot>
<x-slot:upgrade>
You need to upgrade Coolify to {{ data_get($service, 'minversion') }} to use this
service.
</x-slot>
</x-resource-view>
2024-02-22 10:53:25 +00:00
{{-- <button class="text-left cursor-not-allowed bg-coolgray-100 box-without-bg" disabled>
<div class="flex flex-col mx-6">
2023-10-20 07:29:09 +00:00
<div class="font-bold">
{{ Str::headline($serviceName) }}
</div>
2024-02-22 10:53:25 +00:00
You need to upgrade to {{ data_get($service, 'minversion') }} to use this service.
2023-09-25 13:48:43 +00:00
</div>
2024-02-22 10:53:25 +00:00
</button> --}}
@else
2024-02-20 14:07:12 +00:00
<x-resource-view wire="setType('one-click-service-{{ $serviceName }}')">
<x-slot:title> {{ Str::headline($serviceName) }}</x-slot>
<x-slot:description>
@if (data_get($service, 'slogan'))
{{ data_get($service, 'slogan') }}
@endif
</x-slot>
<x-slot:logo>
@if (file_exists(public_path(data_get($service, 'logo'))))
2024-02-20 14:07:12 +00:00
<img class="w-[4.5rem]
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
2024-02-20 14:07:12 +00:00
src="{{ asset(data_get($service, 'logo')) }}">
@else
<img class="w-[4.5rem]
aspect-square h-[4.5rem] p-2 transition-all duration-200 opacity-30 grayscale group-hover:grayscale-0 group-hover:opacity-100"
src="{{ asset('svgs/unknown.svg') }}">
2024-02-20 14:07:12 +00:00
@endif
</x-slot:logo>
<x-slot:documentation>
{{ data_get($service, 'documentation') }}
</x-slot>
</x-resource-view>
{{-- <button class="text-left box group" wire:loading.attr="disabled"
wire:click="setType('one-click-service-{{ $serviceName }}')">
2023-10-20 07:29:09 +00:00
<div class="flex flex-col mx-2">
2024-03-24 15:00:25 +00:00
<div class="font-bold dark:text-white group-hover:dark:text-white">
{{ Str::headline($serviceName) }}
2023-09-27 19:51:06 +00:00
</div>
@if (data_get($service, 'slogan'))
2023-10-20 07:29:09 +00:00
<div class="description">
{{ data_get($service, 'slogan') }}
</div>
@endif
</div>
2024-02-20 14:07:12 +00:00
</button> --}}
@endif
2023-12-07 18:06:32 +00:00
@empty
2024-02-20 14:07:12 +00:00
<div class="w-96">No service found. Please try to reload the list!</div>
2023-10-24 10:33:49 +00:00
@endforelse
2023-09-25 13:48:43 +00:00
@endif
2023-09-11 11:52:54 +00:00
</div>
2024-03-22 11:47:19 +00:00
@endif
@if ($current_step === 'servers')
2024-03-22 10:34:15 +00:00
<h2>Select a server</h2>
<div class="pb-5"></div>
<div class="flex flex-col justify-center gap-4 text-left xl:flex-row xl:flex-wrap">
2023-08-21 08:18:11 +00:00
@forelse($servers as $server)
<div class="w-64 box group" wire:click="setServer({{ $server }})">
<div class="flex flex-col mx-6">
2024-03-24 15:00:25 +00:00
<div class="font-bold group-hover:dark:text-white">
{{ $server->name }}
</div>
2024-03-24 15:00:25 +00:00
<div class="text-xs group-hover:dark:text-white">
{{ $server->description }}</div>
</div>
</div>
2023-08-21 08:18:11 +00:00
@empty
<div>
2024-03-24 15:00:25 +00:00
<div>No validated & reachable servers found. <a class="dark:text-white underline" href="/servers">
2023-09-05 10:14:31 +00:00
Go to servers page
</a></div>
2023-08-21 08:18:11 +00:00
</div>
@endforelse
</div>
2024-03-12 18:09:08 +00:00
{{-- @if ($isDatabase)
2024-01-12 14:41:46 +00:00
<div class="text-center">Swarm clusters are excluded from this type of resource at the moment. It will
be activated soon. Stay tuned.</div>
2024-03-12 18:09:08 +00:00
@endif --}}
@endif
@if ($current_step === 'destinations')
2024-03-22 10:34:15 +00:00
<h2>Select a destination</h2>
<div>Destinations are used to segregate resources by network. If you are unsure, select the default
Standalone Docker (coolify).</div>
<div class="flex flex-col justify-center gap-4 text-left xl:flex-row xl:flex-wrap">
2023-12-15 14:48:01 +00:00
@if ($server->isSwarm())
@foreach ($swarmDockers as $swarmDocker)
<div class="box group" wire:click="setDestination('{{ $swarmDocker->uuid }}')">
<div class="flex flex-col mx-6">
2024-03-24 15:00:25 +00:00
<div class="font-bold group-hover:dark:text-white">
2023-12-15 14:48:01 +00:00
Swarm Docker <span class="text-xs">({{ $swarmDocker->name }})</span>
</div>
</div>
</div>
2023-12-15 14:48:01 +00:00
@endforeach
@else
@foreach ($standaloneDockers as $standaloneDocker)
<div class="box group" wire:click="setDestination('{{ $standaloneDocker->uuid }}')">
<div class="flex flex-col mx-6">
2024-03-24 15:00:25 +00:00
<div class="font-bold group-hover:dark:text-white">
2023-12-15 14:48:01 +00:00
Standalone Docker <span class="text-xs">({{ $standaloneDocker->name }})</span>
</div>
2024-03-24 15:00:25 +00:00
<div class="text-xs group-hover:dark:text-white">
Network: {{ $standaloneDocker->network }}</div>
2023-09-05 10:14:31 +00:00
</div>
2023-08-30 09:26:46 +00:00
</div>
2023-12-15 14:48:01 +00:00
@endforeach
@endif
</div>
@endif
2023-09-05 10:14:31 +00:00
@if ($current_step === 'existing-postgresql')
<form wire:submit='addExistingPostgresql' class="flex items-end gap-4">
2023-09-11 11:52:54 +00:00
<x-forms.input placeholder="postgres://username:password@database:5432" label="Database URL"
id="existingPostgresqlUrl" />
<x-forms.button type="submit">Add Database</x-forms.button>
</form>
2023-09-05 10:14:31 +00:00
@endif
</div>
</div>