Page 1 of 1

disk temperature colors

Posted: 04 Jun 2014 04:35
by chachi420
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.

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>"; 
}
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.
status check.JPG

Re: disk temperature colors

Posted: 02 Jul 2014 21:58
by RedAntz
Hi chachi420,

Thanks for suggestions. New feature to highlight temperature text in Status|Disks page based on Informal and Critical threshold at Temperature monitoring section in Disks|Management|S.M.A.R.T. is implemented and will be available in next release.

Re: disk temperature colors

Posted: 14 Jul 2014 23:33
by chachi420
RedAntz wrote:Hi chachi420,

Thanks for suggestions. New feature to highlight temperature text in Status|Disks page based on Informal and Critical threshold at Temperature monitoring section in Disks|Management|S.M.A.R.T. is implemented and will be available in next release.
Oh wow i didnt even get any notification of this reply. Good thing i just accidentally checked it. Thank you so much!