fix php ini update bug

This commit is contained in:
Saeed Vaziry 2024-03-24 15:16:49 +01:00
parent ca0e33be2f
commit d504588f95
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!');
return back();
return back()->with([
'ini' => $request->input('ini'),
]);
}
public function uninstall(Server $server, Request $request): RedirectResponse

View File

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

View File

@ -6,45 +6,47 @@
</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 name="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-live id="php-default-cli">
<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 name="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
@endforeach
@if (count($phps) == 1)
<x-dropdown-link>
{{ __("No other versions") }}
</x-dropdown-link>
@endif
</x-slot>
</x-dropdown>
</x-slot>
</x-dropdown>
</div>
</div>
</div>
</x-item-card>
</a>
</x-item-card>
</a>
</x-live>
</div>

View File

@ -39,7 +39,7 @@ class="cursor-pointer"
</x-dropdown-link>
<x-dropdown-link
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-swap="outerHTML"
hx-target="#update-php-ini-form"