__name__: 'CBI.MultiIOSelect',
renderWidget(section_id, option_index, cfgvalue) {
- const value = (cfgvalue != null) ? cfgvalue : this.default ? this.default : '',
- choices = this.transformChoices() ? this.transformChoices() : '';
+ const value = (cfgvalue != null) ? cfgvalue : this.default ? this.default : '';
+ const choices = this.transformChoices() ? this.transformChoices() : '';
const widget = new ui.Dropdown(L.toArray(value), choices, {
- id: this.cbid(section_id),
- sort: this.keylist,
- multiple: true,
- optional: true,
- display_items: 5,
- dropdown_items: -1,
- create: true,
- disabled: (this.readonly != null) ? this.readonly : this.map.readonly,
- validate: L.bind(this.validate, this, section_id),
+ id: this.cbid(section_id),
+ sort: this.keylist,
+ multiple: this.multiple ?? true,
+ optional: this.optional ?? true,
+ display_items: this.display_items ?? 5,
+ dropdown_items: this.dropdown_items ?? -1,
+ create: this.create ?? true,
+ disabled: (this.readonly != null) ? this.readonly : this.map.readonly,
+ validate: L.bind(this.validate, this, section_id),
});
return widget.render();
'blacklist IPv6 addresses, use <code>!*:*</code>.') + '<br />' +
usage);
o.placeholder = 'Addresses and interfaces';
+ o.optional = true;
o.depends({lldp_mgmt_addr_advertisements: '1'});
o.cfgvalue = function(section_id) {
const opt = uci.get(this.config, section_id, this.option);
'Absent any value, all interfaces are considered. ' +
'LLDPd takes the first MAC address from all the considered ' +
'interfaces to compute the chassis ID.'));
+ o.optional = true;
o.value('*');
o.value('!*');
ss.addbtntitle = _('Add Custom TLV', 'lldpd Custom TLV');
oo = ss.option(lldpd.CBIMultiIOSelect, 'ports',
_('Network Interface(s)'));
+ oo.optional = true;
net_devices.forEach(nd => {
oo.value(nd.getName());
oo.value('!'+nd.getName());