changed option to 'temperature_scale'

This commit is contained in:
Jordi Sanfeliu 2013-03-27 19:58:09 +01:00
parent d44d572cdc
commit 6e5bb906f0
7 changed files with 15 additions and 15 deletions

View File

@ -1,6 +1,6 @@
3.N.N - NN-XXX-2013
====================
- Added a new option called 'temperatures_scale' to be able to toggle between
- Added a new option called 'temperature_scale' to be able to toggle between
values in Celsius or in Fahrenheit.
(suggested by Bryan Guidroz, bryanguidroz AT hotmail.com)

View File

@ -55,7 +55,7 @@ sub celsius_to {
my ($config, $celsius) = @_;
$celsius = $celsius || 0;
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
return ($celsius * (9 / 5)) + 32;
}
return $celsius;

View File

@ -246,7 +246,7 @@ sub disk_cgi {
$title = !$silent ? $title : "";
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
$temp_scale = "Fahrenheit";
}
@ -379,7 +379,7 @@ sub disk_cgi {
print(" <tr>\n");
print(" <td bgcolor='$colors->{title_bg_color}'>\n");
}
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
push(@CDEF, "CDEF:temp_0=9,5,/,temp0,*,32,+");
push(@CDEF, "CDEF:temp_1=9,5,/,temp1,*,32,+");
push(@CDEF, "CDEF:temp_2=9,5,/,temp2,*,32,+");

View File

@ -208,7 +208,7 @@ sub hptemp_cgi {
$title = !$silent ? $title : "";
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
$temp_scale = "Fahrenheit";
}
@ -350,7 +350,7 @@ sub hptemp_cgi {
push(@tmp, "COMMENT: \\n");
}
}
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
push(@CDEF, "CDEF:temp_0=9,5,/,temp0,*,32,+");
push(@CDEF, "CDEF:temp_1=9,5,/,temp1,*,32,+");
push(@CDEF, "CDEF:temp_2=9,5,/,temp2,*,32,+");
@ -468,7 +468,7 @@ sub hptemp_cgi {
push(@tmp, "COMMENT: \\n") unless ($n + 1) % 2;
}
}
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
push(@CDEF, "CDEF:temp_0=9,5,/,temp0,*,32,+");
push(@CDEF, "CDEF:temp_1=9,5,/,temp1,*,32,+");
push(@CDEF, "CDEF:temp_2=9,5,/,temp2,*,32,+");
@ -575,7 +575,7 @@ sub hptemp_cgi {
push(@tmp, "COMMENT: \\n") unless ($n + 1) % 2;
}
}
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
push(@CDEF, "CDEF:temp_0=9,5,/,temp0,*,32,+");
push(@CDEF, "CDEF:temp_1=9,5,/,temp1,*,32,+");
push(@CDEF, "CDEF:temp_2=9,5,/,temp2,*,32,+");

View File

@ -337,7 +337,7 @@ sub lmsens_cgi {
$title = !$silent ? $title : "";
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
$temp_scale = "Fahrenheit";
}
@ -553,7 +553,7 @@ sub lmsens_cgi {
print(" <tr>\n");
print(" <td valign='bottom' bgcolor='$colors->{title_bg_color}'>\n");
}
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
push(@CDEF, "CDEF:core_0=9,5,/,core0,*,32,+");
push(@CDEF, "CDEF:core_1=9,5,/,core1,*,32,+");
push(@CDEF, "CDEF:core_2=9,5,/,core2,*,32,+");
@ -832,7 +832,7 @@ sub lmsens_cgi {
push(@tmpz, "LINE2:cpu_1#EEEE44:CPU 1") unless !$lmsens->{list}->{'cpu1'};
push(@tmpz, "LINE2:cpu_2#EE44EE:CPU 2") unless !$lmsens->{list}->{'cpu2'};
push(@tmpz, "LINE2:cpu_3#44EE44:CPU 3") unless !$lmsens->{list}->{'cpu3'};
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
push(@CDEF, "CDEF:mb_0=9,5,/,mb0,*,32,+");
push(@CDEF, "CDEF:mb_1=9,5,/,mb1,*,32,+");
push(@CDEF, "CDEF:cpu_0=9,5,/,cpu0,*,32,+");
@ -1033,7 +1033,7 @@ sub lmsens_cgi {
push(@tmpz, "LINE2:gpu_6#EE44EE:GPU 6\\g") unless !$lmsens->{list}->{'gpu6'};
push(@tmpz, "LINE2:gpu_7#EEEE44:GPU 7\\g") unless !$lmsens->{list}->{'gpu7'};
push(@tmpz, "LINE2:gpu_8#963C74:GPU 8\\g") unless !$lmsens->{list}->{'gpu8'};
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
push(@CDEF, "CDEF:gpu_0=9,5,/,gpu0,*,32,+");
push(@CDEF, "CDEF:gpu_1=9,5,/,gpu1,*,32,+");
push(@CDEF, "CDEF:gpu_2=9,5,/,gpu2,*,32,+");

View File

@ -229,7 +229,7 @@ sub nvidia_cgi {
$title = !$silent ? $title : "";
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
$temp_scale = "Fahrenheit";
}
@ -341,7 +341,7 @@ sub nvidia_cgi {
print(" <tr>\n");
print(" <td bgcolor='$colors->{title_bg_color}'>\n");
}
if(lc($config->{temperatures_scale}) eq "f") {
if(lc($config->{temperature_scale}) eq "f") {
push(@CDEF, "CDEF:temp_0=9,5,/,temp0,*,32,+");
push(@CDEF, "CDEF:temp_1=9,5,/,temp1,*,32,+");
push(@CDEF, "CDEF:temp_2=9,5,/,temp2,*,32,+");

View File

@ -11,7 +11,7 @@ iface_mode = graph
enable_zoom = y
netstats_in_bps = n
disable_javascript_void = n
temperatures_scale = c
temperature_scale = c
base_dir = /usr/share/monitorix/
base_lib = /var/lib/monitorix/