components

package
v0.0.42 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2026 License: BSD-2-Clause-Views Imports: 12 Imported by: 0

README

components

This module contains templ components for use by the server module when outputting HTML documents.

After modifying any .templ files run go generate to regenerate the code.

Documentation

Overview

templ: version: v0.3.1001

Index

Constants

This section is empty.

Variables

View Source
var CSSFS embed.FS
View Source
var JsFS embed.FS

The "all:" prefix is needed here because by default files beginning with ‘.’ or ‘_’ are excluded and we want to include "_hyperscript.min.js"

Functions

func APITokensContent added in v0.0.25

func APITokensContent(orgName string, orgClientCreds []cdntypes.OrgClientCredentialSafe, flashMessages []string, tokenURL *url.URL, serverURL *url.URL, errorMessage string) templ.Component

func ActivateServiceVersionContent

func ActivateServiceVersionContent(orgName string, serviceName string, version int64, err error) templ.Component

func AddressesString added in v0.0.30

func AddressesString(node cdntypes.Node) string

AddressesString formats a node's addresses as newline-separated text for display in textarea form fields.

func CacheNodesContent added in v0.0.30

func CacheNodesContent(nodes []cdntypes.CacheNodeListItem, nodeGroups []cdntypes.NodeGroup, flashMessages []string, errorMessage string) templ.Component

func ConsoleErrorContent added in v0.0.30

func ConsoleErrorContent(errorMessage string) templ.Component

func ConsolePage

func ConsolePage(u *url.URL, title string, ad cdntypes.AuthData, orgName string, availableOrgNames []string, contents templ.Component, itemLabel string) templ.Component

func CreateAPITokenContent added in v0.0.25

func CreateAPITokenContent(orgName string, atData APITokenData) templ.Component

func CreateCacheNodeContent added in v0.0.30

func CreateCacheNodeContent(formData CacheNodeFormData) templ.Component

func CreateDomainContent

func CreateDomainContent(orgName string, dData DomainData) templ.Component

func CreateIPNetworkContent added in v0.0.38

func CreateIPNetworkContent(formData IPNetworkFormData) templ.Component

func CreateL4LBNodeContent added in v0.0.30

func CreateL4LBNodeContent(formData L4LBNodeFormData) templ.Component

func CreateNodeGroupContent added in v0.0.30

func CreateNodeGroupContent(formData NodeGroupFormData) templ.Component

func CreateOrgContent added in v0.0.30

func CreateOrgContent(formData OrgFormData) templ.Component

func CreateServiceContent

func CreateServiceContent(orgName string, err error) templ.Component

func CreateServiceVersionContent

func CreateServiceVersionContent(serviceName string, orgName string, domains []cdntypes.Domain, originGroups []cdntypes.OriginGroup, submittedData *cdntypes.CreateServiceVersionForm, vclTemplateValue string, cloneData cdntypes.ServiceVersionCloneData, err error, errDetails string) templ.Component

func CreateUserContent added in v0.0.30

func CreateUserContent(formData UserFormData, roles []cdntypes.Role, orgs []cdntypes.Org) templ.Component

func Dashboard

func Dashboard(dashData cdntypes.DashboardData) templ.Component

func DomainsContent

func DomainsContent(orgName string, domains []cdntypes.Domain, verificationTag string, tagSeparator string, flashMessages []string, errorMessage string) templ.Component

func EditCacheNodeContent added in v0.0.30

func EditCacheNodeContent(nodeName string, formData CacheNodeFormData) templ.Component

func EditL4LBNodeContent added in v0.0.30

func EditL4LBNodeContent(nodeName string, formData L4LBNodeFormData) templ.Component

func EditNodeGroupContent added in v0.0.30

func EditNodeGroupContent(groupName string, formData NodeGroupFormData) templ.Component

func EditOrgContent added in v0.0.30

func EditOrgContent(orgName string, formData OrgFormData) templ.Component

func EditUserContent added in v0.0.30

func EditUserContent(formData UserFormData, roles []cdntypes.Role, orgs []cdntypes.Org, authProvider string, userID string, passwordResetData PasswordResetFormData) templ.Component

func IPNetworksContent added in v0.0.38

func IPNetworksContent(ipNetworks []cdntypes.IPNetworkListItem, flashMessages []string, errorMessage string) templ.Component

func L4LBNodesContent added in v0.0.30

func L4LBNodesContent(nodes []cdntypes.L4LBNodeListItem, nodeGroups []cdntypes.NodeGroup, flashMessages []string, errorMessage string) templ.Component

func LoginPage

func LoginPage(returnTo string, loginFailed bool) templ.Component
func NavBar(u *url.URL, ad cdntypes.AuthData, orgName string, availableOrgNames []string) templ.Component

func NewAPITokenContent added in v0.0.25

func NewAPITokenContent(orgName string, newOrgCred cdntypes.NewOrgClientCredential, returnURL string) templ.Component

func NodeGroupsContent added in v0.0.30

func NodeGroupsContent(nodeGroups []cdntypes.NodeGroup, flashMessages []string, errorMessage string) templ.Component

func OrgsContent added in v0.0.30

func OrgsContent(orgs []cdntypes.OrgListItem, flashMessages []string, errorMessage string) templ.Component

func OriginFieldSet

func OriginFieldSet(orgName string, serviceName string, index int, numFields int, submittedOrigin *cdntypes.CreateServiceVersionOrigin, cloneOrigin cdntypes.Origin, originGroups []cdntypes.OriginGroup, htmxRequest bool) templ.Component

func ServiceContent

func ServiceContent(orgName string, serviceName string, serviceVersions []cdntypes.ServiceVersion) templ.Component

func ServiceVersionContent

func ServiceVersionContent(serviceName string, sv cdntypes.ServiceVersionConfig) templ.Component

func ServicesContent

func ServicesContent(orgName string, services []ServiceEntry, flashMessages []string, errorMessage string) templ.Component

func UsersContent added in v0.0.30

func UsersContent(users []cdntypes.UserListItem, flashMessages []string, errorMessage string) templ.Component

Types

type APITokenData added in v0.0.25

type APITokenData struct {
	APITokenFormFields
	Errors APITokenErrors
}

type APITokenErrors added in v0.0.25

type APITokenErrors struct {
	APITokenFormFields
	ServerError string
}

type APITokenFormFields added in v0.0.25

type APITokenFormFields struct {
	Name        string
	Description string
}
type Breadcrumb struct {
	Label string
	URL   string
}

Breadcrumb represents one item in the breadcrumb navigation trail.

type CacheNodeFormData added in v0.0.30

type CacheNodeFormData struct {
	NodeFormFields
	Errors NodeFormErrors
}

type DomainData

type DomainData struct {
	DomainFormFields
	Errors DomainErrors
}

type DomainErrors

type DomainErrors struct {
	DomainFormFields
	ServerError string
}

type DomainFormFields

type DomainFormFields struct {
	FQDN string
}

type IPNetworkFormData added in v0.0.38

type IPNetworkFormData struct {
	IPNetworkFormFields
	Errors IPNetworkFormErrors
}

type IPNetworkFormErrors added in v0.0.38

type IPNetworkFormErrors struct {
	Network     string
	ServerError string
}

type IPNetworkFormFields added in v0.0.38

type IPNetworkFormFields struct {
	Network string
}

type L4LBNodeFormData added in v0.0.30

type L4LBNodeFormData struct {
	NodeFormFields
	Errors NodeFormErrors
}

type NodeFormErrors added in v0.0.30

type NodeFormErrors struct {
	Name        string
	Description string
	Addresses   string
	ServerError string
}

type NodeFormFields added in v0.0.30

type NodeFormFields struct {
	Name        string
	Description string
	Addresses   string
}

type NodeGroupFormData added in v0.0.30

type NodeGroupFormData struct {
	NodeGroupFormFields
	Errors NodeGroupFormErrors
}

type NodeGroupFormErrors added in v0.0.30

type NodeGroupFormErrors struct {
	Name        string
	Description string
	ServerError string
}

type NodeGroupFormFields added in v0.0.30

type NodeGroupFormFields struct {
	Name        string
	Description string
}

type OrgFormData added in v0.0.30

type OrgFormData struct {
	OrgFormFields
	Errors OrgFormErrors
}

type OrgFormErrors added in v0.0.30

type OrgFormErrors struct {
	Name             string
	ServiceQuota     string
	DomainQuota      string
	ClientTokenQuota string
	ServerError      string
}

type OrgFormFields added in v0.0.30

type OrgFormFields struct {
	Name             string
	ServiceQuota     string
	DomainQuota      string
	ClientTokenQuota string
}

type PasswordResetFormData added in v0.0.30

type PasswordResetFormData struct {
	PasswordResetFormFields
	Errors PasswordResetFormErrors
}

type PasswordResetFormErrors added in v0.0.30

type PasswordResetFormErrors struct {
	Password        string // #nosec G117 -- Error message for password field, not a secret
	ConfirmPassword string
	ServerError     string
}

type PasswordResetFormFields added in v0.0.30

type PasswordResetFormFields struct {
	Password        string `schema:"password" validate:"required,min=15,max=64"`            // #nosec G117 -- Used for form password input, never used for serialized output
	ConfirmPassword string `schema:"confirm-password" validate:"required,eqfield=Password"` // #nosec G117 -- Used for form password input, never used for serialized output
}

type ServiceEntry added in v0.0.30

type ServiceEntry struct {
	cdntypes.Service
	IPAddresses []netip.Addr
}

ServiceEntry is a console-specific view type that combines a Service with its allocated IP addresses for display on the services overview page.

type UserFormData added in v0.0.30

type UserFormData struct {
	UserFormFields
	Errors UserFormErrors
}

type UserFormErrors added in v0.0.30

type UserFormErrors struct {
	DisplayName     string
	Role            string
	Org             string
	Password        string // #nosec G117 -- Error message for password field, not a secret
	ConfirmPassword string
	ServerError     string
}

type UserFormFields added in v0.0.30

type UserFormFields struct {
	DisplayName     string `schema:"display_name" validate:"required,min=1,max=63"`
	Role            string `schema:"role" validate:"required"`
	Org             string `schema:"org"`
	Password        string `schema:"password"`         // #nosec G117 -- Used for form password input, never used for serialized output
	ConfirmPassword string `schema:"confirm-password"` // #nosec G117 -- Used for form password input, never used for serialized output
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL