mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
List ungrouped devices on group management page (#10527)
* list ungrouped devices on group management page * some code changes * some code changes * change query to eager loading * use url macro * Update resources/views/device-group/index.blade.php Co-Authored-By: Neil Lathwood <gh+n@laf.io> * Title Case * style fixes * inline @if * remove container * revert force push
This commit is contained in:
committed by
Tony Murray
parent
d8eb3ab90e
commit
b606a42ba9
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Device;
|
||||
use App\Models\DeviceGroup;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -25,8 +26,13 @@ class DeviceGroupController extends Controller
|
||||
{
|
||||
$this->authorize('manage', DeviceGroup::class);
|
||||
|
||||
$ungrouped_devices = Device::orderBy('hostname')->whereNotIn('device_id', function ($query) {
|
||||
$query->select('device_id')->from('device_group_device');
|
||||
})->get();
|
||||
|
||||
return view('device-group.index', [
|
||||
'device_groups' => DeviceGroup::orderBy('name')->withCount('devices')->get(),
|
||||
'ungrouped_devices' => $ungrouped_devices,
|
||||
]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user