bugs fix
This commit is contained in:
parent
2cee2f5f06
commit
897cb081d7
6 changed files with 32 additions and 22 deletions
|
|
@ -17,8 +17,8 @@ class NetworkController extends Controller
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
$networks = Network::all();
|
||||
return view('networks.index', compact('networks'));
|
||||
$networks = Network::paginate(20);
|
||||
return view('bo.pages.networks.index', compact('networks'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -28,7 +28,7 @@ class NetworkController extends Controller
|
|||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('networks.create');
|
||||
return view('bo.pages.networks.create');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -42,7 +42,7 @@ class NetworkController extends Controller
|
|||
$network = new Network();
|
||||
$network->fill($request->validated());
|
||||
if ($network->saveOrFail()) {
|
||||
return redirect()->route('networks.edit', compact('network'))
|
||||
return redirect()->route('bo.networks.edit', compact('network'))
|
||||
->with('success', trans('Network créé.'));
|
||||
}
|
||||
|
||||
|
|
@ -57,21 +57,21 @@ class NetworkController extends Controller
|
|||
*/
|
||||
public function edit(Network $network)
|
||||
{
|
||||
return view('networks.edit', ['network' => $network]);
|
||||
return view('bo.pages.networks.edit', ['network' => $network]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\Networks\UpdateNetwork $request
|
||||
* @param \App\Models\Network $network
|
||||
* @param \App\Models\Network $network
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(UpdateNetwork $request, Network $network)
|
||||
{
|
||||
$network->fill($request->validated());
|
||||
if ($network->saveOrFail()) {
|
||||
return redirect()->route('networks.edit', compact('network'))
|
||||
return redirect()->route('bo.networks.edit', compact('network'))
|
||||
->with('success', trans('Network mis à jour.'));
|
||||
}
|
||||
return \back();
|
||||
|
|
@ -85,14 +85,14 @@ class NetworkController extends Controller
|
|||
*/
|
||||
public function destroy(Network $network)
|
||||
{
|
||||
return view('networks.delete', ['network' => $network]);
|
||||
return view('bo.pages.networks.delete', ['network' => $network]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Http\Requests\ValidateOtpRequest $request
|
||||
* @param \App\Models\Network $network
|
||||
* @param \App\Models\Network $network
|
||||
* @return \Illuminate\Http\Response
|
||||
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
|
||||
*/
|
||||
|
|
@ -100,7 +100,7 @@ class NetworkController extends Controller
|
|||
{
|
||||
// phpcs:enable
|
||||
if ($network->deleteOrFail()) {
|
||||
return redirect()->route('networks.index')
|
||||
return redirect()->route('bo.networks.index')
|
||||
->with('warning', 'Network supprimé !');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class ApiCheckCredentialMiddleware
|
|||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, \Closure $next)
|
||||
public function handle(mixed $request, \Closure $next)
|
||||
{
|
||||
if ($request->header('Authorization') !== \config('api.key')) {
|
||||
return response('Unauthorized', 401);
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@
|
|||
<div class="card">
|
||||
<div class="card-header">
|
||||
Ajout d'une IP
|
||||
<a class="btn btn-sm btn-primary float-end" href="{{ route('networks.index') }}">{{ __('Retour') }}</a>
|
||||
<a class="btn btn-sm btn-primary float-end" href="{{ route('bo.networks.index') }}">{{ __('Retour') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form action="{{ route('networks.store') }}" method="POST">
|
||||
<form action="{{ route('bo.networks.store') }}" method="POST">
|
||||
@csrf
|
||||
@include('networks.form', ['no_ips' => true])
|
||||
@include('bo.pages.networks.form', ['no_ips' => true])
|
||||
<div class="row">
|
||||
<div class="col-md-12 mt-2 text-center">
|
||||
<button class="btn btn-primary" type="submit">{{ __('Enregistrer') }}</button>
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@
|
|||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Confirmation de suppression de l\'IP') }} <a class="btn btn-sm btn-primary float-end"
|
||||
href="{{ route('networks.edit', $network) }}">{{ __('Retour') }}</a></div>
|
||||
href="{{ route('bo.networks.edit', $network) }}">{{ __('Retour') }}</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="d-flex d-flex-row justify-content-center">
|
||||
@include('otp-delete', ['route' => route('networks.destroySubmit', $network)])
|
||||
@include('otp-delete', ['route' => route('bo.networks.destroySubmit', $network)])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
<div class="card">
|
||||
<div class="card-header">
|
||||
Détails de l'IP
|
||||
<a class="btn btn-sm btn-danger float-end" href="{{ route('networks.destroy', $network) }}">{{ __('Supprimer') }}</a>
|
||||
<a class="btn btn-sm btn-primary float-end me-2" href="{{ route('networks.index') }}">{{ __('Retour') }}</a>
|
||||
<a class="btn btn-sm btn-danger float-end" href="{{ route('bo.networks.destroy', $network) }}">{{ __('Supprimer') }}</a>
|
||||
<a class="btn btn-sm btn-primary float-end me-2" href="{{ route('bo.networks.index') }}">{{ __('Retour') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form action="{{ route('networks.update', $network) }}" method="POST">
|
||||
<form action="{{ route('bo.networks.update', $network) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('networks.form')
|
||||
@include('bo.pages.networks.form')
|
||||
<div class="row">
|
||||
<div class="col-md-12 mt-2 text-center">
|
||||
<button class="btn btn-primary" type="submit">{{ __('Enregistrer') }}</button>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Gestion des IP du réseau') }}<a class="btn btn-sm btn-primary float-end"
|
||||
href="{{ route('networks.create') }}">{{ __('Ajouter') }}</a></div>
|
||||
href="{{ route('bo.networks.create') }}">{{ __('Ajouter') }}</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
|
|
@ -14,6 +14,11 @@
|
|||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 col-md-6 p-0">
|
||||
{{ $networks->withQueryString()->onEachSide(1)->links() }}
|
||||
</div>
|
||||
</div>
|
||||
<table class="table text-center">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
|
|
@ -26,11 +31,16 @@
|
|||
<tr>
|
||||
<td>{{ $network->cidr }}</td>
|
||||
<td><a class="btn btn-sm btn-primary"
|
||||
href="{{ route('networks.edit', $network) }}">{{ __('Détails') }}</a></td>
|
||||
href="{{ route('bo.networks.edit', $network) }}">{{ __('Détails') }}</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 col-md-6 p-0">
|
||||
{{ $networks->withQueryString()->onEachSide(1)->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue