diff options
Diffstat (limited to 'modules/luci-base/htdocs/luci-static')
5 files changed, 41 insertions, 9 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index 568a4abb6a..612c8ff944 100644 --- a/modules/luci-base/htdocs/luci-static/resources/form.js +++ b/modules/luci-base/htdocs/luci-static/resources/form.js @@ -2219,7 +2219,7 @@ var CBITypedSection = CBIAbstractSection.extend(/** @lends LuCI.form.TypedSectio }); if (this.title != null && this.title != '') - sectionEl.appendChild(E('legend', {}, this.title)); + sectionEl.appendChild(E('h3', {}, this.title)); if (this.description != null && this.description != '') sectionEl.appendChild(E('div', { 'class': 'cbi-section-descr' }, this.description)); @@ -3138,7 +3138,7 @@ var CBINamedSection = CBIAbstractSection.extend(/** @lends LuCI.form.NamedSectio }); if (typeof(this.title) === 'string' && this.title !== '') - sectionEl.appendChild(E('legend', {}, this.title)); + sectionEl.appendChild(E('h3', {}, this.title)); if (typeof(this.description) === 'string' && this.description !== '') sectionEl.appendChild(E('div', { 'class': 'cbi-section-descr' }, this.description)); diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js index 83c2807d77..faed3aa6d2 100644 --- a/modules/luci-base/htdocs/luci-static/resources/luci.js +++ b/modules/luci-base/htdocs/luci-static/resources/luci.js @@ -2553,10 +2553,16 @@ rpcBaseURL = Session.getLocalData('rpcBaseURL'); if (rpcBaseURL == null) { + var msg = { + jsonrpc: '2.0', + id: 'init', + method: 'list', + params: undefined + }; var rpcFallbackURL = this.url('admin/ubus'); - rpcBaseURL = Request.get(env.ubuspath).then(function(res) { - return (rpcBaseURL = (res.status == 400) ? env.ubuspath : rpcFallbackURL); + rpcBaseURL = Request.post(env.ubuspath, msg, { nobatch: true }).then(function(res) { + return (rpcBaseURL = res.status == 200 ? env.ubuspath : rpcFallbackURL); }, function() { return (rpcBaseURL = rpcFallbackURL); }).then(function(url) { diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index 856421cd31..1f749c593c 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -3571,6 +3571,24 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */ }, /** + * Get the Linux VLAN network device names. + * + * @returns {string[]} + * Returns the current Linux VLAN network device name as resolved + * from `ubus` runtime information or empty array if this network + * has no associated VLAN network devices. + */ + getVlanIfnames: function() { + var vlans = L.toArray(this.ubus('net', 'vlans')), + ifnames = []; + + for (var i = 0; i < vlans.length; i++) + ifnames.push(vlans[i]['ifname']); + + return ifnames; + }, + + /** * Get the name of the corresponding wifi radio device. * * @returns {null|string} @@ -3880,7 +3898,15 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */ * with this network. */ getAssocList: function() { - return callIwinfoAssoclist(this.getIfname()); + var tasks = []; + var ifnames = [ this.getIfname() ].concat(this.getVlanIfnames()); + + for (var i = 0; i < ifnames.length; i++) + tasks.push(callIwinfoAssoclist(ifnames[i])); + + return Promise.all(tasks).then(function(values) { + return Array.prototype.concat.apply([], values); + }); }, /** diff --git a/modules/luci-base/htdocs/luci-static/resources/protocol/dhcp.js b/modules/luci-base/htdocs/luci-static/resources/protocol/dhcp.js index f0a3ec579c..bacbf559f9 100644 --- a/modules/luci-base/htdocs/luci-static/resources/protocol/dhcp.js +++ b/modules/luci-base/htdocs/luci-static/resources/protocol/dhcp.js @@ -20,7 +20,10 @@ return network.registerProtocol('dhcp', { var dev = this.getL2Device() || this.getDevice(), o; o = s.taboption('general', form.Value, 'hostname', _('Hostname to send when requesting DHCP')); - o.datatype = 'hostname'; + o.default = ''; + o.value('', _('Send the hostname of this device')); + o.value('*', _('Do not send a hostname')); + o.datatype = 'or(hostname, "*")'; o.load = function(section_id) { return callFileRead('/proc/sys/kernel/hostname').then(L.bind(function(hostname) { this.placeholder = hostname; diff --git a/modules/luci-base/htdocs/luci-static/resources/rpc.js b/modules/luci-base/htdocs/luci-static/resources/rpc.js index 7bfc913367..f37f7bb6a4 100644 --- a/modules/luci-base/htdocs/luci-static/resources/rpc.js +++ b/modules/luci-base/htdocs/luci-static/resources/rpc.js @@ -33,9 +33,6 @@ return baseclass.extend(/** @lends LuCI.rpc.prototype */ { req[i].params[2] ); } - else if (req.params) { - q += '/%s.%s'.format(req.params[1], req.params[2]); - } return request.post(rpcBaseURL + q, req, { timeout: (L.env.rpctimeout || 20) * 1000, |