|
@@ -6,7 +6,6 @@ from pathlib import Path
|
|
|
from typing import Awaitable, Callable, Optional
|
|
|
from urllib.parse import parse_qs
|
|
|
|
|
|
-import icecream
|
|
|
from fastapi import Request
|
|
|
from fastapi.responses import FileResponse, RedirectResponse, Response
|
|
|
from starlette.middleware.base import BaseHTTPMiddleware
|
|
@@ -24,7 +23,6 @@ from website.search import Search
|
|
|
from website.star import add_star
|
|
|
from website.style import example_link, features, heading, link_target, section_heading, side_menu, subtitle, title
|
|
|
|
|
|
-icecream.install()
|
|
|
prometheus.start_monitor(app)
|
|
|
|
|
|
# session middleware is required for demo in documentation and prometheus
|
|
@@ -34,11 +32,12 @@ app.add_static_files('/favicon', str(Path(__file__).parent / 'website' / 'favico
|
|
|
app.add_static_files('/fonts', str(Path(__file__).parent / 'website' / 'fonts'))
|
|
|
app.add_static_files('/static', str(Path(__file__).parent / 'website' / 'static'))
|
|
|
|
|
|
-# HACK: prevent the page from scrolling when closing a dialog (#1404)
|
|
|
-def on_dialog_value_change(sender, value, on_value_change=ui.dialog.on_value_change) -> None:
|
|
|
- ui.query('html').classes(**{'add' if value else 'remove': 'has-dialog'})
|
|
|
- on_value_change(sender, value)
|
|
|
-ui.dialog.on_value_change = on_dialog_value_change
|
|
|
+if True: # HACK: prevent the page from scrolling when closing a dialog (#1404)
|
|
|
+ def on_dialog_value_change(sender, value, on_value_change=ui.dialog.on_value_change) -> None:
|
|
|
+ ui.query('html').classes(**{'add' if value else 'remove': 'has-dialog'})
|
|
|
+ on_value_change(sender, value)
|
|
|
+ ui.dialog.on_value_change = on_dialog_value_change
|
|
|
+
|
|
|
|
|
|
@app.get('/logo.png')
|
|
|
def logo() -> FileResponse:
|