Added "summary table" to generated index.html page that allows one to

toggle which bug reports are displayed in the report table.

llvm-svn: 49738
This commit is contained in:
Ted Kremenek 2008-04-15 20:47:02 +00:00
parent 7b96b2e7da
commit 43445b3081
1 changed files with 68 additions and 2 deletions

View File

@ -206,6 +206,8 @@ sub Postprocess {
open(OUT, ">$FName") or die "$Prog: Cannot create file '$FName'\n";
# Print out the header.
print OUT <<ENDTEXT;
<html>
<head>
@ -229,7 +231,68 @@ print OUT <<ENDTEXT;
td.View { padding-left: 10px }
</style>
<script src="sorttable.js"></script>
</head>\n<body>
<script language='javascript' type="text/javascript">
function SetDisplay(RowClass, DisplayVal)
{
var Rows = document.getElementsByTagName("tr");
for ( var i = 0 ; i < Rows.length; ++i ) {
if (Rows[i].className == RowClass) {
Rows[i].style.display = DisplayVal;
}
}
}
function ToggleDisplay(CheckButton, ClassName) {
window.console.log("writing");
if (CheckButton.checked) {
SetDisplay(ClassName, "");
}
else {
SetDisplay(ClassName, "none");
}
}
</script>
</head>
<body>
ENDTEXT
# Print out the summary table.
my %Totals;
for my $row ( @Index ) {
my $bug_type = lc($row->[1]);
if (!defined($Totals{$bug_type})) {
$Totals{$bug_type} = 1;
}
else {
$Totals{$bug_type}++;
}
}
print OUT <<ENDTEXT;
<h3>Summary</h3>
<table class="sortable">
<tr>
<td>Bug Type</td>
<td>Quantity</td>
<td "sorttable_nosort">Display?</td>
</tr>
ENDTEXT
for my $key ( sort { $a cmp $b } keys %Totals ) {
my $x = $key;
$x =~ s/\s/_/g;
print OUT "<tr><td>$key</td><td>$Totals{$key}</td><td><input type=\"checkbox\" onClick=\"ToggleDisplay(this,'bt_$x');\" checked/></td></tr>\n";
}
# Print out the table of errors.
print OUT <<ENDTEXT;
</table>
<h3>Reports</h3>
<table class="sortable">
<tr>
<td>Bug Type</td>
@ -242,7 +305,10 @@ ENDTEXT
for my $row ( sort { $a->[1] cmp $b->[1] } @Index ) {
print OUT "<tr>\n";
my $x = lc($row->[1]);
$x =~ s/\s/_/g;
print OUT "<tr class=\"bt_$x\">\n";
my $ReportFile = $row->[0];