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:
50
resources/views/php/partials/default-cli.blade.php
Normal file
50
resources/views/php/partials/default-cli.blade.php
Normal file
@ -0,0 +1,50 @@
|
||||
<div>
|
||||
<x-card-header>
|
||||
<x-slot name="title">{{ __("Default PHP Cli") }}</x-slot>
|
||||
<x-slot name="description">
|
||||
{{ __("You can see and manage your PHP installations") }}
|
||||
</x-slot>
|
||||
</x-card-header>
|
||||
|
||||
<a class="block">
|
||||
<x-item-card>
|
||||
<div class="flex items-start justify-center">
|
||||
<span class="mr-2">PHP {{ $defaultPHP->version }}</span>
|
||||
@include("services.partials.status", ["status" => $defaultPHP->status])
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<div class="inline">
|
||||
<x-dropdown>
|
||||
<x-slot name="trigger">
|
||||
<x-secondary-button>
|
||||
{{ __("Change") }}
|
||||
<x-heroicon-o-chevron-up-down class="ml-1 h-5 w-5" />
|
||||
</x-secondary-button>
|
||||
</x-slot>
|
||||
<x-slot name="content">
|
||||
@foreach ($phps as $php)
|
||||
@if ($php->version != $defaultPHP->version)
|
||||
<x-dropdown-link
|
||||
id="php-{{ $php->id }}-default-cli"
|
||||
class="cursor-pointer"
|
||||
hx-post="{{ route('servers.php.default-cli', ['server' => $server, 'version' => $php->version]) }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-select="#php-{{ $php->id }}-default-cli"
|
||||
>
|
||||
PHP {{ $php->version }}
|
||||
</x-dropdown-link>
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@if (count($phps) == 1)
|
||||
<x-dropdown-link>
|
||||
{{ __("No other versions") }}
|
||||
</x-dropdown-link>
|
||||
@endif
|
||||
</x-slot>
|
||||
</x-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</x-item-card>
|
||||
</a>
|
||||
</div>
|
49
resources/views/php/partials/install-extension.blade.php
Normal file
49
resources/views/php/partials/install-extension.blade.php
Normal file
@ -0,0 +1,49 @@
|
||||
<x-modal name="install-extension">
|
||||
<form
|
||||
id="install-extension-form"
|
||||
hx-post="{{ route("servers.php.install-extension", ["server" => $server]) }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-select="#install-extension-form"
|
||||
class="p-6"
|
||||
>
|
||||
<input type="hidden" name="version" :value="version" />
|
||||
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __("Install Extension") }}
|
||||
</h2>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="extension" value="Name" />
|
||||
<x-select-input name="extension" class="mt-1 w-full">
|
||||
<option value="" selected>{{ __("Select") }}</option>
|
||||
@foreach (config("core.php_extensions") as $extension)
|
||||
<option value="{{ $extension }}" {{-- @if(in_array($extension, $installedExtensions)) disabled @endif --}}>
|
||||
{{ $extension }}
|
||||
{{--
|
||||
@if (in_array($extension, $installedExtensions))
|
||||
({{ __("Installed") }})
|
||||
@endif
|
||||
--}}
|
||||
</option>
|
||||
@endforeach
|
||||
</x-select-input>
|
||||
@error("extension")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
|
||||
@error("version")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex items-center justify-end">
|
||||
<x-secondary-button type="button" x-on:click="$dispatch('close')">
|
||||
{{ __("Cancel") }}
|
||||
</x-secondary-button>
|
||||
|
||||
<x-primary-button hx-disable class="ml-3">
|
||||
{{ __("Install") }}
|
||||
</x-primary-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
22
resources/views/php/partials/install-new-php.blade.php
Normal file
22
resources/views/php/partials/install-new-php.blade.php
Normal file
@ -0,0 +1,22 @@
|
||||
<x-dropdown>
|
||||
<x-slot name="trigger">
|
||||
<x-primary-button hx-disable>
|
||||
{{ __("Install PHP") }}
|
||||
<x-heroicon-o-chevron-up-down class="ml-1 h-5 w-5" />
|
||||
</x-primary-button>
|
||||
</x-slot>
|
||||
|
||||
<x-slot name="content">
|
||||
@foreach (config("core.php_versions") as $php)
|
||||
@if (! $phps->whereIn("version", $php)->first() && $php !== "none")
|
||||
<x-dropdown-link
|
||||
class="cursor-pointer"
|
||||
hx-post="{{ route('servers.php.install', ['server' => $server, 'version' => $php]) }}"
|
||||
hx-swap="none"
|
||||
>
|
||||
PHP {{ $php }}
|
||||
</x-dropdown-link>
|
||||
@endif
|
||||
@endforeach
|
||||
</x-slot>
|
||||
</x-dropdown>
|
90
resources/views/php/partials/installed-versions.blade.php
Normal file
90
resources/views/php/partials/installed-versions.blade.php
Normal file
@ -0,0 +1,90 @@
|
||||
<div x-data="{ version: '', uninstallAction: '' }">
|
||||
<x-card-header>
|
||||
<x-slot name="title">{{ __("Installed PHPs") }}</x-slot>
|
||||
<x-slot name="description">
|
||||
{{ __("You can see and manage your PHP installations") }}
|
||||
</x-slot>
|
||||
<x-slot name="aside">
|
||||
<div class="flex items-center">
|
||||
@include("php.partials.install-new-php")
|
||||
</div>
|
||||
</x-slot>
|
||||
</x-card-header>
|
||||
|
||||
<x-live id="live-phps">
|
||||
@if (count($phps) > 0)
|
||||
<div class="space-y-3">
|
||||
@foreach ($phps as $php)
|
||||
<a class="block">
|
||||
<x-item-card>
|
||||
<div class="flex items-start justify-center">
|
||||
<span class="mr-2">PHP {{ $php->version }}</span>
|
||||
@include("services.partials.status", ["status" => $php->status])
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<div class="inline">
|
||||
<x-dropdown>
|
||||
<x-slot name="trigger">
|
||||
<x-secondary-button>
|
||||
{{ __("Actions") }}
|
||||
<x-heroicon-o-chevron-up-down class="ml-1 h-5 w-5" />
|
||||
</x-secondary-button>
|
||||
</x-slot>
|
||||
<x-slot name="content">
|
||||
<x-dropdown-link
|
||||
class="cursor-pointer"
|
||||
x-on:click="version = '{{ $php->version }}'; $dispatch('open-modal', 'install-extension')"
|
||||
>
|
||||
{{ __("Install Extension") }}
|
||||
</x-dropdown-link>
|
||||
<x-dropdown-link
|
||||
class="cursor-pointer"
|
||||
x-on:click="$dispatch('open-modal', 'update-php-ini'); document.getElementById('ini').value = 'Loading...';"
|
||||
hx-get="{{ route('servers.php.get-ini', ['server' => $server, 'version' => $php->version]) }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-target="#update-php-ini-form"
|
||||
hx-select="#update-php-ini-form"
|
||||
>
|
||||
{{ __("Edit php.ini") }}
|
||||
</x-dropdown-link>
|
||||
<x-dropdown-link
|
||||
class="cursor-pointer"
|
||||
href="{{ route('servers.services.restart', ['server' => $server, 'service' => $php]) }}"
|
||||
>
|
||||
{{ __("Restart FPM") }}
|
||||
</x-dropdown-link>
|
||||
<x-dropdown-link
|
||||
class="cursor-pointer"
|
||||
x-on:click="uninstallAction = '{{ route('servers.php.uninstall', ['server' => $server, 'version' => $php->version]) }}'; $dispatch('open-modal', 'uninstall-php')"
|
||||
>
|
||||
<span class="text-red-600">
|
||||
{{ __("Uninstall") }}
|
||||
</span>
|
||||
</x-dropdown-link>
|
||||
</x-slot>
|
||||
</x-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</x-item-card>
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<x-simple-card>
|
||||
<div class="text-center">
|
||||
{{ __("You don't have any PHP version installed!") }}
|
||||
</div>
|
||||
</x-simple-card>
|
||||
@endif
|
||||
</x-live>
|
||||
|
||||
<x-confirmation-modal
|
||||
name="uninstall-php"
|
||||
:title="__('Uninstall PHP')"
|
||||
:description="__('Are you sure you want to uninstall this version?')"
|
||||
method="delete"
|
||||
x-bind:action="uninstallAction"
|
||||
/>
|
||||
@include("php.partials.update-php-ini")
|
||||
@include("php.partials.install-extension")
|
||||
</div>
|
39
resources/views/php/partials/update-php-ini.blade.php
Normal file
39
resources/views/php/partials/update-php-ini.blade.php
Normal file
@ -0,0 +1,39 @@
|
||||
<x-modal name="update-php-ini">
|
||||
<form
|
||||
id="update-php-ini-form"
|
||||
hx-post="{{ route("servers.php.update-ini", ["server" => $server]) }}"
|
||||
hx-swap="outerHTML"
|
||||
hx-select="#update-php-ini-form"
|
||||
class="p-6"
|
||||
>
|
||||
<input type="hidden" name="version" :value="version" />
|
||||
|
||||
<h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||
{{ __("Update php.ini") }}
|
||||
</h2>
|
||||
|
||||
<div class="mt-6">
|
||||
<x-input-label for="ini" value="php.ini" />
|
||||
<x-textarea id="ini" name="ini" class="mt-1 w-full" rows="15">
|
||||
{{ old("ini", session()->get("ini")) }}
|
||||
</x-textarea>
|
||||
@error("ini")
|
||||
<x-input-error class="mt-2" :messages="$message" />
|
||||
@enderror
|
||||
|
||||
@error("version")
|
||||
<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 hx-disable class="ml-3">
|
||||
{{ __("Save") }}
|
||||
</x-primary-button>
|
||||
</div>
|
||||
</form>
|
||||
</x-modal>
|
Reference in New Issue
Block a user