summaryrefslogtreecommitdiff
path: root/web/share/js/kvm/atx.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/share/js/kvm/atx.js')
-rw-r--r--web/share/js/kvm/atx.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/web/share/js/kvm/atx.js b/web/share/js/kvm/atx.js
index 796a4eeb..0065e73c 100644
--- a/web/share/js/kvm/atx.js
+++ b/web/share/js/kvm/atx.js
@@ -32,6 +32,7 @@ export function Atx(__recorder) {
/************************************************************************/
+ var __has_switch = null; // Or true/false
var __state = null;
var __init__ = function() {
@@ -54,12 +55,12 @@ export function Atx(__recorder) {
}
if (state.enabled !== undefined) {
__state.enabled = state.enabled;
- tools.feature.setEnabled($("atx-dropdown"), __state.enabled);
+ tools.feature.setEnabled($("atx-dropdown"), (__state.enabled && !__has_switch));
}
if (__state.enabled !== undefined) {
if (state.busy !== undefined) {
+ __updateButtons(!state.busy);
__state.busy = state.busy;
- __updateButtons(!__state.busy);
}
if (state.leds !== undefined) {
__state.leds = state.leds;
@@ -75,6 +76,11 @@ export function Atx(__recorder) {
}
};
+ self.setHasSwitch = function(has_switch) {
+ __has_switch = has_switch;
+ self.setState(__state);
+ };
+
var __updateLeds = function(power, hdd, busy) {
$("atx-power-led").className = (busy ? "led-yellow" : (power ? "led-green" : "led-gray"));
$("atx-hdd-led").className = (hdd ? "led-red" : "led-gray");