Skip to content
This repository was archived by the owner on Jan 20, 2021. It is now read-only.

Commit c8edbc3

Browse files
Pearl1594Pearl Dsilva
andauthored
Allow enabling network/vpc offering at creation (#911)
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
1 parent cba9f7b commit c8edbc3

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/views/offering/AddNetworkOffering.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,15 @@
447447
</a-select-option>
448448
</a-select>
449449
</a-form-item>
450+
<a-form-item>
451+
<span slot="label">
452+
{{ $t('label.enable.network.offering') }}
453+
<a-tooltip :title="apiParams.enable.description">
454+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
455+
</a-tooltip>
456+
</span>
457+
<a-switch v-decorator="['enable', {initialValue: false}]" />
458+
</a-form-item>
450459
</a-form>
451460
<div :span="24" class="action-button">
452461
<a-button @click="closeAction">{{ this.$t('label.cancel') }}</a-button>
@@ -929,6 +938,9 @@ export default {
929938
if (zoneId) {
930939
params.zoneid = zoneId
931940
}
941+
if (values.enable) {
942+
params.enable = values.enable
943+
}
932944
params.traffictype = 'GUEST' // traffic type dropdown has been removed since it has only one option ('Guest'). Hardcode traffic type value here.
933945
api('createNetworkOffering', params).then(json => {
934946
this.$message.success('Network offering created: ' + values.name)

src/views/offering/AddVpcOffering.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@
145145
</a-select-option>
146146
</a-select>
147147
</a-form-item>
148+
<a-form-item>
149+
<span slot="label">
150+
{{ $t('label.enable.vpc.offering') }}
151+
<a-tooltip :title="apiParams.enable.description">
152+
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
153+
</a-tooltip>
154+
</span>
155+
<a-switch v-decorator="['enable', {initialValue: false}]" />
156+
</a-form-item>
148157
</a-form>
149158
<div :span="24" class="action-button">
150159
<a-button @click="closeAction">{{ this.$t('label.cancel') }}</a-button>
@@ -400,6 +409,9 @@ export default {
400409
} else {
401410
params.supportedservices = ''
402411
}
412+
if (values.enable) {
413+
params.enable = values.enable
414+
}
403415
api('createVPCOffering', params).then(json => {
404416
this.$message.success(`${this.$t('message.create.vpc.offering')}: ` + values.name)
405417
this.$emit('refresh-data')

0 commit comments

Comments
 (0)