- Added a new API router for managing vendors with endpoints for listing, creating, updating, retrieving, and deleting vendors. - Implemented frontend views for displaying vendor lists and details using Jinja2 templates. - Created HTML templates for vendor list and detail pages with responsive design and dynamic content loading. - Added JavaScript functionality for vendor management, including pagination, filtering, and modal forms for creating new vendors. - Introduced a settings table in the database for system configuration and extended the users table with additional fields. - Developed a script to import vendors from an OmniSync database into the PostgreSQL database, handling errors and logging progress.
14 lines
430 B
Python
14 lines
430 B
Python
from fastapi import APIRouter, Request
|
|
from fastapi.templating import Jinja2Templates
|
|
from fastapi.responses import HTMLResponse
|
|
|
|
router = APIRouter()
|
|
templates = Jinja2Templates(directory="app")
|
|
|
|
@router.get("/dashboard", response_class=HTMLResponse)
|
|
async def dashboard(request: Request):
|
|
"""
|
|
Render the dashboard page
|
|
"""
|
|
return templates.TemplateResponse("dashboard/frontend/index.html", {"request": request})
|