luci-mod-network: wireless.js: restore mac hints in mac list widget
authorJo-Philipp Wich <jo@mein.io>
Fri, 13 Sep 2019 12:19:33 +0000 (14:19 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 13 Sep 2019 12:19:33 +0000 (14:19 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js

index b50008b5c8c3680d3adcb4b975f19aa03bc8838b..6c254c059e8037952c7f3a479913562fdbf6251b 100644 (file)
@@ -893,7 +893,15 @@ return L.view.extend({
                                        o.datatype = 'macaddr';
                                        o.depends('macfilter', 'allow');
                                        o.depends('macfilter', 'deny');
-                                       //nt.mac_hints(function(mac, name) ml:value(mac, '%s (%s)' %{ mac, name }) end);
+                                       o.load = function(section_id) {
+                                               return network.getHostHints().then(L.bind(function(hints) {
+                                                       hints.getMACHints().map(L.bind(function(hint) {
+                                                               this.value(hint[0], hint[1] ? '%s (%s)'.format(hint[0], hint[1]) : hint[0]);
+                                                       }, this));
+
+                                                       return form.DynamicList.prototype.load.apply(this, [section_id]);
+                                               }, this));
+                                       };
 
                                        mode.value('ap-wds', '%s (%s)'.format(_('Access Point'), _('WDS')));
                                        mode.value('sta-wds', '%s (%s)'.format(_('Client'), _('WDS')));