From 762503cedf15a8611958106cd156cb37a80d751b Mon Sep 17 00:00:00 2001 From: "santasri.pachhal" Date: Thu, 19 Mar 2026 09:26:19 +0530 Subject: [PATCH] chore: add culvert type in model method and fix dashboard skeleton issue --- src/app/(modules)/upload/page.tsx | 201 +++++++----------- .../dashboard/dashboard-skeleton.tsx | 81 ++++--- src/components/ui/sidebar.tsx | 4 +- 3 files changed, 136 insertions(+), 150 deletions(-) diff --git a/src/app/(modules)/upload/page.tsx b/src/app/(modules)/upload/page.tsx index fd25c58..550bb77 100644 --- a/src/app/(modules)/upload/page.tsx +++ b/src/app/(modules)/upload/page.tsx @@ -24,22 +24,15 @@ import { cn } from '@/lib/utils'; const API_URL = process.env.NEXT_PUBLIC_API_URL; -const DETECTION_TYPES = [ - { value: 'pothole-detection', label: 'Pothole Detection' }, - { value: 'sign-board-detection', label: 'Signboard Detection' }, - { value: 'pot-sign-detection', label: 'Pothole & Signboard Detection' }, -] as const; - const DETECTION_METHODS = [ { value: 'yolo', label: 'YOLO Detection Model' }, { value: 'yolo_vl', label: 'YOLO with Vision-Language Model' }, { value: 'sam3', label: 'OpenAI SAM 3 Segmentation Model' }, { value: 'yoloe', label: 'YOLOE Open-Vocabulary Detection' }, { value: 'yoloe_trained_vl', label: 'YOLOE With Vision Language Model' }, + { value: 'culvert_detection', label: 'Culvert Detection' }, ] as const; -type DetectionType = 'pothole-detection' | 'sign-board-detection' | 'pot-sign-detection'; - export default function UploadPage() { const router = useRouter(); const [session, setSession] = useState(null); @@ -48,8 +41,6 @@ export default function UploadPage() { // Form states const [file, setFile] = useState(null); const [jsonFile, setJsonFile] = useState(null); - const [speed, setSpeed] = useState(30); - const [detectionType, setDetectionType] = useState('pothole-detection'); const [selectMethod, setSelectMethod] = useState('yolo_vl'); // Upload states @@ -77,9 +68,12 @@ export default function UploadPage() { const formData = new FormData(); formData.append('file', file); - formData.append('detection_type', detectionType); - formData.append('speed_kmh', speed.toString()); formData.append('detection_mode', selectMethod); + + if (session?.chainageId) { + formData.append('chainage_id', session.chainageId); + } + if (jsonFile) { formData.append('json_file', jsonFile); } @@ -101,7 +95,7 @@ export default function UploadPage() { } } - sessionService.saveVideoData({ videoId: result.video_id, detectionType }); + sessionService.saveVideoData({ videoId: result.video_id }); // Redirect to the dynamic processing page router.push(`/upload/${result.video_id}`); @@ -124,11 +118,7 @@ export default function UploadPage() { router.push(ROUTES.NEW_ANALYSIS); }; - const getTitle = () => { - if (detectionType === 'pothole-detection') return 'Pothole Detection'; - if (detectionType === 'sign-board-detection') return 'Signboard Detection'; - return 'Pothole & Signboard Detection'; - }; + const getTitle = () => 'Road Analysis'; if (isLoading) { return ( @@ -160,30 +150,33 @@ export default function UploadPage() {
-
- - Project - - - {session.projectName} - -
-
- - Package - - - {session.packageName} - -
-
- - Chainage - - - {session.chainageName} - -
+ {[ + { label: 'Project', value: session.projectName, primary: true }, + { label: 'Package', value: session.packageName }, + { label: 'Chainage', value: session.chainageName }, + ].map((item, idx) => ( +
+ + {item.label} + + + {item.value} + +
+ ))}