CLOUDSTACK-7766: Field Validations Missing for Ingress and Egress Rules

This commit is contained in:
Gabor Apati-Nagy 2014-10-28 19:06:14 +00:00 committed by Brian Federle
parent 1033990e91
commit 94b16b3bd5
2 changed files with 37 additions and 6 deletions

View File

@ -4747,11 +4747,19 @@
},
'startport': {
edit: true,
label: 'label.start.port'
label: 'label.start.port',
validation: {
number: true,
range: [0, 65535]
}
},
'endport': {
edit: true,
label: 'label.end.port'
label: 'label.end.port',
validation: {
number: true,
range: [0, 65535]
}
},
'icmptype': {
edit: true,
@ -4766,7 +4774,10 @@
'cidr': {
edit: true,
label: 'label.cidr',
isHidden: true
isHidden: true,
validation: {
ipv4cidr: true
}
},
'accountname': {
edit: true,
@ -4946,11 +4957,19 @@
},
'startport': {
edit: true,
label: 'label.start.port'
label: 'label.start.port',
validation: {
number: true,
range: [0, 65535]
}
},
'endport': {
edit: true,
label: 'label.end.port'
label: 'label.end.port',
validation: {
number: true,
range: [0, 65535]
}
},
'icmptype': {
edit: true,
@ -4965,7 +4984,10 @@
'cidr': {
edit: true,
label: 'label.cidr',
isHidden: true
isHidden: true,
validation: {
ipv4cidr: true
}
},
'accountname': {
edit: true,

View File

@ -992,6 +992,10 @@
.attr('disabled', field.isDisabled ? 'disabled' : false)
.appendTo($td);
if (field.validation) {
$td.find('input').first().data("validation-settings", field.validation );
}
if (field.isDisabled) $input.hide();
if (field.defaultValue) {
$input.val(field.defaultValue);
@ -1243,6 +1247,11 @@
$multiForm.validate();
var inputs = $multiForm.find('input');
$.each(inputs, function() {
if ($(this).data && $(this).data('validation-settings'))
$(this).rules('add', $(this).data('validation-settings'));
});
return this;
};