forked from x/icebergs
add pie.go
This commit is contained in:
parent
f622b9ff32
commit
f0b3a57395
@ -86,6 +86,8 @@ func init() {
|
||||
}, Commands: map[string]*ice.Command{
|
||||
web.WEB_LOGIN: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
switch arg[0] {
|
||||
case "/pod/":
|
||||
return // 免登录
|
||||
case "/header":
|
||||
switch kit.Select("", arg, 1) {
|
||||
case AGENT, CHECK, aaa.LOGIN:
|
||||
|
@ -20,6 +20,11 @@ func init() {
|
||||
nfs.SAVE: {Name: "save type file path", Help: "保存", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(nfs.SAVE, path.Join(m.Option(kit.MDB_PATH), m.Option(kit.MDB_FILE)))
|
||||
}},
|
||||
ice.RUN: {Name: "run", Help: "运行", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(cli.SYSTEM, GO, ice.RUN, path.Join(kit.Slice(arg, 0, 2)...))
|
||||
m.Set(ice.MSG_APPEND)
|
||||
m.ProcessInner()
|
||||
}},
|
||||
mdb.ENGINE: {Name: "engine", Help: "运行", Hand: func(m *ice.Message, arg ...string) {
|
||||
if m.Cmdy(mdb.ENGINE, arg); len(m.Resultv()) > 0 || m.Length() > 0 {
|
||||
return
|
||||
|
2
init.go
2
init.go
@ -118,7 +118,7 @@ func Run(arg ...string) string {
|
||||
if Pulse.Cmdy(arg); Pulse.Result() == "" {
|
||||
Pulse.Table()
|
||||
}
|
||||
Pulse.Sleep("10ms")
|
||||
Pulse.Sleep30ms()
|
||||
}
|
||||
|
||||
return Pulse.Result()
|
||||
|
4
misc.go
4
misc.go
@ -78,6 +78,10 @@ func (m *Message) Split(str string, field string, sp string, nl string) *Message
|
||||
return m
|
||||
}
|
||||
|
||||
func (m *Message) Display(plugin string) *Message {
|
||||
m.Option(MSG_DISPLAY, Display0(2, plugin)["display"])
|
||||
return m
|
||||
}
|
||||
func (m *Message) FieldsIsDetail() bool {
|
||||
if m.OptionFields() == "detail" {
|
||||
return true
|
||||
|
@ -25,7 +25,19 @@ func init() {
|
||||
),
|
||||
)},
|
||||
}, Commands: map[string]*ice.Command{
|
||||
TOTAL: {Name: "total name auto", Help: "统计量", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
TOTAL: {Name: "total name auto pie", Help: "统计量", Action: map[string]*ice.Action{
|
||||
"pie": {Name: "pie", Help: "饼图", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(TOTAL).Table(func(index int, value map[string]string, head []string) {
|
||||
if value["name"] == "total" {
|
||||
return
|
||||
}
|
||||
m.Push("name", value["name"])
|
||||
m.Push("value", value["rest"])
|
||||
})
|
||||
m.Display("/plugin/story/pie.js")
|
||||
m.StatusTimeCount("name", "total", "value", "1")
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
if len(arg) > 0 { // 提交详情
|
||||
m.Cmd(REPOS, ice.OptionFields("name,path")).Table(func(index int, value map[string]string, head []string) {
|
||||
if value[kit.MDB_NAME] == arg[0] {
|
||||
|
Loading…
x
Reference in New Issue
Block a user