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

F #4968: Disable vnet when instantiate flow (#462)

This commit is contained in:
Sergio Betanzos 2020-11-23 15:34:48 +01:00 committed by GitHub
parent 4c397cf015
commit 189c610e80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 61 additions and 17 deletions

View File

@ -96,6 +96,9 @@ features:
deploy_enforce: false
migrate_enforce: false
# True to show the network configuration to instantiate Service template
show_vnet_instantiate_flow: true
tabs:
dashboard-tab:
# The following widgets can be used inside any of the '_per_row' settings

View File

@ -38,6 +38,9 @@ features:
show_attach_disk_advanced: true
show_attach_nic_advanced: true
# True to show the network configuration to instantiate Service template
show_vnet_instantiate_flow: true
tabs:
provision-tab:
panel_tabs:

View File

@ -96,6 +96,9 @@ features:
deploy_enforce: false
migrate_enforce: false
# True to show the network configuration to instantiate Service template
show_vnet_instantiate_flow: true
tabs:
dashboard-tab:
# The following widgets can be used inside any of the '_per_row' settings

View File

@ -90,6 +90,9 @@ features:
deploy_enforce: false
migrate_enforce: false
# True to show the network configuration to instantiate Service template
show_vnet_instantiate_flow: true
tabs:
dashboard-tab:
# The following widgets can be used inside any of the '_per_row' settings

View File

@ -96,6 +96,9 @@ features:
deploy_enforce: false
migrate_enforce: false
# True to show the network configuration to instantiate Service template
show_vnet_instantiate_flow: true
tabs:
dashboard-tab:
# The following widgets can be used inside any of the '_per_row' settings

View File

@ -38,6 +38,9 @@ features:
show_attach_disk_advanced: true
show_attach_nic_advanced: true
# True to show the network configuration to instantiate Service template
show_vnet_instantiate_flow: true
tabs:
provision-tab:
panel_tabs:

View File

@ -96,6 +96,9 @@ features:
deploy_enforce: false
migrate_enforce: false
# True to show the network configuration to instantiate Service template
show_vnet_instantiate_flow: true
tabs:
dashboard-tab:
# The following widgets can be used inside any of the '_per_row' settings

View File

@ -90,6 +90,9 @@ features:
deploy_enforce: false
migrate_enforce: false
# True to show the network configuration to instantiate Service template
show_vnet_instantiate_flow: true
tabs:
dashboard-tab:
# The following widgets can be used inside any of the '_per_row' settings

View File

@ -96,6 +96,9 @@ features:
deploy_enforce: false
migrate_enforce: false
# True to show the network configuration to instantiate Service template
show_vnet_instantiate_flow: true
tabs:
dashboard-tab:
# The following widgets can be used inside any of the '_per_row' settings

View File

@ -38,6 +38,9 @@ features:
show_attach_disk_advanced: true
show_attach_nic_advanced: true
# True to show the network configuration to instantiate Service template
show_vnet_instantiate_flow: true
tabs:
provision-tab:
panel_tabs:

View File

@ -96,6 +96,9 @@ features:
deploy_enforce: false
migrate_enforce: false
# True to show the network configuration to instantiate Service template
show_vnet_instantiate_flow: true
tabs:
dashboard-tab:
# The following widgets can be used inside any of the '_per_row' settings

View File

@ -90,6 +90,9 @@ features:
deploy_enforce: false
migrate_enforce: false
# True to show the network configuration to instantiate Service template
show_vnet_instantiate_flow: true
tabs:
dashboard-tab:
# The following widgets can be used inside any of the '_per_row' settings

View File

@ -170,9 +170,9 @@ define(function(require) {
$("#instantiate_service_user_inputs", context).empty();
UserInputs.serviceTemplateInsert(
$("#instantiate_service_user_inputs", context),
template_json, {
select_networks: true
});
template_json,
{ select_networks: Config.isFeatureEnabled("show_vnet_instantiate_flow") }
);
n_roles = template_json.DOCUMENT.TEMPLATE.BODY.roles.length;
n_roles_done = 0;
var total_cost = 0;
@ -288,7 +288,10 @@ define(function(require) {
n_times_int=parseInt(n_times,10);
}
var extra_info = ServiceUtils.getExtraInfo(context);
var extra_info = ServiceUtils.getExtraInfo(
context,
Config.isFeatureEnabled("show_vnet_instantiate_flow")
);
if(
that &&

View File

@ -1296,7 +1296,10 @@ define(function(require) {
if (body.custom_attrs || body.networks) {
UserInputs.serviceTemplateInsert(
$(".provision_network_selector", context), data);
$(".provision_network_selector", context),
data,
{ select_networks: Config.isFeatureEnabled("show_vnet_instantiate_flow") }
);
} else {
$(".provision_network_selector", context).html("");
$(".provision_custom_attributes_selector", context).html("");
@ -1377,7 +1380,7 @@ define(function(require) {
return false;
}
var extra_info = ServiceUtils.getExtraInfo(context);
var extra_info = ServiceUtils.getExtraInfo(context, Config.isFeatureEnabled("show_vnet_instantiate_flow"));
$(".provision_create_flow_role", context).each(function(){
var user_inputs_values = WizardFields.retrieve($(".provision_custom_attributes_selector", $(this)));

View File

@ -21,14 +21,14 @@ define(function(require) {
"getExtraInfo": _getExtraInfo
};
function _getExtraInfo(context) {
var custom_attrs_json = WizardFields.retrieve(
function _getExtraInfo(context, show_vnet_instantiate_flow) {
var custom_attrs_values = WizardFields.retrieve(
$("#instantiate_service_user_inputs .custom_attr_class", context)
);
var networks_json = WizardFields.retrieve($(".network_attrs_class", context));
var typePrefix = "type_";
var network_values = Object.keys(networks_json).filter(function(key) {
return key.indexOf(typePrefix) == 0; // get all networks names with prefix 'type_'
}).reduce(function(networks, typeKey) {
@ -36,21 +36,22 @@ define(function(require) {
var name = typeKey.replace(typePrefix, '');
var id = networks_json[name]
var extra = networks_json['extra_' + name];
networks.push($.extend(true, {},{
[name]: {
[type]: id, // type configuration: id network/template
extra: (extra && extra !== "") ? extra : undefined,
},
}));
return networks;
}, []);
return { "merge_template": {
"custom_attrs_values": custom_attrs_json,
"networks_values": network_values,
"roles": []
}};
return {
"merge_template": Object.assign(
{ custom_attrs_values, "roles": [] },
show_vnet_instantiate_flow ? { network_values } : null
)
};
}
});

View File

@ -266,7 +266,8 @@ define(function(require) {
template_json.DOCUMENT &&
template_json.DOCUMENT.TEMPLATE &&
template_json.DOCUMENT.TEMPLATE.BODY &&
template_json.DOCUMENT.TEMPLATE.BODY.networks
template_json.DOCUMENT.TEMPLATE.BODY.networks &&
opts.select_networks
){
opts.networks = template_json.DOCUMENT.TEMPLATE.BODY.networks;
}