admin

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Appearance

func Appearance(p view.Page, d AppearanceData) templ.Component

Appearance renders the per-user appearance settings. Saved server-side in a cookie – no JavaScript involved.

func DetailPage

func DetailPage(p view.Page, d DetailData) templ.Component

DetailPage renders sections of key/value lists, tables and forms.

func Form

func Form(d FormData) templ.Component

Form renders a form; also used inside detail pages.

func FormPage

func FormPage(p view.Page, d FormData) templ.Component

FormPage renders a page with one form.

func Table

func Table(d TableData) templ.Component

Table renders a table; also used inside detail pages.

func TablePage

func TablePage(p view.Page, d TableData) templ.Component

TablePage renders a page with one table.

Types

type AppearanceData

type AppearanceData struct {
	Messages  []view.Message
	Layouts   []Choice
	Themes    []Choice
	Densities []Choice
	CSRF      string // session token of the real UI; "" in the prototype
}

AppearanceData is the content of the appearance settings.

type Cell

type Cell struct {
	Text, Href, Rel string
	Title           string      // hover text (a full fingerprint, the exact time); escaped like every text
	Status          view.Status // set: the text is a status
	Mono, Num       bool
	NoWrap          bool
	Break           bool // long values (URLs, errors) wrap anywhere
	Posts           []PostCommand
}

Cell is one table cell.

type Choice

type Choice struct {
	Value, Label, Help string
	Checked            bool
}

Choice is one radio option with an explanation.

type Column

type Column struct {
	Label string
	Num   bool
}

Column is one table column.

type Command

type Command struct {
	Label, Href string
	Primary     bool
}

Command is a link in the command bar.

type DetailData

type DetailData struct {
	Messages []view.Message
	Steps    []components.Step // a wizard step line above the sections
	Commands []Command
	Sections []Section
}

DetailData is a detail page: commands and sections.

type Field

type Field struct {
	ID, Label, Type    string // text, password, textarea, select, checkbox, file, number, hidden
	Value, Hint, Error string
	Required, Checked  bool
	Options            []Option
	Rows               int
	Autocomplete       string // "" = off for passwords, else as given
	Accept             string // file inputs
}

Field is one form control.

type FormData

type FormData struct {
	Messages  []view.Message
	Steps     []components.Step // a wizard step line above the form
	Title     string            // a heading above the form (in sections)
	Intro     []string
	Pre       []Pre
	Action    string
	CSRF      string
	Multipart bool
	Fields    []Field
	Submit    string
	Danger    bool // the submit button is a dangerous action
	Cancel    string
	Method    string // "" = post; "get" for filters
}

FormData is a form with its fields.

type Option

type Option struct {
	Value, Label string
	Selected     bool
}

Option is one choice of a select.

type PostCommand added in v0.3.0

type PostCommand struct {
	Action, CSRF, Label       string
	Disabled, Command, Danger bool
	Fields                    []PostField
}

type PostField added in v0.3.0

type PostField struct{ Name, Value string }

type Pre

type Pre struct {
	Title, Text string
}

Pre is a block of text shown as is (CSR, extension file, instructions).

type Section

type Section struct {
	Title string
	Text  []string
	KV    []view.KV
	Pre   []Pre
	Table *TableData
	Forms []FormData
}

Section is one part of a detail page.

type TableData

type TableData struct {
	RefreshURL string // optional passive fragment polling
	Adaptive   bool   // wrap every column instead of scrolling narrow tables
	Messages   []view.Message
	Title      string // a heading (in sections)
	Commands   []Command
	Filters    *FormData
	Columns    []Column
	Rows       [][]Cell
	Empty      string
	// More links to the next page (cursor).
	More, MoreLabel string
}

TableData is a table with commands and filters.

Jump to

Keyboard shortcuts

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