summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2022-08-10 07:20:58 +0200
committerGitHub <noreply@github.com>2022-08-10 07:20:58 +0200
commitcb0871322751a3d52669aacd83705754b9ea6e08 (patch)
tree904818ea2aec5ff1d1749bb57965fb881b617065
parent71017a530473bf52d5fbf507c62be096975f2bfb (diff)
parentd4f0b06a478505a716478b56f9890e708898a58b (diff)
Merge pull request #5751 from MaxSKash/21.02-DHCP-lease-table
[21.02]luci-mod-status,mod-network: Added fqdn-name to DHCPv4 lease table
-rw-r--r--modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js11
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js10
2 files changed, 19 insertions, 2 deletions
diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
index 6c4178b7df..f3211539da 100644
--- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/dhcp.js
@@ -639,8 +639,17 @@ return view.extend({
else
exp = '%t'.format(lease.expires);
+ var hint = lease.macaddr ? hosts[lease.macaddr] : null,
+ name = hint ? hint.name : null,
+ host = null;
+
+ if (name && lease.hostname && lease.hostname != name)
+ host = '%s (%s)'.format(lease.hostname, name);
+ else if (lease.hostname)
+ host = lease.hostname;
+
return [
- lease.hostname || '?',
+ host || '-',
lease.ipaddr,
lease.macaddr,
exp
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js
index b93f26875d..956c1b20f9 100644
--- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/40_dhcp.js
@@ -102,8 +102,16 @@ return baseclass.extend({
else
exp = '%t'.format(lease.expires);
+ var hint = lease.macaddr ? machints.filter(function(h) { return h[0] == lease.macaddr })[0] : null,
+ host = null;
+
+ if (hint && lease.hostname && lease.hostname != hint[1])
+ host = '%s (%s)'.format(lease.hostname, hint[1]);
+ else if (lease.hostname)
+ host = lease.hostname;
+
rows = [
- lease.hostname || '-',
+ host || '-',
lease.ipaddr,
lease.macaddr,
exp