Testing sub pages.
This commit is contained in:
10
webui.py
10
webui.py
@@ -1,5 +1,6 @@
|
||||
from nicegui import ui
|
||||
from bot_instance import bot
|
||||
from dom5game import Dom5game
|
||||
|
||||
|
||||
def create_ui():
|
||||
@@ -19,5 +20,10 @@ def main_page(rows):
|
||||
ui.table(rows=rows, title="Currently Running Games")
|
||||
|
||||
|
||||
def sub_page(name: str):
|
||||
ui.label(name)
|
||||
def sub_page(game_name: str):
|
||||
rows = []
|
||||
game = Dom5game.get_game_by_name(game_name, bot.tracked_games)
|
||||
for player in game.players.keys():
|
||||
if game.players[player] not in {"AI", "Eliminated"}:
|
||||
rows.append({"Player": player, "Status": game.players[player]})
|
||||
ui.table(rows=rows, title=game_name)
|
||||
|
||||
Reference in New Issue
Block a user