Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions web/static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ function init() {
$('body').tooltip({
selector: '[data-bs-toggle="tooltip"]'
});

const params = new URLSearchParams(window.location.search);
const buildId = params.get("build_id");
if (buildId) {
launchLogModal(buildId);
autoDownloadIntervalId = setInterval(tryAutoDownload, 5000, buildId);
}
}

function refresh_builds() {
Expand Down
6 changes: 0 additions & 6 deletions web/templates/add_build.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,6 @@ <h5 class="modal-title" id="dependencyCheckModalLabel">Attention!</h5>
</div>
</div>

{% if rebuild_from != None %}
<script>
var rebuildFromBuildId = '{{rebuild_from}}';
</script>
{% endif %}

<script type="text/javascript" src="/static/js/add_build.js"></script>
</body>
</html>
9 changes: 0 additions & 9 deletions web/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,6 @@ <h5 class="modal-title" id="featureModalLabel">Included features</h5>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js" integrity="sha384-mQ93GR66B00ZXjt0YO5KlohRA5SY2XofN4zfuZxLkoj1gXtW8ANNCe9d5Y3eG5eD" crossorigin="anonymous"></script>
<script type="text/javascript" src="/static/js/index.js"></script>

{% if build_id != None %}
<script>
document.addEventListener("load", launchLogModal('{{build_id}}'));

// Poll every 5 seconds for auto-download
autoDownloadIntervalId = setInterval(tryAutoDownload, 5000, '{{build_id}}');
</script>
{% endif %}

</body>

</html>
11 changes: 4 additions & 7 deletions web/ui/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,34 @@


@router.get("/", response_class=HTMLResponse)
async def index(request: Request, build_id: str = None):
async def index(request: Request):
"""
Render the main index page showing all builds.

Args:
request: FastAPI Request object
build_id: Optional build ID to automatically show log modal and
trigger artifact download on build completion

Returns:
Rendered HTML template
"""
return templates.TemplateResponse(
"index.html",
{"request": request, "build_id": build_id}
{"request": request}
)


@router.get("/add_build", response_class=HTMLResponse)
async def add_build(request: Request, rebuild_from: str = None):
async def add_build(request: Request):
"""
Render the add build page for creating new firmware builds.

Args:
request: FastAPI Request object
rebuild_from: Optional build ID to copy configuration from

Returns:
Rendered HTML template
"""
return templates.TemplateResponse(
"add_build.html",
{"request": request, "rebuild_from": rebuild_from}
{"request": request}
)