feat: implement drain issue
This commit is contained in:
@@ -4,6 +4,7 @@ import { Activity, Film } from 'lucide-react';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||
import { DetectionLogEntry } from '@/types';
|
||||
import { DETECTION_TYPES } from '@/constants/detectionModeConfig';
|
||||
|
||||
interface DetectionLogsProps {
|
||||
logs: DetectionLogEntry[];
|
||||
@@ -41,26 +42,31 @@ const DetectionLogs = ({ logs, onSeek }: DetectionLogsProps) => {
|
||||
<span className="text-xs text-muted-foreground/80">{log.videoTime}</span>
|
||||
</div>
|
||||
<div className="space-y-4">
|
||||
{log.detections.map((d, j) => (
|
||||
<div key={`${d.id}-${j}`} className="space-y-1">
|
||||
<div className="text-[13px] font-bold">
|
||||
{(d.type || '').replace(/ /g, '_')} ID: {d.id} | Confidence:{' '}
|
||||
{(d.confidence * 100).toFixed(1)}%
|
||||
{log.detections.map((d, j) => {
|
||||
const typeId = (d.type || '').toLowerCase();
|
||||
const typeConfig = DETECTION_TYPES[typeId];
|
||||
const label = typeConfig ? typeConfig.label : typeId.replace(/_/g, ' ');
|
||||
|
||||
return (
|
||||
<div key={`${d.id}-${j}`} className="space-y-1">
|
||||
<div className="text-[13px] font-bold">
|
||||
{label} ID: {d.id} | Confidence: {(d.confidence * 100).toFixed(1)}%
|
||||
</div>
|
||||
{d.bbox && (
|
||||
<div className="text-[12px] text-muted-foreground/80 font-medium">
|
||||
Coordinates: ({Math.round(d.bbox.x1)}, {Math.round(d.bbox.y1)}){' '}
|
||||
<span className="text-muted-foreground/40">→</span> (
|
||||
{Math.round(d.bbox.x2)}, {Math.round(d.bbox.y2)})
|
||||
</div>
|
||||
)}
|
||||
{d.latitude && (
|
||||
<div className="text-[12px] text-muted-foreground/80 font-medium">
|
||||
GPS: {d.latitude.toFixed(8)}, {d.longitude?.toFixed(8)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
{d.bbox && (
|
||||
<div className="text-[12px] text-muted-foreground/80 font-medium">
|
||||
Coordinates: ({Math.round(d.bbox.x1)}, {Math.round(d.bbox.y1)}){' '}
|
||||
<span className="text-muted-foreground/40">→</span> (
|
||||
{Math.round(d.bbox.x2)}, {Math.round(d.bbox.y2)})
|
||||
</div>
|
||||
)}
|
||||
{d.latitude && (
|
||||
<div className="text-[12px] text-muted-foreground/80 font-medium">
|
||||
GPS: {d.latitude.toFixed(8)}, {d.longitude?.toFixed(8)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user