summaryrefslogtreecommitdiff
path: root/kvmd/web/js/atx.js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-07-16 05:16:53 +0300
committerDevaev Maxim <[email protected]>2018-07-16 05:16:53 +0300
commit211401b52c1d334b50dede28bab0a3a6e056992e (patch)
treecb2389d5b9a061ae1b2eb4919e0195374e043513 /kvmd/web/js/atx.js
parent52bf4f38e42852818354ca7f182b589a2f09631d (diff)
minor js fixes
Diffstat (limited to 'kvmd/web/js/atx.js')
-rw-r--r--kvmd/web/js/atx.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/kvmd/web/js/atx.js b/kvmd/web/js/atx.js
index 6e753bdf..d0c8f3af 100644
--- a/kvmd/web/js/atx.js
+++ b/kvmd/web/js/atx.js
@@ -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);
}
};