96 lines
5.4 KiB
PHP
96 lines
5.4 KiB
PHP
<flux:modal name="reinstall-vm" class="md:w-[600px]">
|
|
<div class="space-y-6">
|
|
<div>
|
|
<flux:heading size="lg">{{ __('Chọn lại Hệ điều hành') }}</flux:heading>
|
|
<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>
|
|
|
|
@if ($currentOs)
|
|
<div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
|
|
<div class="flex items-center">
|
|
<svg class="w-5 h-5 text-blue-600 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
|
</svg>
|
|
<div>
|
|
<p class="text-sm font-medium text-blue-800">{{ __('Hệ điều hành hiện tại:') }}</p>
|
|
<p class="text-sm text-blue-700">
|
|
@if ($currentOs && $currentOs->osGroup)
|
|
{{ $currentOs->osGroup->name }} - {{ $currentOs->version ?? 'N/A' }}
|
|
@else
|
|
{{ __('Không xác định') }}
|
|
@endif
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
@if ($osGroups->count() > 0)
|
|
<div class="space-y-4">
|
|
<div>
|
|
<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="selectedOsGroupId" placeholder="Chọn lại Hệ điều hành">
|
|
<flux:select.option value="">Chọn lại hệ điều hành</flux:select.option>
|
|
@foreach ($osGroups as $osGroup)
|
|
<flux:select.option value="{{ $osGroup->id }}">{{ $osGroup->name }}</flux:select.option>
|
|
@endforeach
|
|
</flux:select>
|
|
</div>
|
|
|
|
@if ($selectedOsGroupId && $operatingSystems->count() > 0)
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-2">{{ __('Chọn phiên bản:') }}</label>
|
|
<div class="grid grid-cols-1 gap-3 max-h-60 overflow-y-auto">
|
|
@foreach ($operatingSystems as $os)
|
|
<label
|
|
class="flex items-center p-3 border border-gray-200 rounded-lg hover:bg-gray-50 cursor-pointer transition-colors">
|
|
<input type="radio" wire:model="selectedOsId" value="{{ $os->id }}"
|
|
class="mr-3">
|
|
<div class="flex-1">
|
|
<div class="font-medium text-gray-900">{{ $os->osGroup->name . ' - ' . $os->version }}
|
|
</div>
|
|
</div>
|
|
<div class="flex items-center space-x-2">
|
|
@if ($currentOs && $currentOs->id == $os->id)
|
|
<span
|
|
class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800">
|
|
Hiện tại
|
|
</span>
|
|
@endif
|
|
<span
|
|
class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
|
|
Khả dụng
|
|
</span>
|
|
</div>
|
|
</label>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
@elseif($selectedOsGroupId)
|
|
<div class="text-center py-8">
|
|
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" stroke="currentColor"
|
|
viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M9.172 16.172a4 4 0 015.656 0M9 12h6m-6-4h6m2 5.291A7.962 7.962 0 0112 15c-2.34 0-4.47-.881-6.08-2.33" />
|
|
</svg>
|
|
<h3 class="mt-2 text-sm font-medium text-gray-900">{{ __('Không có phiên bản nào') }}</h3>
|
|
<p class="mt-1 text-sm text-gray-500">
|
|
{{ __('Không có phiên bản hệ điều hành nào khả dụng cho loại này.') }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
<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()">
|
|
{{ __('Hủy') }}
|
|
</flux:button>
|
|
<flux:button variant="primary" color="orange" wire:click="confirmReinstall">
|
|
{{ __('Xác nhận cài lại') }}
|
|
</flux:button>
|
|
</div>
|
|
</div>
|
|
@else
|
|
@endif
|
|
</div>
|
|
</flux:modal>
|