update datatable

This commit is contained in:
pbao9
2026-01-30 13:56:32 +07:00
parent 9802839056
commit cfe38232c3
10 changed files with 292 additions and 215 deletions
@@ -1,76 +1,24 @@
@php use App\Http\Helpers\Helper; @endphp
@extends('admin.main')
@extends('administrator.layout.master')
@push('plugin-styles')
<link href="{{ asset('build/plugins/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
@if(auth()->guard('admins')->user()->can("manager package module"))
<div class="card card-primary card-outline">
<div class="card-header">
@include("admin.block.Sync.Datacenter")
</div>
<div class="card-body">
<table class="table table-invoice table-bordered">
<thead>
<tr>
<th class="text-center">
<label>
<input type="checkbox" name="check" class="check-all">
</label>
</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($datacenter->count())
@foreach($datacenter->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->vCenter->host)
{{ $item->vCenter->host }}
@endisset
</td>
<td class="text-center">
@time($item->created_at)
</td>
<td>
<a class="btn btn-warning btn-sm"
href="{{ route('package.datacenter.edit', ['id' => $item->id]) }}">
<i class="fas fa-user-edit"></i>
</a>
</td>
<td>
@if(auth()->guard('admins')->user()->can("delete module vcenter"))
<form method="post" class="d-inline"
action="{{ route('package.datacenter.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 class="card-body p-5">
<x-datatable id="datacenterTable" ajax="{{ route('package.datacenter.datatable') }}" :columns="[
['key' => 'id', 'label' => 'ID'],
['key' => 'name', 'label' => 'Name'],
['key' => 'v_center.host', 'label' => 'vCenter Host'],
['key' => 'action', 'label' => 'Action']
]" />
</div>
<div class="card-footer">
{{-- {{ $datacenter->withQueryString()->links() }}--}}
</div>
</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 Package
@@ -78,3 +26,13 @@
</div>
@endif
@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
@push('custom-scripts')
@endpush