mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
Feature #3748: Fix bug in flow templates info.js
This commit is contained in:
parent
30675702c3
commit
1bab54b271
@ -52,35 +52,37 @@ define(function(require) {
|
||||
|
||||
var customAttrs = [];
|
||||
|
||||
$.each(this.element.TEMPLATE.BODY['custom_attrs'], function(key, attr){
|
||||
var parts = attr.split("|");
|
||||
// 0 mandatory; 1 type; 2 desc;
|
||||
if ( ! $.isEmptyObject( this.element.TEMPLATE.BODY['custom_attrs'] ) ) {
|
||||
$.each(this.element.TEMPLATE.BODY['custom_attrs'], function(key, attr){
|
||||
var parts = attr.split("|");
|
||||
// 0 mandatory; 1 type; 2 desc;
|
||||
|
||||
var roles_using_net = [];
|
||||
var roles_using_net = [];
|
||||
|
||||
switch (parts[1]) {
|
||||
case "vnet_id":
|
||||
$.each(that.element.TEMPLATE.BODY.roles, function(index, value){
|
||||
if (value.vm_template_contents){
|
||||
var reg = new RegExp("\\$"+TemplateUtils.htmlDecode(key)+"\\b");
|
||||
switch (parts[1]) {
|
||||
case "vnet_id":
|
||||
$.each(that.element.TEMPLATE.BODY.roles, function(index, value){
|
||||
if (value.vm_template_contents){
|
||||
var reg = new RegExp("\\$"+TemplateUtils.htmlDecode(key)+"\\b");
|
||||
|
||||
if(reg.exec(value.vm_template_contents) != null){
|
||||
roles_using_net.push(value.name);
|
||||
if(reg.exec(value.vm_template_contents) != null){
|
||||
roles_using_net.push(value.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
customAttrs.push({
|
||||
"name": key,
|
||||
"mandatory": parts[0],
|
||||
"type": parts[1],
|
||||
"description": parts[2],
|
||||
"roles": roles_using_net.join(", ")
|
||||
customAttrs.push({
|
||||
"name": key,
|
||||
"mandatory": parts[0],
|
||||
"type": parts[1],
|
||||
"description": parts[2],
|
||||
"roles": roles_using_net.join(", ")
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return TemplateHTML({
|
||||
'element': this.element,
|
||||
|
Loading…
x
Reference in New Issue
Block a user