8 return L
.resolveDefault(fs
.read_direct('/etc/banip/banip.maclist'), '');
10 handleSave: function(ev
) {
11 var value
= ((document
.querySelector('textarea').value
|| '').trim().toUpperCase().replace(/\r\n/g, '\n')) + '\n';
12 return fs
.write('/etc/banip/banip.maclist', value
)
14 document
.querySelector('textarea').value
= value
;
15 ui
.addNotification(null, E('p', _('Maclist changes have been saved. Refresh your banIP lists that changes take effect.')), 'info');
16 }).catch(function(e
) {
17 ui
.addNotification(null, E('p', _('Unable to save changes: %s').format(e
.message
)));
20 render: function(blacklist
) {
23 _('This is the local banIP maclist to always-allow certain MAC addresses.<br /> \
24 <em><b>Please note:</b></em> add only one MAC address per line. Comments introduced with \'#\' are allowed - domains, wildcards and regex are not.')),
27 'style': 'width: 100% !important; padding: 5px; font-family: monospace',
28 'spellcheck': 'false',
31 }, [ blacklist
!= null ? blacklist
: '' ])
35 handleSaveApply
: null,