1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Update luci-base

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-08-27 22:20:52 +02:00
parent c3dc257a80
commit e7ae8eed52
8 changed files with 761 additions and 290 deletions

View file

@ -358,7 +358,7 @@ var CBINetworkSelect = form.ListValue.extend({
var network = this.networks[i],
name = network.getName();
if (name == 'loopback' || !this.filter(section_id, name))
if (name == 'loopback' || name == this.exclude || !this.filter(section_id, name))
continue;
if (this.novirtual && network.isVirtual())
@ -420,8 +420,12 @@ var CBIDeviceSelect = form.ListValue.extend({
__name__: 'CBI.DeviceSelect',
load: function(section_id) {
return network.getDevices().then(L.bind(function(devices) {
this.devices = devices;
return Promise.all([
network.getDevices(),
this.noaliases ? null : network.getNetworks()
]).then(L.bind(function(data) {
this.devices = data[0];
this.networks = data[1];
return this.super('load', section_id);
}, this));
@ -483,6 +487,35 @@ var CBIDeviceSelect = form.ListValue.extend({
order.push(name);
}
if (this.networks != null) {
for (var i = 0; i < this.networks.length; i++) {
var net = this.networks[i],
device = network.instantiateDevice('@%s'.format(net.getName()), net),
name = device.getName();
if (name == '@loopback' || name == this.exclude || !this.filter(section_id, name))
continue;
if (this.noinactive && net.isUp() == false)
continue;
var item = E([
E('img', {
'title': device.getI18n(),
'src': L.resource('icons/alias%s.png'.format(net.isUp() ? '' : '_disabled'))
}),
E('span', { 'class': 'hide-open' }, [ name ]),
E('span', { 'class': 'hide-close'}, [ device.getI18n() ])
]);
if (checked[name])
values.push(name);
choices[name] = item;
order.push(name);
}
}
if (!this.nocreate) {
var keys = Object.keys(checked).sort();