Link HTML5 review findings to source
This commit is contained in:
@@ -1713,6 +1713,25 @@ async def html5_project_symbol_detail(project_id: str, lineage_id: str) -> Respo
|
||||
)
|
||||
|
||||
|
||||
@app.get("/html5/projects/{project_id}/source/by-path")
|
||||
async def html5_project_source_by_path(project_id: str, path: str) -> Response:
|
||||
snapshot = _project_snapshot_or_404(project_id)
|
||||
node = next(
|
||||
(
|
||||
item
|
||||
for item in snapshot.nodes
|
||||
if item.source_ref is not None and item.source_ref.source_path == path
|
||||
),
|
||||
None,
|
||||
)
|
||||
if node is None:
|
||||
raise HTTPException(status_code=404, detail=f"Source not found: {path}")
|
||||
return Response(
|
||||
render_html5_source(node),
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user