You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by nv...@apache.org on 2022/04/22 11:35:56 UTC

[cloudstack] branch main updated: UI: fix netmask is not passed to api when create share network (#6300)

This is an automated email from the ASF dual-hosted git repository.

nvazquez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/main by this push:
     new 9a53bada19 UI: fix netmask is not passed to api when create share network (#6300)
9a53bada19 is described below

commit 9a53bada1934d94d77e2f31330c198affa08f189
Author: Wei Zhou <we...@apache.org>
AuthorDate: Fri Apr 22 13:35:49 2022 +0200

    UI: fix netmask is not passed to api when create share network (#6300)
---
 ui/src/views/network/CreateSharedNetworkForm.vue | 30 +++++++++++++++---------
 1 file changed, 19 insertions(+), 11 deletions(-)

diff --git a/ui/src/views/network/CreateSharedNetworkForm.vue b/ui/src/views/network/CreateSharedNetworkForm.vue
index a8c7e9841f..fdcb890fd0 100644
--- a/ui/src/views/network/CreateSharedNetworkForm.vue
+++ b/ui/src/views/network/CreateSharedNetworkForm.vue
@@ -267,18 +267,18 @@
           </a-form-item>
           <a-form-item name="ip4gateway" ref="ip4gateway">
             <template #label>
-              <tooltip-label :title="$t('label.ip4gateway')" :tooltip="apiParams.netmask.description"/>
+              <tooltip-label :title="$t('label.ip4gateway')" :tooltip="apiParams.gateway.description"/>
             </template>
             <a-input
               v-model:value="form.ip4gateway"
-              :placeholder="apiParams.netmask.description"/>
+              :placeholder="apiParams.gateway.description"/>
           </a-form-item>
           <a-form-item name="ip4netmask" ref="ip4netmask">
             <template #label>
-              <tooltip-label :title="$t('label.netmask')" :tooltip="apiParams.netmask.description"/>
+              <tooltip-label :title="$t('label.ip4netmask')" :tooltip="apiParams.netmask.description"/>
             </template>
             <a-input
-              v-model:value="form.netmask"
+              v-model:value="form.ip4netmask"
               :placeholder="apiParams.netmask.description"/>
           </a-form-item>
           <a-form-item name="startipv4" ref="startipv4">
@@ -297,6 +297,14 @@
               v-model:value="form.endipv4"
               :placeholder="apiParams.endip.description"/>
           </a-form-item>
+          <a-form-item v-if="isVirtualRouterForAtLeastOneService" name="routerip" ref="routerip">
+            <template #label>
+              <tooltip-label :title="$t('label.routerip')" :tooltip="apiParams.routerip.description"/>
+            </template>
+            <a-input
+              v-model:value="form.routerip"
+              :placeholder="apiParams.routerip.description"/>
+          </a-form-item>
           <a-form-item name="ip6gateway" ref="ip6gateway">
             <template #label>
               <tooltip-label :title="$t('label.ip6gateway')" :tooltip="apiParams.ip6gateway.description"/>
@@ -865,7 +873,7 @@ export default {
         const formRaw = toRaw(this.form)
         const values = this.handleRemoveFields(formRaw)
         if (
-          (!this.isValidTextValueForKey(values, 'ip4gateway') && !this.isValidTextValueForKey(values, 'netmask') &&
+          (!this.isValidTextValueForKey(values, 'ip4gateway') && !this.isValidTextValueForKey(values, 'ip4netmask') &&
             !this.isValidTextValueForKey(values, 'startipv4') && !this.isValidTextValueForKey(values, 'endipv4') &&
             !this.isValidTextValueForKey(values, 'ip6gateway') && !this.isValidTextValueForKey(values, 'ip6cidr') &&
             !this.isValidTextValueForKey(values, 'startipv6') && !this.isValidTextValueForKey(values, 'endipv6'))
@@ -923,8 +931,8 @@ export default {
         if (this.isValidTextValueForKey(values, 'ip4gateway')) {
           params.gateway = values.ip4gateway
         }
-        if (this.isValidTextValueForKey(values, 'netmask')) {
-          params.netmask = values.netmask
+        if (this.isValidTextValueForKey(values, 'ip4netmask')) {
+          params.netmask = values.ip4netmask
         }
         if (this.isValidTextValueForKey(values, 'startipv4')) {
           params.startip = values.startipv4
@@ -932,15 +940,15 @@ export default {
         if (this.isValidTextValueForKey(values, 'endipv4')) {
           params.endip = values.endipv4
         }
+        if (this.isValidTextValueForKey(values, 'routerip')) {
+          params.routerip = values.routerip
+        }
         // IPv4 (end)
 
         // IPv6 (begin)
-        if (this.isValidTextValueForKey(values, 'ip4gateway')) {
+        if (this.isValidTextValueForKey(values, 'ip6gateway')) {
           params.ip6gateway = values.ip6gateway
         }
-        if (this.isValidTextValueForKey(values, 'routerip')) {
-          params.routerip = values.routerip
-        }
         if (this.isValidTextValueForKey(values, 'ip6cidr')) {
           params.ip6cidr = values.ip6cidr
         }