2025-10-24 15:43:29 +02:00
|
|
|
package templates
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/chasefleming/elem-go"
|
|
|
|
|
"github.com/chasefleming/elem-go/attrs"
|
hscontrol/templates: refactor to use CSS classes and embedded files
Refactor template system to use go:embed for external assets and
CSS classes for styling instead of inline styles:
- general.go: Add go:embed directives for style.css and headscale.svg,
replace inline styles with CSS classes (H1, H2, H3, P, etc.),
add mdTypesetBody wrapper with Material for MkDocs styling
- apple.go, oidc_callback.go, register_web.go, windows.go:
Update to use new CSS-based helper functions (H1, H2, P, etc.)
and mdTypesetBody for consistent layout
This separates content from presentation, making templates easier
to maintain and update. All styling is now centralized in style.css
with Material for MkDocs design system.
2025-10-28 16:29:00 +01:00
|
|
|
"github.com/chasefleming/elem-go/styles"
|
2025-10-24 15:43:29 +02:00
|
|
|
)
|
|
|
|
|
|
hscontrol/templates: refactor to use CSS classes and embedded files
Refactor template system to use go:embed for external assets and
CSS classes for styling instead of inline styles:
- general.go: Add go:embed directives for style.css and headscale.svg,
replace inline styles with CSS classes (H1, H2, H3, P, etc.),
add mdTypesetBody wrapper with Material for MkDocs styling
- apple.go, oidc_callback.go, register_web.go, windows.go:
Update to use new CSS-based helper functions (H1, H2, P, etc.)
and mdTypesetBody for consistent layout
This separates content from presentation, making templates easier
to maintain and update. All styling is now centralized in style.css
with Material for MkDocs design system.
2025-10-28 16:29:00 +01:00
|
|
|
// checkboxIcon returns the success checkbox SVG icon as raw HTML.
|
2025-10-24 15:43:29 +02:00
|
|
|
func checkboxIcon() elem.Node {
|
hscontrol/templates: refactor to use CSS classes and embedded files
Refactor template system to use go:embed for external assets and
CSS classes for styling instead of inline styles:
- general.go: Add go:embed directives for style.css and headscale.svg,
replace inline styles with CSS classes (H1, H2, H3, P, etc.),
add mdTypesetBody wrapper with Material for MkDocs styling
- apple.go, oidc_callback.go, register_web.go, windows.go:
Update to use new CSS-based helper functions (H1, H2, P, etc.)
and mdTypesetBody for consistent layout
This separates content from presentation, making templates easier
to maintain and update. All styling is now centralized in style.css
with Material for MkDocs design system.
2025-10-28 16:29:00 +01:00
|
|
|
return elem.Raw(`<svg id="checkbox" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 512 512">
|
2025-10-24 15:43:29 +02:00
|
|
|
<path d="M256 32C132.3 32 32 132.3 32 256s100.3 224 224 224 224-100.3 224-224S379.7 32 256 32zm114.9 149.1L231.8 359.6c-1.1 1.1-2.9 3.5-5.1 3.5-2.3 0-3.8-1.6-5.1-2.9-1.3-1.3-78.9-75.9-78.9-75.9l-1.5-1.5c-.6-.9-1.1-2-1.1-3.2 0-1.2.5-2.3 1.1-3.2.4-.4.7-.7 1.1-1.2 7.7-8.1 23.3-24.5 24.3-25.5 1.3-1.3 2.4-3 4.8-3 2.5 0 4.1 2.1 5.3 3.3 1.2 1.2 45 43.3 45 43.3l111.3-143c1-.8 2.2-1.4 3.5-1.4 1.3 0 2.5.5 3.5 1.3l30.6 24.1c.8 1 1.3 2.2 1.3 3.5.1 1.3-.4 2.4-1 3.3z"></path>
|
|
|
|
|
</svg>`)
|
|
|
|
|
}
|
|
|
|
|
|
hscontrol/templates: refactor to use CSS classes and embedded files
Refactor template system to use go:embed for external assets and
CSS classes for styling instead of inline styles:
- general.go: Add go:embed directives for style.css and headscale.svg,
replace inline styles with CSS classes (H1, H2, H3, P, etc.),
add mdTypesetBody wrapper with Material for MkDocs styling
- apple.go, oidc_callback.go, register_web.go, windows.go:
Update to use new CSS-based helper functions (H1, H2, P, etc.)
and mdTypesetBody for consistent layout
This separates content from presentation, making templates easier
to maintain and update. All styling is now centralized in style.css
with Material for MkDocs design system.
2025-10-28 16:29:00 +01:00
|
|
|
// OIDCCallback renders the OIDC authentication success callback page.
|
2025-10-24 15:43:29 +02:00
|
|
|
func OIDCCallback(user, verb string) *elem.Element {
|
hscontrol/templates: refactor to use CSS classes and embedded files
Refactor template system to use go:embed for external assets and
CSS classes for styling instead of inline styles:
- general.go: Add go:embed directives for style.css and headscale.svg,
replace inline styles with CSS classes (H1, H2, H3, P, etc.),
add mdTypesetBody wrapper with Material for MkDocs styling
- apple.go, oidc_callback.go, register_web.go, windows.go:
Update to use new CSS-based helper functions (H1, H2, P, etc.)
and mdTypesetBody for consistent layout
This separates content from presentation, making templates easier
to maintain and update. All styling is now centralized in style.css
with Material for MkDocs design system.
2025-10-28 16:29:00 +01:00
|
|
|
// Success message box
|
|
|
|
|
successBox := elem.Div(attrs.Props{
|
|
|
|
|
attrs.Style: styles.Props{
|
|
|
|
|
styles.Display: "flex",
|
|
|
|
|
styles.AlignItems: "center",
|
|
|
|
|
styles.Gap: spaceM,
|
|
|
|
|
styles.Padding: spaceL,
|
|
|
|
|
styles.BackgroundColor: colorSuccessLight,
|
|
|
|
|
styles.Border: "1px solid " + colorSuccess,
|
|
|
|
|
styles.BorderRadius: "0.5rem",
|
|
|
|
|
styles.MarginBottom: spaceXL,
|
|
|
|
|
}.ToInline(),
|
|
|
|
|
},
|
|
|
|
|
checkboxIcon(),
|
|
|
|
|
elem.Div(nil,
|
|
|
|
|
elem.Strong(attrs.Props{
|
|
|
|
|
attrs.Style: styles.Props{
|
|
|
|
|
styles.Display: "block",
|
|
|
|
|
styles.Color: colorSuccess,
|
|
|
|
|
styles.FontSize: fontSizeH3,
|
|
|
|
|
styles.MarginBottom: spaceXS,
|
|
|
|
|
}.ToInline(),
|
|
|
|
|
}, elem.Text("Signed in successfully")),
|
|
|
|
|
elem.P(attrs.Props{
|
|
|
|
|
attrs.Style: styles.Props{
|
|
|
|
|
styles.Margin: "0",
|
|
|
|
|
styles.Color: colorTextPrimary,
|
|
|
|
|
styles.FontSize: fontSizeBase,
|
|
|
|
|
}.ToInline(),
|
|
|
|
|
}, elem.Text(verb), elem.Text(" as "), elem.Strong(nil, elem.Text(user)), elem.Text(". You can now close this window.")),
|
2025-10-24 15:43:29 +02:00
|
|
|
),
|
hscontrol/templates: refactor to use CSS classes and embedded files
Refactor template system to use go:embed for external assets and
CSS classes for styling instead of inline styles:
- general.go: Add go:embed directives for style.css and headscale.svg,
replace inline styles with CSS classes (H1, H2, H3, P, etc.),
add mdTypesetBody wrapper with Material for MkDocs styling
- apple.go, oidc_callback.go, register_web.go, windows.go:
Update to use new CSS-based helper functions (H1, H2, P, etc.)
and mdTypesetBody for consistent layout
This separates content from presentation, making templates easier
to maintain and update. All styling is now centralized in style.css
with Material for MkDocs design system.
2025-10-28 16:29:00 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
return HtmlStructure(
|
|
|
|
|
elem.Title(nil, elem.Text("Headscale Authentication Succeeded")),
|
|
|
|
|
mdTypesetBody(
|
|
|
|
|
headscaleLogo(),
|
|
|
|
|
successBox,
|
|
|
|
|
H2(elem.Text("Getting started")),
|
|
|
|
|
P(elem.Text("Check out the documentation to learn more about headscale and Tailscale:")),
|
|
|
|
|
Ul(
|
|
|
|
|
elem.Li(nil,
|
|
|
|
|
externalLink("https://github.com/juanfont/headscale/tree/main/docs", "Headscale documentation"),
|
|
|
|
|
),
|
|
|
|
|
elem.Li(nil,
|
|
|
|
|
externalLink("https://tailscale.com/kb/", "Tailscale knowledge base"),
|
2025-10-24 15:43:29 +02:00
|
|
|
),
|
|
|
|
|
),
|
hscontrol/templates: refactor to use CSS classes and embedded files
Refactor template system to use go:embed for external assets and
CSS classes for styling instead of inline styles:
- general.go: Add go:embed directives for style.css and headscale.svg,
replace inline styles with CSS classes (H1, H2, H3, P, etc.),
add mdTypesetBody wrapper with Material for MkDocs styling
- apple.go, oidc_callback.go, register_web.go, windows.go:
Update to use new CSS-based helper functions (H1, H2, P, etc.)
and mdTypesetBody for consistent layout
This separates content from presentation, making templates easier
to maintain and update. All styling is now centralized in style.css
with Material for MkDocs design system.
2025-10-28 16:29:00 +01:00
|
|
|
pageFooter(),
|
2025-10-24 15:43:29 +02:00
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
}
|