]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/hardwaregraphs.cgi
IPsec: Ensure that iOS VPNs are always connected
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / hardwaregraphs.cgi
index e32f07c25465d9715507cfb39fc575c17325be4f..813d32f7b5b383368bee5c0e3755bf04a2af6c2f 100644 (file)
@@ -33,7 +33,7 @@ require "${General::swroot}/graphs.pl";
 my %color = ();
 my %mainsettings = ();
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
-&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
 
 my %sensorsettings = ();
 
@@ -67,13 +67,17 @@ if ( $querry[0] =~ "hwtemp"){
        print "Content-type: image/png\n\n";
        binmode(STDOUT);
        &Graphs::updatethermaltempgraph($querry[1]);
-}elsif ( $querry[0] =~ "sd?" || $querry[0] =~ "hd?" || $querry[0] =~ "xvd??" ){
+}elsif ( $querry[0] =~ "sd?" ){
+       print "Content-type: image/png\n\n";
+       binmode(STDOUT);
+       &Graphs::updatehddgraph($querry[0],$querry[1]);
+}elsif ( $querry[0] =~ "nvme?" ){
        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::openpage($Lang::tr{'hardware graphs'}, 1, '');
        &Header::openbigbox('100%', 'left');
 
        &Header::getcgihash(\%sensorsettings);
@@ -93,7 +97,7 @@ if ( $querry[0] =~ "hwtemp"){
                &General::writehash("${General::swroot}/sensors/settings", \%sensorsettings);
        }
 
-       my @disks = `find /sys/block/* -maxdepth 0 ! -name sr* ! -name loop* ! -name ram* -exec basename {} \\; | sort | uniq`;
+       my @disks = `ls -1 /sys/block | grep -E '^sd|^nvme' | sort | uniq`;
 
        foreach (@disks){
                my $disk = $_;
@@ -113,7 +117,7 @@ if ( $querry[0] =~ "hwtemp"){
 
        if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*/temperature-* 2>/dev/null` ) {
                &Header::openbox('100%', 'center', "hwtemp $Lang::tr{'graph'}");
-               &Graphs::makegraphbox("hardwaregraphs.cgi","hwtemp","day","375");
+               &Graphs::makegraphbox("hardwaregraphs.cgi","hwtemp","day");
                Header::closebox();
        }
 
@@ -125,7 +129,7 @@ if ( $querry[0] =~ "hwtemp"){
 
        if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/sensors-*/voltage-* 2>/dev/null` ) {
                &Header::openbox('100%', 'center', "hwvolt $Lang::tr{'graph'}");
-               &Graphs::makegraphbox("hardwaregraphs.cgi","hwvolt","day","435");
+               &Graphs::makegraphbox("hardwaregraphs.cgi","hwvolt","day");
                &Header::closebox();
        }
 
@@ -163,7 +167,7 @@ END
 
        print <<END
 <tr>
-       <td align='center' colspan='2' ><input type='submit' name='ACTION' value=$Lang::tr{'save'} /></td>
+       <td align='center' colspan='2' ><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
 </tr>
 </table>
 </form>