luci/protocols/luci-proto-hnet/htdocs/luci-static/resources/protocol/hnet.js
Jo-Philipp Wich 171ef77e89 treewide: remove rendundant proto handler options
The introduction of network device configuration support also implemented
all common, protocol-independent interface options directly in the
interface config view, so drop the redundant option definitions.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-03-15 11:41:44 +01:00

44 lines
1.3 KiB
JavaScript

'use strict';
'require form';
'require network';
return network.registerProtocol('hnet', {
getI18n: function() {
return _('Automatic Homenet (HNCP)');
},
getOpkgPackage: function() {
return 'hnet-full';
},
renderFormOptions: function(s) {
var dev = this.getL2Device() || this.getDevice(), o;
o = s.taboption('general', form.ListValue, 'mode', _('Category'));
o.value('auto', _('Automatic'));
o.value('external', _('External'));
o.value('internal', _('Internal'));
o.value('leaf', _('Leaf'));
o.value('guest', _('Guest'));
o.value('adhoc', _('Ad-Hoc'));
o.value('hybrid', _('Hybrid'));
o.default = 'auto';
s.taboption('advanced', form.Value, 'link_id', _('IPv6 assignment hint'), _('Assign prefix parts using this hexadecimal subprefix ID for this interface.'));
o = s.taboption('advanced', form.Value, 'ip4assign', _('IPv4 assignment length'));
o.datatype = 'max(32)';
o.default = '24';
o = s.taboption('advanced', form.Value, 'dnsname', _('DNS-Label / FQDN'));
o.default = s.section;
o = s.taboption('advanced', form.Value, 'macaddr', _('Override MAC address'));
o.datatype = 'macaddr';
o.placeholder = dev ? (dev.getMAC() || '') : '';
o = s.taboption('advanced', form.Value, 'mtu', _('Override MTU'));
o.datatype = 'max(9200)';
o.placeholder = dev ? (dev.getMTU() || '1500') : '1500';
}
});