27 |
# Information about what this pearl will do |
# Information about what this pearl will do |
28 |
sub info($){ |
sub info($){ |
29 |
#my $self = shift; |
#my $self = shift; |
30 |
return "VPN map","Map of all VPN links and connecitons"; |
return "VPN connections"," clustered by countries"; |
31 |
} |
} |
32 |
|
|
33 |
# what information do I need to go into action |
# what information do I need to go into action |
44 |
# run the parent ( this will set the params) |
# run the parent ( this will set the params) |
45 |
my $p = $self->{param}; |
my $p = $self->{param}; |
46 |
|
|
47 |
my $g = GraphViz->new(); |
my $g = GraphViz->new( |
48 |
|
width => 8, height => 5, |
49 |
|
pagewidth => 8, pageheight => 5 |
50 |
|
); |
51 |
|
|
52 |
my $rep = DBIx::PearlReports::new |
my $rep = DBIx::PearlReports::new |
53 |
( |
( |
79 |
-head => sub { |
-head => sub { |
80 |
$g->add_node( |
$g->add_node( |
81 |
'l'.$field{vpn_from_location_id}, |
'l'.$field{vpn_from_location_id}, |
82 |
label => "$field{from_location}\n$field{from_country}\n$field{vpn_local_gw}" |
label => "$field{from_location}\n$field{vpn_local_gw}", |
83 |
|
cluster => { |
84 |
|
name => $field{from_country}, |
85 |
|
color => '#e0e0e0', |
86 |
|
}, |
87 |
|
color => '#e0e0ff', |
88 |
|
style => 'filled', |
89 |
); |
); |
90 |
}, |
}, |
91 |
); |
); |
95 |
-head => sub { |
-head => sub { |
96 |
$g->add_node( |
$g->add_node( |
97 |
'l'.$field{vpn_to_location_id}, |
'l'.$field{vpn_to_location_id}, |
98 |
label => "$field{to_location}\n$field{to_country}\n$field{vpn_remote_gw}" |
label => "$field{to_location}\n$field{vpn_remote_gw}", |
99 |
|
cluster => { |
100 |
|
name => $field{to_country}, |
101 |
|
color => '#e0e0e0', |
102 |
|
}, |
103 |
|
color => '#e0ffe0', |
104 |
|
style => 'filled', |
105 |
); |
); |
106 |
}, |
}, |
107 |
); |
); |
109 |
$rep->body(-contents => sub { |
$rep->body(-contents => sub { |
110 |
$g->add_edge( |
$g->add_edge( |
111 |
'l'.$field{vpn_from_location_id} => 'l'.$field{vpn_to_location_id}, label => $field{link_name}, |
'l'.$field{vpn_from_location_id} => 'l'.$field{vpn_to_location_id}, label => $field{link_name}, |
112 |
|
color => '#c0c0c0', |
113 |
); |
); |
114 |
} |
} |
115 |
); |
); |