added variable templating, template parts

This commit is contained in:
2025-10-12 14:35:15 +00:00
parent 68c9aad3a1
commit 1a1ef9b55f
10 changed files with 59 additions and 8 deletions

View File

@ -3,6 +3,7 @@ package manager
// package for the web menagment of the api paths
import (
"api_manager/lib"
"api_manager/web/api"
"api_manager/web/render"
"fmt"
@ -29,3 +30,18 @@ func Show_apis(w http.ResponseWriter, req *http.Request) {
fmt.Fprint(w, render.Template_with_string(eval))
}
func Render_apis(w http.ResponseWriter, req *http.Request) {
apis := api.Apis()
eval := "<div>"
for tag, varr := range apis {
eval_group := ""
eval_group += tag
eval_group += "-"
eval_group += fmt.Sprintf("%v", varr)
eval_group += "<br>"
eval += eval_group
}
eval += "</div>"
fmt.Fprint(w, render.Put_vars_to_template(render.Template_with_part("json_out"), lib.Map_args("json_code", eval)))
}