Some checks failed
Run Tests / test (push) Failing after 1m51s
- Introduced a new table `application_setting` to store configurable application options. - Implemented functions to manage CSS color settings, including loading, updating, and reading environment overrides. - Added a new settings view to render and manage theme colors. - Updated UI to include a settings page with theme color management and environment overrides display. - Enhanced CSS styles for the settings page and sidebar navigation. - Created unit and end-to-end tests for the new settings functionality and CSS management.
49 lines
1.8 KiB
Python
49 lines
1.8 KiB
Python
from routes.distributions import router as distributions_router
|
|
from routes.ui import router as ui_router
|
|
from routes.parameters import router as parameters_router
|
|
from typing import Awaitable, Callable
|
|
|
|
from fastapi import FastAPI, Request, Response
|
|
from fastapi.staticfiles import StaticFiles
|
|
from middleware.validation import validate_json
|
|
from config.database import Base, engine
|
|
from routes.scenarios import router as scenarios_router
|
|
from routes.costs import router as costs_router
|
|
from routes.consumption import router as consumption_router
|
|
from routes.production import router as production_router
|
|
from routes.equipment import router as equipment_router
|
|
from routes.reporting import router as reporting_router
|
|
from routes.currencies import router as currencies_router
|
|
from routes.simulations import router as simulations_router
|
|
from routes.maintenance import router as maintenance_router
|
|
from routes.settings import router as settings_router
|
|
|
|
# Initialize database schema
|
|
Base.metadata.create_all(bind=engine)
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.middleware("http")
|
|
async def json_validation(
|
|
request: Request, call_next: Callable[[Request], Awaitable[Response]]
|
|
) -> Response:
|
|
return await validate_json(request, call_next)
|
|
|
|
app.mount("/static", StaticFiles(directory="static"), name="static")
|
|
|
|
# Include API routers
|
|
app.include_router(scenarios_router)
|
|
app.include_router(parameters_router)
|
|
app.include_router(distributions_router)
|
|
app.include_router(costs_router)
|
|
app.include_router(consumption_router)
|
|
app.include_router(simulations_router)
|
|
app.include_router(production_router)
|
|
app.include_router(equipment_router)
|
|
app.include_router(maintenance_router)
|
|
app.include_router(reporting_router)
|
|
app.include_router(currencies_router)
|
|
app.include_router(settings_router)
|
|
app.include_router(ui_router)
|