- {/* File Dropzone / Picker */}
-
-
- 📁 Click here to select file(s) for upload
-
-
- Upload any document, image, video, or archive to your Nextcloud
-
-
+ {/* File Dropzone */}
+
{
+ e.preventDefault();
+ setIsDragOver(true);
+ }}
+ onDragLeave={() => setIsDragOver(false)}
+ onDrop={(e) => {
+ e.preventDefault();
+ setIsDragOver(false);
+ if (e.dataTransfer.files && e.dataTransfer.files.length > 0) {
+ const paths: string[] = [];
+ for (let i = 0; i < e.dataTransfer.files.length; i++) {
+ const f = e.dataTransfer.files[i];
+ // In desktop webview with path property
+ if ("path" in f && typeof (f as { path: string }).path === "string") {
+ paths.push((f as { path: string }).path);
+ }
+ }
+ if (paths.length > 0) {
+ addPathsToQueue(paths);
+ }
+ }
+ }}
+ >
+
📥
+
+ {isDragOver ? "Drop files now to add to queue" : "Drag and drop files here, or click to browse"}
+
+
+ Supports any files: documents, media, archives, and directories
+
+
- {/* Selected Files List */}
- {selectedFiles.length > 0 && (
-
-
- Selected Files ({selectedFiles.length})
-
-
-
- {selectedFiles.map((file) => (
-
- {file}
-
-
- ))}
-
-
- )}
-
- {/* Upload Options Card */}
-
-
Upload Settings
-
-
- setRemoteDir(e.target.value)}
- placeholder="Uploads or Projects/Folder"
- />
-
-
-
-
-
-
- {createShare && (
-
-
- setSharePassword(e.target.value)}
- placeholder="Leave empty for public access without password"
- />
-
+ {/* File Queue List */}
+
+
+
+ Upload Queue ({fileQueue.length})
+ {fileQueue.length > 0 && (
+
+ {formatBytes(totalQueueBytes)} • {pendingCount} Pending • {doneCount} Done
+
)}
-
-
+
+ {doneCount > 0 && (
+
+ )}
+ {fileQueue.length > 0 && (
+
+ )}
+
+
- {/* Upload Results */}
- {uploadResults.length > 0 && (
-
-
-
Upload Results
-
+ {fileQueue.length === 0 ? (
+
+ Queue is empty. Drop files above or click to select files for uploading.
+
+ ) : (
+
+ {fileQueue.map((item, index) => (
+
handleDragStart(index)}
+ onDragOver={(e) => handleDragOver(e, index)}
+ onDragEnd={handleDragEnd}
+ >
+
+ ⋮⋮
+
+
{index + 1}
+
+
+
{item.name}
+
{item.path}
+ {item.errorMessage && (
+
Error: {item.errorMessage}
+ )}
+
+
+
{formatBytes(item.size)}
+
+
+
+ {item.status.toUpperCase()}
+
+
+
+
+
+
+
+
- {uploadResults.map((r, i) => (
-
+ ))}
+
+ )}
+
+
+ {/* Upload Settings */}
+
+
Upload Settings
+
+
+ setRemoteDir(e.target.value)}
+ placeholder="Uploads or Projects/Folder"
+ />
+
+
+
+
+
+
+ {createShare && (
+
+
+ setSharePassword(e.target.value)}
+ placeholder="Leave empty for public access without password"
+ />
+
+ )}
+
+
+
+
+ {/* Completed Share Links & Results */}
+ {fileQueue.some((q) => q.result) && (
+
+
+ Share Links & Direct Downloads
+
+ {fileQueue
+ .filter((q) => q.result)
+ .map((item) => {
+ const r = item.result!;
+ return (
+
{r.file_name}
{formatBytes(r.bytes_uploaded)}
@@ -320,9 +552,8 @@ export function App() {
)}
- ))}
-
- )}
+ );
+ })}
)}