Project

General

Profile

Download (3.01 KB) Statistics
| Branch: | Tag: | Revision:
<% javascript 'charts' %>
<% title @host.to_label, icon(@host.os) + @host.to_label %>

<% title_actions link_to_if_authorized("Edit", hash_for_edit_host_path(:id => @host), :title => "Edit your host"),
unless @host.build
link_to_if_authorized("Build", hash_for_setBuild_host_path(:id => @host), :disabled => !@host.can_be_build?,
:title => "Enable rebuild on next host boot",
:confirm => "Rebuild #{@host} on next reboot?\nThis would also delete all of its current facts and reports")
else
link_to_if_authorized("Cancel Build", hash_for_cancelBuild_host_path(:id => @host),:disabled => @host.can_be_build?,
:title => "Cancel build request for this host")
end,
if @host.compute_resource_id
vm = @host.compute_resource.find_vm_by_uuid(@host.uuid) rescue nil
if vm
html_opts = vm.ready? ? { :confirm => 'Are you sure?', :class => "btn btn-danger" } : { :class => "btn btn-success" }
link_to_if_authorized "Power#{state(vm.ready?)}", hash_for_power_host_path(:power_action => vm.ready? ? :stop : :start), html_opts.merge(:method => :put)
else
link_to("Unknown Power State",'#',:disabled=> true, :class=>"btn btn-warning")
end
end,
if @host.compute_resource_id
link_to_if_authorized "Console", hash_for_console_host_path(), {:disabled=> vm.nil? || !vm.ready?, :class => "btn btn-info"}
end,
link_to_if_authorized("Run puppet", hash_for_puppetrun_host_path(:id => @host).merge(:auth_action => :edit), :disabled => !Setting[:puppetrun],
:title => "Trigger a puppetrun on a node; requires that puppet run is enabled"),
link_to_if_authorized("All Puppet Classes", hash_for_storeconfig_klasses_host_path(:id => @host).merge(:auth_action => :read), :disabled => @host.resources.count == 0,
:title => "Show all host puppet classes, requires storeconfigs"),
link_to_if_authorized("Delete", hash_for_host_path(:id => @host, :auth_action => :destroy), :class => "btn btn-danger", :confirm => 'Are you sure?', :method => :delete)
-%>
<% content_for(:search_bar) {reports_show} %>

<div class="row">
<%= runtime_chart 'runtime_graph', 'Runtime', "last #{@range} days", @host.runtime_chart(@range.days.ago) %>
<div class="span5"><%= render :partial => "hosts/overview", :locals => { :host => @host } %></div>
</div>
<div class="row">
<%= report_status_chart 'resource_graph', 'Resources', "last #{@range} days", @host.resources_chart(@range.days.ago) %>
<div class="span5">
<% if SETTINGS[:unattended] and @host.managed? -%>
<table class="table table-bordered table-striped table-condensed">
<tr><th>Templates</th></tr>
<tr><td><%= show_templates -%></td></tr>
</table>
<% end -%>
<% if @report_summary.size == 0 -%>
<p>No puppet activity for this host in the last <%= @range %> days</p>
<% else -%>
<%= render :partial => "hosts/metrics", :locals => { :report_summary => @report_summary[@host.name][:metrics] } %>
<% end -%>
</div>
</div>
(25-25/28)