mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 18:41:54 +08:00
minor js fixes
This commit is contained in:
@@ -5,11 +5,20 @@ var atx = new function() {
|
||||
};
|
||||
|
||||
this.clearLeds = function() {
|
||||
atx.setLedsState(false, false);
|
||||
[
|
||||
"atx-power-led",
|
||||
"atx-hdd-led",
|
||||
].forEach(function(name) {
|
||||
$(name).className = "led-off";
|
||||
});
|
||||
};
|
||||
|
||||
this.clickButton = function(el_button) {
|
||||
switch (el_button.id) {
|
||||
this.clickButton = function(el) {
|
||||
var button = null;
|
||||
var confirm_msg = null;
|
||||
var timeout = null;
|
||||
|
||||
switch (el.id) {
|
||||
case "atx-power-button":
|
||||
var button = "power";
|
||||
var confirm_msg = "Are you sure to click the power button?";
|
||||
@@ -17,15 +26,12 @@ var atx = new function() {
|
||||
case "atx-power-button-long":
|
||||
var button = "power_long";
|
||||
var confirm_msg = "Are you sure to perform the long press of the power button?";
|
||||
var timeout = 15000;
|
||||
break;
|
||||
case "atx-reset-button":
|
||||
var button = "reset";
|
||||
var confirm_msg = "Are you sure to reboot the server?";
|
||||
break;
|
||||
default:
|
||||
var button = null;
|
||||
var confirm_msg = null;
|
||||
break;
|
||||
}
|
||||
|
||||
if (button && confirm(confirm_msg)) {
|
||||
@@ -39,7 +45,7 @@ var atx = new function() {
|
||||
}
|
||||
__setButtonsBusy(false);
|
||||
}
|
||||
});
|
||||
}, timeout);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user