Revision 82e47ae0
Added by Amos Benari about 12 years ago
- ID 82e47ae0f86994702c3a084cc6150250a81034ee
app/views/hosts/show.html.erb | ||
---|---|---|
:title => "Cancel build request for this host")
|
||
end,
|
||
if @host.compute_resource_id
|
||
vm = @host.compute_resource.find_vm_by_uuid(@host.uuid)
|
||
html_opts = vm.ready? ? { :confirm => 'Are you sure?', :class => "btn danger" } : { :class => "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)
|
||
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.ready?, :class => "btn info"}
|
||
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 danger", :confirm => 'Are you sure?', :method => :delete)
|
||
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} %>
|
||
|
||
... | ... | |
<%= 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="list">
|
||
<table class="table table-bordered table-striped table-condensed">
|
||
<tr><th>Templates</th></tr>
|
||
<tr><td><%= show_templates -%></td></tr>
|
||
</table>
|
Also available in: Unified diff
updates UI to bootstrap v2