| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright 2014 The Chromium Authors. All rights reserved. | 2 Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be | 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. | 4 found in the LICENSE file. |
| 5 --> | 5 --> |
| 6 | 6 |
| 7 <link rel="import" href="../bower_components/paper-button/paper-button.html"> | 7 <link rel="import" href="../bower_components/paper-button/paper-button.html"> |
| 8 <link rel="import" href="../model/ct-commit-log.html"> | 8 <link rel="import" href="../model/ct-commit-log.html"> |
| 9 <link rel="import" href="../model/tree-status.html"> |
| 9 <link rel="import" href="ct-failure-analyzer.html"> | 10 <link rel="import" href="ct-failure-analyzer.html"> |
| 10 <link rel="import" href="ct-failure-stream.html"> | 11 <link rel="import" href="ct-failure-stream.html"> |
| 11 <link rel="import" href="ct-party-time.html"> | 12 <link rel="import" href="ct-party-time.html"> |
| 12 <link rel="import" href="ct-revision-details.html"> | 13 <link rel="import" href="ct-revision-details.html"> |
| 13 <link rel="import" href="ct-tree-status.html"> | 14 <link rel="import" href="ct-tree-status.html"> |
| 14 | 15 |
| 15 <polymer-element name="ct-unexpected-failures" attributes="tree"> | 16 <polymer-element name="ct-unexpected-failures" attributes="tree"> |
| 16 <template> | 17 <template> |
| 17 <style> | 18 <style> |
| 18 ct-tree-status { | 19 ct-tree-status { |
| 19 white-space: nowrap; | 20 white-space: nowrap; |
| 20 overflow: hidden; | 21 overflow: hidden; |
| 21 text-overflow: ellipsis; | 22 text-overflow: ellipsis; |
| 22 margin: 5px; | 23 margin: 5px; |
| 23 padding: 3px; | 24 padding: 3px; |
| 24 } | 25 } |
| 25 | 26 |
| 26 ct-tree-status[status=open] { | 27 ct-tree-status[state=open] { |
| 27 margin: 0; | 28 margin: 0; |
| 28 padding: 0; | 29 padding: 0; |
| 29 } | 30 } |
| 30 </style> | 31 </style> |
| 31 <ct-failure-analyzer id="analyzer" failures="{{ failures }}" builderLatestRe
visions="{{ builderLatestRevisions }}"></ct-failure-analyzer> | 32 <ct-failure-analyzer id="analyzer" failures="{{ failures }}" builderLatestRe
visions="{{ builderLatestRevisions }}"></ct-failure-analyzer> |
| 32 <ct-tree-status project="chromium"></ct-tree-status> | 33 <ct-tree-status status="{{ treeStatuses['chromium'] }}" state="{{ treeStatus
es['chromium'].status }}"></ct-tree-status> |
| 33 <ct-tree-status project="blink"></ct-tree-status> | 34 <ct-tree-status status="{{ treeStatuses['blink'] }}" state="{{ treeStatuses[
'blink'].status }}"></ct-tree-status> |
| 34 <ct-revision-details id="revisionDetails" builderLatestRevisions="{{ builder
LatestRevisions }}" revisionLog="{{ revisionLog }}" tree="{{ tree }}"></ct-revis
ion-details> | 35 <ct-revision-details id="revisionDetails" builderLatestRevisions="{{ builder
LatestRevisions }}" revisionLog="{{ revisionLog }}" tree="{{ tree }}"></ct-revis
ion-details> |
| 35 <ct-party-time failures="{{ failures }}" tree="{{ tree }}"></ct-party-time> | 36 <ct-party-time failures="{{ failures }}" tree="{{ tree }}"></ct-party-time> |
| 36 <ct-failure-stream groups="{{ failures[tree] }}" commits="{{ revisionLog }}"
tree="{{ tree }}"></ct-failure-stream> | 37 <ct-failure-stream groups="{{ failures[tree] }}" commits="{{ revisionLog }}"
tree="{{ tree }}"></ct-failure-stream> |
| 37 </template> | 38 </template> |
| 38 <script> | 39 <script> |
| 39 (function() { | 40 (function() { |
| 40 // FIXME: Make the update frequency 30 seconds again once we fix crbug.com/4
01358. | 41 // FIXME: Make the update frequency 30 seconds again once we fix crbug.com/4
01358. |
| 41 var kUpdateFrequency = 1000 * 30 * 10; | 42 var kUpdateFrequency = 1000 * 30 * 10; |
| 42 | 43 |
| 43 Polymer({ | 44 Polymer({ |
| 44 revisionLog: new CTCommitLog(), | 45 revisionLog: new CTCommitLog(), |
| 45 tree: '', | 46 tree: '', |
| 46 | 47 |
| 48 created: function() { |
| 49 this.treeStatuses = {}; |
| 50 |
| 51 var projects = ['chromium', 'blink']; |
| 52 for (var i = 0; i < projects.length; i++) { |
| 53 this.treeStatuses[projects[i]] = new TreeStatus(projects[i]); |
| 54 } |
| 55 }, |
| 56 |
| 47 attached: function() { | 57 attached: function() { |
| 48 this.update(); | 58 this.update(); |
| 49 setInterval(this.update.bind(this), kUpdateFrequency); | 59 setInterval(this.update.bind(this), kUpdateFrequency); |
| 50 }, | 60 }, |
| 51 | 61 |
| 52 update: function() { | 62 update: function() { |
| 53 // FIXME: These shouldn't update if there's already an update in progres
s. | 63 // FIXME: These shouldn't update if there's already an update in progres
s. |
| 54 this.revisionLog.update(); | 64 this.revisionLog.update(); |
| 55 this.$.analyzer.update(); | 65 this.$.analyzer.update(); |
| 56 var treeStatuses = this.shadowRoot.querySelectorAll("ct-tree-status"); | 66 Object.keys(this.treeStatuses, function(tree, status) { |
| 57 for (var i = 0; i < treeStatuses.length; i++) | 67 status.update(); |
| 58 treeStatuses[i].update(); | 68 }); |
| 59 }, | 69 }, |
| 60 }); | 70 }); |
| 61 })(); | 71 })(); |
| 62 </script> | 72 </script> |
| 63 </polymer-element> | 73 </polymer-element> |
| OLD | NEW |