mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7766: Field Validations Missing for Ingress and Egress Rules
(cherry picked from commit 94b16b3bd5)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
0b317ea06d
commit
ca8ecc0470
|
|
@ -4459,11 +4459,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,
|
||||
|
|
@ -4478,7 +4486,10 @@
|
|||
'cidr': {
|
||||
edit: true,
|
||||
label: 'label.cidr',
|
||||
isHidden: true
|
||||
isHidden: true,
|
||||
validation: {
|
||||
ipv4cidr: true
|
||||
}
|
||||
},
|
||||
'accountname': {
|
||||
edit: true,
|
||||
|
|
@ -4654,11 +4665,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,
|
||||
|
|
@ -4673,7 +4692,10 @@
|
|||
'cidr': {
|
||||
edit: true,
|
||||
label: 'label.cidr',
|
||||
isHidden: true
|
||||
isHidden: true,
|
||||
validation: {
|
||||
ipv4cidr: true
|
||||
}
|
||||
},
|
||||
'accountname': {
|
||||
edit: true,
|
||||
|
|
|
|||
|
|
@ -971,6 +971,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);
|
||||
|
|
@ -1222,6 +1226,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;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue