update network moudle

This commit is contained in:
pbao9
2026-01-31 10:25:21 +07:00
parent 745e7f71ec
commit 4b5e22c9d2
11 changed files with 277 additions and 179 deletions
@@ -1,75 +1,30 @@
@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('breadcrumb')
@php
$breadcrumbItems = [
['label' => 'Modules'],
['label' => 'Package vCenter'],
['label' => 'Datacenter', 'active' => true],
];
@endphp
<x-breabcrumb :items="$breadcrumbItems" />
@endsection
@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.Network")
@include("administrator.pages.block.Sync.Network")
</div>
<div class="card-body">
<table class="table table-invoice table-bordered">
<thead>
<tr>
<th>
<label>
<input type="checkbox" name="check" class="check-all">
</label>
</th>
<th>Network Name</th>
<th>Host Name</th>
<th>vCenter Host</th>
<th style="width:40px"></th>
<th style="width: 40px"></th>
</tr>
</thead>
<tbody>
@if(count($networks))
@foreach($networks->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->host->name)
{{$item->host->name}}
@endisset
</td>
<td class="text-center">
@isset($item->host->datacenter->vCenter->host)
{{$item->host->datacenter->vCenter->host}}
@endisset
</td>
<td class="text-center">
<a class="btn btn-warning btn-sm"
href="{{ route('package.network.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.network.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">
{{ $networks->withQueryString()->links() }}
<x-datatable id="networkTable" ajax="{{ route('package.network.datatable') }}" :columns="[
['key' => 'name', 'label' => 'Name'],
['key' => 'host.datacenter.v_center.host', 'label' => 'Vcenter Host'],
['key' => 'action', 'label' => 'Action']
]" />
</div>
</div>
@else
@@ -79,3 +34,10 @@
</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