dashboard

package
v4.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: AGPL-3.0 Imports: 5 Imported by: 4

README

后台仪表盘

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = &Dashboards{
	Backend: &Dashboard{
		Cards:         cards,
		Blocks:        &blocks,
		GlobalHeads:   &globalHeads,
		GlobalFooters: &globalFooters,
		TopButtons:    &topButtons,
	},
	Frontend: &Dashboard{},
}

Functions

func BlockAdd

func BlockAdd(index int, block ...*Block)

func BlockRegister

func BlockRegister(block ...*Block)

func BlockRemove

func BlockRemove(index int)

BlockRemove 删除元素

func BlockSet

func BlockSet(index int, list ...*Block)

BlockSet 设置元素

func CardAdd

func CardAdd(index int, card ...*Card)

func CardRegister

func CardRegister(card ...*Card)

func CardRemove

func CardRemove(index int)

CardRemove 删除元素

func CardSet

func CardSet(index int, list ...*Card)

CardSet 设置元素

func GlobalFooterAdd

func GlobalFooterAdd(index int, footer ...*GlobalFooter)

func GlobalFooterRegister

func GlobalFooterRegister(footer ...*GlobalFooter)

func GlobalFooterRemove

func GlobalFooterRemove(index int)

GlobalFooterRemove 删除元素

func GlobalFooterSet

func GlobalFooterSet(index int, list ...*GlobalFooter)

GlobalFooterSet 设置元素

func GlobalHeadAdd

func GlobalHeadAdd(index int, footer ...*GlobalHead)

func GlobalHeadRegister

func GlobalHeadRegister(footer ...*GlobalHead)

func GlobalHeadRemove

func GlobalHeadRemove(index int)

GlobalHeadRemove 删除元素

func GlobalHeadSet

func GlobalHeadSet(index int, list ...*GlobalHead)

GlobalHeadSet 设置元素

func TopButtonAdd

func TopButtonAdd(index int, topButton ...*Button)

func TopButtonFindTmpl

func TopButtonFindTmpl(tmpl string) int

func TopButtonRegister

func TopButtonRegister(topButton ...*Button)

func TopButtonRemove

func TopButtonRemove(index int)

TopButtonRemove 删除元素

func TopButtonRemoveByTmpl

func TopButtonRemoveByTmpl(tmpl string)

func TopButtonSearch

func TopButtonSearch(cb func(*Button) bool) int

func TopButtonSet

func TopButtonSet(index int, list ...*Button)

TopButtonSet 设置元素

Types

type Block

type Block struct {
	Title  string `json:",omitempty" xml:",omitempty"` // 标题
	Ident  string `json:",omitempty" xml:",omitempty"` // 英文标识
	Extra  echo.H `json:",omitempty" xml:",omitempty"` // 附加数据
	Hidden sql.NullBool
	Tmpl   string //模板文件
	Footer string //页脚模板文件
	// contains filtered or unexported fields
}

func NewBlock

func NewBlock(content func(echo.Context) error) *Block

func (*Block) IsHidden

func (c *Block) IsHidden(ctx echo.Context) (hidden bool)

func (*Block) Ready

func (c *Block) Ready(ctx echo.Context) error

func (*Block) SetContentGenerator

func (c *Block) SetContentGenerator(content func(echo.Context) error) *Block

func (*Block) SetExtra

func (c *Block) SetExtra(extra echo.H) *Block

func (*Block) SetExtraKV

func (c *Block) SetExtraKV(key string, value interface{}) *Block

func (*Block) SetFooter

func (c *Block) SetFooter(footer string) *Block

func (*Block) SetHidden

func (c *Block) SetHidden(hidden bool) *Block

func (*Block) SetHiddenDetector

func (c *Block) SetHiddenDetector(hidden func(echo.Context) bool) *Block

func (*Block) SetIdent

func (c *Block) SetIdent(ident string) *Block

func (*Block) SetTitle

func (c *Block) SetTitle(title string) *Block

func (*Block) SetTmpl

func (c *Block) SetTmpl(tmpl string) *Block

type Blocks

type Blocks []*Block

func BlockAll

func BlockAll(ctx echo.Context) Blocks

func (*Blocks) Add

func (c *Blocks) Add(index int, list ...*Block)

Add 添加列表项

func (*Blocks) FindTmpl

func (c *Blocks) FindTmpl(tmpl string) int

func (*Blocks) Ready

func (c *Blocks) Ready(ctx echo.Context) error

func (*Blocks) Remove

func (c *Blocks) Remove(index int)

Remove 删除元素

func (*Blocks) RemoveByTmpl

func (c *Blocks) RemoveByTmpl(tmpl string)

func (*Blocks) Search

func (c *Blocks) Search(cb func(*Block) bool) int

func (*Blocks) Set

func (c *Blocks) Set(index int, list ...*Block)

Set 设置元素

func (*Blocks) Size

func (c *Blocks) Size() int

type Button added in v4.1.0

type Button = Tmplx

func NewButton added in v4.1.0

func NewButton(tmpl string, handle ...func(echo.Context) error) *Button

type Buttons added in v4.1.0

type Buttons = Tmplxs

func TopButtonAll

func TopButtonAll(_ echo.Context) Buttons

type Card

type Card struct {
	IconName  string      //图标名称:fa-tasks
	IconColor string      //图标颜色:primary、success、danger、warning、info
	Short     string      //简称
	Name      string      //中文名称
	Summary   string      //说明
	Content   interface{} //数字等内容
	Hidden    sql.NullBool
	// contains filtered or unexported fields
}

func NewCard

func NewCard(content func(echo.Context) interface{}) *Card

func (*Card) Build

func (c *Card) Build(ctx echo.Context) *Card

func (*Card) IsHidden

func (c *Card) IsHidden(ctx echo.Context) (hidden bool)

func (*Card) SetContentGenerator

func (c *Card) SetContentGenerator(content func(echo.Context) interface{}) *Card

func (*Card) SetHidden

func (c *Card) SetHidden(hidden bool) *Card

func (*Card) SetHiddenDetector

func (c *Card) SetHiddenDetector(hidden func(echo.Context) bool) *Card

type Cards

type Cards []*Card

func CardAll

func CardAll(_ echo.Context) *Cards

func (*Cards) Add

func (c *Cards) Add(index int, list ...*Card)

func (*Cards) Build

func (c *Cards) Build(ctx echo.Context) Cards

func (*Cards) FindShort

func (c *Cards) FindShort(short string) int

func (*Cards) Remove

func (c *Cards) Remove(index int)

Remove 删除元素

func (*Cards) RemoveByShort

func (c *Cards) RemoveByShort(tmpl string)

func (*Cards) Search

func (c *Cards) Search(cb func(*Card) bool) int

func (*Cards) Set

func (c *Cards) Set(index int, list ...*Card)

Set 设置元素

func (*Cards) Size

func (c *Cards) Size() int

type Dashboard

type Dashboard struct {
	Cards         *Cards
	Blocks        *Blocks
	GlobalHeads   *GlobalHeads
	GlobalFooters *GlobalFooters
	TopButtons    *Buttons
}

type Dashboards

type Dashboards struct {
	Backend  *Dashboard
	Frontend *Dashboard
}
type GlobalFooter = Tmplx

func NewGlobalFooter

func NewGlobalFooter(tmpl string, handle ...func(echo.Context) error) *GlobalFooter

type GlobalFooters

type GlobalFooters = Tmplxs

func GlobalFooterAll

func GlobalFooterAll(_ echo.Context) GlobalFooters
type GlobalHead = Tmplx

func NewGlobalHead

func NewGlobalHead(tmpl string, handle ...func(echo.Context) error) *GlobalHead

type GlobalHeads

type GlobalHeads = Tmplxs

func GlobalHeadAll

func GlobalHeadAll(_ echo.Context) GlobalHeads

type Page added in v4.1.0

type Page struct {
	Key   string
	Tmpls map[string][]string
	// contains filtered or unexported fields
}

func NewPage added in v4.1.0

func NewPage(key string, atmpls ...map[string][]string) *Page

func (*Page) AddTmpl added in v4.1.0

func (s *Page) AddTmpl(position string, tmpl ...string) *Page

func (*Page) Fire added in v4.1.0

func (s *Page) Fire(ctx echo.Context) error

func (*Page) On added in v4.1.0

func (s *Page) On(method string, hook func(echo.Context) error) *Page

func (*Page) Tmpl added in v4.1.0

func (s *Page) Tmpl(position string) []string

type Tmplx added in v4.1.0

type Tmplx struct {
	Tmpl string //模板文件
	// contains filtered or unexported fields
}

func NewTmplx added in v4.1.0

func NewTmplx(tmpl string, handle ...func(echo.Context) error) *Tmplx

func (*Tmplx) Ready added in v4.1.0

func (c *Tmplx) Ready(ctx echo.Context) error

func (*Tmplx) SetContentGenerator added in v4.1.0

func (c *Tmplx) SetContentGenerator(content func(echo.Context) error) *Tmplx

func (*Tmplx) SetTmpl added in v4.1.0

func (c *Tmplx) SetTmpl(tmpl string) *Tmplx

type Tmplxs added in v4.1.0

type Tmplxs []*Tmplx

func (*Tmplxs) Add added in v4.1.0

func (c *Tmplxs) Add(index int, list ...*Tmplx)

func (*Tmplxs) FindTmpl added in v4.1.0

func (c *Tmplxs) FindTmpl(tmpl string) int

func (*Tmplxs) Ready added in v4.1.0

func (c *Tmplxs) Ready(ctx echo.Context) error

func (*Tmplxs) Remove added in v4.1.0

func (c *Tmplxs) Remove(index int)

Remove 删除元素

func (*Tmplxs) RemoveByTmpl added in v4.1.0

func (c *Tmplxs) RemoveByTmpl(tmpl string)

func (*Tmplxs) Search added in v4.1.0

func (c *Tmplxs) Search(cb func(*Tmplx) bool) int

func (*Tmplxs) Set added in v4.1.0

func (c *Tmplxs) Set(index int, list ...*Tmplx)

Set 设置元素

func (*Tmplxs) Size added in v4.1.0

func (c *Tmplxs) Size() int

Jump to

Keyboard shortcuts

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