HoneyComb

HoneyComb is a web interface for managing FreeBSD jails and Bhyve VMs.
Log | Files | Refs | README | LICENSE

ui.go (704B)


      1 /*
      2  * Rendering UI elements for the application.
      3  */
      4 package main
      5 
      6 import (
      7 	"html/template"
      8 	"net/http"
      9 )
     10 
     11 /*
     12  * This function handles rendering the buttons for the
     13  * various jails, and in future VMs on the system.
     14  */
     15 func render_ui(w http.ResponseWriter, r *http.Request, j_name string) {
     16 	tmpl := template.Must(template.ParseFiles("static/buttons.html"))
     17 	tmpl.Execute(w, map[string]string{"j_name": j_name})
     18 }
     19 
     20 /* Example function to be able to pass arguments through 	*/
     21 /* The web server handler									*/
     22 func handler(w http.ResponseWriter, r *http.Request, random string) {
     23 	tmpl := template.Must(template.ParseFiles("static/hello.html"))
     24 	tmpl.Execute(w, map[string]string{"Name": random})
     25 }