X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci2%2Fui.git;a=blobdiff_plain;f=luci2%2Fhtdocs%2Fluci2%2Fluci2.js;h=5947791600a9ace955dade058bbd8849ec29a2ce;hp=ea64074c5b21df9a2dba2b832c2096a6b8b37da3;hb=e314622aa9ad41f5d3083dfd21ff0f61175c237f;hpb=2823ef651678ef296faf68eceb51aa5afaae4e83 diff --git a/luci2/htdocs/luci2/luci2.js b/luci2/htdocs/luci2/luci2.js index ea64074..5947791 100644 --- a/luci2/htdocs/luci2/luci2.js +++ b/luci2/htdocs/luci2/luci2.js @@ -1109,6 +1109,35 @@ function LuCI2() return this.set(conf, sid, opt, undefined); }, + get_first: function(conf, type, opt) + { + var sid = undefined; + + L.uci.sections(conf, type, function(s) { + if (typeof(sid) != 'string') + sid = s['.name']; + }); + + return this.get(conf, sid, opt); + }, + + set_first: function(conf, type, opt, val) + { + var sid = undefined; + + L.uci.sections(conf, type, function(s) { + if (typeof(sid) != 'string') + sid = s['.name']; + }); + + return this.set(conf, sid, opt, val); + }, + + unset_first: function(conf, type, opt) + { + return this.set_first(conf, type, opt, undefined); + }, + _reload: function() { var pkgs = [ ];