diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/kvm/index.html | 3 | ||||
-rw-r--r-- | web/kvm/navbar-msd.pug | 1 | ||||
-rw-r--r-- | web/share/js/kvm/msd.js | 8 |
3 files changed, 12 insertions, 0 deletions
diff --git a/web/kvm/index.html b/web/kvm/index.html index 093133ee..ebcc824a 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -420,6 +420,9 @@ <select disabled id="msd-image-selector"></select> </td> <td> + <button disabled id="msd-download-button" title="Download image"> 🖪 </button> + </td> + <td> <button disabled id="msd-remove-button" title="Remove image"><b> × </b></button> </td> </tr> diff --git a/web/kvm/navbar-msd.pug b/web/kvm/navbar-msd.pug index 68d764c3..ae2e063e 100644 --- a/web/kvm/navbar-msd.pug +++ b/web/kvm/navbar-msd.pug @@ -37,6 +37,7 @@ li(id="msd-dropdown" class="right feature-disabled") tr td Image: td(width="100%") #[select(disabled id="msd-image-selector")] + td #[button(disabled id="msd-download-button" title="Download image") 🖪 ] td #[button(disabled id="msd-remove-button" title="Remove image") #[b × ]] table(class="kv msd-cdrom-emulation feature-disabled") tr diff --git a/web/share/js/kvm/msd.js b/web/share/js/kvm/msd.js index aff901d5..4e85239f 100644 --- a/web/share/js/kvm/msd.js +++ b/web/share/js/kvm/msd.js @@ -39,6 +39,7 @@ export function Msd() { $("msd-led").title = "Unknown state"; $("msd-image-selector").onchange = __selectImage; + tools.el.setOnClick($("msd-download-button"), __clickDownloadButton); tools.el.setOnClick($("msd-remove-button"), __clickRemoveButton); tools.radio.setOnClick("msd-mode-radio", __clickModeRadio); @@ -67,10 +68,16 @@ export function Msd() { var __selectImage = function() { tools.el.setEnabled($("msd-image-selector"), false); + tools.el.setEnabled($("msd-download-button"), false); tools.el.setEnabled($("msd-remove-button"), false); __sendParam("image", $("msd-image-selector").value); }; + var __clickDownloadButton = function() { + let name = $("msd-image-selector").value; + window.open(`/api/msd/read?image=${name}`); + }; + var __clickRemoveButton = function() { let name = $("msd-image-selector").value; wm.confirm(`Are you sure you want to remove the image<br><b>${name}</b> from PiKVM?`).then(function(ok) { @@ -244,6 +251,7 @@ export function Msd() { tools.el.setEnabled($("msd-image-selector"), (online && s.features.multi && !s.drive.connected && !s.busy)); __applyStateImageSelector(); + tools.el.setEnabled($("msd-download-button"), (online && s.features.multi && s.drive.image && !s.drive.connected && !s.busy)); tools.el.setEnabled($("msd-remove-button"), (online && s.features.multi && s.drive.image && !s.drive.connected && !s.busy)); tools.radio.setEnabled("msd-mode-radio", (online && s.features.cdrom && !s.drive.connected && !s.busy)); |