Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(669)

Side by Side Diff: appengine/findit/templates/crash/fracas_result_feedback.html

Issue 2067373002: [Findit] Add fracas analysis result feedback page for manual triage. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@only-dashboard
Patch Set: Fix bugs. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <head>
3 <title>Fracas result feedback</title>
4 <meta charset="utf-8">
5 <link rel="stylesheet" href="/common.css">
6 <style>
7 .error {
8 color: #ffffff;
9 background-color: #e98080;
10 border-color: #a77272;
11 }
12 .thumbs-up-down {
13 border-radius: 7px;
14 display: inline-block;
15 }
16 .triage, .triaged {
17 display: block;
18 float: left;
19 vertical-align: middle;
20 }
21 .triage {
22 background-color: #e5e5e5;
23 cursor: pointer;
24 }
25 .triaged {
26 cursor: default;
27 }
28 .correct {
29 border-top: solid 1px;
30 border-bottom: solid 1px;
31 border-left: solid 1px;
32 border-top-left-radius: 7px;
33 border-bottom-left-radius: 7px;
34 padding-left: 10px;
35 padding-right: 10px;
36 margin: auto;
37 }
38 .incorrect {
39 border: solid 1px;
40 padding-left: 10px;
41 padding-right: 10px;
42 }
43 .unsure {
44 border-top: solid 1px;
45 border-bottom: solid 1px;
46 border-right: solid 1px;
47 border-top-right-radius: 7px;
48 border-bottom-right-radius: 7px;
49 padding-left: 10px;
50 padding-right: 14px;
51 }
52 .correct:hover, .correct.triaged {
53 background-color: #8fdf5f;
54 }
55 .incorrect:hover, .incorrect.triaged {
56 background-color: #e98080;
57 }
58 .unsure:hover, .unsure.triaged {
59 background-color: #FFD700;
60 }
61 .not-display, .hidden-row {
62 display: none;
63 }
64 </style>
65 <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1. 11.1/themes/smoothness/jquery-ui.css">
66 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js "></script>
67 <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.m in.js"></script>
68 <script>
69 var analysis_completed = '{{analysis_completed}}' == 'True';
70 var analysis_failed = '{{analysis_failed}}' == 'True';
71 var analysis_correct = {{analysis_correct | tojson | safe}};
72 var regression_range = {{regression_range | tojson | safe}}
73 var suspected_cls = {{suspected_cls | tojson | safe}};
74 var suspected_project = '{{suspected_project}}'
75 var suspected_components = {{suspected_components | tojson | safe}};
76 var default_git_base_url = 'https://chromium.googlesource.com/chromium/src.g it/+/';
77 var culprit_regression_range = {{culprit_regression_range | tojson | safe}}
78 var culprit_cls = {{culprit_cls | tojson | safe}}
79 for (i = 0; i < culprit_cls.length; i++) {
80 culprit_cls[i] = culprit_cls[i]['url'];
81 }
82
83 var culprit_project = '{{culprit_project}}'
84 var culprit_components = {{culprit_components | tojson | safe}}
85
86 function getCulpritPropertyNameForResult(result) {
87 if (result.match('^suspected'))
88 return result.replace('suspected', 'culprit');
89
90 return 'culprit_' + result;
91 }
92
93 function getTriageStatusPropertyNameForResult(result) {
94 return result + '_triage_status';
95 }
96
97 function triageAnalysisResult(e) {
98 var target = $(this);
99 if (target.hasClass('triaged'))
100 return;
101
102 var new_analysis = {};
103 var update = {};
104 var result = target.attr('result_property');
105 if (target.hasClass('correct')) {
106 var triage_status = 'triaged-correct';
107 update[getCulpritPropertyNameForResult(result)] = window[result]
108 } else if (target.hasClass('incorrect')) {
109 var triage_status = 'triaged-incorrect';
110 } else {
111 var triage_status = 'triaged-unsure';
112 }
113 update[getTriageStatusPropertyNameForResult(result)] = triage_status;
114
115 $.getJSON('triage-fracas-analysis?key={{key}}&update=' + encodeURIComponen t(JSON.stringify(update)), function(data) {
116 if (data['success']) {
117 $(".triaged[result_property='" + result + "']").addClass('triage').rem oveClass('triaged');
118 target.addClass('triaged').removeClass('triage');
119 if (triage_status == 'triaged-correct') {
120 $("form[result_property='" + result + "']").addClass('not-display');
121 } else {
122 $("form.not-display[result_property='" + result + "']").removeClass( 'not-display');
123 $("input[result_property='" + result + "']").attr("value", window[ge tCulpritPropertyNameForResult(result)])
124 alert('Please fill the culprit if you found it.')
stgao 2016/06/16 17:32:05 No alert. Too many alerts are not user-friendly.
stgao 2016/06/16 17:32:05 And those input fields are not saved anywhere.
Sharu Jiang 2016/06/21 20:28:50 Done.
Sharu Jiang 2016/06/21 20:28:50 Actually it will be saved by pressing enter, but I
125 }
126 window.location.reload();
127 } else {
128 alert('Failed to update datastore. Please refresh and try again.');
129 }
130 }).error(function(xhr) {
131 // Replace the whole page with errors from server side.
132 document.body.outerHTML = xhr.responseText;
133 });
134 e.preventDefault();
135 }
136
137
138 function updateCulpritResult(result) {
139 if (result) {
140 var value = $('input[result_property=' + result + ']').val();
141 var update = {};
142 update[getCulpritPropertyNameForResult(result)] = value;
143 $.getJSON('triage-fracas-analysis?key={{key}}&update=' + encodeURICompon ent(JSON.stringify(update)), function(data) {
144 if (data['success']) {
145 alert('Update ' + result + ' to new value ' + value);
146 } else {
147 alert('Failed to update datastore. Please refresh and try again.');
148 }
149 }).error(function(xhr) {
150 // Replace the whole page with errors from server side.
151 document.body.outerHTML = xhr.responseText;
152 });
153 }
154 }
155
156 $(document).ready(function() {
157 $('.triage').click(triageAnalysisResult);
158 $.each(analysis_correct, function(result, triage_status) {
159 if (triage_status == 'triaged-correct') {
160 $(".correct[result_property='" + result + "']").addClass('triaged').re moveClass('triage');
161 $("form[result_property='" + result + "']").addClass('not-display');
162 } else if (triage_status == 'triaged-incorrect') {
163 $(".incorrect[result_property='" + result + "']").addClass('triaged'). removeClass('triage');
164 $("form.not-display[result_property='" + result + "']").removeClass('n ot-display');
165 }
166 else if (triage_status == 'triaged-unsure') {
167 $(".unsure[result_property='" + result + "']").addClass('triaged').rem oveClass('triage');
168 $("form.not-display[result_property='" + result + "']").removeClass('n ot-display');
169 }
170 $("input[result_property='" + result + "']").attr("value", window[getCul pritPropertyNameForResult(result)]);
171 });
172 $(".culprit").keypress(function(e) {
173 if (e.which == 13) {
174 e.preventDefault();
175 updateCulpritResult($(this).attr('result_property'));
176 }
177 });
178 $("#note").val('{{note}}')
179 $("#note").keypress(function(e) {
180 if (e.which == 13) {
181 e.preventDefault();
182 var update = {};
183 update['note'] = $(this).val();
184 $.getJSON('triage-fracas-analysis?key={{key}}&update=' + encodeURIComp onent(JSON.stringify(update)), function(data) {
185 if (data['success']) {
186 alert('Update note to new value ' + update['note']);
187 } else {
188 alert('Failed to update datastore. Please refresh and try again.') ;
189 }
190 }).error(function(xhr) {
191 // Replace the whole page with errors from server side.
192 document.body.outerHTML = xhr.responseText;
193 });
194 }
195 });
196 })
197
198 </script>
199 </head>
200 <body>
201 <b>Crash:</b> (<a href="https://code.google.com/p/chromium/issues/entry?status =Unconfirmed&labels=Pri-2,Restrict-View-Google&components=Tool>Test>Findit&summa ry=Findit%20bug%20or%20reature%20request&comment=Signature:%20{{signature}}%0AVe rsion:%20{{version}}%0AChannel:%20{{channel}}%0APlatform:%20{{platform}}%0A%0AWh at%20is%20the%20bug%20or%20feature:%0A">File a Findit bug</a>)
202 <div>
203 Signature: {{signature}}<br>
204 Version: <a href="https://chromium.googlesource.com/chromium/src.git/+/{{ver sion}}">{{version}}</a><br>
205 Channel: {{channel}}<br>
206 Platform: {{platform}}<br>
207 Request time: {{request_time}}<br>
208 </div>
209 <br>
210
211 <div>
212 <b> Stacktrace: </b>
213 <pre>{{stack_trace}}</pre>
214 </div>
215
216 <br>
217 <div>
218 <b> Historical metadata (last 20 versions):</b>
219 <table id="reliable_failures_table">
220 <thead>
221 <tr>
222 <td align="center">Version</td>
223 {% for metadata in historical_metadata %}
stgao 2016/06/16 17:32:05 This seems not the right usage of a <thead> in a <
Sharu Jiang 2016/06/21 20:28:50 Because UMA right now only stores 20 days' data, s
224 <td align="center" width="40"> {{metadata.chrome_version}} </td>
225 {% endfor %}
226 </tr>
227 <tr>
228 <td align="center">CPM</td>
229 {% for metadata in historical_metadata %}
230 <td align="center" width="40"> {{metadata.cpm}} </td>
231 {% endfor %}
232 </tr>
233 <tr>
234 <td align="center">Total clients</td>
235 {% for metadata in historical_metadata %}
236 <td align="center" width="40"> {{metadata.client_number}} </td>
237 {% endfor %}
238 </tr>
239 <tr>
240 <td align="center">Total reports</td>
241 {% for metadata in historical_metadata %}
242 <td align="center" width="40"> {{metadata.report_number}} </td>
243 {% endfor %}
244 </tr>
245 </thead>
246 <tbody>
247 </tbody>
248 </table>
249 </div>
250
251 <br>
252 <b> Regression range: </b>
253 {% if regression_range %}
254 <a href="https://chromium.googlesource.com/chromium/src/+log/{{regression_ range[0]}}..{{regression_range[1]}}?pretty=fuller">{{regression_range[0]}} : {{r egression_range[1]}}</a>
255 {% else %}
256 Not found
257 {% endif %}
258 <br>
259 <div class="thumbs-up-down">
260 <div class="triage correct" result_property="regression_range">Correct<img src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_satisfie d_black_24dp.png"/></div>
261 <div class="triage incorrect" result_property="regression_range">Incorrect <img src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_diss atisfied_black_24dp.png"/></div>
262 <div class="triage unsure" result_property="regression_range">Unsure<img s rc="https://www.gstatic.com/images/icons/material/system/1x/sentiment_neutral_bl ack_24dp.png"/></div>
263 <form class="not-display culprit" result_property="regression_range">
264 <br><br>Culprit regression range:
265 <input type="text" result_property="regression_range" size="30"></input>
266 </form>
267 </div>
268 <br><br>
269 {% if analysis_completed %}
270 {% if analysis_failed %}
271 <span class="error">No result because of some error in analysis!</span>
272 {% else %}
273 <div id="triage-and-table">
274 <b> Suspected cls: </b>
275 {% if suspected_cls %}
276 <table id="suspected_cls_table">
277 <tr>
278 <th>Suspected cls</th>
279 <th>Score</th>
280 <th>Reason</th>
281 </tr>
282 <tbody>
283 {% for suspected_cl in suspected_cls %}
284 <tr>
285 <td align="center"> <a href={{suspected_cl.url}}>{{suspected_cl. revision}}</a> </td>
286 <td align="center"> {{suspected_cl.confidence}} </td>
287 <td align="left"><pre>{{suspected_cl.reason}}</pre></td>
288 </tr>
289 {% endfor %}
290 </tbody>
291 </table>
292 {% else %}
293 Not found <br>
294 {% endif %}
295 </div>
296
297 <div class="thumbs-up-down">
298 <div class="triage correct" result_property="suspected_cls">Correct <i mg src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_satisf ied_black_24dp.png"/></div>
299 <div class="triage incorrect" result_property="suspected_cls">Incorrec t<img src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_dis satisfied_black_24dp.png"/></div>
300 <div class="triage unsure" result_property="suspected_cls">Unsure<img src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_neutral_b lack_24dp.png"/></div>
301 <form class="not-display culprit" result_property="suspected_cls">
302 <br><br>Culprit cls:
303 <input type="text" result_property="suspected_cls" size="100"></inpu t>
304 </form>
305 </div>
306 {% endif %}
307 {% endif %}
308
309 <br><br>
310 <b> Suspected project: </b>
311 {% if suspected_project %}
312 {{suspected_project}}
313 {% else %}
314 Not found
315 {% endif %}
316 <br>
317 <div class="thumbs-up-down">
318 <div class="triage correct" result_property="suspected_project">Correct <i mg src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_satisf ied_black_24dp.png"/></div>
319 <div class="triage incorrect" result_property="suspected_project">Incorrec t<img src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_dis satisfied_black_24dp.png"/></div>
320 <div class="triage unsure" result_property="suspected_project">Unsure<img src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_neutral_b lack_24dp.png"/></div>
321 <form class="not-display culprit" result_property="suspected_project">
322 <br><br>Culprit project:
323 <input type="text" result_property="suspected_project"></input>
324 </form>
325 </div>
326
327 <br><br>
328 <b> Suspected components:</b>
329 {% if suspected_components %}
330 <br>
331 {% for component in suspected_components %}
332 <li>
333 {{component}}
334 </li>
335 {% endfor %}
336 {% else %}
337 Not found <br>
338 {% endif %}
339 <div class="thumbs-up-down">
340 <div class="triage correct" result_property="suspected_components">Correct <img src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_sat isfied_black_24dp.png"/></div>
341 <div class="triage incorrect" result_property="suspected_components">Incor rect<img src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_ dissatisfied_black_24dp.png"/></div>
342 <div class="triage unsure" result_property="suspected_components">Unsure<i mg src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_neutra l_black_24dp.png"/></div>
343 <form class="not-display culprit" result_property="suspected_components">
344 <br><br>Culprit components:
345 <input type="text" result_property="suspected_components" size="40"></in put>
346 </form>
347 </div>
348
349
350 <div>
351 <form>
352 <br><br>
353 <b>Note:<br></b>
354 <textarea id="note" rows="5" cols="80"></textarea>
355 <br>
356 </form>
357 </div>
358
359 <br><br>
360 {% if triage_history %}
361 Triage history:
362 <div>
363 <table>
364 <tr><th>When</th><th>Who</th><th>Property</th><th>Result</th></tr>
365 <tbody>
366 {% for triage_record in triage_history %}
367 <tr>
368 <td>{{triage_record.triage_time}}</td>
369 <td>{{triage_record.user_name}}</td>
370 <td>{{triage_record.result_property}}</td>
371 <td>{{triage_record.triage_status}}</td>
372 </tr>
373 {% endfor %}
374 </tbody>
375 </table>
376 </div>
377 {% endif %}
378 </body>
OLDNEW
« appengine/findit/model/crash/crash_analysis.py ('K') | « appengine/findit/model/triage_status.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698