| 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 12 matching lines...) Expand all Loading... |
| 23 border-bottom:1px solid #d3d3d3; | 23 border-bottom:1px solid #d3d3d3; |
| 24 cursor: pointer; | 24 cursor: pointer; |
| 25 } | 25 } |
| 26 </style> | 26 </style> |
| 27 <script> | 27 <script> |
| 28 var findit = {}; | 28 var findit = {}; |
| 29 findit.stepsForMastersRules = {{ masters | tojson | safe }}; | 29 findit.stepsForMastersRules = {{ masters | tojson | safe }}; |
| 30 findit.builders = {{ builders | tojson | safe }}; | 30 findit.builders = {{ builders | tojson | safe }}; |
| 31 findit.tryJobSettings = {{ try_job_settings | tojson | safe}}; | 31 findit.tryJobSettings = {{ try_job_settings | tojson | safe}}; |
| 32 findit.swarmingSettings = {{ swarming_settings | tojson | safe }}; | 32 findit.swarmingSettings = {{ swarming_settings | tojson | safe }}; |
| 33 findit.downloadBuildDataSettings = {{ download_build_data_settings | tojson
| safe }} | 33 findit.downloadBuildDataSettings = {{ download_build_data_settings | tojson
| safe }}; |
| 34 findit.actionSettings = {{ action_settings | tojson | safe }}; |
| 34 | 35 |
| 35 function getJsonOfTextarea(textId) { | 36 function getJsonOfTextarea(textId) { |
| 36 return JSON.parse($('#' + textId).val()); | 37 return JSON.parse($('#' + textId).val()); |
| 37 } | 38 } |
| 38 | 39 |
| 39 function getStringFromJson(json) { | 40 function getStringFromJson(json) { |
| 40 return JSON.stringify(json, null, ' '); | 41 return JSON.stringify(json, null, ' '); |
| 41 } | 42 } |
| 42 | 43 |
| 43 function createUrl(version) { | 44 function createUrl(version) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 61 var newUrl = createUrl(null); | 62 var newUrl = createUrl(null); |
| 62 window.location.replace(newUrl); | 63 window.location.replace(newUrl); |
| 63 } | 64 } |
| 64 | 65 |
| 65 function save(e) { | 66 function save(e) { |
| 66 var newConfig = { | 67 var newConfig = { |
| 67 'steps_for_masters_rules': getJsonOfTextarea('steps-for-masters-rules'), | 68 'steps_for_masters_rules': getJsonOfTextarea('steps-for-masters-rules'), |
| 68 'builders_to_trybots': getJsonOfTextarea('builders-to-trybots'), | 69 'builders_to_trybots': getJsonOfTextarea('builders-to-trybots'), |
| 69 'try_job_settings': getJsonOfTextarea('try-job-settings'), | 70 'try_job_settings': getJsonOfTextarea('try-job-settings'), |
| 70 'swarming_settings': getJsonOfTextarea('swarming-settings'), | 71 'swarming_settings': getJsonOfTextarea('swarming-settings'), |
| 71 'download_build_data_settings': getJsonOfTextarea('download-build-data-s
ettings') | 72 'download_build_data_settings': getJsonOfTextarea('download-build-data-s
ettings'), |
| 73 'action_settings': getJsonOfTextarea('action-settings'), |
| 72 }; | 74 }; |
| 73 $.post('/waterfall/config', { data: JSON.stringify(newConfig) }).done(func
tion(){ | 75 $.post('/waterfall/config', { data: JSON.stringify(newConfig) }).done(func
tion(){ |
| 74 window.location.replace(createUrl(null)); // Reload after successful sa
ving. | 76 window.location.replace(createUrl(null)); // Reload after successful sa
ving. |
| 75 }).fail(function(xhr){ | 77 }).fail(function(xhr){ |
| 76 // Replace the whole page with errors from server side. | 78 // Replace the whole page with errors from server side. |
| 77 document.body.outerHTML = xhr.responseText; | 79 document.body.outerHTML = xhr.responseText; |
| 78 }); | 80 }); |
| 79 e.preventDefault(); | 81 e.preventDefault(); |
| 80 } | 82 } |
| 81 | 83 |
| 82 $(document).ready(function() { | 84 $(document).ready(function() { |
| 83 $('#previous-version-button').click(loadPrevious); | 85 $('#previous-version-button').click(loadPrevious); |
| 84 $('#next-version-button').click(loadNext); | 86 $('#next-version-button').click(loadNext); |
| 85 $('#latest-version-button').click(loadLatest); | 87 $('#latest-version-button').click(loadLatest); |
| 86 $('#save-button').click(save); | 88 $('#save-button').click(save); |
| 87 $('#steps-for-masters-rules').val(getStringFromJson(findit.stepsForMasters
Rules)); | 89 $('#steps-for-masters-rules').val(getStringFromJson(findit.stepsForMasters
Rules)); |
| 88 $('#builders-to-trybots').val(getStringFromJson(findit.builders)); | 90 $('#builders-to-trybots').val(getStringFromJson(findit.builders)); |
| 89 $('#try-job-settings').val(getStringFromJson(findit.tryJobSettings)); | 91 $('#try-job-settings').val(getStringFromJson(findit.tryJobSettings)); |
| 90 $('#swarming-settings').val(getStringFromJson(findit.swarmingSettings)); | 92 $('#swarming-settings').val(getStringFromJson(findit.swarmingSettings)); |
| 91 $('#download-build-data-settings').val(getStringFromJson(findit.downloadBu
ildDataSettings)); | 93 $('#download-build-data-settings').val(getStringFromJson(findit.downloadBu
ildDataSettings)); |
| 94 $('#action-settings').val(getStringFromJson(findit.actionSettings)); |
| 92 | 95 |
| 93 if ({{ version }} < 2) { | 96 if ({{ version }} < 2) { |
| 94 $('#previous-version-button').attr('disabled', 'disabled'); | 97 $('#previous-version-button').attr('disabled', 'disabled'); |
| 95 $('#previous-version-button').addClass('disabled'); | 98 $('#previous-version-button').addClass('disabled'); |
| 96 } | 99 } |
| 97 else if ({{ version }} >= {{ latest_version }} ) { | 100 else if ({{ version }} >= {{ latest_version }} ) { |
| 98 $('#next-version-button').attr('disabled', 'disabled'); | 101 $('#next-version-button').attr('disabled', 'disabled'); |
| 99 $('#next-version-button').addClass('disabled'); | 102 $('#next-version-button').addClass('disabled'); |
| 100 } | 103 } |
| 101 else { | 104 else { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 132 <textarea id="try-job-settings" rows="10" cols="80"></textarea> | 135 <textarea id="try-job-settings" rows="10" cols="80"></textarea> |
| 133 </div> | 136 </div> |
| 134 <div> | 137 <div> |
| 135 Swarming Task Settings:<br> | 138 Swarming Task Settings:<br> |
| 136 <textarea id="swarming-settings" rows="10" cols="80"></textarea> | 139 <textarea id="swarming-settings" rows="10" cols="80"></textarea> |
| 137 </div> | 140 </div> |
| 138 <div> | 141 <div> |
| 139 Download Build Data Settings:<br> | 142 Download Build Data Settings:<br> |
| 140 <textarea id="download-build-data-settings" rows="10" cols="80"></textarea> | 143 <textarea id="download-build-data-settings" rows="10" cols="80"></textarea> |
| 141 </div> | 144 </div> |
| 145 <div> |
| 146 Action Settings for identified culprits or suspects:<br> |
| 147 <textarea id="action-settings" rows="10" cols="80"></textarea> |
| 148 </div> |
| 142 <br> | 149 <br> |
| 143 <button type="submit" id="save-button">Save</button> | 150 <button type="submit" id="save-button">Save</button> |
| 144 </body> | 151 </body> |
| OLD | NEW |