Factory recreate mode; chunked uploads with progress everywhere
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
771c6f5245
commit
b309778be8
17 files changed
+477
-47
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { uploadBatch } from "../uploads";
|
||||
import { Icon } from "./Icon";
|
||||
import { lazy, Suspense, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { del, get, post, put } from "../api";
|
||||
@@ -223,10 +224,7 @@ export function Files({ onMenu, embed }: { onMenu?: () => void; embed?: FilesEmb
|
||||
|
||||
const upload = async (files: FileList | File[]) => {
|
||||
if (!listing) return;
|
||||
for (const f of [...files]) {
|
||||
const res = await fetch(`/api/files/upload?path=${encodeURIComponent(`${listing.path}/${f.name}`)}`, { method: "PUT", body: f, credentials: "same-origin" });
|
||||
if (!res.ok) toast(`${f.name}: HTTP ${res.status}${res.status === 413 ? " – too large for the reverse proxy" : ""}`);
|
||||
}
|
||||
await uploadBatch([...files].map((f) => ({ file: f, path: `${listing.path}/${f.name}` })));
|
||||
await load(listing.path);
|
||||
void refreshGit();
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user