1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

feature #3357: Add option to disable capacity and network select

(cherry picked from commit 34e1a2931ebb94a175a422dede65771c422e9704)
This commit is contained in:
Daniel Molina 2014-12-18 17:27:12 +01:00
parent 1c9a2ecc0a
commit d6d6a47d78
4 changed files with 41 additions and 18 deletions

View File

@ -8,6 +8,7 @@ tabs:
panel_tabs:
users: false
flows: true
templates: true
actions:
Template.chmod: false
Template.delete: true
@ -17,3 +18,6 @@ tabs:
vdcquotas: false
vdcvms: false
users: false
create_vm:
capacity_select: true
network_select: true

View File

@ -8,6 +8,7 @@ tabs:
panel_tabs:
users: true
flows: true
templates: true
actions:
Template.chmod: true
Template.delete: true
@ -17,3 +18,6 @@ tabs:
vdcquotas: true
vdcvms: true
users: true
create_vm:
capacity_select: true
network_select: true

View File

@ -106,6 +106,15 @@ Config = {
}
}
},
"create_vm": {
"isEnabled": function(widget) {
if (config['view']['tabs']['provision-tab'] && config['view']['tabs']['provision-tab']["create_vm"]){
return config['view']['tabs']['provision-tab']['create_vm'][widget];
} else {
return false;
}
}
},
"logo": (config['view']["provision_logo"] || "images/one_small_logo.png")
}
}

View File

@ -554,14 +554,16 @@ var provision_create_vm = '<form id="provision_create_vm" class="hidden section_
'<br>'+
'<div class="row">'+
'<div class="large-10 large-centered columns">'+
'<div class="provision_capacity_selector">'+
'</div>'+
'<br>'+
'<br>'+
'<div class="provision_network_selector">'+
'</div>'+
'<br>'+
'<br>'+
(Config.provision.create_vm.isEnabled("capacity_select") ?
'<div class="provision_capacity_selector">'+
'</div>'+
'<br>'+
'<br>' : '') +
(Config.provision.create_vm.isEnabled("network_select") ?
'<div class="provision_network_selector">'+
'</div>'+
'<br>'+
'<br>' : '') +
'<div class="provision_custom_attributes_selector">'+
'</div>'+
'</div>'+
@ -6293,18 +6295,22 @@ $(document).ready(function(){
$(".provision_accordion_template a").first().trigger("click");
generate_provision_instance_type_accordion(
$(".provision_capacity_selector", create_vm_context),
template_json.VMTEMPLATE.TEMPLATE);
if (Config.provision.create_vm.isEnabled("capacity_select")) {
generate_provision_instance_type_accordion(
$(".provision_capacity_selector", create_vm_context),
template_json.VMTEMPLATE.TEMPLATE);
};
generate_provision_network_accordion(
$(".provision_network_selector", create_vm_context));
if (Config.provision.create_vm.isEnabled("network_select")) {
generate_provision_network_accordion(
$(".provision_network_selector", create_vm_context));
$.each(nics, function(index, nic){
generate_provision_network_table(
$(".provision_nic_accordion", create_vm_context),
nic);
})
$.each(nics, function(index, nic){
generate_provision_network_table(
$(".provision_nic_accordion", create_vm_context),
nic);
})
}
if (template_json.VMTEMPLATE.TEMPLATE.USER_INPUTS) {
generate_custom_attrs(