mirror of
https://github.com/juanfont/headscale.git
synced 2025-04-17 17:39:50 -04:00
* Changed all the HTML into go using go-elem Created templates package in ./hscontrol/templates. Moved the registerWebAPITemplate into the templates package as a function to be called. Replaced the apple and windows html files with go-elem. * update flake Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> --------- Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com> Co-authored-by: Kristoffer Dalby <kristoffer@tailscale.com>
35 lines
965 B
Go
35 lines
965 B
Go
package templates
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/chasefleming/elem-go"
|
|
"github.com/chasefleming/elem-go/attrs"
|
|
"github.com/chasefleming/elem-go/styles"
|
|
)
|
|
|
|
var codeStyleRegisterWebAPI = styles.Props{
|
|
styles.Display: "block",
|
|
styles.Padding: "20px",
|
|
styles.Border: "1px solid #bbb",
|
|
styles.BackgroundColor: "#eee",
|
|
}
|
|
|
|
func RegisterWeb(key string) *elem.Element {
|
|
return HtmlStructure(
|
|
elem.Title(nil, elem.Text("Registration - Headscale")),
|
|
elem.Body(attrs.Props{
|
|
attrs.Style: styles.Props{
|
|
styles.FontFamily: "sans",
|
|
}.ToInline(),
|
|
},
|
|
elem.H1(nil, elem.Text("headscale")),
|
|
elem.H2(nil, elem.Text("Machine registration")),
|
|
elem.P(nil, elem.Text("Run the command below in the headscale server to add this machine to your network: ")),
|
|
elem.Code(attrs.Props{attrs.Style: codeStyleRegisterWebAPI.ToInline()},
|
|
elem.Text(fmt.Sprintf("headscale nodes register --user USERNAME --key %s", key)),
|
|
),
|
|
),
|
|
)
|
|
}
|