mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-08 20:25:26 +03:00
parent
07c171b341
commit
b11a7ec23a
@ -213,15 +213,6 @@ export function MotionSegment({
|
|||||||
<div className="flex flex-row justify-center w-[20px] md:w-[40px] mb-[1px]">
|
<div className="flex flex-row justify-center w-[20px] md:w-[40px] mb-[1px]">
|
||||||
<div className="w-[10px] md:w-[20px] flex justify-end">
|
<div className="w-[10px] md:w-[20px] flex justify-end">
|
||||||
<div
|
<div
|
||||||
data-segment-time={
|
|
||||||
new Date(segmentTime * 1000 + (segmentDuration * 1000) / 2)
|
|
||||||
}
|
|
||||||
data-motion-value={getMotionSegmentValue(
|
|
||||||
segmentTime + segmentDuration / 2,
|
|
||||||
)}
|
|
||||||
data-audio-value={getAudioSegmentValue(
|
|
||||||
segmentTime + segmentDuration / 2,
|
|
||||||
)}
|
|
||||||
key={`${segmentKey}_motion_data_1`}
|
key={`${segmentKey}_motion_data_1`}
|
||||||
className={`h-[2px] rounded-full bg-motion_review`}
|
className={`h-[2px] rounded-full bg-motion_review`}
|
||||||
onClick={segmentClick}
|
onClick={segmentClick}
|
||||||
@ -251,9 +242,6 @@ export function MotionSegment({
|
|||||||
<div className="flex flex-row justify-center w-[20px] md:w-[40px]">
|
<div className="flex flex-row justify-center w-[20px] md:w-[40px]">
|
||||||
<div className="w-[10px] md:w-[20px] flex justify-end">
|
<div className="w-[10px] md:w-[20px] flex justify-end">
|
||||||
<div
|
<div
|
||||||
data-segment-time={new Date(segmentTime * 1000)}
|
|
||||||
data-motion-value={getMotionSegmentValue(segmentTime)}
|
|
||||||
data-audio-value={getAudioSegmentValue(segmentTime)}
|
|
||||||
key={`${segmentKey}_motion_data_2`}
|
key={`${segmentKey}_motion_data_2`}
|
||||||
className={`h-[2px] rounded-full bg-motion_review`}
|
className={`h-[2px] rounded-full bg-motion_review`}
|
||||||
onClick={segmentClick}
|
onClick={segmentClick}
|
||||||
|
|||||||
@ -63,7 +63,7 @@ export type MockMotionData = {
|
|||||||
function generateRandomMotionAudioData(): MockMotionData[] {
|
function generateRandomMotionAudioData(): MockMotionData[] {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const endTime = now.getTime() / 1000;
|
const endTime = now.getTime() / 1000;
|
||||||
const startTime = endTime - 0.25 * 60 * 60; // 24 hours ago
|
const startTime = endTime - 24 * 60 * 60; // 24 hours ago
|
||||||
const interval = 30; // 30 seconds
|
const interval = 30; // 30 seconds
|
||||||
|
|
||||||
const data = [];
|
const data = [];
|
||||||
@ -75,17 +75,14 @@ function generateRandomMotionAudioData(): MockMotionData[] {
|
|||||||
const endTimestamp = startTimestamp + interval;
|
const endTimestamp = startTimestamp + interval;
|
||||||
const motionValue = Math.floor(Math.random() * 101); // Random number between 0 and 100
|
const motionValue = Math.floor(Math.random() * 101); // Random number between 0 and 100
|
||||||
const audioValue = Math.random() * -100; // Random negative value between -100 and 0
|
const audioValue = Math.random() * -100; // Random negative value between -100 and 0
|
||||||
const foo = new Date(startTimestamp * 1000);
|
|
||||||
data.push({
|
data.push({
|
||||||
start_time: startTimestamp,
|
start_time: startTimestamp,
|
||||||
end_time: endTimestamp,
|
end_time: endTimestamp,
|
||||||
motionValue,
|
motionValue,
|
||||||
audioValue,
|
audioValue,
|
||||||
foo,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(data);
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -298,7 +295,7 @@ function UIPlayground() {
|
|||||||
handlebarTime={handlebarTime} // set the time of the handlebar
|
handlebarTime={handlebarTime} // set the time of the handlebar
|
||||||
setHandlebarTime={setHandlebarTime} // expose handler to set the handlebar time
|
setHandlebarTime={setHandlebarTime} // expose handler to set the handlebar time
|
||||||
onHandlebarDraggingChange={handleDraggingChange} // function for state of handlebar dragging
|
onHandlebarDraggingChange={handleDraggingChange} // function for state of handlebar dragging
|
||||||
// show / hide the minimap
|
showMinimap // show / hide the minimap
|
||||||
minimapStartTime={minimapStartTime} // start time of the minimap - the earlier time (eg 1:00pm)
|
minimapStartTime={minimapStartTime} // start time of the minimap - the earlier time (eg 1:00pm)
|
||||||
minimapEndTime={minimapEndTime} // end of the minimap - the later time (eg 3:00pm)
|
minimapEndTime={minimapEndTime} // end of the minimap - the later time (eg 3:00pm)
|
||||||
events={mockEvents} // events, including new has_been_reviewed and severity properties
|
events={mockEvents} // events, including new has_been_reviewed and severity properties
|
||||||
@ -317,7 +314,7 @@ function UIPlayground() {
|
|||||||
handlebarTime={handlebarTime} // set the time of the handlebar
|
handlebarTime={handlebarTime} // set the time of the handlebar
|
||||||
setHandlebarTime={setHandlebarTime} // expose handler to set the handlebar time
|
setHandlebarTime={setHandlebarTime} // expose handler to set the handlebar time
|
||||||
onHandlebarDraggingChange={handleDraggingChange} // function for state of handlebar dragging
|
onHandlebarDraggingChange={handleDraggingChange} // function for state of handlebar dragging
|
||||||
// show / hide the minimap
|
showMinimap // show / hide the minimap
|
||||||
minimapStartTime={minimapStartTime} // start time of the minimap - the earlier time (eg 1:00pm)
|
minimapStartTime={minimapStartTime} // start time of the minimap - the earlier time (eg 1:00pm)
|
||||||
minimapEndTime={minimapEndTime} // end of the minimap - the later time (eg 3:00pm)
|
minimapEndTime={minimapEndTime} // end of the minimap - the later time (eg 3:00pm)
|
||||||
events={mockEvents} // events, including new has_been_reviewed and severity properties
|
events={mockEvents} // events, including new has_been_reviewed and severity properties
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user