Allow enabling network/vpc offering at creation (#911)

Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
Pearl Dsilva 2021-01-14 06:07:42 +05:30 committed by Rohit Yadav
parent e9df682021
commit fbb3a7aed5
2 changed files with 24 additions and 0 deletions

View File

@ -447,6 +447,15 @@
</a-select-option>
</a-select>
</a-form-item>
<a-form-item>
<span slot="label">
{{ $t('label.enable.network.offering') }}
<a-tooltip :title="apiParams.enable.description">
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
</a-tooltip>
</span>
<a-switch v-decorator="['enable', {initialValue: false}]" />
</a-form-item>
</a-form>
<div :span="24" class="action-button">
<a-button @click="closeAction">{{ this.$t('label.cancel') }}</a-button>
@ -929,6 +938,9 @@ export default {
if (zoneId) {
params.zoneid = zoneId
}
if (values.enable) {
params.enable = values.enable
}
params.traffictype = 'GUEST' // traffic type dropdown has been removed since it has only one option ('Guest'). Hardcode traffic type value here.
api('createNetworkOffering', params).then(json => {
this.$message.success('Network offering created: ' + values.name)

View File

@ -145,6 +145,15 @@
</a-select-option>
</a-select>
</a-form-item>
<a-form-item>
<span slot="label">
{{ $t('label.enable.vpc.offering') }}
<a-tooltip :title="apiParams.enable.description">
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
</a-tooltip>
</span>
<a-switch v-decorator="['enable', {initialValue: false}]" />
</a-form-item>
</a-form>
<div :span="24" class="action-button">
<a-button @click="closeAction">{{ this.$t('label.cancel') }}</a-button>
@ -400,6 +409,9 @@ export default {
} else {
params.supportedservices = ''
}
if (values.enable) {
params.enable = values.enable
}
api('createVPCOffering', params).then(json => {
this.$message.success(`${this.$t('message.create.vpc.offering')}: ` + values.name)
this.$emit('refresh-data')