File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44594459 } ,
44604460 'startport' : {
44614461 edit : true ,
4462- label : 'label.start.port'
4462+ label : 'label.start.port' ,
4463+ validation : {
4464+ number : true ,
4465+ range : [ 0 , 65535 ]
4466+ }
44634467 } ,
44644468 'endport' : {
44654469 edit : true ,
4466- label : 'label.end.port'
4470+ label : 'label.end.port' ,
4471+ validation : {
4472+ number : true ,
4473+ range : [ 0 , 65535 ]
4474+ }
44674475 } ,
44684476 'icmptype' : {
44694477 edit : true ,
44784486 'cidr' : {
44794487 edit : true ,
44804488 label : 'label.cidr' ,
4481- isHidden : true
4489+ isHidden : true ,
4490+ validation : {
4491+ ipv4cidr : true
4492+ }
44824493 } ,
44834494 'accountname' : {
44844495 edit : true ,
46544665 } ,
46554666 'startport' : {
46564667 edit : true ,
4657- label : 'label.start.port'
4668+ label : 'label.start.port' ,
4669+ validation : {
4670+ number : true ,
4671+ range : [ 0 , 65535 ]
4672+ }
46584673 } ,
46594674 'endport' : {
46604675 edit : true ,
4661- label : 'label.end.port'
4676+ label : 'label.end.port' ,
4677+ validation : {
4678+ number : true ,
4679+ range : [ 0 , 65535 ]
4680+ }
46624681 } ,
46634682 'icmptype' : {
46644683 edit : true ,
46734692 'cidr' : {
46744693 edit : true ,
46754694 label : 'label.cidr' ,
4676- isHidden : true
4695+ isHidden : true ,
4696+ validation : {
4697+ ipv4cidr : true
4698+ }
46774699 } ,
46784700 'accountname' : {
46794701 edit : true ,
Original file line number Diff line number Diff line change 971971 . attr ( 'disabled' , field . isDisabled ? 'disabled' : false )
972972 . appendTo ( $td ) ;
973973
974+ if ( field . validation ) {
975+ $td . find ( 'input' ) . first ( ) . data ( "validation-settings" , field . validation ) ;
976+ }
977+
974978 if ( field . isDisabled ) $input . hide ( ) ;
975979 if ( field . defaultValue ) {
976980 $input . val ( field . defaultValue ) ;
12221226
12231227 $multiForm . validate ( ) ;
12241228
1229+ var inputs = $multiForm . find ( 'input' ) ;
1230+ $ . each ( inputs , function ( ) {
1231+ if ( $ ( this ) . data && $ ( this ) . data ( 'validation-settings' ) )
1232+ $ ( this ) . rules ( 'add' , $ ( this ) . data ( 'validation-settings' ) ) ;
1233+ } ) ;
12251234 return this ;
12261235 } ;
12271236
You can’t perform that action at this time.
0 commit comments