refactor: Replace Flux UI components with native HTML/Alpine.js and update Composer dependencies.

This commit is contained in:
pbao9
2026-03-04 09:13:15 +07:00
parent db3a8c4949
commit 68540009c0
6 changed files with 200 additions and 232 deletions
+1 -1
View File
@@ -234,7 +234,7 @@ class VPSReinstallModal extends Component
if ($response->successful()) { if ($response->successful()) {
session()->flash('success', __('Yêu cầu cài lại hệ điều hành đã được gửi thành công.')); session()->flash('success', __('Yêu cầu cài lại hệ điều hành đã được gửi thành công.'));
$this->dispatch('close-modal', ['name' => 'reinstall-vm']); $this->dispatch('close-reinstall-modal');
} else { } else {
$errorMessage = $response->json('message') ?? __('Có lỗi xảy ra khi gửi yêu cầu.'); $errorMessage = $response->json('message') ?? __('Có lỗi xảy ra khi gửi yêu cầu.');
session()->flash('error', $errorMessage); session()->flash('error', $errorMessage);
-1
View File
@@ -21,7 +21,6 @@
"laravel/passport": "^12.2", "laravel/passport": "^12.2",
"laravel/sanctum": "^3.3", "laravel/sanctum": "^3.3",
"laravel/tinker": "^2.7", "laravel/tinker": "^2.7",
"livewire/flux": "^2.2",
"livewire/livewire": "^3.6", "livewire/livewire": "^3.6",
"maatwebsite/excel": "^3.1", "maatwebsite/excel": "^3.1",
"opcodesio/log-viewer": "^3.18", "opcodesio/log-viewer": "^3.18",
Generated
+1 -67
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "e8e3d079473d0f39c2ea9336da6e56cc", "content-hash": "ea9197c6a2804717c1efcd340c4b7828",
"packages": [ "packages": [
{ {
"name": "aws/aws-crt-php", "name": "aws/aws-crt-php",
@@ -3921,72 +3921,6 @@
], ],
"time": "2026-01-15T06:54:53+00:00" "time": "2026-01-15T06:54:53+00:00"
}, },
{
"name": "livewire/flux",
"version": "v2.11.1",
"source": {
"type": "git",
"url": "https://github.com/livewire/flux.git",
"reference": "3ada3b2644215fd1ccb7003ce8e6bc185c22e70a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/livewire/flux/zipball/3ada3b2644215fd1ccb7003ce8e6bc185c22e70a",
"reference": "3ada3b2644215fd1ccb7003ce8e6bc185c22e70a",
"shasum": ""
},
"require": {
"illuminate/console": "^10.0|^11.0|^12.0",
"illuminate/support": "^10.0|^11.0|^12.0",
"illuminate/view": "^10.0|^11.0|^12.0",
"laravel/prompts": "^0.1|^0.2|^0.3",
"livewire/livewire": "^3.7.4|^4.0",
"php": "^8.1",
"symfony/console": "^6.0|^7.0"
},
"conflict": {
"livewire/blaze": "<1.0.0"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"Flux": "Flux\\Flux"
},
"providers": [
"Flux\\FluxServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Flux\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"proprietary"
],
"authors": [
{
"name": "Caleb Porzio",
"email": "calebporzio@gmail.com"
}
],
"description": "The official UI component library for Livewire.",
"keywords": [
"components",
"flux",
"laravel",
"livewire",
"ui"
],
"support": {
"issues": "https://github.com/livewire/flux/issues",
"source": "https://github.com/livewire/flux/tree/v2.11.1"
},
"time": "2026-01-21T17:09:56+00:00"
},
{ {
"name": "livewire/livewire", "name": "livewire/livewire",
"version": "v3.7.6", "version": "v3.7.6",
@@ -5,5 +5,4 @@
@push('scriptsLivewire') @push('scriptsLivewire')
@livewireScripts @livewireScripts
@fluxScripts
@endpush @endpush
@@ -201,7 +201,10 @@
<!-- Gia hạn tự động --> <!-- Gia hạn tự động -->
<td class="text-center py-3 px-4"> <td class="text-center py-3 px-4">
<flux:switch wire:model.live="auto_renew" :checked="$invoice->auto_renew" /> <label class="relative inline-flex items-center cursor-pointer">
<input type="checkbox" wire:model.live="auto_renew" @checked($invoice->auto_renew) class="sr-only peer">
<div class="w-11 h-6 bg-gray-200 rounded-full peer peer-checked:bg-blue-600 after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:after:translate-x-full"></div>
</label>
</td> </td>
<!-- Thao tác --> <!-- Thao tác -->
@@ -1,7 +1,26 @@
<flux:modal name="reinstall-vm" class="md:w-[600px]"> <div
<div class="space-y-6"> x-data="{ open: false }"
x-on:open-reinstall-modal.window="open = true"
x-on:close-reinstall-modal.window="open = false"
>
{{-- Backdrop --}}
<div
x-show="open"
x-transition.opacity
class="fixed inset-0 bg-black/50 z-40"
x-on:click="open = false"
></div>
{{-- Modal panel --}}
<div
x-show="open"
x-transition
class="fixed inset-0 z-50 flex items-center justify-center p-4"
>
<div class="bg-white rounded-lg shadow-xl md:w-[600px] w-full max-h-[90vh] overflow-y-auto">
<div class="p-6 space-y-6">
<div> <div>
<flux:heading size="lg">{{ __('Chọn lại Hệ điều hành') }}</flux:heading> <h2 class="text-lg font-semibold text-gray-900">{{ __('Chọn lại Hệ điều hành') }}</h2>
<p class="text-sm text-gray-600 mt-2">{{ __('Chọn hệ điều hành mới cho máy ảo của bạn.') }}</p> <p class="text-sm text-gray-600 mt-2">{{ __('Chọn hệ điều hành mới cho máy ảo của bạn.') }}</p>
</div> </div>
@@ -31,14 +50,16 @@
<div> <div>
<label <label
class="block text-sm font-medium text-gray-700 mb-2">{{ __('Chọn loại hệ điều hành') }}</label> class="block text-sm font-medium text-gray-700 mb-2">{{ __('Chọn loại hệ điều hành') }}</label>
<flux:select wire:model.live="selectedOsGroupId" placeholder="{{ __('Chọn loại hệ điều hành') }}" <select
:disabled="$isLoading"> wire:model.live="selectedOsGroupId"
<flux:select.option value="">{{ __('Chọn loại hệ điều hành') }}</flux:select.option> :disabled="$isLoading"
class="w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 disabled:opacity-50 disabled:cursor-not-allowed"
>
<option value="">{{ __('Chọn loại hệ điều hành') }}</option>
@foreach ($osGroups as $osGroup) @foreach ($osGroups as $osGroup)
<flux:select.option value="{{ $osGroup->id }}">{{ $osGroup->name }} <option value="{{ $osGroup->id }}">{{ $osGroup->name }}</option>
</flux:select.option>
@endforeach @endforeach
</flux:select> </select>
</div> </div>
@if ($selectedOsGroupId) @if ($selectedOsGroupId)
@@ -141,13 +162,23 @@
@endif @endif
<div class="flex justify-end space-x-3 pt-4 border-t border-gray-200"> <div class="flex justify-end space-x-3 pt-4 border-t border-gray-200">
<flux:button variant="primary" x-on:click="$flux.modal('reinstall-vm').close()" :disabled="$isLoading"> <button
type="button"
x-on:click="open = false"
:disabled="$isLoading"
class="px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
>
{{ __('Hủy') }} {{ __('Hủy') }}
</flux:button> </button>
@if ($selectedOsId && $selectedOsDetails) @if ($selectedOsId && $selectedOsDetails)
<flux:button variant="primary" color="orange" wire:click="confirmReinstall" :disabled="$isLoading"> <button
type="button"
wire:click="confirmReinstall"
:disabled="$isLoading"
class="px-4 py-2 text-sm font-medium text-white bg-orange-500 border border-transparent rounded-md hover:bg-orange-600 disabled:opacity-50 disabled:cursor-not-allowed"
>
@if ($isLoading) @if ($isLoading)
<svg class="w-4 h-4 mr-2 animate-spin" fill="none" viewBox="0 0 24 24"> <svg class="w-4 h-4 mr-2 animate-spin inline" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg> </svg>
@@ -155,7 +186,7 @@
@else @else
{{ __('Xác nhận cài lại') }} {{ __('Xác nhận cài lại') }}
@endif @endif
</flux:button> </button>
@endif @endif
</div> </div>
</div> </div>
@@ -171,4 +202,6 @@
</div> </div>
@endif @endif
</div> </div>
</flux:modal> </div>
</div>
</div>