summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-03-20 17:49:35 +0200
committerMaxim Devaev <[email protected]>2023-03-20 17:49:35 +0200
commitb5b6733b2aff99fc3f815ee9b88fb7025c55db7c (patch)
treedf59765230c783e443b777813c35b6fd81a75230
parent426ed5da12073aefa72768226dbdf3a57cc0cfc0 (diff)
check selected msd partition when uploading a file
-rw-r--r--web/share/js/kvm/msd.js7
1 files changed, 4 insertions, 3 deletions
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.<br>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.<br>Maximum:", tools.formatSize(part.size));
el_input.value = "";
}
}