Project

General

Profile

« Previous | Next » 

Revision c45a0014

Added by Ohad Levy over 12 years ago

  • ID c45a0014cee4b8a530ab25beb9a7b1eb5cd7b037

fixes #1167 - some setting values are ignored

View differences:

app/views/hosts/show.html.erb
<%= icon(@host.os) + @host.to_label %>
</div>
<span class="title_action">
<%= display_link_if_authorized "Edit", hash_for_edit_host_path(:id => @host), :title => "Edit your host" %>
<%= display_link_if_authorized "Facts", hash_for_host_facts_path(:host_id => @host), :title => "Browse host facts" %>
<%= display_link_if_authorized "Reports", hash_for_host_reports_path(:host_id => @host), :title => "Browse host reports" %>
<%= 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" %>
<%= link_to "YAML", externalNodes_host_path(:id => @host), :title => "Puppet external nodes YAML dump" %>
<% unless @host.build -%>
<%= display_link_if_authorized "Build", hash_for_setBuild_host_path(:id => @host).merge(:enable_link => @host.can_be_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 -%>
<%= display_link_if_authorized "Cancel Build", hash_for_cancelBuild_host_path(:id => @host).merge(:enable_link => !@host.can_be_build?),
<%= 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 -%>
<%= display_link_if_authorized "Run puppet", hash_for_puppetrun_host_path(:id => @host).merge(:auth_action => :edit, :enable_link => Setting[:puppetrun]),
<%= 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" %>
<%= display_link_if_authorized "All Puppet Classes", hash_for_storeconfig_klasses_host_path(:id => @host).merge(:auth_action => :read, :enable_link => @host.resources.count > 0),
<%= 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" %>
<%= display_link_if_authorized "Delete", hash_for_host_path(:id => @host, :auth_action => :destroy), :confirm => 'Are you sure?', :method => :delete %>
<%= link_to_if_authorized "Delete", hash_for_host_path(:id => @host, :auth_action => :destroy), :confirm => 'Are you sure?', :method => :delete %>
</span>
<table>
......
<%= form_tag @host, :id => 'days_filter', :method => :get %>
<p>Reports from the last
<%= select(nil, 'range', 1..days_ago(@host.reports.first.reported_at),
{ :selected => @range }, { :onchange =>"$('#days_filter').submit();$(this).disable();" }) %>
{ :selected => @range }, { :onchange =>"$('#days_filter').submit();$(this).disabled();" }) %>
days - <%= @host.reports.recent(@range.days.ago).count %> reports found
</p>
<% end -%>

Also available in: Unified diff