0

tweaks to offline state in admin viewers page (#17)

If stream is offline, hide current viewers statistic and viewers table.
Also, change wording for describing max viewers.
This commit is contained in:
nebunez 2021-02-06 17:52:54 -05:00 committed by GitHub
parent d46d954a29
commit fa9f27edca

View File

@ -96,24 +96,26 @@ export default function ViewersOverTime() {
return ( return (
<div> <div>
<Row gutter={[16, 16]} justify="space-around"> <Row gutter={[16, 16]} justify="space-around">
{online && (
<StatisticItem
title="Current viewers"
value={viewerCount.toString()}
prefix={<UserOutlined />}
/>
)}
<StatisticItem <StatisticItem
title="Current viewers" title={online ? 'Max viewers this session' : 'Max viewers last session'}
value={viewerCount.toString()}
prefix={<UserOutlined />}
/>
<StatisticItem
title="Peak viewers this session"
value={sessionPeakViewerCount.toString()} value={sessionPeakViewerCount.toString()}
prefix={<UserOutlined />} prefix={<UserOutlined />}
/> />
<StatisticItem <StatisticItem
title="Peak viewers overall" title="All-time max viewers"
value={overallPeakViewerCount.toString()} value={overallPeakViewerCount.toString()}
prefix={<UserOutlined />} prefix={<UserOutlined />}
/> />
</Row> </Row>
<Chart title="Viewers" data={viewerInfo} color="#2087E2" unit="" /> <Chart title="Viewers" data={viewerInfo} color="#2087E2" unit="" />
<Table dataSource={clients} columns={columns} rowKey={row => row.clientID} /> {online && <Table dataSource={clients} columns={columns} rowKey={row => row.clientID} />}
</div> </div>
); );
} }