- Updated README.md to reflect new features and usage instructions. - Removed deprecated Dashboard.html component and integrated dashboard functionality directly into the main application. - Revised architecture documentation for clarity and added module map and request flow diagrams. - Enhanced maintenance model to include equipment association and cost tracking. - Updated requirements.txt to include new dependencies (httpx, pandas, numpy). - Improved consumption, maintenance, production, and reporting routes with better validation and response handling. - Added unit tests for maintenance and production routes, ensuring proper CRUD operations and validation. - Enhanced reporting service to calculate and return detailed summary statistics. - Redesigned Dashboard.html for improved user experience and integrated Chart.js for visualizing simulation results.
21 lines
699 B
Python
21 lines
699 B
Python
from fastapi import APIRouter, Request
|
|
from fastapi.responses import HTMLResponse
|
|
from fastapi.templating import Jinja2Templates
|
|
|
|
router = APIRouter()
|
|
|
|
# Set up Jinja2 templates directory
|
|
templates = Jinja2Templates(directory="templates")
|
|
|
|
|
|
@router.get("/ui/scenarios", response_class=HTMLResponse)
|
|
async def scenario_form(request: Request):
|
|
"""Render the scenario creation form."""
|
|
return templates.TemplateResponse("ScenarioForm.html", {"request": request})
|
|
|
|
|
|
@router.get("/ui/parameters", response_class=HTMLResponse)
|
|
async def parameter_form(request: Request):
|
|
"""Render the parameter input form."""
|
|
return templates.TemplateResponse("ParameterInput.html", {"request": request})
|