ui

package
v2.0.0-beta.6 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const BaseTemplate = `` /* 3392-byte string literal not displayed */

BaseTemplate 基础 HTML 模板

Variables

This section is empty.

Functions

func Alert

func Alert(text, color string) template.HTML

Alert 警告框

func Badge

func Badge(text, color string) template.HTML

Badge 徽章

func Button

func Button(text, onclick, color string) template.HTML

Button 按钮

func Card

func Card(title string, content template.HTML) template.HTML

Card 渲染卡片

func CardWithAction

func CardWithAction(title string, actions, content template.HTML) template.HTML

CardWithAction 带操作按钮的卡片

func FormatBytes

func FormatBytes(b uint64) string

FormatBytes 格式化字节

func FormatPercent

func FormatPercent(p float64) string

FormatPercent 格式化百分比

func Grid

func Grid(cols int, content template.HTML) template.HTML

Grid 网格布局

func JSONBlock

func JSONBlock(id string) template.HTML

JSONBlock JSON 代码块

func Link(text, href, color string) template.HTML

Link 链接按钮

func ProgressBar

func ProgressBar(percent float64, color string) template.HTML

ProgressBar 进度条

func Render

func Render(data PageData) (string, error)

Render 渲染基础模板

func StatsCard

func StatsCard(label, value, subtext string) template.HTML

StatsCard 统计卡片

func TR

func TR(cells ...string) template.HTML

TR 表格行

func Table

func Table(headers []string) template.HTML

Table 表格开始

func TableEnd

func TableEnd() template.HTML

TableEnd 表格结束

Types

type PageData

type PageData struct {
	Title       string
	Description string
	Breadcrumb  []string
	Content     template.HTML
	ExtraHead   template.HTML
}

PageData 页面数据

Jump to

Keyboard shortcuts

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