mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Ports by device group (#14175)
* Add devicegroup filterFields * add Devicegroup to post function * StyleCI * Add GUI Element * Less wordy Dropped "View" from the link. Made it too wordy for such a small GUI insertion. * Moved DeviceGroup Ports link to a separate column I realized how it could be confusing to have links to two different items in the same column, so I separated the Ports out.
This commit is contained in:
@@ -63,6 +63,13 @@ class PortsController extends TableController
|
||||
'port_descr_type',
|
||||
'ports.disabled' => 'disabled',
|
||||
'ports.ignore' => 'ignore',
|
||||
'devicegroup' => function ($query, $devicegroup) {
|
||||
return $query->whereHas('device', function ($query) use ($devicegroup) {
|
||||
return $query->whereHas('groups', function ($query) use ($devicegroup) {
|
||||
return $query->where('id', $devicegroup);
|
||||
});
|
||||
});
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -121,6 +121,7 @@ var grid = $("#ports").bootgrid({
|
||||
ignore: '<?php echo $vars['ignore']; ?>',
|
||||
deleted: '<?php echo $vars['deleted']; ?>',
|
||||
errors: '<?php echo $vars['errors']; ?>',
|
||||
devicegroup: '<?php echo $vars['devicegroup']; ?>',
|
||||
};
|
||||
},
|
||||
url: '<?php echo route('table.ports') ?>'
|
||||
|
@@ -24,6 +24,7 @@
|
||||
<th>{{ __('Description') }}</th>
|
||||
<th>{{ __('Type') }}</th>
|
||||
<th>{{ __('Devices') }}</th>
|
||||
<th>{{ __('Ports') }}</th>
|
||||
<th>{{ __('Pattern') }}</th>
|
||||
<th>{{ __('Actions') }}</th>
|
||||
</tr>
|
||||
@@ -37,6 +38,9 @@
|
||||
<td>
|
||||
<a href="{{ url("/devices/group=$device_group->id") }}">{{ $device_group->devices_count }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url("/ports/devicegroup=$device_group->id") }}">View</a>
|
||||
</td>
|
||||
<td>{{ $device_group->type == 'dynamic' ? $device_group->getParser()->toSql(false) : '' }}</td>
|
||||
<td>
|
||||
<button type="button" title="{{ __('Rediscover all Devices of Device Group') }}" class="btn btn-warning btn-sm" aria-label="{{ __('Rediscover Group') }}"
|
||||
|
Reference in New Issue
Block a user