diff --git a/vnc_auto.html b/vnc_auto.html index 2aa21889..5f393769 100644 --- a/vnc_auto.html +++ b/vnc_auto.html @@ -50,9 +50,17 @@
Loading
-
+
+
@@ -90,6 +98,18 @@ rfb.sendCtrlAltDel(); return false; } + function xvpShutdown() { + rfb.xvpShutdown(); + return false; + } + function xvpReboot() { + rfb.xvpReboot(); + return false; + } + function xvpReset() { + rfb.xvpReset(); + return false; + } function updateState(rfb, state, oldstate, msg) { var s, sb, cad, level; s = $D('noVNC_status'); @@ -104,8 +124,12 @@ default: level = "warn"; break; } - if (state === "normal") { cad.disabled = false; } - else { cad.disabled = true; } + if (state === "normal") { + cad.disabled = false; + } else { + cad.disabled = true; + xvpInit(0); + } if (typeof(msg) !== 'undefined') { sb.setAttribute("class", "noVNC_status_" + level); @@ -113,11 +137,24 @@ } } + function xvpInit(ver) { + var xvpbuttons; + xvpbuttons = $D('xvp_buttons'); + if (ver >= 1) { + xvpbuttons.style.display = 'inline'; + } else { + xvpbuttons.style.display = 'none'; + } + } + window.onscriptsload = function () { var host, port, password, path, token; $D('sendCtrlAltDelButton').style.display = "inline"; $D('sendCtrlAltDelButton').onclick = sendCtrlAltDel; + $D('xvpShutdownButton').onclick = xvpShutdown; + $D('xvpRebootButton').onclick = xvpReboot; + $D('xvpResetButton').onclick = xvpReset; WebUtil.init_logging(WebUtil.getQueryVar('logging', 'warn')); document.title = unescape(WebUtil.getQueryVar('title', 'noVNC')); @@ -161,6 +198,7 @@ 'shared': WebUtil.getQueryVar('shared', true), 'view_only': WebUtil.getQueryVar('view_only', false), 'updateState': updateState, + 'onXvpInit': xvpInit, 'onPasswordRequired': passwordRequired}); rfb.connect(host, port, password, path); };