summaryrefslogtreecommitdiff
path: root/web/js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-10-05 20:03:40 +0300
committerDevaev Maxim <[email protected]>2018-10-05 20:06:39 +0300
commita87963e300b489831c3809c4321c8747752fc6c6 (patch)
tree57480d30fd822ac648df39cfb711e6a3aadaf5e1 /web/js
parentbbaf99c1b4a19ec6438f794bc045777443cbaaf2 (diff)
msd pinout
Diffstat (limited to 'web/js')
-rw-r--r--web/js/msd.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/web/js/msd.js b/web/js/msd.js
index f90e4b05..9adb7495 100644
--- a/web/js/msd.js
+++ b/web/js/msd.js
@@ -18,6 +18,8 @@ function Msd() {
tools.setOnClick($("msd-switch-to-kvm-button"), () => __clickSwitchButton("kvm"));
tools.setOnClick($("msd-switch-to-server-button"), () => __clickSwitchButton("server"));
+
+ tools.setOnClick($("msd-reset-button"), __clickResetButton);
};
/********************************************************************************/
@@ -86,6 +88,18 @@ function Msd() {
__applyState();
};
+ var __clickResetButton = function() {
+ var http = tools.makeRequest("POST", "/kvmd/msd/reset", function() {
+ if (http.readyState === 4) {
+ if (http.status !== 200) {
+ ui.error("MSD reset error:<br>", http.responseText);
+ }
+ }
+ __applyState();
+ });
+ __applyState();
+ };
+
var __applyState = function() {
if (__state.connected_to === "server") {
$("msd-another-another-user-uploads").style.display = "none";
@@ -123,6 +137,7 @@ function Msd() {
$("msd-select-new-image-button").disabled = (!__state.in_operate || __state.connected_to !== "kvm" || __state.busy || __upload_http);
$("msd-upload-new-image-button").disabled = (!__state.in_operate || __state.connected_to !== "kvm" || __state.busy || !__image_file);
$("msd-abort-uploading-button").disabled = (!__state.in_operate || !__upload_http);
+ $("msd-reset-button").disabled = (!__state.in_operate || __upload_http);
$("msd-new-image").style.display = (__image_file ? "block" : "none");
$("msd-progress").setAttribute("data-label", "Waiting for upload ...");