Skip to content

fix: Add missing DataFrame web page routes and fix template syntax errors #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025
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
15 changes: 15 additions & 0 deletions server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from starlette.requests import Request
from starlette.responses import HTMLResponse
from starlette.templating import Jinja2Templates
from starlette.staticfiles import StaticFiles
from server.api import api_routes

import uvicorn
Expand Down Expand Up @@ -379,6 +380,17 @@ async def visualizations_page(request: Request):
"task_visualization.html", {"request": request, "current_page": "visualizations"}
)

async def dataframes_page(request: Request):
return templates.TemplateResponse(
"dataframes.html", {"request": request, "current_page": "dataframes"}
)

async def dataframe_detail_page(request: Request):
df_id = request.path_params["df_id"]
return templates.TemplateResponse(
"dataframe_detail.html", {"request": request, "current_page": "dataframes", "df_id": df_id}
)


# --- Add routes ---
routes = [
Expand All @@ -388,9 +400,12 @@ async def visualizations_page(request: Request):
Route("/tools", endpoint=tools_page, methods=["GET"]),
Route("/tool-history", endpoint=tool_history_page, methods=["GET"]),
Route("/visualizations", endpoint=visualizations_page, methods=["GET"]),
Route("/dataframes", endpoint=dataframes_page, methods=["GET"]),
Route("/dataframes/{df_id}", endpoint=dataframe_detail_page, methods=["GET"]),
Route("/config", endpoint=config_page, methods=["GET"]),
Route("/sse", endpoint=handle_sse),
Mount("/messages/", app=sse.handle_post_message),
Mount("/static", StaticFiles(directory=str(Path(__file__).parent / "static")), name="static"),
] + api_routes

# Create Starlette app
Expand Down
Loading