Skip to content

Commit

Permalink
Merge pull request #5578 from GuoLiBin6/feat/glb-to-3.11/secgroup
Browse files Browse the repository at this point in the history
fix(9412): secgroup rule configuration accuracy
  • Loading branch information
easy-mj authored Oct 31, 2023
2 parents 9717d26 + 7cda43d commit ff9c5f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
7 changes: 3 additions & 4 deletions containers/Compute/views/secgroup/constants.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export const priorityRuleMap = {
aws: {
noSupport: true,
priorityNoSupport: true,
},
bingocloud: {
noSupport: true,
priorityNoSupport: true,
},
openstack: {
noSupport: true,
priorityNoSupport: true,
},
aliyun: {
min: 1,
Expand Down Expand Up @@ -42,7 +42,6 @@ export const priorityRuleMap = {
min: 0,
max: 99,
portSupportComma: true,
noSupport: true,
},
ucloud: {
min: 1,
Expand Down
15 changes: 9 additions & 6 deletions containers/Compute/views/secgroup/dialogs/EditRules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
</a-select-option>
</a-select>
</a-form-item>
<a-form-item v-if="isPrioritySupport" :label="$t('compute.text_1001')">
<a-input-number :min="priorityMin" :max="priorityMax" :disabled="cidrDisabled" v-decorator="decorators.priority" />
<a-form-item v-if="isPrioritySupport" :label="$t('compute.text_1001')" :extra="priorityExtra">
<a-input-number :min="priorityMin" :max="priorityMax" :disabled="priorityDisabled || cidrDisabled" v-decorator="decorators.priority" />
</a-form-item>
<a-form-item :extra="isAws ? $t('compute.use_en_comment') : ''">
<span slot="label">{{$t('compute.text_312')}}</span>
Expand Down Expand Up @@ -86,8 +86,8 @@ export default {
const selectItem = this.params.data[0]
const { brand } = this.params
const item = brand ? priorityRuleMap[brand.toLowerCase()] || {} : {}
const priorityMin = !item.noSupport ? item.min : 1
const priorityMax = !item.noSupport ? item.max : 1
const priorityMin = !item.priorityNoSupport ? item.min : 1
const priorityMax = !item.priorityNoSupport ? item.max : 1
return {
loading: false,
form: {
Expand Down Expand Up @@ -182,14 +182,14 @@ export default {
protocolDisabled: this.params.title !== 'edit',
priorityMin,
priorityMax,
isPrioritySupport: !item.noSupport,
isPrioritySupport: !item.priorityNoSupport,
priorityItem: item,
}
},
computed: {
...mapGetters(['scope']),
priorityExtra () {
if (this.priorityItem.noSupport) {
if (this.priorityItem.priorityNoSupport) {
return ''
} else if (this.priorityItem.max) {
return `${this.priorityItem.min}-${this.priorityItem.max}, ${this.priorityItem.isMaxHigh ? this.$t('compute.secgroup_priority_tip2') : this.$t('compute.secgroup_priority_tip')}${this.priorityItem.noRepeat ? ', ' + this.$t('compute.secgroup_priority_no_repeat') : ''}`
Expand Down Expand Up @@ -223,6 +223,9 @@ export default {
}
return false
},
priorityDisabled () {
return this.params.title === 'edit' && ['qcloud'].includes(this.params.brand.toLowerCase())
},
},
created () {
// this.fetchSecgroups('')
Expand Down

0 comments on commit ff9c5f4

Please sign in to comment.