mirror of
https://github.com/Break27/kvmd.git
synced 2026-02-06 18:36:37 +08:00
refactoring
This commit is contained in:
parent
77e9917b64
commit
a4f4d281b2
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user