| 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 14 matching lines...) Expand all Loading... |
| 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 findit.actionSettings = {{ action_settings | tojson | safe }}; |
| 35 findit.checkFlakeSettings = {{ check_flake_settings | tojson | safe }}; |
| 35 | 36 |
| 36 function getJsonOfTextarea(textId) { | 37 function getJsonOfTextarea(textId) { |
| 37 return JSON.parse($('#' + textId).val()); | 38 return JSON.parse($('#' + textId).val()); |
| 38 } | 39 } |
| 39 | 40 |
| 40 function getStringFromJson(json) { | 41 function getStringFromJson(json) { |
| 41 return JSON.stringify(json, null, ' '); | 42 return JSON.stringify(json, null, ' '); |
| 42 } | 43 } |
| 43 | 44 |
| 44 function createUrl(version) { | 45 function createUrl(version) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 64 } | 65 } |
| 65 | 66 |
| 66 function save(e) { | 67 function save(e) { |
| 67 var newConfig = { | 68 var newConfig = { |
| 68 'steps_for_masters_rules': getJsonOfTextarea('steps-for-masters-rules'), | 69 'steps_for_masters_rules': getJsonOfTextarea('steps-for-masters-rules'), |
| 69 'builders_to_trybots': getJsonOfTextarea('builders-to-trybots'), | 70 'builders_to_trybots': getJsonOfTextarea('builders-to-trybots'), |
| 70 'try_job_settings': getJsonOfTextarea('try-job-settings'), | 71 'try_job_settings': getJsonOfTextarea('try-job-settings'), |
| 71 'swarming_settings': getJsonOfTextarea('swarming-settings'), | 72 'swarming_settings': getJsonOfTextarea('swarming-settings'), |
| 72 'download_build_data_settings': getJsonOfTextarea('download-build-data-s
ettings'), | 73 'download_build_data_settings': getJsonOfTextarea('download-build-data-s
ettings'), |
| 73 'action_settings': getJsonOfTextarea('action-settings'), | 74 'action_settings': getJsonOfTextarea('action-settings'), |
| 75 'check_flake_settings': getJsonOfTextarea('check-flake-settings') |
| 74 }; | 76 }; |
| 75 $.post('/waterfall/config', { data: JSON.stringify(newConfig) }).done(func
tion(){ | 77 $.post('/waterfall/config', { data: JSON.stringify(newConfig) }).done(func
tion(){ |
| 76 window.location.replace(createUrl(null)); // Reload after successful sa
ving. | 78 window.location.replace(createUrl(null)); // Reload after successful sa
ving. |
| 77 }).fail(function(xhr){ | 79 }).fail(function(xhr){ |
| 78 // Replace the whole page with errors from server side. | 80 // Replace the whole page with errors from server side. |
| 79 document.body.outerHTML = xhr.responseText; | 81 document.body.outerHTML = xhr.responseText; |
| 80 }); | 82 }); |
| 81 e.preventDefault(); | 83 e.preventDefault(); |
| 82 } | 84 } |
| 83 | 85 |
| 84 $(document).ready(function() { | 86 $(document).ready(function() { |
| 85 $('#previous-version-button').click(loadPrevious); | 87 $('#previous-version-button').click(loadPrevious); |
| 86 $('#next-version-button').click(loadNext); | 88 $('#next-version-button').click(loadNext); |
| 87 $('#latest-version-button').click(loadLatest); | 89 $('#latest-version-button').click(loadLatest); |
| 88 $('#save-button').click(save); | 90 $('#save-button').click(save); |
| 89 $('#steps-for-masters-rules').val(getStringFromJson(findit.stepsForMasters
Rules)); | 91 $('#steps-for-masters-rules').val(getStringFromJson(findit.stepsForMasters
Rules)); |
| 90 $('#builders-to-trybots').val(getStringFromJson(findit.builders)); | 92 $('#builders-to-trybots').val(getStringFromJson(findit.builders)); |
| 91 $('#try-job-settings').val(getStringFromJson(findit.tryJobSettings)); | 93 $('#try-job-settings').val(getStringFromJson(findit.tryJobSettings)); |
| 92 $('#swarming-settings').val(getStringFromJson(findit.swarmingSettings)); | 94 $('#swarming-settings').val(getStringFromJson(findit.swarmingSettings)); |
| 93 $('#download-build-data-settings').val(getStringFromJson(findit.downloadBu
ildDataSettings)); | 95 $('#download-build-data-settings').val(getStringFromJson(findit.downloadBu
ildDataSettings)); |
| 94 $('#action-settings').val(getStringFromJson(findit.actionSettings)); | 96 $('#action-settings').val(getStringFromJson(findit.actionSettings)); |
| 97 $('#check-flake-settings').val(getStringFromJson(findit.checkFlakeSettings
)) |
| 95 | 98 |
| 96 if ({{ version }} < 2) { | 99 if ({{ version }} < 2) { |
| 97 $('#previous-version-button').attr('disabled', 'disabled'); | 100 $('#previous-version-button').attr('disabled', 'disabled'); |
| 98 $('#previous-version-button').addClass('disabled'); | 101 $('#previous-version-button').addClass('disabled'); |
| 99 } | 102 } |
| 100 else if ({{ version }} >= {{ latest_version }} ) { | 103 else if ({{ version }} >= {{ latest_version }} ) { |
| 101 $('#next-version-button').attr('disabled', 'disabled'); | 104 $('#next-version-button').attr('disabled', 'disabled'); |
| 102 $('#next-version-button').addClass('disabled'); | 105 $('#next-version-button').addClass('disabled'); |
| 103 } | 106 } |
| 104 else { | 107 else { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 <textarea id="swarming-settings" rows="10" cols="80"></textarea> | 142 <textarea id="swarming-settings" rows="10" cols="80"></textarea> |
| 140 </div> | 143 </div> |
| 141 <div> | 144 <div> |
| 142 Download Build Data Settings:<br> | 145 Download Build Data Settings:<br> |
| 143 <textarea id="download-build-data-settings" rows="10" cols="80"></textarea> | 146 <textarea id="download-build-data-settings" rows="10" cols="80"></textarea> |
| 144 </div> | 147 </div> |
| 145 <div> | 148 <div> |
| 146 Action Settings for identified culprits or suspects:<br> | 149 Action Settings for identified culprits or suspects:<br> |
| 147 <textarea id="action-settings" rows="10" cols="80"></textarea> | 150 <textarea id="action-settings" rows="10" cols="80"></textarea> |
| 148 </div> | 151 </div> |
| 152 <div> |
| 153 Check Test Flakiness Settings:<br> |
| 154 <textarea id="check-flake-settings" rows="10" cols="80"></textarea> |
| 155 </div> |
| 149 <br> | 156 <br> |
| 150 <button type="submit" id="save-button">Save</button> | 157 <button type="submit" id="save-button">Save</button> |
| 151 </body> | 158 </body> |
| OLD | NEW |