Handler to serve NoVNC page
[invirt/packages/invirt-web.git] / code / templates / novnc.mako
diff --git a/code/templates/novnc.mako b/code/templates/novnc.mako
new file mode 100644 (file)
index 0000000..b0e3bf8
--- /dev/null
@@ -0,0 +1,23 @@
+<%page expression_filter="h" />
+<%inherit file="skeleton.mako" />
+
+<%def name="title()">
+Console to ${machine.name}
+</%def>
+
+<style type='text/css'>body { max-width: none }</style>
+% if not on:
+<p> Your machine appears to be off.</p>
+% elif not has_vnc:
+<p> Your machine appears to not be accepting VNC connections. Perhaps you have a ParaVM machine?</p>
+% endif
+
+<p>See <a href="help?subject=Console" target="_blank">tips</a> about framebuffer and other issues.</p>
+
+<script type="text/javascript" src="static/novnc-1.0.js"></script>
+
+<div id="novnc">
+</div>
+<script type="text/javascript">
+  let rfb = new novnc.default(document.getElementById("novnc"), "wss://${hostname}:${config.vnc.novnc_port}/vnc?host=${vnc_host};vmname=${machine.name};token=${authtoken}");
+</script>