luci2: UCIContext: add: respect "name" if passed
authorRafał Miłecki <zajec5@gmail.com>
Fri, 27 Jun 2014 19:38:35 +0000 (19:38 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 30 Jun 2014 11:41:28 +0000 (13:41 +0200)
This allows creating UCI entries with a desired name, e.g.
config interface 'guestlan'

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
luci2/htdocs/luci2/luci2.js

index 2a2a35984be4c7a09614a4ed096a9e893e61a07c..040f1e5da2c8177b3270df06ca2f6c7fb23c4cd8 100644 (file)
@@ -974,7 +974,7 @@ function LuCI2()
                add: function(conf, type, name)
                {
                        var n = this.state.creates;
-                       var sid = this.createSID(conf);
+                       var sid = name || this.createSID(conf);
 
                        if (!n[conf])
                                n[conf] = { };