Skip to content

Commit

Permalink
Move netlink command to rightmost column of html table.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluhm committed Dec 26, 2023
1 parent 1637aa0 commit a0a2b05
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions netlink-html.pl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ sub html_hier_test_head {
my ($html, @hiers) = @_;

foreach my $hier (@HIERARCHY) {
print $html " <tr>\n <th></th>\n";
print $html " <tr>\n";
print $html " <th>$hier</th>\n";
foreach my $hv (@hiers) {
my $title = "";
Expand All @@ -155,7 +155,7 @@ sub html_hier_test_head {
}
print $html " <th$title>$name</th>\n";
}
print $html " </tr>\n";
print $html " <th></th>\n </tr>\n";
}
}

Expand All @@ -165,8 +165,7 @@ sub html_hier_test_row {
(my $testcmd = $test) =~ s/_/ /g;
my $testdesc = $TESTDESC{$test} || "";
print $html " <tr>\n";
print $html " <th class=\"desc\">$testdesc</th>\n";
print $html " <td class=\"test\"><code>$testcmd</code></td>\n";
print $html " <th class=\"desc\" title=\"$testcmd\">$testdesc</th>\n";
foreach my $hv (@hiers) {
my $tv = $td->{$hv->{key}};
my $status = $tv->{status} || "";
Expand All @@ -184,14 +183,15 @@ sub html_hier_test_row {

print $html " <td$class$title>$href$status$enda$stats_href</td>\n";
}
print $html " <td class=\"test\"><code>$testcmd</code></td>\n";
print $html " </tr>\n";

my $vt = $V{$test};
my $maxval = max map { scalar @{$_ || []} } values %$vt;
for (my $i = 0; $i < $maxval; $i++) {
my $value0 = first { $_ } map { $_->[$i] } values %$vt;
my ($name0, $unit0) = ($value0->{name}, $value0->{unit});
print $html " <tr>\n <th></th>\n";
print $html " <tr>\n";
print $html " <th>$name0</th>\n";
foreach my $hv (@hiers) {
my $tv = $td->{$hv->{key}};
Expand All @@ -202,7 +202,7 @@ sub html_hier_test_row {
print $html " <td></td>\n";
}
}
print $html " </tr>\n";
print $html " <th></th>\n </tr>\n";
}
}

Expand Down Expand Up @@ -234,7 +234,7 @@ sub html_hier_test_row_util {
return if ($valsum == 0);

print $html " <tr>\n";
print $html " <th class=\"desc\">$testdesc</th>\n";
print $html " <th class=\"desc\" title=\"$testcmd\">$testdesc</th>\n";
foreach my $hv (@hiers) {
my ($status, $unit, $iface, $value);
for (my $i = 0; $i < $maxval; $i++) {
Expand Down Expand Up @@ -371,15 +371,15 @@ sub write_html_date_file {
my @dates = reverse sort keys %D;
print $html "<table>\n";
print $html " <thead>\n";
print $html " <tr>\n <th></th>\n <th>pass rate</th>\n";
print $html " <tr>\n <th>pass rate</th>\n";
foreach my $date (@dates) {
my $passrate = $D{$date}{pass};
$passrate /= $D{$date}{total} if $D{$date}{total};
my $percent = "";
$percent = sprintf("%d%%", 100 * $passrate) if defined $passrate;
print $html " <th>$percent</th>\n";
}
print $html " <tr>\n <th></th>\n <th>run at date</th>\n";
print $html " <th></th>\n <tr>\n <th>run at date</th>\n";
foreach my $date (@dates) {
my $short = $D{$date}{short};
my $time = encode_entities($date);
Expand All @@ -389,20 +389,20 @@ sub write_html_date_file {
my $enda = $href ? "</a>" : "";
print $html " <th title=\"$time\">$href$short$enda</th>\n";
}
print $html " <tr>\n <th></th>\n <th>sub runs</th>\n";
print $html " <th></th>\n <tr>\n <th>sub runs</th>\n";
foreach my $date (@dates) {
my $num = @{$H{$date}};
print $html " <th>$num</th>\n";
}
print $html " <tr>\n <th></th>\n <th>machine</th>\n";
print $html " <th></th>\n <tr>\n <th>machine</th>\n";
foreach my $date (@dates) {
my $setup = $D{$date}{setup};
my $link = uri_escape($setup, "^A-Za-z0-9\-\._~/");
my $href = $setup ? "<a href=\"$link\">" : "";
my $enda = $href ? "</a>" : "";
print $html " <th>${href}setup info$enda</th>\n";
}
print $html " <tr>\n <th></th>\n <th>architecture</th>\n";
print $html " <th></th>\n <tr>\n <th>architecture</th>\n";
foreach my $date (@dates) {
my $arch = $D{$date}{arch};
my $dmesg = $D{$date}{dmesg};
Expand All @@ -411,7 +411,7 @@ sub write_html_date_file {
my $enda = $href ? "</a>" : "";
print $html " <th>$href$arch$enda</th>\n";
}
print $html " <tr>\n <th></th>\n <th>host</th>\n";
print $html " <th></th>\n <tr>\n <th>host</th>\n";
foreach my $date (@dates) {
my $hostname = $D{$date}{host};
my $hostlink;
Expand All @@ -423,7 +423,7 @@ sub write_html_date_file {
my $enda = $href ? "</a>" : "";
print $html " <th>$href$hostname$enda</th>\n";
}
print $html " </tr>\n";
print $html " <th></th>\n </tr>\n";
print $html " </thead>\n <tbody>\n";

my @tests = sort { $T{$b}{severity} <=> $T{$a}{severity} || $a cmp $b }
Expand All @@ -433,8 +433,8 @@ sub write_html_date_file {
(my $testcmd = $test) =~ s/_/ /g;
my $testdesc = $TESTDESC{$test} || "";
print $html " <tr>\n";
print $html " <th class=\"desc\">$testdesc</th>\n";
print $html " <td class=\"test\"><code>$testcmd</code></td>\n";
print $html
" <th class=\"desc\" title=\"$testcmd\">$testdesc</th>\n";
foreach my $date (@dates) {
my $tv = $T{$test}{$date};
my $status = $tv->{status} || "";
Expand All @@ -447,6 +447,7 @@ sub write_html_date_file {
my $enda = $href ? "</a>" : "";
print $html " <td$class$title>$href$status$enda</td>\n";
}
print $html " <td class=\"test\"><code>$testcmd</code></td>\n";
print $html " </tr>\n";
}
print $html " </tbody>\n";
Expand Down

0 comments on commit a0a2b05

Please sign in to comment.