Add htmx HTML5 fragments
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-16 21:18:43 +03:00
parent 567b517699
commit 03f1af0301
3 changed files with 92 additions and 18 deletions
+22 -1
View File
@@ -35,7 +35,7 @@ from fastapi.responses import PlainTextResponse, Response, StreamingResponse
from neo4j import AsyncGraphDatabase
from pydantic import BaseModel, Field
from api_server.html5 import render_html5_editor, render_html5_index, render_html5_status
from api_server.html5 import render_html5_editor, render_html5_index, render_html5_source, render_html5_status, render_html5_symbols
from impact_engine import object_impact, routine_impact
from incremental_indexer import rebuild_changed_file
from integration_topology import IntegrationKind, build_integration_topology
@@ -1618,6 +1618,27 @@ async def html5_project_events(project_id: str, once: bool = False) -> Streaming
)
@app.get("/html5/projects/{project_id}/symbols")
async def html5_project_symbols(project_id: str, q: str = "") -> Response:
snapshot = _project_snapshot_or_404(project_id)
return Response(
render_html5_symbols(snapshot, q),
media_type="text/html; charset=utf-8",
)
@app.get("/html5/projects/{project_id}/source/{lineage_id}")
async def html5_project_source(project_id: str, lineage_id: str) -> Response:
snapshot = _project_snapshot_or_404(project_id)
node = _find_snapshot_node(snapshot, lineage_id)
if node is None:
raise HTTPException(status_code=404, detail=f"Lineage not found: {lineage_id}")
return Response(
render_html5_source(node),
media_type="text/html; charset=utf-8",
)
@app.get("/version")
async def version() -> dict[str, str]:
return {"name": "sfera", "version": "0.1.0"}