mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 18:11:54 +08:00
refactoring
This commit is contained in:
@@ -68,7 +68,7 @@ var atx = new function() {
|
||||
"atx-power-button-long",
|
||||
"atx-reset-button",
|
||||
].forEach(function(name) {
|
||||
tools.setButtonBusy(document.getElementById(name), busy);
|
||||
document.getElementById(name).disabled = busy;
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
@@ -28,13 +28,13 @@ var stream = new function() {
|
||||
// };
|
||||
|
||||
this.clickResetButton = function(el_button) {
|
||||
tools.setButtonBusy(el_button, true);
|
||||
el_button.disabled = true;
|
||||
var http = tools.makeRequest("POST", "/kvmd/streamer/reset", function() {
|
||||
if (http.readyState === 4) {
|
||||
if (http.status !== 200) {
|
||||
alert("Can't reset stream:", http.responseText);
|
||||
}
|
||||
tools.setButtonBusy(el_button, false);
|
||||
el_button.disabled = false;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -8,11 +8,6 @@ var tools = new function() {
|
||||
return http;
|
||||
};
|
||||
|
||||
this.setButtonBusy = function(el_button, busy) {
|
||||
el_button.disabled = busy;
|
||||
el_button.style.cursor = (busy ? "wait" : "default");
|
||||
};
|
||||
|
||||
var __debug = (new URL(window.location.href)).searchParams.get("debug");
|
||||
|
||||
this.debug = function(...args) {
|
||||
|
||||
Reference in New Issue
Block a user