mirror of
https://github.com/DavBfr/luci-app-netmap
synced 2025-01-07 03:16:37 +08:00
Fix incompatibility with OpenWrt 2018.6.1
This commit is contained in:
parent
fa99030ad9
commit
18650a6c90
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-netmap
|
||||
PKG_VERSION=1.0
|
||||
PKG_VERSION=1.1
|
||||
PKG_RELEASE:=0
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
@ -99,15 +99,19 @@
|
||||
nodes.push({id: 1, label: '<%=luci.sys.hostname() or "?"%>', image: router_img, shape: 'image'});
|
||||
|
||||
<% local p, id, v, w, m, h; id = 1; for _, v in ipairs(wifinets) do -%>
|
||||
<% for _, w in ipairs(v["networks"]) do -%>
|
||||
<% for _, w in ipairs(v.networks) do -%>
|
||||
<% id = id + 1; -%>
|
||||
nodes.push({id: <%=id%>, label: '<%=w.ssid%>\n<%=w.frequency%> GHz\n<%=hosts[w.bssid].name%>', image: wifi_img, shape: 'image'});
|
||||
edges.push({from: 1, to: <%=id%>, length: EDGE_LENGTH_SUB});
|
||||
<% p = id; hosts[w.bssid].id = id; -%>
|
||||
<% for m, h in pairs(w["assoclist"]) do -%>
|
||||
<% id = id + 1; hosts[m].id = id; -%>
|
||||
nodes.push({id: <%=id%>, label: '<%=hosts[m].name%>', image: laptop_img, shape: 'image'});
|
||||
edges.push({from: <%=p%>, to: <%=id%>, length: EDGE_LENGTH_MAIN*<%=-h["signal"]%>/40});
|
||||
<% local net = ntm:get_wifinet(w.ifname) -%>
|
||||
<% for m, h in pairs(net:assoclist()) do
|
||||
id = id + 1
|
||||
hosts[m].id = id;
|
||||
local host_name = (hosts[m]) and (hosts[m].name or hosts[m].ipv4 or hosts[m].ipv6)
|
||||
-%>
|
||||
nodes.push({id: <%=id%>, label: '<%=host_name%>', image: laptop_img, shape: 'image'});
|
||||
edges.push({from: <%=p%>, to: <%=id%>, length: EDGE_LENGTH_MAIN*<%=-h.signal%>/40});
|
||||
<%- end %>
|
||||
<%- end %>
|
||||
<%- end %>
|
||||
|
Loading…
Reference in New Issue
Block a user