Skip to content

Commit

Permalink
luci-app-oaf: show mac vendor if supported
Browse files Browse the repository at this point in the history
  • Loading branch information
jjm2473 committed Mar 14, 2024
1 parent 0ce333b commit 31933ea
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion luci-app-oaf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LUCI_TITLE:=Open App Filter Module
LUCI_PKGARCH:=all
LUCI_DEPENDS:=+appfilter +kmod-oaf +luci-compat
PKG_NAME:=luci-app-oaf
PKG_VERSION:=5.0.3
PKG_VERSION:=5.0.4
PKG_RELEASE:=
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature
1 change: 1 addition & 0 deletions luci-app-oaf/luasrc/model/cbi/appfilter/user_list.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ local m, s

m = Map("appfilter", translate(""), translate(""))

m:section(SimpleSection).template = "oaf/mac_vendor"

m:section(SimpleSection).template = "oaf/user_status"

Expand Down
3 changes: 3 additions & 0 deletions luci-app-oaf/luasrc/model/cbi/appfilter/user_setting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,7 @@ if config_users ~= nil and config_users ~= false then
users:value(r[i], r[i]);
end
end

m:section(SimpleSection).template = "oaf/mac_vendor"

return m
13 changes: 13 additions & 0 deletions luci-app-oaf/luasrc/view/oaf/mac_vendor.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

<script src="/luci-static/resources/mac_vendor/mac_vendor.js?v=<%=math.random(1,100000)%>"></script>
<script>
window.mac_vendor && window.mac_vendor.onready(function(api) {
$(document.getElementById('cbid.appfilter.user.users')).find('.cbi-checkbox').each(function(i,e){
var mac = e.querySelector('input.cbi-input-checkbox').value;
var vendor = api.query(mac);
if (vendor && vendor.vendor_cn) {
e.querySelector('span').innerText += (' ['+vendor.vendor_cn+']');
}
})
});
</script>

0 comments on commit 31933ea

Please sign in to comment.