]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - html/cgi-bin/qosgraph.cgi
Debuginformationen aus den CGIs entfernt
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / qosgraph.cgi
1 #!/usr/bin/perl
2 #
3 # SmoothWall CGIs
4 #
5 # This code is distributed under the terms of the GPL
6 #
7 # (c) The SmoothWall Team
8 #
9 #
10
11 use strict;
12
13 # enable only the following on debugging purpose
14 #use warnings;
15 #use CGI::Carp 'fatalsToBrowser';
16
17 require '/var/ipfire/general-functions.pl';
18 require "${General::swroot}/lang.pl";
19 require "${General::swroot}/header.pl";
20 require "${General::swroot}/graphs.pl";
21
22 my @cgigraph=();
23 my $errormessage = "";
24
25 &Header::showhttpheaders();
26
27 $ENV{'QUERY_STRING'} =~ s/&//g;
28 @cgigraph = split(/graph=/,$ENV{'QUERY_STRING'});
29 $cgigraph[1] = '' unless defined $cgigraph[1];
30
31 &Graphs::overviewgraph("day",$cgigraph[1]);
32 &Graphs::overviewgraph("week",$cgigraph[1]);
33 &Graphs::overviewgraph("month",$cgigraph[1]);
34 &Graphs::overviewgraph("year",$cgigraph[1]);
35
36 &Header::openpage('QoS', 1, '');
37 &Header::openbigbox('100%', 'left', '', $errormessage);
38 &Header::openbox('100%', 'left', $cgigraph[1]);
39
40 if (-e "/srv/web/ipfire/html/graphs/qos-graph-$cgigraph[1]-day.png") {
41 my $ftime = localtime((stat("/srv/web/ipfire/html/graphs/qos-graph-$cgigraph[1]-day.png"))[9]);
42 print "<center>";
43 print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
44 print "<img alt='' src='/graphs/qos-graph-$cgigraph[1]-day.png' border='0' /><hr />";
45 } else {
46 print $Lang::tr{'no information available'};
47 }
48
49 if (-e "/srv/web/ipfire/html/graphs/qos-graph-$cgigraph[1]-week.png") {
50 my $ftime = localtime((stat("/srv/web/ipfire/html/graphs/qos-graph-$cgigraph[1]-week.png"))[9]);
51 print "<center>";
52 print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
53 print "<img alt='' src='/graphs/qos-graph-$cgigraph[1]-week.png' border='0' /><hr />";
54 } else {
55 print $Lang::tr{'no information available'};
56 }
57
58 if (-e "/srv/web/ipfire/html/graphs/qos-graph-$cgigraph[1]-month.png") {
59 my $ftime = localtime((stat("/srv/web/ipfire/html/graphs/qos-graph-$cgigraph[1]-month.png.png"))[9]);
60 print "<center>";
61 print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
62 print "<img alt='' src='/graphs/qos-graph-$cgigraph[1]-month.png' border='0' /><hr />";
63 } else {
64 print $Lang::tr{'no information available'};
65 }
66
67 if (-e "/srv/web/ipfire/html/graphs/qos-graph-$cgigraph[1]-year.png") {
68 my $ftime = localtime((stat("/srv/web/ipfire/html/graphs/qos-graph-$cgigraph[1]-year.png"))[9]);
69 print "<center>";
70 print "<b>$Lang::tr{'the statistics were last updated at'}: $ftime</b></center><br />\n";
71 print "<img alt='' src='/graphs/qos-graph-$cgigraph[1]-year.png' border='0' /><hr />";
72 } else {
73 print $Lang::tr{'no information available'};
74 }
75
76 print"<div align='center'><br/><a href='/cgi-bin/qos.cgi'>$Lang::tr{'back'}</a></div>";
77
78 &Header::closebox();
79 &Header::closebigbox();
80 &Header::closepage();