Chromium Code Reviews| Index: Tools/GardeningServer/ui/ct-revision-details.html |
| diff --git a/Tools/GardeningServer/ui/ct-revision-details.html b/Tools/GardeningServer/ui/ct-revision-details.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..705f4616a85052c5d79cbd74a3f78025778821f4 |
| --- /dev/null |
| +++ b/Tools/GardeningServer/ui/ct-revision-details.html |
| @@ -0,0 +1,86 @@ |
| +<!-- |
| +Copyright 2014 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 href="../bower_components/core-icons/core-icons.html" rel="import"> |
| +<link href="../bower_components/paper-item/paper-item.html" rel="import"> |
| +<link href="../bower_components/paper-menu-button/paper-menu-button.html" rel="import"> |
| + |
| +<polymer-element name="ct-revision-details"> |
| + <template> |
| + <style> |
| + :host { |
| + display: inline; |
|
ojan
2014/07/21 23:22:37
inline is the default. Do you actually want this t
|
| + } |
| + .menu { |
|
ojan
2014/07/21 23:22:37
I've just been using tag names as selectors. No ne
|
| + padding: 0; |
| + margin-bottom: -0.5em; |
| + } |
| + .menuItem { |
|
ojan
2014/07/21 23:22:37
Can't just make the paper-item display flex and ge
|
| + display: flex; |
| + width: 100%; |
|
ojan
2014/07/21 23:22:37
Is this needed?
|
| + justify-content: space-between; |
|
ojan
2014/07/21 23:22:37
space-between!
|
| + } |
| + .menuRevision { |
| + padding-left: 2em; |
| + } |
| + </style> |
| + <template if="{{_sortedBuilders.length}}"> |
| + Latest revision processed by every bot: |
| + <paper-menu-button icon="arrow-drop-down" class="menu" valign="bottom"> |
| + <template repeat="{{builder in _sortedBuilders}}"> |
| + <paper-item> |
| + <div class="menuItem"> |
| + <div> |
| + {{builder}} |
| + </div> |
| + <div class="menuRevision"> |
| + {{_latestRevisions[builder]}} |
| + </div> |
| + </div> |
| + </paper-item> |
| + </template> |
| + </paper-menu-button> |
| + <a id="fullyProcessedRevision" href="{{_fullyProcessedRevision.url}}">{{_fullyProcessedRevision.number}}</a>, |
| + trunk is at <a id="trunkRevision" href="{{trunkRevision.url}}">{{trunkRevision.number}}</a> |
| + </template> |
| + </template> |
| + <script> |
| + Polymer({ |
| + _latestRevisions: null, |
| + _sortedBuilders: [], |
| + _fullyProcessedRevision: null, |
| + urgency: "", |
| + message: "", |
| + |
| + _createRevision: function(revisionNumber) { |
| + var revision = new Object; |
|
ojan
2014/07/21 23:22:37
s/new Object/{}
Or, even better:
return {
numbe
|
| + revision.number = revisionNumber; |
| + revision.url = trac.changesetURL(revisionNumber); |
| + return revision; |
| + }, |
| + |
| + update: function() { |
| + this.message = ""; |
| + Promise.all([model.updateRecentCommits(), model.updateResultsByBuilder()]).then(function() { |
| + this.message = "Latest revision processed by every bot: " |
| + this._fullyProcessedRevision = this._createRevision(model.latestRevisionWithNoBuildersInFlight()); |
| + |
| + var latestRevisions = model.latestRevisionByBuilder(); |
| + |
| + // Get the list of builders sorted with the most recent one first. |
| + var sortedBuilders = Object.keys(latestRevisions); |
| + sortedBuilders.sort(function (a, b) { return parseInt(latestRevisions[b]) - parseInt(latestRevisions[a]);}); |
| + |
| + |
| + this.trunkRevision = this._createRevision(model.latestRevision()); |
|
ojan
2014/07/21 23:22:37
_trunkRevision?
|
| + |
| + this._latestRevisions = latestRevisions; |
| + this._sortedBuilders = sortedBuilders; |
| + }.bind(this)); |
| + }, |
| + |
| + }); |
| + </script> |
| +</polymer-element> |