mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
reading images api
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user