Skip to content

Commit 9b9ce54

Browse files
committed
feat: UI cleanup on dashboard
1 parent b3b9cfb commit 9b9ce54

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
lines changed

src/app/dashboard/streams/page.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ import Link from 'next/link';
1313

1414
export default async function StreamsPage() {
1515
const streams = await prisma.stream.findMany({
16+
select: {
17+
fixtureId: true,
18+
name: true,
19+
state: true,
20+
ingestPoint: {
21+
select: {
22+
id: true,
23+
name: true,
24+
},
25+
},
26+
},
1627
orderBy: {
1728
fixtureId: 'asc',
1829
},
@@ -21,14 +32,18 @@ export default async function StreamsPage() {
2132
const rows = streams.map((stream) => (
2233
<TableTr key={stream.fixtureId}>
2334
<TableTd>
24-
<StreamStatusIndicator stream={stream} />
35+
<StreamStatusIndicator
36+
state={stream.state}
37+
ingestPointId={stream?.ingestPoint?.id}
38+
/>
2539
</TableTd>
2640
<TableTd>
2741
<Link href={`/dashboard/streams/${stream.fixtureId}`}>
2842
{stream.name}
2943
</Link>
3044
</TableTd>
3145
<TableTd>{stream.fixtureId}</TableTd>
46+
<TableTd>{stream.ingestPoint?.name ?? '<unset>'}</TableTd>
3247
</TableTr>
3348
));
3449

@@ -43,6 +58,7 @@ export default async function StreamsPage() {
4358
<TableTh>Status</TableTh>
4459
<TableTh>Name</TableTh>
4560
<TableTh>Fixture ID</TableTh>
61+
<TableTh>Ingest</TableTh>
4662
</TableTr>
4763
</TableThead>
4864
<TableTbody>{rows}</TableTbody>

src/components/DashboardShell.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default function DashboardShell({
2525
return (
2626
<AppShell
2727
header={{ height: 60 }}
28+
footer={{ height: 40 }}
2829
navbar={{
2930
width: 300,
3031
breakpoint: 'sm',

src/components/StreamPlayer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function StreamPlayerInner({ streamId, isLive, logPlayerErrors }: Props) {
132132
'StreamPlayerInner initialised when HLS is not supported. This should not happen!'
133133
);
134134
}
135-
}, [streamUrl]);
135+
}, [streamUrl, logPlayerErrors]);
136136

137137
const togglePause = useCallback(() => {
138138
if (!audio.current) return;

src/components/StreamStatusIndicator.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
import { Stream } from '@prisma/client';
1+
import { StreamState } from '@prisma/client';
22
import { IconAlertTriangle, IconHeadphones } from '@tabler/icons-react';
33

44
import unavailable from '@/components/StreamStatusIndicator/unavailable.svg';
55
import live from '@/components/StreamStatusIndicator/live.svg';
66
import Image from 'next/image';
77

8-
export function StreamStatusIndicator({ stream }: { stream: Stream }) {
9-
switch (stream.state) {
8+
export function StreamStatusIndicator({
9+
state,
10+
ingestPointId,
11+
}: {
12+
state: StreamState;
13+
ingestPointId?: string;
14+
}) {
15+
switch (state) {
1016
case 'Pending':
11-
return stream.ingestPointId ? (
17+
return ingestPointId ? (
1218
<Image alt="Pending" src={unavailable} />
1319
) : (
1420
<IconAlertTriangle title="Ingest not configured" color="orange" />

0 commit comments

Comments
 (0)