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 { useEffect, useRef, useState } from "react";
|
||||
import { api, get, patch, post } from "../../api";
|
||||
import { confirmDialog, toast } from "../../dialogs";
|
||||
@@ -100,7 +101,11 @@ export function Backups() {
|
||||
setRestoring(true);
|
||||
try {
|
||||
if ("name" in source) await post(`/backups/${encodeURIComponent(source.name)}/restore`);
|
||||
else await api("/backups/restore", { method: "POST", body: source.file, headers: { "Content-Type": "application/zip" } });
|
||||
else {
|
||||
const sent = await uploadBatch([{ file: source.file, path: "", name: source.file.name, endpoint: "/api/backups/upload" }]);
|
||||
if (!sent.length) throw new Error(t("backup.uploadFailed"));
|
||||
await post("/backups/restore-uploaded");
|
||||
}
|
||||
toast(t("backup.restarting"), "info");
|
||||
// Wait until the server is gone and back, then reload with the restored data.
|
||||
await new Promise((r) => setTimeout(r, 2500));
|
||||
|
||||
Reference in new issue
Block a user