69 lines
3.1 KiB
PHP
69 lines
3.1 KiB
PHP
{{-- VM Control Panel Partial - Optimized with reusable components --}}
|
|
@php
|
|
$vmStatus = $vmInfo['status'] ?? null;
|
|
$isPoweredOn = $vmStatus == 'POWERED_ON';
|
|
$isPoweredOff = $vmStatus == 'POWERED_OFF';
|
|
$isWindows =
|
|
\Illuminate\Support\Str::contains(\Illuminate\Support\Str::lower($vmInfo['os'] ?? ''), 'windows') ||
|
|
\Illuminate\Support\Str::contains(
|
|
\Illuminate\Support\Str::lower($invoice->invoiceItem->first()?->os?->osGroup?->name ?? ''),
|
|
'windows',
|
|
);
|
|
@endphp
|
|
|
|
<div class="bg-white rounded-lg shadow-lg p-6 mb-6">
|
|
<h2 class="text-xl font-semibold text-gray-800 mb-6 flex items-center">
|
|
<svg class="w-5 h-5 mr-2 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
|
d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 100 4m0-4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 100 4m0-4v2m0-6V4">
|
|
</path>
|
|
</svg>
|
|
{{ __('Điều khiển VM') }}
|
|
</h2>
|
|
|
|
{{-- VM Control Grid --}}
|
|
<div class="grid grid-cols-6 gap-4">
|
|
{{-- Row 1: Basic Controls --}}
|
|
@include('frontend.service.partials.control-buttons.renewal-button')
|
|
{{-- Debug info removed - was causing htmlspecialchars error --}}
|
|
|
|
@if ($isPoweredOff)
|
|
@include('frontend.service.partials.control-buttons.start-button')
|
|
@elseif ($isPoweredOn)
|
|
@include('frontend.service.partials.control-buttons.restart-button')
|
|
@if ($isWindows)
|
|
@include('frontend.service.partials.control-buttons.reset-remote-button')
|
|
@endif
|
|
@include('frontend.service.partials.control-buttons.stop-button')
|
|
@include('frontend.service.partials.control-buttons.console-button', ['invoice' => $invoice])
|
|
@endif
|
|
|
|
{{-- @include('frontend.service.partials.control-buttons.config-button') --}}
|
|
@include('frontend.service.partials.control-buttons.reinstall-button')
|
|
|
|
@if ($isPoweredOn)
|
|
@include('frontend.service.partials.control-buttons.snapshot-button')
|
|
@include('frontend.service.partials.control-buttons.reset-password-button')
|
|
@include('frontend.service.partials.control-buttons.change-ip-button')
|
|
@endif
|
|
</div>
|
|
|
|
{{-- Notes Section --}}
|
|
@include('frontend.service.partials.control-notes')
|
|
@livewire('v-p-s-reinstall-modal', [
|
|
'productId' => $invoice->invoiceItem->first()?->getProductAttribute()?->id,
|
|
'invoiceId' => $invoice->id,
|
|
])
|
|
@if ($isPoweredOn)
|
|
@include('frontend.service.partials.snapshots-modal', ['invoice' => $invoice])
|
|
@include('frontend.service.partials.reset-password-modal', [
|
|
'invoice' => $invoice,
|
|
'isWindows' => $isWindows,
|
|
])
|
|
@include('frontend.service.partials.change-ip-modal', ['invoice' => $invoice])
|
|
@include('frontend.service.partials.change-remote-port-modal', ['invoice' => $invoice])
|
|
@include('frontend.service.partials.renewal-modal', ['invoice' => $invoice])
|
|
@endif
|
|
</div>
|
|
</div>
|