From 7acb107cbfb0d458a3e0430fb3b2382a836ab05e Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Sat, 29 Dec 2018 17:04:40 +0300 Subject: [PATCH] /dhcp/status -- give out hostname for UI --- dhcp.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dhcp.go b/dhcp.go index 4d6d257a..33355d8c 100644 --- a/dhcp.go +++ b/dhcp.go @@ -21,9 +21,10 @@ func handleDHCPStatus(w http.ResponseWriter, r *http.Request) { leases := []map[string]string{} for i := range rawLeases { lease := map[string]string{ - "mac": rawLeases[i].HWAddr.String(), - "ip": rawLeases[i].IP.String(), - "expires": rawLeases[i].Expiry.Format(time.RFC3339), + "mac": rawLeases[i].HWAddr.String(), + "ip": rawLeases[i].IP.String(), + "hostname": rawLeases[i].Hostname, + "expires": rawLeases[i].Expiry.Format(time.RFC3339), } leases = append(leases, lease)