Project

General

Profile

Download (2.37 KB) Statistics
| Branch: | Tag: | Revision:
<!--SPICE Console-->
<% if @console[:secure_port] -%>
<script type="text/javascript">
function connectvm()
{
var pluginobj = document.embeds[0];
pluginobj.hostIP = String("<%= @console[:address] %>");
pluginobj.SecurePort = String("<%= @console[:secure_port] %>");
pluginobj.Password = String("<%= @console[:ticket] %>");
pluginobj.TrustStore = String("<%= @console[:ca_cert] %>");
pluginobj.SSLChannels = String("all");
pluginobj.fullScreen = false;
pluginobj.Title = String('<%= "#{@console[:name]} - Press Shift-F12 to release the cursor." %>');
pluginobj.connect();
}
$(function () { connectvm(); });
</script>
<embed type="application/x-spice" height=0 width=0>
<!--VNC Console-->
<% elsif @console[:proxy_port] -%>
<%= content_for(:head) { javascript_tag "var INCLUDE_URI = '/javascripts/noVNC/';" } %>
<%= javascript 'noVNC/vnc', 'noVNC/ui', 'noVNC' %>

<div id='vnc' data-port='<%= @console[:proxy_port] %>' data-password='<%= @console[:password] %>'>

<div id="noVNC_status_bar" class="row" style="margin-bottom:18px;">
<div id="noVNC_status" class="span7 label" >Loading</div>
<div id="noVNC_buttons">
<input type=button value="Ctrl-Alt-Del" id="sendCtrlAltDelButton" class="fr btn" >
</div>
<%= link_to_if_authorized("Back to host", hash_for_host_path(:id => @host), :title => "Back to host" , :class => 'fr btn') if @host %>
</div>

<canvas id="noVNC_canvas" width="640px" height="20px" class="clearfix ca">
Canvas not supported.
</canvas>
</div>
<!--Text Console-->
<% else -%>
<div class="row">
<% search_bar "Generated #{time_ago_in_words @console['timestamp']} ago" %>
<% title_actions link_to_if_authorized("Back to host", hash_for_host_path(:id => @host), :title => "Back to host" , :class => 'fr btn') %>
<% title "Console output for #{@host}" %>
</div>
<% if @host.installed_at.nil? or (@console['timestamp'] - @host.installed_at < 5.minutes) -%>
<div class='alert'>
<a class="close" href="#" data-dismiss="alert">&times;</a>
Console output may be out of date
</div>
<% end -%>
<pre class="pre-scrollable">
<code>
<%= @console['output'] %>
</code>
</pre>
<% end -%>
(13-13/29)