diff options
Diffstat (limited to 'web/js/kvm/atx.js')
-rw-r--r-- | web/js/kvm/atx.js | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/web/js/kvm/atx.js b/web/js/kvm/atx.js index 6a641ac9..ed5f045e 100644 --- a/web/js/kvm/atx.js +++ b/web/js/kvm/atx.js @@ -15,17 +15,12 @@ function Atx() { /********************************************************************************/ self.setState = function(state) { - $("atx-power-led").className = (state.leds.power ? "led-green" : "led-gray"); - $("atx-hdd-led").className = (state.leds.hdd ? "led-red" : "led-gray"); + $("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.busy); - wm.switchDisabled($("atx-power-button-long"), state.busy); - wm.switchDisabled($("atx-reset-button"), state.busy); - }; - - self.clearState = function() { - $("atx-power-led").className = "led-gray"; - $("atx-hdd-led").className = "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) { |