Feature #2320
closed
Javascript helper to toggle subnet mask length for IPv4/IPv6 during input
Added by Seth Mos over 12 years ago.
Updated over 12 years ago.
Description
There are numerous places in the UI where one is free to enter a IPv4 or IPv6 address, however, the max subnet mask length for ip4 is 32 bits, and for ip6 is 128 bits. A bit of JS that could toggle the subnetmask length to drop to 32 on a ip4 address during input saves a lot of headache.
This is atleast valid on editing aliases, virtual IP, static routes? Probably others, we'll add to the ticket for those.
- Status changed from New to Feedback
- % Done changed from 0 to 90
Pretty much done. I've done some testing but I want others to test as well.
- Assignee changed from Darren Embry to Chris Buechler
Chris, I'm reassigning this to you so you can test this or have someone else test it out. I'm pretty sure I've found every place where someone can enter an ipv4 or ipv6 address, see revisions.
- Assignee changed from Chris Buechler to Seth Mos
seems good to me, will let Seth give the final approval.
- Assignee changed from Seth Mos to Darren Embry
Add on system_routes_edit.php too (needs gateways defined to save)
on firewall_virtual_ip_edit.php it jumps to a length of 1 on a valid ipv4
Add on vpn_ipsec_phase2.php (Add IPsec phase 2 entry, add phase 1 first)
Couldn't find any others going through the UI.
added on system_routes_edit.php
fixed firewall_virtual_ip_edit.php (will commit soonish)
In vpn_ipsec_phase2.php there is some existing client-side JavaScript logic that changes the selected value for the #bits dropdowns that conflicts with what I'm doing.
Namely those times when it sets the #bits to 24 or 64 by default.
I'm going to disable that stuff for the time being but if you still want that behavior in some way then we need to discuss exactly when those changes in the dropdown values happen.
it should still default that way on IPsec. For v4 addresses, show 1-32 and default to 24, and for v6, show 1-128 and default to 64.
Okay, all my changesets are committed now. Gotta think hard about this one then.
I've restored default 24/64 bits.
I had to modify the normal behavior on dropdown value changes between ipv6 and ipv4 a bit.
I like it so far, it appears to work as intended for me. Consider resolved?
- Status changed from Feedback to Resolved
Also available in: Atom
PDF