dashboard

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dashboards map[string]*DSL = map[string]*DSL{}

Dashboards the loaded dashboard widgets

Functions

func Export

func Export() error

Export process & api

func Guard

func Guard(c *gin.Context)

Guard form widget dashboard

func Load

func Load(cfg config.Config) error

Load load task

func LoadAndExport

func LoadAndExport(cfg config.Config) error

LoadAndExport load table

func LoadFile

func LoadFile(root string, file string) error

LoadFile load table dsl by file

Types

type ActionDSL

type ActionDSL struct {
	Setting    *action.Process `json:"setting,omitempty"`
	Component  *action.Process `json:"-"`
	Data       *action.Process `json:"data,omitempty"`
	BeforeData *hook.Before    `json:"before:data,omitempty"`
	AfterData  *hook.After     `json:"after:data,omitempty"`
}

ActionDSL the dashboard action DSL

func (*ActionDSL) SetDefaultProcess

func (act *ActionDSL) SetDefaultProcess()

SetDefaultProcess set the default value of action

type DSL

type DSL struct {
	ID     string                 `json:"id,omitempty"`
	Name   string                 `json:"name,omitempty"`
	Action *ActionDSL             `json:"action"`
	Layout *LayoutDSL             `json:"layout"`
	Fields *FieldsDSL             `json:"fields"`
	Config map[string]interface{} `json:"config,omitempty"`
	CProps field.CloudProps       `json:"-"`
	compute.Computable
	*mapping.Mapping
}

DSL the dashboard DSL

func Get

func Get(dashboard interface{}) (*DSL, error)

Get dashboard via process or id

func MustGet

func MustGet(dashboard interface{}) *DSL

MustGet Get dashboard via process or id thow error

func New

func New(id string) *DSL

New create a new DSL

func (*DSL) Actions

func (dsl *DSL) Actions() []component.ActionsExport

Actions get the dashboard actions

func (*DSL) Validate

func (dsl *DSL) Validate() error

Validate table

func (*DSL) Xgen

func (dsl *DSL) Xgen(data map[string]interface{}, excludes map[string]bool) (map[string]interface{}, error)

Xgen trans to xgen setting

type FieldsDSL

type FieldsDSL struct {
	Filter    field.Filters `json:"filter,omitempty"`
	Dashboard field.Columns `json:"dashboard,omitempty"`
	// contains filtered or unexported fields
}

FieldsDSL the dashboard fields DSL

func (*FieldsDSL) Xgen

func (fields *FieldsDSL) Xgen(layout *LayoutDSL) (map[string]interface{}, error)

Xgen trans to xgen setting

type FilterLayoutDSL

type FilterLayoutDSL struct {
	Actions component.Actions   `json:"actions,omitempty"`
	Columns component.Instances `json:"columns,omitempty"`
}

FilterLayoutDSL layout.filter

type LayoutDSL

type LayoutDSL struct {
	Actions   component.Actions `json:"actions,omitempty"`
	Dashboard *ViewLayoutDSL    `json:"dashboard,omitempty"`
	Filter    *FilterLayoutDSL  `json:"filter,omitempty"`
}

LayoutDSL the dashboard layout DSL

func (*LayoutDSL) Clone

func (layout *LayoutDSL) Clone() (*LayoutDSL, error)

Clone layout for output

func (*LayoutDSL) Xgen

func (layout *LayoutDSL) Xgen(data map[string]interface{}, excludes map[string]bool, mapping *mapping.Mapping) (*LayoutDSL, error)

Xgen trans to Xgen setting

type ViewLayoutDSL

type ViewLayoutDSL struct {
	Columns component.Instances `json:"columns,omitempty"`
}

ViewLayoutDSL layout.form

Jump to

Keyboard shortcuts

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