From 2da2b2705a2eae26870d8d93253fd09bca76c934 Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Fri, 4 Jun 2021 14:40:16 -0300 Subject: [PATCH] add option to replace file on upload --- navigator/navigator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/navigator/navigator.js b/navigator/navigator.js index 111ec5b..939a09c 100644 --- a/navigator/navigator.js +++ b/navigator/navigator.js @@ -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"});