From ae29d43af0bdb4edbdbc1c2d3a996c5ecb692bb1 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Sat, 5 Jan 2019 09:31:12 -0600 Subject: [PATCH] Sort device select by hostname (#9607) Plus small format fix for horizontal device summary widget. DO NOT DELETE THIS TEXT #### Please note > Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting. - [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/) #### Testers If you would like to test this pull request then please run: `./scripts/github-apply `, i.e `./scripts/github-apply 5926` After you are done testing, you can remove the changes with `./scripts/github-remove`. If there are schema changes, you can ask on discord how to revert. --- app/Http/Controllers/Select/DeviceController.php | 4 +++- resources/views/widgets/device-summary-horiz.blade.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Select/DeviceController.php b/app/Http/Controllers/Select/DeviceController.php index df52aa7be2..5290970c35 100644 --- a/app/Http/Controllers/Select/DeviceController.php +++ b/app/Http/Controllers/Select/DeviceController.php @@ -47,7 +47,9 @@ class DeviceController extends SelectController { $this->id = $request->get('id', 'device_id'); - return Device::hasAccess($request->user())->select('device_id', 'hostname', 'sysName'); + return Device::hasAccess($request->user()) + ->select('device_id', 'hostname', 'sysName') + ->orderBy('hostname'); } public function formatItem($device) diff --git a/resources/views/widgets/device-summary-horiz.blade.php b/resources/views/widgets/device-summary-horiz.blade.php index da3f24954b..c03bb64efb 100644 --- a/resources/views/widgets/device-summary-horiz.blade.php +++ b/resources/views/widgets/device-summary-horiz.blade.php @@ -22,7 +22,7 @@ {{ $devices['ignored'] }} {{ $devices['disabled'] }} @if($summary_errors) - - + - @endif