Skip to content

Commit

Permalink
Merge pull request #5574 from GuoLiBin6/feat/glb-to-3.11/secgroup
Browse files Browse the repository at this point in the history
feat(4592): secgroup reconfiguration
  • Loading branch information
easy-mj authored Oct 27, 2023
2 parents 5df3fcc + adb864e commit c5789f9
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@ export default {
brand: this.data.brand,
})
},
meta: () => {
return {
meta: (obj) => {
const ret = {
validate: !this.isRead,
tooltip: this.isRead ? this.$t('compute.secgroup.shared') : '',
}
if (['hcs', 'hcso', 'huawei', 'volcengine'].includes((this.data.brand || '').toLowerCase())) {
ret.validate = false
ret.tooltip = this.$t('compute.text_1388')
}
return ret
},
},
// {
Expand Down
1 change: 1 addition & 0 deletions containers/Compute/views/secgroup/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const priorityRuleMap = {
min: 0,
max: 99,
portSupportComma: true,
noSupport: true,
},
ucloud: {
min: 1,
Expand Down
19 changes: 13 additions & 6 deletions containers/Compute/views/secgroup/dialogs/EditRules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@change="fetchSecgroups"
option-filter-prop="children"
:placeholder="$t('compute.secgroup.source.placeholder')"
:disabled="cidrDisabled"
v-decorator="decorators.source">
<a-select-opt-group>
<span slot="label">CIDR</span>
Expand All @@ -38,25 +39,25 @@
</a-select>
</a-form-item>
<a-form-item :label="$t('compute.text_980')">
<a-select v-decorator="decorators.protocol" @change="protocolChange" :disabled="protocolDisabled">
<a-select v-decorator="decorators.protocol" @change="protocolChange" :disabled="protocolDisabled || cidrDisabled">
<a-select-option v-for="item in protocolOptions" :key="item.value" :value="item.value">
{{item.label}}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item :label="$t('compute.text_998')" :extra="portExtra">
<a-input :disabled="portsDisabled" v-decorator="decorators.ports" :placeholder="$t('compute.text_350')" />
<a-checkbox class="right-checkbox" @change="portsChange" :checked="portsChecked" :disabled="portsCheckboxDisabled">{{$t('compute.text_1000')}}</a-checkbox>
<a-input :disabled="portsDisabled || cidrDisabled" v-decorator="decorators.ports" :placeholder="$t('compute.text_350')" />
<a-checkbox class="right-checkbox" @change="portsChange" :checked="portsChecked" :disabled="portsCheckboxDisabled || cidrDisabled">{{$t('compute.text_1000')}}</a-checkbox>
</a-form-item>
<a-form-item :label="$t('compute.text_694')">
<a-select v-decorator="decorators.action" :disabled="!isPrioritySupport">
<a-select v-decorator="decorators.action" :disabled="!isPrioritySupport || cidrDisabled">
<a-select-option v-for="item in actionOptions" :key="item.value" :value="item.value">
{{item.label}}
</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" v-decorator="decorators.priority" />
<a-input-number :min="priorityMin" :max="priorityMax" :disabled="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 @@ -135,7 +136,7 @@ export default {
priority: [
'priority',
{
initialValue: selectItem.priority || 1,
initialValue: selectItem.priority || priorityMin,
},
],
description: [
Expand Down Expand Up @@ -216,6 +217,12 @@ export default {
}
return ret
},
cidrDisabled () {
if (this.params.title === 'edit' && ['ctyun', 'aliyun'].includes(this.params.brand.toLowerCase())) {
return true
}
return false
},
},
created () {
// this.fetchSecgroups('')
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@
"on": "On",
"off": "Off",
"qga_exec_command_failed": "QGA execution failed",
"convert_failed": "Convert Failed"
"convert_failed": "Convert Failed",
"security_group_fail": "Failed to create security group"
},
"network": {
"init": "Initialize",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@
"on": "稼働中",
"off": "シャットダウン",
"qga_exec_command_failed": "QGA の実行に失敗しました",
"convert_failed": "変換に失敗しました"
"convert_failed": "変換に失敗しました",
"security_group_fail": "セキュリティグループの作成に失敗しました"
},
"network": {
"init": "初期化する",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@
"on": "运行中",
"off": "关机",
"qga_exec_command_failed": "QGA执行失败",
"convert_failed": "转换失败"
"convert_failed": "转换失败",
"security_group_fail": "创建安全组失败"
},
"network": {
"init": "初始化",
Expand Down

0 comments on commit c5789f9

Please sign in to comment.