html cleanup
This commit is contained in:
parent
dbe3232b2c
commit
10369c9b5e
|
|
@ -1,7 +1,5 @@
|
|||
</div> <!-- /well -->
|
||||
<hr/>
|
||||
|
||||
<footer>
|
||||
<hr/>
|
||||
<p>
|
||||
<a href="http://sitespeed.io">Sitespeed.io</a>
|
||||
written by
|
||||
|
|
@ -11,8 +9,6 @@
|
|||
</p>
|
||||
</footer>
|
||||
|
||||
</div> <!-- /span12 -->
|
||||
</div> <!-- /row -->
|
||||
</div> <!-- /container -->
|
||||
|
||||
<script src="js/jquery-1.7.2.min.js"></script>
|
||||
|
|
|
|||
|
|
@ -2,32 +2,40 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>$document.getRootElement().getAttribute("host").getValue()</title>
|
||||
<title>
|
||||
#if($!{document.getRootElement().getAttribute("host")})
|
||||
$document.getRootElement().getAttribute("host").getValue() -
|
||||
#end
|
||||
$pageTitle
|
||||
</title>
|
||||
<meta name="description" content="$pageDescription">
|
||||
<link rel="stylesheet" href="css/bootstrap.min.css">
|
||||
|
||||
<link rel="shortcut icon" href="img/favicon.png">
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
<style type="text/css">
|
||||
body {
|
||||
padding-top: 55px;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
|
||||
|
||||
.navbar .brand {
|
||||
padding: 2px 20px 2px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
footer p {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.large {
|
||||
font-family: Tahoma,Impact,Verdana,sans-serif;
|
||||
font-size: 32px;
|
||||
line-height: 38px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
<link rel="shortcut icon" href="img/favicon.png">
|
||||
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
|
||||
|
|
@ -50,9 +58,6 @@
|
|||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--/.navbar -->
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<div class="well">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
|
||||
#parse("report/velocity/header.vm")
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
|
||||
<h2>Page <a href="$document.getRootElement().getChild("u").getValue()" target="_blank">$document.getRootElement().getChild("u").getValue()</a> </h2>
|
||||
|
||||
|
|
@ -59,12 +61,6 @@
|
|||
<th>
|
||||
size
|
||||
</th>
|
||||
<th>
|
||||
expires
|
||||
</th>
|
||||
<th>
|
||||
gzip
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -87,26 +83,14 @@
|
|||
<td>
|
||||
$asset.getChild("size").getValue()
|
||||
</td>
|
||||
<td>
|
||||
#if($!{asset.getChild("expires")})
|
||||
$asset.getChild("expires").getValue()
|
||||
#else
|
||||
0
|
||||
#end
|
||||
</td>
|
||||
<td>
|
||||
#if($!{asset.getChild("gzip")})
|
||||
$asset.getChild("gzip").getValue()
|
||||
#else
|
||||
|
||||
#end
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
#end
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div> <!-- span 12 -->
|
||||
</div> <!-- row -->
|
||||
|
||||
#parse("report/velocity/footer.vm")
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
|
||||
#parse("report/velocity/header.vm")
|
||||
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
|
||||
<h2>Pages ($document.getRootElement().getChildren().size()) - $document.getRootElement().getAttribute("url").getValue()</h2>
|
||||
|
||||
<table class="table table-condensed table-striped table-bordered" id="pagesTable" >
|
||||
|
|
@ -138,7 +141,8 @@
|
|||
#end
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
#parse("report/velocity/footer.vm")
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,102 @@
|
|||
## Collecting data needed for the summary page
|
||||
|
||||
#set($nrOfPages = $document.getRootElement().getChildren().size())
|
||||
|
||||
|
||||
## Get the total objects
|
||||
|
||||
#set($nrOfDecimals = 0)
|
||||
#set($nrOfJs = 0)
|
||||
#set($nrOfCss = 0)
|
||||
#set($nrOfCssImages = 0)
|
||||
#set($nrOfImages = 0)
|
||||
#set($nrOfTotalRequests = 0)
|
||||
#set($nrOfTotalRequestsPrimedCache = 0)
|
||||
#set($totalPageWeight = 0)
|
||||
#set($totalLoadTime = 0)
|
||||
#set($totalScore = 0)
|
||||
|
||||
#foreach ($results in $document.getRootElement().getChildren())
|
||||
|
||||
#if($!{results.getChild("stats").getChild("js").getChild("r")})
|
||||
#set ($nrOfJs = $math.add($nrOfJs, $results.getChild("stats").getChild("js").getChild("r").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("stats").getChild("css").getChild("r")})
|
||||
#set ($nrOfCss = $math.add($nrOfCss,$results.getChild("stats").getChild("css").getChild("r").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("stats").getChild("cssimage").getChild("r")})
|
||||
#set ($nrOfCssImages = $math.add($nrOfCssImages, $results.getChild("stats").getChild("cssimage").getChild("r").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("stats").getChild("image").getChild("r")})
|
||||
#set ($nrOfImages = $math.add($nrOfImages, $results.getChild("stats").getChild("image").getChild("r").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("r")})
|
||||
#set ($nrOfTotalRequests = $math.add($nrOfTotalRequests, $results.getChild("r").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("r_c")})
|
||||
#set ($nrOfTotalRequestsPrimedCache = $math.add($nrOfTotalRequestsPrimedCache, $results.getChild("r_c").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("w")})
|
||||
#set ($totalPageWeight = $math.add($totalPageWeight, $results.getChild("w").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("lt")})
|
||||
#set ($totalLoadTime = $math.add($totalLoadTime, $results.getChild("lt").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("o")})
|
||||
#set ($totalScore = $math.add($totalScore, $results.getChild("o").getValue()))
|
||||
#end
|
||||
#end
|
||||
|
||||
## Create averages
|
||||
#set ($scoreAverage = $math.roundTo($nrOfDecimals,$math.div($totalScore,$nrOfPages)))
|
||||
#set ($jsAverage = $math.roundTo($nrOfDecimals,$math.div($nrOfJs,$nrOfPages)))
|
||||
#set ($requestAverage = $math.roundTo($nrOfDecimals,$math.div($nrOfTotalRequests,$nrOfPages)))
|
||||
#set ($cssAverage = $math.roundTo($nrOfDecimals,$math.div($nrOfCss,$nrOfPages)))
|
||||
#set ($cssImageAverage = $math.roundTo($nrOfDecimals,$math.div($nrOfCssImages,$nrOfPages)))
|
||||
#set ($imageAverage = $math.roundTo($nrOfDecimals,$math.div($nrOfImages,$nrOfPages)))
|
||||
#set ($requestPrimedAverage = $math.roundTo($nrOfDecimals,$math.div($nrOfTotalRequestsPrimedCache,$nrOfPages)))
|
||||
#set ($pageWeightAverage = $math.roundTo($nrOfDecimals,$math.div($totalPageWeight,$nrOfPages)))
|
||||
#set ($loadTimeAverage = $math.roundTo($nrOfDecimals,$math.div($totalLoadTime,$nrOfPages)))
|
||||
|
||||
## Limits and messages, should be made cleaner
|
||||
|
||||
#if ($scoreAverage>90)
|
||||
#set ($scoreType = "success")
|
||||
#elseif ($scoreAverage>80)
|
||||
#set ($scoreType = "warning")
|
||||
#else
|
||||
#set ($scoreType = "error")
|
||||
#end
|
||||
|
||||
#if ($jsAverage<3)
|
||||
#set ($jsType = "success")
|
||||
#elseif ($jsAverage<5)
|
||||
#set ($jsType = "warning")
|
||||
#else
|
||||
#set ($jsType = "error")
|
||||
#end
|
||||
|
||||
#if ($cssAverage==1)
|
||||
#set ($cssType = "success")
|
||||
#elseif ($cssAverage<3)
|
||||
#set ($cssType = "warning")
|
||||
#else
|
||||
#set ($cssType = "error")
|
||||
#end
|
||||
|
||||
#if ($requestAverage<25)
|
||||
#set ($requestType = "success")
|
||||
#elseif ($requestAverage<50)
|
||||
#set ($requestType = "warning")
|
||||
#else
|
||||
#set ($requestType = "error")
|
||||
#end
|
||||
|
||||
|
|
@ -1,78 +1,61 @@
|
|||
|
||||
#parse("report/velocity/header.vm")
|
||||
#parse("report/velocity/summary.logic.vm")
|
||||
|
||||
<h2>Executive summary for $document.getRootElement().getAttribute("url").getValue() </h2>
|
||||
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
|
||||
<h2>$nrOfPages pages analyzed for $document.getRootElement().getAttribute("url").getValue() </h2>
|
||||
|
||||
#set($nrOfPages = $document.getRootElement().getChildren().size())
|
||||
$nrOfPages pages has been analyzed
|
||||
|
||||
#set($nrOfDecimals = 0)
|
||||
#set($nrOfJs = 0)
|
||||
#set($nrOfCss = 0)
|
||||
#set($nrOfCssImages = 0)
|
||||
#set($nrOfImages = 0)
|
||||
#set($nrOfTotalRequests = 0)
|
||||
#set($nrOfTotalRequestsPrimedCache = 0)
|
||||
#set($totalPageWeight = 0)
|
||||
#set($totalLoadTime = 0)
|
||||
#set($totalScore = 0)
|
||||
|
||||
#foreach ($results in $document.getRootElement().getChildren())
|
||||
|
||||
#if($!{results.getChild("stats").getChild("js").getChild("r")})
|
||||
#set ($nrOfJs = $math.add($nrOfJs, $results.getChild("stats").getChild("js").getChild("r").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("stats").getChild("css").getChild("r")})
|
||||
#set ($nrOfCss = $math.add($nrOfCss,$results.getChild("stats").getChild("css").getChild("r").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("stats").getChild("cssimage").getChild("r")})
|
||||
#set ($nrOfCssImages = $math.add($nrOfCssImages, $results.getChild("stats").getChild("cssimage").getChild("r").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("stats").getChild("image").getChild("r")})
|
||||
#set ($nrOfImages = $math.add($nrOfImages, $results.getChild("stats").getChild("image").getChild("r").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("r")})
|
||||
#set ($nrOfTotalRequests = $math.add($nrOfTotalRequests, $results.getChild("r").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("r_c")})
|
||||
#set ($nrOfTotalRequestsPrimedCache = $math.add($nrOfTotalRequestsPrimedCache, $results.getChild("r_c").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("w")})
|
||||
#set ($totalPageWeight = $math.add($totalPageWeight, $results.getChild("w").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("lt")})
|
||||
#set ($totalLoadTime = $math.add($totalLoadTime, $results.getChild("lt").getValue()))
|
||||
#end
|
||||
|
||||
#if($!{results.getChild("o")})
|
||||
#set ($totalScore = $math.add($totalScore, $results.getChild("o").getValue()))
|
||||
#end
|
||||
|
||||
#end
|
||||
|
||||
|
||||
#if ($totalScore>90)
|
||||
#set ($scoreType = "success")
|
||||
#set ($scoreMessage = "Executive summary: Your site has good WPO <p class='large'>$totalScore</p>")
|
||||
#elseif ($totalScore>80)
|
||||
#set ($scoreType = "warning")
|
||||
#set ($scoreMessage = "Executive summary: You need to lock into your site performance <p class='large'>$totalScore</p>")
|
||||
#else
|
||||
#set ($scoreType = "error")
|
||||
#set ($scoreMessage = "Executive summary: You need to improve perfomance for your site <p class='large'>$totalScore</p>")
|
||||
#end
|
||||
|
||||
<div class="alert alert-$scoreType">
|
||||
$scoreMessage
|
||||
<div class="row">
|
||||
<div class="span3">
|
||||
<div class="alert alert-$scoreType">
|
||||
Average Yslow score is <div class='large'>$scoreAverage</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span3">
|
||||
<div class="alert alert-$requestType">
|
||||
Average number of requests <div class='large'>$requestAverage</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span3">
|
||||
<div class="alert alert-$jsType">
|
||||
Average number of js <div class='large'>$jsAverage</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span3">
|
||||
<div class="alert alert-$cssType">
|
||||
Average number of css <div class='large'>$cssAverage</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="span3">
|
||||
<div class="">
|
||||
Average number of css images <div class='large'>$cssImageAverage</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span3">
|
||||
<div class="">
|
||||
Average number of images <div class='large'>$imageAverage</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span3">
|
||||
<div class="">
|
||||
Average number of requests primed <div class='large'>$requestPrimedAverage</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="span3">
|
||||
<div class="">
|
||||
Average load time <div class='large'>$loadTimeAverage</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<table class="table table-condensed table-striped table-bordered" id="pagesTable" >
|
||||
<thead>
|
||||
|
|
@ -86,53 +69,55 @@
|
|||
<tr>
|
||||
<td>JS</td>
|
||||
<td>$nrOfJs</td>
|
||||
<td>$math.roundTo($nrOfDecimals,$math.div($nrOfJs,$nrOfPages))</td>
|
||||
<td>$jsAverage</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CSS</td>
|
||||
<td>$nrOfCss</td>
|
||||
<td>$math.roundTo($nrOfDecimals,$math.div($nrOfCss,$nrOfPages))</td>
|
||||
<td>$cssAverage</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CSS images</td>
|
||||
<td>$nrOfCssImages</td>
|
||||
<td>$math.roundTo($nrOfDecimals,$math.div($nrOfCssImages,$nrOfPages))</td>
|
||||
<td>$cssImageAverage</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Image</td>
|
||||
<td>$nrOfImages</td>
|
||||
<td>$math.roundTo($nrOfDecimals,$math.div($nrOfImages,$nrOfPages))</td>
|
||||
<td>$imageAverage</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Requests</td>
|
||||
<td>$nrOfTotalRequests</td>
|
||||
<td>$math.roundTo($nrOfDecimals,$math.div($nrOfTotalRequests,$nrOfPages))</td>
|
||||
<td>$requestAverage</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Requests primed cache</td>
|
||||
<td>$nrOfTotalRequestsPrimedCache</td>
|
||||
<td>$math.roundTo($nrOfDecimals,$math.div($nrOfTotalRequestsPrimedCache,$nrOfPages))</td>
|
||||
<td>$requestPrimedAverage</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Page weight</td>
|
||||
<td>$totalPageWeight</td>
|
||||
<td>$math.roundTo($nrOfDecimals,$math.div($totalPageWeight,$nrOfPages))</td>
|
||||
<td>$pageWeightAverage</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Load time</td>
|
||||
<td>$totalLoadTime</td>
|
||||
<td>$math.roundTo($nrOfDecimals,$math.div($totalLoadTime,$nrOfPages))</td>
|
||||
<td>$loadTimeAverage</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Score</td>
|
||||
<td>$totalScore</td>
|
||||
<td>$math.roundTo($nrOfDecimals,$math.div($totalScore,$nrOfPages))</td>
|
||||
<td>$scoreAverage</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
#parse("report/velocity/footer.vm")
|
||||
|
|
|
|||
Loading…
Reference in New Issue