refactor: change analysis to upload
This commit is contained in:
@@ -10,30 +10,30 @@ const options = [
|
||||
{ value: 'combined', label: 'Road Defect Detection with vl' },
|
||||
] as const;
|
||||
|
||||
interface AnalysisSettingsSectionProps {
|
||||
interface UploadSettingsSectionProps {
|
||||
value: string;
|
||||
onValueChange: (value: string) => void;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export function AnalysisSettingsSection({
|
||||
export function UploadSettingsSection({
|
||||
value,
|
||||
onValueChange,
|
||||
disabled = false,
|
||||
}: AnalysisSettingsSectionProps) {
|
||||
}: UploadSettingsSectionProps) {
|
||||
return (
|
||||
<section className="space-y-3">
|
||||
<div>
|
||||
<h2 className="text-sm font-semibold text-foreground">
|
||||
Analysis Settings
|
||||
Upload Settings
|
||||
</h2>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Select the AI model workflow for this job.
|
||||
Select the detection workflow for this upload.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<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
|
||||
options={options}
|
||||
value={value}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import { useState } from 'react';
|
||||
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 { Button } from '@/components/ui/button';
|
||||
@@ -12,9 +12,9 @@ import { videoService } from '@/services/api';
|
||||
import type { SessionContext } from '@/types';
|
||||
import { ROUTES } from '@/utils/routes';
|
||||
|
||||
import { AnalysisSettingsSection } from './components/AnalysisSettingsSection';
|
||||
import { InputDataSection } from './components/InputDataSection';
|
||||
import { LocationSection } from './components/LocationSection';
|
||||
import { UploadSettingsSection } from './components/UploadSettingsSection';
|
||||
|
||||
export default function UploadPage() {
|
||||
const router = useRouter();
|
||||
@@ -34,7 +34,7 @@ export default function UploadPage() {
|
||||
|
||||
const handleSubmit = async () => {
|
||||
if (!session?.chainageId || !videoFile || !gpsFile) {
|
||||
setError('Complete location and input data before starting analysis.');
|
||||
setError('Complete location and input data before upload.');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,8 +63,8 @@ export default function UploadPage() {
|
||||
return (
|
||||
<div className="space-y-5">
|
||||
<PageHeader
|
||||
title="Create Analysis Job"
|
||||
description="Configure location, upload data, and start AI analysis."
|
||||
title="Upload"
|
||||
description="Configure location, upload data, and submit it for processing."
|
||||
icon={TrendingUp}
|
||||
/>
|
||||
|
||||
@@ -94,7 +94,7 @@ export default function UploadPage() {
|
||||
|
||||
<Separator />
|
||||
|
||||
<AnalysisSettingsSection
|
||||
<UploadSettingsSection
|
||||
value={analysisMethod}
|
||||
onValueChange={setAnalysisMethod}
|
||||
disabled={isSubmitting}
|
||||
@@ -117,12 +117,12 @@ export default function UploadPage() {
|
||||
{isSubmitting ? (
|
||||
<>
|
||||
<Loader2 className="size-4 animate-spin" />
|
||||
Starting analysis...
|
||||
Uploading...
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Play className="size-4" />
|
||||
Start Analysis
|
||||
<UploadCloud className="size-4" />
|
||||
Upload
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
|
||||
@@ -15,7 +15,7 @@ export function BreadcrumbBasic() {
|
||||
const pathname = usePathname();
|
||||
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) => {
|
||||
return segment
|
||||
.split('-')
|
||||
|
||||
@@ -31,7 +31,7 @@ export const menuItems: MenuItem[] = [
|
||||
icon: LayoutDashboard,
|
||||
},
|
||||
{
|
||||
title: 'New Analysis',
|
||||
title: 'Upload',
|
||||
path: ROUTES.UPLOAD,
|
||||
icon: Plus,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user