File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -6,26 +6,25 @@ use warnings;
66# Display the meta-data page - the internal status of the server and VWF system
77
88use 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
31301;
You can’t perform that action at this time.
0 commit comments