mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Global search by IP address (#11165)
* device search by (valid) ip address * add device_ip & not empty conditions to search results * updated comments * spaces after commas * search ip and overwrite_ip for name based searches, too
This commit is contained in:
@@ -582,6 +582,7 @@
|
||||
device_image: device.device_image,
|
||||
url: device.url,
|
||||
name: device.name,
|
||||
device_ip: device.device_ip,
|
||||
device_os: device.device_os,
|
||||
version: device.version,
|
||||
device_hardware: device.device_hardware,
|
||||
@@ -662,7 +663,7 @@
|
||||
valueKey: 'name',
|
||||
templates: {
|
||||
header: '<h5><strong> Devices</strong></h5>',
|
||||
suggestion: Handlebars.compile('<p><a href="@{{url}}"><img src="@{{device_image}}" border="0"> <small><strong>@{{name}}</strong> | @{{device_os}} | @{{version}} | @{{device_hardware}} with @{{device_ports}} port(s) | @{{location}}</small></a></p>')
|
||||
suggestion: Handlebars.compile('<p><a href="@{{url}}"><img src="@{{device_image}}" border="0"> <small><strong>@{{name}}</strong>@{{#if device_ip}} | <i>@{{device_ip}}</i>@{{/if}}@{{#if device_os}} | @{{device_os}}@{{/if}}@{{#if version}} @{{version}}@{{/if}}@{{#if device_hardware}} | @{{device_hardware}}@{{/if}}@{{#if device_ports}} with @{{device_ports}} port(s)@{{/if}}@{{#if location}} | @{{location}}@{{/if}}</small></a></p>')
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -673,7 +674,7 @@
|
||||
valueKey: 'name',
|
||||
templates: {
|
||||
header: '<h5><strong> Ports</strong></h5>',
|
||||
suggestion: Handlebars.compile('<p><a href="@{{url}}"><small><i class="fa fa-link fa-sm icon-theme" aria-hidden="true"></i> <strong>@{{name}}</strong> – @{{hostname}}<br /><i>@{{description}}</i></small></a></p>')
|
||||
suggestion: Handlebars.compile('<p><a href="@{{url}}"><small><i class="fa fa-link fa-sm icon-theme" aria-hidden="true"></i> <strong>@{{name}}</strong> - @{{hostname}}@{{#if description}} <i>@{{description}}</i>@{{/if}}</small></a></p>')
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -684,7 +685,7 @@
|
||||
valueKey: 'name',
|
||||
templates: {
|
||||
header: '<h5><strong> BGP Sessions</strong></h5>',
|
||||
suggestion: Handlebars.compile('<p><a href="@{{url}}"><small><i class="@{{bgp_image}}" aria-hidden="true"></i> @{{name}} - @{{hostname}}<br />AS@{{localas}} -> AS@{{remoteas}}</small></a></p>')
|
||||
suggestion: Handlebars.compile('<p><a href="@{{url}}"><small><i class="@{{bgp_image}}" aria-hidden="true"></i> @{{name}} - @{{hostname}} - AS@{{localas}} -> AS@{{remoteas}}</small></a></p>')
|
||||
}
|
||||
}).on('typeahead:select', function (ev, suggestion) {
|
||||
window.location.href = suggestion.url;
|
||||
|
Reference in New Issue
Block a user