Files
Aniworld/src/server/controllers/page_controller.py
Lukas 48a2fd0f2a feat: add loading page with real-time initialization progress
- Create loading.html template with WebSocket-based progress updates
- Update initialization_service to emit progress events via ProgressService
- Modify setup endpoint to run initialization in background and redirect to loading page
- Add /loading route in page_controller
- Show real-time progress for series sync, NFO scan, and media scan steps
- Display completion message with button to continue to app
- Handle errors with visual feedback
2026-01-23 14:54:56 +01:00

62 lines
1.5 KiB
Python

"""
Page controller for serving HTML templates.
This module provides endpoints for serving HTML pages using Jinja2 templates.
"""
from fastapi import APIRouter, Request
from fastapi.responses import HTMLResponse
from src.server.utils.template_helpers import render_template
router = APIRouter(tags=["pages"])
@router.get("/", response_class=HTMLResponse)
async def root(request: Request):
"""Serve the main application page."""
return render_template(
"index.html",
request,
title="Aniworld Download Manager"
)
@router.get("/setup", response_class=HTMLResponse)
async def setup_page(request: Request):
"""Serve the setup page."""
return render_template(
"setup.html",
request,
title="Setup - Aniworld"
)
@router.get("/login", response_class=HTMLResponse)
async def login_page(request: Request):
"""Serve the login page."""
return render_template(
"login.html",
request,
title="Login - Aniworld"
)
@router.get("/queue", response_class=HTMLResponse)
async def queue_page(request: Request):
"""Serve the download queue page."""
return render_template(
"queue.html",
request,
title="Download Queue - Aniworld"
)
@router.get("/loading", response_class=HTMLResponse)
async def loading_page(request: Request):
"""Serve the initialization loading page."""
return render_template(
"loading.html",
request,
title="Initializing - Aniworld"
)