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

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

Issue 1914113002: [Findit] Enable project classifier and component classifier (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 7 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <head> 2 <head>
3 <meta charset="utf-8"> 3 <meta charset="utf-8">
4 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></sc ript> 4 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></sc ript>
5 <link rel="stylesheet" href="/common.css"></link> 5 <link rel="stylesheet" href="/common.css"></link>
6 <title>Crash Configuration</title> 6 <title>Crash Configuration</title>
7 <script> 7 <script>
8 var crash = {}; 8 var crash = {};
9 crash.fracas = {{ fracas | tojson | safe }}; 9 crash.fracas = {{ fracas | tojson | safe }};
10 crash.component_classifier = {{ component_classifier | tojson | safe }};
11 crash.project_classifier = {{ project_classifier | tojson | safe }};
12 crash.constants = {{ constants | tojson | safe }};
10 13
11 function getJsonOfTextarea(textId) { 14 function getJsonOfTextarea(textId) {
12 return JSON.parse($('#' + textId).val()); 15 return JSON.parse($('#' + textId).val());
13 } 16 }
14 17
15 function getStringFromJson(json) { 18 function getStringFromJson(json) {
16 return JSON.stringify(json, null, ' '); 19 return JSON.stringify(json, null, ' ');
17 } 20 }
18 21
19 function save(e) { 22 function save(e) {
20 var newConfig = { 23 var newConfig = {
21 'fracas': getJsonOfTextarea('fracas'), 24 'fracas': getJsonOfTextarea('fracas'),
25 'component_classifier': getJsonOfTextarea('component-classifier'),
26 'project_classifier': getJsonOfTextarea('project-classifier'),
27 'constants': getJsonOfTextarea('constants'),
22 }; 28 };
23 $.post('/crash/config', { data: JSON.stringify(newConfig) }).done(function () { 29 $.post('/crash/config', { data: JSON.stringify(newConfig) }).done(function () {
24 window.location.reload(); // Reload after successful saving. 30 window.location.reload(); // Reload after successful saving.
25 }).fail(function(xhr) { 31 }).fail(function(xhr) {
26 // Replace the whole page with errors from server side. 32 // Replace the whole page with errors from server side.
27 document.body.outerHTML = xhr.responseText; 33 document.body.outerHTML = xhr.responseText;
28 }); 34 });
29 e.preventDefault(); 35 e.preventDefault();
30 } 36 }
31 37
32 $(document).ready(function() { 38 $(document).ready(function() {
33 $('#save-button').click(save); 39 $('#save-button').click(save);
34 $('#fracas').val(getStringFromJson(crash.fracas)); 40 $('#fracas').val(getStringFromJson(crash.fracas));
41 $('#component-classifier').val(getStringFromJson(crash.component_classifie r));
42 $('#project-classifier').val(getStringFromJson(crash.project_classifier));
43 $('#constants').val(getStringFromJson(crash.constants));
35 }); 44 });
36 </script> 45 </script>
37 </head> 46 </head>
38 <body> 47 <body>
39 <h3>Crash Configuration</h3> 48 <h3>Crash Configuration</h3>
40 <div> 49 <div>
41 Settings for Fracas:<br> 50 Settings for Fracas:<br>
42 <textarea id="fracas" rows="20" cols="80"></textarea> 51 <textarea id="fracas" rows="20" cols="80"></textarea>
43 </div> 52 </div>
53 <div>
54 Settings for component classifier:<br>
55 <textarea id="component-classifier" rows="20" cols="80"></textarea>
56 </div>
57 <div>
58 Settings for project classifier:<br>
59 <textarea id="project-classifier" rows="20" cols="80"></textarea>
60 </div>
61 <div>
62 Constants:<br>
63 <textarea id="constants" rows="20" cols="80"></textarea>
64 </div>
44 <button type="submit" id="save-button">Save</button> 65 <button type="submit" id="save-button">Save</button>
45 </body> 66 </body>
OLDNEW
« appengine/findit/crash/project_classifier.py ('K') | « appengine/findit/model/crash/crash_config.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698