SpriteLink / NIPAP

Neat IP Address Planner - NIPAP is the best open source IPAM in the known universe, challenging classical IP address management (IPAM) systems in many areas.
https://spritelink.github.io/NIPAP/
MIT License
539 stars 132 forks source link

Implement recursive delete in the web-ui #407

Open plajjan opened 11 years ago

plajjan commented 11 years ago

The web-ui does not currently support recursively deleting a prefix and all its children. Add support so that when a prefix that has children is being deleted, the user is prompted if the prefix should be deleted recursively or not.

Should also list which prefixes are affected, Ie that will be deleted, if a recursive delete is used.

dosomder commented 10 years ago

I recommend to add a checkbox in the confirmation window which says something like "Delete all sub prefixes". The answer is then stored in 'recursive' parameter. This would require changes in the files

I think it's not really necessary to list affected prefixes, maybe in a spoiler. But what would be nice is if you could revert the last delete.

plajjan commented 10 years ago

I think we will implement most of the logic in JavaScript for a better user experience.

If a prefix is to be deleted, we query the backend for any subnets to the prefix that is about to be deleted. If the prefix is an assignment and there are hosts inside, it is required that it is deleted recursively as having hosts without a covering assignment is a violation of the database constraints. If on the other hand it is a reservation, we should give the user the option to either just delete the selected prefix or recursively delete all that it contains. This is how the cli behaves and I think we should mimic that behaviour. The cli also displays a list of prefixes that are about to be deleted, if a recursive delete is used. If the list is to long, it is truncated and a message stating how many prefixes are affected is shown.

plajjan commented 9 years ago

Rethinking this I realize we probably don't need to query the backend. We have the number of children of the prefix already!

If the prefix is of type assignment and has children >0 then a normal (non recursive) is not allowed and could be greyed out.

If a prefix has zero children then obviously a recursive delete is not possible, or at least doesn't make a difference, and could therefore be greyed out.

plajjan commented 9 years ago

But on the other hand, since we want to display a list of affected prefixes (ie, the ones that are about to be removed) we need to query the backend anyway...