mirror of
https://shylinux.com/x/operation
synced 2025-04-24 17:08:04 +08:00
add some
This commit is contained in:
parent
165c5356ca
commit
a05a435956
24
src/dashboard/cleanup.go
Normal file
24
src/dashboard/cleanup.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package dashboard
|
||||||
|
|
||||||
|
import (
|
||||||
|
"shylinux.com/x/ice"
|
||||||
|
)
|
||||||
|
|
||||||
|
type cleanup struct {
|
||||||
|
Tables
|
||||||
|
portal Portal
|
||||||
|
order string `data:"3"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s cleanup) PlaceTrash(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmdy(s.portal, s.portal.PlaceTrash)
|
||||||
|
m.DisplayTable()
|
||||||
|
}
|
||||||
|
func (s cleanup) List(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmdy(s.portal, s.portal.PlaceCheck)
|
||||||
|
// m.Cmdy(s.Prefix(m, "service"))
|
||||||
|
// m.Cmdy("web.code.mysql.cleanup", "mysql").Action()
|
||||||
|
m.DisplayTable()
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { ice.TeamCtxCmd(cleanup{}) }
|
@ -23,12 +23,12 @@ func (s dashboard) Config(m *ice.Message, arg ...string) {
|
|||||||
s.UserPlaceInit(m)
|
s.UserPlaceInit(m)
|
||||||
}
|
}
|
||||||
func (s dashboard) Schema(m *ice.Message, arg ...string) {
|
func (s dashboard) Schema(m *ice.Message, arg ...string) {
|
||||||
m.Display("/plugin/table.js")
|
|
||||||
s.Show(m, s.Open(m).Raw(`
|
s.Show(m, s.Open(m).Raw(`
|
||||||
select TABLE_SCHEMA,TABLE_NAME,TABLE_ROWS,DATA_LENGTH,INDEX_LENGTH from information_schema.TABLES
|
select TABLE_SCHEMA,TABLE_NAME,TABLE_ROWS,DATA_LENGTH,INDEX_LENGTH from information_schema.TABLES
|
||||||
where TABLE_SCHEMA != 'mysql' AND TABLE_SCHEMA != 'information_schema' AND TABLE_SCHEMA != 'performance_schema'
|
where TABLE_SCHEMA != 'mysql' AND TABLE_SCHEMA != 'information_schema' AND TABLE_SCHEMA != 'performance_schema'
|
||||||
order by DATA_LENGTH desc
|
order by DATA_LENGTH desc
|
||||||
`))
|
`))
|
||||||
|
m.DisplayTable()
|
||||||
}
|
}
|
||||||
func (s dashboard) List(m *ice.Message, arg ...string) {
|
func (s dashboard) List(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
|
@ -10,8 +10,10 @@ const (
|
|||||||
TITLE = "title"
|
TITLE = "title"
|
||||||
CONTENT = "content"
|
CONTENT = "content"
|
||||||
CREATED_AT = "created_at"
|
CREATED_AT = "created_at"
|
||||||
|
DELETED_AT = "deleted_at"
|
||||||
USER_UID = "user_uid"
|
USER_UID = "user_uid"
|
||||||
USER_DASHBOARD_ROLE = "user_dashboard_role"
|
USER_DASHBOARD_ROLE = "user_dashboard_role"
|
||||||
|
AUTH_UID = "auth_uid"
|
||||||
DASHBOARD_UID = "dashboard_uid"
|
DASHBOARD_UID = "dashboard_uid"
|
||||||
DASHBOARD_NAME = "dashboard_name"
|
DASHBOARD_NAME = "dashboard_name"
|
||||||
DASHBOARD_TYPE = "dashboard_type"
|
DASHBOARD_TYPE = "dashboard_type"
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
package dashboard
|
package dashboard
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"shylinux.com/x/ice"
|
||||||
|
|
||||||
"shylinux.com/x/community/src/gonganxitong"
|
"shylinux.com/x/community/src/gonganxitong"
|
||||||
"shylinux.com/x/operation/src/operation"
|
"shylinux.com/x/operation/src/operation"
|
||||||
)
|
)
|
||||||
@ -10,6 +14,16 @@ type Portal struct {
|
|||||||
placeCreate string `name:"placeCreate city_name* company_name* dashboard_name* dashboard_type:select" role:"void"`
|
placeCreate string `name:"placeCreate city_name* company_name* dashboard_name* dashboard_type:select" role:"void"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s Portal) PlaceTrash(m *ice.Message, arg ...string) {
|
||||||
|
s.Portal.PlaceTrash(m, arg...)
|
||||||
|
for key, _ := range m.Target().Commands {
|
||||||
|
if strings.HasPrefix(key, "_") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
m.Push("command", key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
gonganxitong.PortalCmd(Portal{Portal: operation.NewPortal(userDashboard{}, dashboard{})})
|
gonganxitong.PortalCmd(Portal{Portal: operation.NewPortal(userDashboard{}, dashboard{})})
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"portal": "数据分析",
|
"portal": "数据分析",
|
||||||
"dashboard": "连接配置", "summary": "数据汇总",
|
"dashboard": "连接配置", "summary": "数据汇总", "cleanup": "数据清理",
|
||||||
"config": "配置", "schema": "概况",
|
"config": "配置", "schema": "概况",
|
||||||
"icons": {
|
"icons": {
|
||||||
"dashboard": "https://img.icons8.com/officel/80/data-configuration.png",
|
"dashboard": "https://img.icons8.com/officel/80/data-configuration.png",
|
||||||
"summary": "https://img.icons8.com/officel/80/statistics.png"
|
"summary": "https://img.icons8.com/officel/80/statistics.png",
|
||||||
|
"cleanup": "https://img.icons8.com/officel/80/data-configuration.png"
|
||||||
},
|
},
|
||||||
"input": {
|
"input": {
|
||||||
"My Dashboard": "我的数据",
|
"My Dashboard": "我的数据",
|
||||||
|
@ -15,4 +15,4 @@ func main() { print(ice.Run()) }
|
|||||||
func init() {
|
func init() {
|
||||||
ice.Info.NodeMain = "web.team.production.portal"
|
ice.Info.NodeMain = "web.team.production.portal"
|
||||||
ice.Info.CodeMain = "src/operation/portal.go"
|
ice.Info.CodeMain = "src/operation/portal.go"
|
||||||
}
|
}
|
@ -3,14 +3,14 @@ package gonganxitong
|
|||||||
import "shylinux.com/x/ice"
|
import "shylinux.com/x/ice"
|
||||||
|
|
||||||
type {{.Option "name"}} struct {
|
type {{.Option "name"}} struct {
|
||||||
Table
|
Tables
|
||||||
fields string `data:"title,content"`
|
fields string `data:"title,content"`
|
||||||
create string `name:"create title* content*" role:"leader"`
|
create string `name:"create title* content*" role:"leader"`
|
||||||
remove string `name:"remove" role:"leader"`
|
remove string `name:"remove" role:"leader"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s {{.Option "name"}}) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) }
|
func (s {{.Option "name"}}) List(m *ice.Message, arg ...string) {
|
||||||
func (s {{.Option "name"}}) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
|
// s.ValueList(m, arg).Display("")
|
||||||
func (s {{.Option "name"}}) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
}
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd({{.Option "name"}}{}) }
|
func init() { ice.TeamCtxCmd({{.Option "name"}}{}) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user