summaryrefslogtreecommitdiff
path: root/web
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
parentbbaf99c1b4a19ec6438f794bc045777443cbaaf2 (diff)
msd pinout
Diffstat (limited to 'web')
-rw-r--r--web/index.html3
-rw-r--r--web/js/msd.js15
2 files changed, 16 insertions, 2 deletions
diff --git a/web/index.html b/web/index.html
index 1c16bc91..52e08f45 100644
--- a/web/index.html
+++ b/web/index.html
@@ -69,9 +69,7 @@
<div class="ctl-dropdown-content">
<div class="ctl-dropdown-content-buttons">
<button id="show-about-button">&bull; Show about</button>
- <hr>
<button id="show-keyboard-button">&bull; Show keyboard</button>
- <hr>
<button id="show-stream-button">&bull; Show stream</button>
<hr>
<button disabled id="stream-screenshot-button">&bull; Take a screenshot</button>
@@ -91,6 +89,7 @@
<hr>
<div class="ctl-dropdown-content-buttons">
<button disabled id="stream-reset-button">&bull; Reset stream</button>
+ <button disabled id="msd-reset-button">&bull; Reset mass storage</button>
</div>
</div>
</div>
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 ...");