OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2017 The Chromium Authors. All rights reserved. | 3 Copyright 2017 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 <link rel="import" href="/components/polymer/polymer.html"> | 7 <link rel="import" href="/components/polymer/polymer.html"> |
8 | 8 |
9 <link rel="import" href="/dashboard/elements/alerts-table.html"> | 9 <link rel="import" href="/dashboard/elements/alerts-table.html"> |
| 10 <link rel="import" href="/dashboard/elements/bug-details.html"> |
10 <link rel="import" href="/dashboard/static/simple_xhr.html"> | 11 <link rel="import" href="/dashboard/static/simple_xhr.html"> |
11 | 12 |
12 <dom-module id="benchmark-health-report-details"> | 13 <dom-module id="benchmark-health-report-details"> |
13 <style> | 14 <style> |
14 .error { | 15 .error { |
15 color: #dd4b39; | 16 color: #dd4b39; |
16 font-weight: bold; | 17 font-weight: bold; |
17 } | 18 } |
18 | 19 |
19 #loading-spinner { | 20 #loading-spinner { |
(...skipping 16 matching lines...) Expand all Loading... |
36 <template is="dom-repeat" items="{{bots}}"> | 37 <template is="dom-repeat" items="{{bots}}"> |
37 <li>{{item}} | 38 <li>{{item}} |
38 </template> | 39 </template> |
39 </ul> | 40 </ul> |
40 | 41 |
41 <h2>{{alerts.length}} alerts for {{benchmark}} in the last {{numDays}} day
s</h2> | 42 <h2>{{alerts.length}} alerts for {{benchmark}} in the last {{numDays}} day
s</h2> |
42 <h3>{{computeNumValid(alerts)}} valid and {{computeNumInvalid(alerts)}} in
valid and {{computeNumUntriaged(alerts)}} untriaged</h3> | 43 <h3>{{computeNumValid(alerts)}} valid and {{computeNumInvalid(alerts)}} in
valid and {{computeNumUntriaged(alerts)}} untriaged</h3> |
43 <alerts-table id="alerts-table" | 44 <alerts-table id="alerts-table" |
44 alert-list="{{alerts}}" | 45 alert-list="{{alerts}}" |
45 extra-columns="{{extraColumns}}"></alerts-table> | 46 extra-columns="{{extraColumns}}"></alerts-table> |
| 47 |
| 48 <h2>{{bugIds.length}} bugs for {{benchmark}} in the last {{numDays}} days<
/h2> |
| 49 <template is="dom-repeat" items="{{bugIds}}"> |
| 50 <bug-details bug-id="{{item}}"></bug-details> |
| 51 </template> |
46 </template> | 52 </template> |
47 | 53 |
48 </template> | 54 </template> |
49 <script> | 55 <script> |
50 'use strict'; | 56 'use strict'; |
51 Polymer({ | 57 Polymer({ |
52 is: 'benchmark-health-report-details', | 58 is: 'benchmark-health-report-details', |
53 properties: { | 59 properties: { |
54 alerts: { | 60 alerts: { |
55 notify: true, | 61 notify: true, |
56 type: Array | 62 type: Array |
57 }, | 63 }, |
58 benchmark: { | 64 benchmark: { |
59 notify: true, | 65 notify: true, |
60 type: String | 66 type: String |
61 }, | 67 }, |
62 bots: { | 68 bots: { |
63 notify: true, | 69 notify: true, |
64 type: Array | 70 type: Array |
65 }, | 71 }, |
| 72 bugIds: { |
| 73 notify: true, |
| 74 type: Array |
| 75 }, |
66 extraColumns: { | 76 extraColumns: { |
67 type: Array, | 77 type: Array, |
68 notify: true, | 78 notify: true, |
69 value: () => ([ | 79 value: () => ([ |
70 { | 80 { |
71 'key': 'percent_changed', | 81 'key': 'percent_changed', |
72 'label': 'Delta %' | 82 'label': 'Delta %' |
73 }, | 83 }, |
74 { | 84 { |
75 'key': 'absolute_delta', | 85 'key': 'absolute_delta', |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 'master': this.master, | 151 'master': this.master, |
142 'benchmark': this.benchmark, | 152 'benchmark': this.benchmark, |
143 'num_days': this.numDays | 153 'num_days': this.numDays |
144 }; | 154 }; |
145 simple_xhr.send('/benchmark_health_report', params, | 155 simple_xhr.send('/benchmark_health_report', params, |
146 response => { | 156 response => { |
147 this.alerts = response['alerts']; | 157 this.alerts = response['alerts']; |
148 this.bots = response['bots']; | 158 this.bots = response['bots']; |
149 this.monitored = response['monitored']; | 159 this.monitored = response['monitored']; |
150 this.loading = false; | 160 this.loading = false; |
| 161 var bugIds = new Set(); |
| 162 for (let alert of this.alerts) { |
| 163 if (alert.bug_id && alert.bug_id > 0) { |
| 164 bugIds.add(alert.bug_id); |
| 165 } |
| 166 } |
| 167 this.set('bugIds', Array.from(bugIds)); |
151 }, | 168 }, |
152 errorMsg => { | 169 errorMsg => { |
153 this.error = errorMsg; | 170 this.error = errorMsg; |
154 this.loading = false; | 171 this.loading = false; |
155 }); | 172 }); |
156 } | 173 } |
157 }); | 174 }); |
158 </script> | 175 </script> |
159 </dom-module> | 176 </dom-module> |
OLD | NEW |