cockpit
cockpit copied to clipboard
frontend: data lake: allow deleting variables in the monitor
Current behaviour
Data lake variables cannot be deleted, even if they were created by an Input Widget or Action that no longer exists.
Expected or desired behaviour
- [x] We should be able to delete them directly, using the data lake variables monitor
- Ideally this would be limited to those that are created by user input rather than those used by Cockpit's internals and/or auto-generated from receiving MAVLink messages, but "allow deleting everything" could be an ok starting point as long as there's a way to restore required values if something gets broken (hopefully just by refreshing the page)
- Initial deletion support (from the table) was implemented in #1706
- [ ] Per this comment, it would be nice if we could detect whether a variable is being used anywhere else, and delete it automatically when the last reference to it is removed
- This is a form of garbage collection, and could potentially be achieved using reference counting (e.g. store a count of references to a variable with the variable, increment that whenever it's referred to, and decrement that when a reference is removed/deleted, then delete the variable when the count decrements to 0)
Prerequisites
- [x] I have checked to make sure that a similar request has not already been filed or fixed.