chore: brand icon and title by default
This commit is contained in:
1 parent
8e61dc111c
commit
b4fcbd38ba
17 files changed
+1254
-213
No files matched your search
@@ -3,6 +3,7 @@ import { RefreshCw, Maximize2, Minimize2, Users, Signal, TriangleAlert, Cpu, Mem
|
||||
import { toast } from 'sonner'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
import {
|
||||
Select,
|
||||
@@ -65,9 +66,13 @@ export default function LiveBoard() {
|
||||
const programs = await fetchStreams(true)
|
||||
setStreams(programs)
|
||||
const nextId = streamId || programs.find((p) => p.status === 'live')?.id
|
||||
const nextProgram = programs.find((p) => p.id === nextId)
|
||||
if (nextId) {
|
||||
setStreamId(nextId)
|
||||
setSessions(await fetchViewerSessions(nextId))
|
||||
// Viewer sessions audit live playback. A replay produces none — and rows
|
||||
// left over from when the programme was live would describe a broadcast
|
||||
// that is over — so nothing is fetched for a non-live programme.
|
||||
setSessions(nextProgram?.status === 'live' ? await fetchViewerSessions(nextId) : [])
|
||||
} else {
|
||||
setSessions([])
|
||||
}
|
||||
@@ -105,10 +110,13 @@ export default function LiveBoard() {
|
||||
if (nodeId === 'auto' && quality === 'auto') await sendRemoteCommand(streamId, session.token, 'restore_auto', targets)
|
||||
toast.success(`已向 ${selected.size} 个观众下发节点与清晰度策略`)
|
||||
} catch {
|
||||
toast.error('控制命令下发失败,请确认节目已启用审计式播放控制')
|
||||
toast.error('控制命令下发失败,请确认节目正在直播并已启用审计式播放控制')
|
||||
}
|
||||
}
|
||||
|
||||
const selectedProgram = streams.find((p) => p.id === streamId)
|
||||
const isLiveProgram = selectedProgram?.status === 'live'
|
||||
|
||||
const activeSessions = sessions.filter((s) => Date.now() - new Date(s.last_heartbeat).getTime() < 30000)
|
||||
const buffering = activeSessions.filter(
|
||||
(s) => s.playback_state === 'buffering' || Number(s.buffered_seconds || 0) < 1,
|
||||
@@ -187,7 +195,16 @@ export default function LiveBoard() {
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{streamId && (
|
||||
{streamId && !isLiveProgram && (
|
||||
<Alert>
|
||||
<AlertTitle>观众会话审计仅适用于直播</AlertTitle>
|
||||
<AlertDescription>
|
||||
当前选中的节目不是直播状态。回放是直接下发的录制文件,没有线路、清晰度或播放控制可审计,因此不产生观众会话。
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
{streamId && isLiveProgram && (
|
||||
<Card>
|
||||
<CardHeader className="flex-row items-center justify-between space-y-0">
|
||||
<CardTitle className="text-base">审计式观众会话</CardTitle>
|
||||
|
||||
Reference in new issue
Block a user