Commit 18baa942 authored by Dietmar Maurer's avatar Dietmar Maurer

Formatter/HTML: improve output format

parent 96eb4f9c
...@@ -202,19 +202,25 @@ PVE::HTTPServer::register_formatter($portal_format, sub { ...@@ -202,19 +202,25 @@ PVE::HTTPServer::register_formatter($portal_format, sub {
next if !ref($elem); next if !ref($elem);
if (defined(my $value = $elem->{$prop})) { if (defined(my $value = $elem->{$prop})) {
if ($value ne '') { my $tv = to_json($elem, {pretty => 1, allow_nonref => 1, canonical => 1});
my $text = $value;
if (scalar(keys %$elem) > 1) { push @$items, {
my $tv = to_json($elem, {allow_nonref => 1, canonical => 1}); tag => 'a',
$text = "$value $tv"; class => 'list-group-item',
} href => "$path/$value",
push @$items, { cn => [
tag => 'a', {
class => 'list-group-item', tag => 'h4',
href => "$path/$value", class => 'list-group-item-heading',
text => $text, text => $value,
} },
} {
tag => 'pre',
class => 'list-group-item',
text => $tv,
},
],
};
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment