From b5b6733b2aff99fc3f815ee9b88fb7025c55db7c Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Mon, 20 Mar 2023 17:49:35 +0200 Subject: check selected msd partition when uploading a file --- web/share/js/kvm/msd.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'web/share/js/kvm/msd.js') diff --git a/web/share/js/kvm/msd.js b/web/share/js/kvm/msd.js index 2f78655e..01504934 100644 --- a/web/share/js/kvm/msd.js +++ b/web/share/js/kvm/msd.js @@ -45,12 +45,12 @@ export function Msd() { tools.el.setOnClick($("msd-remove-button"), __clickRemoveButton); tools.radio.setOnClick("msd-mode-radio", () => __sendParam("cdrom", tools.radio.getValue("msd-mode-radio"))); - tools.el.setOnClick($("msd-rw-switch"), () => __sendParam("rw", $("msd-rw-switch").checked)); tools.el.setOnClick($("msd-select-new-button"), __toggleSelectSub); $("msd-new-file").onchange = __selectNewFile; $("msd-new-url").oninput = __selectNewUrl; + $("msd-new-part-selector").onchange = __selectNewFile; tools.el.setOnClick($("msd-upload-new-button"), __clickUploadNewButton); tools.el.setOnClick($("msd-abort-new-button"), __clickAbortNewButton); @@ -208,8 +208,9 @@ export function Msd() { let file = tools.input.getFile($("msd-new-file")); if (file) { $("msd-new-url").value = ""; - if (file.size > __state.storage.parts[""].size) { - wm.error("New image is too big for your Mass Storage Drive.
Maximum:", tools.formatSize(__state.storage.parts[""].size)); + let part = __state.storage.parts[$("msd-new-part-selector").value]; + if (file.size > part.size) { + wm.error("New image is too big for the MSD partition.
Maximum:", tools.formatSize(part.size)); el_input.value = ""; } } -- cgit v1.2.3