diff --git a/lib/App/Netdisco/DB/Result/Virtual/PortVLANMismatch.pm b/lib/App/Netdisco/DB/Result/Virtual/PortVLANMismatch.pm index f73d249d..5e201cef 100644 --- a/lib/App/Netdisco/DB/Result/Virtual/PortVLANMismatch.pm +++ b/lib/App/Netdisco/DB/Result/Virtual/PortVLANMismatch.pm @@ -20,7 +20,7 @@ __PACKAGE__->result_source_instance->view_definition(<<'ENDSQL'); LEFT JOIN device_port dp2 ON (dp.ip = dp2.ip and dp.port = dp2.slave_of) LEFT JOIN device_port_vlan dp2v ON (dp2.ip = dp2v.ip and dp2.port = dp2v.port) WHERE dp.has_subinterfaces) alldpv - WHERE vlan NOT IN (1002, 1003, 1004, 1005) GROUP BY ip, port) + WHERE vlan::text NOT IN (?, ?, ?, ?) GROUP BY ip, port) SELECT CASE WHEN length(ld.dns) > 0 THEN ld.dns ELSE host(ld.ip) END AS left_device, lp.port AS left_port, diff --git a/lib/App/Netdisco/Web/Plugin/Report/PortVLANMismatch.pm b/lib/App/Netdisco/Web/Plugin/Report/PortVLANMismatch.pm index 6fc0cbcd..147ae640 100644 --- a/lib/App/Netdisco/Web/Plugin/Report/PortVLANMismatch.pm +++ b/lib/App/Netdisco/Web/Plugin/Report/PortVLANMismatch.pm @@ -17,7 +17,12 @@ register_report( get '/ajax/content/report/portvlanmismatch' => require_login sub { return unless schema('netdisco')->resultset('Device')->count; - my @results = schema('netdisco')->resultset('Virtual::PortVLANMismatch')->hri->all; + my @results = schema('netdisco') + ->resultset('Virtual::PortVLANMismatch')->search({},{ + bind => [ setting('sidebar_defaults')->{'device_ports'}->{'p_hide1002'}->{'default'} + ? (1002, 1003, 1004, 1005) : (0, 0, 0, 0) ], + }) + ->hri->all; if (request->is_ajax) { my $json = to_json (\@results);