disk temperature colors
Posted: 04 Jun 2014 04:35
Hello everyone,
I am a complete noob and I was just playing around with the php codes and I thought it would be cool to display the temperatures of the disks under STATUS > DISKS with some colors based on defined value of temperature. So for ex, color of the temperatures above 30 will be red and otherwise will be green. Here is the simple code I wrote.
Where to place it: Do the 'find word in the page' thing with ctrl+F and type in "temp". AFTER the 6th 'temp' (which ends like this " htmlspecialchars($temp));?> ") so put it right after that semicolon after the 6th 'temp' word and save it. Of course, you can modify the code however you want and you can set the temperature you want in the code in the beginning. Set the threshold however you want and the color as well. Have fun with it. I thought it'd be helpful only because my disks used to get pretty hot and i had to go through all temperatures to see which one was higher. Now, if i see red color, boom!, i go and turn on the fan or something. My NAS is on one heck of an old computer so no good ventilation system lol. That's why I did this. I'm attaching a screenshot as well to see how it looks before you try it.
I am a complete noob and I was just playing around with the php codes and I thought it would be cool to display the temperatures of the disks under STATUS > DISKS with some colors based on defined value of temperature. So for ex, color of the temperatures above 30 will be red and otherwise will be green. Here is the simple code I wrote.
Code: Select all
if($temp <= 29){
$temp = "<div style=\"color: green; font-weight: bold;\">$temp</div>";
}
else
{
$temp = "<div style=\"color: red; font-weight: bold;\">$temp</div>";
}