7272 <a-select-option value =" udp" :label =" $t('label.udp')" >{{ $t('label.udp') }}</a-select-option >
7373 </a-select >
7474 </div >
75+ <div v-if =" isVPC()" >
76+ <div class =" form__item" ref =" newCidrList" >
77+ <tooltip-label :title =" $t('label.sourcecidrlist')" bold :tooltip =" apiParams.cidrlist.description" :tooltip-placement =" 'right'" />
78+ <a-input v-model:value =" newRule.cidrlist" ></a-input >
79+ </div >
80+ </div >
7581 <div class =" form__item" style =" margin-left : auto ;" >
7682 <div class =" form__label" >{{ $t('label.add.vm') }}</div >
7783 <a-button :disabled =" !('createPortForwardingRule' in $store.getters.apis)" type =" primary" @click =" openAddVMModal" >{{ $t('label.add') }}</a-button >
108114 <template v-if =" column .key === ' protocol' " >
109115 {{ getCapitalise(record.protocol) }}
110116 </template >
117+ <template v-if =" column .key === ' cidrlist' " >
118+ <span style =" white-space : pre-line " > {{ record.cidrlist?.replaceAll(" ", "\n") }}</span >
119+ </template >
111120 <template v-if =" column .key === ' vm' " >
112121 <div ><desktop-outlined />
113122 <router-link
@@ -334,9 +343,11 @@ import Status from '@/components/widgets/Status'
334343import TooltipButton from ' @/components/widgets/TooltipButton'
335344import BulkActionView from ' @/components/view/BulkActionView'
336345import eventBus from ' @/config/eventBus'
346+ import TooltipLabel from ' @/components/widgets/TooltipLabel.vue'
337347
338348export default {
339349 components: {
350+ TooltipLabel,
340351 Status,
341352 TooltipButton,
342353 BulkActionView
@@ -399,6 +410,11 @@ export default {
399410 key: ' protocol' ,
400411 title: this .$t (' label.protocol' )
401412 },
413+ {
414+ key: ' cidrlist' ,
415+ title: this .$t (' label.sourcecidrlist' ),
416+ hidden: ! this .isVPC ()
417+ },
402418 {
403419 title: this .$t (' label.state' ),
404420 dataIndex: ' state'
@@ -411,7 +427,7 @@ export default {
411427 key: ' actions' ,
412428 title: this .$t (' label.actions' )
413429 }
414- ],
430+ ]. filter ( item => ! item . hidden ) ,
415431 tiers: {
416432 loading: false ,
417433 data: []
@@ -450,14 +466,18 @@ export default {
450466 vmPage: 1 ,
451467 vmPageSize: 10 ,
452468 vmCount: 0 ,
453- searchQuery: null
469+ searchQuery: null ,
470+ cidrlist: ' '
454471 }
455472 },
456473 computed: {
457474 hasSelected () {
458475 return this .selectedRowKeys .length > 0
459476 }
460477 },
478+ beforeCreate () {
479+ this .apiParams = this .$getApiParams (' createPortForwardingRule' )
480+ },
461481 created () {
462482 console .log (this .resource )
463483 this .initForm ()
@@ -830,6 +850,9 @@ export default {
830850 onSearch (value ) {
831851 this .searchQuery = value
832852 this .fetchVirtualMachines ()
853+ },
854+ isVPC () {
855+ return ' vpcid' in this .resource
833856 }
834857 }
835858}
0 commit comments