Skip to content

Commit 46758c4

Browse files
committed
Address UI
1 parent ac02a31 commit 46758c4

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

ui/public/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,6 +2090,7 @@
20902090
"label.source": "Select Import-Export Source Hypervisor",
20912091
"label.source.based": "SourceBased",
20922092
"label.sourcecidr": "Source CIDR",
2093+
"label.sourcecidrlist": "Source CIDR list",
20932094
"label.sourcehost": "Source host",
20942095
"label.sourceipaddress": "Source IP address",
20952096
"label.sourceipaddressnetworkid": "Network ID of source IP address",

ui/src/views/network/LoadBalancing.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</div>
3838
<div class="form">
3939
<div class="form__item" ref="newCidrList">
40-
<tooltip-label :title="$t('label.cidrlist')" bold :tooltip="createLoadBalancerRuleParams.cidrlist.description" :tooltip-placement="'right'"/>
40+
<tooltip-label :title="$t('label.sourcecidrlist')" bold :tooltip="createLoadBalancerRuleParams.cidrlist.description" :tooltip-placement="'right'"/>
4141
<a-input v-model:value="newRule.cidrlist"></a-input>
4242
</div>
4343
<div class="form__item">
@@ -808,7 +808,7 @@ export default {
808808
},
809809
{
810810
key: 'cidrlist',
811-
title: this.$t('label.cidrlist')
811+
title: this.$t('label.sourcecidrlist')
812812
},
813813
{
814814
key: 'protocol',

ui/src/views/network/PortForwarding.vue

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@
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>
@@ -108,6 +114,9 @@
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'
334343
import TooltipButton from '@/components/widgets/TooltipButton'
335344
import BulkActionView from '@/components/view/BulkActionView'
336345
import eventBus from '@/config/eventBus'
346+
import TooltipLabel from '@/components/widgets/TooltipLabel.vue'
337347
338348
export 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

Comments
 (0)