luci-mod-network: fix unsetting network.device options
authorJo-Philipp Wich <jo@mein.io>
Mon, 29 Mar 2021 14:27:47 +0000 (16:27 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 29 Mar 2021 14:27:47 +0000 (16:27 +0200)
The existing logic only handled removing the last remaining device section
option (which results in the deletion of the entire section) but failed to
actually unset single options.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-network/htdocs/luci-static/resources/tools/network.js

index 829ab1496385d265f7d9979d758d5367e085008f..cd51a0391cf52526b73c8edf1c9f193a55f5e24b 100644 (file)
@@ -158,6 +158,8 @@ function deviceRemove(section_id) {
 
                if (empty)
                        uci.remove('network', ds);
+               else
+                       uci.unset('network', ds, this.option);
        }
 
        uci.unset('network', section_id, this.option);