ui: new modal component

This commit is contained in:
Andras Bacsai
2024-01-31 14:18:59 +01:00
parent f1a9e28d5a
commit 8ff7aeb78b
10 changed files with 75 additions and 25 deletions

View File

@@ -1,8 +1,3 @@
<div>
<x-modal yesOrNo modalId="deleteEnvironment" modalTitle="Delete Environment">
<x-slot:modalBody>
<p>This environment will be deleted. It is not reversible. <br>Please think again.</p>
</x-slot:modalBody>
</x-modal>
<x-forms.button isError isModal modalId="deleteEnvironment"> Delete Environment</x-forms.button>
</div>
<x-new-modal isErrorButton buttonTitle="Delete Environment" disabled="{{ $disabled }}">
This environment will be deleted. It is not reversible. <br>Please think again.
</x-new-modal>

View File

@@ -1,10 +1,3 @@
<div>
<x-modal yesOrNo modalId="deleteProject" modalTitle="Delete Project">
<x-slot:modalBody>
<p>This project will be deleted. It is not reversible. <br>Please think again.</p>
</x-slot:modalBody>
</x-modal>
<x-forms.button isError isModal modalId="deleteProject">
Delete Project
</x-forms.button>
</div>
<x-new-modal isErrorButton buttonTitle="Delete Project" disabled="{{ $disabled }}">
This project will be deleted. It is not reversible. <br>Please think again.
</x-new-modal>

View File

@@ -5,6 +5,7 @@
<div class="flex items-end gap-2">
<h2>General</h2>
<x-forms.button type="submit">Save</x-forms.button>
<livewire:project.delete-project :disabled="$project->resource_count() > 0" :project_id="$project->id" />
</div>
<div class="flex gap-2">
<x-forms.input label="Name" id="project.name" />
@@ -23,7 +24,8 @@
Add</button>
</x-slide-over>
</div>
<div class="flex items-center gap-2 pb-4">You can use these variables anywhere with <span class="text-warning">@{{project.VARIABLENAME}}</span><x-helper
<div class="flex items-center gap-2 pb-4">You can use these variables anywhere with <span
class="text-warning">@{{ project.VARIABLENAME }}</span><x-helper
helper="More info <a class='text-white underline' href='https://coolify.io/docs/environment-variables#shared-variables' target='_blank'>here</a>."></x-helper>
</div>
<div class="flex flex-col gap-2">

View File

@@ -3,6 +3,7 @@
<div class="flex items-end gap-2">
<h1>Environment: {{ data_get($environment, 'name') }}</h1>
<x-forms.button type="submit">Save</x-forms.button>
<livewire:project.delete-environment :disabled="!$environment->isEmpty()" :environment_id="$environment->id" />
</div>
<nav class="flex pt-2 pb-10">
<ol class="flex items-center">

View File

@@ -7,7 +7,6 @@
href="{{ route('project.clone-me', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => request()->route('environment_name')]) }}">
Clone
</a>
<livewire:project.delete-environment :environment_id="$environment->id" />
@else
<a href="{{ route('project.resource.create', ['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">+
@@ -17,6 +16,7 @@
Clone
</a>
@endif
<livewire:project.delete-environment :disabled="!$environment->isEmpty()" :environment_id="$environment->id" />
</div>
<nav class="flex pt-2 pb-10">
<ol class="flex items-center">

View File

@@ -3,9 +3,7 @@
<h1>Environments</h1>
<x-forms.button class="btn" onclick="newEnvironment.showModal()">+ Add</x-forms.button>
<livewire:project.add-environment :project="$project" />
@if ($project->applications->count() === 0)
<livewire:project.delete-project :project_id="$project->id" />
@endif
<livewire:project.delete-project :disabled="$project->resource_count() > 0" :project_id="$project->id" />
</div>
<div class="text-xs truncate subtitle lg:text-sm">{{ $project->name }}</div>
<div class="grid gap-2 lg:grid-cols-2">