File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,7 +128,8 @@ export default {
128128 label: 'WebProxy',
129129 field: 'WebProxy',
130130 placeholder: '',
131- type: 'InputText'
131+ type: 'InputText',
132+ validator: Validators.url
132133 },
133134 {
134135 label: 'WebProxyPassword',
Original file line number Diff line number Diff line change @@ -126,6 +126,24 @@ export default {
126126
127127 return err ;
128128 } ,
129+ url ( value , schema ) {
130+ const emptyError = checkEmpty ( value , schema . required ) ;
131+ if ( ! isNil ( emptyError ) ) return emptyError ;
132+
133+ const err = [ ] ;
134+
135+ if ( ! isString ( value ) ) {
136+ err . push ( 'This is not a text!' ) ;
137+ } else {
138+ try {
139+ new URL ( value ) ;
140+ } catch {
141+ err . push ( 'This is not a valid URL!' ) ;
142+ }
143+ }
144+
145+ return err ;
146+ } ,
129147 tradeToken : limitedString ( 8 , 8 ) ,
130148 byte : limitedNumber ( 0 , 255 ) ,
131149 ushort : limitedNumber ( 0 , 65535 ) ,
You can’t perform that action at this time.
0 commit comments