Skip to content

Commit

Permalink
Address UI
Browse files Browse the repository at this point in the history
  • Loading branch information
winterhazel committed Oct 21, 2024
1 parent ac02a31 commit 46758c4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2090,6 +2090,7 @@
"label.source": "Select Import-Export Source Hypervisor",
"label.source.based": "SourceBased",
"label.sourcecidr": "Source CIDR",
"label.sourcecidrlist": "Source CIDR list",
"label.sourcehost": "Source host",
"label.sourceipaddress": "Source IP address",
"label.sourceipaddressnetworkid": "Network ID of source IP address",
Expand Down
4 changes: 2 additions & 2 deletions ui/src/views/network/LoadBalancing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</div>
<div class="form">
<div class="form__item" ref="newCidrList">
<tooltip-label :title="$t('label.cidrlist')" bold :tooltip="createLoadBalancerRuleParams.cidrlist.description" :tooltip-placement="'right'"/>
<tooltip-label :title="$t('label.sourcecidrlist')" bold :tooltip="createLoadBalancerRuleParams.cidrlist.description" :tooltip-placement="'right'"/>
<a-input v-model:value="newRule.cidrlist"></a-input>
</div>
<div class="form__item">
Expand Down Expand Up @@ -808,7 +808,7 @@ export default {
},
{
key: 'cidrlist',
title: this.$t('label.cidrlist')
title: this.$t('label.sourcecidrlist')
},
{
key: 'protocol',
Expand Down
27 changes: 25 additions & 2 deletions ui/src/views/network/PortForwarding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
<a-select-option value="udp" :label="$t('label.udp')">{{ $t('label.udp') }}</a-select-option>
</a-select>
</div>
<div v-if="isVPC()">
<div class="form__item" ref="newCidrList">
<tooltip-label :title="$t('label.sourcecidrlist')" bold :tooltip="apiParams.cidrlist.description" :tooltip-placement="'right'"/>
<a-input v-model:value="newRule.cidrlist"></a-input>
</div>
</div>
<div class="form__item" style="margin-left: auto;">
<div class="form__label">{{ $t('label.add.vm') }}</div>
<a-button :disabled="!('createPortForwardingRule' in $store.getters.apis)" type="primary" @click="openAddVMModal">{{ $t('label.add') }}</a-button>
Expand Down Expand Up @@ -108,6 +114,9 @@
<template v-if="column.key === 'protocol'">
{{ getCapitalise(record.protocol) }}
</template>
<template v-if="column.key === 'cidrlist'">
<span style="white-space: pre-line"> {{ record.cidrlist?.replaceAll(" ", "\n") }}</span>
</template>
<template v-if="column.key === 'vm'">
<div><desktop-outlined/>
<router-link
Expand Down Expand Up @@ -334,9 +343,11 @@ import Status from '@/components/widgets/Status'
import TooltipButton from '@/components/widgets/TooltipButton'
import BulkActionView from '@/components/view/BulkActionView'
import eventBus from '@/config/eventBus'
import TooltipLabel from '@/components/widgets/TooltipLabel.vue'
export default {
components: {
TooltipLabel,
Status,
TooltipButton,
BulkActionView
Expand Down Expand Up @@ -399,6 +410,11 @@ export default {
key: 'protocol',
title: this.$t('label.protocol')
},
{
key: 'cidrlist',
title: this.$t('label.sourcecidrlist'),
hidden: !this.isVPC()
},
{
title: this.$t('label.state'),
dataIndex: 'state'
Expand All @@ -411,7 +427,7 @@ export default {
key: 'actions',
title: this.$t('label.actions')
}
],
].filter(item => !item.hidden),
tiers: {
loading: false,
data: []
Expand Down Expand Up @@ -450,14 +466,18 @@ export default {
vmPage: 1,
vmPageSize: 10,
vmCount: 0,
searchQuery: null
searchQuery: null,
cidrlist: ''
}
},
computed: {
hasSelected () {
return this.selectedRowKeys.length > 0
}
},
beforeCreate () {
this.apiParams = this.$getApiParams('createPortForwardingRule')
},
created () {
console.log(this.resource)
this.initForm()
Expand Down Expand Up @@ -830,6 +850,9 @@ export default {
onSearch (value) {
this.searchQuery = value
this.fetchVirtualMachines()
},
isVPC () {
return 'vpcid' in this.resource
}
}
}
Expand Down

0 comments on commit 46758c4

Please sign in to comment.