upadte: clean code + add next cloud
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
interface ActionButtonsProps {
|
||||
isUploading: boolean
|
||||
isSecretEmpty: boolean
|
||||
noDestination: boolean
|
||||
hasPendingOrErrors: boolean
|
||||
allDone: boolean
|
||||
hasErrors: boolean
|
||||
@@ -12,6 +13,7 @@ interface ActionButtonsProps {
|
||||
export default function ActionButtons({
|
||||
isUploading,
|
||||
isSecretEmpty,
|
||||
noDestination,
|
||||
hasPendingOrErrors,
|
||||
allDone,
|
||||
hasErrors,
|
||||
@@ -19,20 +21,22 @@ export default function ActionButtons({
|
||||
onCancel,
|
||||
onReset,
|
||||
}: ActionButtonsProps) {
|
||||
const cantUpload = isSecretEmpty || noDestination
|
||||
|
||||
return (
|
||||
<div className="flex gap-3">
|
||||
{!isUploading && hasPendingOrErrors && (
|
||||
<button
|
||||
onClick={onUpload}
|
||||
disabled={isSecretEmpty}
|
||||
disabled={cantUpload}
|
||||
className={`flex-1 font-medium text-sm py-2.5 px-6 rounded-xl transition-all duration-150
|
||||
focus:outline-none focus:ring-2 focus:ring-white/50 border border-white/20
|
||||
${isSecretEmpty
|
||||
${cantUpload
|
||||
? 'bg-white/30 text-gray-500 cursor-not-allowed'
|
||||
: 'bg-white text-[#000000] hover:bg-gray-200'
|
||||
}`}
|
||||
>
|
||||
Envoyer sur GitHub
|
||||
Envoyer
|
||||
</button>
|
||||
)}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { DESTINATIONS } from '@/lib/constants'
|
||||
import type { Destination } from '@/lib/constants'
|
||||
|
||||
interface DestinationPickerProps {
|
||||
destination: Destination
|
||||
destination: Destination | null
|
||||
disabled: boolean
|
||||
onChange: (value: Destination) => void
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
interface DriveErrorModalProps {
|
||||
error: string
|
||||
onCancel: () => void
|
||||
onContinue: () => void
|
||||
}
|
||||
|
||||
export default function DriveErrorModal({
|
||||
error,
|
||||
onCancel,
|
||||
onContinue,
|
||||
}: DriveErrorModalProps) {
|
||||
return (
|
||||
<div
|
||||
className="fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="drive-error-title"
|
||||
>
|
||||
<div className="bg-black-900 border border-white/20 rounded-2xl p-6 max-w-md w-full mx-4 space-y-4">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-10 h-10 rounded-full bg-red-900/30 flex items-center justify-center shrink-0">
|
||||
<svg className="w-5 h-5 text-red-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div>
|
||||
<h3 id="drive-error-title" className="text-sm font-semibold text-gray-100">
|
||||
Erreur Drive
|
||||
</h3>
|
||||
<p className="text-xs text-gray-400 mt-0.5">
|
||||
L'archivage sur le Drive a echoue. Les fichiers n'ont pas ete versionnes.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="bg-black-800 border border-white/10 rounded-xl p-3">
|
||||
<p className="text-xs text-red-400 font-mono break-all">{error}</p>
|
||||
</div>
|
||||
|
||||
<p className="text-xs text-gray-400">
|
||||
Voulez-vous quand meme envoyer les fichiers aux devs via GitHub ?
|
||||
</p>
|
||||
|
||||
<div className="flex gap-3">
|
||||
<button
|
||||
onClick={onCancel}
|
||||
className="flex-1 bg-black-700 text-gray-300 font-medium text-sm
|
||||
py-2.5 px-4 rounded-xl border border-white/10 transition-colors duration-150
|
||||
hover:bg-black-600"
|
||||
>
|
||||
Annuler
|
||||
</button>
|
||||
<button
|
||||
onClick={onContinue}
|
||||
className="flex-1 bg-white text-[#000000] font-medium text-sm
|
||||
py-2.5 px-4 rounded-xl transition-colors duration-150
|
||||
hover:bg-gray-200"
|
||||
>
|
||||
Envoyer sur Git seulement
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -67,9 +67,48 @@ export default function FolderCard({ entry, index, onToggleViewer, onRemove }: F
|
||||
<span className="text-xs text-red-400 truncate">{entry.error}</span>
|
||||
)}
|
||||
{entry.status === 'success' && entry.filename && (
|
||||
<span className="text-xs text-green-400 font-mono">{entry.filename}</span>
|
||||
<span className="text-xs text-green-400 font-mono">Drive + Git OK</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Drive status sub-line */}
|
||||
{entry.driveStatus && entry.driveStatus !== 'pending' && (
|
||||
<div className="flex items-center gap-1.5 mt-0.5">
|
||||
{entry.driveStatus === 'uploading' && (
|
||||
<>
|
||||
<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-gray-400">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>
|
||||
<span className="text-xs text-green-400">Drive OK</span>
|
||||
</>
|
||||
)}
|
||||
{entry.driveStatus === 'error' && (
|
||||
<>
|
||||
<svg className="w-3 h-3 text-red-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2.5}>
|
||||
<path strokeLinecap="round" strokeLinejoin="round" d="M6 18L18 6M6 6l12 12" />
|
||||
</svg>
|
||||
<span className="text-xs text-red-400 truncate">Drive echoue{entry.driveError ? ` : ${entry.driveError}` : ''}</span>
|
||||
</>
|
||||
)}
|
||||
{entry.driveStatus === 'skipped' && (
|
||||
<>
|
||||
<svg className="w-3 h-3 text-yellow-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
|
||||
<path strokeLinecap="round" strokeLinejoin="round" d="M12 9v2m0 4h.01" />
|
||||
</svg>
|
||||
<span className="text-xs text-yellow-400">Drive ignore</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{entry.status === 'uploading' && (
|
||||
<div className="mt-1.5 w-full h-1 bg-black-700 rounded-full overflow-hidden">
|
||||
<div
|
||||
|
||||
@@ -80,6 +80,7 @@ export default function FolderDropzone({
|
||||
</p>
|
||||
<p className="text-xs text-gray-500 mt-1">
|
||||
Contenu attendu : model.glb/gltf + textures (roughness, normal, metalness, color, displace)
|
||||
<br />Les originaux sont archives sur le Drive, les comprimes sont envoyes sur Git.
|
||||
</p>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -34,7 +34,7 @@ export default function NoChangesModal({
|
||||
Aucun changement detecte
|
||||
</h3>
|
||||
<p className="text-xs text-gray-400 mt-0.5">
|
||||
Le dossier <span className="font-mono text-gray-300">{destination}/{folderName}</span> est identique au contenu distant.
|
||||
Le dossier <span className="font-mono text-gray-300">{destination}/{folderName}</span> est identique au contenu distant. Rien a envoyer.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,7 +38,8 @@ export default function OverwriteConfirmModal({
|
||||
Dossier deja existant
|
||||
</h3>
|
||||
<p className="text-xs text-gray-400 mt-0.5">
|
||||
<span className="font-mono text-yellow-400">{destination}/{folderName}</span> existe deja sur le repo
|
||||
<span className="font-mono text-yellow-400">{destination}/{folderName}</span> existe deja.
|
||||
Les anciens fichiers seront archives sur le Drive, puis les nouveaux seront envoyes sur le Drive et Git.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user