mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 00:11:49 +02:00
Fix json appearing in global search
This commit is contained in:
+1
-1
@@ -1626,7 +1626,7 @@ tr.search:nth-child(odd) {
|
|||||||
left: -400px !important;
|
left: -400px !important;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 5px;
|
padding: 8px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
-webkit-border-radius: 8px;
|
-webkit-border-radius: 8px;
|
||||||
-moz-border-radius: 8px;
|
-moz-border-radius: 8px;
|
||||||
|
|||||||
@@ -553,7 +553,7 @@ if ($_SESSION['authenticated'])
|
|||||||
</nav>
|
</nav>
|
||||||
<script>
|
<script>
|
||||||
var devices = new Bloodhound({
|
var devices = new Bloodhound({
|
||||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('device_id'),
|
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'),
|
||||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||||
remote: {
|
remote: {
|
||||||
url: "ajax_search.php?search=%QUERY&type=device",
|
url: "ajax_search.php?search=%QUERY&type=device",
|
||||||
@@ -639,7 +639,8 @@ $('#gsearch').typeahead({
|
|||||||
{
|
{
|
||||||
source: devices.ttAdapter(),
|
source: devices.ttAdapter(),
|
||||||
async: true,
|
async: true,
|
||||||
display: name,
|
display: 'name',
|
||||||
|
valueKey: 'name',
|
||||||
templates: {
|
templates: {
|
||||||
header: '<h5><strong> Devices</strong></h5>',
|
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> | {{device_os}} | {{version}} | {{device_hardware}} with {{device_ports}} port(s) | {{location}}</small></a></p>')
|
||||||
@@ -648,7 +649,8 @@ $('#gsearch').typeahead({
|
|||||||
{
|
{
|
||||||
source: ports.ttAdapter(),
|
source: ports.ttAdapter(),
|
||||||
async: true,
|
async: true,
|
||||||
display: name,
|
display: 'name',
|
||||||
|
valueKey: 'name',
|
||||||
templates: {
|
templates: {
|
||||||
header: '<h5><strong> Ports</strong></h5>',
|
header: '<h5><strong> Ports</strong></h5>',
|
||||||
suggestion: Handlebars.compile('<p><a href="{{url}}"><small><img src="images/icons/port.png" /> <strong>{{name}}</strong> – {{hostname}}<br /><i>{{description}}</i></small></a></p>')
|
suggestion: Handlebars.compile('<p><a href="{{url}}"><small><img src="images/icons/port.png" /> <strong>{{name}}</strong> – {{hostname}}<br /><i>{{description}}</i></small></a></p>')
|
||||||
@@ -657,7 +659,8 @@ $('#gsearch').typeahead({
|
|||||||
{
|
{
|
||||||
source: bgp.ttAdapter(),
|
source: bgp.ttAdapter(),
|
||||||
async: true,
|
async: true,
|
||||||
display: name,
|
display: 'name',
|
||||||
|
valueKey: 'name',
|
||||||
templates: {
|
templates: {
|
||||||
header: '<h5><strong> BGP Sessions</strong></h5>',
|
header: '<h5><strong> BGP Sessions</strong></h5>',
|
||||||
suggestion: Handlebars.compile('<p><a href="{{url}}"><small><img src="{{bgp_image}}" border="0">{{name}} - {{hostname}}<br />AS{{localas}} -> AS{{remoteas}}</small></a></p>')
|
suggestion: Handlebars.compile('<p><a href="{{url}}"><small><img src="{{bgp_image}}" border="0">{{name}} - {{hostname}}<br />AS{{localas}} -> AS{{remoteas}}</small></a></p>')
|
||||||
|
|||||||
Reference in New Issue
Block a user