<commit_before><?php
/*
Copyright 2010 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

require_once("utils.php");
require_once("ui.php");

$gArchive = ( array_key_exists("a", $_GET) ? $_GET["a"] : "" );
$gLabel = ( array_key_exists("l", $_GET) ? $_GET["l"] : latestLabel($gArchive) );
$gTitle = $gArchive;
?>
<!doctype html>
<html>
<head>
	<link type="text/css" rel="stylesheet" href="style.css" />
	
	<title>HTTP Archive - <?php echo $gTitle ?></title>
	<meta charset="UTF-8">
</head>

<body>
<?php echo uiHeader($gTitle); ?>

<?php
if ( $gArchive ) {
	echo <<<OUTPUT
<div style='float: right; font-size: 0.8em; text-align: right;'>
<a href='urls.php?a=$gArchive'>list of URLs</a>
<br>
<a href='download.php?a=$gArchive&l=$gLabel&format=csv'>download CSV</a>
</div>
OUTPUT;
}
?>

<form>
	<label>Choose an archive:</label>
	<select onChange="document.location='viewarchive.php?a='+escape(this.options[this.selectedIndex].value)">
<?php
$aNames = archiveNames();
for ( $i = 0; $i < count($aNames); $i++ ) {
	$name = $aNames[$i];
	echo "  <option value='$name'" . ( $name == $gArchive ? " selected" : "" ) . ">$name</option>\n";
}
?>
	</select>

<?php
if ( $gArchive ) { ?>
	<label>Chose a run:</label>

	<?php echo selectArchiveLabel($gArchive, $gLabel);
 } ?>
</form>

<?php
if ( $gArchive ) {
	echo "<table id=stats class=tablesort>\n" .
		"<tr><th>Website</th>";

	// column headers
	//$aColumns = array("onLoad", "renderStart", "PageSpeed", "reqTotal", "bytesTotal", "reqHtml", "bytesHtml", "reqJS", "bytesJS", "reqCSS", "bytesCSS", "reqImg", "bytesImg", "numDomains");
	$aColumns = array("onLoad", "renderStart", "PageSpeed", "reqTotal", "bytesTotal", "numDomains");
	foreach($aColumns as $column) {
		echo "<th class='sortnum'>" . $ghColumnTitles[$column] . "</th> ";
	}
	echo "</tr>\n";
<commit_msg>Added 3 column layout at top; needs test of multiple archives<commit_after><?php
/*
Copyright 2010 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

require_once("utils.php");
require_once("ui.php");

$gArchive = ( array_key_exists("a", $_GET) ? $_GET["a"] : "" );
$gLabel = ( array_key_exists("l", $_GET) ? $_GET["l"] : latestLabel($gArchive) );
$gTitle = $gArchive;
?>
<!doctype html>
<html>
<head>
	<link type="text/css" rel="stylesheet" href="style.css" />
	
	<title>HTTP Archive - <?php echo $gTitle ?></title>
	<meta charset="UTF-8">
</head>

<body>
<?php echo uiHeader($gTitle); ?>

<section class="even-columns">
<form>
	<label>Choose an archive:</label>
	<select onChange="document.location='viewarchive.php?a='+escape(this.options[this.selectedIndex].value)">
<?php
$aNames = archiveNames();
for ( $i = 0; $i < count($aNames); $i++ ) {
	$name = $aNames[$i];
	echo "  <option value='$name'" . ( $name == $gArchive ? " selected" : "" ) . ">$name</option>\n";
}
?>
	</select>
</form>

<?php
if ( $gArchive ) { ?>
<form>
	<label>Chose a run:</label>

	<?php echo selectArchiveLabel($gArchive, $gLabel); ?>
</form>
<?php } ?>


<?php
if ( $gArchive ) {
	echo <<<OUTPUT
	<p><a href='urls.php?a=$gArchive'>list of URLs</a><br><a href='download.php?a=$gArchive&l=$gLabel&format=csv'>download CSV</a></p>
OUTPUT;
}
?>
</section>

<?php
if ( $gArchive ) {
	echo "<table id=stats class=tablesort>\n" .
		"<tr><th>Website</th>";

	// column headers
	//$aColumns = array("onLoad", "renderStart", "PageSpeed", "reqTotal", "bytesTotal", "reqHtml", "bytesHtml", "reqJS", "bytesJS", "reqCSS", "bytesCSS", "reqImg", "bytesImg", "numDomains");
	$aColumns = array("onLoad", "renderStart", "PageSpeed", "reqTotal", "bytesTotal", "numDomains");
	foreach($aColumns as $column) {
		echo "<th class='sortnum'>" . $ghColumnTitles[$column] . "</th> ";
	}
	echo "</tr>\n";

{'fraction_non_alphanumeric': 0.19694360740421868, 'fraction_numerical': 0.0049504950495049506, 'mean_word_length': 5.09043250327654, 'pattern_counts': {'":': 0, '<': 98, '<?xml version=': 0, '>': 88, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6368508', 'n_tokens_mistral': 1668, 'n_tokens_neox': 1595, 'n_words': 440}