foreman/app/views/hosts/show.html.erb @ c45a0014
cdf02336 | Ohad Levy | <% title @host.to_label, false %>
|
|
01984fb7 | Amos Benari | <div class='page_title'>
|
|
<%= icon(@host.os) + @host.to_label %>
|
|||
</div>
|
|||
d5c2f34a | Ohad Levy | <span class="title_action">
|
|
c45a0014 | Ohad Levy | <%= link_to_if_authorized "Edit", hash_for_edit_host_path(:id => @host), :title => "Edit your host" %>
|
|
<%= link_to_if_authorized "Facts", hash_for_host_facts_path(:host_id => @host), :title => "Browse host facts" %>
|
|||
<%= link_to_if_authorized "Reports", hash_for_host_reports_path(:host_id => @host), :title => "Browse host reports" %>
|
|||
6fc77b66 | Ohad Levy | <%= link_to "YAML", externalNodes_host_path(:id => @host), :title => "Puppet external nodes YAML dump" %>
|
|
7700f32f | Frank Sweetser | <% unless @host.build -%>
|
|
c45a0014 | Ohad Levy | <%= link_to_if_authorized "Build", hash_for_setBuild_host_path(:id => @host), :disabled => !@host.can_be_build?,
|
|
6fc77b66 | Ohad Levy | :title => "Enable rebuild on next host boot",
|
|
:confirm => "Rebuild #{@host} on next reboot?\nThis would also delete all of its current facts and reports" %>
|
|||
7700f32f | Frank Sweetser | <% else -%>
|
|
c45a0014 | Ohad Levy | <%= link_to_if_authorized "Cancel Build", hash_for_cancelBuild_host_path(:id => @host),:disabled => @host.can_be_build?,
|
|
6fc77b66 | Ohad Levy | :title => "Cancel build request for this host" %>
|
|
b25137fe | Amos Benari | <% end -%>
|
|
c45a0014 | Ohad Levy | <%= link_to_if_authorized "Run puppet", hash_for_puppetrun_host_path(:id => @host).merge(:auth_action => :edit), :disabled => !Setting[:puppetrun],
|
|
6fc77b66 | Ohad Levy | :title => "Trigger a puppetrun on a node; requires that puppet run is enabled" %>
|
|
c45a0014 | Ohad Levy | <%= link_to_if_authorized "All Puppet Classes", hash_for_storeconfig_klasses_host_path(:id => @host).merge(:auth_action => :read), :disabled => @host.resources.count == 0,
|
|
6fc77b66 | Ohad Levy | :title => "Show all host puppet classes, requires storeconfigs" %>
|
|
c45a0014 | Ohad Levy | <%= link_to_if_authorized "Delete", hash_for_host_path(:id => @host, :auth_action => :destroy), :confirm => 'Are you sure?', :method => :delete %>
|
|
d5c2f34a | Ohad Levy | </span>
|
|
72e65b31 | Ohad Levy | ||
01984fb7 | Amos Benari | <table>
|
|
<th>
|
|||
c6f1b718 | Ohad Levy | <% if @host.reports.size > 0 -%>
|
|
01984fb7 | Amos Benari | <%= form_tag @host, :id => 'days_filter', :method => :get %>
|
|
<p>Reports from the last
|
|||
<%= select(nil, 'range', 1..days_ago(@host.reports.first.reported_at),
|
|||
c45a0014 | Ohad Levy | { :selected => @range }, { :onchange =>"$('#days_filter').submit();$(this).disabled();" }) %>
|
|
01984fb7 | Amos Benari | days - <%= @host.reports.recent(@range.days.ago).count %> reports found
|
|
</p>
|
|||
c6f1b718 | Ohad Levy | <% end -%>
|
|
01984fb7 | Amos Benari | </th>
|
|
<tr>
|
|||
<td>
|
|||
<div id="runtime_graph" class="host_chart"></div>
|
|||
</td>
|
|||
<td style="vertical-align: top; padding-top: 7px;">
|
|||
<%= render :partial => "hosts/overview", :locals => { :host => @host } %>
|
|||
</td>
|
|||
</tr>
|
|||
<tr>
|
|||
<td>
|
|||
<div id="resource_graph" class="host_chart"></div>
|
|||
</td>
|
|||
<td style="vertical-align: top;padding-top: 7px;">
|
|||
<% 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 -%>
|
|||
</td>
|
|||
</tr>
|
|||
</table>
|
|||
<%= render_runtime_chart 'runtime_graph', 'Runtime', "last #{@range} days", @host.runtime_chart(@range.days.ago) %>
|
|||
<%= render_report_status_chart 'resource_graph', 'Resources', "last #{@range} days", @host.resources_chart(@range.days.ago) %>
|