refactor: change analysis to upload

This commit is contained in:
2026-06-18 18:24:19 +05:30
parent d8fa02dc5d
commit dff9e2222f
4 changed files with 17 additions and 17 deletions

View File

@@ -10,30 +10,30 @@ const options = [
{ value: 'combined', label: 'Road Defect Detection with vl' }, { value: 'combined', label: 'Road Defect Detection with vl' },
] as const; ] as const;
interface AnalysisSettingsSectionProps { interface UploadSettingsSectionProps {
value: string; value: string;
onValueChange: (value: string) => void; onValueChange: (value: string) => void;
disabled?: boolean; disabled?: boolean;
} }
export function AnalysisSettingsSection({ export function UploadSettingsSection({
value, value,
onValueChange, onValueChange,
disabled = false, disabled = false,
}: AnalysisSettingsSectionProps) { }: UploadSettingsSectionProps) {
return ( return (
<section className="space-y-3"> <section className="space-y-3">
<div> <div>
<h2 className="text-sm font-semibold text-foreground"> <h2 className="text-sm font-semibold text-foreground">
Analysis Settings Upload Settings
</h2> </h2>
<p className="text-xs text-muted-foreground"> <p className="text-xs text-muted-foreground">
Select the AI model workflow for this job. Select the detection workflow for this upload.
</p> </p>
</div> </div>
<div className="grid grid-cols-1 gap-3 md:grid-cols-2"> <div className="grid grid-cols-1 gap-3 md:grid-cols-2">
<FormField id="analysis-method" label="Analysis Method"> <FormField id="detection-method" label="Detection Method">
<SelectPopover <SelectPopover
options={options} options={options}
value={value} value={value}

View File

@@ -2,7 +2,7 @@
import { useState } from 'react'; import { useState } from 'react';
import { useRouter } from 'next/navigation'; import { useRouter } from 'next/navigation';
import { Loader2, Play, TrendingUp } from 'lucide-react'; import { Loader2, TrendingUp, UploadCloud } from 'lucide-react';
import { PageHeader } from '@/components/page-header'; import { PageHeader } from '@/components/page-header';
import { Button } from '@/components/ui/button'; import { Button } from '@/components/ui/button';
@@ -12,9 +12,9 @@ import { videoService } from '@/services/api';
import type { SessionContext } from '@/types'; import type { SessionContext } from '@/types';
import { ROUTES } from '@/utils/routes'; import { ROUTES } from '@/utils/routes';
import { AnalysisSettingsSection } from './components/AnalysisSettingsSection';
import { InputDataSection } from './components/InputDataSection'; import { InputDataSection } from './components/InputDataSection';
import { LocationSection } from './components/LocationSection'; import { LocationSection } from './components/LocationSection';
import { UploadSettingsSection } from './components/UploadSettingsSection';
export default function UploadPage() { export default function UploadPage() {
const router = useRouter(); const router = useRouter();
@@ -34,7 +34,7 @@ export default function UploadPage() {
const handleSubmit = async () => { const handleSubmit = async () => {
if (!session?.chainageId || !videoFile || !gpsFile) { if (!session?.chainageId || !videoFile || !gpsFile) {
setError('Complete location and input data before starting analysis.'); setError('Complete location and input data before upload.');
return; return;
} }
@@ -63,8 +63,8 @@ export default function UploadPage() {
return ( return (
<div className="space-y-5"> <div className="space-y-5">
<PageHeader <PageHeader
title="Create Analysis Job" title="Upload"
description="Configure location, upload data, and start AI analysis." description="Configure location, upload data, and submit it for processing."
icon={TrendingUp} icon={TrendingUp}
/> />
@@ -94,7 +94,7 @@ export default function UploadPage() {
<Separator /> <Separator />
<AnalysisSettingsSection <UploadSettingsSection
value={analysisMethod} value={analysisMethod}
onValueChange={setAnalysisMethod} onValueChange={setAnalysisMethod}
disabled={isSubmitting} disabled={isSubmitting}
@@ -117,12 +117,12 @@ export default function UploadPage() {
{isSubmitting ? ( {isSubmitting ? (
<> <>
<Loader2 className="size-4 animate-spin" /> <Loader2 className="size-4 animate-spin" />
Starting analysis... Uploading...
</> </>
) : ( ) : (
<> <>
<Play className="size-4" /> <UploadCloud className="size-4" />
Start Analysis Upload
</> </>
)} )}
</Button> </Button>

View File

@@ -15,7 +15,7 @@ export function BreadcrumbBasic() {
const pathname = usePathname(); const pathname = usePathname();
const segments = pathname.split('/').filter((segment) => segment !== ''); const segments = pathname.split('/').filter((segment) => segment !== '');
// Helper to format segment (e.g., "new-analysis" -> "New Analysis") // Helper to format segment (e.g., "upload-history" -> "Upload History")
const formatSegment = (segment: string) => { const formatSegment = (segment: string) => {
return segment return segment
.split('-') .split('-')

View File

@@ -31,7 +31,7 @@ export const menuItems: MenuItem[] = [
icon: LayoutDashboard, icon: LayoutDashboard,
}, },
{ {
title: 'New Analysis', title: 'Upload',
path: ROUTES.UPLOAD, path: ROUTES.UPLOAD,
icon: Plus, icon: Plus,
}, },