[OpenWrt-Devel] [PATCH][project/luci2/ui.git] luci2: UCIContext: add: respect "name" if passed

Rafał Miłecki zajec5 at gmail.com
Fri Jun 27 16:38:35 EDT 2014


This allows creating UCI entries with a desired name, e.g.
config interface 'guestlan'

Signed-off-by: Rafał Miłecki <zajec5 at gmail.com>
---
 luci2/htdocs/luci2/luci2.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/luci2/htdocs/luci2/luci2.js b/luci2/htdocs/luci2/luci2.js
index 2a2a359..040f1e5 100644
--- a/luci2/htdocs/luci2/luci2.js
+++ b/luci2/htdocs/luci2/luci2.js
@@ -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] = { };
-- 
1.8.4.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list