update host
This commit is contained in:
@@ -27,7 +27,7 @@ class Host extends Controller
|
|||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$title = 'List all Host';
|
$title = 'List all Host';
|
||||||
return view("admin.package.host.index", compact('title'));
|
return view("administrator.pages.package.host.index", compact('title'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function datatable(Request $request)
|
public function datatable(Request $request)
|
||||||
@@ -44,6 +44,9 @@ class Host extends Controller
|
|||||||
->editColumn('updated_at', function ($d) {
|
->editColumn('updated_at', function ($d) {
|
||||||
return $d->updated_at ? $d->updated_at->format('d/m/Y') : '';
|
return $d->updated_at ? $d->updated_at->format('d/m/Y') : '';
|
||||||
})
|
})
|
||||||
|
->editColumn('datacenter.name', function ($d) {
|
||||||
|
return $d->datacenter->name . ' - ' . $d->datacenter->datacenter_id;
|
||||||
|
})
|
||||||
->addColumn('action', function ($d) {
|
->addColumn('action', function ($d) {
|
||||||
$editUrl = route('package.host.edit', ['id' => $d->id]);
|
$editUrl = route('package.host.edit', ['id' => $d->id]);
|
||||||
$deleteBtn = '';
|
$deleteBtn = '';
|
||||||
@@ -92,7 +95,7 @@ HTML;
|
|||||||
{
|
{
|
||||||
$title = 'Add host';
|
$title = 'Add host';
|
||||||
|
|
||||||
return view('admin.package.host.add', compact('title'));
|
return view('administrator.pages.package.host.add', compact('title'));
|
||||||
}
|
}
|
||||||
public function store(HostRequest $request)
|
public function store(HostRequest $request)
|
||||||
{
|
{
|
||||||
@@ -123,7 +126,7 @@ HTML;
|
|||||||
}
|
}
|
||||||
$title = "View Host Information";
|
$title = "View Host Information";
|
||||||
|
|
||||||
return view('admin.package.host.edit', compact('host', 'title'));
|
return view('administrator.pages.package.host.edit', compact('host', 'title'));
|
||||||
}
|
}
|
||||||
public function update(int $id = 0, HostRequest $request)
|
public function update(int $id = 0, HostRequest $request)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<a href="{{ route('package.host.create') }}" class="btn btn-outline-secondary"><i class="fas fa-plus-circle"></i> Add Host</a>
|
<a href="{{ route('package.host.create') }}" class="btn btn-outline-secondary"><i class="fas fa-plus-circle"></i> Add Host</a>
|
||||||
@include("admin.block.Sync.All")
|
@include("administrator.pages.block.Sync.All")
|
||||||
<a href="{{ route('package.host.sync') }}" class="btn btn-outline-secondary"><i class="fas fa-sync"></i> Sync Host</a>
|
<a href="{{ route('package.host.sync') }}" class="btn btn-outline-secondary"><i class="fas fa-sync"></i> Sync Host</a>
|
||||||
|
|||||||
@@ -1,6 +1,20 @@
|
|||||||
@extends("admin.main")
|
@extends('administrator.layout.master')
|
||||||
|
@push('plugin-styles')
|
||||||
|
<link href="{{ asset('build/plugins/select2/select2.min.css') }}" rel="stylesheet" />
|
||||||
|
@endpush
|
||||||
|
|
||||||
|
@section('breadcrumb')
|
||||||
|
@php
|
||||||
|
$breadcrumbItems = [
|
||||||
|
['label' => 'Modules'],
|
||||||
|
['label' => 'Package vCenter'],
|
||||||
|
['label' => 'Host', 'active' => true],
|
||||||
|
];
|
||||||
|
@endphp
|
||||||
|
<x-breabcrumb :items="$breadcrumbItems" />
|
||||||
|
@endsection
|
||||||
@section("content")
|
@section("content")
|
||||||
@if(auth()->guard('admins')->user()->can("add module vcenter"))
|
@if(auth()->guard('admins')->user()->can("add module vcenter"))
|
||||||
<div class="card card-outline card-primary">
|
<div class="card card-outline card-primary">
|
||||||
<form action="{{ route('package.host.store') }}" method="post">
|
<form action="{{ route('package.host.store') }}" method="post">
|
||||||
@csrf
|
@csrf
|
||||||
@@ -32,7 +46,8 @@
|
|||||||
<div class="row form-group align-items-center mb-0">
|
<div class="row form-group align-items-center mb-0">
|
||||||
<label for="console" class="col-md-3 text-right">Console Name</label>
|
<label for="console" class="col-md-3 text-right">Console Name</label>
|
||||||
<div class="col-md-9 p-1 bg-customer">
|
<div class="col-md-9 p-1 bg-customer">
|
||||||
<input type="text" id="console" name="console" placeholder="consolenode129.tgs.com.vn" value="" class="form-control">
|
<input type="text" id="console" name="console" placeholder="consolenode129.tgs.com.vn" value=""
|
||||||
|
class="form-control">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -42,10 +57,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
<div class="alert alert-danger alert-dismissible">
|
<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
|
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Module vCenter
|
||||||
management department</h5>
|
management department</h5>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@push('plugin-scripts')
|
||||||
|
<script src="{{ asset('build/plugins/jquery/jquery.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('build/plugins/select2/select2.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('build/plugins/datatables.net/dataTables.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('build/plugins/datatables.net-bs5/dataTables.bootstrap5.min.js') }}"></script>
|
||||||
|
@endpush
|
||||||
@@ -1,8 +1,22 @@
|
|||||||
@extends("admin.main")
|
@extends('administrator.layout.master')
|
||||||
|
@push('plugin-styles')
|
||||||
|
<link href="{{ asset('build/plugins/select2/select2.min.css') }}" rel="stylesheet" />
|
||||||
|
@endpush
|
||||||
|
|
||||||
|
@section('breadcrumb')
|
||||||
|
@php
|
||||||
|
$breadcrumbItems = [
|
||||||
|
['label' => 'Modules'],
|
||||||
|
['label' => 'Package vCenter'],
|
||||||
|
['label' => 'Host', 'active' => true],
|
||||||
|
];
|
||||||
|
@endphp
|
||||||
|
<x-breabcrumb :items="$breadcrumbItems" />
|
||||||
|
@endsection
|
||||||
@section("content")
|
@section("content")
|
||||||
@if(auth()->guard('admins')->user()->can("add module vcenter"))
|
@if(auth()->guard('admins')->user()->can("add module vcenter"))
|
||||||
<div class="card card-outline card-primary">
|
<div class="card card-outline card-primary">
|
||||||
<form action="{{ route('package.host.update',['id' => $host->id]) }}" method="post">
|
<form action="{{ route('package.host.update', ['id' => $host->id]) }}" method="post">
|
||||||
@csrf
|
@csrf
|
||||||
@method('put')
|
@method('put')
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@@ -13,28 +27,32 @@
|
|||||||
<div class="row form-group align-items-center mb-0">
|
<div class="row form-group align-items-center mb-0">
|
||||||
<label for="name" class="col-md-3 text-right">Name</label>
|
<label for="name" class="col-md-3 text-right">Name</label>
|
||||||
<div class="col-md-9 p-1 bg-customer">
|
<div class="col-md-9 p-1 bg-customer">
|
||||||
<input type="text" id="name" name="name" placeholder="" value="{{ $host->name}}" class="form-control">
|
<input type="text" id="name" name="name" placeholder="" value="{{ $host->name}}"
|
||||||
|
class="form-control">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{--Host ID--}}
|
{{--Host ID--}}
|
||||||
<div class="row form-group align-items-center mb-0">
|
<div class="row form-group align-items-center mb-0">
|
||||||
<label for="host_id" class="col-md-3 text-right">Host ID</label>
|
<label for="host_id" class="col-md-3 text-right">Host ID</label>
|
||||||
<div class="col-md-9 p-1 bg-customer">
|
<div class="col-md-9 p-1 bg-customer">
|
||||||
<input type="text" id="host_id" name="host_id" placeholder="" value="{{ $host->host_id}}" class="form-control">
|
<input type="text" id="host_id" name="host_id" placeholder="" value="{{ $host->host_id}}"
|
||||||
|
class="form-control">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{--Template ID--}}
|
{{--Template ID--}}
|
||||||
<div class="row form-group align-items-center mb-0">
|
<div class="row form-group align-items-center mb-0">
|
||||||
<label for="template" class="col-md-3 text-right">Template ID</label>
|
<label for="template" class="col-md-3 text-right">Template ID</label>
|
||||||
<div class="col-md-9 p-1 bg-customer">
|
<div class="col-md-9 p-1 bg-customer">
|
||||||
<input type="text" id="template" name="template" placeholder="" value="{{ $host->template}}" class="form-control">
|
<input type="text" id="template" name="template" placeholder="" value="{{ $host->template}}"
|
||||||
|
class="form-control">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{--Console ID--}}
|
{{--Console ID--}}
|
||||||
<div class="row form-group align-items-center mb-0">
|
<div class="row form-group align-items-center mb-0">
|
||||||
<label for="console" class="col-md-3 text-right">Console Name</label>
|
<label for="console" class="col-md-3 text-right">Console Name</label>
|
||||||
<div class="col-md-9 p-1 bg-customer">
|
<div class="col-md-9 p-1 bg-customer">
|
||||||
<input type="text" id="console" name="console" placeholder="consolenode129.tgs.com.vn" value="{{ $host->console}}" class="form-control">
|
<input type="text" id="console" name="console" placeholder="consolenode129.tgs.com.vn"
|
||||||
|
value="{{ $host->console}}" class="form-control">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -44,10 +62,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
<div class="alert alert-danger alert-dismissible">
|
<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
|
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Module vCenter
|
||||||
management department</h5>
|
management department</h5>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@endsection
|
@endsection
|
||||||
|
@push('plugin-scripts')
|
||||||
|
<script src="{{ asset('build/plugins/jquery/jquery.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('build/plugins/select2/select2.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('build/plugins/datatables.net/dataTables.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('build/plugins/datatables.net-bs5/dataTables.bootstrap5.min.js') }}"></script>
|
||||||
|
@endpush
|
||||||
@@ -1,79 +1,32 @@
|
|||||||
@php use App\Http\Helpers\Helper; @endphp
|
@extends('administrator.layout.master')
|
||||||
@extends('admin.main')
|
@push('plugin-styles')
|
||||||
|
<link href="{{ asset('build/plugins/select2/select2.min.css') }}" rel="stylesheet" />
|
||||||
|
@endpush
|
||||||
|
|
||||||
|
@section('breadcrumb')
|
||||||
|
@php
|
||||||
|
$breadcrumbItems = [
|
||||||
|
['label' => 'Modules'],
|
||||||
|
['label' => 'Package vCenter'],
|
||||||
|
['label' => 'Host', 'active' => true],
|
||||||
|
];
|
||||||
|
@endphp
|
||||||
|
<x-breabcrumb :items="$breadcrumbItems" />
|
||||||
|
@endsection
|
||||||
@section('content')
|
@section('content')
|
||||||
@if(auth()->guard('admins')->user()->can("manager package module"))
|
@if(auth()->guard('admins')->user()->can("manager package module"))
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
@include("admin.block.Sync.Host")
|
@include("administrator.pages.block.Sync.Host")
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<table class="table table-invoice table-bordered">
|
<x-datatable id="hostTable" ajax="{{ route('package.host.datatable') }}" :columns="[
|
||||||
<thead>
|
['key' => 'name', 'label' => 'Name'],
|
||||||
<tr>
|
['key' => 'host_id', 'label' => 'Host ID'],
|
||||||
<th class="text-center">
|
['key' => 'datacenter.name', 'label' => 'Datacenter'],
|
||||||
<label>
|
['key' => 'datacenter.v_center.host', 'label' => 'vCenter Host'],
|
||||||
<input type="checkbox" name="check" class="check-all">
|
['key' => 'action', 'label' => 'Action']
|
||||||
</label>
|
]" />
|
||||||
</th>
|
|
||||||
<th class="text-center">Host Name</th>
|
|
||||||
<th class="text-center">Datacenter Name</th>
|
|
||||||
<th class="text-center">vCenter Host</th>
|
|
||||||
<th class="text-center">Last Updated</th>
|
|
||||||
<th style="width: 40px"></th>
|
|
||||||
<th style="width: 40px"></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@if(count($hosts) > 0)
|
|
||||||
@foreach($hosts->all() as $item)
|
|
||||||
<tr>
|
|
||||||
<td class="text-center">
|
|
||||||
<label for=""></label><input type="checkbox" name="id[]" value="{{ $item->id }}"
|
|
||||||
id="">
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
{{ $item->name }}
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
@isset($item->datacenter->name)
|
|
||||||
{{$item->datacenter->name}}
|
|
||||||
@endisset
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
@isset($item->datacenter->vCenter->host)
|
|
||||||
{{$item->datacenter->vCenter->host}}
|
|
||||||
@endisset
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
@time($item->updated_at)
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
<a class="btn btn-warning btn-sm"
|
|
||||||
href="{{ route('package.host.edit', ['id' => $item->id]) }}">
|
|
||||||
<i class="fas fa-search"></i>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
@if(auth()->guard('admins')->user()->can("delete module vcenter"))
|
|
||||||
<form method="post" class="d-inline"
|
|
||||||
action="{{ route('package.host.destroy', ['id' => $item->id]) }}">
|
|
||||||
@method('delete')
|
|
||||||
@csrf
|
|
||||||
<button type="submit" data-toggle="tooltip" data-placement="top" title=""
|
|
||||||
class="btn btn-sm btn-danger" data-original-title="Xoá">
|
|
||||||
<i class="fas fa-trash"></i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
@endif
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<div class="card-footer">
|
|
||||||
{{ $hosts->withQueryString()->links() }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
@@ -83,3 +36,9 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@endsection
|
@endsection
|
||||||
|
@push('plugin-scripts')
|
||||||
|
<script src="{{ asset('build/plugins/jquery/jquery.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('build/plugins/select2/select2.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('build/plugins/datatables.net/dataTables.min.js') }}"></script>
|
||||||
|
<script src="{{ asset('build/plugins/datatables.net-bs5/dataTables.bootstrap5.min.js') }}"></script>
|
||||||
|
@endpush
|
||||||
Reference in New Issue
Block a user