Skip to content

Commit 571aaec

Browse files
committed
Revert meta_data page
1 parent 85a1eed commit 571aaec

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

lib/VWF/Display/meta_data.pm

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@ use warnings;
66
# Display the meta-data page - the internal status of the server and VWF system
77

88
use parent 'VWF::Display';
9-
use JSON::MaybeXS;
109

11-
sub html {
10+
sub html
11+
{
1212
my $self = shift;
13-
my %args = ref($_[0]) eq 'HASH' ? %{$_[0]} : @_;
13+
my %args = (ref($_[0]) eq 'HASH') ? %{$_[0]} : @_;
1414

1515
my $vwf_log = $args{'vwf_log'} or die "Missing 'vwf_log' handle";
1616
my $domain_name = $self->{'info'}->domain_name();
1717

18-
my @datapoints;
19-
for my $type (qw(web mobile search robot)) {
18+
my $datapoints;
19+
foreach my $type('web', 'mobile', 'search', 'robot') {
2020
my @entries = $vwf_log->type({ domain_name => $domain_name, type => $type });
21-
push @datapoints, { y => scalar(@entries), label => $type };
22-
23-
if(my $logger = $self->{'logger'}) {
24-
$logger->debug("$type = " . scalar(@entries));
21+
$datapoints .= '{y: ' . scalar(@entries) . ", label: \"$type\"},\n";
22+
if($self->{'logger'}) {
23+
$self->{'logger'}->debug("$type = " . scalar(@entries));
2524
}
2625
}
2726

28-
return $self->SUPER::html({ datapoints => JSON::MaybeXS::encode_json(\@datapoints) });
27+
return $self->SUPER::html({ datapoints => $datapoints });
2928
}
3029

3130
1;

0 commit comments

Comments
 (0)