mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Dynamic Select setting (#13179)
* Dynamic Select setting embeds select2 and uses ajax to call to backend for options poller-group included * fix validation a bit * fix typehint * move minProperties into the select schema * Change dashboard-select to select-dynamic Love deleting code * Change dashboard-select to select-dynamic Love deleting code wire up a few select2 options * fix whitespace * Not a model, just an object * Suggestion from @SourceDoctor autocomplete values of select and select-dynamic Got a little creative with InternalHttpRequest...
This commit is contained in:
@@ -51,7 +51,10 @@ abstract class SelectController extends PaginatedAjaxController
|
||||
$this->validate($request, $this->rules());
|
||||
$limit = $request->get('limit', 50);
|
||||
|
||||
$query = $this->search($request->get('term'), $this->baseQuery($request), $this->searchFields($request));
|
||||
$query = $this->baseQuery($request)->when($request->has('id'), function ($query) {
|
||||
return $query->whereKey(request('id'));
|
||||
});
|
||||
$query = $this->search($request->get('term'), $query, $this->searchFields($request));
|
||||
$this->sort($request, $query);
|
||||
$paginator = $query->simplePaginate($limit);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user