go-admin: github.com/GoAdminGroup/go-admin/template/types Index | Files | Directories

package types

import "github.com/GoAdminGroup/go-admin/template/types"

Index

Package Files

components.go form.go info.go page.go

Constants

const DefaultPageSize = 10

Variables

var DefaultPageSizeList = []int{10, 20, 30, 50, 100}
var JoinFieldValueDelimiter = utils.Uuid(8)

func AddGlobalDisplayProcessFn Uses

func AddGlobalDisplayProcessFn(f DisplayProcessFn)

type Action Uses

type Action interface {
    Js() template.JS
    BtnAttribute() template.HTML
    ExtContent() template.HTML
    SetBtnId(btnId string)
    GetCallbacks() context.Node
}

type ActionButton Uses

type ActionButton struct {
    Id     string
    Title  template.HTML
    Action Action
}

func (ActionButton) Content Uses

func (b ActionButton) Content() (template.HTML, template.JS)

type AlertAttribute Uses

type AlertAttribute interface {
    SetTheme(value string) AlertAttribute
    SetTitle(value template.HTML) AlertAttribute
    SetContent(value template.HTML) AlertAttribute
    GetContent() template.HTML
}

type Attribute Uses

type Attribute struct {
    TemplateList map[string]string
}

Attribute is the component interface of template. Every component of template should implement it.

type BoxAttribute Uses

type BoxAttribute interface {
    SetHeader(value template.HTML) BoxAttribute
    SetBody(value template.HTML) BoxAttribute
    SetNoPadding() BoxAttribute
    SetFooter(value template.HTML) BoxAttribute
    SetTitle(value template.HTML) BoxAttribute
    WithHeadBorder() BoxAttribute
    SetStyle(value template.HTMLAttr) BoxAttribute
    SetHeadColor(value string) BoxAttribute
    SetTheme(value string) BoxAttribute
    SetSecondHeader(value template.HTML) BoxAttribute
    SetSecondHeadColor(value string) BoxAttribute
    WithSecondHeadBorder() BoxAttribute
    SetSecondHeaderClass(value string) BoxAttribute
    GetContent() template.HTML
}

type Button Uses

type Button interface {
    Content() (template.HTML, template.JS)
}

type ButtonAttribute Uses

type ButtonAttribute interface {
    SetContent(value template.HTML) ButtonAttribute
    SetOrientationRight() ButtonAttribute
    SetOrientationLeft() ButtonAttribute
    SetMarginLeft(int) ButtonAttribute
    SetMarginRight(int) ButtonAttribute
    SetThemePrimary() ButtonAttribute
    SetSmallSize() ButtonAttribute
    SetMiddleSize() ButtonAttribute
    SetHref(string) ButtonAttribute
    SetThemeWarning() ButtonAttribute
    SetTheme(value string) ButtonAttribute
    SetLoadingText(value template.HTML) ButtonAttribute
    SetThemeDefault() ButtonAttribute
    SetType(string) ButtonAttribute
    GetContent() template.HTML
}

type Buttons Uses

type Buttons []Button

func (Buttons) Content Uses

func (b Buttons) Content() (template.HTML, template.JS)

type Callbacks Uses

type Callbacks []context.Node

func (Callbacks) AddCallback Uses

func (c Callbacks) AddCallback(node context.Node) Callbacks

type ColAttribute Uses

type ColAttribute interface {
    SetSize(value map[string]string) ColAttribute
    SetContent(value template.HTML) ColAttribute
    AddContent(value template.HTML) ColAttribute
    GetContent() template.HTML
}

type DataTableAttribute Uses

type DataTableAttribute interface {
    GetDataTableHeader() template.HTML
    SetThead(value []map[string]string) DataTableAttribute
    SetInfoList(value []map[string]template.HTML) DataTableAttribute
    SetEditUrl(value string) DataTableAttribute
    SetDeleteUrl(value string) DataTableAttribute
    SetNewUrl(value string) DataTableAttribute
    SetPrimaryKey(value string) DataTableAttribute
    SetAction(action template.HTML) DataTableAttribute
    SetIsTab(value bool) DataTableAttribute
    SetButtons(btns template.HTML) DataTableAttribute
    SetHideFilterArea(value bool) DataTableAttribute
    SetHideRowSelector(value bool) DataTableAttribute
    SetActionJs(aj template.JS) DataTableAttribute
    SetInfoUrl(value string) DataTableAttribute
    SetDetailUrl(value string) DataTableAttribute
    SetHasFilter(hasFilter bool) DataTableAttribute
    SetExportUrl(value string) DataTableAttribute
    SetUpdateUrl(value string) DataTableAttribute
    GetContent() template.HTML
}

type DefaultAction Uses

type DefaultAction struct {
    Attr template.HTML
    JS   template.JS
    Ext  template.HTML
}

func NewDefaultAction Uses

func NewDefaultAction(attr, ext template.HTML, js template.JS) *DefaultAction

func (*DefaultAction) BtnAttribute Uses

func (def *DefaultAction) BtnAttribute() template.HTML

func (*DefaultAction) ExtContent Uses

func (def *DefaultAction) ExtContent() template.HTML

func (*DefaultAction) GetCallbacks Uses

func (def *DefaultAction) GetCallbacks() context.Node

func (*DefaultAction) Js Uses

func (def *DefaultAction) Js() template.JS

func (*DefaultAction) SetBtnId Uses

func (def *DefaultAction) SetBtnId(btnId string)

type DefaultButton Uses

type DefaultButton struct {
    Id        string
    Title     template.HTML
    Color     template.HTML
    TextColor template.HTML
    Action    Action
    Icon      string
}

func (DefaultButton) Content Uses

func (b DefaultButton) Content() (template.HTML, template.JS)

type DeleteFn Uses

type DeleteFn func(ids []string) error

type DisplayProcessFn Uses

type DisplayProcessFn func(string) string

type DisplayProcessFnChains Uses

type DisplayProcessFnChains []DisplayProcessFn

func AddLimit Uses

func AddLimit(limit int) DisplayProcessFnChains

func AddSubstr Uses

func AddSubstr(start int, end int) DisplayProcessFnChains

func AddToLower Uses

func AddToLower() DisplayProcessFnChains

func AddToTitle Uses

func AddToTitle() DisplayProcessFnChains

func AddToUpper Uses

func AddToUpper() DisplayProcessFnChains

func AddTrimSpace Uses

func AddTrimSpace() DisplayProcessFnChains

func AddXssFilter Uses

func AddXssFilter() DisplayProcessFnChains

func AddXssJsFilter Uses

func AddXssJsFilter() DisplayProcessFnChains

func (DisplayProcessFnChains) Add Uses

func (d DisplayProcessFnChains) Add(f DisplayProcessFn) DisplayProcessFnChains

func (DisplayProcessFnChains) Append Uses

func (d DisplayProcessFnChains) Append(f DisplayProcessFnChains) DisplayProcessFnChains

func (DisplayProcessFnChains) Copy Uses

func (d DisplayProcessFnChains) Copy() DisplayProcessFnChains

func (DisplayProcessFnChains) Valid Uses

func (d DisplayProcessFnChains) Valid() bool

type Field Uses

type Field struct {
    Head     string
    Field    string
    TypeName db.DatabaseType

    Join Join

    Width      int
    Sortable   bool
    EditAble   bool
    Fixed      bool
    Filterable bool
    Hide       bool

    EditType    table.Type
    EditOptions []map[string]string

    FilterType      form.Type
    FilterOptions   FieldOptions
    FilterOperator  FilterOperator
    FilterOptionExt template.JS
    FilterHead      string
    FilterHelpMsg   template.HTML

    FieldDisplay
}

Field is the table field.

func (Field) Exist Uses

func (f Field) Exist() bool

func (Field) GetEditOptions Uses

func (f Field) GetEditOptions() string

type FieldDisplay Uses

type FieldDisplay struct {
    Display              FieldFilterFn
    DisplayProcessChains DisplayProcessFnChains
}

func (FieldDisplay) AddLimit Uses

func (f FieldDisplay) AddLimit(limit int) DisplayProcessFnChains

func (FieldDisplay) AddSubstr Uses

func (f FieldDisplay) AddSubstr(start int, end int) DisplayProcessFnChains

func (FieldDisplay) AddToLower Uses

func (f FieldDisplay) AddToLower() DisplayProcessFnChains

func (FieldDisplay) AddToTitle Uses

func (f FieldDisplay) AddToTitle() DisplayProcessFnChains

func (FieldDisplay) AddToUpper Uses

func (f FieldDisplay) AddToUpper() DisplayProcessFnChains

func (FieldDisplay) AddTrimSpace Uses

func (f FieldDisplay) AddTrimSpace() DisplayProcessFnChains

func (FieldDisplay) ToDisplay Uses

func (f FieldDisplay) ToDisplay(value FieldModel) interface{}

type FieldFilterFn Uses

type FieldFilterFn func(value FieldModel) interface{}

FieldDisplay is filter function of data.

type FieldList Uses

type FieldList []Field

func (FieldList) GetFieldByFieldName Uses

func (f FieldList) GetFieldByFieldName(name string) Field

type FieldModel Uses

type FieldModel struct {
    // The primaryKey of the table.
    ID  string

    // The value of the single query result.
    Value string

    // The current row data.
    Row map[string]interface{}
}

FieldModel is the single query result.

type FieldModelValue Uses

type FieldModelValue []string

func (FieldModelValue) First Uses

func (r FieldModelValue) First() string

func (FieldModelValue) Value Uses

func (r FieldModelValue) Value() string

type FieldOptions Uses

type FieldOptions []map[string]string

func (FieldOptions) SetSelected Uses

func (fo FieldOptions) SetSelected(val interface{}, labels []string) FieldOptions

type FilterOperator Uses

type FilterOperator string
const (
    FilterOperatorLike           FilterOperator = "like"
    FilterOperatorGreater        FilterOperator = ">"
    FilterOperatorGreaterOrEqual FilterOperator = ">="
    FilterOperatorEqual          FilterOperator = "="
    FilterOperatorNotEqual       FilterOperator = "!="
    FilterOperatorLess           FilterOperator = "<"
    FilterOperatorLessOrEqual    FilterOperator = "<="
    FilterOperatorFree           FilterOperator = "free"
)

func GetOperatorFromValue Uses

func GetOperatorFromValue(value string) FilterOperator

func (FilterOperator) AddOrNot Uses

func (o FilterOperator) AddOrNot() bool

func (FilterOperator) Label Uses

func (o FilterOperator) Label() template.HTML

func (FilterOperator) String Uses

func (o FilterOperator) String() string

func (FilterOperator) Valid Uses

func (o FilterOperator) Valid() bool

func (FilterOperator) Value Uses

func (o FilterOperator) Value() string

type FilterType Uses

type FilterType struct {
    FormType form.Type
    Operator FilterOperator
    Head     string
    HelpMsg  template.HTML
}

type FormAttribute Uses

type FormAttribute interface {
    SetHeader(value template.HTML) FormAttribute
    SetContent(value []FormField) FormAttribute
    SetTabContents(value [][]FormField) FormAttribute
    SetTabHeaders(value []string) FormAttribute
    SetFooter(value template.HTML) FormAttribute
    SetPrefix(value string) FormAttribute
    SetUrl(value string) FormAttribute
    SetPrimaryKey(value string) FormAttribute
    SetInfoUrl(value string) FormAttribute
    SetMethod(value string) FormAttribute
    SetTitle(value template.HTML) FormAttribute
    SetLayout(layout form.Layout) FormAttribute
    SetToken(value string) FormAttribute
    SetOperationFooter(value template.HTML) FormAttribute
    GetBoxHeader() template.HTML
    GetDetailBoxHeader(editUrl, deleteUrl string) template.HTML
    GetBoxHeaderNoButton() template.HTML
    GetContent() template.HTML
}

type FormField Uses

type FormField struct {
    Field    string
    TypeName db.DatabaseType
    Head     string
    FormType form2.Type

    Default                template.HTML
    Value                  template.HTML
    Value2                 string
    Options                FieldOptions
    DefaultOptionDelimiter string
    Label                  template.HTML

    CustomContent template.HTML
    CustomJs      template.JS
    CustomCss     template.CSS

    Editable    bool
    NotAllowAdd bool
    Must        bool
    Hide        bool

    HelpMsg   template.HTML
    OptionExt template.JS

    FieldDisplay
    PostFilterFn PostFieldFilterFn
}

FormField is the form field with different options.

func (FormField) UpdateValue Uses

func (f FormField) UpdateValue(id, val string, res map[string]interface{}) FormField

type FormFields Uses

type FormFields []FormField

func (FormFields) Copy Uses

func (f FormFields) Copy() FormFields

func (FormFields) FindByFieldName Uses

func (f FormFields) FindByFieldName(field string) FormField

type FormPanel Uses

type FormPanel struct {
    FieldList FormFields

    // Warn: may be deprecated in the future.
    TabGroups  TabGroups
    TabHeaders TabHeaders

    Table       string
    Title       string
    Description string

    Validator FormPostFn
    PostHook  FormPostFn

    Callbacks Callbacks

    UpdateFn FormPostFn
    InsertFn FormPostFn

    HeaderHtml template.HTML
    FooterHtml template.HTML
    // contains filtered or unexported fields
}

FormPanel

func NewFormPanel Uses

func NewFormPanel() *FormPanel

func (*FormPanel) AddField Uses

func (f *FormPanel) AddField(head, field string, filedType db.DatabaseType, formType form2.Type) *FormPanel

func (*FormPanel) AddLimitFilter Uses

func (f *FormPanel) AddLimitFilter(limit int) *FormPanel

func (*FormPanel) AddSubstrFilter Uses

func (f *FormPanel) AddSubstrFilter(start int, end int) *FormPanel

func (*FormPanel) AddToLowerFilter Uses

func (f *FormPanel) AddToLowerFilter() *FormPanel

func (*FormPanel) AddToTitleFilter Uses

func (f *FormPanel) AddToTitleFilter() *FormPanel

func (*FormPanel) AddToUpperFilter Uses

func (f *FormPanel) AddToUpperFilter() *FormPanel

func (*FormPanel) AddTrimSpaceFilter Uses

func (f *FormPanel) AddTrimSpaceFilter() *FormPanel

func (*FormPanel) AddXssFilter Uses

func (f *FormPanel) AddXssFilter() *FormPanel

func (*FormPanel) AddXssJsFilter Uses

func (f *FormPanel) AddXssJsFilter() *FormPanel

func (*FormPanel) FieldCustomContent Uses

func (f *FormPanel) FieldCustomContent(content template.HTML) *FormPanel

func (*FormPanel) FieldCustomCss Uses

func (f *FormPanel) FieldCustomCss(css template.CSS) *FormPanel

func (*FormPanel) FieldCustomJs Uses

func (f *FormPanel) FieldCustomJs(js template.JS) *FormPanel

func (*FormPanel) FieldDefault Uses

func (f *FormPanel) FieldDefault(def string) *FormPanel

func (*FormPanel) FieldDefaultOptionDelimiter Uses

func (f *FormPanel) FieldDefaultOptionDelimiter(delimiter string) *FormPanel

func (*FormPanel) FieldDisplay Uses

func (f *FormPanel) FieldDisplay(filter FieldFilterFn) *FormPanel

func (*FormPanel) FieldFormType Uses

func (f *FormPanel) FieldFormType(formType form2.Type) *FormPanel

func (*FormPanel) FieldHelpMsg Uses

func (f *FormPanel) FieldHelpMsg(s template.HTML) *FormPanel

func (*FormPanel) FieldHide Uses

func (f *FormPanel) FieldHide() *FormPanel

func (*FormPanel) FieldLimit Uses

func (f *FormPanel) FieldLimit(limit int) *FormPanel

func (*FormPanel) FieldMust Uses

func (f *FormPanel) FieldMust() *FormPanel

func (*FormPanel) FieldNotAllowAdd Uses

func (f *FormPanel) FieldNotAllowAdd() *FormPanel

func (*FormPanel) FieldNotAllowEdit Uses

func (f *FormPanel) FieldNotAllowEdit() *FormPanel

func (*FormPanel) FieldOptionExt Uses

func (f *FormPanel) FieldOptionExt(m map[string]interface{}) *FormPanel

func (*FormPanel) FieldOptions Uses

func (f *FormPanel) FieldOptions(options []map[string]string) *FormPanel

func (*FormPanel) FieldPostFilterFn Uses

func (f *FormPanel) FieldPostFilterFn(post PostFieldFilterFn) *FormPanel

func (*FormPanel) FieldSubstr Uses

func (f *FormPanel) FieldSubstr(start int, end int) *FormPanel

func (*FormPanel) FieldToLower Uses

func (f *FormPanel) FieldToLower() *FormPanel

func (*FormPanel) FieldToTitle Uses

func (f *FormPanel) FieldToTitle() *FormPanel

func (*FormPanel) FieldToUpper Uses

func (f *FormPanel) FieldToUpper() *FormPanel

func (*FormPanel) FieldTrimSpace Uses

func (f *FormPanel) FieldTrimSpace() *FormPanel

func (*FormPanel) FieldValue Uses

func (f *FormPanel) FieldValue(value string) *FormPanel

func (*FormPanel) FieldXssFilter Uses

func (f *FormPanel) FieldXssFilter() *FormPanel

func (*FormPanel) SetDescription Uses

func (f *FormPanel) SetDescription(desc string) *FormPanel

func (*FormPanel) SetFooterHtml Uses

func (f *FormPanel) SetFooterHtml(footer template.HTML) *FormPanel

func (*FormPanel) SetHeaderHtml Uses

func (f *FormPanel) SetHeaderHtml(header template.HTML) *FormPanel

func (*FormPanel) SetInsertFn Uses

func (f *FormPanel) SetInsertFn(po FormPostFn) *FormPanel

func (*FormPanel) SetPostHook Uses

func (f *FormPanel) SetPostHook(po FormPostFn) *FormPanel

func (*FormPanel) SetPostValidator Uses

func (f *FormPanel) SetPostValidator(va FormPostFn) *FormPanel

func (*FormPanel) SetTabGroups Uses

func (f *FormPanel) SetTabGroups(groups TabGroups) *FormPanel

func (*FormPanel) SetTabHeaders Uses

func (f *FormPanel) SetTabHeaders(headers ...string) *FormPanel

func (*FormPanel) SetTable Uses

func (f *FormPanel) SetTable(table string) *FormPanel

func (*FormPanel) SetTitle Uses

func (f *FormPanel) SetTitle(title string) *FormPanel

func (*FormPanel) SetUpdateFn Uses

func (f *FormPanel) SetUpdateFn(po FormPostFn) *FormPanel

type FormPostFn Uses

type FormPostFn func(values form.Values) error

type GetPanelFn Uses

type GetPanelFn func(ctx interface{}) (Panel, error)

type ImgAttribute Uses

type ImgAttribute interface {
    SetWidth(value string) ImgAttribute
    SetHeight(value string) ImgAttribute
    WithModal() ImgAttribute
    SetSrc(value template.HTML) ImgAttribute
    GetContent() template.HTML
}

type InfoPanel Uses

type InfoPanel struct {
    FieldList FieldList

    Table       string
    Title       string
    Description string

    // Warn: may be deprecated future.
    TabGroups  TabGroups
    TabHeaders TabHeaders

    Sort Sort

    PageSizeList    []int
    DefaultPageSize int

    IsHideNewButton    bool
    IsHideExportButton bool
    IsHideEditButton   bool
    IsHideDeleteButton bool
    IsHideDetailButton bool
    IsHideFilterButton bool
    IsHideRowSelector  bool
    IsHidePagination   bool
    IsHideFilterArea   bool
    FilterFormLayout   form.Layout

    Wheres []Where

    Callbacks Callbacks

    Buttons Buttons

    DeleteHook  DeleteFn
    PreDeleteFn DeleteFn
    DeleteFn    DeleteFn

    ActionButtons Buttons
    Action        template.HTML
    HeaderHtml    template.HTML
    FooterHtml    template.HTML
    // contains filtered or unexported fields
}

InfoPanel

func NewInfoPanel Uses

func NewInfoPanel() *InfoPanel

func (*InfoPanel) AddActionButton Uses

func (i *InfoPanel) AddActionButton(title template.HTML, action Action, ids ...string) *InfoPanel

func (*InfoPanel) AddActionButtonFront Uses

func (i *InfoPanel) AddActionButtonFront(title template.HTML, action Action, ids ...string) *InfoPanel

func (*InfoPanel) AddButton Uses

func (i *InfoPanel) AddButton(title template.HTML, icon string, action Action, color ...template.HTML) *InfoPanel

func (*InfoPanel) AddField Uses

func (i *InfoPanel) AddField(head, field string, typeName db.DatabaseType) *InfoPanel

func (*InfoPanel) AddLimitFilter Uses

func (i *InfoPanel) AddLimitFilter(limit int) *InfoPanel

func (*InfoPanel) AddSubstrFilter Uses

func (i *InfoPanel) AddSubstrFilter(start int, end int) *InfoPanel

func (*InfoPanel) AddToLowerFilter Uses

func (i *InfoPanel) AddToLowerFilter() *InfoPanel

func (*InfoPanel) AddToTitleFilter Uses

func (i *InfoPanel) AddToTitleFilter() *InfoPanel

func (*InfoPanel) AddToUpperFilter Uses

func (i *InfoPanel) AddToUpperFilter() *InfoPanel

func (*InfoPanel) AddTrimSpaceFilter Uses

func (i *InfoPanel) AddTrimSpaceFilter() *InfoPanel

func (*InfoPanel) AddXssFilter Uses

func (i *InfoPanel) AddXssFilter() *InfoPanel

func (*InfoPanel) AddXssJsFilter Uses

func (i *InfoPanel) AddXssJsFilter() *InfoPanel

func (*InfoPanel) FieldDisplay Uses

func (i *InfoPanel) FieldDisplay(filter FieldFilterFn) *InfoPanel

func (*InfoPanel) FieldEditAble Uses

func (i *InfoPanel) FieldEditAble(editType ...table.Type) *InfoPanel

func (*InfoPanel) FieldEditOptions Uses

func (i *InfoPanel) FieldEditOptions(options []map[string]string) *InfoPanel

func (*InfoPanel) FieldFilterOptionExt Uses

func (i *InfoPanel) FieldFilterOptionExt(m map[string]interface{}) *InfoPanel

func (*InfoPanel) FieldFilterOptions Uses

func (i *InfoPanel) FieldFilterOptions(options []map[string]string) *InfoPanel

func (*InfoPanel) FieldFilterable Uses

func (i *InfoPanel) FieldFilterable(filterType ...FilterType) *InfoPanel

func (*InfoPanel) FieldFixed Uses

func (i *InfoPanel) FieldFixed() *InfoPanel

func (*InfoPanel) FieldHide Uses

func (i *InfoPanel) FieldHide() *InfoPanel

func (*InfoPanel) FieldJoin Uses

func (i *InfoPanel) FieldJoin(join Join) *InfoPanel

func (*InfoPanel) FieldLimit Uses

func (i *InfoPanel) FieldLimit(limit int) *InfoPanel

func (*InfoPanel) FieldSortable Uses

func (i *InfoPanel) FieldSortable() *InfoPanel

func (*InfoPanel) FieldSubstr Uses

func (i *InfoPanel) FieldSubstr(start int, end int) *InfoPanel

func (*InfoPanel) FieldToLower Uses

func (i *InfoPanel) FieldToLower() *InfoPanel

func (*InfoPanel) FieldToTitle Uses

func (i *InfoPanel) FieldToTitle() *InfoPanel

func (*InfoPanel) FieldToUpper Uses

func (i *InfoPanel) FieldToUpper() *InfoPanel

func (*InfoPanel) FieldTrimSpace Uses

func (i *InfoPanel) FieldTrimSpace() *InfoPanel

func (*InfoPanel) FieldWidth Uses

func (i *InfoPanel) FieldWidth(width int) *InfoPanel

func (*InfoPanel) FieldXssFilter Uses

func (i *InfoPanel) FieldXssFilter() *InfoPanel

func (*InfoPanel) GetPageSizeList Uses

func (i *InfoPanel) GetPageSizeList() []string

func (*InfoPanel) GetSort Uses

func (i *InfoPanel) GetSort() string

func (*InfoPanel) HideDeleteButton Uses

func (i *InfoPanel) HideDeleteButton() *InfoPanel

func (*InfoPanel) HideDetailButton Uses

func (i *InfoPanel) HideDetailButton() *InfoPanel

func (*InfoPanel) HideEditButton Uses

func (i *InfoPanel) HideEditButton() *InfoPanel

func (*InfoPanel) HideExportButton Uses

func (i *InfoPanel) HideExportButton() *InfoPanel

func (*InfoPanel) HideFilterArea Uses

func (i *InfoPanel) HideFilterArea() *InfoPanel

func (*InfoPanel) HideFilterButton Uses

func (i *InfoPanel) HideFilterButton() *InfoPanel

func (*InfoPanel) HideNewButton Uses

func (i *InfoPanel) HideNewButton() *InfoPanel

func (*InfoPanel) HidePagination Uses

func (i *InfoPanel) HidePagination() *InfoPanel

func (*InfoPanel) HideRowSelector Uses

func (i *InfoPanel) HideRowSelector() *InfoPanel

func (*InfoPanel) SetAction Uses

func (i *InfoPanel) SetAction(action template.HTML) *InfoPanel

func (*InfoPanel) SetDefaultPageSize Uses

func (i *InfoPanel) SetDefaultPageSize(defaultPageSize int) *InfoPanel

func (*InfoPanel) SetDeleteFn Uses

func (i *InfoPanel) SetDeleteFn(fn DeleteFn) *InfoPanel

func (*InfoPanel) SetDeleteHook Uses

func (i *InfoPanel) SetDeleteHook(fn DeleteFn) *InfoPanel

func (*InfoPanel) SetDescription Uses

func (i *InfoPanel) SetDescription(desc string) *InfoPanel

func (*InfoPanel) SetFilterFormLayout Uses

func (i *InfoPanel) SetFilterFormLayout(layout form.Layout) *InfoPanel

func (*InfoPanel) SetFooterHtml Uses

func (i *InfoPanel) SetFooterHtml(footer template.HTML) *InfoPanel

func (*InfoPanel) SetHeaderHtml Uses

func (i *InfoPanel) SetHeaderHtml(header template.HTML) *InfoPanel

func (*InfoPanel) SetPageSizeList Uses

func (i *InfoPanel) SetPageSizeList(pageSizeList []int) *InfoPanel

func (*InfoPanel) SetPreDeleteFn Uses

func (i *InfoPanel) SetPreDeleteFn(fn DeleteFn) *InfoPanel

func (*InfoPanel) SetSortAsc Uses

func (i *InfoPanel) SetSortAsc() *InfoPanel

func (*InfoPanel) SetSortDesc Uses

func (i *InfoPanel) SetSortDesc() *InfoPanel

func (*InfoPanel) SetTabGroups Uses

func (i *InfoPanel) SetTabGroups(groups TabGroups) *InfoPanel

func (*InfoPanel) SetTabHeaders Uses

func (i *InfoPanel) SetTabHeaders(headers ...string) *InfoPanel

func (*InfoPanel) SetTable Uses

func (i *InfoPanel) SetTable(table string) *InfoPanel

func (*InfoPanel) SetTitle Uses

func (i *InfoPanel) SetTitle(title string) *InfoPanel

func (*InfoPanel) Where Uses

func (i *InfoPanel) Where(field string, operator string, arg interface{}) *InfoPanel

type Join Uses

type Join struct {
    Table     string
    Field     string
    JoinField string
}

func (Join) Valid Uses

func (j Join) Valid() bool

type LabelAttribute Uses

type LabelAttribute interface {
    SetContent(value template.HTML) LabelAttribute
    SetColor(value template.HTML) LabelAttribute
    SetType(value string) LabelAttribute
    GetContent() template.HTML
}

type LinkAttribute Uses

type LinkAttribute interface {
    OpenInNewTab() LinkAttribute
    SetURL(value string) LinkAttribute
    SetTabTitle(value template.HTML) LinkAttribute
    SetContent(value template.HTML) LinkAttribute
    GetContent() template.HTML
}

type Page Uses

type Page struct {
    // User is the login user.
    User models.UserModel

    // Menu is the left side menu of the template.
    Menu menu.Menu

    // Panel is the main content of template.
    Panel Panel

    // System contains some system info.
    System SystemInfo

    // UrlPrefix is the prefix of url.
    UrlPrefix string

    // Title is the title of the web page.
    Title string

    // Logo is the logo of the template.
     template.HTML

    // MiniLogo is the downsizing logo of the template.
     template.HTML

    // ColorScheme is the color scheme of the template.
    ColorScheme string

    // IndexUrl is the home page url of the site.
    IndexUrl string

    // AssetUrl is the cdn link of assets
    CdnUrl string

    // Custom html in the tag head.
    CustomHeadHtml template.HTML

    // Custom html after body.
    CustomFootHtml template.HTML

    // Components assets
    AssetsList template.HTML
}

Page used in the template as a top variable.

func NewPage Uses

func NewPage(user models.UserModel, menu menu.Menu, panel Panel, cfg config.Config, assetsList template.HTML) Page

type PaginatorAttribute Uses

type PaginatorAttribute interface {
    SetCurPageStartIndex(value string) PaginatorAttribute
    SetCurPageEndIndex(value string) PaginatorAttribute
    SetTotal(value string) PaginatorAttribute
    SetPreviousClass(value string) PaginatorAttribute
    SetPreviousUrl(value string) PaginatorAttribute
    SetPages(value []map[string]string) PaginatorAttribute
    SetPageSizeList(value []string) PaginatorAttribute
    SetNextClass(value string) PaginatorAttribute
    SetNextUrl(value string) PaginatorAttribute
    SetOption(value map[string]template.HTML) PaginatorAttribute
    SetUrl(value string) PaginatorAttribute
    SetExtraInfo(value template.HTML) PaginatorAttribute
    GetContent() template.HTML
}

type Panel Uses

type Panel struct {
    Content     template.HTML
    Title       string
    Description string
    Url         string
}

Panel contains the main content of the template which used as pjax.

type PopupAttribute Uses

type PopupAttribute interface {
    SetID(value string) PopupAttribute
    SetTitle(value template.HTML) PopupAttribute
    SetFooter(value template.HTML) PopupAttribute
    SetBody(value template.HTML) PopupAttribute
    SetSize(value string) PopupAttribute
    GetContent() template.HTML
}

type PostFieldFilterFn Uses

type PostFieldFilterFn func(value PostFieldModel) string

PostFieldFilterFn is filter function of data.

type PostFieldModel Uses

type PostFieldModel struct {
    ID    string
    Value FieldModelValue
    Row   map[string]interface{}
}

PostFieldModel contains ID and value of the single query result and the current row data.

type RowAttribute Uses

type RowAttribute interface {
    SetContent(value template.HTML) RowAttribute
    AddContent(value template.HTML) RowAttribute
    GetContent() template.HTML
}

type Sort Uses

type Sort uint8
const (
    SortDesc Sort = iota
    SortAsc
)

type SystemInfo Uses

type SystemInfo struct {
    Version string
}

SystemInfo contains basic info of system.

type TabGroups Uses

type TabGroups [][]string

func NewTabGroups Uses

func NewTabGroups(items ...string) TabGroups

func (TabGroups) AddGroup Uses

func (t TabGroups) AddGroup(items ...string) TabGroups

func (TabGroups) Valid Uses

func (t TabGroups) Valid() bool

type TabHeaders Uses

type TabHeaders []string

func (TabHeaders) Add Uses

func (t TabHeaders) Add(header string) TabHeaders

type TableAttribute Uses

type TableAttribute interface {
    SetThead(value []map[string]string) TableAttribute
    SetInfoList(value []map[string]template.HTML) TableAttribute
    SetType(value string) TableAttribute
    SetMinWidth(value int) TableAttribute
    GetContent() template.HTML
}

type TabsAttribute Uses

type TabsAttribute interface {
    SetData(value []map[string]template.HTML) TabsAttribute
    GetContent() template.HTML
}

type TreeAttribute Uses

type TreeAttribute interface {
    SetTree(value []menu.Item) TreeAttribute
    SetEditUrl(value string) TreeAttribute
    SetOrderUrl(value string) TreeAttribute
    SetUrlPrefix(value string) TreeAttribute
    SetDeleteUrl(value string) TreeAttribute
    GetContent() template.HTML
    GetTreeHeader() template.HTML
}

type Where Uses

type Where struct {
    Field    string
    Operator string
    Arg      interface{}
}

Directories

PathSynopsis
action
form
table

Package types imports 17 packages (graph) and is imported by 65 packages. Updated 2020-01-24. Refresh now. Tools for package owners.