Added resolution to the status column, restructured into two lines: status + LAN/WAN on top, resolution + bitrate underneath

This commit is contained in:
Bergasha committed 2026-08-19 13:33:08 +10:00
1 parent acc97da84b
commit c6f77cec2e
1 file changed
+24 -16
+24 -16
View File
@@ -288,7 +288,7 @@ export default function MediaServerWidget({
sortable={isAdvanced} sortable={isAdvanced}
sort={sort} sort={sort}
onSort={toggleSort} onSort={toggleSort}
width={140} width={170}
/> />
)} )}
</Table.Tr> </Table.Tr>
@@ -300,6 +300,8 @@ export default function MediaServerWidget({
const status = getPlaybackStatus(currentlyPlaying?.metadata?.transcoding); const status = getPlaybackStatus(currentlyPlaying?.metadata?.transcoding);
const location = showLocation ? currentlyPlaying?.location : null; const location = showLocation ? currentlyPlaying?.location : null;
const bitrateLabel = showBitrate ? formatBitrate(currentlyPlaying?.metadata?.bitrateKbps) : null; const bitrateLabel = showBitrate ? formatBitrate(currentlyPlaying?.metadata?.bitrateKbps) : null;
const resolution = currentlyPlaying?.metadata?.video.resolution;
const resolutionLabel = resolution ? `${resolution.width}x${resolution.height}` : null;
const toggleDetails = () => setSelectedRowId((current) => (current === rowId ? null : rowId)); const toggleDetails = () => setSelectedRowId((current) => (current === rowId ? null : rowId));
return ( return (
@@ -350,24 +352,30 @@ export default function MediaServerWidget({
<Table.Td> <Table.Td>
{currentlyPlaying && ( {currentlyPlaying && (
<Stack gap={4} align="flex-start" w="100%" className={classes.cellContent}> <Stack gap={4} align="flex-start" w="100%" className={classes.cellContent}>
<Badge size="xs" variant="light" color={playbackStatusColorMap[status]}> <Group gap={4} align="center" justify="space-between" wrap="nowrap" w="100%">
{t(`items.${status}` as never)} <Badge size="xs" variant="light" color={playbackStatusColorMap[status]}>
</Badge> {t(`items.${status}` as never)}
{(location ?? bitrateLabel) && ( </Badge>
<Group gap={4} align="center" justify="space-between" wrap="nowrap" w="100%"> {location && (
<Group gap={4} align="center" wrap="nowrap"> <Group gap={4} align="center" wrap="nowrap">
{location && {location === "lan" ? (
(location === "lan" ? ( <IconWifi size="var(--mantine-font-size-xs)" />
<IconWifi size="var(--mantine-font-size-xs)" /> ) : (
) : ( <IconWorld size="var(--mantine-font-size-xs)" />
<IconWorld size="var(--mantine-font-size-xs)" />
))}
{location && (
<Text size="xs" c="dimmed" tt="uppercase">
{location}
</Text>
)} )}
<Text size="xs" c="dimmed" tt="uppercase">
{location}
</Text>
</Group> </Group>
)}
</Group>
{(resolutionLabel ?? bitrateLabel) && (
<Group gap={4} align="center" justify="space-between" wrap="nowrap" w="100%">
{resolutionLabel && (
<Text size="xs" c="dimmed" style={{ whiteSpace: "nowrap" }}>
{resolutionLabel}
</Text>
)}
{bitrateLabel && ( {bitrateLabel && (
<Text size="xs" c="dimmed" style={{ whiteSpace: "nowrap" }}> <Text size="xs" c="dimmed" style={{ whiteSpace: "nowrap" }}>
{bitrateLabel} {bitrateLabel}