update change port
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
$isWindows = Str::contains(Str::lower($vmInfo['os'] ?? ''), 'windows') ||
|
||||
Str::contains(Str::lower($invoice->invoiceItem->first()->os->osGroup->name ?? ''), 'windows');
|
||||
$vmIp = $vmInfo['ip_address'] ?? '103.42.56.177';
|
||||
$vmPort = $isWindows ? '3389' : '22';
|
||||
$vmPort = $invoice->order->vmWare->first()->port ?? '3389';
|
||||
$vmUser = $isWindows ? 'administrator' : 'root';
|
||||
$osName = $invoice->invoiceItem->first()->os->osGroup->name ?? 'Unknown';
|
||||
$osVersion = $invoice->invoiceItem->first()->os->version ?? '';
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
{{-- Transaction Info Partial - Optimized with date helpers --}}
|
||||
@php
|
||||
$registrationDate = $invoice->date ? \Carbon\Carbon::parse($invoice->date)->format('d/m/Y') : 'N/A';
|
||||
$dueDate = $invoice->due_date ? \Carbon\Carbon::parse($invoice->due_date)->format('d/m/Y') : 'N/A';
|
||||
// Keep Carbon instances for calculations and formatted strings for display
|
||||
$registrationCarbon = $invoice->date ? \Carbon\Carbon::parse($invoice->date) : null;
|
||||
$dueCarbon = $invoice->due_date ? \Carbon\Carbon::parse($invoice->due_date) : null;
|
||||
|
||||
$registrationDate = $registrationCarbon ? $registrationCarbon->format('d/m/Y') : 'N/A';
|
||||
$dueDate = $dueCarbon ? $dueCarbon->format('d/m/Y') : 'N/A';
|
||||
|
||||
$totalAmount = number_format($invoice->total ?? 0, 0, ',', '.');
|
||||
$isExpired = $invoice->status == 1;
|
||||
|
||||
// Precompute days remaining (use 'N/A' when dates are missing)
|
||||
$daysRemaining = $dueCarbon && $registrationCarbon ? $dueCarbon->diffInDays($registrationCarbon) : 'N/A';
|
||||
@endphp
|
||||
|
||||
<div class="bg-white rounded-lg shadow-lg p-6">
|
||||
@@ -47,10 +55,16 @@
|
||||
<span class="text-sm">{{ $dueDate }}</span>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="text-gray-600 font-medium">{{ __('Số ngày còn lại') }}</span>
|
||||
<span class="bg-green-100 text-green-800 px-2 py-1 rounded text-xs">{{ $daysRemaining }} Ngày</span>
|
||||
</div>
|
||||
|
||||
|
||||
{{-- Auto Renewal Status --}}
|
||||
<div class="flex justify-between items-center">
|
||||
<span class="text-gray-600 font-medium">{{ __('Trạng thái gia hạn tự động') }}</span>
|
||||
<span class="bg-red-100 text-red-800 px-2 py-1 rounded text-xs">OFF</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user