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

Side by Side Diff: appengine/findit/templates/config.html

Issue 1866883002: [Findit] A huge refactoring and some bug fixing. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fix nit. Created 4 years, 8 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
« no previous file with comments | « appengine/findit/templates/build_failure.html ('k') | appengine/findit/templates/home.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>Findit Configuration</title> 6 <title>Findit Configuration</title>
7 <style> 7 <style>
8 .previous, .next, .latest { 8 .previous, .next, .latest {
9 color: #0645AD; 9 color: #0645AD;
10 background:none!important; 10 background:none!important;
(...skipping 23 matching lines...) Expand all
34 function getJsonOfTextarea(textId) { 34 function getJsonOfTextarea(textId) {
35 return JSON.parse($('#' + textId).val()); 35 return JSON.parse($('#' + textId).val());
36 } 36 }
37 37
38 function getStringFromJson(json) { 38 function getStringFromJson(json) {
39 return JSON.stringify(json, null, ' '); 39 return JSON.stringify(json, null, ' ');
40 } 40 }
41 41
42 function createUrl(version) { 42 function createUrl(version) {
43 if (version) 43 if (version)
44 return '/config?version=' + version.toString(); 44 return '/waterfall/config?version=' + version.toString();
45 else 45 else
46 return '/config'; 46 return '/waterfall/config';
47 } 47 }
48 48
49 function loadPrevious() { 49 function loadPrevious() {
50 $.get('/config').done(function(){ 50 var newUrl = createUrl({{ version }} - 1);
51 var newUrl = createUrl({{ version }} - 1); 51 window.location.replace(newUrl);
52 window.location.replace(newUrl);
53 });
54 } 52 }
55 53
56 function loadNext() { 54 function loadNext() {
57 $.get('/config').done(function(){ 55 var newUrl = createUrl({{ version }} + 1);
58 var newUrl = createUrl({{ version }} + 1); 56 window.location.replace(newUrl);
59 window.location.replace(newUrl);
60 });
61 } 57 }
62 58
63 function loadLatest() { 59 function loadLatest() {
64 $.get('/config').done(function(){ 60 var newUrl = createUrl(null);
65 var newUrl = createUrl(null); 61 window.location.replace(newUrl);
66 window.location.replace(newUrl);
67 });
68 } 62 }
69 63
70 function save(e) { 64 function save(e) {
71 var newConfig = { 65 var newConfig = {
72 'steps_for_masters_rules': getJsonOfTextarea('steps-for-masters-rules'), 66 'steps_for_masters_rules': getJsonOfTextarea('steps-for-masters-rules'),
73 'builders_to_trybots': getJsonOfTextarea('builders-to-trybots'), 67 'builders_to_trybots': getJsonOfTextarea('builders-to-trybots'),
74 'try_job_settings': getJsonOfTextarea('try-job-settings'), 68 'try_job_settings': getJsonOfTextarea('try-job-settings'),
75 'swarming_settings': getJsonOfTextarea('swarming-settings') 69 'swarming_settings': getJsonOfTextarea('swarming-settings')
76 }; 70 };
77 $.post('/config', { data: JSON.stringify(newConfig) }).done(function(){ 71 $.post('/waterfall/config', { data: JSON.stringify(newConfig) }).done(func tion(){
78 window.location.replace(createUrl(null)); // Reload after successful sa ving. 72 window.location.replace(createUrl(null)); // Reload after successful sa ving.
79 }).fail(function(xhr){ 73 }).fail(function(xhr){
80 // Replace the whole page with errors from server side. 74 // Replace the whole page with errors from server side.
81 document.body.outerHTML = xhr.responseText; 75 document.body.outerHTML = xhr.responseText;
82 }); 76 });
83 e.preventDefault(); 77 e.preventDefault();
84 } 78 }
85 79
86 $(document).ready(function() { 80 $(document).ready(function() {
87 $('#previous-version-button').click(loadPrevious); 81 $('#previous-version-button').click(loadPrevious);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 Try Job Settings:<br> 128 Try Job Settings:<br>
135 <textarea id="try-job-settings" rows="10" cols="80"></textarea> 129 <textarea id="try-job-settings" rows="10" cols="80"></textarea>
136 </div> 130 </div>
137 <div> 131 <div>
138 Swarming Task Settings:<br> 132 Swarming Task Settings:<br>
139 <textarea id="swarming-settings" rows="10" cols="80"></textarea> 133 <textarea id="swarming-settings" rows="10" cols="80"></textarea>
140 </div> 134 </div>
141 <br> 135 <br>
142 <button type="submit" id="save-button">Save</button> 136 <button type="submit" id="save-button">Save</button>
143 </body> 137 </body>
OLDNEW
« no previous file with comments | « appengine/findit/templates/build_failure.html ('k') | appengine/findit/templates/home.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698