-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
luci-base: add clone action for tables
This augments CBITableSection, affecting types which extend it, i.e. CBIGridSection. Setting a table 'cloneable' property to true reveals a column of clone buttons who designate the current entry as a clone source. Clicking the clone button duplicates the data of that section_id into a new entry, while the new entry gets a new and unique SID. E.g. s = m.section(form.GridSection, 'foo', _('Bar')); ... s.cloneable = true; Clone and add actions differ: clone will not open a dialogue. That is a user exercise. One may set the put_next flag to false to put the new clone last, or true to put it next (after the clone source). This uses a new uci action which fulfills the behaviour: clone It is possible for the uci clone action to be used independently. See also: https://forum.openwrt.org/t/add-clone-button-to-luci-configurations-esp-in-firewall/196232 Signed-off-by: Paul Donald <[email protected]>
- Loading branch information
1 parent
2ce8529
commit 22cccf7
Showing
2 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters