Files
portal-api/resources/views/administrator/pages/package/vm/edit.blade.php
T

100 lines
4.9 KiB
PHP

@extends("administrator.layout.master")
@section('breadcrumb')
@php
$breadcrumbItems = [
['label' => 'Modules'],
['label' => 'Package vCenter'],
['label' => 'Virtual Machine', 'route' => 'package.vm.index'],
['label' => $vm->name ?? $vm->vm_id ?? 'Edit', 'active' => true],
];
@endphp
<x-admin-breadcrumb :items="$breadcrumbItems" />
@endsection
@section("content")
@if(auth()->guard('admins')->user()->can("add module vcenter"))
<div class="card card-outline card-primary">
<form action="{{ route('package.vm.update',['id' => $vm->id]) }}" method="post">
@csrf
@method('put')
<div class="card-body">
{{--Name--}}
<div class="row form-group align-items-center mb-0">
<label for="name" class="col-md-3 text-right">Name</label>
<div class="col-md-9 p-1 bg-customer">
<input type="text" id="name" name="name" placeholder="" value="{{ $vm->name}}" class="form-control">
</div>
</div>
{{--VM ID--}}
<div class="row form-group align-items-center mb-0">
<label for="vm_id" class="col-md-3 text-right">VM ID</label>
<div class="col-md-9 p-1 bg-customer">
<input type="text" id="vm_id" name="vm_id" placeholder="" value="{{ $vm->vm_id}}" class="form-control">
</div>
</div>
{{--Power State--}}
<div class="row form-group align-items-center mb-0">
<label for="power_state" class="col-md-3 text-right">Power State</label>
<div class="col-md-9 p-1 bg-customer">
@if($vm->power_state == 'POWERED_ON')
<span class="badge bg-success">Đang bật</span>
@elseif($vm->power_state == 'POWERED_OFF')
<span class="badge bg-secondary">Đang tắt</span>
@else
{{ $vm->power_state }}
@endif
</div>
</div>
{{--CPU--}}
<div class="row form-group align-items-center mb-0">
<label for="cpu" class="col-md-3 text-right">CPU</label>
<div class="col-md-9 p-1 bg-customer">
<input type="text" id="cpu" name="cpu" placeholder="" value="{{ $vm->cpu}}" class="form-control">
</div>
</div>
{{--RAM (MB)--}}
<div class="row form-group align-items-center mb-0">
<label for="ram_mb" class="col-md-3 text-right">RAM (MB)</label>
<div class="col-md-9 p-1 bg-customer">
<input type="text" id="ram_mb" name="ram_mb" placeholder="" value="{{ $vm->ram_mb}}" class="form-control">
</div>
</div>
{{--Datacenter--}}
<div class="row form-group align-items-center mb-0">
<label for="datacenter_id" class="col-md-3 text-right">Datacenter</label>
<div class="col-md-9 p-1 bg-customer">
<input type="text" id="datacenter_id" name="datacenter_id" placeholder="" value="{{ $vm->datacenter_id}}" class="form-control">
</div>
</div>
{{--Host--}}
<div class="row form-group align-items-center mb-0">
<label for="host_id" class="col-md-3 text-right">Host</label>
<div class="col-md-9 p-1 bg-customer">
<input type="text" id="host_id" name="host_id" placeholder="" value="{{ $vm->host_id}}" class="form-control">
</div>
</div>
</div>
<div class="card-footer">
<a href="{{ route('package.vm.index') }}" class="btn btn-secondary">Back</a>
<button type="submit" class="btn btn-primary">Save</button>
@if($vm->vm_id && $vm->power_state == 'POWERED_ON')
<a href="{{ route('admin.vm.console', ['vm_id' => $vm->vm_id]) }}" target="_blank" class="btn btn-info">
<i class="fas fa-terminal"></i> Console
</a>
@elseif($vm->vm_id)
<span class="btn btn-secondary disabled">
<i class="fas fa-terminal"></i> Console (Off)
</span>
@endif
</div>
</form>
</div>
@else
<div class="alert alert-danger alert-dismissible">
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Module vCenter
management department</h5>
</div>
@endif
@endsection