+my @querry = split(/\?/,$ENV{'QUERY_STRING'});
+$querry[0] = '' unless defined $querry[0];
+$querry[1] = 'hour' unless defined $querry[1];
+
+if ( $querry[0] =~ "hwtemp"){
+ print "Content-type: image/png\n\n";
+ binmode(STDOUT);
+ &Graphs::updatehwtempgraph($querry[1]);
+}elsif ( $querry[0] =~ "hwfan"){
+ print "Content-type: image/png\n\n";
+ binmode(STDOUT);
+ &Graphs::updatehwfangraph($querry[1]);
+}elsif ( $querry[0] =~ "hwvolt"){
+ print "Content-type: image/png\n\n";
+ binmode(STDOUT);
+ &Graphs::updatehwvoltgraph($querry[1]);
+}elsif ( $querry[0] =~ "thermaltemp"){
+ print "Content-type: image/png\n\n";
+ binmode(STDOUT);
+ &Graphs::updatethermaltempgraph($querry[1]);
+}elsif ( $querry[0] =~ "sd?" ){
+ print "Content-type: image/png\n\n";
+ binmode(STDOUT);
+ &Graphs::updatehddgraph($querry[0],$querry[1]);
+}else{
+ &Header::showhttpheaders();
+ &Header::openpage($Lang::tr{'harddisk temperature graphs'}, 1, '');
+ &Header::openbigbox('100%', 'left');
+
+ &Header::getcgihash(\%sensorsettings);
+
+ if ( $sensorsettings{'ACTION'} eq $Lang::tr{'save'} ) {
+ foreach(@sensorsgraphs){
+ chomp($_);
+ $_ =~ /\/(.*)sensors-(.*)\/(.*)\.rrd/;
+ my $label = $2.$3;$label=~ s/-//g;
+ if ( $sensorsettings{'LINE-'.$label} ne "on" ){
+ $sensorsettings{'LINE-'.$label} = 'off';
+ } elsif ($sensorsettings{'LINE-'.$label} eq "on" ){
+ $sensorsettings{'LINE-'.$label} = 'checked';
+ }
+ $sensorsettings{'LABEL-'.$label} =~ s/\W//g;
+ }
+ &General::writehash("${General::swroot}/sensors/settings", \%sensorsettings);
+ }