Add alt_scaling_for_timeleft, alt_scaling_for_battery_voltage and alt_scaling_for_voltage config options to nut module.

This option sets the alternative scaling option for the corresponding plots.
This commit is contained in:
Andreas Bachlechner 2022-02-28 22:09:49 +01:00
parent 9bed02ca3f
commit c29f1c3325
2 changed files with 40 additions and 0 deletions

View File

@ -259,6 +259,16 @@ sub skipscale_string {
}
}
sub altscaling_options {
my ($altscaling) = @_;
my @scaling_options;
if ($altscaling) {
push(@scaling_options, "--alt-autoscale");
push(@scaling_options, "--alt-y-grid");
}
return @scaling_options;
}
sub nut_cgi {
my ($package, $config, $cgi) = @_;
my @output;
@ -321,6 +331,9 @@ sub nut_cgi {
my $ignore_error_output = lc($nut->{ignore_error_output} || "") eq "y" ? 1 : 0;
my $skipscale_for_transfer_voltage = lc($nut->{skipscale_for_transfer_voltage} || "") eq "y" ? 1 : 0;
my $skipscale_for_shutdown_level = lc($nut->{skipscale_for_shutdown_level} || "") eq "y" ? 1 : 0;
my $alt_scaling_for_voltage = lc($nut->{alt_scaling_for_voltage} || "") eq "y" ? 1 : 0;
my $alt_scaling_for_timeleft = lc($nut->{alt_scaling_for_timeleft} || "") eq "y" ? 1 : 0;
my $alt_scaling_for_battery_voltage = lc($nut->{alt_scaling_for_battery_voltage} || "") eq "y" ? 1 : 0;
# text mode
#
@ -514,6 +527,7 @@ sub nut_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
altscaling_options($alt_scaling_for_voltage),
@extra,
@riglim,
$zoom,
@ -541,6 +555,7 @@ sub nut_cgi {
"--width=$width",
"--height=$height",
@full_size_mode,
altscaling_options($alt_scaling_for_voltage),
@extra,
@riglim,
$zoom,
@ -817,6 +832,7 @@ sub nut_cgi {
"--vertical-label=Volts",
"--width=$width",
"--height=$height",
altscaling_options($alt_scaling_for_battery_voltage),
@extra,
@riglim,
$zoom,
@ -840,6 +856,7 @@ sub nut_cgi {
"--width=$width",
"--height=$height",
@full_size_mode,
altscaling_options($alt_scaling_for_battery_voltage),
@extra,
@riglim,
$zoom,
@ -906,6 +923,7 @@ sub nut_cgi {
"--vertical-label=Minutes",
"--width=$width",
"--height=$height",
altscaling_options($alt_scaling_for_timeleft),
@extra,
@riglim,
$zoom,
@ -930,6 +948,7 @@ sub nut_cgi {
"--vertical-label=Minutes",
"--width=$width",
"--height=$height",
altscaling_options($alt_scaling_for_timeleft),
@full_size_mode,
@extra,
@riglim,

View File

@ -4234,6 +4234,27 @@ This option, when enabled via \fIy\fP, ignores the shutdown level graph when sca
.P
Default value: \fIn\fP
.RE
.P
.BI alt_scaling_for_voltage
.RS
This option, when enabled via \fIy\fP, sets alternate plot axis scaling for the voltage graph. This can be useful to improve the scaling in some cases.
.P
Default value: \fIn\fP
.RE
.P
.BI alt_scaling_for_timeleft
.RS
This option, when enabled via \fIy\fP, sets alternate plot axis scaling for the time left graph. This can be useful to improve the scaling in some cases.
.P
Default value: \fIn\fP
.RE
.P
.BI alt_scaling_for_battery_voltage
.RS
This option, when enabled via \fIy\fP, sets alternate plot axis scaling for the battery voltage graph. This can be useful to improve the scaling in some cases.
.P
Default value: \fIn\fP
.RE
.SS Wowza Media Server (wowza.pm)
This graph is able to monitor an unlimited number of Wowza servers.
.P