Looks nicer
This commit is contained in:
parent
5112113aae
commit
ab08d745a1
6 changed files with 279 additions and 79 deletions
11
webserver.go
11
webserver.go
|
|
@ -67,18 +67,11 @@ func rootHandler(w http.ResponseWriter, r *http.Request) {
|
|||
data["DNSRecords"] = entries
|
||||
|
||||
tree := BuildRecordsTree(entries)
|
||||
htmlElements := tree.ToHTMLElements([]string{}, 0)
|
||||
htmlElements := tree.ToHTMLElements([]string{})
|
||||
|
||||
var html string
|
||||
for _, el := range htmlElements {
|
||||
if el.Header {
|
||||
html += el.HTML
|
||||
}
|
||||
}
|
||||
for _, el := range htmlElements {
|
||||
if !el.Header {
|
||||
html += el.HTML
|
||||
}
|
||||
html += el.HTML
|
||||
}
|
||||
|
||||
data["Tree"] = template.HTML(html)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue