mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Add group case Add group case for portgroup URL query * Add PortGroups to MenuComposer * Add PortGroups to Menu blade Adds to menu blade, using a similar behavior as Locations. * Make PortCount into link Make port count into like similar to DeviceGroups device count. * Update MenuComposer.php Make StyleCI happy * Update MenuComposer.php Make StyleCI happy * Update ports.inc.php Make StyleCI happy * Update menu.blade.php Menu fix. * Update Menu so Manage Groups always displays. * Adding Group function * Add group to filterFields * Trying suggested change * Subquery Co-authored-by: Tony Murray <[email protected]>
84 lines
3.3 KiB
PHP
84 lines
3.3 KiB
PHP
@extends('layouts.librenmsv1')
|
|
|
|
@section('title', __('Port Groups'))
|
|
|
|
@section('content')
|
|
<div class="container-fluid">
|
|
<x-panel id="manage-port-groups-panel">
|
|
<x-slot name="title">
|
|
<i class="fa fa-th fa-fw fa-lg" aria-hidden="true"></i> {{ __('Port Groups') }}
|
|
</x-slot>
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<a type="button" class="btn btn-primary" href="{{ route('port-groups.create') }}">
|
|
<i class="fa fa-plus"></i> {{ __('New Port Group') }}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table id="manage-port-groups-table" class="table table-condensed table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ __('Name') }}</th>
|
|
<th>{{ __('Description') }}</th>
|
|
<th>{{ __('Ports') }}</th>
|
|
<th>{{ __('Actions') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($port_groups as $port_group)
|
|
<tr id="row_{{ $port_group->id }}">
|
|
<td>{{ $port_group->name }}</td>
|
|
<td>{{ $port_group->desc }}</td>
|
|
<td><a href="{{ url("/ports/group=$port_group->id") }}">{{ $port_group->ports_count }}</a></td>
|
|
<td>
|
|
<a type="button" title="{{ __('edit Port Group') }}" class="btn btn-primary btn-sm" aria-label="{{ __('Edit') }}"
|
|
href="{{ route('port-groups.edit', $port_group->id) }}">
|
|
<i class="fa fa-pencil" aria-hidden="true"></i></a>
|
|
<button type="button" class="btn btn-danger btn-sm" title="{{ __('delete Port Group') }}" aria-label="{{ __('Delete') }}"
|
|
onclick="delete_pg(this, '{{ $port_group->name }}', '{{ route('port-groups.destroy', $port_group->id) }}')">
|
|
<i
|
|
class="fa fa-trash" aria-hidden="true"></i></button>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</x-panel>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('scripts')
|
|
<script>
|
|
function delete_pg(button, name, url) {
|
|
var index = button.parentNode.parentNode.rowIndex;
|
|
|
|
if (confirm('{{ __('Are you sure you want to delete ') }}' + name + '?')) {
|
|
$.ajax({
|
|
url: url,
|
|
type: 'DELETE',
|
|
success: function (msg) {
|
|
document.getElementById("manage-port-groups-table").deleteRow(index);
|
|
toastr.success(msg);
|
|
},
|
|
error: function () {
|
|
toastr.error('{{ __('The port group could not be deleted') }}');
|
|
}
|
|
});
|
|
}
|
|
|
|
return false;
|
|
}
|
|
</script>
|
|
@endsection
|
|
|
|
@section('css')
|
|
<style>
|
|
.table-responsive {
|
|
padding-top: 16px
|
|
}
|
|
</style>
|
|
@endsection
|