From 801b290ac67de03810704f523faae6cf53bb4186 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Wed, 28 Jul 2021 11:43:46 +0300 Subject: show remote uploading file --- web/share/js/kvm/msd.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'web/share') diff --git a/web/share/js/kvm/msd.js b/web/share/js/kvm/msd.js index 6f1fb8f0..25c68b01 100644 --- a/web/share/js/kvm/msd.js +++ b/web/share/js/kvm/msd.js @@ -207,15 +207,16 @@ export function Msd() { wm.setElementEnabled($("msd-reset-button"), (s && s.enabled && !s.busy)); - tools.hiddenSetVisible($("msd-submenu-new-image"), (online && __image_file)); - $("msd-new-image-name").innerHTML = ((online && __image_file) ? __image_file.name : ""); - $("msd-new-image-size").innerHTML = ((online && __image_file) ? tools.formatSize(__image_file.size) : ""); + let uploading = (online ? (s.storage.uploading || __image_file) : null); + tools.hiddenSetVisible($("msd-submenu-new-image"), uploading); + $("msd-new-image-name").innerHTML = (uploading ? uploading.name : ""); + $("msd-new-image-size").innerHTML = (uploading ? tools.formatSize(uploading.size) : ""); if (online) { - if (!__upload_http) { - tools.progressSetValue($("msd-uploading-progress"), "Waiting for upload (press UPLOAD button) ...", 0); - } else if (s.storage.uploading) { + if (s.storage.uploading) { let percent = Math.round(s.storage.uploading.written * 100 / s.storage.uploading.size); tools.progressSetValue($("msd-uploading-progress"), `${percent}%`, percent); + } else if (!__upload_http) { + tools.progressSetValue($("msd-uploading-progress"), "Waiting for upload (press UPLOAD button) ...", 0); } } else { $("msd-select-new-image-file").value = ""; -- cgit v1.2.3