/dhcp/status -- give out hostname for UI

This commit is contained in:
Eugene Bujak 2018-12-29 17:04:40 +03:00
parent 86d79ae232
commit 7acb107cbf
1 changed files with 4 additions and 3 deletions

View File

@ -21,9 +21,10 @@ func handleDHCPStatus(w http.ResponseWriter, r *http.Request) {
leases := []map[string]string{} leases := []map[string]string{}
for i := range rawLeases { for i := range rawLeases {
lease := map[string]string{ lease := map[string]string{
"mac": rawLeases[i].HWAddr.String(), "mac": rawLeases[i].HWAddr.String(),
"ip": rawLeases[i].IP.String(), "ip": rawLeases[i].IP.String(),
"expires": rawLeases[i].Expiry.Format(time.RFC3339), "hostname": rawLeases[i].Hostname,
"expires": rawLeases[i].Expiry.Format(time.RFC3339),
} }
leases = append(leases, lease) leases = append(leases, lease)