30 lines
783 B
Python
30 lines
783 B
Python
from pathlib import Path
|
|
|
|
from src.views import dashboard as dashboard_html
|
|
|
|
|
|
FRONTEND = Path(__file__).resolve().parents[1] / "frontend"
|
|
|
|
|
|
def dashboard_bundle_text() -> str:
|
|
"""Return the HTML, CSS, and bootstrap sources that make up the dashboard."""
|
|
return "\n".join(
|
|
(
|
|
(FRONTEND / "index.html").read_text(),
|
|
(FRONTEND / "dashboard.css").read_text(),
|
|
(FRONTEND / "dashboard.js").read_text(),
|
|
)
|
|
)
|
|
|
|
|
|
async def dashboard() -> str:
|
|
# Exercise the real view lookup before adding its separately served assets.
|
|
html = await dashboard_html()
|
|
return "\n".join(
|
|
(
|
|
html,
|
|
(FRONTEND / "dashboard.css").read_text(),
|
|
(FRONTEND / "dashboard.js").read_text(),
|
|
)
|
|
)
|