| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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> |
| OLD | NEW |