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) {
|
||||
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]) {
|
||||
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");
|
||||
setCompatibilityMode(cameraSettings.compatibilityMode || false);
|
||||
} else {
|
||||
setStreamName(
|
||||
Object.entries(config?.cameras[camera]?.live?.streams || {})[0]?.[1] ||
|
||||
"",
|
||||
);
|
||||
setStreamName(firstStreamEntry);
|
||||
setStreamType("smart");
|
||||
setCompatibilityMode(false);
|
||||
}
|
||||
@ -150,19 +158,28 @@ export function CameraStreamingDialog({
|
||||
if (!config) {
|
||||
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]) {
|
||||
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");
|
||||
setCompatibilityMode(cameraSettings.compatibilityMode || false);
|
||||
} else {
|
||||
setStreamName(
|
||||
Object.entries(config?.cameras[camera]?.live?.streams || {})[0]?.[1] ||
|
||||
"",
|
||||
);
|
||||
setStreamName(firstStreamEntry);
|
||||
setStreamType("smart");
|
||||
setCompatibilityMode(false);
|
||||
}
|
||||
|
||||
setIsDialogOpen(false);
|
||||
}, [groupStreamingSettings, camera, config, setIsDialogOpen]);
|
||||
|
||||
|
@ -549,9 +549,20 @@ export default function DraggableGridLayout({
|
||||
} else {
|
||||
grow = "aspect-video";
|
||||
}
|
||||
const streamName =
|
||||
currentGroupStreamingSettings?.[camera.name]?.streamName ||
|
||||
Object.values(camera.live.streams)[0];
|
||||
const availableStreams = camera.live.streams || {};
|
||||
const firstStreamEntry = Object.values(availableStreams)[0] || "";
|
||||
|
||||
const streamNameFromSettings =
|
||||
currentGroupStreamingSettings?.[camera.name]?.streamName || "";
|
||||
const streamExists =
|
||||
streamNameFromSettings &&
|
||||
Object.values(availableStreams).includes(
|
||||
streamNameFromSettings,
|
||||
);
|
||||
|
||||
const streamName = streamExists
|
||||
? streamNameFromSettings
|
||||
: firstStreamEntry;
|
||||
const autoLive =
|
||||
currentGroupStreamingSettings?.[camera.name]?.streamType !==
|
||||
"no-streaming";
|
||||
|
@ -117,7 +117,9 @@ export default function StorageMetrics({
|
||||
{formatUnixTimestampToDateTime(earliestDate, {
|
||||
timezone: timezone,
|
||||
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>
|
||||
)}
|
||||
|
Loading…
Reference in New Issue
Block a user