mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
refactoring
This commit is contained in:
@@ -26,12 +26,12 @@ var atx = new function() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.clickButton = function(el) {
|
this.clickButton = function(el_button) {
|
||||||
var button = null;
|
var button = null;
|
||||||
var confirm_msg = null;
|
var confirm_msg = null;
|
||||||
var timeout = null;
|
var timeout = null;
|
||||||
|
|
||||||
switch (el.id) {
|
switch (el_button.id) {
|
||||||
case "atx-power-button":
|
case "atx-power-button":
|
||||||
var button = "power";
|
var button = "power";
|
||||||
var confirm_msg = "Are you sure to click the power button?";
|
var confirm_msg = "Are you sure to click the power button?";
|
||||||
@@ -48,7 +48,6 @@ var atx = new function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (button && confirm(confirm_msg)) {
|
if (button && confirm(confirm_msg)) {
|
||||||
// atx.setButtonsBusy(true);
|
|
||||||
var http = tools.makeRequest("POST", "/kvmd/atx/click?button=" + button, function() {
|
var http = tools.makeRequest("POST", "/kvmd/atx/click?button=" + button, function() {
|
||||||
if (http.readyState === 4) {
|
if (http.readyState === 4) {
|
||||||
if (http.status === 409) {
|
if (http.status === 409) {
|
||||||
@@ -56,7 +55,6 @@ var atx = new function() {
|
|||||||
} else if (http.status !== 200) {
|
} else if (http.status !== 200) {
|
||||||
alert("Click error:", http.responseText);
|
alert("Click error:", http.responseText);
|
||||||
}
|
}
|
||||||
// atx.setButtonsBusy(false);
|
|
||||||
}
|
}
|
||||||
}, timeout);
|
}, timeout);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user