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
2 changes: 1 addition & 1 deletion web/static/js/add_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ async function handleFormSubmit(event) {
const result = await response.json();

// Redirect to viewlog page
window.location.href = `/viewlog/${result.build_id}`;
window.location.href = `/?build_id=${result.build_id}`;

} catch (error) {
console.error('Error submitting build:', error);
Expand Down
6 changes: 3 additions & 3 deletions web/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ <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 token != None %}
{% if build_id != None %}
<script>
document.addEventListener("load", launchLogModal('{{token}}'));
document.addEventListener("load", launchLogModal('{{build_id}}'));

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

Expand Down
25 changes: 4 additions & 21 deletions web/ui/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,21 @@


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

Args:
request: FastAPI Request object
token: Optional build token to automatically show log modal
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, "token": token}
)


@router.get("/viewlog/{token}", response_class=HTMLResponse)
async def viewlog(request: Request, token: str):
"""
Render the index page with a specific build log open.

Args:
request: FastAPI Request object
token: Build ID to show log for

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


Expand Down