Add a maintenance pause/resume switch and a proper user navbar
RoundConfig gets a paused flag toggled via new POST /admin/pause and /admin/resume endpoints (audit-logged, surfaced as a "Manutenzione" card in the admin Parametri view). Pausing only stops the *next* round from opening once the current one closes — rounds/service.py:open_new_round_if_needed still lets an in-progress round finish, draw, and pay out its winner normally. GET /rounds/current exposes lottery_paused so the user page shows a maintenance banner (even while logged out) instead of silently going idle. Also replaces the user dashboard's stacked account-bar card + bento-grid menu with a single sticky navbar (identity row + Deposito/Bet/Prelievo tabs), and moves the page content into a dedicated .app-shell container so the navbar itself can span full width.
This commit is contained in:
@@ -25,6 +25,7 @@ class CurrentRoundResponse(BaseModel):
|
||||
winner_user_id: int | None = None
|
||||
winner_amount_sats: int | None = None
|
||||
chain_tip_height: int | None = None
|
||||
lottery_paused: bool = False
|
||||
|
||||
|
||||
@router.get("/current", response_model=CurrentRoundResponse)
|
||||
@@ -39,6 +40,7 @@ async def current_round(request: Request, session: AsyncSession = Depends(get_se
|
||||
bet_amount_sats=config.bet_amount_sats,
|
||||
draw_animation_seconds=config.draw_animation_seconds,
|
||||
chain_tip_height=chain_tip_height,
|
||||
lottery_paused=config.paused,
|
||||
)
|
||||
|
||||
participant_count = await session.scalar(
|
||||
@@ -60,4 +62,5 @@ async def current_round(request: Request, session: AsyncSession = Depends(get_se
|
||||
winner_user_id=round_.winner_user_id,
|
||||
winner_amount_sats=round_.winner_amount_sats,
|
||||
chain_tip_height=chain_tip_height,
|
||||
lottery_paused=config.paused,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user