mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 23:42: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:
@ -0,0 +1,5 @@
|
||||
<x-profile-layout>
|
||||
<x-slot name="pageTitle">{{ __("Storage Providers") }}</x-slot>
|
||||
|
||||
@include("settings.server-providers.partials.providers-list")
|
||||
</x-profile-layout>
|
@ -0,0 +1,97 @@
|
||||
<div>
|
||||
<x-primary-button x-data="" x-on:click.prevent="$dispatch('open-modal', 'connect-provider')">
|
||||
{{ __("Connect") }}
|
||||
</x-primary-button>
|
||||
|
||||
<x-modal name="connect-provider" :show="request()->has('provider')">
|
||||
@php
|
||||
$oldProvider = old("provider", request()->input("provider") ?? "");
|
||||
@endphp
|
||||
|
||||
<form
|
||||
id="connect-provider-form"
|
||||
hx-post="{{ route("server-providers.connect") }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-select="#connect-provider-form"
|
||||
hx-ext="disable-element"
|
||||
hx-disable-element="#btn-connect-provider"
|
||||
class="p-6"
|
||||
x-data="{ provider: '{{ $oldProvider }}' }"
|
||||
>
|
||||
@csrf
|
||||
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __("Connect to a Server Provider") }}
|
||||
</h2>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="provider" value="Provider" />
|
||||
<x-select-input x-model="provider" id="provider" name="provider" class="mt-1 w-full">
|
||||
<option value="" selected disabled>
|
||||
{{ __("Select") }}
|
||||
</option>
|
||||
@foreach (config("core.server_providers") as $p)
|
||||
@if ($p !== "custom")
|
||||
<option value="{{ $p }}" @if($oldProvider === $p) selected @endif>
|
||||
{{ $p }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</x-select-input>
|
||||
@error("provider")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="name" value="Name" />
|
||||
<x-text-input value="{{ old('name') }}" id="name" name="name" type="text" class="mt-1 w-full" />
|
||||
@error("name")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div x-show="provider === 'aws'">
|
||||
<div class="mt-6">
|
||||
<x-input-label for="key" value="Access Key" />
|
||||
<x-text-input value="{{ old('key') }}" id="key" name="key" type="text" class="mt-1 w-full" />
|
||||
@error("key")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="secret" value="Secret" />
|
||||
<x-text-input
|
||||
value="{{ old('secret') }}"
|
||||
id="secret"
|
||||
name="secret"
|
||||
type="text"
|
||||
class="mt-1 w-full"
|
||||
/>
|
||||
@error("secret")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div x-show="['hetzner', 'digitalocean', 'vultr', 'linode'].includes(provider)" class="mt-6">
|
||||
<x-input-label for="token" value="API Key" />
|
||||
<x-text-input value="{{ old('token') }}" id="token" name="token" type="text" class="mt-1 w-full" />
|
||||
@error("token")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</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 id="btn-connect-provider" class="ml-3">
|
||||
{{ __("Connect") }}
|
||||
</x-primary-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
||||
</div>
|
@ -0,0 +1,18 @@
|
||||
<x-modal name="delete-provider" :show="$errors->isNotEmpty()">
|
||||
<form id="delete-provider-form" method="post" x-bind:action="deleteAction" class="p-6">
|
||||
@csrf
|
||||
@method("delete")
|
||||
|
||||
<h2 class="text-lg font-medium">Are you sure that you want to delete this provider?</h2>
|
||||
|
||||
<div class="mt-6 flex justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __("Cancel") }}
|
||||
</x-secondary-button>
|
||||
|
||||
<x-danger-button class="ml-3">
|
||||
{{ __("Delete") }}
|
||||
</x-danger-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
@ -0,0 +1,47 @@
|
||||
<div>
|
||||
<x-card-header>
|
||||
<x-slot name="title">Server Providers</x-slot>
|
||||
<x-slot name="description">You can connect to your server providers to create servers using their APIs</x-slot>
|
||||
<x-slot name="aside">
|
||||
@include("settings.server-providers.partials.connect-provider")
|
||||
</x-slot>
|
||||
</x-card-header>
|
||||
<div x-data="{ deleteAction: '' }" class="space-y-3">
|
||||
@if (count($providers) > 0)
|
||||
@foreach ($providers as $provider)
|
||||
<x-item-card>
|
||||
<div class="flex-none">
|
||||
<img
|
||||
src="{{ asset("static/images/" . $provider->provider . ".svg") }}"
|
||||
class="h-10 w-10"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<div class="ml-3 flex flex-grow flex-col items-start justify-center">
|
||||
<span class="mb-1">{{ $provider->profile }}</span>
|
||||
<span class="text-sm text-gray-400">
|
||||
<x-datetime :value="$provider->created_at" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<div class="inline">
|
||||
<x-icon-button
|
||||
x-on:click="deleteAction = '{{ route('server-providers.delete', $provider->id) }}'; $dispatch('open-modal', 'delete-provider')"
|
||||
>
|
||||
<x-heroicon-o-trash class="h-5 w-5" />
|
||||
</x-icon-button>
|
||||
</div>
|
||||
</div>
|
||||
</x-item-card>
|
||||
@endforeach
|
||||
|
||||
@include("settings.server-providers.partials.delete-provider")
|
||||
@else
|
||||
<x-simple-card>
|
||||
<div class="text-center">
|
||||
{{ __("You haven't connected to any server providers yet!") }}
|
||||
</div>
|
||||
</x-simple-card>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user