forked from x/icebergs
add some
This commit is contained in:
parent
4f181981df
commit
37b26a8bfc
@ -5,6 +5,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/web/html"
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -217,7 +218,31 @@ var Index = &ice.Context{Name: MDB, Help: "数据模块", Commands: ice.Commands
|
|||||||
// LIST, func() { _list_prunes(m, arg[0], arg[1], arg[3:]...) },
|
// LIST, func() { _list_prunes(m, arg[0], arg[1], arg[3:]...) },
|
||||||
)
|
)
|
||||||
}},
|
}},
|
||||||
EXPORT: {Name: "export key sub type file", Hand: func(m *ice.Message, arg ...string) {
|
EXPORT: {Name: "export index auto", Help: "导出数据", Actions: ice.MergeActions(ice.Actions{
|
||||||
|
IMPORT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
HashSelect(m).Table(func(value ice.Maps) {
|
||||||
|
if value[STATUS] != DISABLE {
|
||||||
|
m.Cmd(IMPORT, value["index"], "", value["type"])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}},
|
||||||
|
EXPORT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
HashSelect(m).Table(func(value ice.Maps) {
|
||||||
|
if value[STATUS] != DISABLE {
|
||||||
|
m.Cmd(EXPORT, value["index"], "", value["type"])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}},
|
||||||
|
ENABLE: {Hand: func(m *ice.Message, arg ...string) { HashModify(m, STATUS, ENABLE) }},
|
||||||
|
DISABLE: {Hand: func(m *ice.Message, arg ...string) { HashModify(m, STATUS, DISABLE) }},
|
||||||
|
}, ExportHashAction(SHORT, "index", FIELD, "time,index,type,status")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if len(arg) < 2 {
|
||||||
|
HashSelect(m, arg...).RewriteAppend(func(value, key string, index int) string {
|
||||||
|
kit.If(key == STATUS, func() { value = kit.Select(ENABLE, value) })
|
||||||
|
return value
|
||||||
|
}).PushAction().Action(html.FILTER)
|
||||||
|
return
|
||||||
|
}
|
||||||
m.OptionDefault(CACHE_LIMIT, "-1")
|
m.OptionDefault(CACHE_LIMIT, "-1")
|
||||||
file := _mdb_export_file(m, arg...)
|
file := _mdb_export_file(m, arg...)
|
||||||
kit.Switch(arg[2],
|
kit.Switch(arg[2],
|
||||||
|
2
conf.go
2
conf.go
@ -356,6 +356,8 @@ const ( // mdb
|
|||||||
INPUTS = "inputs"
|
INPUTS = "inputs"
|
||||||
CREATE = "create"
|
CREATE = "create"
|
||||||
SELECT = "select"
|
SELECT = "select"
|
||||||
|
IMPORT = "import"
|
||||||
|
EXPORT = "export"
|
||||||
|
|
||||||
KEY = "key"
|
KEY = "key"
|
||||||
VALUE = "value"
|
VALUE = "value"
|
||||||
|
2
init.go
2
init.go
@ -60,6 +60,7 @@ var Index = &Context{Name: ICE, Help: "冰山模块", Commands: Commands{
|
|||||||
INIT: {Hand: func(m *Message, arg ...string) {
|
INIT: {Hand: func(m *Message, arg ...string) {
|
||||||
m.Cmd(kit.Keys(MDB, CTX_INIT))
|
m.Cmd(kit.Keys(MDB, CTX_INIT))
|
||||||
m.Cmd(CTX_INIT)
|
m.Cmd(CTX_INIT)
|
||||||
|
m.Cmd(EXPORT, IMPORT)
|
||||||
m.Cmd(SOURCE, ETC_INIT_SHY)
|
m.Cmd(SOURCE, ETC_INIT_SHY)
|
||||||
loadImportant(m)
|
loadImportant(m)
|
||||||
m.Cmd(CTX_OPEN)
|
m.Cmd(CTX_OPEN)
|
||||||
@ -71,6 +72,7 @@ var Index = &Context{Name: ICE, Help: "冰山模块", Commands: Commands{
|
|||||||
m.GoSleep300ms(func() {
|
m.GoSleep300ms(func() {
|
||||||
m.root.Option(EXIT, kit.Select("0", arg, 0))
|
m.root.Option(EXIT, kit.Select("0", arg, 0))
|
||||||
m.Cmd(SOURCE, ETC_EXIT_SHY)
|
m.Cmd(SOURCE, ETC_EXIT_SHY)
|
||||||
|
m.Cmd(EXPORT, EXPORT)
|
||||||
m.Cmd(CTX_EXIT)
|
m.Cmd(CTX_EXIT)
|
||||||
removeImportant(m)
|
removeImportant(m)
|
||||||
})
|
})
|
||||||
|
@ -60,6 +60,7 @@ type relay struct {
|
|||||||
ice.Hash
|
ice.Hash
|
||||||
ice.Code
|
ice.Code
|
||||||
checkbox string `data:"true"`
|
checkbox string `data:"true"`
|
||||||
|
export string `data:"true"`
|
||||||
short string `data:"machine"`
|
short string `data:"machine"`
|
||||||
field string `data:"time,icons,machine,username,host,port,portal,dream,module,version,commitTime,compileTime,bootTime,go,git,package,shell,kernel,arch,vcpu,ncpu,mhz,mem,disk,network,listen,socket,proc,vendor"`
|
field string `data:"time,icons,machine,username,host,port,portal,dream,module,version,commitTime,compileTime,bootTime,go,git,package,shell,kernel,arch,vcpu,ncpu,mhz,mem,disk,network,listen,socket,proc,vendor"`
|
||||||
create string `name:"create host* port=22 username machine icons"`
|
create string `name:"create host* port=22 username machine icons"`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user