summaryrefslogtreecommitdiff
path: root/web/js/kvm/atx.js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-12-15 04:29:40 +0300
committerDevaev Maxim <[email protected]>2018-12-15 04:29:40 +0300
commit3c33bd37190772a783369894e209bcfe0858177a (patch)
treee095f08f37371a3182f6ced0b280c4bcaa06983b /web/js/kvm/atx.js
parent3445766a50eab16a96d969397a6fe0422f7cfcd2 (diff)
own auth
Diffstat (limited to 'web/js/kvm/atx.js')
-rw-r--r--web/js/kvm/atx.js43
1 files changed, 0 insertions, 43 deletions
diff --git a/web/js/kvm/atx.js b/web/js/kvm/atx.js
deleted file mode 100644
index ed5f045e..00000000
--- a/web/js/kvm/atx.js
+++ /dev/null
@@ -1,43 +0,0 @@
-function Atx() {
- var self = this;
-
- /********************************************************************************/
-
- var __init__ = function() {
- $("atx-power-led").title = "Power Led";
- $("atx-hdd-led").title = "Disk Activity Led";
-
- tools.setOnClick($("atx-power-button"), () => __clickButton("power", "Are you sure to click the power button?"));
- tools.setOnClick($("atx-power-button-long"), () => __clickButton("power_long", "Are you sure to perform the long press of the power button?"));
- tools.setOnClick($("atx-reset-button"), () => __clickButton("reset", "Are you sure to reboot the server?"));
- };
-
- /********************************************************************************/
-
- self.setState = function(state) {
- $("atx-power-led").className = ((state && state.leds.power) ? "led-green" : "led-gray");
- $("atx-hdd-led").className = ((state && state.leds.hdd) ? "led-red" : "led-gray");
-
- wm.switchDisabled($("atx-power-button"), (!state || state.busy));
- wm.switchDisabled($("atx-power-button-long"), (!state || state.busy));
- wm.switchDisabled($("atx-reset-button"), (!state || state.busy));
- };
-
- var __clickButton = function(button, confirm_msg) {
- wm.confirm(confirm_msg).then(function(ok) {
- if (ok) {
- var http = tools.makeRequest("POST", "/kvmd/atx/click?button=" + button, function() {
- if (http.readyState === 4) {
- if (http.status === 409) {
- wm.error("Performing another ATX operation for other client.<br>Please try again later");
- } else if (http.status !== 200) {
- wm.error("Click error:<br>", http.responseText);
- }
- }
- });
- }
- });
- };
-
- __init__();
-}