explicit no-op layout so that layout hook gets triggered which makes API work
This commit is contained in:
@@ -24,7 +24,7 @@ ajax '/ajax/content/device/modules' => require_login sub {
|
||||
content_type('text/html');
|
||||
template 'ajax/device/modules.tt', {
|
||||
nodes => $results,
|
||||
}, { layout => undef };
|
||||
}, { layout => 'noop' };
|
||||
};
|
||||
|
||||
true;
|
||||
|
||||
@@ -218,7 +218,7 @@ get '/ajax/content/device/ports' => require_login sub {
|
||||
ips => $ips_name,
|
||||
device => $device,
|
||||
vlans => $vlans,
|
||||
}, { layout => undef };
|
||||
}, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
@@ -228,7 +228,7 @@ get '/ajax/content/device/ports' => require_login sub {
|
||||
ips => $ips_name,
|
||||
device => $device,
|
||||
vlans => $vlans,
|
||||
}, { layout => undef };
|
||||
}, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@ get '/ajax/content/device/vlans' => require_login sub {
|
||||
if (request->is_ajax) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/device/vlans.tt', { results => $json },
|
||||
{ layout => undef };
|
||||
{ layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/device/vlans_csv.tt', { results => \@results },
|
||||
{ layout => undef };
|
||||
{ layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -29,11 +29,11 @@ get '/ajax/content/report/apchanneldist' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/apchanneldist.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/apchanneldist.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/apchanneldist_csv.tt', { results => \@results }, { layout => undef };
|
||||
template 'ajax/report/apchanneldist_csv.tt', { results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -38,12 +38,12 @@ get '/ajax/content/report/apclients' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/apclients.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/apclients.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/apclients_csv.tt',
|
||||
{ results => \@results }, { layout => undef };
|
||||
{ results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ get '/ajax/content/report/apradiochannelpower/data' => require_login sub {
|
||||
get '/ajax/content/report/apradiochannelpower' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
template 'ajax/report/apradiochannelpower.tt', {}, { layout => undef };
|
||||
template 'ajax/report/apradiochannelpower.tt', {}, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
my @results
|
||||
@@ -50,7 +50,7 @@ get '/ajax/content/report/apradiochannelpower' => require_login sub {
|
||||
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/apradiochannelpower_csv.tt',
|
||||
{ results => \@results, }, { layout => undef };
|
||||
{ results => \@results, }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -29,12 +29,12 @@ get '/ajax/content/report/deviceaddrnodns' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json (\@results);
|
||||
template 'ajax/report/deviceaddrnodns.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/deviceaddrnodns.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/deviceaddrnodns_csv.tt',
|
||||
{ results => \@results, }, { layout => undef };
|
||||
{ results => \@results, }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@ get '/ajax/content/report/devicebylocation' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/devicebylocation.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/devicebylocation.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/devicebylocation_csv.tt',
|
||||
{ results => \@results }, { layout => undef };
|
||||
{ results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -28,12 +28,12 @@ get '/ajax/content/report/devicednsmismatch' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/devicednsmismatch.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/devicednsmismatch.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/devicednsmismatch_csv.tt',
|
||||
{ results => \@results }, { layout => undef };
|
||||
{ results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ get '/ajax/content/report/devicepoestatus/data' => require_login sub {
|
||||
get '/ajax/content/report/devicepoestatus' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
template 'ajax/report/devicepoestatus.tt', {}, { layout => undef };
|
||||
template 'ajax/report/devicepoestatus.tt', {}, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
my @results
|
||||
@@ -51,7 +51,7 @@ get '/ajax/content/report/devicepoestatus' => require_login sub {
|
||||
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/devicepoestatus_csv.tt',
|
||||
{ results => \@results, }, { layout => undef };
|
||||
{ results => \@results, }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -23,12 +23,12 @@ get '/ajax/content/report/duplexmismatch' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/duplexmismatch.tt', { results => $json, }, { layout => undef };
|
||||
template 'ajax/report/duplexmismatch.tt', { results => $json, }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/duplexmismatch_csv.tt',
|
||||
{ results => \@results, }, { layout => undef };
|
||||
{ results => \@results, }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -30,12 +30,12 @@ get '/ajax/content/report/halfduplex' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/halfduplex.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/halfduplex.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/halfduplex_csv.tt',
|
||||
{ results => \@results }, { layout => undef };
|
||||
{ results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -193,11 +193,11 @@ get '/ajax/content/report/ipinventory' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/ipinventory.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/ipinventory.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/ipinventory_csv.tt', { results => \@results, }, { layout => undef };
|
||||
template 'ajax/report/ipinventory_csv.tt', { results => \@results, }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -131,13 +131,13 @@ get '/ajax/content/report/moduleinventory' => require_login sub {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/moduleinventory.tt',
|
||||
{ results => $json, opt => $has_opt },
|
||||
{ layout => undef };
|
||||
{ layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/moduleinventory_csv.tt',
|
||||
{ results => \@results, opt => $has_opt },
|
||||
{ layout => undef };
|
||||
{ layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -97,13 +97,13 @@ get '/ajax/content/report/netbios' => require_login sub {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/netbios.tt',
|
||||
{ results => $json, opt => $domain },
|
||||
{ layout => undef };
|
||||
{ layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/netbios_csv.tt',
|
||||
{ results => \@results, opt => $domain },
|
||||
{ layout => undef };
|
||||
{ layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -38,12 +38,12 @@ get '/ajax/content/report/nodemultiips' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/nodemultiips.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/nodemultiips.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/nodemultiips_csv.tt',
|
||||
{ results => \@results }, { layout => undef };
|
||||
{ results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -120,13 +120,13 @@ get '/ajax/content/report/nodevendor' => require_login sub {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/nodevendor.tt',
|
||||
{ results => $json, opt => $vendor },
|
||||
{ layout => undef };
|
||||
{ layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/nodevendor_csv.tt',
|
||||
{ results => \@results, opt => $vendor },
|
||||
{ layout => undef };
|
||||
{ layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -64,12 +64,12 @@ get '/ajax/content/report/nodesdiscovered' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/nodesdiscovered.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/nodesdiscovered.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/nodesdiscovered_csv.tt',
|
||||
{ results => \@results }, { layout => undef };
|
||||
{ results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -32,12 +32,12 @@ get '/ajax/content/report/portadmindown' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json (\@results);
|
||||
template 'ajax/report/portadmindown.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/portadmindown.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/portadmindown_csv.tt',
|
||||
{ results => \@results, }, { layout => undef };
|
||||
{ results => \@results, }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -32,12 +32,12 @@ get '/ajax/content/report/portblocking' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json (\@results);
|
||||
template 'ajax/report/portblocking.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/portblocking.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/portblocking_csv.tt',
|
||||
{ results => \@results, }, { layout => undef };
|
||||
{ results => \@results, }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ ajax '/ajax/content/report/portlog' => require_login sub {
|
||||
content_type('text/html');
|
||||
template 'ajax/report/portlog.tt', {
|
||||
results => $set,
|
||||
}, { layout => undef };
|
||||
}, { layout => 'noop' };
|
||||
};
|
||||
|
||||
true;
|
||||
|
||||
@@ -46,12 +46,12 @@ get '/ajax/content/report/portmultinodes' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json (\@results);
|
||||
template 'ajax/report/portmultinodes.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/portmultinodes.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/portmultinodes_csv.tt',
|
||||
{ results => \@results, }, { layout => undef };
|
||||
{ results => \@results, }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -71,12 +71,12 @@ get '/ajax/content/report/portssid' => require_login sub {
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/portssid.tt',
|
||||
{ results => $json, opt => $ssid }, { layout => undef };
|
||||
{ results => $json, opt => $ssid }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/portssid_csv.tt',
|
||||
{ results => \@results, opt => $ssid }, { layout => undef };
|
||||
{ results => \@results, opt => $ssid }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ get '/ajax/content/report/portutilization' => require_login sub {
|
||||
|
||||
if (request->is_ajax) {
|
||||
my $json = to_json (\@results);
|
||||
template 'ajax/report/portutilization.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/portutilization.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/portutilization_csv.tt', { results => \@results, }, { layout => undef };
|
||||
template 'ajax/report/portutilization_csv.tt', { results => \@results, }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@ get '/ajax/content/report/portvlanmismatch' => require_login sub {
|
||||
|
||||
if (request->is_ajax) {
|
||||
my $json = to_json (\@results);
|
||||
template 'ajax/report/portvlanmismatch.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/portvlanmismatch.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/portvlanmismatch_csv.tt', { results => \@results, }, { layout => undef };
|
||||
template 'ajax/report/portvlanmismatch_csv.tt', { results => \@results, }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ get '/ajax/content/report/ssidinventory' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/report/portssid.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/portssid.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/portssid_csv.tt', { results => \@results }, { layout => undef };
|
||||
template 'ajax/report/portssid_csv.tt', { results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -48,11 +48,11 @@ get '/ajax/content/report/subnets' => require_login sub {
|
||||
return unless scalar @results;
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
template 'ajax/report/subnets.tt', { results => \@results }, { layout => undef };
|
||||
template 'ajax/report/subnets.tt', { results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/subnets_csv.tt', { results => \@results }, { layout => undef };
|
||||
template 'ajax/report/subnets_csv.tt', { results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -37,11 +37,11 @@ get '/ajax/content/report/vlaninventory' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json (\@results);
|
||||
template 'ajax/report/vlaninventory.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/report/vlaninventory.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/report/vlaninventory_csv.tt', { results => \@results }, { layout => undef };
|
||||
template 'ajax/report/vlaninventory_csv.tt', { results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -87,11 +87,11 @@ get '/ajax/content/search/device' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/search/device.tt', { results => $json }, { layout => undef };;
|
||||
template 'ajax/search/device.tt', { results => $json }, { layout => 'noop' };;
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/search/device_csv.tt', { results => \@results, }, { layout => undef };
|
||||
template 'ajax/search/device_csv.tt', { results => \@results, }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ get '/ajax/content/search/node' => require_login sub {
|
||||
ports => $ports,
|
||||
wireless => $wireless,
|
||||
netbios => $netbios,
|
||||
}, { layout => undef };
|
||||
}, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
my $ports = param('deviceports')
|
||||
@@ -203,7 +203,7 @@ get '/ajax/content/search/node' => require_login sub {
|
||||
ports => $ports,
|
||||
wireless => $wireless,
|
||||
netbios => $netbios,
|
||||
}, { layout => undef };
|
||||
}, { layout => 'noop' };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ get '/ajax/content/search/node' => require_login sub {
|
||||
return template 'ajax/search/node_by_ip.tt', {
|
||||
macs => $set,
|
||||
archive_filter => {@active},
|
||||
}, { layout => undef };
|
||||
}, { layout => 'noop' };
|
||||
};
|
||||
|
||||
true;
|
||||
|
||||
@@ -100,11 +100,11 @@ get '/ajax/content/search/port' => require_login sub {
|
||||
|
||||
if ( request->is_ajax ) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/search/port.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/search/port.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/search/port_csv.tt', { results => \@results }, { layout => undef };
|
||||
template 'ajax/search/port_csv.tt', { results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ get '/ajax/content/search/vlan' => require_login sub {
|
||||
|
||||
if (request->is_ajax) {
|
||||
my $json = to_json( \@results );
|
||||
template 'ajax/search/vlan.tt', { results => $json }, { layout => undef };
|
||||
template 'ajax/search/vlan.tt', { results => $json }, { layout => 'noop' };
|
||||
}
|
||||
else {
|
||||
header( 'Content-Type' => 'text/comma-separated-values' );
|
||||
template 'ajax/search/vlan_csv.tt', { results => \@results }, { layout => undef };
|
||||
template 'ajax/search/vlan_csv.tt', { results => \@results }, { layout => 'noop' };
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user