webadmin: add defender page

This commit is contained in:
Nicola Murino
2021-06-08 13:24:28 +02:00
parent feec2118bb
commit 4be6307d87
15 changed files with 322 additions and 57 deletions

View File

@@ -14,7 +14,12 @@ import (
)
func getDefenderHosts(w http.ResponseWriter, r *http.Request) {
render.JSON(w, r, common.GetDefenderHosts())
hosts := common.GetDefenderHosts()
if hosts == nil {
render.JSON(w, r, make([]common.DefenderEntry, 0))
return
}
render.JSON(w, r, hosts)
}
func getDefenderHostByID(w http.ResponseWriter, r *http.Request) {