index2.html 5.3 KB

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