From 68540009c0f627a37c182c265479700ede4971c6 Mon Sep 17 00:00:00 2001 From: pbao9 Date: Wed, 4 Mar 2026 09:13:15 +0700 Subject: [PATCH] refactor: Replace Flux UI components with native HTML/Alpine.js and update Composer dependencies. --- app/Http/Livewire/VPSReinstallModal.php | 2 +- composer.json | 1 - composer.lock | 68 +--- .../components/livewire-assets.blade.php | 1 - resources/views/livewire/my-service.blade.php | 5 +- .../livewire/v-p-s-reinstall-modal.blade.php | 355 ++++++++++-------- 6 files changed, 200 insertions(+), 232 deletions(-) diff --git a/app/Http/Livewire/VPSReinstallModal.php b/app/Http/Livewire/VPSReinstallModal.php index 2a433f6..abb4c5f 100644 --- a/app/Http/Livewire/VPSReinstallModal.php +++ b/app/Http/Livewire/VPSReinstallModal.php @@ -234,7 +234,7 @@ class VPSReinstallModal extends Component 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.')); - $this->dispatch('close-modal', ['name' => 'reinstall-vm']); + $this->dispatch('close-reinstall-modal'); } else { $errorMessage = $response->json('message') ?? __('Có lỗi xảy ra khi gửi yêu cầu.'); session()->flash('error', $errorMessage); diff --git a/composer.json b/composer.json index 13d236e..cea8498 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,6 @@ "laravel/passport": "^12.2", "laravel/sanctum": "^3.3", "laravel/tinker": "^2.7", - "livewire/flux": "^2.2", "livewire/livewire": "^3.6", "maatwebsite/excel": "^3.1", "opcodesio/log-viewer": "^3.18", diff --git a/composer.lock b/composer.lock index d0da793..2ce01e3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e8e3d079473d0f39c2ea9336da6e56cc", + "content-hash": "ea9197c6a2804717c1efcd340c4b7828", "packages": [ { "name": "aws/aws-crt-php", @@ -3921,72 +3921,6 @@ ], "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", "version": "v3.7.6", diff --git a/resources/views/components/livewire-assets.blade.php b/resources/views/components/livewire-assets.blade.php index a48d91d..848d100 100644 --- a/resources/views/components/livewire-assets.blade.php +++ b/resources/views/components/livewire-assets.blade.php @@ -5,5 +5,4 @@ @push('scriptsLivewire') @livewireScripts - @fluxScripts @endpush diff --git a/resources/views/livewire/my-service.blade.php b/resources/views/livewire/my-service.blade.php index a1d5fbb..d11fc38 100644 --- a/resources/views/livewire/my-service.blade.php +++ b/resources/views/livewire/my-service.blade.php @@ -201,7 +201,10 @@ - + diff --git a/resources/views/livewire/v-p-s-reinstall-modal.blade.php b/resources/views/livewire/v-p-s-reinstall-modal.blade.php index 10aefe6..fc06efd 100644 --- a/resources/views/livewire/v-p-s-reinstall-modal.blade.php +++ b/resources/views/livewire/v-p-s-reinstall-modal.blade.php @@ -1,174 +1,207 @@ - -
-
- {{ __('Chọn lại Hệ điều hành') }} -

{{ __('Chọn hệ điều hành mới cho máy ảo của bạn.') }}

-
+
+ {{-- Backdrop --}} +
- @if ($currentOs) -
-
- - - -
-

{{ __('Hệ điều hành hiện tại:') }}

-

- @if ($currentOs && $currentOs->osGroup) - {{ $currentOs->osGroup->name }} - {{ $currentOs->version ?? 'N/A' }} - @else - {{ __('Không xác định') }} - @endif -

-
-
-
- @endif - - @if (count($osGroups) > 0) -
+ {{-- Modal panel --}} +
+
+
- - - {{ __('Chọn loại hệ điều hành') }} - @foreach ($osGroups as $osGroup) - {{ $osGroup->name }} - - @endforeach - +

{{ __('Chọn lại Hệ điều hành') }}

+

{{ __('Chọn hệ điều hành mới cho máy ảo của bạn.') }}

- @if ($selectedOsGroupId) -
- - - @if ($isLoading) -
- - - - - -

{{ __('Đang tải danh sách phiên bản...') }}

-
- @elseif (count($operatingSystems) > 0) -
- @foreach ($operatingSystems as $os) - - @endforeach -
- @else -
- - - -

{{ __('Không có phiên bản nào') }} -

-

- {{ __('Không có phiên bản hệ điều hành nào khả dụng cho loại này.') }}

-
- @endif -
- @endif - - @if ($selectedOsId && $selectedOsDetails && $vpsInfo) -
-
- - + @if ($currentOs) +
+
+ + -
-

{{ __('Quý khách cài đặt lại VPS với thông tin như sau:') }}

-
-

{{ __('VPS:') }} {{ $vpsIpAddress ?? $moduleVmware?->name ?? $vpsInfo->name ?? 'N/A' }}

-

{{ __('Hệ điều hành:') }} {{ $selectedOsDetails->osGroup->name ?? '' }} {{ $selectedOsDetails->version ?? '' }}

-
-
-

{{ __('Lưu ý:') }}

-

{{ __('Hành động này rất nguy hiểm, nó có thể xóa VPS và cài đặt lại. Quý khách vui lòng kiểm tra lại các VPS cần cài đặt lại.') }}

-
+
+

{{ __('Hệ điều hành hiện tại:') }}

+

+ @if ($currentOs && $currentOs->osGroup) + {{ $currentOs->osGroup->name }} - {{ $currentOs->version ?? 'N/A' }} + @else + {{ __('Không xác định') }} + @endif +

@endif -
- - {{ __('Hủy') }} - - @if ($selectedOsId && $selectedOsDetails) - - @if ($isLoading) - - - - - {{ __('Đang xử lý...') }} - @else - {{ __('Xác nhận cài lại') }} + @if (count($osGroups) > 0) +
+
+ + +
+ + @if ($selectedOsGroupId) +
+ + + @if ($isLoading) +
+ + + + + +

{{ __('Đang tải danh sách phiên bản...') }}

+
+ @elseif (count($operatingSystems) > 0) +
+ @foreach ($operatingSystems as $os) + + @endforeach +
+ @else +
+ + + +

{{ __('Không có phiên bản nào') }} +

+

+ {{ __('Không có phiên bản hệ điều hành nào khả dụng cho loại này.') }}

+
+ @endif +
+ @endif + + @if ($selectedOsId && $selectedOsDetails && $vpsInfo) +
+
+ + + +
+

{{ __('Quý khách cài đặt lại VPS với thông tin như sau:') }}

+
+

{{ __('VPS:') }} {{ $vpsIpAddress ?? $moduleVmware?->name ?? $vpsInfo->name ?? 'N/A' }}

+

{{ __('Hệ điều hành:') }} {{ $selectedOsDetails->osGroup->name ?? '' }} {{ $selectedOsDetails->version ?? '' }}

+
+
+

{{ __('Lưu ý:') }}

+

{{ __('Hành động này rất nguy hiểm, nó có thể xóa VPS và cài đặt lại. Quý khách vui lòng kiểm tra lại các VPS cần cài đặt lại.') }}

+
+
+
+
+ @endif + +
+ + @if ($selectedOsId && $selectedOsDetails) + @endif - - @endif -
+
+
+ @else +
+ + + +

{{ __('Không có hệ điều hành nào') }}

+

+ {{ __('Không có hệ điều hành nào khả dụng cho VPS này.') }}

+
+ @endif
- @else -
- - - -

{{ __('Không có hệ điều hành nào') }}

-

- {{ __('Không có hệ điều hành nào khả dụng cho VPS này.') }}

-
- @endif +
- +