aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-testbed
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-03-21 12:19:22 +0100
committerAleksandr Nogikh <nogikh@google.com>2024-03-21 16:42:53 +0000
commit10ed73e36c73f4a0642c30c1e7ab2d247a148e12 (patch)
tree218654efaf46a5538118cebd9a76817a7e199043 /tools/syz-testbed
parentf61173d242590d5ebf0d1ef9fd516e8977db1674 (diff)
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.
Diffstat (limited to 'tools/syz-testbed')
-rw-r--r--tools/syz-testbed/templates/table.html18
1 files changed, 4 insertions, 14 deletions
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 @@
</td>
{{range $c := $uiTable.Table.ColumnHeaders}}
{{$cell := ($uiTable.Table.Get $r $c)}}
- {{if and $cell $uiTable.Extra}}
- <td>{{template "PrintValue" $cell.Value}}</td>
- <td>{{template "PrintExtra" $cell}}</td>
- {{else}}
- <td>{{$cell}}</td>
- {{end}}
+ <td>{{if $cell}}{{$cell}}{{end}}</td>
+ {{if $uiTable.Extra}}
+ <td>{{if $cell}}{{template "PrintExtra" $cell}}{{end}}</td>
+ {{end}}
{{end}}
</tr>
{{end}}