26 lines
629 B
Python
26 lines
629 B
Python
from nicegui import APIRouter, app, ui
|
|
|
|
from auth.logout import logout
|
|
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.page("/")
|
|
def main():
|
|
with ui.column().classes("absolute-center items-center"):
|
|
username = app.storage.user.get("username", "unknown user")
|
|
ui.label(f"Hello {username}!").classes("text-2xl")
|
|
ui.button("log out", icon="logout", on_click=logout)
|
|
|
|
pgroups = app.storage.user.get("pgroups", set())
|
|
ui.select(
|
|
label="pgroup",
|
|
options=sorted(pgroups),
|
|
with_input=True,
|
|
on_change=lambda e: ui.navigate.to(f"/tables/{e.value}")
|
|
)
|
|
|
|
|
|
|