some older cisco devices report a numeric value for class, ignore null as a class
This commit is contained in:
@@ -88,7 +88,7 @@ get '/ajax/content/report/moduleinventory' => require_login sub {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@results = $rs->search(
|
@results = $rs->search(
|
||||||
{},
|
{class => { '!=', undef }},
|
||||||
{ select => [ 'class', { count => 'class' } ],
|
{ select => [ 'class', { count => 'class' } ],
|
||||||
as => [qw/ class count /],
|
as => [qw/ class count /],
|
||||||
group_by => [qw/ class /]
|
group_by => [qw/ class /]
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ $(document).ready(function() {
|
|||||||
}, {
|
}, {
|
||||||
"data": 'class',
|
"data": 'class',
|
||||||
"render": function(data, type, row, meta) {
|
"render": function(data, type, row, meta) {
|
||||||
return '<a href="[% uri_for('/report/moduleinventory') %]?class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data)) + '</a>';
|
return '<a href="[% uri_for('/report/moduleinventory') %]?class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"data": 'type',
|
"data": 'type',
|
||||||
@@ -101,7 +101,7 @@ $(document).ready(function() {
|
|||||||
[% ELSE %] {
|
[% ELSE %] {
|
||||||
"data": 'class',
|
"data": 'class',
|
||||||
"render": function(data, type, row, meta) {
|
"render": function(data, type, row, meta) {
|
||||||
return '<a href="[% uri_for('/report/moduleinventory') %]?class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data)) + '</a>';
|
return '<a href="[% uri_for('/report/moduleinventory') %]?class=' + encodeURIComponent(data) + '">' + he.encode(capitalizeFirstLetter(data + '')) + '</a>';
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"data": 'count',
|
"data": 'count',
|
||||||
|
|||||||
Reference in New Issue
Block a user