});
}
+function getDevices(network) {
+ if (network.isBridge()) {
+ var devices = network.getDevices();
+ return devices ? devices : [];
+ } else {
+ return L.toArray(network.getDevice());
+ }
+}
+
var CBIZoneSelect = form.ListValue.extend({
__name__: 'CBI.ZoneSelect',
'class': 'ifacebadge' + (network.getName() == this.network ? ' ifacebadge-active' : '')
}, network.getName() + ': ');
- var devices = network.isBridge() ? network.getDevices() : L.toArray(network.getDevice());
+ var devices = getDevices(network);
for (var k = 0; k < devices.length; k++) {
span.appendChild(E('img', {
'class': 'ifacebadge' + (network.getName() == this.network ? ' ifacebadge-active' : '')
}, network.getName() + ': ');
- var subdevs = network.isBridge() ? network.getDevices() : L.toArray(network.getDevice());
+ var subdevs = getDevices(network);
for (var k = 0; k < subdevs.length && subdevs[k]; k++) {
span.appendChild(E('img', {
renderIfaceBadge: function(network) {
var span = E('span', { 'class': 'ifacebadge' }, network.getName() + ': '),
- devices = network.isBridge() ? network.getDevices() : L.toArray(network.getDevice());
+ devices = getDevices(network);
for (var j = 0; j < devices.length && devices[j]; j++) {
span.appendChild(E('img', {