diff options
author | Maxim Devaev <[email protected]> | 2021-07-28 11:43:46 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2021-07-28 11:43:46 +0300 |
commit | 801b290ac67de03810704f523faae6cf53bb4186 (patch) | |
tree | 33a4f14cb8f2829d871c89178d8ce454186edd2f /web/share | |
parent | e43cbb667f26c6e61527fb2d58373a0822f3153a (diff) |
show remote uploading file
Diffstat (limited to 'web/share')
-rw-r--r-- | web/share/js/kvm/msd.js | 13 |
1 files changed, 7 insertions, 6 deletions
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 = ""; |