add device filter feature
This commit is contained in:
parent
a2502f6b70
commit
a7329fa96f
1 changed files with 7 additions and 1 deletions
|
|
@ -947,7 +947,9 @@
|
|||
function renderDevices(devices) {
|
||||
let selectedIndex = -1,
|
||||
selected = API.device.get(),
|
||||
devs = settings().devices;
|
||||
features = API.feature,
|
||||
devs = settings().devices,
|
||||
dfilter = typeof(features.device_filter) === 'function' ? features.device_filter : undefined;
|
||||
|
||||
for (let local in devs) {
|
||||
if (!(devs.hasOwnProperty(local) && devs[local])) {
|
||||
|
|
@ -1009,6 +1011,10 @@
|
|||
if (!loc && deviceFilter && device.toLowerCase().indexOf(deviceFilter) < 0) {
|
||||
return;
|
||||
}
|
||||
// allow for device filter feature
|
||||
if (dfilter && dfilter(device) === false) {
|
||||
return;
|
||||
}
|
||||
if (incr === 0) {
|
||||
first = device;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue