{# Live region of the Pusoy Dos monitor. Rendered inside monitor.html.twig on first load AND standalone by WfboController::pusoyMonitorData(), re-fetched by the pd-monitor Stimulus controller every 3s (innerHTML swap of this output only). #} {% macro card(c) %}{{ pusoy_card(c) }}{% endmacro %} {% macro money(v) %}₱{{ v|number_format(2) }}{% endmacro %} {% macro ago(s) %}{{ s is null ? '—' : (s < 60 ? s ~ 's' : (s < 3600 ? (s // 60) ~ 'm' : (s // 3600) ~ 'h')) }}{% endmacro %} {% macro awayReason(r) %}{{ {offline: 'offline', timeouts: '3 timeouts', left: 'left'}[r] ?? r }}{% endmacro %} {% import _self as m %} {% set k = kpis %}
{% set cards = [ {key: 'entries', label: 'Entries Today', value: m.money(k.entries), sub: k.entryCount ~ ' paid seats · ' ~ k.paidHands ~ ' hands'}, {key: 'payouts', label: 'Payouts', value: m.money(k.payouts), sub: 'pots paid to winners'}, {key: 'fee', label: 'House Fee', value: m.money(k.houseFee), sub: 'entries − payouts'}, {key: 'comm', label: 'Commission', value: m.money(k.commissions), sub: 'agents\' share'}, {key: 'revenue', label: 'Net Revenue', value: m.money(k.revenue), sub: 'incl. test: ' ~ m.money(k.revenueAll), amount: k.revenue}, {key: 'hands', label: 'Hands Dealt', value: k.handsDealt, sub: 'today, free tables incl.'}, {key: 'online', label: 'Players Online', value: counts.online, sub: counts.players ~ ' in the game'}, {key: 'tables', label: 'Open Tables', value: counts.tables, sub: counts.playingTables ~ ' playing · ' ~ counts.privateTables ~ ' private'}, {key: 'tiers', label: 'Tables by Tier', value: counts.tablesByTier.bronze ~ ' / ' ~ counts.tablesByTier.silver ~ ' / ' ~ counts.tablesByTier.gold, sub: 'bronze / silver / gold · free ' ~ counts.tablesByTier.free}, {key: 'queue', label: 'In Queue', value: counts.queued, sub: 'waiting for a seat'}, ] %} {% for c in cards %}
{{ c.label }}
{{ c.value }}
{{ c.key == 'entries' ? 'incl. test: ' ~ m.money(k.entriesAll) ~ ' · ' : '' }}{{ c.sub }}
{% endfor %}
{% for a in alerts %} {{ a.text }} {% endfor %}
{% set playingTables = tables|filter(t => t.status == 'playing') %}
Playing tables ({{ playingTables|length }}){{ tables|length }} open
{% for t in tables %} {% if loop.index0 == playingTables|length and playingTables|length < tables|length %}
Other open tables
{% endif %}
#{{ t.id }} {{ t.tier }} {% if t.private %}Private · {{ t.code }}{% endif %} {{ t.status }} {{ t.prize is not null ? 'Pot ' ~ m.money(t.prize) : 'Free' }} {% if t.canClose %}{% endif %}
{% for s in t.seats %} {{ s.empty ? 'open' : s.name }}{% if s.cardCount is not null %} {{ s.cardCount }}{% endif %}{% if s.turn and t.secondsLeft is not null %} · {{ t.secondsLeft }}s{% endif %}{% if s.away %} · away{{ s.awayReason ? ' (' ~ m.awayReason(s.awayReason) ~ ')' }}{% endif %}{% if s.placement == 1 %} · won{% endif %} {% endfor %} {% if t.stalledFor is not null %}stalled {{ t.stalledFor }}s{% endif %}
{% else %}
No open tables right now · {{ now|date('H:i') }}
{% endfor %}
{% if focus %} {% set t = focus.table %}
Table #{{ t.id }} · {{ t.tier }}{{ t.private ? ' · private ' ~ t.code ~ ' · host ' ~ (t.hostName ?? '—') }} · {{ t.seatCount }} seats · {{ t.handCount }} hand{{ t.handCount == 1 ? '' : 's' }} {% if t.handId %}Hand #{{ t.handId }} ↗{% endif %} {% if t.canClose %}{% endif %} ✕ Close
{% if t.prize is not null %}
Pot {{ m.money(t.prize) }}
{% else %}
Free table
{% endif %} {% if t.status == 'playing' %} {% if t.lead %}
{% for c in t.lead.cards %}{{ m.card(c) }}{% endfor %}
{{ t.seats[t.lead.seat].name ?? '' }} · {{ (t.lead.type ?? '')|replace({'_': ' '}) }}
{% else %}
{{ t.openingPlay ? 'Opening play (' ~ pusoy_card(t.openingCard) ~ ')' : 'New lead' }}
{% endif %}
Hand #{{ t.handId }} · {{ m.ago(t.dealtAgo) }} in{{ t.deadCount ? ' · ' ~ t.deadCount ~ ' face down' }}
{% elseif t.status == 'results' %} {% if t.deadCards is not empty %}
Face down: {% for c in t.deadCards %}{{ m.card(c) }}{% endfor %}
{% endif %}
Hand #{{ t.handId }} over{% if t.nextHandIn is not null %} · next in {{ t.nextHandIn }}s{% elseif t.private %} · host deals{% endif %}
{% else %}
Waiting · {{ t.playersHere }}/{{ t.seatCount }} here
{% if t.nextHandIn is not null %}
Dealing in {{ t.nextHandIn }}s
{% endif %} {% endif %} {% if t.stalledFor is not null %}
Stalled {{ t.stalledFor }}s
{% endif %}
{% for s in t.seats %}
{% if s.cardCount is not null and s.cards is empty %}
{% for i in 1..min(s.cardCount, 13) %}{% if s.cardCount > 0 %}{% endif %}{% endfor %} {{ s.cardCount }}
{% endif %} {% if s.cards is not empty %}
{% for c in s.cards %}{{ m.card(c) }}{% endfor %}
{% endif %}
{% if s.userId %}{{ s.name }}{% else %}{{ s.empty ? 'Open seat' : s.name }}{% endif %}
{% if s.ip %}
{{ s.ip }}
{% endif %}
{% if s.turn %}Turn{{ t.secondsLeft is not null ? ' ' ~ t.secondsLeft ~ 's' }}{% endif %} {% if s.placement == 1 %}Won{{ s.payout ? ' ' ~ m.money(s.payout) }}{% elseif s.placement %}#{{ s.placement }}{% endif %} {% if s.away %}Away{{ s.awayReason ? ' · ' ~ m.awayReason(s.awayReason) }}{% elseif s.offline %}Offline {{ m.ago(s.lastSeen) }}{% endif %} {% if s.waiting %}Waiting{% endif %} {% if s.leaving %}Leaving{% endif %} {% if s.short %}Low balance{% endif %}
{% endfor %}
Plays (newest first)
{% for mv in focus.moves %}
{{ mv.at|date('H:i:s') }} {{ mv.name }} {% for c in mv.cards %}{{ m.card(c) }} {% else %}pass{% endfor %} {% if mv.type %}{{ mv.type|replace({'_': ' '}) }}{% endif %} {% if mv.actor != 'human' %}({{ {bot: 'bot', standin: 'stand-in', timeout: 'timeout'}[mv.actor] ?? mv.actor }}){% endif %}
{% else %}
No plays in this hand yet.
{% endfor %}
Table chat
{% for c in focus.chat %}
{{ c.at|date('H:i') }} {{ c.name }} {{ c.text }} {% if c.flagged %}Flagged{% endif %}
{% else %}
No chat at this table.
{% endfor %}
{% else %}
{{ focusMissing ? 'That table has closed.' : 'Pick a table to watch the game' }}
Click any table in the list on the left.
{% endif %}
Live chat · all tables + lobby{{ chatEnabled ? '' : 'Chat is switched off' }}
{% for c in chat %}
{{ c.at|date('H:i') }} {% if c.tableId %} #{{ c.tableId }} {{ c.code ?? c.tier }} {% else %} Lobby {% endif %} {{ c.name }} {{ c.text }} {% if c.flagged %}Flagged{% endif %}
{% else %}
No chat yet.
{% endfor %}
{% set offlineLong = players|filter(p => not p.online and not p.leaving and p.lastSeen >= kickOfflineMinutes * 60)|length %}
Players in the game ({{ players|length }})
{% for p in players %} {% else %} {% endfor %}
PlayerStateTableWalletSeenJoinedIP
{{ p.name }}{% if p.test %} test{% endif %} {{ p.state }}{{ p.awayReason ? ' (' ~ m.awayReason(p.awayReason) ~ ')' }}{{ p.leaving ? ' · leaving' }} {% if p.tableId %}#{{ p.tableId }} {% endif %}{{ p.tier }}{{ p.seat is not null ? ' · seat ' ~ (p.seat + 1) }} {{ m.money(p.wallet) }} {{ m.ago(p.lastSeen) }} {{ p.joinedAt|date('H:i') }} {{ p.ip ?? '—' }} {% if p.moveTargets is not empty %}{% endif %}
Nobody is playing right now.
Last settled hands
{% for h in recentHands %} {% else %} {% endfor %}
HandTableWinnerEntriesPaidAt
#{{ h.id }} #{{ h.tableId }} {{ h.tier }}{{ h.private ? ' · private' }} {{ h.winner ?? '—' }} {{ m.money(h.entries) }} {{ m.money(h.paid) }} {{ h.settledAt ? h.settledAt|date('H:i:s') : '—' }}
No hands yet.
Updated {{ now|date('H:i:s') }} · refreshes every 3s