File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 47474747 } ,
47484748 'startport' : {
47494749 edit : true ,
4750- label : 'label.start.port'
4750+ label : 'label.start.port' ,
4751+ validation : {
4752+ number : true ,
4753+ range : [ 0 , 65535 ]
4754+ }
47514755 } ,
47524756 'endport' : {
47534757 edit : true ,
4754- label : 'label.end.port'
4758+ label : 'label.end.port' ,
4759+ validation : {
4760+ number : true ,
4761+ range : [ 0 , 65535 ]
4762+ }
47554763 } ,
47564764 'icmptype' : {
47574765 edit : true ,
47664774 'cidr' : {
47674775 edit : true ,
47684776 label : 'label.cidr' ,
4769- isHidden : true
4777+ isHidden : true ,
4778+ validation : {
4779+ ipv4cidr : true
4780+ }
47704781 } ,
47714782 'accountname' : {
47724783 edit : true ,
49464957 } ,
49474958 'startport' : {
49484959 edit : true ,
4949- label : 'label.start.port'
4960+ label : 'label.start.port' ,
4961+ validation : {
4962+ number : true ,
4963+ range : [ 0 , 65535 ]
4964+ }
49504965 } ,
49514966 'endport' : {
49524967 edit : true ,
4953- label : 'label.end.port'
4968+ label : 'label.end.port' ,
4969+ validation : {
4970+ number : true ,
4971+ range : [ 0 , 65535 ]
4972+ }
49544973 } ,
49554974 'icmptype' : {
49564975 edit : true ,
49654984 'cidr' : {
49664985 edit : true ,
49674986 label : 'label.cidr' ,
4968- isHidden : true
4987+ isHidden : true ,
4988+ validation : {
4989+ ipv4cidr : true
4990+ }
49694991 } ,
49704992 'accountname' : {
49714993 edit : true ,
Original file line number Diff line number Diff line change 992992 . attr ( 'disabled' , field . isDisabled ? 'disabled' : false )
993993 . appendTo ( $td ) ;
994994
995+ if ( field . validation ) {
996+ $td . find ( 'input' ) . first ( ) . data ( "validation-settings" , field . validation ) ;
997+ }
998+
995999 if ( field . isDisabled ) $input . hide ( ) ;
9961000 if ( field . defaultValue ) {
9971001 $input . val ( field . defaultValue ) ;
12431247
12441248 $multiForm . validate ( ) ;
12451249
1250+ var inputs = $multiForm . find ( 'input' ) ;
1251+ $ . each ( inputs , function ( ) {
1252+ if ( $ ( this ) . data && $ ( this ) . data ( 'validation-settings' ) )
1253+ $ ( this ) . rules ( 'add' , $ ( this ) . data ( 'validation-settings' ) ) ;
1254+ } ) ;
12461255 return this ;
12471256 } ;
12481257
You can’t perform that action at this time.
0 commit comments