-foreach (@devices) {
- my $device = $_;
- chomp($device);
- &Graphs::updatediskgraph ("day",$device);
- diskbox("$device");
-}
-
-&Header::openbox('100%', 'center', $Lang::tr{'disk usage'});
-print "<table width='95%' cellspacing='5'>\n";
-open(DF,'/bin/df -B M -x rootfs|');
-while(<DF>)
-{
- if ($_ =~ m/^Filesystem/ )
- {
- print <<END
+if ( $querry[0] =~ "sd?" || $querry[0] =~ "hd?" || $querry[0] =~ "xvd??"){
+ print "Content-type: image/png\n\n";
+ binmode(STDOUT);
+
+ &Graphs::updatediskgraph($querry[0],$querry[1]);
+}else{
+ &Header::showhttpheaders();
+ &Header::openpage($Lang::tr{'media information'}, 1, '');
+ &Header::openbigbox('100%', 'left');
+
+ foreach (@devices) {
+ my $device = $_;
+ chomp($device);
+ my @array = split(/\//,$device);
+ &Header::openbox('100%', 'center', "$array[$#array] $Lang::tr{'graph'}");
+ diskbox($array[$#array]);
+ &Graphs::makegraphbox("media.cgi",$array[$#array],"day");
+ &Header::closebox();
+ }
+
+
+ &Header::openbox('100%', 'center', $Lang::tr{'disk usage'});
+ print "<table width='95%' cellspacing='5'>\n";
+ open(DF,'/bin/df -B M -x rootfs|');
+ while(<DF>){
+ if ($_ =~ m/^Filesystem/ ){
+ print <<END