1
0
mirror of https://github.com/cp6/my-idlers.git synced 2024-11-18 00:13:12 +01:00
my-idlers/resources/views/ips/index.blade.php

87 lines
3.6 KiB
PHP
Raw Normal View History

2022-02-21 01:29:54 +01:00
@section('title') {{'IP Addresses'}} @endsection
2022-02-21 04:47:13 +01:00
@section('css_links')
<link rel="stylesheet" href="{{ asset('css/datatables.bootstrap.min.css') }}">
@endsection
@section('style')
<x-modal-style></x-modal-style>
@endsection
2022-02-21 01:29:54 +01:00
@section('scripts')
<script src="{{ asset('js/vue.min.js') }}"></script>
<script src="{{ asset('js/axios.min.js') }}"></script>
@endsection
<x-app-layout>
<x-slot name="header">
2022-02-21 01:29:54 +01:00
{{ __('IP Addresses') }}
</x-slot>
<div class="container" id="app">
<x-delete-confirm-modal></x-delete-confirm-modal>
<x-card class="shadow mt-3">
<a href="{{ route('IPs.create') }}" class="btn btn-primary mb-3">Add IP</a>
<x-success-alert></x-success-alert>
<div class="table-responsive">
2022-02-21 04:47:13 +01:00
<table class="table table-bordered" id="ips-table">
<thead class="table-light">
<tr>
<th class="text-nowrap">Type</th>
<th class="text-nowrap">Address</th>
<th class="text-nowrap">Actions</th>
</tr>
</thead>
<tbody>
2022-02-21 04:47:13 +01:00
@if(!empty($ips))
@foreach($ips as $ip)
<tr>
2022-02-21 04:47:13 +01:00
<td class="text-nowrap">@if ($ip->is_ipv4 === 1)
IPv4
@else
IPv6
@endif</td>
<td class="text-nowrap">{{ $ip->address}}</td>
<td class="text-nowrap">
2022-02-21 04:47:13 +01:00
<form action="{{ route('IPs.destroy', $ip->id) }}" method="POST">
@csrf
@method('DELETE')
<i class="fas fa-trash text-danger ms-3" @click="modalForm"
2022-02-21 04:47:13 +01:00
id="btn-{{$ip->hostname}}" title="{{$ip->id}}"></i>
</form>
</td>
</tr>
@endforeach
@else
<tr>
<td class="px-4 py-2 border text-red-500" colspan="3">No IPs found.</td>
</tr>
@endif
</tbody>
</table>
</div>
</x-card>
@if(Session::has('timer_version_footer') && Session::get('timer_version_footer') === 1)
<p class="text-muted mt-4 text-end"><small>
Built on Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }}
)</small>
</p>
@endif
</div>
2022-02-21 04:47:13 +01:00
<x-datatables-assets></x-datatables-assets>
<script type="text/javascript">
$(document).ready(function () {
$('#ips-table').DataTable({
"pageLength": 15,
"lengthMenu": [5, 10, 15, 25, 30, 50, 75, 100],
"columnDefs": [
{"orderable": false, "targets": 1}
],
"initComplete": function () {
$('.dataTables_length,.dataTables_filter').addClass('mb-2');
$('.dataTables_paginate').addClass('mt-2');
$('.dataTables_info').addClass('mt-2 text-muted ');
}
});
});
</script>
<x-modal-delete-script>
2022-02-21 04:47:13 +01:00
<x-slot name="uri">IPs</x-slot>
</x-modal-delete-script>
</x-app-layout>