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 2a2a359..040f1e5 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] = { };