Project

General

Profile

Feature #2288 » foreman.patch

Foreman Patch - Anonymous, 03/08/2013 01:32 PM

View differences:

foreman/app/models/compute_resource.rb 2013-03-08 05:23:07.701022850 -0500
def hardware_profile(id,opts={})
end
def quotas(opts={})
end
def quota(id,opts={})
end
def update_required?(old_attrs, new_attrs)
old_attrs.merge(new_attrs) do |k,old_v,new_v|
foreman/app/views/compute_resources_vms/form/ovirt/_volume.html.erb 2013-03-08 18:15:24.145000096 -0500
<%= select_f f, :storage_domain, compute_resource.storage_domains, :id, :name,
{ }, :label => 'Storage Domain', :disabled => disabled, :class => "span2",
:help_inline=> remove_child_link("X", f, { :method => :'_delete', :title => 'remove volume', :class => 'label label-important' }) %>
<%= select_f f, :quota, compute_resource.quotas, :id, :name, {},
{ :help_inline => image_tag('spinner.gif', :id => 'quota_indicator', :class => 'hide').html_safe, :help_block => "Quota to use"} %>
<%= f.hidden_field :quota if disabled %>
<%= f.hidden_field :storage_domain if disabled %>
<%= f.hidden_field :id %>
<%= field(f, :bootable, :label => 'Bootable') do
......
end %>
<% end -%>
</div>
</div>
</div>
foreman/app/views/compute_resources_vms/form/_ovirt.html.erb 2013-03-08 18:14:34.524000076 -0500
:onchange => 'ovirt_clusterSelected(this);',
:help_inline => image_tag('spinner.gif', :id => 'cluster_indicator', :class => 'hide').html_safe } %>
<%= f.hidden_field :cluster if !new %>
<%= select_f f, :quota, compute_resource.quotas, :id, :name, {},
{ :help_inline => image_tag('spinner.gif', :id => 'quota_indicator', :class => 'hide').html_safe,
:help_block => "Quota to use"} %>
<%= f.hidden_field :quota if !new %>
<%= select_f f, :template, compute_resource.hardware_profiles, :id, :name, {},
{ :disabled => !new, :'data-url' => hardware_profile_selected_compute_resource_path(compute_resource),
:onchange => 'ovirt_hwpSelected(this);',
foreman/lib/foreman/model/ovirt.rb 2013-03-08 11:10:07.290000100 -0500
16*1024*1024*1024
end
def quotas
client.quotas
end
def quota(id)
client.quota.get(id) || raise(ActiveRecord::RecordNotFound)
end
def hardware_profiles(opts={})
client.templates
end
(2-2/4)