Searching by MAC now works regardless of whether the device's MAC is lower or upper case.
This commit is contained in:
1 parent
f0a1289818
commit
00987ea8e2
2 files changed
+9
-9
No files matched your search
@@ -11,13 +11,13 @@
|
|||||||
"Device.DeviceInfo.HardwareVersion" : {"alias" : "summary.hardwareVersion"},
|
"Device.DeviceInfo.HardwareVersion" : {"alias" : "summary.hardwareVersion"},
|
||||||
"Device.DeviceInfo.SoftwareVersion" : {"alias" : "summary.softwareVersion"},
|
"Device.DeviceInfo.SoftwareVersion" : {"alias" : "summary.softwareVersion"},
|
||||||
|
|
||||||
"InternetGatewayDevice.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANIPConnection./^\\d+$/.MACAddress" : {"alias" : "summary.mac"},
|
"InternetGatewayDevice.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANIPConnection./^\\d+$/.MACAddress" : {"alias" : "summary.mac", "type" : "mac"},
|
||||||
"InternetGatewayDevice.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANIPConnection./^\\d+$/.ExternalIPAddress" : {"alias" : "summary.ip"},
|
"InternetGatewayDevice.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANIPConnection./^\\d+$/.ExternalIPAddress" : {"alias" : "summary.ip"},
|
||||||
"InternetGatewayDevice.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANPPPConnection./^\\d+$/.MACAddress" : {"alias" : "summary.mac"},
|
"InternetGatewayDevice.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANPPPConnection./^\\d+$/.MACAddress" : {"alias" : "summary.mac", "type" : "mac"},
|
||||||
"InternetGatewayDevice.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANPPPConnection./^\\d+$/.ExternalIPAddress" : {"alias" : "summary.ip"},
|
"InternetGatewayDevice.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANPPPConnection./^\\d+$/.ExternalIPAddress" : {"alias" : "summary.ip"},
|
||||||
"Device.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANIPConnection./^\\d+$/.MACAddress" : {"alias" : "summary.mac"},
|
"Device.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANIPConnection./^\\d+$/.MACAddress" : {"alias" : "summary.mac", "type" : "mac"},
|
||||||
"Device.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANIPConnection./^\\d+$/.ExternalIPAddress" : {"alias" : "summary.ip"},
|
"Device.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANIPConnection./^\\d+$/.ExternalIPAddress" : {"alias" : "summary.ip"},
|
||||||
"Device.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANPPPConnection./^\\d+$/.MACAddress" : {"alias" : "summary.mac"},
|
"Device.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANPPPConnection./^\\d+$/.MACAddress" : {"alias" : "summary.mac", "type" : "mac"},
|
||||||
"Device.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANPPPConnection./^\\d+$/.ExternalIPAddress" : {"alias" : "summary.ip"},
|
"Device.WANDevice./^\\d+$/.WANConnectionDevice./^\\d+$/.WANPPPConnection./^\\d+$/.ExternalIPAddress" : {"alias" : "summary.ip"},
|
||||||
|
|
||||||
"InternetGatewayDevice.LANDevice./^\\d+$/.WLANConfiguration./^\\d+$/.SSID" : {"alias" : "summary.wlanSsid"},
|
"InternetGatewayDevice.LANDevice./^\\d+$/.WLANConfiguration./^\\d+$/.SSID" : {"alias" : "summary.wlanSsid"},
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ common = require './common'
|
|||||||
parameters = require './parameters'
|
parameters = require './parameters'
|
||||||
|
|
||||||
|
|
||||||
stringToRegexp = (input) ->
|
stringToRegexp = (input, flags) ->
|
||||||
if (input.indexOf('*') == -1)
|
if (input.indexOf('*') == -1)
|
||||||
return false
|
return false
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ stringToRegexp = (input) ->
|
|||||||
|
|
||||||
output = output.replace(/[\*]/, '.*')
|
output = output.replace(/[\*]/, '.*')
|
||||||
|
|
||||||
return new RegExp(output)
|
return new RegExp(output, flags)
|
||||||
|
|
||||||
|
|
||||||
normalizers = {}
|
normalizers = {}
|
||||||
@@ -117,14 +117,14 @@ normalizers.mac = (input, normType) ->
|
|||||||
|
|
||||||
if input.indexOf('*') != -1
|
if input.indexOf('*') != -1
|
||||||
input = (colonizeMac(a) for a in input.split('*')).join('*')
|
input = (colonizeMac(a) for a in input.split('*')).join('*')
|
||||||
return stringToRegexp(input, false)
|
return stringToRegexp(input, 'i')
|
||||||
|
|
||||||
input = colonizeMac(input)
|
input = colonizeMac(input)
|
||||||
|
|
||||||
if input.length == 17
|
if input.length == 17
|
||||||
return input
|
return [input, input.toLowerCase()]
|
||||||
|
|
||||||
return {'$regex' : new RegExp(input)}
|
return {'$regex' : new RegExp(input, 'i')}
|
||||||
|
|
||||||
|
|
||||||
exports.normalize = (path, value, normType) ->
|
exports.normalize = (path, value, normType) ->
|
||||||
|
|||||||
Reference in new issue
Block a user