feat: init postgresql database
This commit is contained in:
41
resources/views/components/databases/navbar.blade.php
Normal file
41
resources/views/components/databases/navbar.blade.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<div class="navbar-main">
|
||||
<a class="{{ request()->routeIs('project.database.configuration') ? 'text-white' : '' }}"
|
||||
href="{{ route('project.database.configuration', $parameters) }}">
|
||||
<button>Configuration</button>
|
||||
</a>
|
||||
{{-- <x-applications.links :application="$application" /> --}}
|
||||
<div class="flex-1"></div>
|
||||
{{-- <x-applications.advanced :application="$application" /> --}}
|
||||
|
||||
@if ($database->status === 'running')
|
||||
<button wire:click='start' class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-warning" viewBox="0 0 24 24" stroke-width="2"
|
||||
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||
<path
|
||||
d="M10.09 4.01l.496 -.495a2 2 0 0 1 2.828 0l7.071 7.07a2 2 0 0 1 0 2.83l-7.07 7.07a2 2 0 0 1 -2.83 0l-7.07 -7.07a2 2 0 0 1 0 -2.83l3.535 -3.535h-3.988">
|
||||
</path>
|
||||
<path d="M7.05 11.038v-3.988"></path>
|
||||
</svg>
|
||||
Restart
|
||||
</button>
|
||||
<button wire:click='stop' class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24" stroke-width="2"
|
||||
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"></path>
|
||||
<path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"></path>
|
||||
</svg>
|
||||
Stop
|
||||
</button>
|
||||
@else
|
||||
<button wire:click='start' onclick="logs.showModal()"
|
||||
class="flex items-center gap-2 cursor-pointer hover:text-white text-neutral-400">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-warning" 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="M7 4v16l13 -8z" />
|
||||
</svg>Start
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
@@ -10,7 +10,9 @@
|
||||
</svg>
|
||||
</div>
|
||||
<div class="flex flex-col w-full gap-2">
|
||||
<h3 class="text-lg font-bold">{{ $modalTitle }}</h3>
|
||||
@isset($modalTitle)
|
||||
<h3 class="text-lg font-bold">{{ $modalTitle }}</h3>
|
||||
@endisset
|
||||
@isset($modalBody)
|
||||
{{ $modalBody }}
|
||||
@endisset
|
||||
@@ -31,8 +33,11 @@
|
||||
</div>
|
||||
</form>
|
||||
@else
|
||||
<form method="dialog" class="flex flex-col gap-2 rounded modal-box" wire:submit.prevent='submit'>
|
||||
<h3 class="text-lg font-bold">{{ $modalTitle }}</h3>
|
||||
<form method="dialog" class="flex flex-col w-11/12 max-w-5xl gap-2 rounded modal-box"
|
||||
wire:submit.prevent='submit'>
|
||||
@isset($modalTitle)
|
||||
<h3 class="text-lg font-bold">{{ $modalTitle }}</h3>
|
||||
@endisset
|
||||
@isset($modalBody)
|
||||
{{ $modalBody }}
|
||||
@endisset
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<li class="inline-flex items-center">
|
||||
<a class="text-xs truncate lg:text-sm"
|
||||
href="{{ route('project.show', ['project_uuid' => $this->parameters['project_uuid']]) }}">
|
||||
{{ $application->environment->project->name }}</a>
|
||||
{{ $resource->environment->project->name }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<div class="flex items-center">
|
||||
@@ -25,7 +25,7 @@
|
||||
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
|
||||
clip-rule="evenodd"></path>
|
||||
</svg>
|
||||
<span class="text-xs truncate lg:text-sm">{{ data_get($application, 'name') }}</span>
|
||||
<span class="text-xs truncate lg:text-sm">{{ data_get($resource, 'name') }}</span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
@@ -38,9 +38,9 @@
|
||||
</svg>
|
||||
</div>
|
||||
</li>
|
||||
@if ($application->status === 'running')
|
||||
@if ($resource->status === 'running')
|
||||
<x-status.running />
|
||||
@elseif($application->status === 'restarting')
|
||||
@elseif($resource->status === 'restarting')
|
||||
<x-status.restarting />
|
||||
@else
|
||||
<x-status.stopped />
|
||||
@@ -23,6 +23,6 @@
|
||||
</div>
|
||||
</div>
|
||||
@if (isDev())
|
||||
<livewire:s3-test />
|
||||
<livewire:dev.s3-test />
|
||||
@endif
|
||||
</x-layout>
|
||||
|
||||
@@ -10,21 +10,22 @@
|
||||
<div class="flex flex-col gap-2 py-4">
|
||||
<div class="flex flex-col items-end gap-2 xl:flex-row">
|
||||
<x-forms.input id="application.name" label="Name" required />
|
||||
<x-forms.input placeholder="https://coolify.io" 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" />
|
||||
@if ($wildcard_domain)
|
||||
<div class="flex flex-row gap-2">
|
||||
@if ($global_wildcard_domain)
|
||||
<x-forms.button wire:click="generateGlobalRandomDomain">Set Global Wildcard
|
||||
</x-forms.button>
|
||||
@endif
|
||||
@if ($server_wildcard_domain)
|
||||
<x-forms.button wire:click="generateServerRandomDomain">Set Server Wildcard
|
||||
</x-forms.button>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
<x-forms.input id="application.description" label="Description" />
|
||||
</div>
|
||||
<x-forms.input placeholder="https://coolify.io" 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" />
|
||||
@if ($wildcard_domain)
|
||||
<div class="flex flex-row gap-2">
|
||||
@if ($global_wildcard_domain)
|
||||
<x-forms.button wire:click="generateGlobalRandomDomain">Set Global Wildcard
|
||||
</x-forms.button>
|
||||
@endif
|
||||
@if ($server_wildcard_domain)
|
||||
<x-forms.button wire:click="generateServerRandomDomain">Set Server 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>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<nav x-init="$wire.check_status" wire:poll.10000ms="check_status">
|
||||
<x-applications.breadcrumbs :application="$application" :parameters="$parameters" />
|
||||
<x-resources.breadcrumbs :resource="$application" :parameters="$parameters" />
|
||||
<x-applications.navbar :application="$application" :parameters="$parameters" />
|
||||
</nav>
|
||||
@@ -0,0 +1,4 @@
|
||||
<nav>
|
||||
<x-resources.breadcrumbs :resource="$database" :parameters="$parameters" />
|
||||
<x-databases.navbar :database="$database" :parameters="$parameters" />
|
||||
</nav>
|
||||
@@ -0,0 +1,18 @@
|
||||
<div>
|
||||
<form wire:submit.prevent="submit">
|
||||
<div class="flex items-center gap-2">
|
||||
<h2>General</h2>
|
||||
<x-forms.button type="submit">
|
||||
Save
|
||||
</x-forms.button>
|
||||
</div>
|
||||
<x-forms.input label="Name" id="database.name" />
|
||||
<x-forms.input label="Description" id="database.description" />
|
||||
<x-forms.input label="Username" id="database.postgres_username" placeholder="If empty, use postgres." />
|
||||
<x-forms.input label="Password" id="database.postgres_password" type="password" />
|
||||
<x-forms.input label="Database" id="database.postgres_db" placeholder="If empty, use $USERNAME." />
|
||||
<x-forms.input label="Init Args" id="database.postgres_initdb_args" placeholder="If empty, use default." />
|
||||
<x-forms.input label="Host Auth Method" id="database.postgres_host_auth_method"
|
||||
placeholder="If empty, use default." />
|
||||
</form>
|
||||
</div>
|
||||
@@ -1,6 +1,6 @@
|
||||
<x-layout>
|
||||
<h1>Configuration</h1>
|
||||
<livewire:application.heading :application="$application" />
|
||||
<livewire:project.application.heading :application="$application" />
|
||||
<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'general' }" class="flex h-full pt-6">
|
||||
<div class="flex flex-col gap-4 min-w-fit">
|
||||
<a :class="activeTab === 'general' && 'text-white'"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<x-layout>
|
||||
<h1 class="py-0">Deployment</h1>
|
||||
<livewire:application.heading :application="$application" />
|
||||
<livewire:project.application.heading :application="$application" />
|
||||
<livewire:project.application.deployment-logs :application_deployment_queue="$application_deployment_queue" />
|
||||
</x-layout>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<x-layout>
|
||||
<h1>Deployments</h1>
|
||||
<livewire:application.heading :application="$application" />
|
||||
<livewire:project.application.heading :application="$application" />
|
||||
<livewire:project.application.deployments :application="$application" :deployments="$deployments" :deployments_count="$deployments_count" />
|
||||
</x-layout>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<x-layout>
|
||||
<h1>Database</h1>
|
||||
|
||||
|
||||
</x-layout>
|
||||
65
resources/views/project/database/configuration.blade.php
Normal file
65
resources/views/project/database/configuration.blade.php
Normal file
@@ -0,0 +1,65 @@
|
||||
<x-layout>
|
||||
<h1>Configuration</h1>
|
||||
<livewire:project.database.heading :database="$database" />
|
||||
<x-modal modalId="logs">
|
||||
<x-slot:modalBody>
|
||||
<livewire:activity-monitor :header="true" />
|
||||
</x-slot:modalBody>
|
||||
<x-slot:modalSubmit>
|
||||
<x-forms.button onclick="logs.close()" type="submit">
|
||||
Close
|
||||
</x-forms.button>
|
||||
</x-slot:modalSubmit>
|
||||
</x-modal>
|
||||
<div x-data="{ activeTab: window.location.hash ? window.location.hash.substring(1) : 'general' }" class="flex h-full pt-6">
|
||||
<div class="flex flex-col gap-4 min-w-fit">
|
||||
<a :class="activeTab === 'general' && 'text-white'"
|
||||
@click.prevent="activeTab = 'general'; window.location.hash = 'general'" href="#">General</a>
|
||||
<a :class="activeTab === 'environment-variables' && 'text-white'"
|
||||
@click.prevent="activeTab = 'environment-variables'; window.location.hash = 'environment-variables'"
|
||||
href="#">Environment
|
||||
Variables</a>
|
||||
<a :class="activeTab === 'source' && 'text-white'"
|
||||
@click.prevent="activeTab = 'source'; window.location.hash = 'source'" href="#">Source</a>
|
||||
<a :class="activeTab === 'destination' && 'text-white'"
|
||||
@click.prevent="activeTab = 'destination'; window.location.hash = 'destination'"
|
||||
href="#">Destination
|
||||
</a>
|
||||
<a :class="activeTab === 'storages' && 'text-white'"
|
||||
@click.prevent="activeTab = 'storages'; window.location.hash = 'storages'" href="#">Storages
|
||||
</a>
|
||||
<a :class="activeTab === 'resource-limits' && 'text-white'"
|
||||
@click.prevent="activeTab = 'resource-limits'; window.location.hash = 'resource-limits'"
|
||||
href="#">Resource Limits
|
||||
</a>
|
||||
<a :class="activeTab === 'danger' && 'text-white'"
|
||||
@click.prevent="activeTab = 'danger'; window.location.hash = 'danger'" href="#">Danger Zone
|
||||
</a>
|
||||
</div>
|
||||
<div class="w-full pl-8">
|
||||
<div x-cloak x-show="activeTab === 'general'" class="h-full">
|
||||
@if ($database->getMorphClass() === 'App\Models\Postgresql')
|
||||
<livewire:project.database.postgresql.general :database="$database" />
|
||||
@endif
|
||||
</div>
|
||||
<div x-cloak x-show="activeTab === 'environment-variables'">
|
||||
{{-- <livewire:project.application.environment-variable.all :application="$application" /> --}}
|
||||
</div>
|
||||
<div x-cloak x-show="activeTab === 'source'">
|
||||
{{-- <livewire:project.application.source :application="$application" /> --}}
|
||||
</div>
|
||||
<div x-cloak x-show="activeTab === 'destination'">
|
||||
{{-- <livewire:project.application.destination :destination="$application->destination" /> --}}
|
||||
</div>
|
||||
<div x-cloak x-show="activeTab === 'storages'">
|
||||
{{-- <livewire:project.application.storages.all :application="$application" /> --}}
|
||||
</div>
|
||||
<div x-cloak x-show="activeTab === 'resource-limits'">
|
||||
{{-- <livewire:project.application.resource-limits :application="$application" /> --}}
|
||||
</div>
|
||||
<div x-cloak x-show="activeTab === 'danger'">
|
||||
{{-- <livewire:project.application.danger :application="$application" /> --}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-layout>
|
||||
@@ -5,7 +5,7 @@
|
||||
<a href="{{ route('project.resources.new', ['project_uuid' => request()->route('project_uuid'), 'environment_name' => request()->route('environment_name')]) }} "
|
||||
class="font-normal text-white normal-case border-none rounded hover:no-underline btn btn-primary btn-sm no-animation">+
|
||||
Add</a>
|
||||
@if ($environment->applications->count() === 0)
|
||||
@if ($environment->can_delete_environment())
|
||||
<livewire:project.delete-environment :environment_id="$environment->id" />
|
||||
@endif
|
||||
</div>
|
||||
@@ -31,14 +31,26 @@
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
@if ($environment->applications->count() === 0)
|
||||
@if ($environment->can_delete_environment())
|
||||
<p>No resources found.</p>
|
||||
@endif
|
||||
<div class="grid gap-2 lg:grid-cols-2">
|
||||
@foreach ($environment->applications->sortBy('name') as $application)
|
||||
<a class="box"
|
||||
href="{{ route('project.application.configuration', [$project->uuid, $environment->name, $application->uuid]) }}">
|
||||
{{ $application->name }}
|
||||
<div class="flex flex-col">
|
||||
<div>{{ $application->name }}</div>
|
||||
<div class="text-xs text-gray-400">{{ $application->description }}</div>
|
||||
</div>
|
||||
</a>
|
||||
@endforeach
|
||||
@foreach ($environment->databases->sortBy('name') as $databases)
|
||||
<a class="box"
|
||||
href="{{ route('project.database.configuration', [$project->uuid, $environment->name, $databases->uuid]) }}">
|
||||
<div class="flex flex-col">
|
||||
<div>{{ $databases->name }}</div>
|
||||
<div class="text-xs text-gray-400">{{ $databases->description }}</div>
|
||||
</div>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user