ui

package
v0.35.6 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: GPL-3.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderManagementShell

func RenderManagementShell(bootstrap any, metadata ManagementShellMetadata) (string, error)

func RenderManagementShellWithAssets

func RenderManagementShellWithAssets(bootstrap any, metadata ManagementShellMetadata, assets ManagementShellAssets) (string, error)

func RenderToString

func RenderToString(page *Page) (string, error)

func SetRoot

func SetRoot(root string)

Types

type LoginPageCommonData

type LoginPageCommonData struct {
	WebBaseURL     string
	HeadCustomCode template.HTML
	Version        string
	Year           int
	CaptchaOpen    bool
	CaptchaHTML    template.HTML
}

func (LoginPageCommonData) Map

func (d LoginPageCommonData) Map() map[string]any

type ManagementPageCommonData

type ManagementPageCommonData struct {
	WebBaseURL     string
	HeadCustomCode template.HTML
	Version        string
	Year           int
	IsAdmin        bool
	// ServerUpdate tells whether the server can be updated from the web.
	ServerUpdate bool
	// ServerUpdateAvailable tells that a newer release is known already.
	ServerUpdateAvailable bool
	// MixPlain tells that the mixed port accepts plaintext carriers (tcp,
	// ws, http).
	MixPlain bool
	// AdmitKey is the admission key of the exchange carrier, as hex, shown to
	// administrators only.
	AdmitKey string
	// MixIP and MixPort are the mixed port, where a type=auto link connects;
	// the port is "" when there is none.
	MixIP, MixPort string
	// MixQUICALPN is the ALPN the UDP side of the mixed port takes for quic.
	MixQUICALPN string
	// MixUDPPort is the port quic reaches the mixed port on: the port it
	// listens on, as a port mapping or proxy given in bridge_addr (MixPort)
	// usually carries TCP only.
	MixUDPPort string
	Username   string
	BridgeType string
	// VisitorVKey, when set, is the vkey the access commands show.
	VisitorVKey   string
	BridgeAddr    string
	BridgeIP      string
	BridgePort    string
	WindowsSuffix string
	TCPIP         string
	TCPPort       string
	KCPPort       string
	TLSIP         string
	TLSPort       string
	QUICIP        string
	QUICPort      string
	QUICALPN      string
	QUICAddr      string
	WSPath        string
	WSIP          string
	WSPort        string
	WSSIP         string
	WSSPort       string
	ProxyPort     string
	// Features are the feature switches the templates test, by name.
	Features map[string]bool
}

func (ManagementPageCommonData) LinkURLs added in v0.35.0

func (d ManagementPageCommonData) LinkURLs() map[string]string

LinkURLs are the launch links of the enabled bridge carriers, by type (auto where there is a mixed port, tcp, tls, quic, ws, wss, http, https): the one place the start commands take them from. A link has no vkey yet, "npc://@host:port", for the page to put in with npcLink (language.js); an HTTP link carries the path, a QUIC link the ALPN.

func (ManagementPageCommonData) Map

func (d ManagementPageCommonData) Map() map[string]any

type ManagementShellAssets

type ManagementShellAssets struct {
	Ready   bool     `json:"ready"`
	Styles  []string `json:"styles,omitempty"`
	Scripts []string `json:"scripts,omitempty"`
}

func DefaultManagementShellAssets

func DefaultManagementShellAssets(baseURL string) ManagementShellAssets

func ResolveManagementShellAssets

func ResolveManagementShellAssets(staticRoot, staticBase string) ManagementShellAssets

func (ManagementShellAssets) Clone

type ManagementShellMetadata

type ManagementShellMetadata struct {
	BaseURL        string
	HeadCustomCode string
}

type Model

type Model struct {
	Controller string         `json:"controller"`
	Action     string         `json:"action"`
	TplName    string         `json:"tpl_name"`
	Layout     string         `json:"layout,omitempty"`
	Data       map[string]any `json:"data"`
}

func PageModel

func PageModel(page *Page) *Model

type Page

type Page struct {
	Controller string
	Action     string
	Template   string
	Layout     string
	Data       map[string]any
}

Jump to

Keyboard shortcuts

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