1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-07 17:17:41 +03:00

Bug #3095: Use -2 (unlimited) if no quotas are provided in the vdcadmin view

This commit is contained in:
Daniel Molina 2014-07-25 15:42:14 +02:00
parent 459b79dcfe
commit 8e86a1973f
2 changed files with 14 additions and 10 deletions

View File

@ -124,7 +124,7 @@ function create_group_tmpl(dialog_name){
<div class="large-12 columns">\
<label>\
<input type="checkbox" id="shared_resources" name="shared_resources" value="YES" />\
'+tr("Allow users to view the VMs of other users in the same group")+'\
'+tr("Allow users to view the VMs a Services of other users in the same group")+'\
<span class="tip">'+tr("An ACL Rule will be created to give users in this group access to all the resources in the same group.")+'</span>\
</label>\
</div>\

View File

@ -1754,9 +1754,9 @@ var povision_actions = {
Sunstone.runAction("Provision.User.set_quota", [response.USER.ID], {
"VM" : {
"VOLATILE_SIZE":"-1",
"VMS": $("#provision_rvms_quota_input").val()||0,
"MEMORY": $("#provision_memory_quota_input").val()||0,
"CPU": $("#provision_cpu_quota_input").val()||0}
"VMS": $("#provision_rvms_quota_input").val()||QUOTA_LIMIT_UNLIMITED,
"MEMORY": $("#provision_memory_quota_input").val()||QUOTA_LIMIT_UNLIMITED,
"CPU": $("#provision_cpu_quota_input").val()||QUOTA_LIMIT_UNLIMITED}
});
},
error: onError
@ -5432,9 +5432,13 @@ function setup_provision_user_info(context) {
var quotas_str = $(".provision_info_vdc_user", context).attr("quotas");
if (quotas_str) {
var quotas = JSON.parse(quotas_str);
provision_rvms_quota_vdc_info_input.val(quotas.VM.VMS).change();
provision_cpu_quota_vdc_info_input.val(quotas.VM.CPU).change();
provision_memory_quota_vdc_info_tmp_input.val(Math.floor(quotas.VM.MEMORY/1024)).change();
var rvms_quotas = (quotas.VM.VMS == QUOTA_LIMIT_UNLIMITED ? "" : quotas.VM.VMS)
var cpu_quotas = (quotas.VM.CPU == QUOTA_LIMIT_UNLIMITED ? "" : quotas.VM.CPU)
var memory_quotas = (quotas.VM.MEMORY == QUOTA_LIMIT_UNLIMITED ? "" : Math.floor(quotas.VM.MEMORY/1024))
provision_rvms_quota_vdc_info_input.val(rvms_quotas).change();
provision_cpu_quota_vdc_info_input.val(cpu_quotas).change();
provision_memory_quota_vdc_info_tmp_input.val(memory_quotas).change();
}
});
@ -5469,9 +5473,9 @@ function setup_provision_user_info(context) {
extra_param: {
"VM" : {
"VOLATILE_SIZE":"-1",
"VMS": $(".provision_rvms_quota_vdc_info_input", context).val()||0,
"MEMORY": $(".provision_memory_quota_vdc_info_input", context).val()||0,
"CPU": $(".provision_cpu_quota_vdc_info_input", context).val()||0}
"VMS": $(".provision_rvms_quota_vdc_info_input", context).val()||QUOTA_LIMIT_UNLIMITED,
"MEMORY": $(".provision_memory_quota_vdc_info_input", context).val()||QUOTA_LIMIT_UNLIMITED,
"CPU": $(".provision_cpu_quota_vdc_info_input", context).val()||QUOTA_LIMIT_UNLIMITED}
}
},
success: function(request, response){