diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index e67d909a..3602099f 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -13,6 +13,7 @@ use Number::Bytes::Human qw(format_bytes); use Encode; use File::Basename; use JSON::MaybeXS; +use HTML::Entities; use List::Util qw[min max]; use List::SomeUtils qw{any}; use Net::Prometheus; @@ -229,7 +230,7 @@ sub machines :Local Args(0) { $c->stash->{pretty_percent} = sub { my ($percent) = @_; my $ret = sprintf('%.2f', $percent); - return (' ' x (6 - length($ret))) . $ret; + return (' ' x (6 - length($ret))) . encode_entities($ret); }; $self->status_ok($c, entity => $c->stash->{machines}); } diff --git a/src/root/common.tt b/src/root/common.tt index 38bb64f2..b18d33f7 100644 --- a/src/root/common.tt +++ b/src/root/common.tt @@ -444,9 +444,9 @@ BLOCK renderInputDiff; %] BLOCK renderPager %] [% END; @@ -700,7 +700,7 @@ BLOCK createChart %] diff --git a/src/root/machine-status.tt b/src/root/machine-status.tt index fcb201cf..86713c85 100644 --- a/src/root/machine-status.tt +++ b/src/root/machine-status.tt @@ -36,7 +36,7 @@ [% pressure = m.value.stats.pressure %] [% MACRO render_pressure(title, pressure) BLOCK %] [% IF pressure %] - [% HTML.escape(title) %]:[% pretty_percent(pressure.avg10) | html %]%[% pretty_percent(pressure.avg60) | html %]%[% pretty_percent(pressure.avg300) | html %]% + [% HTML.escape(title) %]:[% pretty_percent(pressure.avg10) %]%[% pretty_percent(pressure.avg60) %]%[% pretty_percent(pressure.avg300) %]% [% END %] [% END %] [% IF pressure %]