feat: init postgresql database

This commit is contained in:
Andras Bacsai
2023-08-07 18:46:40 +02:00
parent 0a040a0531
commit a020bc872d
38 changed files with 430 additions and 66 deletions

View File

@@ -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'"

View File

@@ -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>

View File

@@ -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>

View File

@@ -1,5 +0,0 @@
<x-layout>
<h1>Database</h1>
</x-layout>

View 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>

View File

@@ -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>