Recursive tree version

This commit is contained in:
Magnus Åhall 2026-02-24 17:21:55 +01:00
parent 42c5d43610
commit 97058d036d
8 changed files with 599 additions and 134 deletions

View file

@ -6,12 +6,12 @@ import (
// Standard
"embed"
"encoding/json"
_ "encoding/json"
"fmt"
"net/http"
"os"
"slices"
"html/template"
_ "html/template"
)
var (
@ -66,8 +66,10 @@ func rootHandler(w http.ResponseWriter, r *http.Request) {
slices.SortFunc(entries, SortDNSRecord)
data["DNSRecords"] = entries
/*
tree := BuildRecordsTree(entries)
htmlElements := tree.ToHTMLElements([]string{})
data["TreeData"] = tree
var html string
for _, el := range htmlElements {
@ -78,6 +80,7 @@ func rootHandler(w http.ResponseWriter, r *http.Request) {
j, _ := json.Marshal(tree)
os.WriteFile("/tmp/tree.json", j, 0644)
*/
data["VERSION"] = VERSION
page.Data = data