mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-07 00:46:58 +03:00
Add login page
This commit is contained in:
parent
d017ea17c8
commit
a78c9f3dd4
4 changed files with 92 additions and 0 deletions
|
@ -22,6 +22,10 @@ func (t *TemplateRegistry) Render(w io.Writer, name string, data interface{}, c
|
|||
err := errors.New("Template not found -> " + name)
|
||||
return err
|
||||
}
|
||||
// login page does not need the base layout
|
||||
if name == "login.html" {
|
||||
return tmpl.Execute(w, data)
|
||||
}
|
||||
return tmpl.ExecuteTemplate(w, "base.html", data)
|
||||
}
|
||||
|
||||
|
@ -29,6 +33,7 @@ func (t *TemplateRegistry) Render(w io.Writer, name string, data interface{}, c
|
|||
func New() *echo.Echo {
|
||||
e := echo.New()
|
||||
templates := make(map[string]*template.Template)
|
||||
templates["login.html"] = template.Must(template.ParseFiles("templates/login.html"))
|
||||
templates["clients.html"] = template.Must(template.ParseFiles("templates/clients.html", "templates/base.html"))
|
||||
templates["server.html"] = template.Must(template.ParseFiles("templates/server.html", "templates/base.html"))
|
||||
templates["global_settings.html"] = template.Must(template.ParseFiles("templates/global_settings.html", "templates/base.html"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue