index.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. <script type="text/javascript" src="{{ url_for('static', filename='js/CollapsibleLists.js')}}"></script>
  22. </head>
  23. <body onload="javascript: reload()">
  24. <div id="main">
  25. <a href="https://custom.ardupilot.org/">
  26. <div id="logo">
  27. </div>
  28. </a>
  29. <div id="menu">
  30. <h2>ArduPilot Custom Firmware Builder</h2>
  31. <br><b>This site is EXPERIMENTAL</b>
  32. <p>Please select the required options for the custom firmware build, then hit 'Generate'.</p>
  33. <form action="/generate" method="post">
  34. <label for="vehicle">Choose a vehicle:
  35. <select name="vehicle">
  36. {% for vehicle in get_vehicles()[0] %}
  37. {% if vehicle == get_vehicles()[1] %}
  38. <option value="{{vehicle}}" selected>{{vehicle}}</option>
  39. {% else %}
  40. <option value="{{vehicle}}">{{vehicle}}</option>
  41. {% endif %}
  42. {% endfor %}
  43. </select>
  44. </label>
  45. <p></p>
  46. <label for="board">Choose a board:
  47. <select name="board">
  48. {% for board in get_boards()[0] %}
  49. {% if board == get_boards()[1] %}
  50. <option value="{{board}}" selected>{{board}}</option>
  51. {% else %}
  52. <option value="{{board}}">{{board}}</option>
  53. {% endif %}
  54. {% endfor %}
  55. </select>
  56. </label>
  57. <p></p>
  58. <label for="board">Select Features:
  59. <ul class="collapsibleList">
  60. {% for c in get_build_categories() %}
  61. <li>{{c}}
  62. <ul>
  63. {% for f in get_build_options(c) %}
  64. <li>
  65. {% if f.default == 1 %}
  66. <input onclick='dependencies(this, "{{f.label}}", "{{f.dependency}}");' type="checkbox"
  67. name="{{f.label}}" id="{{f.label}}" value="1" checked>
  68. {% else %}
  69. <input onclick='dependencies(this, "{{f.label}}", "{{f.dependency}}");' type="checkbox"
  70. name="{{f.label}}" id="{{f.label}}" value="1">
  71. {% endif %}
  72. {{f.description}}
  73. </li>
  74. {% endfor %}
  75. </ul>
  76. </li>
  77. {% endfor %}
  78. </ul>
  79. </label>
  80. <br>
  81. <input type="submit" value="Generate">
  82. </form>
  83. </div>
  84. <hr>
  85. <p>Exisiting builds (click on the status of a build to view it):</p>
  86. <div id="build_status"></div>
  87. <br/>
  88. <script>
  89. CollapsibleLists.apply();
  90. function reload() {
  91. var output = document.getElementById('build_status');
  92. var xhr = new XMLHttpRequest();
  93. xhr.open('GET', "/builds/status.html");
  94. // disable cache, thanks to: https://stackoverflow.com/questions/22356025/force-cache-control-no-cache-in-chrome-via-xmlhttprequest-on-f5-reload
  95. xhr.setRequestHeader("Cache-Control", "no-cache, no-store, max-age=0");
  96. xhr.setRequestHeader("Expires", "Tue, 01 Jan 1980 1:00:00 GMT");
  97. xhr.setRequestHeader("Pragma", "no-cache");
  98. xhr.onload = function () {
  99. if (xhr.status === 200) {
  100. output.innerHTML = xhr.responseText;
  101. }
  102. setTimeout(reload, 5000)
  103. }
  104. xhr.send();
  105. }
  106. function dependencies(cb, f_label, f_dependency1) {
  107. switch (cb.name) {
  108. case f_label:
  109. const f_dependency = f_dependency1.split(",")
  110. var arrayLength = f_dependency.length;
  111. for (var i = 0; i < arrayLength; i++) {
  112. if (document.getElementById(f_dependency[i]).checked == false) {
  113. document.getElementById(f_dependency[i]).checked = cb.checked;
  114. }
  115. }
  116. break;
  117. }
  118. }
  119. </script>
  120. </div>
  121. </body>
  122. <hr>
  123. <footer>Created by Will Piper, <a href=https://github.com/ArduPilot/CustomBuild>Source Code</a>.</footer>
  124. </html>