Fixed pikvm/pikvm#783: remove incomplete msd image

This commit is contained in:
Maxim Devaev
2022-07-30 18:15:50 +03:00
parent 5ee8f7a7a3
commit 589ec14de0
6 changed files with 29 additions and 10 deletions

View File

@@ -115,10 +115,10 @@ export function Msd() {
let file = tools.input.getFile($("msd-new-file"));
__http = new XMLHttpRequest();
if (file) {
__http.open("POST", `/api/msd/write?image=${encodeURIComponent(file.name)}`, true);
__http.open("POST", `/api/msd/write?image=${encodeURIComponent(file.name)}&remove_incomplete=1`, true);
} else {
let url = $("msd-new-url").value;
__http.open("POST", `/api/msd/write_remote?url=${encodeURIComponent(url)}`, true);
__http.open("POST", `/api/msd/write_remote?url=${encodeURIComponent(url)}&remove_incomplete=1`, true);
}
__http.upload.timeout = 7 * 24 * 3600;
__http.onreadystatechange = __httpStateChange;