+ dhcp: /dhcp/status: return static leases

This commit is contained in:
Simon Zolin
2019-05-14 13:54:35 +03:00
parent 342699d933
commit 763b986955
3 changed files with 26 additions and 3 deletions

View File

@@ -42,9 +42,11 @@ func convertLeases(inputLeases []dhcpd.Lease, includeExpires bool) []map[string]
func handleDHCPStatus(w http.ResponseWriter, r *http.Request) {
log.Tracef("%s %v", r.Method, r.URL)
leases := convertLeases(dhcpServer.Leases(), true)
staticLeases := convertLeases(dhcpServer.StaticLeases(), false)
status := map[string]interface{}{
"config": config.DHCP,
"leases": leases,
"config": config.DHCP,
"leases": leases,
"static_leases": staticLeases,
}
w.Header().Set("Content-Type", "application/json")