components

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 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

Overview

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

templ: version: v0.3.1001

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EyeLogo(state string, sizePx int) templ.Component

EyeLogo is the animated brand mark — an almond-shaped eye with a pupil that dilates between three states. Mirrors the Android client's `design/GoloomEye.kt`. The state is bound via Alpine: replace `state` with an x-data expression at the call-site if it should react live (e.g. SSE flips the connection status).

States:

"idle"        - relaxed eye, slow blink loop
"connecting"  - pulsing pupil, eyebrow tightens
"on"          - fully open, accent-coloured iris

func InboundCard

func InboundCard(s inbound.Status) templ.Component

InboundCard renders one inbound row on the dashboard. Plain DOM node: refreshes via SSE replacing the whole InboundCardList wrapper, or per-card htmx targeted swap via #inbound-card-<id>. Action buttons hit the JSON API endpoints from the original admin server, then trigger a targeted refresh.

func InboundCardList

func InboundCardList(items []inbound.Status) templ.Component

InboundCardList is the wrapper that holds all card elements; SSE "inbounds" event replaces this whole node so newly created / removed inbounds appear without a page refresh.

func Modal(name, title string) templ.Component

Modal is a generic Alpine-driven dialog. Show/hide by toggling `Alpine.store('modals').<name>` boolean, e.g.:

<button @click="$store.modals.account = true">Аккаунт</button>
@components.Modal("account", "Сменить пароль") { ... }

Backdrop click closes; Esc closes; focus trap is handled by Alpine where `x-trap.inert` is supported, otherwise it's a soft trap.

func ModalsStore

func ModalsStore() templ.Component

ModalsStore registers the Alpine store the Modal component reads from. Drop one of these once per page (typically in Layout-level children) so all modals share state cleanly.

func StatChip

func StatChip(label, phase string) templ.Component

StatChip is a small status pill — used both for inbound phase and for admin warning banners. The colour is derived from the phase string so callers don't have to keep a parallel switch.

func WGTable

func WGTable(rows []WGRow) templ.Component

WGTable renders the bottom-of-dashboard wireguard interface list. Re-fetched every 5s by HTMX (see Dashboard).

Types

type WGRow

type WGRow struct {
	Name       string
	ListenPort int
	NumPeers   int
	Managed    bool
	InboundTag string
}

WGRow describes one row in the WG-interface table. Mirrors admin.wgInterfaceInfo so we can render without exposing internal types into the ui package.

Jump to

Keyboard shortcuts

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