reset* confirmation

This commit is contained in:
Devaev Maxim 2019-04-22 21:22:59 +03:00
parent 4e108c35e8
commit 5a80d98f04
3 changed files with 29 additions and 17 deletions

View File

@ -212,6 +212,8 @@ function Hid() {
}; };
var __clickResetButton = function() { var __clickResetButton = function() {
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() { var http = tools.makeRequest("POST", "/kvmd/hid/reset", function() {
if (http.readyState === 4) { if (http.readyState === 4) {
if (http.status !== 200) { if (http.status !== 200) {
@ -219,6 +221,8 @@ function Hid() {
} }
} }
}); });
}
});
}; };
__init__(); __init__();

View File

@ -99,6 +99,8 @@ function Msd() {
}; };
var __clickResetButton = function() { var __clickResetButton = function() {
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() { var http = tools.makeRequest("POST", "/kvmd/msd/reset", function() {
if (http.readyState === 4) { if (http.readyState === 4) {
if (http.status !== 200) { if (http.status !== 200) {
@ -108,6 +110,8 @@ function Msd() {
__applyState(); __applyState();
}); });
__applyState(); __applyState();
}
});
}; };
var __applyState = function() { var __applyState = function() {

View File

@ -185,6 +185,8 @@ function Streamer() {
}; };
var __clickResetButton = function() { var __clickResetButton = function() {
wm.confirm("Are you sure you want to reset stream?").then(function (ok) {
if (ok) {
var http = tools.makeRequest("POST", "/kvmd/streamer/reset", function() { var http = tools.makeRequest("POST", "/kvmd/streamer/reset", function() {
if (http.readyState === 4) { if (http.readyState === 4) {
if (http.status !== 200) { if (http.status !== 200) {
@ -192,6 +194,8 @@ function Streamer() {
} }
} }
}); });
}
});
}; };
var __sendParam = function(name, value) { var __sendParam = function(name, value) {