1<%doc>
2
3 Reports Section.
4
5</%doc>
6%
7%
8<%args>
9$user => $ui->get_current_user($r);
10</%args>
11%
12%
13<%attr>
14title   => 'Reports'
15section => 'Reports'
16</%attr>
17%
18%
19<%shared>
20my $PAGE_ATTRIBUTE = "REPORTS_PAGE";
21my $SECTION = "Reports";
22</%shared>
23%
24%
25<%init>
26
27my $manager = $ui->get_permission_manager($r);
28unless ( $manager && $manager->can($user, "access_section", 'reports') ){
29    $m->comp('/generic/error.mhtml', error=>"You don't have permission to access this section");
30}
31
32my %caller_args = $m->caller_args(-1);
33if (exists($caller_args{page})){
34    $user->setAttribute($r, "$PAGE_ATTRIBUTE", $caller_args{page});
35}
36my $page = $user->getAttribute("$PAGE_ATTRIBUTE");
37</%init>
38
39<%method .section_meta_data>
40    <%doc>
41        Returns the meta data used to generate this sections header in section1.mhtml
42    </%doc>
43    <%init>
44        return {
45	    section      => $SECTION,
46	    page         => 'reports/',
47	    title        => 'Reports',
48	    attribute    => $PAGE_ATTRIBUTE,
49	    sub_sections => [
50		{ section => 'DEVICE',    title => 'Devices' },
51		{ section => 'ASSET',     title => 'Assets' },
52		{ section => 'IP',        title => 'IP' },
53		{ section => 'MACS',      title => 'MAC Addresses' },
54		{ section => 'TOPOLOGY',  title => 'Topology Graph' },
55		{ section => 'POLLSTATS', title => 'Polling Stats' },
56		{ section => 'DATABASE',  title => 'Database Reports' },
57	    ]
58        };
59    </%init>
60</%method>
61
62<%perl>
63
64if ( $page eq "POLLSTATS" ) {
65</%perl>
66    <div class="container">
67	<div class="containerhead">Device Polling Statistics</div>
68	<div class="containerbody">
69	<table border="0">
70  	  <tr>
71	    <td><a href="addr_poll_stats.html">Network Addresses</a></td>
72	    <td>MAC and IP addresses active on the Network</td>
73	  </tr>
74  	  <tr>
75	    <td><a href="dev_poll_stats.html">Devices</a></td>
76	    <td>Devices being polled for ARP caches and forwarding tables</td>
77	  </tr>
78  	  <tr>
79	    <td><a href="time_poll_stats.html">Poll Time</a></td>
80	    <td>Device polling time</td>
81	  </tr>
82	</table>
83	</div>
84    </div>
85
86<%perl>
87
88}elsif ( $page eq "DEVICE" && $m->request_comp->name ne "device_inventory.html" ) {
89
90	$m->comp('device_inventory.html');
91
92}elsif($page eq "ASSET" && $m->request_comp->name ne "asset_inventory.html"){
93	$m->comp('asset_inventory.html');
94
95}elsif ( $page eq "IP" && $m->request_comp->name ne "ip_reports.html" ) {
96
97	$m->comp('ip_reports.html');
98
99}elsif ( $page eq "MACS" && $m->request_comp->name ne "macs_by_vendor.html" ) {
100
101	$m->comp('macs_by_vendor.html');
102
103}elsif ($page eq "DATABASE") {
104</%perl>
105	<div class="container">
106	<div class="containerhead">Database Reports</div>
107	<div class="containerbody">
108
109%    if ( Netdot->config->get('DB_TYPE') eq 'mysql' ){
110	<br>
111	<a href="mysql_stats.html">Table Information</a><br>
112	Shows information about all the tables in the database including size, number of rows, and last update times.<br>
113
114%    }else{
115	<br>
116	Sorry.  Only MySQL report available at this time.
117%    }
118	<br>
119
120	</div>
121	</div>
122<%perl>
123}elsif ( $page eq "TOPOLOGY" && $m->request_comp->name ne 'topology_graph.html' ) {
124
125    $m->comp('topology_graph.html');
126
127}elsif ($page eq "CUSTOM") {
128
129}
130
131if ( $m->fetch_next ){
132    $m->call_next;
133}
134
135
136</%perl>
137