Feature #2288 » add-quota-support.patch
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|
|
||
... | ... | |
def quota(id,opts={})
|
||
end
|
||
def default_quota_id
|
||
self.quotas.each do |q|
|
||
return q.id if self.name == q.name
|
||
end
|
||
end
|
||
def update_required?(old_attrs, new_attrs)
|
||
old_attrs.merge(new_attrs) do |k,old_v,new_v|
|
||
update_required?(old_v, new_v) if old_v.is_a?(Hash)
|
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
|
foreman/app/assets/javascripts/compute_resource.js 2013-06-28 12:40:39.186143603 -0400 | ||
---|---|---|
});
|
||
}
|
||
function ovirt_quotaSelected(item) {
|
||
var qid = $(item).val();
|
||
$("#host_compute_attributes_volumes_attributes_new_volumes_quota option").each(function() {
|
||
opt = $(this)
|
||
if(opt[0].value == qid) {
|
||
opt.attr("selected","selected");
|
||
} else {
|
||
opt.attr("selected", false);
|
||
}
|
||
});
|
||
}
|
||
function ovirt_hwpSelected(item){
|
||
var hwp = $(item).val();
|
||
var url = $(item).attr('data-url');
|
||
... | ... | |
disable_element($('[id$='+new_id+'_size_gb]').val(item.size_gb));
|
||
disable_element($('[id$='+new_id+'_storage_domain]').val(item.storage_domain));
|
||
disable_element( $('[id$='+new_id+'_bootable_true]').attr('checked', item.bootable));
|
||
if (item.quote != '') {
|
||
disable_element($('[id$='+new_id+'_quota]').val(item.quota));
|
||
}
|
||
$('[id$='+new_id+'_id]').val(7);
|
||
$('[id$='+new_id+'_storage_domain]').next().hide();
|
||
}
|
foreman/app/views/compute_resources_vms/form/ovirt/_volume.html.erb 2013-06-28 12:01:39.640678618 -0400 | ||
---|---|---|
<%= 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, {:selected => compute_resource.default_quota_id},
|
||
{ :onchange => 'ovirt_quotaSelected(this);', :help_inline => image_tag('spinner.gif', :id => 'quota_indicator', :class => 'hide').html_safe, :help_block => "Quota to use"} %>
|
||
<%= f.hidden_field :storage_domain if disabled %>
|
||
<%= f.hidden_field :id %>
|
||
<%= field(f, :bootable, :label => _('Bootable')) do
|
foreman/app/views/compute_resources_vms/form/_ovirt.html.erb 2013-06-28 12:02:53.543172342 -0400 | ||
---|---|---|
:onchange => 'ovirt_clusterSelected(this);',
|
||
:help_inline => :indicator } %>
|
||
<%= f.hidden_field :cluster if !new %>
|
||
<%= select_f f, :quota, compute_resource.quotas, :id, :name, {:selected => compute_resource.default_quota_id},
|
||
{ :onchange => 'ovirt_quotaSelected(this);', :help_inline => image_tag('spinner.gif', :id => 'quota_indicator', :class => 'hide').html_safe,
|
||
:help_block => "Quota to use"} %>
|
||
<%= select_f f, :template, compute_resource.hardware_profiles, :id, :name, {:include_blank => _("Select template")},
|
||
{ :disabled => !new, :'data-url' => hardware_profile_selected_compute_resource_path(compute_resource),
|
||
:onchange => 'ovirt_hwpSelected(this);',
|
- « Previous
- 1
- 2
- 3
- 4
- Next »