index.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <!doctype html>
  2. <head>
  3. <link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles/main.css') }}">
  4. </head>
  5. <body onload="javascript: reload()">
  6. <div id="main">
  7. <a href="https://firmware.ardupilot.org/">
  8. <div id="logo">
  9. </div>
  10. </a>
  11. <div id="menu">
  12. <title>ArduPilot Custom Firmware Builder</title>
  13. <h2>ArduPilot Custom Firmware Builder</h2>
  14. <br><b>This site is EXPERIMENTAL</b>
  15. <p>Please select the required options for the custom firmware build.</p>
  16. <form action="/generate" method="post">
  17. <label for="vehicle">Choose a vehicle:</label>
  18. <select name="vehicle">
  19. {% for vehicle in get_vehicles() %}
  20. <option value="{{vehicle}}">{{vehicle}}</option>
  21. {% endfor %}
  22. </select>
  23. <br><br>
  24. <label for="board">Choose a board:</label>
  25. <select name="board">
  26. {% for board in get_boards() %}
  27. <option value="{{board}}">{{board}}</option>
  28. {% endfor %}
  29. </select>
  30. <br><br>
  31. {% for (label,define,text) in get_build_options() %}
  32. <input type="checkbox" name="{{label}}" value="define {{define}} 1">
  33. <input type="hidden" name="{{label}}" value="define {{define}} 0"> {{text}}
  34. <br>
  35. {% endfor %}
  36. <br>
  37. <input type="submit" value="Generate" method="post">
  38. </form>
  39. </div>
  40. <hr>
  41. <div id="build_status"></div>
  42. <br />
  43. <script>
  44. function reload() {
  45. var output = document.getElementById('build_status');
  46. var xhr = new XMLHttpRequest();
  47. xhr.open('GET', "/builds/status.html");
  48. // disable cache, thanks to: https://stackoverflow.com/questions/22356025/force-cache-control-no-cache-in-chrome-via-xmlhttprequest-on-f5-reload
  49. xhr.setRequestHeader("Cache-Control", "no-cache, no-store, max-age=0");
  50. xhr.setRequestHeader("Expires", "Tue, 01 Jan 1980 1:00:00 GMT");
  51. xhr.setRequestHeader("Pragma", "no-cache");
  52. xhr.onload = function() {
  53. if (xhr.status == 200) {
  54. output.innerHTML = xhr.responseText;
  55. }
  56. setTimeout(reload,5000)
  57. }
  58. xhr.send();
  59. }
  60. </script>
  61. </body>
  62. <hr>
  63. <footer>Created by Will Piper, <a href=https://github.com/ArduPilot/CustomBuild>Source Code<a>.</footer>