WIP
This commit is contained in:
parent
36baaf0caf
commit
ad638acaf3
7 changed files with 120 additions and 37 deletions
10
webserver.go
10
webserver.go
|
|
@ -11,6 +11,7 @@ import (
|
|||
"net/http"
|
||||
"os"
|
||||
"slices"
|
||||
"html/template"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -65,12 +66,17 @@ func rootHandler(w http.ResponseWriter, r *http.Request) {
|
|||
slices.SortFunc(entries, SortDNSRecord)
|
||||
data["DNSRecords"] = entries
|
||||
|
||||
tree := RecordsTree{}
|
||||
tree = tree.BuildTree(entries, 0, 1)
|
||||
fmt.Printf("\n\x1b[32;1mSTART\x1b[0m\n")
|
||||
tree := BuildRecordsTree(entries)
|
||||
htmlTree := tree.ToHTML([]string{})
|
||||
data["Tree"] = template.HTML(htmlTree)
|
||||
|
||||
fmt.Printf("\n\x1b[32;1mDONE\x1b[0m\n")
|
||||
|
||||
j, _ := json.Marshal(tree)
|
||||
os.WriteFile("/tmp/tree.json", j, 0644)
|
||||
|
||||
data["VERSION"] = VERSION
|
||||
page.Data = data
|
||||
|
||||
err = htmlEngine.Render(page, w, r)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue