File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 4848 </ a-select >
4949 </ a-form-item >
5050 < a-form-item label ='{{ i18n "pages.xray.outbound.city" }} ' v-if ="nordModal.cities.length > 0 ">
51- < a-select v-model ="nordModal.cityId " show-search option-filter-prop ="label ">
51+ < a-select v-model ="nordModal.cityId " @change =" onCityChange " show-search option-filter-prop ="label ">
5252 < a-select-option :key ="0 " :value ="null " label ='{{ i18n "pages.xray.outbound.allCities" }} '>
5353 {{ i18n "pages.xray.outbound.allCities" }}
5454 </ a-select-option >
182182 return s ;
183183 } ) . sort ( ( a , b ) => a . load - b . load ) ;
184184
185+ if ( this . servers . length > 0 ) {
186+ this . serverId = this . servers [ 0 ] . id ;
187+ }
188+
185189 if ( this . servers . length === 0 ) {
186190 app . $message . warning ( 'No servers found for the selected country' ) ;
187191 }
276280 fetchServers : ( ) => nordModal . fetchServers ( ) ,
277281 addOutbound : ( ) => nordModal . addOutbound ( ) ,
278282 resetOutbound ( ) { nordModal . resetOutbound ( this . nordOutboundIndex ) } ,
283+ onCityChange ( ) {
284+ if ( this . filteredServers . length > 0 ) {
285+ this . nordModal . serverId = this . filteredServers [ 0 ] . id ;
286+ } else {
287+ this . nordModal . serverId = null ;
288+ }
289+ }
279290 } ,
280291 computed : {
281292 nordOutboundIndex : {
You can’t perform that action at this time.
0 commit comments