| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <head> | 2 <head> |
| 3 <title>Fracas result feedback</title> | 3 <title>Fracas result feedback</title> |
| 4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
| 5 <link rel="stylesheet" href="/common.css"> | 5 <link rel="stylesheet" href="/common.css"> |
| 6 <style> | 6 <style> |
| 7 .error { | 7 .error { |
| 8 color: #ffffff; | 8 color: #ffffff; |
| 9 background-color: #e98080; | 9 background-color: #e98080; |
| 10 border-color: #a77272; | 10 border-color: #a77272; |
| 11 } | 11 } |
| 12 .correct { |
| 13 border-top: solid 1px; |
| 14 border-bottom: solid 1px; |
| 15 border-left: solid 1px; |
| 16 border-top-left-radius: 7px; |
| 17 border-bottom-left-radius: 7px; |
| 18 padding-left: 10px; |
| 19 padding-right: 10px; |
| 20 margin: auto; |
| 21 } |
| 22 .incorrect { |
| 23 border: solid 1px; |
| 24 padding-left: 10px; |
| 25 padding-right: 10px; |
| 26 } |
| 27 .unsure { |
| 28 border-top: solid 1px; |
| 29 border-bottom: solid 1px; |
| 30 border-right: solid 1px; |
| 31 border-top-right-radius: 7px; |
| 32 border-bottom-right-radius: 7px; |
| 33 padding-left: 10px; |
| 34 padding-right: 14px; |
| 35 } |
| 36 .correct:hover, .correct.triaged { |
| 37 background-color: #8fdf5f; |
| 38 } |
| 39 .incorrect:hover, .incorrect.triaged { |
| 40 background-color: #e98080; |
| 41 } |
| 42 .unsure:hover, .unsure.triaged { |
| 43 background-color: #FFD700; |
| 44 } |
| 12 </style> | 45 </style> |
| 13 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
"></script> | 46 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
"></script> |
| 14 <script> | 47 <script> |
| 48 var analysis_completed = '{{analysis_completed}}' == 'True'; |
| 49 var analysis_failed = '{{analysis_failed}}' == 'True'; |
| 50 var analysis_correct = {{analysis_correct | tojson | safe}}; |
| 51 var regression_range = {{regression_range | tojson | safe}}; |
| 52 var suspected_cls = {{suspected_cls | tojson | safe}}; |
| 53 var suspected_project = '{{suspected_project}}'; |
| 54 var suspected_components = {{suspected_components | tojson | safe}}; |
| 55 |
| 56 var culprit_regression_range = {{culprit_regression_range | tojson | safe}}; |
| 57 var culprit_cls = {{culprit_cls | tojson | safe}}; |
| 58 var culprit_project = '{{culprit_project}}' == 'None' ? undefined : '{{culpr
it_project}}'; |
| 59 var culprit_components = {{culprit_components | tojson | safe}}; |
| 60 |
| 61 var note = '{{note}}' == 'None' ? undefined : '{{note}}'; |
| 62 |
| 63 |
| 15 function createUrl(base_url, parameters) { | 64 function createUrl(base_url, parameters) { |
| 16 var params = []; | 65 var params = []; |
| 17 for(var key in parameters) { | 66 for(var key in parameters) { |
| 18 if (parameters[key] != undefined) { | 67 if (parameters[key] != undefined) { |
| 19 params.push(key + '=' + parameters[key]); | 68 params.push(key + '=' + parameters[key]); |
| 20 } | 69 } |
| 21 } | 70 } |
| 22 | 71 |
| 23 if (params.length == 0) { | 72 if (params.length == 0) { |
| 24 return base_url; | 73 return base_url; |
| 25 } else { | 74 } else { |
| 26 return base_url + '?' + params.join('&'); | 75 return base_url + '?' + params.join('&'); |
| 27 } | 76 } |
| 28 } | 77 } |
| 29 | 78 |
| 79 |
| 30 function constructMonorailUrl() { | 80 function constructMonorailUrl() { |
| 31 var parameters = {}; | 81 var parameters = {}; |
| 32 parameters.status = 'Unconfirmed'; | 82 parameters.status = 'Unconfirmed'; |
| 33 parameters.labels = 'Pri-2,Restrict-View-Google'; | 83 parameters.labels = 'Pri-2,Restrict-View-Google'; |
| 34 parameters.components = 'Tools>Test>Findit'; | 84 parameters.components = 'Tools>Test>Findit'; |
| 35 parameters.summary = encodeURIComponent('[Findit] Findit bug or feature'); | 85 parameters.summary = encodeURIComponent('[Findit] Findit bug or feature'); |
| 36 parameters.comment = encodeURIComponent( | 86 parameters.comment = encodeURIComponent( |
| 37 'Signature: {{signature}}\nVersion: {{version}}\n' + | 87 'Signature: {{signature}}\nVersion: {{version}}\n' + |
| 38 'Channel: {{channel}}\nPlatform: {{platform}}\n\n' + | 88 'Channel: {{channel}}\nPlatform: {{platform}}\n\n' + |
| 39 'Findit result: ' + window.location.href + | 89 'Findit result: ' + window.location.href + |
| 40 '\n\nWhat is the bug or feature?'); | 90 '\n\nWhat is the bug or feature?'); |
| 41 return createUrl('https://code.google.com/p/chromium/issues/entry', | 91 return createUrl('https://code.google.com/p/chromium/issues/entry', |
| 42 parameters); | 92 parameters); |
| 43 } | 93 } |
| 44 | 94 |
| 95 |
| 96 function getCulpritPropertyNameForResult(result) { |
| 97 if (result.match('^suspected')) |
| 98 return result.replace('suspected', 'culprit'); |
| 99 |
| 100 return 'culprit_' + result; |
| 101 } |
| 102 |
| 103 |
| 104 function triageAnalysisResult(e) { |
| 105 var target = $(this); |
| 106 if (target.hasClass('triaged')) |
| 107 return; |
| 108 |
| 109 var new_analysis = {}; |
| 110 var update_data = {}; |
| 111 var result = target.attr('result_property'); |
| 112 var culprit_result = getCulpritPropertyNameForResult(result) |
| 113 if (target.hasClass('incorrect')) { |
| 114 var triage_status = 1; |
| 115 } else if (target.hasClass('correct')) { |
| 116 var triage_status = 2; |
| 117 if (result == 'suspected_cls') { |
| 118 update_data[culprit_result] = window[result]; |
| 119 for (var i in update_data[culprit_result]) { |
| 120 update_data[culprit_result][i] = update_data[culprit_result][i]['url
']; |
| 121 } |
| 122 } else { |
| 123 update_data[culprit_result] = window[result]; |
| 124 } |
| 125 } else if (target.hasClass('unsure')) { |
| 126 var triage_status = 3; |
| 127 } |
| 128 update_data[result + '_triage_status'] = triage_status; |
| 129 |
| 130 $.post('triage-fracas-analysis?key={{key}}', {'update-data': JSON.stringif
y(update_data)}, function(data) { |
| 131 if (data['success']) { |
| 132 $('.triaged[result_property=\'' + result + '\']').addClass('triage').r
emoveClass('triaged'); |
| 133 target.addClass('triaged').removeClass('triage'); |
| 134 if (triage_status == 2) { |
| 135 $('#' + result + '_culprit_input').addClass('not-display'); |
| 136 $('#' + culprit_result).val(update_data[culprit_result]); |
| 137 } else { |
| 138 $('#' + result + '_culprit_input').removeClass('not-display'); |
| 139 } |
| 140 } else { |
| 141 alert('Failed to update triage results. Please refresh and try again.'
); |
| 142 } |
| 143 }).error(function(xhr) { |
| 144 // Replace the whole page with errors from server side. |
| 145 document.body.outerHTML = xhr.responseText; |
| 146 }); |
| 147 e.preventDefault(); |
| 148 } |
| 149 |
| 150 |
| 151 function saveCulprits(e) { |
| 152 e.preventDefault(); |
| 153 var update_data = {}; |
| 154 var properties = ['culprit_regression_range', 'culprit_cls', 'culprit_proj
ect', 'culprit_components', 'note'] |
| 155 for (var i in properties) { |
| 156 var value = $('#' + properties[i]).val() |
| 157 if (value) { |
| 158 update_data[properties[i]] = value; |
| 159 } |
| 160 } |
| 161 $.post('triage-fracas-analysis?key={{key}}', {'update-data': JSON.stringif
y(update_data)}, function(data) { |
| 162 if (!data['success']) { |
| 163 alert('Failed to update datastore. Please refresh and try again.'); |
| 164 } |
| 165 }).error(function(xhr) { |
| 166 // Replace the whole page with errors from server side. |
| 167 document.body.outerHTML = xhr.responseText; |
| 168 }); |
| 169 } |
| 170 |
| 171 |
| 45 $(document).ready(function() { | 172 $(document).ready(function() { |
| 46 $('#monorail-bug').attr('href', constructMonorailUrl()); | 173 $('#monorail-bug').attr('href', constructMonorailUrl()); |
| 174 $('.triage').click(triageAnalysisResult); |
| 175 $.each(analysis_correct, function(result, triage_status) { |
| 176 if (triage_status == 1) { // Triaged-incorrect. |
| 177 $('.incorrect[result_property=\'' + result + '\']').addClass('triaged'
).removeClass('triage'); |
| 178 $('#' + result + '_culprit_input').removeClass('not-display'); |
| 179 } else if (triage_status == 2) { // Triaged-correct. |
| 180 $('.correct[result_property=\'' + result + '\']').addClass('triaged').
removeClass('triage'); |
| 181 $('#' + result + '_culprit_input').addClass('not-display'); |
| 182 } else if (triage_status == 3) { // Triaged-unsure. |
| 183 $('.unsure[result_property=\'' + result + '\']').addClass('triaged').r
emoveClass('triage'); |
| 184 $('#' + result + '_culprit_input').removeClass('not-display'); |
| 185 } |
| 186 }); |
| 187 $('#culprit_regression_range').val(culprit_regression_range); |
| 188 $('#culprit_cls').val(culprit_cls); |
| 189 $('#culprit_project').val(culprit_project); |
| 190 $('#culprit_components').val(culprit_components); |
| 191 $('#note').val(note); |
| 192 $('#save-button').click(saveCulprits); |
| 47 }) | 193 }) |
| 48 </script> | 194 </script> |
| 49 </head> | 195 </head> |
| 50 <body> | 196 <body> |
| 51 <div> | 197 <div> |
| 52 <b>Crash:</b> (<a href="#" id='monorail-bug'>File a Findit bug</a>) | 198 <b>Crash:</b> (<a href="#" id='monorail-bug'>File a Findit bug</a>) |
| 53 <br> | 199 <br> |
| 54 Signature: {{signature}}<br> | 200 Signature: {{signature}}<br> |
| 55 Version: <a href="https://chromium.googlesource.com/chromium/src.git/+/{{ver
sion}}">{{version}}</a><br> | 201 Version: <a href="https://chromium.googlesource.com/chromium/src.git/+/{{ver
sion}}">{{version}}</a><br> |
| 56 Channel: {{channel}}<br> | 202 Channel: {{channel}}<br> |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 245 |
| 100 <div> | 246 <div> |
| 101 <br> | 247 <br> |
| 102 <b> Regression range: </b> | 248 <b> Regression range: </b> |
| 103 {% if regression_range %} | 249 {% if regression_range %} |
| 104 <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> | 250 <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> |
| 105 {% else %} | 251 {% else %} |
| 106 Not found | 252 Not found |
| 107 {% endif %} | 253 {% endif %} |
| 108 <br> | 254 <br> |
| 255 <div class="triage-area"> |
| 256 <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> |
| 257 <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> |
| 258 <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> |
| 259 <div class="not-display" id="regression_range_culprit_input"> |
| 260 <br><br>Culprit regression range: (e.g. 53.0.2749.0, 53.0.2750.0)<br> |
| 261 <textarea id="culprit_regression_range" size="30" rows="1" cols="30"></t
extarea> |
| 262 </div> |
| 263 </div> |
| 109 <div> | 264 <div> |
| 110 | 265 |
| 111 <div> | 266 <div> |
| 112 <br><br> | |
| 113 {% if analysis_completed %} | 267 {% if analysis_completed %} |
| 268 <br><br> |
| 114 {% if analysis_failed %} | 269 {% if analysis_failed %} |
| 115 <span class="error">No result because of some error in analysis!</span> | 270 <span class="error">No result because of some error in analysis!</span> |
| 116 {% else %} | 271 {% else %} |
| 117 <b> Suspected cls: </b> | 272 <b> Suspected cls: </b> |
| 118 {% if suspected_cls %} | 273 {% if suspected_cls %} |
| 119 <table id="suspected_cls_table"> | 274 <table id="suspected_cls_table"> |
| 120 <tr> | 275 <tr> |
| 121 <th>Suspected cls</th> | 276 <th>Suspected cls</th> |
| 122 <th>Score</th> | 277 <th>Score</th> |
| 123 <th>Reason</th> | 278 <th>Reason</th> |
| 124 </tr> | 279 </tr> |
| 125 <tbody> | 280 <tbody> |
| 126 {% for suspected_cl in suspected_cls %} | 281 {% for suspected_cl in suspected_cls %} |
| 127 <tr> | 282 <tr> |
| 128 <td align="center"> <a href={{suspected_cl.url}}>{{suspected_cl.
revision}}</a> </td> | 283 <td align="center"> <a href={{suspected_cl.url}}>{{suspected_cl.
revision}}</a> </td> |
| 129 <td align="center"> {{suspected_cl.confidence}} </td> | 284 <td align="center"> {{suspected_cl.confidence}} </td> |
| 130 <td align="left"><pre>{{suspected_cl.reason}}</pre></td> | 285 <td align="left"><pre>{{suspected_cl.reason}}</pre></td> |
| 131 </tr> | 286 </tr> |
| 132 {% endfor %} | 287 {% endfor %} |
| 133 </tbody> | 288 </tbody> |
| 134 </table> | 289 </table> |
| 135 {% else %} | 290 {% else %} |
| 136 Not found <br> | 291 Not found <br> |
| 137 {% endif %} | 292 {% endif %} |
| 138 {% endif %} | 293 {% endif %} |
| 139 {% endif %} | 294 {% endif %} |
| 295 <div class="triage-area"> |
| 296 <div class="triage correct" result_property="suspected_cls">Correct<img sr
c="https://www.gstatic.com/images/icons/material/system/1x/sentiment_satisfied_b
lack_24dp.png"/></div> |
| 297 <div class="triage incorrect" result_property="suspected_cls">Incorrect<im
g src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_dissati
sfied_black_24dp.png"/></div> |
| 298 <div class="triage unsure" result_property="suspected_cls">Unsure<img src=
"https://www.gstatic.com/images/icons/material/system/1x/sentiment_neutral_black
_24dp.png"/></div> |
| 299 <div class="not-display" id="suspected_cls_culprit_input"> |
| 300 <br><br>Culprit suspected cls: (e.g. https://chromium.googlesource.com/
chromium/src/+/346a46f9cc4151e989b961d2d0429d16aeb49c14)<br> |
| 301 <textarea id="culprit_cls" size="30" rows="3" cols="100"></textarea> |
| 302 </div> |
| 303 </div> |
| 140 </div> | 304 </div> |
| 141 | 305 |
| 142 <div> | 306 <div> |
| 143 <br><br> | 307 <br><br> |
| 144 <b> Suspected project: </b> | 308 <b> Suspected project: </b> |
| 145 {% if suspected_project %} | 309 {% if suspected_project %} |
| 146 {{suspected_project}} | 310 {{suspected_project}} |
| 147 {% else %} | 311 {% else %} |
| 148 Not found | 312 Not found |
| 149 {% endif %} | 313 {% endif %} |
| 150 <br> | 314 <br> |
| 315 <div class="triage-area"> |
| 316 <div class="triage correct" result_property="suspected_project">Correct<im
g src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_satisfi
ed_black_24dp.png"/></div> |
| 317 <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> |
| 318 <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> |
| 319 <div class="not-display" id="suspected_project_culprit_input"> |
| 320 <br><br>Culprit project: (e.g. chromium)<br> |
| 321 <textarea id="culprit_project" size="30" rows="1"></textarea> |
| 322 </div> |
| 323 </div> |
| 151 </div> | 324 </div> |
| 152 | 325 |
| 153 <div> | 326 <div> |
| 154 <br><br> | 327 <br><br> |
| 155 <b> Suspected components:</b> | 328 <b> Suspected components:</b> |
| 156 {% if suspected_components %} | 329 {% if suspected_components %} |
| 157 <br> | 330 <br> |
| 158 {% for component in suspected_components %} | 331 {% for component in suspected_components %} |
| 159 <li> | 332 <li> |
| 160 {{component}} | 333 {{component}} |
| 161 </li> | 334 </li> |
| 162 {% endfor %} | 335 {% endfor %} |
| 163 {% else %} | 336 {% else %} |
| 164 Not found <br> | 337 Not found <br> |
| 165 {% endif %} | 338 {% endif %} |
| 339 <div class="triage-area"> |
| 340 <div class="triage correct" result_property="suspected_components">Correct
<img src="https://www.gstatic.com/images/icons/material/system/1x/sentiment_sati
sfied_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 <div class="not-display" id="suspected_components_culprit_input"> |
| 344 <br><br>Culprit components: (e.g. Blink>API, Blink>DOM)<br> |
| 345 <textarea id="culprit_components" rows="2"></textarea> |
| 346 </div> |
| 347 </div> |
| 166 </div> | 348 </div> |
| 167 | 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 <button type="submit" id="save-button">Save</button> |
| 360 |
| 361 <div> |
| 362 <br><br> |
| 363 {% if triage_history %} |
| 364 Triage history: |
| 365 <table> |
| 366 <tr><th>When</th><th>Who</th><th>Property</th><th>Result</th></tr> |
| 367 <tbody> |
| 368 {% for triage_record in triage_history %} |
| 369 <tr> |
| 370 <td>{{triage_record.triage_time}}</td> |
| 371 <td>{{triage_record.user_name}}</td> |
| 372 <td>{{triage_record.result_property}}</td> |
| 373 <td>{{triage_record.triage_status}}</td> |
| 374 </tr> |
| 375 {% endfor %} |
| 376 </tbody> |
| 377 </table> |
| 378 {% endif %} |
| 379 <div> |
| 380 |
| 168 </body> | 381 </body> |
| OLD | NEW |