[luci] [PATCH] modules/admin-core: add support for DUIDs in dhcp_leases()

Roman A. aka BasicXP x12ozmouse at ya.ru
Fri Aug 17 14:15:19 CEST 2012


Made a mistake in the <%:DUID>, should be <%:DUID%>, sorry. Fixed here.

Signed-off-by: Roman A. aka BasicXP <x12ozmouse at ya.ru>

---

Index: modules/admin-full/luasrc/view/admin_network/lease_status.htm
===================================================================
--- modules/admin-full/luasrc/view/admin_network/lease_status.htm	(revision 9067)
+++ modules/admin-full/luasrc/view/admin_network/lease_status.htm	(working copy)
@@ -51,7 +51,7 @@
 		<tr class="cbi-section-table-titles">
 			<th class="cbi-section-table-cell"><%:Hostname%></th>
 			<th class="cbi-section-table-cell"><%:IPv4-Address%></th>
-			<th class="cbi-section-table-cell"><%:MAC-Address%></th>
+			<th class="cbi-section-table-cell"><%:MAC-Address%> / <%:DUID%></th>
 			<th class="cbi-section-table-cell"><%:Leasetime remaining%></th>
 		</tr>
 		<tr class="cbi-section-table-row">
Index: modules/admin-core/luasrc/tools/status.lua
===================================================================
--- modules/admin-core/luasrc/tools/status.lua	(revision 9067)
+++ modules/admin-core/luasrc/tools/status.lua	(working copy)
@@ -36,8 +36,11 @@
 			if not ln then
 				break
 			else
-				local ts, mac, ip, name = ln:match("^(%d+) (%S+) (%S+) (%S+)")
-				if ts and mac and ip and name then
+				local ts, mac, ip, name, duid = ln:match("^(%d+) (%S+) (%S+) (%S+) (%S+)")
+				if ts and mac and ip and name and duid then
+				    if mac == "0" then
+				        mac      = duid
+				    end
 					rv[#rv+1] = {
 						expires  = os.difftime(tonumber(ts) or 0, os.time()),
 						macaddr  = mac,


More information about the luci mailing list