Add streamer dashboard stats; fix TTS overlap race properly
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 30s

Dashboard now shows unique visitors (via sender link), total messages,
and unique senders per streamer, tracked via new viewer_visits/messages
tables.

The previous overlay TTS-overlap fix had a race: audio not having
arrived yet was treated the same as "no audio at all", letting the
queue advance before slow-to-synthesize audio (e.g. a long question)
ever started playing. Now "not arrived yet" is explicitly distinct
from "finished playing", with a grace-period fallback for genuine TTS
failures.

Also drop the hardcoded AI name from ai-prompt.txt since it's now
injected dynamically from the streamer's configured ai_name.
This commit is contained in:
vrubelroman 2026-07-08 18:04:02 +00:00
parent ec6d8c4cfe
commit b669c2d0b7
5 changed files with 114 additions and 9 deletions

View file

@ -74,12 +74,45 @@
margin-top: 8px;
min-height: 16px;
}
.stats-row {
display: flex;
gap: 24px;
}
.stat {
flex: 1;
}
.stat .value {
font-size: 24px;
font-weight: 600;
}
.stat .label {
font-size: 13px;
color: #666;
}
</style>
</head>
<body>
<h1>Ваши ссылки</h1>
<div class="card">
<h2>Статистика</h2>
<div class="stats-row">
<div class="stat">
<div class="value" id="stat-visitors"></div>
<div class="label">заходили по ссылке</div>
</div>
<div class="stat">
<div class="value" id="stat-messages"></div>
<div class="label">сообщений отправлено</div>
</div>
<div class="stat">
<div class="value" id="stat-unique-senders"></div>
<div class="label">уникальных отправителей</div>
</div>
</div>
</div>
<div class="card">
<h2>Ссылка для OBS / StreamLabs</h2>
<p>Вставьте в свойства Browser Source (URL).</p>
@ -141,6 +174,9 @@
document.getElementById('sender-url').value = data.senderUrl;
document.getElementById('display-duration').value = data.displayDurationSeconds;
document.getElementById('ai-name').value = data.aiName;
document.getElementById('stat-visitors').textContent = data.stats.visitors;
document.getElementById('stat-messages').textContent = data.stats.messages;
document.getElementById('stat-unique-senders').textContent = data.stats.uniqueSenders;
}
document.getElementById('save-settings').addEventListener('click', async () => {