From 10ed73e36c73f4a0642c30c1e7ab2d247a148e12 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 21 Mar 2024 12:19:22 +0100 Subject: tools/syz-testbed: fix html table columns If the column value is not present, but compute relative value changes, we still need to add two cells. Also, there's no need in the PrintValue template -- the String() method does the same computation. --- tools/syz-testbed/templates/table.html | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'tools') diff --git a/tools/syz-testbed/templates/table.html b/tools/syz-testbed/templates/table.html index e6da9dda2..3b7213f5a 100644 --- a/tools/syz-testbed/templates/table.html +++ b/tools/syz-testbed/templates/table.html @@ -1,11 +1,3 @@ -{{define "PrintValue"}} - {{if or (lt . -100.0) (gt . 100.0)}} - {{printf "%.0f" .}} - {{else}} - {{printf "%.1f" .}} - {{end}} -{{end}} - {{define "PrintExtra"}} {{if .PercentChange}} {{$numVal := (dereference .PercentChange)}} @@ -57,12 +49,10 @@ {{range $c := $uiTable.Table.ColumnHeaders}} {{$cell := ($uiTable.Table.Get $r $c)}} - {{if and $cell $uiTable.Extra}} - {{template "PrintValue" $cell.Value}} - {{template "PrintExtra" $cell}} - {{else}} - {{$cell}} - {{end}} + {{if $cell}}{{$cell}}{{end}} + {{if $uiTable.Extra}} + {{if $cell}}{{template "PrintExtra" $cell}}{{end}} + {{end}} {{end}} {{end}} -- cgit mrf-deployment