Documentation ¶
Overview ¶
Code generated for package simple_admin by go-bindata DO NOT EDIT. (@generated) sources: simple_admin_templates/external_chartAddEdit.chunk.css simple_admin_templates/external_chartAddEdit.js simple_admin_templates/p__404.js simple_admin_templates/p__Welcome.chunk.css simple_admin_templates/p__Welcome.js simple_admin_templates/p__account__changePassword.chunk.css simple_admin_templates/p__account__changePassword.js simple_admin_templates/p__dashboard__add.chunk.css simple_admin_templates/p__dashboard__add.js simple_admin_templates/p__dashboard__edit.chunk.css simple_admin_templates/p__dashboard__edit.js simple_admin_templates/p__dashboard__index.chunk.css simple_admin_templates/p__dashboard__index.js simple_admin_templates/p__dataShow.chunk.css simple_admin_templates/p__dataShow.js simple_admin_templates/p__dataShow__single.chunk.css simple_admin_templates/p__dataShow__single.js simple_admin_templates/p__layout__SecurityLayout.chunk.css simple_admin_templates/p__layout__SecurityLayout.js simple_admin_templates/p__userManage__index.chunk.css simple_admin_templates/p__userManage__index.js simple_admin_templates/p__user__login__index.chunk.css simple_admin_templates/p__user__login__index.js simple_admin_templates/simple_admin.html simple_admin_templates/umi.css simple_admin_templates/umi.js simple_admin_templates/vendors~external_chartAddEdit.chunk.css simple_admin_templates/vendors~external_chartAddEdit.js simple_admin_templates/vendors~external_chartAddEdit~p__Welcome~p__account__changePassword~p__dashboard__index~p__dataShow~~28b62020.chunk.css simple_admin_templates/vendors~external_chartAddEdit~p__Welcome~p__account__changePassword~p__dashboard__index~p__dataShow~~28b62020.js simple_admin_templates/vendors~external_chartAddEdit~p__user__login__index.chunk.css simple_admin_templates/vendors~external_chartAddEdit~p__user__login__index.js simple_admin_templates/vendors~p__404.chunk.css simple_admin_templates/vendors~p__404.js simple_admin_templates/vendors~p__404~p__Welcome~p__account__changePassword~p__dashboard__add~p__dashboard__edit~p__dashboa~837a9f08.chunk.css simple_admin_templates/vendors~p__404~p__Welcome~p__account__changePassword~p__dashboard__add~p__dashboard__edit~p__dashboa~837a9f08.js simple_admin_templates/vendors~p__Welcome~p__account__changePassword~p__dashboard__add~p__dashboard__edit~p__dashboard__ind~5b4479c7.chunk.css simple_admin_templates/vendors~p__Welcome~p__account__changePassword~p__dashboard__add~p__dashboard__edit~p__dashboard__ind~5b4479c7.js simple_admin_templates/vendors~p__Welcome~p__account__changePassword~p__dashboard__add~p__dashboard__edit~p__dashboard__ind~f7f871a1.chunk.css simple_admin_templates/vendors~p__Welcome~p__account__changePassword~p__dashboard__add~p__dashboard__edit~p__dashboard__ind~f7f871a1.js
Index ¶
- Variables
- func AddDashBoard(ctx iris.Context)
- func AddDashBoardScreen(ctx iris.Context)
- func AddRouterData(ctx iris.Context)
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetFile() http.FileSystem
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func ChangeUserPassword(ctx iris.Context)
- func ChangeUserRoles(ctx iris.Context)
- func Configuration(ctx iris.Context)
- func DashBoardIsSelfMiddleware(ctx iris.Context)
- func DashBoardSourceGet(ctx iris.Context)
- func DeleteBoardScreen(ctx iris.Context)
- func DeleteDashBoard(ctx iris.Context)
- func EditDashBoard(ctx iris.Context)
- func EditDashBoardPosition(ctx iris.Context)
- func EditRouterData(ctx iris.Context)
- func GenJwtToken(userUid, userName string) string
- func GetCurrentUser(ctx iris.Context)
- func GetDashBoard(ctx iris.Context)
- func GetDashBoardScreen(ctx iris.Context)
- func GetMapValues(a map[string]string) []string
- func GetRouterCustomAction(ctx iris.Context)
- func GetRouterData(ctx iris.Context)
- func GetRouterFields(ctx iris.Context)
- func GetRouterSingleData(ctx iris.Context)
- func GetRouters(ctx iris.Context)
- func GetSingleDashBoard(ctx iris.Context)
- func Index(ctx iris.Context)
- func IsNum(s string) bool
- func Login(ctx iris.Context)
- func MsgLog(msg string) error
- func MustAsset(name string) []byte
- func PolicyRequireAdminMiddleware(ctx iris.Context)
- func PolicyValidMiddleware(ctx iris.Context)
- func RandStringBytes(n int) string
- func Reg(ctx iris.Context)
- func RemoveRouterData(ctx iris.Context)
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func SearchRouterData(ctx iris.Context)
- func SpiderVisitHistoryMiddleware(ctx iris.Context)
- func StringsContains(a []string, x string) bool
- func TokenToUserUidMiddleware(ctx iris.Context)
- type Config
- type ConfigResp
- type CustomAction
- type CustomActionResp
- type DashBoard
- type DashBoardAddReq
- type DashBoardChangePositionReq
- type DashBoardGetDataItem
- type DashBoardGetDataReq
- type DashBoardScreen
- type DashBoardScreenAddOrEditReq
- type DeleteReq
- type GetAllTableNameResp
- type GetCurrentUserResp
- type PagResult
- type SearchReq
- type SpAdmin
- type SpDeleteAfterProcess
- type SpDeleteBeforeProcess
- type SpInsertAfterProcess
- type SpInsertBeforeProcess
- type SpTableNameProcess
- type SpUpdateAfterProcess
- type SpUpdateBeforeProcess
- type SpiderHistory
- type TableFieldsResp
- type TableInfoList
- type UserChangePasswordReq
- type UserChangeRolesReq
- type UserLoginReq
- type UserLoginResp
- type UserModel
Constants ¶
This section is empty.
Variables ¶
var ( NowSpAdmin *SpAdmin SvKey = sv.GlobalContextKey DefaultPrefix = "/SP_PREFIX" )
var CustomJwt = jwt.New(jwt.Config{ ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) { return MySecret, nil }, Expiration: true, SigningMethod: jwt.SigningMethodHS256, })
自定义JWT 使用办法 中间层 handler.CustomJwt.Serve, handler.TokenToUserUidMiddleware,user handler
var MySecret = []byte("8657684ae02840ead423e0d781a7a0c5")
Functions ¶
func AddDashBoardScreen ¶ added in v1.4.8
func AddDashBoardScreen(ctx iris.Context)
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetFile ¶ added in v1.3.1
func AssetFile() http.FileSystem
AssetFile return a http.FileSystem instance that data backend by asset
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func DashBoardIsSelfMiddleware ¶ added in v1.4.8
func DashBoardIsSelfMiddleware(ctx iris.Context)
数据可视化必须本人操作Middleware
func DeleteBoardScreen ¶ added in v1.4.8
func DeleteBoardScreen(ctx iris.Context)
func GetMapValues ¶
func GetRouterCustomAction ¶ added in v1.0.8
func GetRouterCustomAction(ctx iris.Context)
获取单个表的自定义操作
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func PolicyRequireAdminMiddleware ¶
func PolicyRequireAdminMiddleware(ctx iris.Context)
必须admin权限middleware
func RandStringBytes ¶
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
func SpiderVisitHistoryMiddleware ¶ added in v1.2.7
func SpiderVisitHistoryMiddleware(ctx iris.Context)
爬虫监听Middleware
func StringsContains ¶
Types ¶
type Config ¶
type Config struct { Name string // 后台显示名称 Engine *xorm.Engine // xorm engine实例 App *iris.Application // iris实例 ModelList []interface{} // 模型列表 UserModel interface{} // 用户模型 RunSync bool // 是否进行sync PageSize int // 每页条数 AbridgeName string // tag的解析名称 Prefix string // 前缀 InitAdminUserName string // 初始管理员用户名 若存在则跳过 InitAdminPassword string // 初始管理员密码 UserModelSpecialUniqueName string // 用户模型唯一名 CustomActions []CustomAction // 自定义action列表 EnableSpiderWatch bool // 开启爬虫监听 SpiderMatchList []string // 爬虫ua匹配列表 SpiderSkipList []string // 爬虫匹配忽略 // contains filtered or unexported fields }
type ConfigResp ¶ added in v1.0.2
type CustomAction ¶ added in v1.0.8
type CustomAction struct { Name string `json:"name"` // action display name Methods string `json:"methods"` // request run methods Valid interface{} `json:"valid"` // request valid struct Path string `json:"path"` // request path Scope interface{} `json:"scope"` // show where Func func(ctx iris.Context) // contains filtered or unexported fields }
自定义action
type CustomActionResp ¶ added in v1.0.8
type DashBoard ¶ added in v1.4.8
type DashBoard struct { Id uint64 `xorm:"autoincr pk unique" json:"id"` ScreenId uint64 `sp:"fk('DashBoardScreen') index" comment:"屏幕ID" json:"screen_id" ` Name string `xorm:"varchar(45) notnull" comment:"名称" json:"name"` ChartType string `xorm:"varchar(40) notnull" comment:"图表类型" json:"chart_type"` DataSource string `xorm:"text notnull" comment:"数据源" json:"data_source"` Extra string `xorm:"text" comment:"附加信息" json:"extra"` Config string `xorm:"text notnull" comment:"配置" json:"config"` }
type DashBoardAddReq ¶ added in v1.4.8
type DashBoardAddReq struct { Name string `json:"name" form:"name" comment:"名称" validate:"required,max=45"` DataSource string `json:"data_source" form:"data_source" comment:"数据源配置" validate:"required"` Config string `json:"config" form:"config" comment:"图表配置" validate:"required"` ChartType string `json:"chart_type" form:"chart_type" comment:"图表类型" validate:"required"` }
数据图表新增
type DashBoardChangePositionReq ¶ added in v1.4.9
type DashBoardChangePositionReq struct {
Extra string `json:"extra" form:"extra" comment:"附加信息" validate:"required"`
}
数据图表位置变更
type DashBoardGetDataItem ¶ added in v1.4.8
type DashBoardGetDataItem struct { ColName string `json:"col_name" comment:"列名" validate:"required,max=50"` OpType string `json:"op_type" comment:"操作" validate:"required,max=20"` // = > != < >= <= in (not in) like Value string `json:"value" comment:"值" validate:"required,max=100"` Order uint64 `json:"order" comment:"顺序" validate:"required"` // 以小到大排列 ConnectType string `json:"connect_type" comment:"连接方式"` // and or xor not }
获取数据源内容
type DashBoardGetDataReq ¶ added in v1.4.8
type DashBoardGetDataReq struct { ColumnOp []DashBoardGetDataItem `json:"column_op"` Limit uint64 `json:"limit"` }
获取数据源
type DashBoardScreen ¶ added in v1.4.8
type DashBoardScreen struct { Id uint64 `xorm:"autoincr pk unique" json:"id"` Name string `xorm:"varchar(45) notnull" comment:"仪表台名称" json:"name"` Priority uint64 `xorm:"notnull" comment:"优先级" json:"priority"` IsDefault bool `xorm:"notnull" comment:"默认" json:"is_default"` CreateUserId uint64 `xorm:"notnull index" comment:"用户ID" json:"create_user_id"` }
仪表台模型
func (*DashBoardScreen) SpAlias ¶ added in v1.4.8
func (c *DashBoardScreen) SpAlias() string
type DashBoardScreenAddOrEditReq ¶ added in v1.4.8
type DashBoardScreenAddOrEditReq struct { Id uint64 `json:"id" form:"name" comment:"id"` Name string `json:"name" form:"name" comment:"名称" validate:"required,max=25"` IsDefault bool `json:"is_default" form:"is_default" comment:"默认"` }
数据屏幕
type DeleteReq ¶ added in v1.0.2
type DeleteReq struct {
Ids string `json:"ids" form:"ids" comment:"标识符列表" validate:"required,min=1"`
}
type GetAllTableNameResp ¶ added in v1.4.3
type GetCurrentUserResp ¶ added in v1.0.2
type PagResult ¶
type PagResult struct { All int64 `json:"all"` Page int `json:"page"` PageSize int `json:"page_size"` Data []map[string]string `json:"data"` }
分页结果
type SearchReq ¶ added in v1.2.6
type SearchReq struct { Cols []string `json:"cols" form:"cols" comment:"列信息" validate:"required"` // column map name SearchText string `json:"search_text" form:"search_text" comment:"搜索内容" validate:"max=20" ` FullMath bool `json:"full_math" form:"full_math" comment:"全匹配"` }
搜索
type SpAdmin ¶
type SpAdmin struct {
// contains filtered or unexported fields
}
func (*SpAdmin) Pagination ¶
分页
type SpDeleteAfterProcess ¶ added in v1.4.3
type SpDeleteAfterProcess interface {
SpDeleteAfter()
}
删除之后
type SpDeleteBeforeProcess ¶ added in v1.4.3
type SpDeleteBeforeProcess interface {
SpDeleteBefore()
}
删除之前
type SpInsertAfterProcess ¶ added in v1.4.3
type SpInsertAfterProcess interface {
SpInsertAfter()
}
插入之后
type SpInsertBeforeProcess ¶ added in v1.4.3
type SpInsertBeforeProcess interface {
SpInsertBefore()
}
插入之前
type SpTableNameProcess ¶ added in v1.4.3
type SpTableNameProcess interface {
SpAlias() string
}
表别名
type SpUpdateAfterProcess ¶ added in v1.4.3
type SpUpdateAfterProcess interface {
SpUpdateAfter()
}
更新之后
type SpUpdateBeforeProcess ¶ added in v1.4.3
type SpUpdateBeforeProcess interface {
SpUpdateBefore()
}
更新之前
type SpiderHistory ¶ added in v1.2.7
type SpiderHistory struct { Id uint64 `xorm:"autoincr pk unique" json:"id"` CreateTime time.Time `xorm:"created index" json:"create_time" comment:"创建时间"` Ip string `xorm:"varchar(15)" json:"ip" comment:"ip地址"` Match string `xorm:"varchar(40)" json:"match" comment:"爬虫名"` Ua string `xorm:"varchar(150)" json:"ua" comment:"ua"` Page string `xorm:"varchar(150)" json:"page" comment:"访问路径"` // 访问路径 }
模型爬虫监听模型
func (*SpiderHistory) SpAlias ¶ added in v1.4.7
func (c *SpiderHistory) SpAlias() string
type TableFieldsResp ¶ added in v1.0.3
type TableInfoList ¶ added in v1.3.7
type TableInfoList struct { RouterName string `json:"router_name"` RemarkName string `json:"remark_name"` FieldList TableFieldsResp `json:"field_list"` Actions []CustomAction `json:"actions"` }
表信息存储
type UserChangePasswordReq ¶ added in v1.0.2
type UserChangePasswordReq struct { Id uint64 `json:"id" comment:"id" validate:"required"` UserName string `json:"user_name" comment:"用户名" validate:"required,max=20,min=3"` Password string `json:"password" comment:"密码" validate:"required,min=3,max=20"` }
用户变更密码
type UserChangeRolesReq ¶ added in v1.0.2
type UserChangeRolesReq struct { Id uint64 `json:"id" comment:"id" validate:"required"` Role string `json:"role" comment:"群组名" validate:"required"` Add bool `json:"add" comment:"添加"` }
admin 变更用户群组
type UserLoginReq ¶ added in v1.0.2
type UserLoginReq struct { UserName string `json:"user_name" comment:"用户名" validate:"required,max=20,min=3"` Password string `json:"password" comment:"密码" validate:"required,min=3,max=20"` }
用户登录
type UserLoginResp ¶ added in v1.0.2
type UserLoginResp struct { Token string `json:"token"` UserInfo GetCurrentUserResp `json:"user_info"` }
type UserModel ¶
type UserModel struct { Id uint64 `xorm:"autoincr pk unique" json:"id"` UserName string `xorm:"varchar(60) notnull unique index" comment:"用户名" json:"username"` Password string `xorm:"varchar(100) notnull" comment:"密码" json:"password"` Salt string `xorm:"varchar(40) notnull" comment:"加密salt" json:"salt"` }
默认用户模型