Add HTML5 project creation form
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-16 21:30:41 +03:00
parent e71789f51e
commit 86f64de08f
3 changed files with 64 additions and 4 deletions
@@ -39,6 +39,7 @@ from api_server.html5 import (
render_html5_editor,
render_html5_index,
render_html5_project_setup,
render_html5_project_rows,
render_html5_setup_summary,
render_html5_source,
render_html5_status,
@@ -1584,6 +1585,19 @@ async def html5_index() -> Response:
)
@app.post("/html5/projects")
async def html5_create_project(request: Request) -> Response:
form = await _html5_form_data(request)
project_id = _form_value(form, "project_id")
if not project_id:
raise HTTPException(status_code=400, detail="project_id is required.")
await create_project(ProjectCreateRequest(project_id=project_id, name=_form_value(form, "name")))
return Response(
render_html5_project_rows(_project_summaries()),
media_type="text/html; charset=utf-8",
)
@app.get("/html5/projects/{project_id}/editor")
async def html5_project_editor(project_id: str, q: str = "") -> Response:
try: