Enhance VPC Network Tier form to auto-populate Gateway, and Netmask#10617
Enhance VPC Network Tier form to auto-populate Gateway, and Netmask#10617weizhouapache merged 7 commits intoapache:4.19from Imvedansh:4.19
Conversation
|
@Imvedansh a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
|
@Imvedansh it is good idea to display VPC cidr in the form. |
|
@weizhouapache Yes, placeholder will suggest according as per super CIDR |
|
@Imvedansh a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #10617 +/- ##
============================================
+ Coverage 15.16% 15.89% +0.73%
- Complexity 11326 11331 +5
============================================
Files 5414 5046 -368
Lines 474804 445155 -29649
Branches 57909 52704 -5205
============================================
- Hits 72002 70756 -1246
+ Misses 394749 366490 -28259
+ Partials 8053 7909 -144
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@weizhouapache is this good to go? |
I suggest to change "Your current" which is unclear. others look good |
|
@weizhouapache ,Replacing it with "For example", It will suggest netmask as per CIDR notation of VPC |
bernardodemarco
left a comment
There was a problem hiding this comment.
@Imvedansh, nice work, overall looks good. Here are some minor suggestions
ui/src/views/network/VpcTiersTab.vue
Outdated
| } | ||
|
|
||
| const cidrValue = `${address}/${maskBits}` | ||
| const netmask = subnetMasks[prefix] || '255.255.255.0' |
There was a problem hiding this comment.
What do you think about abstracting this process of retrieving a CIDR's netmask into an utility function? Maybe, we could place it inside the ui/src/utils folder
There was a problem hiding this comment.
I had considered abstracting this logic, as the use of subnetMask list felt out of place in that context.
Sure , will do now
ui/src/views/network/VpcTiersTab.vue
Outdated
| 32: '255.255.255.255' | ||
| } | ||
|
|
||
| const cidrValue = `${address}/${maskBits}` |
There was a problem hiding this comment.
Is it necessary to define this cidrValue here? It'll contain the same value as the cidr variable has, right?
There was a problem hiding this comment.
Previously, I was automating the input of the Gateway and Netmask fields. In that case, the Gateway needed to be the network address, and the Subnet Mask had to be derived from the prefix.
Thanks for pointing it out , will clear it out
|
@bernardodemarco a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
|
@Imvedansh a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
bernardodemarco
left a comment
There was a problem hiding this comment.
lgtm. tested in the QA environment
|
UI build: ✔️ |
Co-authored-by: Bernardo De Marco Gonçalves <bernardomg2004@gmail.com>
|
@weizhouapache a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
* 4.20: xenserver: do not destroy halted hypervisor vm (#9175) define the limit of projects through the UI (#10652) fix projects metrics on dashboard (#10651) systemvm: Bump systemvm template version to debian 12.10 (#10628) Enhance VPC Network Tier form to auto-populate Gateway, and Netmask (#10617)


Description
This PR fixes a UX gap in the VPC Network Tier (Add Network) form, where the parent VPC CIDR was not visible or accessible during subnet configuration. Previously, users had to manually close the form, navigate back to the VPC details, copy the CIDR, and then reopen the form to paste the correct subnet range.
With this PR:
The Add Network form now auto-fills:
Gateway: Based on CIDR
Netmask: Based on CIDR
This eliminates context switching, reduces input errors, and improves workflow efficiency.
Expected behavior (after fix):
When creating a new network tier inside a VPC, the form automatically suggests a valid (CIDR) gateway, and netmask within the VPC's CIDR block.
This Fixes : #10615
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Verified by creating a new VPC with a /16 CIDR block.
Used the Add Network form under the created VPC.
Confirmed that the form auto-fills a /24 subnet, valid gateway, and netmask.
Ensured the inputs reflect valid and usable values within the VPC CIDR.
Checked that manual override is still possible.
How did you try to break this feature and the system with this change?
-Tried editing the auto-filled values to invalid CIDRs → proper validation triggers.
-Created multiple network tiers to ensure no collisions and clean suggestions.