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

button.go components.go display.go form.go info.go operators.go page.go select.go size.go tmpl.go

Constants

const (
    NavBtnSiteName = "go_admin_site_navbtn"
    NavBtnInfoName = "go_admin_info_navbtn"
    NavBtnToolName = "go_admin_tool_navbtn"
    NavBtnPlugName = "go_admin_plug_navbtn"
)
const (
    PostTypeCreate = iota
    PostTypeUpdate
)
const DefaultPageSize = 10

Variables

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

func AddGlobalDisplayProcessFn Uses

func AddGlobalDisplayProcessFn(f FieldFilterFn)

func GetJoinField Uses

func GetJoinField(field string) string

func JoinField Uses

func JoinField(table, field string) string

func ParseTableDataTmpl Uses

func ParseTableDataTmpl(content interface{}) string

func ParseTableDataTmplWithID Uses

func ParseTableDataTmplWithID(id template.HTML, content string, value ...map[string]InfoItem) string

func RegisterDisplayFnGenerator Uses

func RegisterDisplayFnGenerator(key string, gen DisplayFnGenerator)

type Action Uses

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

type ActionButton Uses

type ActionButton struct {
    *BaseButton
}

func GetActionButton Uses

func GetActionButton(title template.HTML, action Action, ids ...string) *ActionButton

func (*ActionButton) Content Uses

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

type AddFormFieldFn Uses

type AddFormFieldFn func(panel *FormPanel)

type AjaxData Uses

type AjaxData struct {
    SuccessTitle   string
    SuccessText    string
    ErrorTitle     string
    ErrorText      string
    SuccessJumpURL string
}

type AlertAttribute Uses

type AlertAttribute interface {
    SetTheme(value string) AlertAttribute
    SetTitle(value template.HTML) AlertAttribute
    SetContent(value template.HTML) AlertAttribute
    Warning(msg string) template.HTML
    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 BaseButton Uses

type BaseButton struct {
    Id, Url, Method, Name string
    Title                 template.HTML
    Action                Action
}

func (*BaseButton) Content Uses

func (b *BaseButton) Content() (template.HTML, template.JS)

func (*BaseButton) GetAction Uses

func (b *BaseButton) GetAction() Action

func (*BaseButton) GetName Uses

func (b *BaseButton) GetName() string

func (*BaseButton) ID Uses

func (b *BaseButton) ID() string

func (*BaseButton) METHOD Uses

func (b *BaseButton) METHOD() string

func (*BaseButton) SetName Uses

func (b *BaseButton) SetName(name string)

func (*BaseButton) URL Uses

func (b *BaseButton) URL() string

type BaseDisplayFnGenerator Uses

type BaseDisplayFnGenerator struct{}

func (*BaseDisplayFnGenerator) HTML Uses

func (base *BaseDisplayFnGenerator) HTML() template.HTML

func (*BaseDisplayFnGenerator) JS Uses

func (base *BaseDisplayFnGenerator) JS() template.HTML

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
    SetIframeStyle(iframe bool) BoxAttribute
    SetAttr(attr template.HTMLAttr) 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)
    GetAction() Action
    URL() string
    METHOD() string
    ID() string
    GetName() string
    SetName(name string)
}

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) AddNavButton Uses

func (b Buttons) AddNavButton(ico, name string, action Action) Buttons

func (Buttons) CheckExist Uses

func (b Buttons) CheckExist(name string) bool

func (Buttons) CheckPermission Uses

func (b Buttons) CheckPermission(user models.UserModel) Buttons

func (Buttons) Content Uses

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

func (Buttons) FooterContent Uses

func (b Buttons) FooterContent() template.HTML

func (Buttons) RemoveButtonByName Uses

func (b Buttons) RemoveButtonByName(name string) Buttons

func (Buttons) RemoveInfoNavButton Uses

func (b Buttons) RemoveInfoNavButton() Buttons

func (Buttons) RemovePlugNavButton Uses

func (b Buttons) RemovePlugNavButton() Buttons

func (Buttons) RemoveSiteNavButton Uses

func (b Buttons) RemoveSiteNavButton() Buttons

func (Buttons) RemoveToolNavButton Uses

func (b Buttons) RemoveToolNavButton() Buttons

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 S) ColAttribute
    SetContent(value template.HTML) ColAttribute
    AddContent(value template.HTML) ColAttribute
    GetContent() template.HTML
}

type ContentWrapper Uses

type ContentWrapper func(content template.HTML) template.HTML

type DataTableAttribute Uses

type DataTableAttribute interface {
    GetDataTableHeader() template.HTML
    SetThead(value Thead) DataTableAttribute
    SetInfoList(value []map[string]InfoItem) DataTableAttribute
    SetEditUrl(value string) DataTableAttribute
    SetDeleteUrl(value string) DataTableAttribute
    SetNewUrl(value string) DataTableAttribute
    SetPrimaryKey(value string) DataTableAttribute
    SetStyle(style string) DataTableAttribute
    SetAction(action template.HTML) DataTableAttribute
    SetIsTab(value bool) DataTableAttribute
    SetHideThead() DataTableAttribute
    SetLayout(value string) DataTableAttribute
    SetButtons(btns template.HTML) DataTableAttribute
    SetHideFilterArea(value bool) DataTableAttribute
    SetHideRowSelector(value bool) DataTableAttribute
    SetActionJs(aj template.JS) DataTableAttribute
    SetNoAction() DataTableAttribute
    SetInfoUrl(value string) DataTableAttribute
    SetDetailUrl(value string) DataTableAttribute
    SetHasFilter(hasFilter bool) DataTableAttribute
    SetSortUrl(value string) 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
    Footer template.HTML
}

func NewDefaultAction Uses

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

func (*DefaultAction) BtnAttribute Uses

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

func (*DefaultAction) BtnClass Uses

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

func (*DefaultAction) ExtContent Uses

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

func (*DefaultAction) FooterContent Uses

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

func (*DefaultAction) GetCallbacks Uses

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

func (*DefaultAction) Js Uses

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

func (*DefaultAction) SetBtnData Uses

func (def *DefaultAction) SetBtnData(data interface{})

func (*DefaultAction) SetBtnId Uses

func (def *DefaultAction) SetBtnId(btnId string)

type DefaultButton Uses

type DefaultButton struct {
    *BaseButton
    Color     template.HTML
    TextColor template.HTML
    Icon      string
    Direction template.HTML
}

func GetColumnButton Uses

func GetColumnButton(title template.HTML, icon string, action Action, colors ...template.HTML) *DefaultButton

func GetDefaultButton Uses

func GetDefaultButton(title template.HTML, icon string, action Action, colors ...template.HTML) *DefaultButton

func (*DefaultButton) Content Uses

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

type DefaultSelection Uses

type DefaultSelection struct {
    *BaseButton
    Options     FieldOptions
    Placeholder string
    Width       int
}

func GetDefaultSelection Uses

func GetDefaultSelection(placeholder string, options FieldOptions, action Action, widths ...int) *DefaultSelection

func (*DefaultSelection) Content Uses

func (b *DefaultSelection) Content() (template.HTML, template.JS)

type DeleteFn Uses

type DeleteFn func(ids []string) error

type DeleteFnWithRes Uses

type DeleteFnWithRes func(ids []string, res error) error

type DisplayFnGenerator Uses

type DisplayFnGenerator interface {
    Get(args ...interface{}) FieldFilterFn
    JS() template.HTML
    HTML() template.HTML
}

type DisplayProcessFnChains Uses

type DisplayProcessFnChains []FieldFilterFn

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 FieldFilterFn) 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 ExportProcessFn Uses

type ExportProcessFn func(param parameter.Parameters) (PanelInfo, error)

type Field Uses

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

    Joins Joins

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

    EditType    table.Type
    EditOptions FieldOptions

    FilterFormFields []FilterFormField

    FieldDisplay
}

Field is the table field.

func (Field) Exist Uses

func (f Field) Exist() bool

func (Field) GetFilterFormFields Uses

func (f Field) GetFilterFormFields(params parameter.Parameters, headField string, sql ...*db.SQL) []FormField

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) IsNotSelectRes Uses

func (f FieldDisplay) IsNotSelectRes(v interface{}) bool

func (FieldDisplay) ToDisplay Uses

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

func (FieldDisplay) ToDisplayHTML Uses

func (f FieldDisplay) ToDisplayHTML(value FieldModel) template.HTML

func (FieldDisplay) ToDisplayString Uses

func (f FieldDisplay) ToDisplayString(value FieldModel) string

func (FieldDisplay) ToDisplayStringArray Uses

func (f FieldDisplay) ToDisplayStringArray(value FieldModel) []string

func (FieldDisplay) ToDisplayStringArrayArray Uses

func (f FieldDisplay) ToDisplayStringArrayArray(value FieldModel) [][]string

type FieldDotColor Uses

type FieldDotColor string
const (
    FieldDotColorDanger  FieldDotColor = "danger"
    FieldDotColorInfo    FieldDotColor = "info"
    FieldDotColorPrimary FieldDotColor = "primary"
    FieldDotColorSuccess FieldDotColor = "success"
)

type FieldFilterFn Uses

type FieldFilterFn func(value FieldModel) interface{}

FieldDisplay is filter function of data.

type FieldGetImgArrFn Uses

type FieldGetImgArrFn func(value string) []string

type FieldLabelParam Uses

type FieldLabelParam struct {
    Color template.HTML
    Type  string
}

type FieldList Uses

type FieldList []Field

func (FieldList) GetFieldByFieldName Uses

func (f FieldList) GetFieldByFieldName(name string) Field

func (FieldList) GetFieldFilterProcessValue Uses

func (f FieldList) GetFieldFilterProcessValue(key, value, keyIndex string) string

func (FieldList) GetFieldJoinTable Uses

func (f FieldList) GetFieldJoinTable(key string) string

func (FieldList) GetThead Uses

func (f FieldList) GetThead(info TableInfo, params parameter.Parameters, columns []string) (Thead, string, string)

func (FieldList) GetTheadAndFilterForm Uses

func (f FieldList) GetTheadAndFilterForm(info TableInfo, params parameter.Parameters, columns []string,
    sql ...func() *db.SQL) (Thead, string, string, string, []string, []FormField)

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{}

    // Post type
    PostType PostType
}

FieldModel is the single query result.

func (FieldModel) IsCreate Uses

func (m FieldModel) IsCreate() bool

func (FieldModel) IsUpdate Uses

func (m FieldModel) IsUpdate() bool

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 FieldOption Uses

type FieldOption struct {
    Text          string            `json:"text"`
    Value         string            `json:"value"`
    TextHTML      template.HTML     `json:"-"`
    Selected      bool              `json:"-"`
    SelectedLabel template.HTML     `json:"-"`
    Extra         map[string]string `json:"-"`
}

type FieldOptions Uses

type FieldOptions []FieldOption

func (FieldOptions) Copy Uses

func (fo FieldOptions) Copy() FieldOptions

func (FieldOptions) Marshal Uses

func (fo FieldOptions) Marshal() string

func (FieldOptions) SetSelected Uses

func (fo FieldOptions) SetSelected(val interface{}, labels []template.HTML) FieldOptions

func (FieldOptions) SetSelectedLabel Uses

func (fo FieldOptions) SetSelectedLabel(labels []template.HTML) FieldOptions

type FieldProgressBarData Uses

type FieldProgressBarData struct {
    Style string
    Size  string
    Max   int
}

type FilterFormField Uses

type FilterFormField struct {
    Type        form.Type
    Options     FieldOptions
    OptionTable OptionTable
    Width       int
    Operator    FilterOperator
    OptionExt   template.JS
    Head        string
    Placeholder string
    HelpMsg     template.HTML
    ProcessFn   func(string) string
}

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
    Placeholder string
    NoHead      bool
    Width       int
    HelpMsg     template.HTML
    Options     FieldOptions
    Process     func(string) string
    OptionExt   map[string]interface{}
}

type FormAttribute Uses

type FormAttribute interface {
    SetHeader(value template.HTML) FormAttribute
    SetContent(value FormFields) FormAttribute
    SetTabContents(value []FormFields) FormAttribute
    SetTabHeaders(value []string) FormAttribute
    SetFooter(value template.HTML) FormAttribute
    SetPrefix(value string) FormAttribute
    SetUrl(value string) FormAttribute
    SetPrimaryKey(value string) FormAttribute
    SetId(id string) FormAttribute
    SetAjax(successJS, errorJS template.JS) FormAttribute
    SetHiddenFields(fields map[string]string) FormAttribute
    SetFieldsHTML(html template.HTML) FormAttribute
    SetMethod(value string) FormAttribute
    SetHeadWidth(width int) FormAttribute
    SetInputWidth(width int) FormAttribute
    SetTitle(value template.HTML) FormAttribute
    SetLayout(layout form.Layout) FormAttribute
    SetOperationFooter(value template.HTML) FormAttribute
    GetDefaultBoxHeader(hideBack bool) template.HTML
    GetDetailBoxHeader(editUrl, deleteUrl string) template.HTML
    GetBoxHeaderNoButton() template.HTML
    GetContent() template.HTML
}

type FormField Uses

type FormField struct {
    Field          string          `json:"field"`
    FieldClass     string          `json:"field_class"`
    TypeName       db.DatabaseType `json:"type_name"`
    Head           string          `json:"head"`
    Foot           template.HTML   `json:"foot"`
    FormType       form2.Type      `json:"form_type"`
    FatherFormType form2.Type      `json:"father_form_type"`
    FatherField    string          `json:"father_field"`

    RowWidth int
    RowFlag  uint8

    Default                template.HTML  `json:"default"`
    DefaultArr             interface{}    `json:"default_arr"`
    Value                  template.HTML  `json:"value"`
    Value2                 string         `json:"value_2"`
    ValueArr               []string       `json:"value_arr"`
    Value2Arr              []string       `json:"value_2_arr"`
    Options                FieldOptions   `json:"options"`
    OptionsArr             []FieldOptions `json:"options_arr"`
    DefaultOptionDelimiter string         `json:"default_option_delimiter"`
    Label                  template.HTML  `json:"label"`
    HideLabel              bool           `json:"hide_label"`

    Placeholder string `json:"placeholder"`

    CustomContent template.HTML `json:"custom_content"`
    CustomJs      template.JS   `json:"custom_js"`
    CustomCss     template.CSS  `json:"custom_css"`

    Editable    bool `json:"editable"`
    NotAllowAdd bool `json:"not_allow_add"`
    Must        bool `json:"must"`
    Hide        bool `json:"hide"`

    Width int `json:"width"`

    InputWidth int `json:"input_width"`
    HeadWidth  int `json:"head_width"`

    Joins Joins `json:"-"`

    Divider      bool   `json:"divider"`
    DividerTitle string `json:"divider_title"`

    HelpMsg template.HTML `json:"help_msg"`

    TableFields FormFields

    OptionExt       template.JS     `json:"option_ext"`
    OptionExt2      template.JS     `json:"option_ext_2"`
    OptionInitFn    OptionInitFn    `json:"-"`
    OptionArrInitFn OptionArrInitFn `json:"-"`
    OptionTable     OptionTable     `json:"-"`

    FieldDisplay `json:"-"`
    PostFilterFn PostFieldFilterFn `json:"-"`
}

FormField is the form field with different options.

func (*FormField) FillCustomContent Uses

func (f *FormField) FillCustomContent() *FormField

func (*FormField) GetRawValue Uses

func (f *FormField) GetRawValue(columns []string, v interface{}) string

func (*FormField) UpdateDefaultValue Uses

func (f *FormField) UpdateDefaultValue(sql *db.SQL) *FormField

func (*FormField) UpdateValue Uses

func (f *FormField) UpdateValue(id, val string, res map[string]interface{}, sql *db.SQL) *FormField

type FormFields Uses

type FormFields []FormField

func (FormFields) Add Uses

func (f FormFields) Add(field FormField) FormFields

func (FormFields) Copy Uses

func (f FormFields) Copy() FormFields

func (FormFields) FillCustomContent Uses

func (f FormFields) FillCustomContent() FormFields

func (FormFields) FindByFieldName Uses

func (f FormFields) FindByFieldName(field string) *FormField

func (FormFields) FindIndexByFieldName Uses

func (f FormFields) FindIndexByFieldName(field string) int

func (FormFields) FindTableChildren Uses

func (f FormFields) FindTableChildren(father string) []*FormField

func (FormFields) FindTableField Uses

func (f FormFields) FindTableField(field, father string) *FormField

func (FormFields) RemoveNotShow Uses

func (f FormFields) RemoveNotShow() FormFields

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
    PreProcessFn FormPreProcessFn

    Callbacks Callbacks

    UpdateFn FormPostFn
    InsertFn FormPostFn

    IsHideContinueEditCheckBox bool
    IsHideContinueNewCheckBox  bool
    IsHideResetButton          bool
    IsHideBackButton           bool

    Layout form2.Layout

    HTMLContent template.HTML

    Header template.HTML

    InputWidth int
    HeadWidth  int

    FormNewTitle    template.HTML
    FormNewBtnWord  template.HTML
    FormEditTitle   template.HTML
    FormEditBtnWord template.HTML

    Ajax          bool
    AjaxSuccessJS template.JS
    AjaxErrorJS   template.JS

    Responder Responder

    Wrapper ContentWrapper

    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) AddRow Uses

func (f *FormPanel) AddRow(addFields AddFormFieldFn) *FormPanel

func (*FormPanel) AddSubstrFilter Uses

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

func (*FormPanel) AddTable Uses

func (f *FormPanel) AddTable(head, field string, addFields AddFormFieldFn) *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) EnableAjax Uses

func (f *FormPanel) EnableAjax(msgs ...string) *FormPanel

func (*FormPanel) EnableAjaxData Uses

func (f *FormPanel) EnableAjaxData(data AjaxData) *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) FieldDivider Uses

func (f *FormPanel) FieldDivider(title ...string) *FormPanel

func (*FormPanel) FieldEnableFileUpload Uses

func (f *FormPanel) FieldEnableFileUpload(data ...interface{}) *FormPanel

func (*FormPanel) FieldFoot Uses

func (f *FormPanel) FieldFoot(foot template.HTML) *FormPanel

func (*FormPanel) FieldFormType Uses

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

func (*FormPanel) FieldHeadWidth Uses

func (f *FormPanel) FieldHeadWidth(width int) *FormPanel

func (*FormPanel) FieldHelpMsg Uses

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

func (*FormPanel) FieldHide Uses

func (f *FormPanel) FieldHide() *FormPanel

func (*FormPanel) FieldHideLabel Uses

func (f *FormPanel) FieldHideLabel() *FormPanel

func (*FormPanel) FieldInputWidth Uses

func (f *FormPanel) FieldInputWidth(width int) *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) FieldOnChoose Uses

func (f *FormPanel) FieldOnChoose(val, field string, value template.HTML) *FormPanel

func (*FormPanel) FieldOnChooseAjax Uses

func (f *FormPanel) FieldOnChooseAjax(field, url string, handler Handler, custom ...template.HTML) *FormPanel

func (*FormPanel) FieldOnChooseCustom Uses

func (f *FormPanel) FieldOnChooseCustom(js template.HTML) *FormPanel

func (*FormPanel) FieldOnChooseDisable Uses

func (f *FormPanel) FieldOnChooseDisable(value string, field ...string) *FormPanel

func (*FormPanel) FieldOnChooseHide Uses

func (f *FormPanel) FieldOnChooseHide(value string, field ...string) *FormPanel

func (*FormPanel) FieldOnChooseMap Uses

func (f *FormPanel) FieldOnChooseMap(m map[string]LinkField) *FormPanel

func (*FormPanel) FieldOnChooseShow Uses

func (f *FormPanel) FieldOnChooseShow(value string, field ...string) *FormPanel

func (*FormPanel) FieldOnSearch Uses

func (f *FormPanel) FieldOnSearch(url string, handler Handler, delay ...int) *FormPanel

func (*FormPanel) FieldOptionExt Uses

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

func (*FormPanel) FieldOptionExt2 Uses

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

func (*FormPanel) FieldOptionExtJS Uses

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

func (*FormPanel) FieldOptionExtJS2 Uses

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

func (*FormPanel) FieldOptionInitFn Uses

func (f *FormPanel) FieldOptionInitFn(fn OptionInitFn) *FormPanel

func (*FormPanel) FieldOptions Uses

func (f *FormPanel) FieldOptions(options FieldOptions) *FormPanel

func (*FormPanel) FieldOptionsFromTable Uses

func (f *FormPanel) FieldOptionsFromTable(table, textFieldName, valueFieldName string, process ...OptionTableQueryProcessFn) *FormPanel

func (*FormPanel) FieldOptionsTableProcessFn Uses

func (f *FormPanel) FieldOptionsTableProcessFn(fn OptionProcessFn) *FormPanel

func (*FormPanel) FieldPlaceholder Uses

func (f *FormPanel) FieldPlaceholder(placeholder string) *FormPanel

func (*FormPanel) FieldPostFilterFn Uses

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

func (*FormPanel) FieldRowWidth Uses

func (f *FormPanel) FieldRowWidth(width int) *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) FieldWidth Uses

func (f *FormPanel) FieldWidth(width int) *FormPanel

func (*FormPanel) FieldXssFilter Uses

func (f *FormPanel) FieldXssFilter() *FormPanel

func (*FormPanel) FieldsWithDefaultValue Uses

func (f *FormPanel) FieldsWithDefaultValue(sql ...func() *db.SQL) FormFields

func (*FormPanel) FieldsWithValue Uses

func (f *FormPanel) FieldsWithValue(pk, id string, columns []string, res map[string]interface{}, sql func() *db.SQL) FormFields

func (*FormPanel) GetNewFormFields Uses

func (f *FormPanel) GetNewFormFields(sql ...func() *db.SQL) (FormFields, []FormFields, []string)

func (*FormPanel) GroupField Uses

func (f *FormPanel) GroupField(sql ...func() *db.SQL) ([]FormFields, []string)

func (*FormPanel) GroupFieldWithValue Uses

func (f *FormPanel) GroupFieldWithValue(pk, id string, columns []string, res map[string]interface{}, sql func() *db.SQL) ([]FormFields, []string)

func (*FormPanel) HideBackButton Uses

func (f *FormPanel) HideBackButton() *FormPanel

func (*FormPanel) HideContinueEditCheckBox Uses

func (f *FormPanel) HideContinueEditCheckBox() *FormPanel

func (*FormPanel) HideContinueNewCheckBox Uses

func (f *FormPanel) HideContinueNewCheckBox() *FormPanel

func (*FormPanel) HideResetButton Uses

func (f *FormPanel) HideResetButton() *FormPanel

func (*FormPanel) OperationURL Uses

func (f *FormPanel) OperationURL(id string) string

func (*FormPanel) SetAjaxErrorJS Uses

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

func (*FormPanel) SetAjaxSuccessJS Uses

func (f *FormPanel) SetAjaxSuccessJS(js template.JS) *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) SetFormEditBtnWord Uses

func (f *FormPanel) SetFormEditBtnWord(word template.HTML) *FormPanel

func (*FormPanel) SetFormEditTitle Uses

func (f *FormPanel) SetFormEditTitle(title template.HTML) *FormPanel

func (*FormPanel) SetFormNewBtnWord Uses

func (f *FormPanel) SetFormNewBtnWord(word template.HTML) *FormPanel

func (*FormPanel) SetFormNewTitle Uses

func (f *FormPanel) SetFormNewTitle(title template.HTML) *FormPanel

func (*FormPanel) SetHTMLContent Uses

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

func (*FormPanel) SetHeadWidth Uses

func (f *FormPanel) SetHeadWidth(width int) *FormPanel

func (*FormPanel) SetHeader Uses

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

func (*FormPanel) SetHeaderHtml Uses

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

func (*FormPanel) SetInputWidth Uses

func (f *FormPanel) SetInputWidth(width int) *FormPanel

func (*FormPanel) SetInsertFn Uses

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

func (*FormPanel) SetLayout Uses

func (f *FormPanel) SetLayout(layout form2.Layout) *FormPanel

func (*FormPanel) SetPostHook Uses

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

func (*FormPanel) SetPostValidator Uses

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

func (*FormPanel) SetPreProcessFn Uses

func (f *FormPanel) SetPreProcessFn(fn FormPreProcessFn) *FormPanel

func (*FormPanel) SetPrimaryKey Uses

func (f *FormPanel) SetPrimaryKey(name string, typ db.DatabaseType) *FormPanel

func (*FormPanel) SetResponder Uses

func (f *FormPanel) SetResponder(responder Responder) *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(fn FormPostFn) *FormPanel

func (*FormPanel) SetWrapper Uses

func (f *FormPanel) SetWrapper(wrapper ContentWrapper) *FormPanel

type FormPostFn Uses

type FormPostFn func(values form.Values) error

type FormPreProcessFn Uses

type FormPreProcessFn func(values form.Values) form.Values

type GetDataFn Uses

type GetDataFn func(param parameter.Parameters) ([]map[string]interface{}, int)

type GetPanelFn Uses

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

type GetPanelInfoFn Uses

type GetPanelInfoFn func(ctx *context.Context) (Panel, error)

type GroupFieldHeaders Uses

type GroupFieldHeaders []string

type GroupFormFields Uses

type GroupFormFields []FormFields

type Handler Uses

type Handler func(ctx *context.Context) (success bool, msg string, data interface{})

func (Handler) Wrap Uses

func (h Handler) Wrap() context.Handler

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 InfoItem Uses

type InfoItem struct {
    Content template.HTML `json:"content"`
    Value   string        `json:"value"`
}

type InfoList Uses

type InfoList []map[string]InfoItem

func (InfoList) GroupBy Uses

func (i InfoList) GroupBy(groups TabGroups) []InfoList

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
    SortField string

    PageSizeList    []int
    DefaultPageSize int

    ExportType      int
    ExportProcessFn ExportProcessFn

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

    FilterFormHeadWidth  int
    FilterFormInputWidth int

    Wheres    Wheres
    WhereRaws WhereRaw

    Callbacks Callbacks

    Buttons Buttons

    TableLayout string

    DeleteHook  DeleteFn
    PreDeleteFn DeleteFn
    DeleteFn    DeleteFn

    DeleteHookWithRes DeleteFnWithRes

    GetDataFn GetDataFn

    ActionButtons Buttons

    DisplayGeneratorRecords map[string]struct{}

    QueryFilterFn       QueryFilterFn
    UpdateParametersFns []UpdateParametersFn

    Wrapper ContentWrapper

    // column operation buttons
    Action     template.HTML
    HeaderHtml template.HTML
    FooterHtml template.HTML
    // contains filtered or unexported fields
}

InfoPanel

func NewInfoPanel Uses

func NewInfoPanel(pk string) *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) AddButtonRaw Uses

func (i *InfoPanel) AddButtonRaw(btn Button, action Action) *InfoPanel

func (*InfoPanel) AddColumn Uses

func (i *InfoPanel) AddColumn(head string, fun FieldFilterFn) *InfoPanel

func (*InfoPanel) AddColumnButtons Uses

func (i *InfoPanel) AddColumnButtons(head string, buttons ...Button) *InfoPanel

func (*InfoPanel) AddField Uses

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

func (*InfoPanel) AddFilter Uses

func (i *InfoPanel) AddFilter(head, field string, typeName db.DatabaseType, fn UpdateParametersFn, filterType ...FilterType) *InfoPanel

func (*InfoPanel) AddLimitFilter Uses

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

func (*InfoPanel) AddSelectBox Uses

func (i *InfoPanel) AddSelectBox(placeholder string, options FieldOptions, action Action, width ...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) AddUpdateParametersFn Uses

func (i *InfoPanel) AddUpdateParametersFn(fn UpdateParametersFn) *InfoPanel

func (*InfoPanel) AddXssFilter Uses

func (i *InfoPanel) AddXssFilter() *InfoPanel

func (*InfoPanel) AddXssJsFilter Uses

func (i *InfoPanel) AddXssJsFilter() *InfoPanel

func (*InfoPanel) ExportValue Uses

func (i *InfoPanel) ExportValue() *InfoPanel

func (*InfoPanel) FieldBool Uses

func (i *InfoPanel) FieldBool(flags ...string) *InfoPanel

func (*InfoPanel) FieldCarousel Uses

func (i *InfoPanel) FieldCarousel(fn FieldGetImgArrFn, size ...int) *InfoPanel

func (*InfoPanel) FieldCopyable Uses

func (i *InfoPanel) FieldCopyable(prefix ...string) *InfoPanel

func (*InfoPanel) FieldDate Uses

func (i *InfoPanel) FieldDate(format string) *InfoPanel

func (*InfoPanel) FieldDisplay Uses

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

func (*InfoPanel) FieldDot Uses

func (i *InfoPanel) FieldDot(icons map[string]FieldDotColor, defaultDot FieldDotColor) *InfoPanel

func (*InfoPanel) FieldDownLoadable Uses

func (i *InfoPanel) FieldDownLoadable(prefix ...string) *InfoPanel

func (*InfoPanel) FieldEditAble Uses

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

func (*InfoPanel) FieldEditOptions Uses

func (i *InfoPanel) FieldEditOptions(options FieldOptions, extra ...map[string]string) *InfoPanel

func (*InfoPanel) FieldFileSize Uses

func (i *InfoPanel) FieldFileSize() *InfoPanel

func (*InfoPanel) FieldFilterOnChoose Uses

func (i *InfoPanel) FieldFilterOnChoose(val, field string, value template.HTML) *InfoPanel

func (*InfoPanel) FieldFilterOnChooseAjax Uses

func (i *InfoPanel) FieldFilterOnChooseAjax(field, url string, handler Handler) *InfoPanel

func (*InfoPanel) FieldFilterOnChooseCustom Uses

func (i *InfoPanel) FieldFilterOnChooseCustom(js template.HTML) *InfoPanel

func (*InfoPanel) FieldFilterOnChooseDisable Uses

func (i *InfoPanel) FieldFilterOnChooseDisable(value string, field ...string) *InfoPanel

func (*InfoPanel) FieldFilterOnChooseHide Uses

func (i *InfoPanel) FieldFilterOnChooseHide(value string, field ...string) *InfoPanel

func (*InfoPanel) FieldFilterOnChooseMap Uses

func (i *InfoPanel) FieldFilterOnChooseMap(m map[string]LinkField) *InfoPanel

func (*InfoPanel) FieldFilterOnChooseShow Uses

func (i *InfoPanel) FieldFilterOnChooseShow(value string, field ...string) *InfoPanel

func (*InfoPanel) FieldFilterOnSearch Uses

func (i *InfoPanel) FieldFilterOnSearch(url string, handler Handler, delay ...int) *InfoPanel

func (*InfoPanel) FieldFilterOptionExt Uses

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

func (*InfoPanel) FieldFilterOptions Uses

func (i *InfoPanel) FieldFilterOptions(options FieldOptions) *InfoPanel

func (*InfoPanel) FieldFilterOptionsFromTable Uses

func (i *InfoPanel) FieldFilterOptionsFromTable(table, textFieldName, valueFieldName string, process ...OptionTableQueryProcessFn) *InfoPanel

func (*InfoPanel) FieldFilterProcess Uses

func (i *InfoPanel) FieldFilterProcess(process func(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) FieldIcon Uses

func (i *InfoPanel) FieldIcon(icons map[string]string, defaultIcon string) *InfoPanel

func (*InfoPanel) FieldImage Uses

func (i *InfoPanel) FieldImage(width, height string, prefix ...string) *InfoPanel

func (*InfoPanel) FieldJoin Uses

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

func (*InfoPanel) FieldLabel Uses

func (i *InfoPanel) FieldLabel(args ...FieldLabelParam) *InfoPanel

func (*InfoPanel) FieldLimit Uses

func (i *InfoPanel) FieldLimit(limit int) *InfoPanel
func (i *InfoPanel) FieldLink(src string, openInNewTab ...bool) *InfoPanel

func (*InfoPanel) FieldLoading Uses

func (i *InfoPanel) FieldLoading(data []string) *InfoPanel

func (*InfoPanel) FieldProgressBar Uses

func (i *InfoPanel) FieldProgressBar(data ...FieldProgressBarData) *InfoPanel

func (*InfoPanel) FieldQrcode Uses

func (i *InfoPanel) FieldQrcode() *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) HideQueryInfo Uses

func (i *InfoPanel) HideQueryInfo() *InfoPanel

func (*InfoPanel) HideRowSelector Uses

func (i *InfoPanel) HideRowSelector() *InfoPanel

func (*InfoPanel) IsExportValue Uses

func (i *InfoPanel) IsExportValue() bool

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) SetDeleteHookWithRes Uses

func (i *InfoPanel) SetDeleteHookWithRes(fn DeleteFnWithRes) *InfoPanel

func (*InfoPanel) SetDescription Uses

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

func (*InfoPanel) SetExportProcessFn Uses

func (i *InfoPanel) SetExportProcessFn(fn ExportProcessFn) *InfoPanel

func (*InfoPanel) SetFilterFormHeadWidth Uses

func (i *InfoPanel) SetFilterFormHeadWidth(w int) *InfoPanel

func (*InfoPanel) SetFilterFormInputWidth Uses

func (i *InfoPanel) SetFilterFormInputWidth(w int) *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) SetGetDataFn Uses

func (i *InfoPanel) SetGetDataFn(fn GetDataFn) *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) SetPrimaryKey Uses

func (i *InfoPanel) SetPrimaryKey(name string, typ db.DatabaseType) *InfoPanel

func (*InfoPanel) SetQueryFilterFn Uses

func (i *InfoPanel) SetQueryFilterFn(fn QueryFilterFn) *InfoPanel

func (*InfoPanel) SetSortAsc Uses

func (i *InfoPanel) SetSortAsc() *InfoPanel

func (*InfoPanel) SetSortDesc Uses

func (i *InfoPanel) SetSortDesc() *InfoPanel

func (*InfoPanel) SetSortField Uses

func (i *InfoPanel) SetSortField(field string) *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) SetTableFixed Uses

func (i *InfoPanel) SetTableFixed() *InfoPanel

func (*InfoPanel) SetTitle Uses

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

func (*InfoPanel) SetWrapper Uses

func (i *InfoPanel) SetWrapper(wrapper ContentWrapper) *InfoPanel

func (*InfoPanel) Where Uses

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

func (*InfoPanel) WhereOr Uses

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

func (*InfoPanel) WhereRaw Uses

func (i *InfoPanel) WhereRaw(raw string, arg ...interface{}) *InfoPanel

type Join Uses

type Join struct {
    Table      string
    TableAlias string
    Field      string
    JoinField  string
    BaseTable  string
}

Join store join table info. For example:

Join {

BaseTable:   "users",
Field:       "role_id",
Table:       "roles",
JoinField:   "id",

}

It will generate the join table sql like:

... left join roles on roles.id = users.role_id ...

func (Join) GetTableName Uses

func (j Join) GetTableName() string

func (Join) Valid Uses

func (j Join) Valid() bool

type Joins Uses

type Joins []Join

func (Joins) Last Uses

func (j Joins) Last() Join

func (Joins) Valid Uses

func (j Joins) 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
    SetAttributes(attr template.HTMLAttr) LinkAttribute
    SetClass(class template.HTML) LinkAttribute
    NoPjax() LinkAttribute
    SetTabTitle(value template.HTML) LinkAttribute
    SetContent(value template.HTML) LinkAttribute
    GetContent() template.HTML
}

type LinkField Uses

type LinkField struct {
    Field   string
    Value   template.HTML
    Hide    bool
    Disable bool
}
type NavButton struct {
    *BaseButton
    Icon string
}

func GetNavButton Uses

func GetNavButton(title template.HTML, icon string, action Action, names ...string) *NavButton
func (n *NavButton) Content() (template.HTML, template.JS)

type NewPageParam Uses

type NewPageParam struct {
    User         models.UserModel
    Menu         *menu.Menu
    Panel        Panel
    Assets       template.HTML
    Buttons      Buttons
    Iframe       bool
    TmplHeadHTML template.HTML
    TmplFootJS   template.HTML
}

func (NewPageParam) NavButtonsAndJS Uses

func (param NewPageParam) NavButtonsAndJS() (template.HTML, template.HTML)

type OptionArrInitFn Uses

type OptionArrInitFn func(val FieldModel) []FieldOptions

type OptionInitFn Uses

type OptionInitFn func(val FieldModel) FieldOptions

type OptionProcessFn Uses

type OptionProcessFn func(options FieldOptions) FieldOptions

type OptionTable Uses

type OptionTable struct {
    Table          string
    TextField      string
    ValueField     string
    QueryProcessFn OptionTableQueryProcessFn
    ProcessFn      OptionProcessFn
}

type OptionTableQueryProcessFn Uses

type OptionTableQueryProcessFn func(sql *db.SQL) *db.SQL

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

    TmplHeadHTML template.HTML
    TmplFootJS   template.HTML

    // Components assets
    AssetsList template.HTML

    // Footer info
    FooterInfo template.HTML

    // Load as Iframe or not
    Iframe bool

    NavButtonsHTML template.HTML
    // contains filtered or unexported fields
}

Page used in the template as a top variable.

func NewPage Uses

func NewPage(param NewPageParam) *Page

func NewPagePanel Uses

func NewPagePanel(panel Panel) *Page

func (*Page) AddButton Uses

func (page *Page) AddButton(title template.HTML, icon string, action Action) *Page

type PaginatorAttribute Uses

type PaginatorAttribute interface {
    SetCurPageStartIndex(value string) PaginatorAttribute
    SetCurPageEndIndex(value string) PaginatorAttribute
    SetTotal(value string) PaginatorAttribute
    SetHideEntriesInfo() 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 {
    Title       template.HTML
    Description template.HTML
    Content     template.HTML

    CSS template.CSS
    JS  template.JS
    Url string

    // Whether to toggle the sidebar
    MiniSidebar bool

    // Auto refresh page switch.
    AutoRefresh bool
    // Refresh page intervals, the unit is second.
    RefreshInterval []int

    Callbacks Callbacks
}

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

func (Panel) GetContent Uses

func (p Panel) GetContent(params ...bool) Panel

type PanelInfo Uses

type PanelInfo struct {
    Thead    Thead    `json:"thead"`
    InfoList InfoList `json:"info_list"`
}

type PopupAttribute Uses

type PopupAttribute interface {
    SetID(value string) PopupAttribute
    SetTitle(value template.HTML) PopupAttribute
    SetDraggable() PopupAttribute
    SetHideFooter() PopupAttribute
    SetWidth(width string) PopupAttribute
    SetHeight(height string) PopupAttribute
    SetFooter(value template.HTML) PopupAttribute
    SetFooterHTML(value template.HTML) PopupAttribute
    SetBody(value template.HTML) PopupAttribute
    SetSize(value string) PopupAttribute
    GetContent() template.HTML
}

type PostFieldFilterFn Uses

type PostFieldFilterFn func(value PostFieldModel) interface{}

PostFieldFilterFn is filter function of data.

type PostFieldModel Uses

type PostFieldModel struct {
    ID    string
    Value FieldModelValue
    Row   map[string]string
    // Post type
    PostType PostType
}

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

func (PostFieldModel) IsCreate Uses

func (m PostFieldModel) IsCreate() bool

func (PostFieldModel) IsUpdate Uses

func (m PostFieldModel) IsUpdate() bool

type PostType Uses

type PostType uint8

type QueryFilterFn Uses

type QueryFilterFn func(param parameter.Parameters, conn db.Connection) (ids []string, stopQuery bool)

type Responder Uses

type Responder func(ctx *context.Context)

type RowAttribute Uses

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

type S Uses

type S map[string]string

func Size Uses

func Size(sm, md, lg int) S

func SizeLG Uses

func SizeLG(lg int) S

func SizeMD Uses

func SizeMD(md int) S

func SizeSM Uses

func SizeSM(sm int) S

func SizeXL Uses

func SizeXL(xl int) S

func SizeXS Uses

func SizeXS(xs int) S

func (S) LG Uses

func (s S) LG(lg int) S

func (S) MD Uses

func (s S) MD(md int) S

func (S) SM Uses

func (s S) SM(sm int) S

func (S) XL Uses

func (s S) XL(xl int) S

func (S) XS Uses

func (s S) XS(xs int) S

type Sort Uses

type Sort uint8
const (
    SortDesc Sort = iota
    SortAsc
)

type SystemInfo Uses

type SystemInfo struct {
    Version string
    Theme   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 Thead) TableAttribute
    SetInfoList(value []map[string]InfoItem) TableAttribute
    SetType(value string) TableAttribute
    SetName(name string) TableAttribute
    SetMinWidth(value string) TableAttribute
    SetHideThead() TableAttribute
    SetLayout(value string) TableAttribute
    SetStyle(style string) TableAttribute
    GetContent() template.HTML
}

type TableInfo Uses

type TableInfo struct {
    Table      string
    PrimaryKey string
    Delimiter  string
    Driver     string
}

type TableRowData Uses

type TableRowData struct {
    Id    template.HTML
    Ids   template.HTML
    Value map[string]InfoItem
}

type TabsAttribute Uses

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

type Thead Uses

type Thead []TheadItem

func (Thead) GroupBy Uses

func (t Thead) GroupBy(group [][]string) []Thead

type TheadItem Uses

type TheadItem struct {
    Head       string       `json:"head"`
    Sortable   bool         `json:"sortable"`
    Field      string       `json:"field"`
    Hide       bool         `json:"hide"`
    Editable   bool         `json:"editable"`
    EditType   string       `json:"edit_type"`
    EditOption FieldOptions `json:"edit_option"`
    Width      string       `json:"width"`
}

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 TreeViewAttribute Uses

type TreeViewAttribute interface {
    SetTree(value TreeViewData) TreeViewAttribute
    SetUrlPrefix(value string) TreeViewAttribute
    SetID(id string) TreeViewAttribute
    GetContent() template.HTML
}

type TreeViewData Uses

type TreeViewData struct {
    Data              TreeViewItems `json:"data,omitempty"`
    Levels            int           `json:"levels,omitempty"`
    BackColor         string        `json:"backColor,omitempty"`
    BorderColor       string        `json:"borderColor,omitempty"`
    CheckedIcon       string        `json:"checkedIcon,omitempty"`
    CollapseIcon      string        `json:"collapseIcon,omitempty"`
    Color             string        `json:"color,omitempty"`
    EmptyIcon         string        `json:"emptyIcon,omitempty"`
    EnableLinks       bool          `json:"enableLinks,omitempty"`
    ExpandIcon        string        `json:"expandIcon,omitempty"`
    MultiSelect       bool          `json:"multiSelect,omitempty"`
    NodeIcon          string        `json:"nodeIcon,omitempty"`
    OnhoverColor      string        `json:"onhoverColor,omitempty"`
    SelectedIcon      string        `json:"selectedIcon,omitempty"`
    SearchResultColor string        `json:"searchResultColor,omitempty"`
    SelectedBackColor string        `json:"selectedBackColor,omitempty"`
    SelectedColor     string        `json:"selectedColor,omitempty"`
    ShowBorder        bool          `json:"showBorder,omitempty"`
    ShowCheckbox      bool          `json:"showCheckbox,omitempty"`
    ShowIcon          bool          `json:"showIcon,omitempty"`
    ShowTags          bool          `json:"showTags,omitempty"`
    UncheckedIcon     string        `json:"uncheckedIcon,omitempty"`

    SearchResultBackColor  string `json:"searchResultBackColor,omitempty"`
    HighlightSearchResults bool   `json:"highlightSearchResults,omitempty"`
}

type TreeViewItem Uses

type TreeViewItem struct {
    Text         string            `json:"text,omitempty"`
    Icon         string            `json:"icon,omitempty"`
    SelectedIcon string            `json:"selected_icon,omitempty"`
    Color        string            `json:"color,omitempty"`
    BackColor    string            `json:"backColor,omitempty"`
    Href         string            `json:"href,omitempty"`
    Selectable   bool              `json:"selectable,omitempty"`
    State        TreeViewItemState `json:"state,omitempty"`
    Tags         []string          `json:"tags,omitempty"`
    Nodes        TreeViewItems     `json:"nodes,omitempty"`
}

type TreeViewItemState Uses

type TreeViewItemState struct {
    Checked  bool `json:"checked,omitempty"`
    Disabled bool `json:"disabled,omitempty"`
    Expanded bool `json:"expanded,omitempty"`
    Selected bool `json:"selected,omitempty"`
}

type TreeViewItems Uses

type TreeViewItems []TreeViewItem

type UpdateParametersFn Uses

type UpdateParametersFn func(param *parameter.Parameters)

type Where Uses

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

type WhereRaw Uses

type WhereRaw struct {
    Raw  string
    Args []interface{}
}

func (WhereRaw) Statement Uses

func (wh WhereRaw) Statement(wheres string, whereArgs []interface{}) (string, []interface{})

type Wheres Uses

type Wheres []Where

func (Wheres) Statement Uses

func (whs Wheres) Statement(wheres, delimiter string, whereArgs []interface{}, existKeys, columns []string) (string, []interface{})

Directories

PathSynopsis
action
display
form
form/select
table

Package types imports 25 packages (graph) and is imported by 69 packages. Updated 2020-07-09. Refresh now. Tools for package owners.