copbird-website/app.py

44 lines
1 KiB
Python
Raw Normal View History

2023-06-17 16:44:51 +00:00
from pathlib import Path
from typing import List
from shiny import App, ui, Inputs, Outputs, Session
from shiny.types import NavSetArg
2023-06-17 14:42:37 +00:00
from src import mod_welcome
2023-06-17 14:00:36 +00:00
2023-06-17 16:44:51 +00:00
def nav_controls() -> List[NavSetArg]:
return [
ui.nav(ui.h5("Intro"), mod_welcome.welcome_ui("Intro"), value="intro"),
ui.nav(ui.h5("Datensatz Analyse"), "Datensatz Analyse"),
ui.nav_control(
ui.a(
ui.h5("AG-Link"),
href="https://ag-link.xyz",
target="_blank",
),
),
]
app_ui = ui.page_navbar(
*nav_controls(),
selected="intro",
fluid=False,
title=ui.div(ui.img(src="favicon.ico", width="75dpi", height="75dpi"),
ui.h3("Copbird")),
lang="de",
window_title="Copbird",
collapsible=True,
bg="#ba289f",
inverse=True,
id="Intro",
2023-06-17 14:00:36 +00:00
)
2023-06-17 16:44:51 +00:00
def server(input: Inputs, output: Outputs, session: Session):
2023-06-17 18:01:23 +00:00
mod_welcome.welcome_server("Intro")
2023-06-17 16:44:51 +00:00
2023-06-17 14:00:36 +00:00
2023-06-17 16:44:51 +00:00
static_dir = Path(__file__).parent / "www"
2023-06-17 14:00:36 +00:00
2023-06-17 16:44:51 +00:00
app = App(app_ui, server, static_assets=static_dir)