mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-05 16:02:34 +00:00
Migrate to HTMX (#114)
Dropped Livewire Added HTMX Added Blade code lint Drop Mysql and Redis Migrate to SQLite
This commit is contained in:
5
resources/views/ssls/index.blade.php
Normal file
5
resources/views/ssls/index.blade.php
Normal file
@ -0,0 +1,5 @@
|
||||
<x-site-layout :site="$site">
|
||||
<x-slot name="pageTitle">{{ __("SSL") }}</x-slot>
|
||||
|
||||
@include("ssls.partials.ssls-list")
|
||||
</x-site-layout>
|
78
resources/views/ssls/partials/create-ssl.blade.php
Normal file
78
resources/views/ssls/partials/create-ssl.blade.php
Normal file
@ -0,0 +1,78 @@
|
||||
<div x-data="{ type: '{{ old("type") }}' }">
|
||||
<x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'create-ssl')">
|
||||
{{ __("Create SSL") }}
|
||||
</x-primary-button>
|
||||
|
||||
<x-modal name="create-ssl">
|
||||
<form
|
||||
id="create-ssl-form"
|
||||
hx-post="{{ route("servers.sites.ssl.store", ["server" => $server, "site" => $site]) }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-select="#create-ssl-form"
|
||||
class="p-6"
|
||||
>
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __("Create SSL") }}
|
||||
</h2>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="type" :value="__('SSL Type')" />
|
||||
<x-select-input x-model="type" id="type" name="type" class="mt-1 w-full">
|
||||
<option value="" selected disabled>
|
||||
{{ __("Select") }}
|
||||
</option>
|
||||
@foreach (\App\Enums\SslType::getValues() as $t)
|
||||
<option value="{{ $t }}" @if($t == old('type')) selected @endif>
|
||||
{{ $t }}
|
||||
</option>
|
||||
@endforeach
|
||||
</x-select-input>
|
||||
@error("type")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div x-show="type === 'custom'">
|
||||
<div class="mt-6">
|
||||
<x-input-label for="certificate" :value="__('Certificate')" />
|
||||
<x-textarea
|
||||
value="{{ old('certificate') }}"
|
||||
id="certificate"
|
||||
name="certificate"
|
||||
type="text"
|
||||
class="mt-1 w-full"
|
||||
rows="5"
|
||||
/>
|
||||
@error("certificate")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="private" :value="__('Private Key')" />
|
||||
<x-textarea
|
||||
value="{{ old('private') }}"
|
||||
id="private"
|
||||
name="private"
|
||||
type="text"
|
||||
class="mt-1 w-full"
|
||||
rows="5"
|
||||
/>
|
||||
@error("private")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __("Cancel") }}
|
||||
</x-secondary-button>
|
||||
|
||||
<x-primary-button class="ml-3" hx-disable>
|
||||
{{ __("Create") }}
|
||||
</x-primary-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
||||
</div>
|
61
resources/views/ssls/partials/ssls-list.blade.php
Normal file
61
resources/views/ssls/partials/ssls-list.blade.php
Normal file
@ -0,0 +1,61 @@
|
||||
<div x-data="{ deleteAction: '' }">
|
||||
<x-card-header>
|
||||
<x-slot name="title">{{ __("SSLs") }}</x-slot>
|
||||
<x-slot name="description">
|
||||
{{ __("Here you can manage your site's SSL certificates") }}
|
||||
</x-slot>
|
||||
<x-slot name="aside">
|
||||
@include("ssls.partials.create-ssl")
|
||||
</x-slot>
|
||||
</x-card-header>
|
||||
<x-live id="live-ssls">
|
||||
<div x-data="" class="space-y-3">
|
||||
@if (count($ssls) > 0)
|
||||
<x-table>
|
||||
<tr>
|
||||
<x-th>{{ __("Type") }}</x-th>
|
||||
<x-th>{{ __("Created") }}</x-th>
|
||||
<x-th>{{ __("Expires at") }}</x-th>
|
||||
<x-th></x-th>
|
||||
</tr>
|
||||
@foreach ($ssls as $ssl)
|
||||
<tr>
|
||||
<x-td>{{ $ssl->type }}</x-td>
|
||||
<x-td>
|
||||
<x-datetime :value="$ssl->created_at" />
|
||||
</x-td>
|
||||
<x-td>
|
||||
<x-datetime :value="$ssl->expires_at" />
|
||||
</x-td>
|
||||
<x-td>
|
||||
<div class="flex items-center">
|
||||
@include("ssls.partials.status", ["status" => $ssl->status])
|
||||
<div class="inline">
|
||||
<x-icon-button
|
||||
x-on:click="deleteAction = '{{ route('servers.sites.ssl.destroy', ['server' => $server, 'site' => $site, 'ssl' => $ssl]) }}'; $dispatch('open-modal', 'delete-ssl')"
|
||||
>
|
||||
<x-heroicon-o-trash class="h-5 w-5" />
|
||||
</x-icon-button>
|
||||
</div>
|
||||
</div>
|
||||
</x-td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</x-table>
|
||||
@else
|
||||
<x-simple-card>
|
||||
<div class="text-center">
|
||||
{{ __("You don't have any SSL certificates yet!") }}
|
||||
</div>
|
||||
</x-simple-card>
|
||||
@endif
|
||||
</div>
|
||||
</x-live>
|
||||
<x-confirmation-modal
|
||||
name="delete-ssl"
|
||||
:title="__('Confirm')"
|
||||
:description="__('Are you sure that you want to delete this SSL certificate?')"
|
||||
method="delete"
|
||||
x-bind:action="deleteAction"
|
||||
/>
|
||||
</div>
|
15
resources/views/ssls/partials/status.blade.php
Normal file
15
resources/views/ssls/partials/status.blade.php
Normal file
@ -0,0 +1,15 @@
|
||||
@if ($status == \App\Enums\SslStatus::CREATED)
|
||||
<x-status status="success">{{ $status }}</x-status>
|
||||
@endif
|
||||
|
||||
@if ($status == \App\Enums\SslStatus::CREATING)
|
||||
<x-status status="warning">{{ $status }}</x-status>
|
||||
@endif
|
||||
|
||||
@if ($status == \App\Enums\SslStatus::DELETING)
|
||||
<x-status status="danger">{{ $status }}</x-status>
|
||||
@endif
|
||||
|
||||
@if ($status == \App\Enums\SslStatus::FAILED)
|
||||
<x-status status="danger">{{ $status }}</x-status>
|
||||
@endif
|
Reference in New Issue
Block a user