Chromium Code Reviews| 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="../model/patch-summary.html"> | 7 <link rel="import" href="../model/patch-summary.html"> |
| 8 <link rel="import" href="../model/patch-summary-list.html"> | 8 <link rel="import" href="../model/patch-summary-list.html"> |
| 9 | 9 |
| 10 <polymer-element name="tom-patch-summary" attributes="model viewMenu"> | 10 <polymer-element name="tom-patch-summary" attributes="model viewMenu"> |
| 11 <template> | 11 <template> |
| 12 <link rel="stylesheet" href="./tom-patch-summary.css"> | 12 <link rel="stylesheet" href="./tom-patch-summary.css"> |
| 13 <div class="row"> | 13 <div class="row"> |
| 14 <div class="metric-cell column">{{ model.value | toFixed }} {{ model.unit }}</div> | 14 <div class="metric-cell column">{{ model.value | toFixed }} {{ model.unit }}</div> |
| 15 | 15 |
| 16 <template bind="{{ model._issueTitle ? model._issueTitle : model._patchURL as title }}"> | 16 <template bind="{{ model._issueTitle ? model._issueTitle : model._patchURL as title }}"> |
| 17 <div class="patch-cell"> | 17 <div class="patch-cell"> |
| 18 <a href="{{ model._patchURL }}" title="{{ title }}">{{ title }}</a><br > | 18 <a href="{{ model._patchURL }}" title="{{ title }}">{{ title }}</a><br > |
| 19 <a href="{{ model._patchURL }}">#{{ model.patchset }}</a> | 19 <a href="{{ model._patchURL }}">#{{ model.patchset }}</a> |
| 20 <a href="//chromium-cq-status.appspot.com/patch-status/{{ model.issue }}/{{ model.patchset }}">[CQ Status]</a> | 20 <a href="{{ model._statusURL }}">[CQ Status]</a> |
| 21 <a href="//chromium-cq-status.appspot.com/recent#issue={{ model.issue }},patchset={{ model.patchset }}">[CQ Logs]</a> | 21 <a href="{{ model._recentURL }}">[CQ Logs]</a> |
| 22 </div> | 22 </div> |
| 23 </template> | 23 </template> |
| 24 | 24 |
| 25 <template if="{{ !model._summary }}"> | 25 <template if="{{ !model._summary }}"> |
| 26 <div class="column-container"> | 26 <div class="column-container"> |
| 27 <div class="column">Loading...</div> | 27 <div class="column">Loading...</div> |
| 28 </div> | 28 </div> |
| 29 </template> | 29 </template> |
| 30 | 30 |
| 31 <template if="{{ model._summary }}"> | 31 <template if="{{ model._summary }}"> |
| 32 <template if="{{ viewMenu.value == 'summary' }}"> | |
| 33 <div class="column-container"> | |
| 34 <template repeat="{{ value in model._columnValues }}"> | |
| 35 <div class="column">{{ value }}</div> | |
| 36 </template> | |
| 37 </div> | |
| 38 </template> | |
| 39 | |
| 40 <template if="{{ viewMenu.value == 'jobs' }}"> | 32 <template if="{{ viewMenu.value == 'jobs' }}"> |
| 41 <div class="column grow builder-bubbles"> | 33 <div class="column grow builder-bubbles"> |
| 42 <template repeat="{{ builder in model._jobViewBuilderBuilds[viewMenu .subMenu.value] }}"> | 34 <template repeat="{{ builder in model._jobViewBuilderBuilds[viewMenu .subMenu.value] }}"> |
| 43 <span class="builder-bubble"> | 35 <span class="builder-bubble"> |
| 44 <a href="http://build.chromium.org/p/{{ builder.master }}/builde rs/{{ builder.name }}" title="{{ builder.master }}"> | 36 <a href="http://build.chromium.org/p/{{ builder.master }}/builde rs/{{ builder.name }}" title="{{ builder.master }}"> |
| 45 {{ builder.name }}: | 37 {{ builder.name }}: |
| 46 </a> | 38 </a> |
| 47 <template repeat="{{ build in builder.builds }}"> | 39 <template repeat="{{ build in builder.builds }}"> |
| 48 <a href="{{ build.url }}" title="{{ build.slave }}" class="bui ld-bubble {{ build.state }}"> | 40 <a href="{{ build.url }}" title="{{ build.slave }}" class="bui ld-bubble {{ build.state }}"> |
| 49 #{{ build.number }} | 41 #{{ build.number }} |
| 50 </a> | 42 </a> |
| 51 </template> | 43 </template> |
| 52 </span> | 44 </span> |
| 53 <br> | 45 <br> |
| 54 </template> | 46 </template> |
| 55 </div> | 47 </div> |
| 56 </template> | 48 </template> |
| 49 | |
| 50 <template if="{{ viewMenu.value == 'timeline' }}"> | |
| 51 <template bind="{{ model.list[viewMenu.subMenu.value] as interval }}"> | |
| 52 <div style="position: relative; width: 100%; overflow: hidden;"> | |
| 53 <template repeat="{{ attempt in model._summary.attempts }}"> | |
| 54 <a | |
| 55 href="{{ model._statusURL }}#{{ attempt.number }}" | |
| 56 class="attempt success-{{ attempt.success }}" | |
| 57 style=" | |
| 58 left: {{ 100 * (attempt.begin - interval.begin) / (interval. end - interval.begin) }}%; | |
| 59 width: {{ 100 * attempt.durations.total / (interval.end - in terval.begin) }}%;" | |
| 60 title="{{ attempt | attemptText }}"> | |
|
ojan
2015/01/15 02:48:33
This won't bind correctly if you change a member o
alancutter (OOO until 2018)
2015/01/19 23:19:01
Done.
| |
| 61 {{ attempt | attemptText }} | |
| 62 </a> | |
| 63 </template> | |
| 64 </div> | |
| 65 </template> | |
| 66 </template> | |
| 67 | |
| 68 <template if="{{ viewMenu.value == 'summary' }}"> | |
| 69 <div class="column-container"> | |
| 70 <template repeat="{{ value in model._columnValues }}"> | |
| 71 <div class="column">{{ value }}</div> | |
| 72 </template> | |
| 73 </div> | |
| 74 </template> | |
| 75 | |
| 57 </template> | 76 </template> |
| 58 </div class="row"> | 77 </div class="row"> |
| 59 </template> | 78 </template> |
| 60 <script> | 79 <script> |
| 61 Polymer({ | 80 Polymer({ |
| 62 toFixed: function(number) { | 81 toFixed: function(number) { |
| 63 return number.toFixed(); | 82 return number.toFixed(); |
| 64 }, | 83 }, |
| 84 attemptText: function(attempt) { | |
| 85 return '{1} ({2}min)'.assign( | |
| 86 this.attemptSuccessText(attempt), | |
| 87 (attempt.durations.total / 60).toFixed()); | |
| 88 }, | |
| 89 attemptSuccessText: function(attempt) { | |
| 90 switch (attempt.success) { | |
| 91 case true: | |
| 92 return 'Success'; | |
| 93 case null: | |
| 94 return 'Running'; | |
| 95 default: | |
| 96 var text = 'Fail'; | |
| 97 var reason = attempt.fail_reason; | |
| 98 if (reason && reason.fail_type) { | |
| 99 text += ': '; | |
| 100 if (reason.fail_type === 'failed_jobs') { | |
| 101 var getBuilder = function(detail) { return detail.builder }; | |
| 102 text += reason.fail_details.map(getBuilder).join(' '); | |
| 103 } else { | |
| 104 text += reason.fail_type; | |
| 105 } | |
| 106 } | |
| 107 return text; | |
| 108 } | |
| 109 } | |
| 65 }); | 110 }); |
| 66 </script> | 111 </script> |
| 67 </polymer-element> | 112 </polymer-element> |
| OLD | NEW |