Better ONVIF Scanner, now displays all found network devices
- Will now display ONVIF devices if auth fails - will now display all network devices with operating web panelsmerge-requests/210/head
parent
f1f22a49f1
commit
600a7f5641
|
|
@ -242,6 +242,9 @@
|
|||
"ONVIF Scanner": "ONVIF Scanner",
|
||||
"ONVIFEventsNotAvailable": "ONVIF Events not Available",
|
||||
"ONVIFnotCompliantProfileT": "Camera is not ONVIF Profile T Compliant",
|
||||
"ONVIFErr400": "Found ONVIF port but authorization failed when retrieving the Stream URL. Check username and password used for scan.",
|
||||
"ONVIFErr405": "Method Not Allowed. Check username and password used for scan.",
|
||||
"ONVIFErr404": "Not Found. This may just be the web panel for a network device.",
|
||||
"Scan Settings": "Scan Settings",
|
||||
"ONVIFnote": "Discover ONVIF devices on networks outside your own or leave it blank to scan your current network. <br>Username and Password can be left blank.",
|
||||
"Range or Single": "Range or Single",
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ module.exports = function(s,config,lang,app,io){
|
|||
ip = addressRange.join(',')
|
||||
}
|
||||
if(ports === ''){
|
||||
ports = '80,8080,8000,7575,8081,554'
|
||||
ports = '80,8080,8000,7575,8081,9080'
|
||||
}
|
||||
if(ports.indexOf('-') > -1){
|
||||
ports = ports.split('-')
|
||||
|
|
@ -120,15 +120,21 @@ module.exports = function(s,config,lang,app,io){
|
|||
return s.stringContains(find,err.message,true)
|
||||
}
|
||||
var foundDevice = false
|
||||
var errorMessage = ''
|
||||
switch(true){
|
||||
//ONVIF camera found but denied access
|
||||
case searchError('400'): //Bad Request - Sender not Authorized
|
||||
foundDevice = true
|
||||
errorMessage = lang.ONVIFErr400
|
||||
break;
|
||||
case searchError('405'): //Method Not Allowed
|
||||
foundDevice = true
|
||||
errorMessage = lang.ONVIFErr405
|
||||
break;
|
||||
//Webserver exists but undetermined if IP Camera
|
||||
case searchError('404'): //Not Found
|
||||
foundDevice = true
|
||||
errorMessage = lang.ONVIFErr404
|
||||
break;
|
||||
}
|
||||
if(foundDevice && foundCameraCallback)foundCameraCallback({
|
||||
|
|
@ -136,7 +142,7 @@ module.exports = function(s,config,lang,app,io){
|
|||
ff: 'failed_capture',
|
||||
ip: camera.ip,
|
||||
port: camera.port,
|
||||
error: err.message
|
||||
error: errorMessage
|
||||
});
|
||||
s.debugLog(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,25 @@ $.oB={
|
|||
v:$('#onvif_video'),
|
||||
};
|
||||
$.oB.f=$.oB.e.find('form');$.oB.o=$.oB.e.find('.output_data');
|
||||
var drawProbeResult = function(options){
|
||||
var tempID = $.ccio.gid();
|
||||
$.oB.foundMonitors[tempID] = Object.assign({},options);
|
||||
$.oB.e.find('._loading').hide()
|
||||
$.oB.e.find('._notfound').remove()
|
||||
$.oB.e.find('[type="submit"]').prop('disabled',false)
|
||||
var info = options.error ? options.error : options.info ? $.ccio.init('jsontoblock',options.info) : ''
|
||||
var streamUrl = options.error ? '' : 'No Stream URL Found'
|
||||
if(options.uri){
|
||||
streamUrl = options.uri
|
||||
}
|
||||
$('#onvif_probe .output_data').append(`<tr onvif_row="${tempID}">
|
||||
<td><a ${options.error ? `target="_blank" href="http${options.port == 443 ? 's' : ''}://${options.ip}:${options.port}"` : ''} class="btn btn-sm btn-primary ${options.error ? '' : 'copy'}"> <i class="fa fa-${options.error ? 'link' : 'copy'}"></i> </a></td>
|
||||
<td class="ip">${options.ip}</td>
|
||||
<td class="port">${options.port}</td>
|
||||
<td>${info}</td>
|
||||
<td class="url">${streamUrl}</td>
|
||||
</tr>`)
|
||||
}
|
||||
$.oB.f.submit(function(ee){
|
||||
ee.preventDefault();
|
||||
e={};
|
||||
|
|
@ -57,4 +76,5 @@ $.oB.e.find('[name="user"]').change(function(e){
|
|||
if($.ccio.op().onvif_probe_user){
|
||||
$.oB.e.find('[name="user"]').val($.ccio.op().onvif_probe_user)
|
||||
}
|
||||
$.oB.drawProbeResult = drawProbeResult
|
||||
})
|
||||
|
|
|
|||
|
|
@ -822,18 +822,7 @@ $user.ws.on('f',function (d){
|
|||
// }
|
||||
// break;
|
||||
case'onvif':
|
||||
var tempID = $.ccio.gid();
|
||||
$.oB.foundMonitors[tempID] = Object.assign({},d);
|
||||
$.oB.e.find('._loading').hide()
|
||||
$.oB.e.find('._notfound').remove()
|
||||
$.oB.e.find('[type="submit"]').prop('disabled',false)
|
||||
d.info=$.ccio.init('jsontoblock',d.info)
|
||||
if(d.uri){
|
||||
d.stream=d.uri
|
||||
}else{
|
||||
d.stream='URL not Found'
|
||||
}
|
||||
$('#onvif_probe .output_data').append('<tr onvif_row="'+tempID+'"><td><a class="btn btn-sm btn-primary copy"> <i class="fa fa-copy"></i> </a></td><td class="ip">'+d.ip+'</td><td class="port">'+d.port+'</td><td>'+$.ccio.init('jsontoblock',d.info)+'</td><td class="url">'+d.stream+'</td></tr>')
|
||||
$.oB.drawProbeResult(d)
|
||||
break;
|
||||
}
|
||||
delete(d);
|
||||
|
|
|
|||
Loading…
Reference in New Issue