mirror of
https://github.com/containous/traefik.git
synced 2024-12-22 13:34:03 +03:00
web provider renderer
This commit is contained in:
parent
f6d587b16a
commit
d3071ca110
9
web.go
9
web.go
@ -7,7 +7,6 @@ import (
|
||||
"github.com/gorilla/handlers"
|
||||
"github.com/unrolled/render"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"encoding/json"
|
||||
"log"
|
||||
@ -50,11 +49,5 @@ func GetConfigHandler(rw http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func GetHtmlConfigHandler(response http.ResponseWriter, request *http.Request) {
|
||||
templates := template.Must(template.ParseFiles("configuration.html"))
|
||||
response.Header().Set("Content-type", "text/html")
|
||||
err := request.ParseForm()
|
||||
if err != nil {
|
||||
http.Error(response, fmt.Sprintf("error parsing url %v", err), 500)
|
||||
}
|
||||
templates.ExecuteTemplate(response, "configuration.html", Page{Configuration:*currentConfiguration})
|
||||
renderer.HTML(response, http.StatusOK, "configuration", Page{Configuration:*currentConfiguration})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user