| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <!doctype html>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='styles/main.css') }}">
- </head>
- <title>ArduPilot Custom Firmware Builder</title>
- <h2>ArduPilot Custom Firmware Builder</h2>
- {% if error %}
- <p>{{ error }} {{ex}}</p>
- {% else %}
- <body onload="javascript: reload()">
- <div id="main">
- <a href="https://custom.ardupilot.org/">
- <div id="logo">
- </div>
- </a>
- <div id="menu">
- <p>Build in progress...</p>
- <form action="/builds/{{token}}" target="_blank">
- <input type="submit" value="Go to build directory"/>
- </form>
- <form action="/builds" target="_blank">
- <input type="submit" value="See all builds"/>
- </form>
- <form action="/">
- <input type="submit" value="Queue another build">
- </form>
- </div>
- <p>Build ID: {{ token }}</p>
- <p>Build progress:</p>
- <textarea
- id="build_output" rows="30" cols="100" readonly>
- </textarea>
- <br><input type="checkbox" id="AutoScroll" checked>AutoScroll
- <script>
- function reload() {
- var output = document.getElementById('build_output');
- var xhr = new XMLHttpRequest();
- xhr.open('GET', "/builds/{{token}}/build.log");
- // disable cache, thanks to: https://stackoverflow.com/questions/22356025/force-cache-control-no-cache-in-chrome-via-xmlhttprequest-on-f5-reload
- xhr.setRequestHeader("Cache-Control", "no-cache, no-store, max-age=0");
- xhr.setRequestHeader("Expires", "Tue, 01 Jan 1980 1:00:00 GMT");
- xhr.setRequestHeader("Pragma", "no-cache");
- xhr.onload = function () {
- if (xhr.status == 200) {
- output.textContent = xhr.responseText;
- var scrollcheck = document.getElementById('AutoScroll');
- if (scrollcheck.checked) {
- output.scrollTop = output.scrollHeight;
- }
- if (xhr.responseText.includes("BUILD_FINISHED")) {
- return;
- }
- }
- setTimeout(reload, 3000)
- }
- xhr.send();
- }
- </script>
- </body>
- {% endif %}
- </html>
|