blob: a264086e957074c1b5170f6169fd317af66097fa [file] [log] [blame]
<!--
Copyright 2016 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="../../buildbucket/static/cr-buildbucket-client.html">
<dom-module id="binary-size-view">
<template>
<style>
:host {
border-top: 1px solid #ddd;
display: block;
margin: 1em 0;
}
.container {
align-items: center;
display: flex;
flex-wrap: wrap;
}
.header {
background-color: #fafafa;
border-bottom: 1px solid #ddd;
justify-content: space-between;
min-height: 3.2em;
padding: .5em var(--default-horizontal-margin, 1rem);
}
.header .label {
font: inherit;
font-family: var(--font-family-bold);
font-size: 1.17em;
margin-right: 1em;
}
.header .update {
color: rgba(0, 0, 0, .7);
}
table {
border-collapse: collapse;
}
th, td {
padding: .2em .4em;
text-align: left;
}
td {
border-top: 1px solid #ddd;
}
td.size {
text-align: right;
}
a {
color: #1a4494;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
</style>
<template is="dom-if" if="[[_binarySizeInfo.length]]">
<div class="header container">
<div class="container">
<h3 class="label">Binary size changes</h3>
<div class="update">[[_statusString]]</div>
</div>
</div>
<section class="builds">
<table>
<tr>
<th>Size before</th>
<th>Size after</th>
<th colspan="2">Size difference</th>
<th>File</th>
<th>Builder</td>
</tr>
<template is="dom-repeat" items="[[_binarySizeInfo]]" as="row">
<tr>
<td class="size" title="[[row.ciSize]] B">
<a href="[[row.ciUrl]]" target="blank">[[_humanByteSize(row.ciSize)]]</a>
</td>
<td class="size" title="[[row.trySize]] B">
<a href="[[row.tryUrl]]" target="blank">[[_humanByteSize(row.trySize)]]</a>
</td>
<td class="size" title="[[_subtract(row.trySize, row.ciSize)]] B">
[[_humanByteSizeDelta(row.ciSize, row.trySize)]]
</td>
<td class="size">
[[_percentSizeDelta(row.ciSize, row.trySize)]]
</td>
<td>[[row.binary]]</td>
<td>[[row.builder]]</td>
</tr>
</template>
</table>
</section>
</template>
<cr-buildbucket-client
id="client" base-url="[[baseUrl]]" plugin="[[plugin]]"></cr-buildbucket-client>
</template>
<script src="binary-size-view.js"></script>
</dom-module>