Skip to content

Commit

Permalink
fixed the size of graphs in Multihost viewer when using a bigger 'glo…
Browse files Browse the repository at this point in the history
…bal_zoom' value
  • Loading branch information
mikaku committed Nov 29, 2023
1 parent 487d32d commit 9861c01
Show file tree
Hide file tree
Showing 57 changed files with 1,188 additions and 1,017 deletions.
13 changes: 8 additions & 5 deletions lib/ambsens.pm
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ sub ambsens_cgi {
my $colors = $cgi->{colors};
my $graph = $cgi->{graph};
my $silent = $cgi->{silent};
my $zoom = "--zoom=" . $config->{global_zoom};
my $zoom = $config->{global_zoom};
my %rrd = (
'new' => \&RRDs::graphv,
'old' => \&RRDs::graph,
Expand Down Expand Up @@ -387,13 +387,16 @@ sub ambsens_cgi {
# graph mode
#
if($silent eq "yes" || $silent eq "imagetag") {
$zoom = 1; # force 'global_zoom' to 1 in Multihost viewer
$colors->{fg_color} = "#000000"; # visible color for text mode
$u = "_";
}
if($silent eq "imagetagbig") {
$zoom = 1; # force 'global_zoom' to 1 in Multihost viewer
$colors->{fg_color} = "#000000"; # visible color for text mode
$u = "";
}
my $global_zoom = "--zoom=" . $zoom;

for($n = 0; $n < scalar(my @sl = split(',', $ambsens->{list})); $n++) {
$str = $u . $package . $n . "." . $tf->{when} . ".$imgfmt_lc";
Expand Down Expand Up @@ -468,7 +471,7 @@ sub ambsens_cgi {
"--height=$height",
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
"DEF:s1=$rrd:ambsens" . $n . "_s1:AVERAGE",
Expand Down Expand Up @@ -497,7 +500,7 @@ sub ambsens_cgi {
@full_size_mode,
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
"DEF:s1=$rrd:ambsens" . $n . "_s1:AVERAGE",
Expand All @@ -521,8 +524,8 @@ sub ambsens_cgi {
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$n], IMG => $IMG[$n]) . "\n");
} else {
if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
$picz_width = $picz->{image_width} * $zoom;
$picz_height = $picz->{image_height} * $zoom;
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
Expand Down
13 changes: 8 additions & 5 deletions lib/amdenergy.pm
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ sub amdenergy_cgi {
my $colors = $cgi->{colors};
my $graph = $cgi->{graph};
my $silent = $cgi->{silent};
my $zoom = "--zoom=" . $config->{global_zoom};
my $zoom = $config->{global_zoom};
my %rrd = (
'new' => \&RRDs::graphv,
'old' => \&RRDs::graph,
Expand Down Expand Up @@ -509,13 +509,16 @@ sub amdenergy_cgi {
# graph mode
#
if($silent eq "yes" || $silent eq "imagetag") {
$zoom = 1; # force 'global_zoom' to 1 in Multihost viewer
$colors->{fg_color} = "#000000"; # visible color for text mode
$u = "_";
}
if($silent eq "imagetagbig") {
$zoom = 1; # force 'global_zoom' to 1 in Multihost viewer
$colors->{fg_color} = "#000000"; # visible color for text mode
$u = "";
}
my $global_zoom = "--zoom=" . $zoom;

my $plots_per_list_item = 1;
foreach my $k (sort keys %{$amdenergy->{list}}) {
Expand Down Expand Up @@ -712,7 +715,7 @@ sub amdenergy_cgi {
"--height=$height",
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
$large_plot ? () : @{$cgi->{version12_small}},
@{$colors->{graph_colors}},
Expand All @@ -734,7 +737,7 @@ sub amdenergy_cgi {
@full_size_mode,
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
$large_plot ? () : @{$cgi->{version12_small}},
@{$colors->{graph_colors}},
Expand All @@ -752,8 +755,8 @@ sub amdenergy_cgi {
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * $plots_per_list_item + $n_plot], IMG => $IMG[$e * $plots_per_list_item + $n_plot]) . "\n");
} else {
if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
$picz_width = $picz->{image_width} * $zoom;
$picz_height = $picz->{image_height} * $zoom;
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
Expand Down
13 changes: 8 additions & 5 deletions lib/amdgpu.pm
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ sub amdgpu_cgi {
my $colors = $cgi->{colors};
my $graph = $cgi->{graph};
my $silent = $cgi->{silent};
my $zoom = "--zoom=" . $config->{global_zoom};
my $zoom = $config->{global_zoom};
my %rrd = (
'new' => \&RRDs::graphv,
'old' => \&RRDs::graph,
Expand Down Expand Up @@ -443,13 +443,16 @@ sub amdgpu_cgi {
# graph mode
#
if($silent eq "yes" || $silent eq "imagetag") {
$zoom = 1; # force 'global_zoom' to 1 in Multihost viewer
$colors->{fg_color} = "#000000"; # visible color for text mode
$u = "_";
}
if($silent eq "imagetagbig") {
$zoom = 1; # force 'global_zoom' to 1 in Multihost viewer
$colors->{fg_color} = "#000000"; # visible color for text mode
$u = "";
}
my $global_zoom = "--zoom=" . $zoom;

for($n = 0; $n < keys(%{$amdgpu->{list}}); $n++) {
for($n2 = 0; $n2 < $number_of_sensor_values_in_use; $n2++) {
Expand Down Expand Up @@ -712,7 +715,7 @@ sub amdgpu_cgi {
"--height=$height",
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
$n_plot < $main_sensor_plots ? () : @{$cgi->{version12_small}},
@{$colors->{graph_colors}},
Expand All @@ -734,7 +737,7 @@ sub amdgpu_cgi {
@full_size_mode,
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
$n_plot < $main_sensor_plots ? () : @{$cgi->{version12_small}},
@{$colors->{graph_colors}},
Expand All @@ -752,8 +755,8 @@ sub amdgpu_cgi {
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * $number_of_sensor_values_in_use + $n_plot], IMG => $IMG[$e * $number_of_sensor_values_in_use + $n_plot]) . "\n");
} else {
if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
$picz_width = $picz->{image_width} * $zoom;
$picz_height = $picz->{image_height} * $zoom;
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
Expand Down
53 changes: 28 additions & 25 deletions lib/apache.pm
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ sub apache_cgi {
my $colors = $cgi->{colors};
my $graph = $cgi->{graph};
my $silent = $cgi->{silent};
my $zoom = "--zoom=" . $config->{global_zoom};
my $zoom = $config->{global_zoom};
my %rrd = (
'new' => \&RRDs::graphv,
'old' => \&RRDs::graph,
Expand Down Expand Up @@ -827,13 +827,16 @@ sub apache_cgi {
# graph mode
#
if($silent eq "yes" || $silent eq "imagetag") {
$zoom = 1; # force 'global_zoom' to 1 in Multihost viewer
$colors->{fg_color} = "#000000"; # visible color for text mode
$u = "_";
}
if($silent eq "imagetagbig") {
$zoom = 1; # force 'global_zoom' to 1 in Multihost viewer
$colors->{fg_color} = "#000000"; # visible color for text mode
$u = "";
}
my $global_zoom = "--zoom=" . $zoom;

for($n = 0; $n < scalar(my @al = split(',', $apache->{list})); $n++) {
for($n2 = 1; $n2 <= 6; $n2++) {
Expand Down Expand Up @@ -903,7 +906,7 @@ sub apache_cgi {
"--height=$height",
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
"DEF:apache" . $e . "_busy=$rrd:apache" . $e . "_busy:AVERAGE",
Expand All @@ -929,7 +932,7 @@ sub apache_cgi {
@full_size_mode,
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
"DEF:apache" . $e . "_busy=$rrd:apache" . $e . "_busy:AVERAGE",
Expand All @@ -948,8 +951,8 @@ sub apache_cgi {
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * 6], IMG => $IMG[$e * 6]) . "\n");
} else {
if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
$picz_width = $picz->{image_width} * $zoom;
$picz_height = $picz->{image_height} * $zoom;
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
Expand Down Expand Up @@ -1033,7 +1036,7 @@ sub apache_cgi {
"--height=$height",
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
"DEF:apache" . $e . "_star=$rrd:apache" . $e . "_star:AVERAGE",
Expand Down Expand Up @@ -1061,7 +1064,7 @@ sub apache_cgi {
@full_size_mode,
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
"DEF:apache" . $e . "_star=$rrd:apache" . $e . "_star:AVERAGE",
Expand All @@ -1083,8 +1086,8 @@ sub apache_cgi {
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * 6 + 1], IMG => $IMG[$e * 6 + 1]) . "\n");
} else {
if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
$picz_width = $picz->{image_width} * $zoom;
$picz_height = $picz->{image_height} * $zoom;
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
Expand Down Expand Up @@ -1132,7 +1135,7 @@ sub apache_cgi {
"--height=$height",
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
Expand All @@ -1154,7 +1157,7 @@ sub apache_cgi {
@full_size_mode,
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
Expand All @@ -1172,8 +1175,8 @@ sub apache_cgi {
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * 6 + 2], IMG => $IMG[$e * 6 + 2]) . "\n");
} else {
if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
$picz_width = $picz->{image_width} * $zoom;
$picz_height = $picz->{image_height} * $zoom;
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
Expand Down Expand Up @@ -1217,7 +1220,7 @@ sub apache_cgi {
"--height=$height",
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
Expand All @@ -1239,7 +1242,7 @@ sub apache_cgi {
@full_size_mode,
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
Expand All @@ -1257,8 +1260,8 @@ sub apache_cgi {
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * 6 + 3], IMG => $IMG[$e * 6 + 3]) . "\n");
} else {
if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
$picz_width = $picz->{image_width} * $zoom;
$picz_height = $picz->{image_height} * $zoom;
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
Expand Down Expand Up @@ -1309,7 +1312,7 @@ sub apache_cgi {
"--height=$height",
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
Expand All @@ -1334,7 +1337,7 @@ sub apache_cgi {
@full_size_mode,
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
Expand All @@ -1355,8 +1358,8 @@ sub apache_cgi {
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * 6 + 4], IMG => $IMG[$e * 6 + 4]) . "\n");
} else {
if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
$picz_width = $picz->{image_width} * $zoom;
$picz_height = $picz->{image_height} * $zoom;
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
Expand Down Expand Up @@ -1400,7 +1403,7 @@ sub apache_cgi {
"--height=$height",
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
Expand All @@ -1422,7 +1425,7 @@ sub apache_cgi {
@full_size_mode,
@extra,
@riglim,
$zoom,
$global_zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
Expand All @@ -1440,8 +1443,8 @@ sub apache_cgi {
push(@output, " " . picz_a_element(config => $config, IMGz => $IMGz[$e * 6 + 5], IMG => $IMG[$e * 6 + 5]) . "\n");
} else {
if($version eq "new") {
$picz_width = $picz->{image_width} * $config->{global_zoom};
$picz_height = $picz->{image_height} * $config->{global_zoom};
$picz_width = $picz->{image_width} * $zoom;
$picz_height = $picz->{image_height} * $zoom;
} else {
$picz_width = $width + 115;
$picz_height = $height + 100;
Expand Down
Loading

0 comments on commit 9861c01

Please sign in to comment.