437 lines
21 KiB
PHP
437 lines
21 KiB
PHP
<div class="box clients-summary__box p-4">
|
|
<div class="row form-group">
|
|
<table class="form" width="100%" border="0" cellspacing="2" cellpadding="3">
|
|
<tbody>
|
|
<tr>
|
|
<td class="fieldlabel">Order #</td>
|
|
<td class="fieldarea">
|
|
<strong>{{ $product->order->id }}</strong> -
|
|
<a href="{{ route('admin.order.edit', ['id' => $product->order->id]) }}">View Order</a>
|
|
</td>
|
|
<td class="fieldlabel">Registration Date</td>
|
|
<td class="fieldarea">
|
|
@isset($product->order->date)
|
|
@time($product->order->date)
|
|
@endisset
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fieldlabel">Product/Service</td>
|
|
<td class="fieldarea">
|
|
@isset($productName->name)
|
|
{{ $productName->name }}
|
|
@endisset
|
|
</td>
|
|
<td class="fieldlabel">Quantity</td>
|
|
<td class="fieldarea"><strong>1</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fieldlabel">Server</td>
|
|
<td class="fieldarea">
|
|
@isset($product->ipaddress->host->datacenter->vCenter->host)
|
|
{{ $product->ipaddress->host->datacenter->vCenter->host }}
|
|
@endisset
|
|
</td>
|
|
<td class="fieldlabel">First Payment Amount</td>
|
|
<td class="fieldarea">
|
|
<input type="number" class="form-control" readonly name="first_payment"
|
|
value="{{ $product->first_payment }}" id="">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fieldlabel">IP Address</td>
|
|
<td class="fieldarea">
|
|
@isset($product->ipaddress->ip)
|
|
{{ $product->ipaddress->ip }}
|
|
@endisset
|
|
</td>
|
|
<td class="fieldlabel">Recurring Amount</td>
|
|
<td class="fieldarea">
|
|
<input type="number" class="form-control" name="next_payment_input"
|
|
value="{{ $product->next_payment }}" id="">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="fieldlabel">Billing Cycle</td>
|
|
<td class="fieldarea">
|
|
{{-- {{ Helpers::BillingCycle($product->getInvoiceItem()->billing) }} --}}
|
|
{!! $invoice_item ? $invoice_item->getBilling() : 'N/A' !!}
|
|
</td>
|
|
<td class="fieldlabel">Next Due Date</td>
|
|
<td class="fieldarea">
|
|
<input type="text" name="next_due_date_input" id="next_due_date"
|
|
class="form-control datetime-picker" placeholder="dd/mm/yy" value="@time($product->next_due_date_input)">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fieldlabel">Payment Method</td>
|
|
<td class="fieldarea">
|
|
@isset($product->order->payment->name)
|
|
{{ $product->order->payment->name }}
|
|
@endisset
|
|
</td>
|
|
<td class="fieldlabel">Status</td>
|
|
<td class="fieldarea">
|
|
<select name="select_status" class="form-control">
|
|
<option value="1" @selected($product->status == 1)>Active</option>
|
|
<option value="2" @selected($product->status == 2)>Suspend</option>
|
|
<option value="3" @selected($product->status == 3)>Pending</option>
|
|
<option value="0" @selected($product->status == 0)>Power Off</option>
|
|
<option value="4" @selected($product->status == 4)>Expiry</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fieldlabel">Username</td>
|
|
<td class="fieldarea">
|
|
<input type="text" class="form-control" readonly name="username"
|
|
value="{{ $product->user }}">
|
|
</td>
|
|
<td class="fieldlabel">Password</td>
|
|
<td class="fieldarea">
|
|
<input type="text" class="form-control" readonly name="password"
|
|
value="{{ $product->password ? SignRSA::DecryptFunc($product->password) : '' }}">
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- VM Information Section -->
|
|
<div class="card mt-4">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Thông tin máy ảo</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<table class="table table-sm table-borderless">
|
|
<tr>
|
|
<td width="30%" class="text-muted">VM ID:</td>
|
|
<td><code>{{ $product->vmware_id ?? 'N/A' }}</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="text-muted">Tên VM:</td>
|
|
<td>{{ $product->name ?? 'Chưa đặt tên' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="text-muted">Trạng thái:</td>
|
|
<td>
|
|
@if ($product->status == 1)
|
|
<span class="badge badge-success">Đang chạy</span>
|
|
@elseif($product->status == 2)
|
|
<span class="badge badge-warning">Tạm dừng</span>
|
|
@elseif($product->status == 3)
|
|
<span class="badge badge-info">Đang khởi tạo</span>
|
|
@elseif($product->status == 0)
|
|
<span class="badge badge-danger">Đã dừng</span>
|
|
@elseif($product->status == 4)
|
|
<span class="badge badge-secondary">Hết hạn</span>
|
|
@else
|
|
<span class="badge badge-secondary">Không xác định</span>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="text-muted">Hostname:</td>
|
|
<td>{{ $product->hostname ?? 'N/A' }}</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<table class="table table-sm table-borderless">
|
|
<tr>
|
|
<td width="30%" class="text-muted">IP Address:</td>
|
|
<td><code>{{ $product->ipaddress->ip ?? 'N/A' }}</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="text-muted">Username:</td>
|
|
<td>{{ $product->user ?? 'N/A' }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="text-muted">Hệ điều hành:</td>
|
|
<td>
|
|
@if (isset($product->os) && isset($product->os->osGroup))
|
|
{{ $product->os->osGroup->name ?? 'Unknown' }} {{ $product->os->version ?? '' }}
|
|
@else
|
|
N/A
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="text-muted">vCenter:</td>
|
|
<td>
|
|
@if (isset($product->ipaddress) &&
|
|
isset($product->ipaddress->host) &&
|
|
isset($product->ipaddress->host->datacenter) &&
|
|
isset($product->ipaddress->host->datacenter->vCenter))
|
|
{{ $product->ipaddress->host->datacenter->vCenter->host ?? 'N/A' }}
|
|
@else
|
|
N/A
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Windows Login Info -->
|
|
@if (isset($product->os) && isset($product->os->osGroup) && $product->os->osGroup->name == 'Windows')
|
|
<div class="alert alert-info mt-3">
|
|
<h6><i class="fas fa-info-circle"></i> Thông tin đăng nhập Windows</h6>
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<strong>Username:</strong> <code>administrator</code>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<strong>Password:</strong> <code>TGS@123</code>
|
|
<button type="button" onclick="navigator.clipboard.writeText('TGS@123')"
|
|
class="btn btn-sm btn-outline-primary ml-2">Copy</button>
|
|
</div>
|
|
</div>
|
|
<small class="text-muted">* Đổi mật khẩu sau khi đăng nhập lần đầu để bảo mật tốt hơn.</small>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<!-- VM Control Section -->
|
|
<div class="card mt-4">
|
|
<div class="card-header">
|
|
<h5 class="mb-0">Điều khiển VM</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<!-- Power On -->
|
|
<div class="col-md-3 col-sm-6 mb-2">
|
|
<button type="button" id="startVMButton" class="btn btn-success btn-block">
|
|
<i class="fas fa-play"></i> Khởi động
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Power Off -->
|
|
<div class="col-md-3 col-sm-6 mb-2">
|
|
<button type="button" id="stopVMButton" class="btn btn-danger btn-block">
|
|
<i class="fas fa-stop"></i> Tắt máy
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Shutdown Guest -->
|
|
<div class="col-md-3 col-sm-6 mb-2">
|
|
<button type="button" id="shutdownVMButton" class="btn btn-warning btn-block">
|
|
<i class="fas fa-power-off"></i> Shutdown
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Suspend -->
|
|
<div class="col-md-3 col-sm-6 mb-2">
|
|
<button type="button" id="suspendVMButton" class="btn btn-secondary btn-block"
|
|
{{ $product->status === 2 ? 'disabled' : '' }}>
|
|
<i class="fas fa-pause"></i> Tạm dừng
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Restart -->
|
|
<div class="col-md-3 col-sm-6 mb-2">
|
|
<button type="button" id="restartVMButton" class="btn btn-info btn-block">
|
|
<i class="fas fa-redo"></i> Khởi động lại
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Console -->
|
|
<div class="col-md-3 col-sm-6 mb-2">
|
|
<a href="{{ route('task.console', ['product' => $product->id, 'vmware-id' => $product->vmware_id]) }}"
|
|
target="_blank" class="btn btn-dark btn-block">
|
|
<i class="fas fa-terminal"></i> Console
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Reinstall -->
|
|
<div class="col-md-3 col-sm-6 mb-2">
|
|
<button type="button" data-toggle="modal" data-target="#modal-lg"
|
|
class="btn btn-outline-secondary btn-block" data-ajax="{{ route('task.reinstall') }}">
|
|
<i class="fas fa-download"></i> Cài lại
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Status Info -->
|
|
<div class="mt-3 p-3 bg-light">
|
|
<h6 class="mb-2">Thông tin chi tiết:</h6>
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<small class="text-muted">Trạng thái VM:</small>
|
|
@if ($product->status == 1)
|
|
<span class="badge badge-success ml-1">Đang chạy</span>
|
|
@elseif($product->status == 2)
|
|
<span class="badge badge-warning ml-1">Tạm dừng</span>
|
|
@elseif($product->status == 3)
|
|
<span class="badge badge-info ml-1">Đang khởi tạo</span>
|
|
@elseif($product->status == 0)
|
|
<span class="badge badge-danger ml-1">Đã dừng</span>
|
|
@elseif($product->status == 4)
|
|
<span class="badge badge-secondary ml-1">Hết hạn</span>
|
|
@endif
|
|
</div>
|
|
<div class="col-md-6">
|
|
<small class="text-muted">VM ID:</small> <code>{{ $product->vmware_id ?? 'N/A' }}</code>
|
|
</div>
|
|
</div>
|
|
<div class="row mt-1">
|
|
<div class="col-md-6">
|
|
<small class="text-muted">IP Address:</small>
|
|
<code>{{ $product->ipaddress->ip ?? 'N/A' }}</code>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<small class="text-muted">Ngày tạo:</small>
|
|
{{ $product->order->date ? \Carbon\Carbon::parse($product->order->date)->format('d/m/Y H:i') : 'N/A' }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Notes -->
|
|
<div class="alert alert-light mt-3 mb-0">
|
|
<small>
|
|
<strong>Lưu ý:</strong><br>
|
|
• Các thao tác có thể mất vài giây để hoàn thành<br>
|
|
• VM sẽ được khởi động lại sau khi thay đổi cấu hình<br>
|
|
• Vui lòng đợi thao tác hoàn thành trước khi thực hiện tiếp<br>
|
|
• Console sẽ mở trong tab mới
|
|
</small>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<form action="{{ route('customer.product.update') }}" method="post">
|
|
<div class="box bg-white rounded p-3">
|
|
@csrf
|
|
@method('put')
|
|
|
|
<input type="hidden" name="next_due_date"
|
|
value="{{ (session('next_due_date') ? \Carbon\Carbon::parse(session('next_due_date'))->format('d/m/Y') : null) ?? ($product->next_due_date ? \Carbon\Carbon::parse($product->next_due_date)->format('d/m/Y') : null) }}">
|
|
<input type="hidden" name="next_payment"
|
|
value="{{ session('next_payment') ?? $product->next_payment }}">
|
|
<input type="hidden" name="product_id" value="{{ session('product_id') ?? $product->id }}">
|
|
<input type="hidden" name="product_type" value="4">
|
|
<input type="hidden" name="status" value="{{ session('status') ?? $product->status }}">
|
|
|
|
{{-- Vmware Name --}}
|
|
<div class="row form-group align-items-center mb-0">
|
|
<label for="name" class="col-md-3 text-right">VM Name</label>
|
|
<div class="col-md-9 p-1 bg-customer">
|
|
<input type="text" name="name" class="form-control" id="name"
|
|
value="{{ session('name') ?? $product->name }}">
|
|
</div>
|
|
</div>
|
|
{{-- Vmware Hostname --}}
|
|
<div class="row form-group align-items-center mb-0">
|
|
<label for="hostname" class="col-md-3 text-right">VM Hostname</label>
|
|
<div class="col-md-9 p-1 bg-customer">
|
|
<input type="text" name="hostname" class="form-control" id="hostname"
|
|
value="{{ session('hostname') ?? $product->hostname }}">
|
|
</div>
|
|
</div>
|
|
{{-- Vmware Port --}}
|
|
<div class="row form-group align-items-center mb-0">
|
|
<label for="port" class="col-md-3 text-right">VM Port</label>
|
|
<div class="col-md-9 p-1 bg-customer">
|
|
<input type="text" name="port" class="form-control" id="port"
|
|
value="{{ session('port') ?? $product->port }}">
|
|
</div>
|
|
</div>
|
|
{{-- Username --}}
|
|
<div class="row form-group align-items-center mb-0">
|
|
<label for="user" class="col-md-3 text-right">Username</label>
|
|
<div class="col-md-9 p-1 bg-customer">
|
|
<input type="text" name="user" class="form-control" id="user"
|
|
value="{{ session('user') ?? $product->user }}">
|
|
</div>
|
|
</div>
|
|
{{-- Password --}}
|
|
<div class="row form-group align-items-center mb-0">
|
|
<label for="password" class="col-md-3 text-right">Password</label>
|
|
<div class="col-md-9 p-1 bg-customer">
|
|
<input type="text" name="password" class="form-control" id="password"
|
|
value="{{ session('password') ?? ($product->password ? SignRSA::DecryptFunc($product->password) : '') }}">
|
|
</div>
|
|
</div>
|
|
|
|
{{-- vmware_id --}}
|
|
<div class="row form-group align-items-center mb-0">
|
|
<label for="vmware_id" class="col-md-3 text-right">VirtualMachine ID</label>
|
|
<div class="col-md-9 p-1 bg-customer">
|
|
<input type="text" name="vmware_id" class="form-control" id="vmware_id"
|
|
value="{{ session('vmware_id') ?? $product->vmware_id }}">
|
|
</div>
|
|
</div>
|
|
|
|
{{-- vCenter --}}
|
|
<x-module.v-center :model="$product" />
|
|
|
|
{{-- Datacenter --}}
|
|
<x-module.datacenter :model="$product" />
|
|
|
|
{{-- Host --}}
|
|
<x-module.host :model="$product" />
|
|
|
|
{{-- Network --}}
|
|
<x-module.network :model="$product" />
|
|
|
|
{{-- IP Address --}}
|
|
<x-module.ip-address :model="$product" />
|
|
|
|
{{-- OS Group --}}
|
|
<x-module.os :model="$product" />
|
|
|
|
{{-- OS Version --}}
|
|
<x-module.os-version :model="$product" />
|
|
</div>
|
|
<div class="card-footer text-center">
|
|
<button type="submit" class="btn bg-gradient-success">
|
|
<i class="far fa-check-circle"></i>
|
|
Save
|
|
</button>
|
|
<a href="{{ route('customer.index') }}" class="btn bg-gradient-secondary">Cancel
|
|
</a>
|
|
</div>
|
|
</form>
|
|
<div class="modal fade" id="modal-lg">
|
|
<div class="modal-dialog modal-lg">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">Configuration for create VPS</h4>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<form action="{{ route('task.manager') }}" method="post">
|
|
@csrf
|
|
<div class="modal-body">
|
|
<input type="hidden" name="type" value="{{ $type }}">
|
|
<input type="hidden" name="product" value="{{ $product->id }}">
|
|
<input type="hidden" name="userid" value="{{ $userid }}">
|
|
<input type="hidden" class="form-action" name="action" value="create">
|
|
|
|
<x-module.v-center :model="null" />
|
|
<x-module.datacenter :model="null" />
|
|
<x-module.host :model="null" />
|
|
<x-module.network :model="null" />
|
|
<x-module.os :model="null" />
|
|
{{-- <x-module.os-version :model="null" /> --}}
|
|
</div>
|
|
<div class="modal-footer justify-content-between">
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
|
|
<button type="submit" class="btn btn-primary">Save changes</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<!-- /.modal-content -->
|
|
</div>
|
|
<!-- /.modal-dialog -->
|
|
</div>
|
|
@include('admin.customer.action.addon')
|
|
</div>
|
|
|
|
@include('admin.customer.form.scripts.vps')
|