summaryrefslogtreecommitdiff
path: root/web/share/js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2019-04-22 21:22:59 +0300
committerDevaev Maxim <[email protected]>2019-04-22 21:22:59 +0300
commit5a80d98f046e99cfc49e6b233101b0562c463ef8 (patch)
treeb5a09c1924510997887cdd8724fe334aa0aee2e5 /web/share/js
parent4e108c35e802b51963c0edb4afa91d0e1a89a95e (diff)
reset* confirmation
Diffstat (limited to 'web/share/js')
-rw-r--r--web/share/js/kvm/hid.js14
-rw-r--r--web/share/js/kvm/msd.js18
-rw-r--r--web/share/js/kvm/stream.js14
3 files changed, 29 insertions, 17 deletions
diff --git a/web/share/js/kvm/hid.js b/web/share/js/kvm/hid.js
index a39201f2..9ecc4be5 100644
--- a/web/share/js/kvm/hid.js
+++ b/web/share/js/kvm/hid.js
@@ -212,11 +212,15 @@ function Hid() {
};
var __clickResetButton = function() {
- var http = tools.makeRequest("POST", "/kvmd/hid/reset", function() {
- if (http.readyState === 4) {
- if (http.status !== 200) {
- wm.error("HID reset error:<br>", http.responseText);
- }
+ wm.confirm("Are you sure you want to reset HID (keyboard & mouse)?").then(function(ok) {
+ if (ok) {
+ var http = tools.makeRequest("POST", "/kvmd/hid/reset", function() {
+ if (http.readyState === 4) {
+ if (http.status !== 200) {
+ wm.error("HID reset error:<br>", http.responseText);
+ }
+ }
+ });
}
});
};
diff --git a/web/share/js/kvm/msd.js b/web/share/js/kvm/msd.js
index 7cf5aa0f..d1dfac08 100644
--- a/web/share/js/kvm/msd.js
+++ b/web/share/js/kvm/msd.js
@@ -99,15 +99,19 @@ function Msd() {
};
var __clickResetButton = function() {
- var http = tools.makeRequest("POST", "/kvmd/msd/reset", function() {
- if (http.readyState === 4) {
- if (http.status !== 200) {
- wm.error("MSD reset error:<br>", http.responseText);
- }
+ wm.confirm("Are you sure you want to reset Mass Storage Device?").then(function(ok) {
+ if (ok) {
+ var http = tools.makeRequest("POST", "/kvmd/msd/reset", function() {
+ if (http.readyState === 4) {
+ if (http.status !== 200) {
+ wm.error("MSD reset error:<br>", http.responseText);
+ }
+ }
+ __applyState();
+ });
+ __applyState();
}
- __applyState();
});
- __applyState();
};
var __applyState = function() {
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js
index 97d08ea3..f804d555 100644
--- a/web/share/js/kvm/stream.js
+++ b/web/share/js/kvm/stream.js
@@ -185,11 +185,15 @@ function Streamer() {
};
var __clickResetButton = function() {
- var http = tools.makeRequest("POST", "/kvmd/streamer/reset", function() {
- if (http.readyState === 4) {
- if (http.status !== 200) {
- wm.error("Can't reset stream:<br>", http.responseText);
- }
+ wm.confirm("Are you sure you want to reset stream?").then(function (ok) {
+ if (ok) {
+ var http = tools.makeRequest("POST", "/kvmd/streamer/reset", function() {
+ if (http.readyState === 4) {
+ if (http.status !== 200) {
+ wm.error("Can't reset stream:<br>", http.responseText);
+ }
+ }
+ });
}
});
};