This commit is contained in:
2026-04-11 01:54:08 +02:00
parent c34c768dcb
commit 35df0e8263

View File

@@ -1,17 +1,23 @@
from nicegui import ui from nicegui import ui
from bot_instance import bot from bot_instance import bot
# reminder:
# tracked_games etc erst in andere variable kopieren und lock benutzen.
def create_ui(): def create_ui():
ui.label("Amogus") pages = ui.sub_pages()
with bot.tracked_games_lock:
games = list(bot.tracked_games)
rows = [] rows = []
for game in games: for game in bot.tracked_games:
rows.append({"Name": game.name}) pages.add(f"/{game.name}", lambda name=game.name: sub_page(name))
rows.append({"Name": game.name, "Turn": game.turn})
ui.table(rows=rows) pages.add("/", lambda: main_page(rows))
ui.run(reload=False)
def main_page(rows):
ui.label("test")
ui.table(rows=rows, title="Currently Running Games")
def sub_page(name: str):
ui.label(name)