add option to replace file on upload

This commit is contained in:
joshuaboud 2021-06-04 14:40:16 -03:00
parent 9189daf1cd
commit 2da2b2705a
No known key found for this signature in database
GPG Key ID: 17EFB59E2A8BF50E

View File

@ -1003,8 +1003,8 @@ class FileUpload {
async upload() {
if (await this.check_if_exists()) {
window.alert(this.filename + ": File exists.");
return;
if (!window.confirm(this.filename + ": File exists. Replace?"))
return;
}
this.make_html_element();
this.proc = cockpit.spawn(["/usr/share/cockpit/navigator/scripts/write-chunks.py", this.path], {err: "out", superuser: "try"});