mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-09-10 17:51:45 +02:00
UI tweaks (#17319)
This commit is contained in:
parent
e36fe79782
commit
b7fcd41737
@ -103,16 +103,24 @@ export function CameraStreamingDialog({
|
|||||||
if (!config) {
|
if (!config) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get available streams from the config and first stream entry as fallback
|
||||||
|
const availableStreams = config?.cameras[camera]?.live?.streams || {};
|
||||||
|
const firstStreamEntry = Object.entries(availableStreams)[0]?.[1] || "";
|
||||||
|
|
||||||
if (groupStreamingSettings && groupStreamingSettings[camera]) {
|
if (groupStreamingSettings && groupStreamingSettings[camera]) {
|
||||||
const cameraSettings = groupStreamingSettings[camera];
|
const cameraSettings = groupStreamingSettings[camera];
|
||||||
setStreamName(cameraSettings.streamName || "");
|
const streamNameFromSettings = cameraSettings.streamName || "";
|
||||||
|
|
||||||
|
const streamExists =
|
||||||
|
streamNameFromSettings &&
|
||||||
|
Object.values(availableStreams).includes(streamNameFromSettings);
|
||||||
|
|
||||||
|
setStreamName(streamExists ? streamNameFromSettings : firstStreamEntry);
|
||||||
setStreamType(cameraSettings.streamType || "smart");
|
setStreamType(cameraSettings.streamType || "smart");
|
||||||
setCompatibilityMode(cameraSettings.compatibilityMode || false);
|
setCompatibilityMode(cameraSettings.compatibilityMode || false);
|
||||||
} else {
|
} else {
|
||||||
setStreamName(
|
setStreamName(firstStreamEntry);
|
||||||
Object.entries(config?.cameras[camera]?.live?.streams || {})[0]?.[1] ||
|
|
||||||
"",
|
|
||||||
);
|
|
||||||
setStreamType("smart");
|
setStreamType("smart");
|
||||||
setCompatibilityMode(false);
|
setCompatibilityMode(false);
|
||||||
}
|
}
|
||||||
@ -150,19 +158,28 @@ export function CameraStreamingDialog({
|
|||||||
if (!config) {
|
if (!config) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get available streams from the config and first stream entry as fallback
|
||||||
|
const availableStreams = config?.cameras[camera]?.live?.streams || {};
|
||||||
|
const firstStreamEntry = Object.entries(availableStreams)[0]?.[1] || "";
|
||||||
|
|
||||||
if (groupStreamingSettings && groupStreamingSettings[camera]) {
|
if (groupStreamingSettings && groupStreamingSettings[camera]) {
|
||||||
const cameraSettings = groupStreamingSettings[camera];
|
const cameraSettings = groupStreamingSettings[camera];
|
||||||
setStreamName(cameraSettings.streamName || "");
|
const streamNameFromSettings = cameraSettings.streamName || "";
|
||||||
|
|
||||||
|
const streamExists =
|
||||||
|
streamNameFromSettings &&
|
||||||
|
Object.values(availableStreams).includes(streamNameFromSettings);
|
||||||
|
|
||||||
|
setStreamName(streamExists ? streamNameFromSettings : firstStreamEntry);
|
||||||
setStreamType(cameraSettings.streamType || "smart");
|
setStreamType(cameraSettings.streamType || "smart");
|
||||||
setCompatibilityMode(cameraSettings.compatibilityMode || false);
|
setCompatibilityMode(cameraSettings.compatibilityMode || false);
|
||||||
} else {
|
} else {
|
||||||
setStreamName(
|
setStreamName(firstStreamEntry);
|
||||||
Object.entries(config?.cameras[camera]?.live?.streams || {})[0]?.[1] ||
|
|
||||||
"",
|
|
||||||
);
|
|
||||||
setStreamType("smart");
|
setStreamType("smart");
|
||||||
setCompatibilityMode(false);
|
setCompatibilityMode(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
setIsDialogOpen(false);
|
setIsDialogOpen(false);
|
||||||
}, [groupStreamingSettings, camera, config, setIsDialogOpen]);
|
}, [groupStreamingSettings, camera, config, setIsDialogOpen]);
|
||||||
|
|
||||||
|
@ -549,9 +549,20 @@ export default function DraggableGridLayout({
|
|||||||
} else {
|
} else {
|
||||||
grow = "aspect-video";
|
grow = "aspect-video";
|
||||||
}
|
}
|
||||||
const streamName =
|
const availableStreams = camera.live.streams || {};
|
||||||
currentGroupStreamingSettings?.[camera.name]?.streamName ||
|
const firstStreamEntry = Object.values(availableStreams)[0] || "";
|
||||||
Object.values(camera.live.streams)[0];
|
|
||||||
|
const streamNameFromSettings =
|
||||||
|
currentGroupStreamingSettings?.[camera.name]?.streamName || "";
|
||||||
|
const streamExists =
|
||||||
|
streamNameFromSettings &&
|
||||||
|
Object.values(availableStreams).includes(
|
||||||
|
streamNameFromSettings,
|
||||||
|
);
|
||||||
|
|
||||||
|
const streamName = streamExists
|
||||||
|
? streamNameFromSettings
|
||||||
|
: firstStreamEntry;
|
||||||
const autoLive =
|
const autoLive =
|
||||||
currentGroupStreamingSettings?.[camera.name]?.streamType !==
|
currentGroupStreamingSettings?.[camera.name]?.streamType !==
|
||||||
"no-streaming";
|
"no-streaming";
|
||||||
|
@ -117,7 +117,9 @@ export default function StorageMetrics({
|
|||||||
{formatUnixTimestampToDateTime(earliestDate, {
|
{formatUnixTimestampToDateTime(earliestDate, {
|
||||||
timezone: timezone,
|
timezone: timezone,
|
||||||
strftime_fmt:
|
strftime_fmt:
|
||||||
config.ui.time_format == "24hour" ? "%d %b %Y" : "%B %d, %Y",
|
config.ui.time_format === "24hour"
|
||||||
|
? "%d %b %Y, %H:%M"
|
||||||
|
: "%B %d, %Y, %I:%M %p",
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
Loading…
Reference in New Issue
Block a user