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 | |
parent | e43cbb667f26c6e61527fb2d58373a0822f3153a (diff) |
show remote uploading file
Diffstat (limited to 'web')
-rw-r--r-- | web/kvm/index.html | 22 | ||||
-rw-r--r-- | web/kvm/navbar-msd.pug | 6 | ||||
-rw-r--r-- | web/share/js/kvm/msd.js | 13 |
3 files changed, 21 insertions, 20 deletions
diff --git a/web/kvm/index.html b/web/kvm/index.html index b152035d..dd7d1de5 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -303,17 +303,6 @@ </div> <hr> </div> - <div class="hidden" id="msd-message-another-user-uploads"> - <div class="text"> - <table> - <tr> - <td rowspan="2"><img class="sign " src="/share/svg/info.svg"></td> - <td style="line-height:1.5"><b>Another user uploads an image</b></td> - </tr> - </table> - </div> - <hr> - </div> <table class="kv"> <tr> <td>Status:</td> @@ -372,6 +361,17 @@ <button class="row25" disabled id="msd-upload-new-image-button">Upload</button> <button class="row25" disabled id="msd-abort-uploading-button">Abort</button> </div> + <div class="hidden" id="msd-message-another-user-uploads"> + <hr> + <div class="text"> + <table> + <tr> + <td rowspan="2"><img class="sign " src="/share/svg/info.svg"></td> + <td style="line-height:1.5"><b>Another user uploads an image</b></td> + </tr> + </table> + </div> + </div> <div class="hidden" id="msd-submenu-new-image"> <hr> <table class="kv"> diff --git a/web/kvm/navbar-msd.pug b/web/kvm/navbar-msd.pug index 419494fd..ceb8152a 100644 --- a/web/kvm/navbar-msd.pug +++ b/web/kvm/navbar-msd.pug @@ -21,9 +21,6 @@ li(id="msd-dropdown" class="right feature-disabled") +menu_message("warning", "Current image is out of storag") | This image was connected manually using #[b kvmd-otgmsd] hr - div(id="msd-message-another-user-uploads" class="hidden") - +menu_message("info", "Another user uploads an image") - hr table(class="kv") tr td Status: @@ -64,6 +61,9 @@ li(id="msd-dropdown" class="right feature-disabled") button(disabled id="msd-select-new-image-button" class="row50") Select image to upload button(disabled id="msd-upload-new-image-button" class="row25") Upload button(disabled id="msd-abort-uploading-button" class="row25") Abort + div(id="msd-message-another-user-uploads" class="hidden") + hr + +menu_message("info", "Another user uploads an image") div(id="msd-submenu-new-image" class="hidden") hr table(class="kv") 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 = ""; |