index.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ArduPilot Custom Firmware Builder</title>
  6. <meta name="description"
  7. content="ArduPilot Custom Firmware Builder. It allows to build custom ArduPilot firmware by selecting the wanted features.">
  8. <meta name="author" content="ArduPilot Team">
  9. <meta name="viewport" content="width=device-width, initial-scale=1">
  10. <!-- OG Meta Tags to improve the way the post looks when you share the page on LinkedIn, Facebook, Google+ -->
  11. <meta property="og:site_name" content="ArduPilot"/>
  12. <meta property="og:site" content=""/>
  13. <meta property="og:title" content="ArduPilot Custom Firmware Builder"/>
  14. <meta property="og:description"
  15. content="ArduPilot Custom Firmware Builder. It allows to build custom ArduPilot firmware by selecting the wanted features."/>
  16. <!-- description shown in the actual shared post -->
  17. <meta property="og:type" content="website">
  18. <meta property="og:url" content="https://custom.ardupilot.org/">
  19. <meta property="og:image" content="https://ardupilot.org/application/files/6315/7552/1962/ArduPilot-Motto.png">
  20. <link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='styles/main.css') }}">
  21. </head>
  22. <body onload="javascript: reload()">
  23. <div id="main">
  24. <a href="https://custom.ardupilot.org/">
  25. <div id="logo">
  26. </div>
  27. </a>
  28. <div id="menu">
  29. <h2>ArduPilot Custom Firmware Builder</h2>
  30. <p>Please select the branch to build, then hit 'Next'.</p>
  31. <form action="/index2" method="post">
  32. <label for="branch">Choose a branch:
  33. <select name="branch">
  34. {% for branch in get_branches()[0] %}
  35. {% if branches == get_branches()[1] %}
  36. <option value="{{branch}}" selected>{{get_branches()[0][branch]}}</option>
  37. {% else %}
  38. <option value="{{branch}}">{{get_branches()[0][branch]}}</option>
  39. {% endif %}
  40. {% endfor %}
  41. </select>
  42. </label>
  43. <p></p>
  44. <label for="vehicle">Choose a vehicle:
  45. <select name="vehicle">
  46. {% for vehicle in get_vehicles()[0] %}
  47. {% if vehicle == get_vehicles()[1] %}
  48. <option value="{{vehicle}}" selected>{{vehicle}}</option>
  49. {% else %}
  50. <option value="{{vehicle}}">{{vehicle}}</option>
  51. {% endif %}
  52. {% endfor %}
  53. </select>
  54. </label>
  55. <br>
  56. <input type="submit" value="Next">
  57. </form>
  58. </div>
  59. <hr>
  60. <p>Exisiting builds (click on the status of a build to view it):</p>
  61. <div id="build_status"></div>
  62. <br/>
  63. <script>
  64. function reload() {
  65. var output = document.getElementById('build_status');
  66. var xhr = new XMLHttpRequest();
  67. xhr.open('GET', "/builds/status.html");
  68. // disable cache, thanks to: https://stackoverflow.com/questions/22356025/force-cache-control-no-cache-in-chrome-via-xmlhttprequest-on-f5-reload
  69. xhr.setRequestHeader("Cache-Control", "no-cache, no-store, max-age=0");
  70. xhr.setRequestHeader("Expires", "Tue, 01 Jan 1980 1:00:00 GMT");
  71. xhr.setRequestHeader("Pragma", "no-cache");
  72. xhr.onload = function () {
  73. if (xhr.status === 200) {
  74. output.innerHTML = xhr.responseText;
  75. }
  76. setTimeout(reload, 5000)
  77. }
  78. xhr.send();
  79. }
  80. </script>
  81. </div>
  82. </body>
  83. <hr>
  84. <footer>Created by Will Piper, <a href=https://github.com/ArduPilot/CustomBuild>Source Code</a>.</footer>
  85. </html>