fix: some bugs

This commit is contained in:
Tom Boullay
2026-04-14 16:57:23 +02:00
parent 3a7a5e2eea
commit 110d64ec33
8 changed files with 37 additions and 34 deletions
+3 -5
View File
@@ -278,7 +278,7 @@ export default function UploadZone() {
// ---- Step 1: Drive upload ----
updateEntry(i, {
status: 'uploading',
progress: 0,
progress: 1,
error: undefined,
driveStatus: 'uploading',
driveError: undefined,
@@ -300,7 +300,7 @@ export default function UploadZone() {
return
}
updateEntry(i, { driveStatus: 'success' })
updateEntry(i, { driveStatus: 'success', progress: 50 })
// ---- Step 2: Git upload ----
await pushGit(i, controller.signal)
@@ -314,13 +314,11 @@ export default function UploadZone() {
const pushGit = async (index: number, signal?: AbortSignal) => {
const folderEntry = entries[index]
updateEntry(index, { progress: 5 })
const gitResult = await uploadGit(
folderEntry,
secret,
destination!,
(pct) => updateEntry(index, { progress: pct }),
(pct) => updateEntry(index, { progress: 50 + Math.round(pct / 2) }),
signal,
)
+8 -7
View File
@@ -62,7 +62,7 @@ export default function FolderCard({ entry, index, onToggleViewer, onRemove }: F
<span className="shrink-0 text-xs px-1.5 py-0.5 rounded-full bg-gray-700 text-gray-300">Dossier</span>
</div>
<div className="flex items-center gap-2 mt-0.5">
<span className="text-xs text-gray-500">modele : {entry.modelFile.name}</span>
<span className="text-xs text-gray-500">model : {entry.modelFile.name}</span>
{entry.status === 'error' && entry.error && (
<span className="text-xs text-red-400 truncate">{entry.error}</span>
)}
@@ -71,8 +71,8 @@ export default function FolderCard({ entry, index, onToggleViewer, onRemove }: F
)}
</div>
{/* Drive status sub-line */}
{entry.driveStatus && entry.driveStatus !== 'pending' && (
{/* Drive status sub-line (only during upload, not after success) */}
{entry.status !== 'success' && entry.driveStatus && entry.driveStatus !== 'pending' && (
<div className="flex items-center gap-1.5 mt-0.5">
{entry.driveStatus === 'uploading' && (
<>
@@ -80,15 +80,16 @@ export default function FolderCard({ entry, index, onToggleViewer, onRemove }: F
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" />
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" />
</svg>
<span className="text-xs text-gray-400">Drive en cours...</span>
<span className="text-xs text-gray-400">Upload Drive en cours...</span>
</>
)}
{entry.driveStatus === 'success' && (
<>
<svg className="w-3 h-3 text-green-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2.5}>
<path strokeLinecap="round" strokeLinejoin="round" d="M5 13l4 4L19 7" />
<svg className="w-3 h-3 text-gray-400 animate-spin" fill="none" viewBox="0 0 24 24">
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" />
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" />
</svg>
<span className="text-xs text-green-400">Drive OK</span>
<span className="text-xs text-gray-400">Upload Git en cours...</span>
</>
)}
{entry.driveStatus === 'error' && (