Statistics - Per day and per stream statistics (src/periodstats.js, one generic stat_day table), backfilled once from the older tables; Stream / Week / Month / Year / All time views, Community and Streams tabs. - Viewer count every 5 minutes and title / category history per stream (EventSub channel.update): viewer graph, games played (donut), games in the streams list. - Twitch sync (src/twitchsync.js): followers with follow dates, current subs, mods, VIPs, all-time bits, channel emotes, past streams from VODs. Twitch analytics CSV import (src/twitchcsv.js). - Public stats page on its own host (Settings -> Stats and data): no message text, no bots, !hideme / !showme opt-out. Viewer page: roles, follow age, sub status, bits, a menu for rarely used actions. - StreamElements watch-time importer removed (already imported minutes stay as a baseline). Dashboard - Settings and Actions with a left sidebar; each settings page saves only its own fields. Connections (Twitch, StreamElements token now set here, HUDFX), OBS links (hidden behind an eye toggle) with a link builder, Chat (sound picked from the media library), TTS, Stats and data, Backup (export / import the whole setup), Advanced. Time zone setting for the stats pages. - Actions -> Alerts: alert style, pictures, sounds, bits tiers and card colours, stored in the database (src/theme.js); an old file-based theme is imported once. Alert preview page (/actions/alerts/preview, tools/preview/export.js for a static copy). - Old /actions page removed; Actions = Redeems / Alerts / TTS voices / Media. Alerts - New plain Card style for everyone (public/alerts/card.js); Polaroid, Cassette and the TTS letter stay as optional looks. Redeem variations can be Card, Cassette, Sound only or Video. Repo - No channel data in git: the channel's art, stickers and sounds stay on disk (gitignored) and are picked in the dashboard; examples for the server config (apache.example.sh, .env.example). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
2.9 KiB
Text
39 lines
2.9 KiB
Text
<style>
|
|
/* colours for the shared stats body (_statsbody.ejs), from Pico */
|
|
main { --muted:var(--pico-muted-color); --line:var(--pico-muted-border-color); --accent:var(--pico-primary-background);
|
|
--accent-hover:var(--pico-primary-hover-background); --card:transparent; --card-solid:var(--pico-card-background-color); }
|
|
.meta { color:var(--pico-muted-color); font-size:.85rem; }
|
|
.search { display:flex; gap:.5rem; max-width:420px; }
|
|
.search input, .search button { margin:0; }
|
|
.search button { width:auto; }
|
|
.warn { color:#e6b800; }
|
|
</style>
|
|
|
|
<div style="display:flex; align-items:center; gap:1rem; flex-wrap:wrap;">
|
|
<h2 style="margin:0;">Stats</h2>
|
|
<% if (live) { %><span class="badge badge-green">live · counting</span><% } %>
|
|
<form class="search" method="GET" action="/stats/viewer" style="margin-left:auto;">
|
|
<input type="search" name="q" placeholder="Look up a viewer…" required>
|
|
<button type="submit" class="outline">Find</button>
|
|
</form>
|
|
</div>
|
|
<p class="meta">
|
|
<span title="Bots (Settings → Hidden chatters) are counted but left out of everything shown here. Days are UTC. Watch time from before HeyStreamer counted comes from StreamElements (or Twitch's analytics export) and only shows under All time."><%= since ? `Counting since ${since}` : 'Nothing counted yet: stats start with the next stream.' %>
|
|
· <%= hiddenCount %> hidden bot<%= hiddenCount === 1 ? '' : 's' %> left out ⓘ</span>
|
|
· <% if (publicUrl) { %><a href="<%= publicUrl %>" target="_blank" rel="noopener" title="What viewers see: no message text, bots and !hideme viewers not named">Public page ↗</a><% } else { %><a href="/public" target="_blank" rel="noopener" title="Public page is off (Settings → Public stats page). This preview works while you are logged in.">Public page preview ↗</a><% } %>
|
|
</p>
|
|
|
|
<%
|
|
const syncBad = Object.entries(sync.parts || {}).filter(([, v]) => !String(v).startsWith('ok'));
|
|
const syncTip = sync.at ? `Last sync ${sync.at.slice(0, 16).replace('T', ' ')} UTC: ` + Object.entries(sync.parts).map(([k, v]) => `${k} ${v}`).join(', ') : 'Not synced yet';
|
|
%>
|
|
<p class="meta" style="margin-top:-.4rem;">
|
|
<span title="<%= syncTip %>">Twitch sync: <%= sync.at ? `${sync.at.slice(0, 16).replace('T', ' ')} UTC` : 'never' %><% if (syncBad.length) { %> · <span class="warn"><%= syncBad.map(([k]) => k).join(', ') %> failed</span><% } %> ⓘ</span>
|
|
· analytics: <%= csv.days ? `${csv.days} days imported` : 'none imported' %>
|
|
· <a href="/settings/stats">Sync, import and the public page: Settings → Stats and data</a>
|
|
</p>
|
|
|
|
<% if (msg) { %><p class="<%= /failed/i.test(msg) ? 'warn' : '' %>" style="font-weight:600;"><%= msg %></p><% } %>
|
|
|
|
<%- include('_statsbody', { s, q, base: '/stats', viewerHref: '/stats/viewer?q=', mode: 'admin', view, ranks, tz,
|
|
extraBoards: [{ title: 'Points · all time', rows: pointsBoard, level: x => x.level, wide: true }] }) %>
|