diff options
author | Phil Davis <phil.davis@inf.org> | 2016-04-25 13:50:13 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2016-04-25 13:50:13 +0545 |
commit | eb442fec8bd079760a53372bd9eaed7c502f2e98 (patch) | |
tree | 43c4a8494e028781c6f767b5f3b60086fd4968d4 /src/usr/local/www/widgets/widgets | |
parent | 641b5618a764f5b6d56ab72eb7095666d37826b9 (diff) | |
download | pfsense-eb442fec8bd079760a53372bd9eaed7c502f2e98.zip pfsense-eb442fec8bd079760a53372bd9eaed7c502f2e98.tar.gz |
Fix #6251 Temperature on System Information Widget
It just seems that some infrastructure for a temperature bar had been put in place, but the code never finished to actually do it. But I am a bit surprised that it has taken so long for someone to report this.
The temperature is in deg Celsius, so a 0 to 100 "progress bar" works nicely for the typical reasonable temperature range. I have not tried to make it have any sort of good/warning/really hot color indications... - that is for the Temperature Sensors widget.
I also changed to using the ° way to get a degree symbol, rather than the various special character codes that were there. Hopefully ° should be a fully portable way to specify this.
Diffstat (limited to 'src/usr/local/www/widgets/widgets')
-rw-r--r-- | src/usr/local/www/widgets/widgets/system_information.widget.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/usr/local/www/widgets/widgets/system_information.widget.php b/src/usr/local/www/widgets/widgets/system_information.widget.php index 28189e3..1face09 100644 --- a/src/usr/local/www/widgets/widgets/system_information.widget.php +++ b/src/usr/local/www/widgets/widgets/system_information.widget.php @@ -242,9 +242,12 @@ $filesystems = get_mounted_filesystems(); <tr> <th><?=gettext("Temperature");?></th> <td> - <?php $TempMeter = $temp = get_temp(); ?> - <div id="tempPB"></div> - <span id="tempmeter"><?= $temp."°C"; ?></span> + <?php $temp_deg_c = get_temp(); ?> + <div class="progress"> + <div id="tempPB" class="progress-bar progress-bar-striped" role="progressbar" aria-valuenow="<?=$temp_deg_c?>" aria-valuemin="0" aria-valuemax="100" style="width: <?=$temp_deg_c?>%"> + </div> + </div> + <span id="tempmeter"><?= $temp_deg_c . "°C"; ?></span> </td> </tr> <?php endif; ?> @@ -429,10 +432,10 @@ function updateCPU(x) { function updateTemp(x) { if ($("#tempmeter")) { - $("#tempmeter").html(x + '\u00B0' + 'C'); + $("#tempmeter").html(x + '°' + 'C'); } if ($('#tempPB')) { - $("#tempPB").progressbar( { value: parseInt(x) } ); + setProgress('tempPB', parseInt(x)); } } |