]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
Graphen Hintergrundfarbe bei Standarttheme auf weiss gesetzt
authormaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Tue, 22 May 2007 19:04:48 +0000 (19:04 +0000)
committermaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Tue, 22 May 2007 19:04:48 +0000 (19:04 +0000)
Config Types in der Nettraffic angepasst
Erstellung der Week Month und Year Graphen nur noch bei Request

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@573 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

html/cgi-bin/graphs.cgi
html/cgi-bin/hardwaregraphs.cgi
html/cgi-bin/media.cgi
html/cgi-bin/memory.cgi
html/cgi-bin/network.cgi
html/cgi-bin/system.cgi
html/cgi-bin/traffic.cgi
html/html/themes/ipfire/include/colors.txt

index 82357e729ec93b47c0c049449a3d000e172daed3..19bbafeb3f6c993425399ae355375e2f2dc1c05a 100644 (file)
 use strict;
 
 # enable only the following on debugging purpose
-#use warnings;
-#use CGI::Carp 'fatalsToBrowser';
+use warnings;
+use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
+require "${General::swroot}/graphs.pl";
 
 my %cgiparams=();
 my %pppsettings=();
@@ -34,6 +35,24 @@ $ENV{'QUERY_STRING'} =~ s/&//g;
 @cgigraphs = split(/graph=/,$ENV{'QUERY_STRING'});
 $cgigraphs[1] = '' unless defined $cgigraphs[1];
 
+if ($cgigraphs[1] =~ /(load)/) {&Graphs::updateloadgraph ("week");&Graphs::updateloadgraph ("month");&Graphs::updateloadgraph ("year");}
+if ($cgigraphs[1] =~ /(cpu)/) {&Graphs::updatecpugraph ("week");&Graphs::updatecpugraph ("month");&Graphs::updatecpugraph ("year");}
+if ($cgigraphs[1] =~ /(memory|swap)/) {&Graphs::updatememgraph ("week");&Graphs::updatememgraph ("month");&Graphs::updatememgraph ("year");}
+if ($cgigraphs[1] =~ /disk/){
+          my @devices = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
+
+          foreach (@devices) {
+                my $device = $_;
+                chomp($device);
+                 &Graphs::updatediskgraph ("week",$device);
+                 &Graphs::updatediskgraph ("month",$device);
+                 &Graphs::updatediskgraph ("year",$device);}}
+if ($cgigraphs[1] =~ /lq/) {&Graphs::updatelqgraph("week");&Graphs::updatelqgraph("month");&Graphs::updatelqgraph("year");}
+if ($cgigraphs[1] =~ /RED/) {&Graphs::updateifgraph("RED", "week");&Graphs::updateifgraph("RED", "month");&Graphs::updateifgraph("RED", "year");}
+if ($cgigraphs[1] =~ /GREEN/) {&Graphs::updateifgraph("GREEN", "week");&Graphs::updateifgraph("GREEN", "month");&Graphs::updateifgraph("GREEN", "year");}
+if ($cgigraphs[1] =~ /BLUE/) {&Graphs::updateifgraph("BLUE", "week");&Graphs::updateifgraph("BLUE", "month");&Graphs::updateifgraph("BLUE", "year");}
+if ($cgigraphs[1] =~ /ORANGE/) {&Graphs::updateifgraph("ORANGE", "week");&Graphs::updateifgraph("ORANGE", "month");&Graphs::updateifgraph("ORANGE", "year");}
+
 if ($cgigraphs[1] =~ /(network|GREEN|BLUE|ORANGE|RED|lq)/) {
        &Header::openpage($Lang::tr{'network traffic graphs'}, 1, '');
 } else {
index 4537994852c6cd61966b98f512498af142b2dd49..9cbaf12be2e7127617a9159ad69c1db16e0d53cb 100644 (file)
@@ -30,23 +30,11 @@ foreach (@disks){
   my $disk = $_;
   chomp $disk;
   &Graphs::updatehddgraph ($disk,"day");
-  &Graphs::updatehddgraph ($disk,"week");
-  &Graphs::updatehddgraph ($disk,"month");
-  &Graphs::updatehddgraph ($disk,"year");
 }
 
   &Graphs::updatetempgraph ("day");
-  &Graphs::updatetempgraph ("week");
-  &Graphs::updatetempgraph ("month");
-  &Graphs::updatetempgraph ("year");
   &Graphs::updatefangraph ("day");
-  &Graphs::updatefangraph ("week");
-  &Graphs::updatefangraph ("month");
-  &Graphs::updatefangraph ("year");
   &Graphs::updatevoltgraph ("day");
-  &Graphs::updatevoltgraph ("week");
-  &Graphs::updatevoltgraph ("month");
-  &Graphs::updatevoltgraph ("year");
 
 my @graphs=();
 
@@ -159,6 +147,19 @@ if ($cgigraphs[1] =~ /hddtemp/)
 }
 elsif ($cgigraphs[1] =~ /(temp|fan|volt)/) 
 {
+if ($cgigraphs[1] =~ /temp/) {&Graphs::updatetempgraph ("week");&Graphs::updatetempgraph ("month");&Graphs::updatetempgraph ("year");}
+if ($cgigraphs[1] =~ /fan/) {&Graphs::updatefangraph ("week");&Graphs::updatefangraph ("month");&Graphs::updatefangraph ("year");}
+if ($cgigraphs[1] =~ /volt/) {&Graphs::updatevoltgraph ("week");&Graphs::updatevoltgraph ("month");&Graphs::updatevoltgraph ("year");}
+if ($cgigraphs[1] =~ /hddtemp/){
+          my @devices = `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`;
+
+          foreach (@devices) {
+                my $device = $_;
+                chomp($device);
+            &Graphs::updatehddgraph ($disk,"week");
+            &Graphs::updatehddgraph ($disk,"month");
+            &Graphs::updatehddgraph ($disk,"year");}}
+
   my $graph = $cgigraphs[1];
   my $graphname = $Lang::tr{"mbmon $cgigraphs[1]"};
   &Header::openbox('100%', 'center', "$graphname $Lang::tr{'graph'}");
index 2dfc3a02ce80d722f6568a7f1b0d1115b8607bb5..54aa3ba5a02bd65d4a846101334e609401f7130c 100644 (file)
@@ -39,8 +39,6 @@ foreach (@devices) {
        my $device = $_;
        chomp($device);
        &Graphs::updatediskgraph ("day",$device);
-       &Graphs::updatediskgraph ("week",$device);
-       &Graphs::updatediskgraph ("month",$device);
        diskbox("$device");
 }
 
index 030afe867df07723f7b170d3f8824516b78e81a9..5e84c80de2e9829623ba591e2c2b643916fbe623 100644 (file)
@@ -22,9 +22,6 @@ require "${General::swroot}/graphs.pl";
 my %cgiparams=();
 
 &Graphs::updatememgraph ("day");
-&Graphs::updatememgraph ("week");
-&Graphs::updatememgraph ("month");
-&Graphs::updatememgraph ("year");
 
 &Header::showhttpheaders();
 &Header::getcgihash(\%cgiparams);
index 70bdf35c685b67421c611bd267b0c35a4ecadbe7..4e6c3e7f9be9c39eea3f52c8b3adbb39423ac21a 100644 (file)
@@ -55,19 +55,9 @@ if ($cgiparams[1] =~ /red/) {
 foreach my $graphname (@graphs) {
 
   if ($graphname eq "lq" )
-  {
-  &Graphs::updatelqgraph("day");
-  &Graphs::updatelqgraph("week");
-  &Graphs::updatelqgraph("month");
-  &Graphs::updatelqgraph("year");
-  }
+  {  &Graphs::updatelqgraph("day");  }
   else
-  {
-  &Graphs::updateifgraph($graphname, "day");
-  &Graphs::updateifgraph($graphname, "week");
-  &Graphs::updateifgraph($graphname, "month");
-  &Graphs::updateifgraph($graphname, "year");
-  }
+  {  &Graphs::updateifgraph($graphname, "day");  }
   
        &Header::openbox('100%', 'center', "$graphname $Lang::tr{'graph'}");
        if (-e "$Header::graphdir/${graphname}-day.png") {
index 02f03842202753d44f99df4c65930b005ecbaa21..5cc813f39a64aa75562f503404cef5efb58c27b0 100644 (file)
@@ -67,13 +67,7 @@ if ($netsettings{'BLUE_DEV'} ne '') {
 
 # Generate Graphs from rrd Data
 &Graphs::updatecpugraph ("day");
-&Graphs::updatecpugraph ("week");
-&Graphs::updatecpugraph ("month");
-&Graphs::updatecpugraph ("year");
 &Graphs::updateloadgraph ("day");
-&Graphs::updateloadgraph ("week");
-&Graphs::updateloadgraph ("month");
-&Graphs::updateloadgraph ("year");
 
 &Header::showhttpheaders();
 &Header::getcgihash(\%cgiparams);
index dae5c96cea593365c6e560697752a52891bd7ba6..22867d76a784f7ffe189fc13c98456b923d87cf4 100644 (file)
@@ -129,13 +129,13 @@ my $netWidth = '34%';
 my $inOutWidth = '17%';
 
 # 4 networks
-if ($netsettings{'CONFIG_TYPE'} =~ /^(5|7)$/) {
+if ($netsettings{'CONFIG_TYPE'} =~ /^(4)$/) {
        $dateWidth = '12%';
        $netWidth = '22%';
        $inOutWidth = '11%';
 }
 # 3 networks
-if ($netsettings{'CONFIG_TYPE'} =~ /^(1|3|4|6)$/) {
+if ($netsettings{'CONFIG_TYPE'} =~ /^(2|3)$/) {
        $dateWidth = '16%';
        $netWidth = '28%';
        $inOutWidth = '14%';
@@ -148,16 +148,18 @@ print <<END;
                <td width='$netWidth' align='center' class='boldbase' ><b>$Lang::tr{'trafficgreen'}</b></td>
 END
 
-if ($netsettings{'CONFIG_TYPE'} =~ /^(4|5|6|7)$/) {
+if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/) {
        print "<td width='$netWidth' align='center' class='boldbase' ><b>$Lang::tr{'trafficblue'}</b></td>";
 }
 
-if ($netsettings{'CONFIG_TYPE'} =~ /^(1|3|5|7)$/) {
+if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/) {
        print "<td width='$netWidth' align='center' class='boldbase' ><b>$Lang::tr{'trafficorange'}</b></td>";
 }
 
+if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/) {
+       print "<td width='$netWidth' align='center' class='boldbase'><b>$Lang::tr{'trafficred'}</b></td>";
+       }
 print <<END;
-               <td width='$netWidth' align='center' class='boldbase'><b>$Lang::tr{'trafficred'}</b></td>
        </tr>
        </table>
        <table width='100%'>
@@ -167,22 +169,23 @@ print <<END;
                <td width='$inOutWidth' align='center' class='boldbase'><font color='#16A61D'><b>$Lang::tr{'trafficout'}</b></font></td>
 END
 
-if ($netsettings{'CONFIG_TYPE'} =~ /^(4|5|6|7)$/)
+if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/)
 {  
        print "<td width='$inOutWidth' align='center' class='boldbase'><font color='${Header::colourblue}'><b>$Lang::tr{'trafficin'}</b></font></td>";
        print "<td width='$inOutWidth' align='center' class='boldbase'><font color='${Header::colourblue}'><b>$Lang::tr{'trafficout'}</b></font></td>";
 } 
 
-if ($netsettings{'CONFIG_TYPE'} =~ /^(1|3|5|7)$/)
+if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/)
 {  
        print "<td width='$inOutWidth' align='center' class='boldbase'><font color='#FF9933'><b>$Lang::tr{'trafficin'}</b></font></td>";
        print "<td width='$inOutWidth' align='center' class='boldbase'><font color='#FF9933'><b>$Lang::tr{'trafficout'}</b></font></td>";
 } 
-print <<END;
-               <td width='$inOutWidth' align='center' class='boldbase'><font color='#CE1B31'><b>$Lang::tr{'trafficin'}</b></font></td>
-               <td width='$inOutWidth' align='center' class='boldbase'><font color='#CE1B31'><b>$Lang::tr{'trafficout'}</b></font></td>
-       </tr>
-END
+if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
+{
+       print "<td width='$inOutWidth' align='center' class='boldbase'><font color='#CE1B31'><b>$Lang::tr{'trafficin'}</b></font></td>";
+       print "<td width='$inOutWidth' align='center' class='boldbase'><font color='#CE1B31'><b>$Lang::tr{'trafficout'}</b></font></td>";
+}
+       print"</tr>";
 
 my $total_blue_in=0;
 my $total_blue_out=0;
@@ -214,21 +217,24 @@ foreach (@allDays) {
        $total_green_in += $allDaysBytes{$_}{${Traffic::green_in}};
        $total_green_out += $allDaysBytes{$_}{${Traffic::green_out}};
                
-       if ($netsettings{'CONFIG_TYPE'} =~ /^(4|5|6|7)$/)
+       if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/)
        {
                $total_blue_in += $allDaysBytes{$_}{${Traffic::blue_in}};
                $total_blue_out += $allDaysBytes{$_}{${Traffic::blue_out}};
        }
                
-       if ($netsettings{'CONFIG_TYPE'} =~ /^(1|3|5|7)$/)
+       if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/)
        {
                $total_orange_in += $allDaysBytes{$_}{${Traffic::orange_in}};
                $total_orange_out += $allDaysBytes{$_}{${Traffic::orange_out}};
        }
-               
+       
+  if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
+       {       
        $total_red_in += $allDaysBytes{$_}{${Traffic::red_in}};
        $total_red_out += $allDaysBytes{$_}{${Traffic::red_out}};
-                               
+       }
+                       
        if ($lines % 2) {
                print "<tr bgcolor='$color{'color20'}'>"; }
        else {
@@ -238,20 +244,21 @@ foreach (@allDays) {
        printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::green_in}}/1048576);
        printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::green_out}}/1048576);
                
-       if ($netsettings{'CONFIG_TYPE'} =~ /^(4|5|6|7)$/)
+       if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/)
        {   
                printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::blue_in}}/1048576);
                printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::blue_out}}/1048576);
        } 
-       if ($netsettings{'CONFIG_TYPE'} =~ /^(1|3|5|7)$/)
+       if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/)
        {   
                printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::orange_in}}/1048576);
                printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::orange_out}}/1048576);
        } 
-               
+       if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
+  {
        printf "<td align='center' nowrap='nowrap'>%.3f</td>\n", ($allDaysBytes{$_}{${Traffic::red_in}}/1048576);
        printf "<td align='center' nowrap='nowrap'>%.3f</td></tr>\n", ($allDaysBytes{$_}{${Traffic::red_out}}/1048576);
-               
+  }            
        $lines++;
 }
 
@@ -273,21 +280,23 @@ print <<END;
        <td align='center' class='boldbase' nowrap='nowrap'><b>$total_green_out MB</b></td>
 END
   
-if ($netsettings{'CONFIG_TYPE'} =~ /^(4|5|6|7)$/)
+if ($netsettings{'CONFIG_TYPE'} =~ /^(3|4)$/)
 {    
        print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_blue_in MB</b></td>";
        print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_blue_out MB</b></td>";
 }
 
-if ($netsettings{'CONFIG_TYPE'} =~ /^(1|3|5|7)$/)
+if ($netsettings{'CONFIG_TYPE'} =~ /^(2|4)$/)
 {    
        print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_orange_in MB</b></td>";
        print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_orange_out MB</b></td>";
 }
-     
+if ($netsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/)
+{
+       print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_red_in MB</b></td>";
+       print "<td align='center' class='boldbase' nowrap='nowrap'><b>$total_red_out MB</b></td>";    
+}    
 print <<END;
-               <td align='center' class='boldbase' nowrap='nowrap'><b>$total_red_in MB</b></td>
-               <td align='center' class='boldbase' nowrap='nowrap'><b>$total_red_out MB</b></td>
        </tr>
        </table>
 END
index 547e20a43045f51d460de933496cbda9c9d55978..f51993d726825bfa7926cb548e49f0f1109d2122 100644 (file)
@@ -1,13 +1,13 @@
-colour1=#CD5B45
-colour2=#EE6A50
-colour3=#FF7256
-colour4=#EE9572
-colour5=#FFA07A
-colour6=#CDAF95
-colour7=#EECBAD
-colour8=#FFDAB9
-colour9=#FFE4C4
-colour10=#FFCCCC
+color1=#CD5B45
+color2=#EE6A50
+color3=#FF7256
+color4=#EE9572
+color5=#FFA07A
+color6=#CDAF95
+color7=#EECBAD
+color8=#FFDAB9
+color9=#FFE4C4
+color10=#FFCCCC
 color11=#0000FF
 color12=#00FF00
 color13=#FF0000
@@ -18,7 +18,7 @@ color17=#90EE90
 color18=#F4A460
 color19=#EAE9EE
 color20=#E0E0E0
-color21=#EAE9EE
+color21=#FFFFFF
 color22=#F0F0F0
 color23=#FF00FF
 color24=#6464FF