Merge pull request #133 from vitodeploy/fix-php-ini-update

fix php ini update bug
This commit is contained in:
Saeed Vaziry 2024-03-24 15:19:06 +01:00 committed by GitHub
commit f68d6c7ca2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 45 additions and 41 deletions

View File

@ -71,7 +71,9 @@ public function updateIni(Server $server, Request $request): RedirectResponse
Toast::success('PHP ini updated!'); Toast::success('PHP ini updated!');
return back(); return back()->with([
'ini' => $request->input('ini'),
]);
} }
public function uninstall(Server $server, Request $request): RedirectResponse public function uninstall(Server $server, Request $request): RedirectResponse

View File

@ -1,5 +1,5 @@
@props([ @props([
"interval" => "30s", "interval" => "7s",
"id", "id",
"target" => null, "target" => null,
]) ])

View File

@ -6,45 +6,47 @@
</x-slot> </x-slot>
</x-card-header> </x-card-header>
<a class="block"> <x-live id="php-default-cli">
<x-item-card> <a class="block">
<div class="flex items-start justify-center"> <x-item-card>
<span class="mr-2">PHP {{ $defaultPHP->version }}</span> <div class="flex items-start justify-center">
@include("services.partials.status", ["status" => $defaultPHP->status]) <span class="mr-2">PHP {{ $defaultPHP->version }}</span>
</div> @include("services.partials.status", ["status" => $defaultPHP->status])
<div class="flex items-center"> </div>
<div class="inline"> <div class="flex items-center">
<x-dropdown> <div class="inline">
<x-slot name="trigger"> <x-dropdown>
<x-secondary-button> <x-slot name="trigger">
{{ __("Change") }} <x-secondary-button>
<x-heroicon name="o-chevron-up-down" class="ml-1 h-5 w-5" /> {{ __("Change") }}
</x-secondary-button> <x-heroicon name="o-chevron-up-down" class="ml-1 h-5 w-5" />
</x-slot> </x-secondary-button>
<x-slot name="content"> </x-slot>
@foreach ($phps as $php) <x-slot name="content">
@if ($php->version != $defaultPHP->version) @foreach ($phps as $php)
<x-dropdown-link @if ($php->version != $defaultPHP->version)
id="php-{{ $php->id }}-default-cli" <x-dropdown-link
class="cursor-pointer" id="php-{{ $php->id }}-default-cli"
hx-post="{{ route('servers.php.default-cli', ['server' => $server, 'version' => $php->version]) }}" class="cursor-pointer"
hx-swap="outerHTML" hx-post="{{ route('servers.php.default-cli', ['server' => $server, 'version' => $php->version]) }}"
hx-select="#php-{{ $php->id }}-default-cli" hx-swap="outerHTML"
> hx-select="#php-{{ $php->id }}-default-cli"
PHP {{ $php->version }} >
PHP {{ $php->version }}
</x-dropdown-link>
@endif
@endforeach
@if (count($phps) == 1)
<x-dropdown-link>
{{ __("No other versions") }}
</x-dropdown-link> </x-dropdown-link>
@endif @endif
@endforeach </x-slot>
</x-dropdown>
@if (count($phps) == 1) </div>
<x-dropdown-link>
{{ __("No other versions") }}
</x-dropdown-link>
@endif
</x-slot>
</x-dropdown>
</div> </div>
</div> </x-item-card>
</x-item-card> </a>
</a> </x-live>
</div> </div>

View File

@ -39,7 +39,7 @@ class="cursor-pointer"
</x-dropdown-link> </x-dropdown-link>
<x-dropdown-link <x-dropdown-link
class="cursor-pointer" class="cursor-pointer"
x-on:click="$dispatch('open-modal', 'update-php-ini'); document.getElementById('ini').value = 'Loading...';" x-on:click="version = '{{ $php->version }}'; $dispatch('open-modal', 'update-php-ini'); document.getElementById('ini').value = 'Loading...';"
hx-get="{{ route('servers.php.get-ini', ['server' => $server, 'version' => $php->version]) }}" hx-get="{{ route('servers.php.get-ini', ['server' => $server, 'version' => $php->version]) }}"
hx-swap="outerHTML" hx-swap="outerHTML"
hx-target="#update-php-ini-form" hx-target="#update-php-ini-form"