diff options
author | Devaev Maxim <[email protected]> | 2020-12-21 01:59:49 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-12-21 01:59:49 +0300 |
commit | 42475809fcafef12d39a12b7dd2be49aea9d9b6f (patch) | |
tree | a56572c31a6128434d2c8b89e7d479a558965b47 /web | |
parent | 2cb210c975b37d4e9db06b8e121f42f7d09c6fe1 (diff) |
refactoring
Diffstat (limited to 'web')
-rw-r--r-- | web/share/js/kvm/msd.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/web/share/js/kvm/msd.js b/web/share/js/kvm/msd.js index 28227b2d..9767dbfb 100644 --- a/web/share/js/kvm/msd.js +++ b/web/share/js/kvm/msd.js @@ -138,9 +138,8 @@ export function Msd() { tools.progressSetValue($("msd-uploading-progress"), "Aborted", 0); }; - var __clickConnectButton = function(connect) { - let action = (connect ? "connect" : "disconnect"); - let http = tools.makeRequest("POST", `/api/msd/${action}`, function() { + var __clickConnectButton = function(connected) { + let http = tools.makeRequest("POST", `/api/msd/set_connected?connected=${connected}`, function() { if (http.readyState === 4) { if (http.status !== 200) { wm.error("Switch error:<br>", http.responseText); @@ -149,7 +148,7 @@ export function Msd() { __applyState(); }); __applyState(); - wm.switchEnabled($(`msd-${action}-button`), false); + wm.switchEnabled($(`msd-${connected ? "connect" : "disconnect"}-button`), false); }; var __selectNewImageFile = function() { |