index2.html 5.6 KB

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