update optimize code
This commit is contained in:
@@ -2,9 +2,15 @@
|
||||
@php
|
||||
$serverName = $invoice->invoiceItem->first()->server_name ?? 'Cloud VPS';
|
||||
$vmStatus = $vmInfo['status'] ?? null;
|
||||
$statusBg = match ($vmStatus) {
|
||||
'POWERED_ON' => 'bg-green-600',
|
||||
'POWERED_OFF' => 'bg-red-600',
|
||||
default => 'bg-gray-600',
|
||||
};
|
||||
@endphp
|
||||
|
||||
<div class="bg-gray-100 rounded-lg shadow-lg p-8 flex flex-col items-center justify-center">
|
||||
<div class="bg-gray-100 rounded-xl shadow-lg p-8 flex flex-col items-center justify-center relative">
|
||||
<span class="text-sm text-gray-600">{{ $invoice->invoiceItem->first()?->getProductAttribute()?->name }}</span>
|
||||
<div class="bg-white rounded-lg p-6 mb-4 shadow-md">
|
||||
<svg class="w-16 h-16 text-gray-700" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"
|
||||
@@ -18,12 +24,19 @@
|
||||
{{ $serverName }}
|
||||
</p>
|
||||
<div class="mt-4">
|
||||
@if ($vmStatus == 'POWERED_ON')
|
||||
<span class="bg-green-500 text-white px-4 py-2 rounded-full text-sm font-medium">{{ __('RUNNING') }}</span>
|
||||
@elseif($vmStatus == 'POWERED_OFF')
|
||||
<span class="bg-red-500 text-white px-4 py-2 rounded-full text-sm font-medium">{{ __('STOPPED') }}</span>
|
||||
@else
|
||||
<span class="bg-gray-500 text-white px-4 py-2 rounded-full text-sm font-medium">{{ __('UNKNOWN') }}</span>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="h-10 w-full rounded-b-lg absolute bottom-0 left-0 flex items-center justify-center {{ $statusBg }}">
|
||||
<span class="text-center text-white">
|
||||
@if ($vmStatus == 'POWERED_ON')
|
||||
{{ __('RUNNING') }}
|
||||
@elseif($vmStatus == 'POWERED_OFF')
|
||||
{{ __('STOPPED') }}
|
||||
@else
|
||||
{{ __('UNKNOWN') }}
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user