forked from x/icebergs
opt data.js
This commit is contained in:
parent
6da7784838
commit
f306d7a4cb
@ -141,31 +141,28 @@ func init() {
|
|||||||
m.ProcessRefresh30ms()
|
m.ProcessRefresh30ms()
|
||||||
}},
|
}},
|
||||||
}, Hand: func(m *ice.Message, arg ...string) {
|
}, Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if start := 0; len(arg) == 0 {
|
||||||
_dream_list(m)
|
_dream_list(m).SetAppend(mdb.TEXT)
|
||||||
m.SetAppend("text")
|
|
||||||
m.Table(func(index int, value map[string]string, head []string) {
|
m.Table(func(index int, value map[string]string, head []string) {
|
||||||
if value["status"] == "start" {
|
if value[cli.STATUS] != cli.START {
|
||||||
ls := kit.Split(m.Cmdx(SPACE, value["name"], cli.SYSTEM, "git", "diff", "--shortstat"), ",", ",")
|
m.Push(mdb.TEXT, "")
|
||||||
text := []string{}
|
return
|
||||||
for _, line := range ls {
|
|
||||||
list := kit.Split(line)
|
|
||||||
if strings.Contains(line, "file") {
|
|
||||||
text = append(text, list[0]+" file")
|
|
||||||
} else if strings.Contains(line, "ins") {
|
|
||||||
text = append(text, list[0]+" +++")
|
|
||||||
} else if strings.Contains(line, "dele") {
|
|
||||||
text = append(text, list[0]+" ---")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m.Push("text", strings.Join(text, ", "))
|
|
||||||
} else {
|
|
||||||
m.Push("text", "")
|
|
||||||
}
|
}
|
||||||
})
|
start++
|
||||||
m.Sort("status,type,name")
|
text := []string{}
|
||||||
if !strings.Contains(m.Option(ice.MSG_USERUA), "Mobile") {
|
for _, line := range kit.Split(m.Cmdx(SPACE, value[mdb.NAME], cli.SYSTEM, "git", "diff", "--shortstat"), ice.FS, ice.FS) {
|
||||||
m.Display("/plugin/table.js", "style", "card")
|
if list := kit.Split(line); strings.Contains(line, "file") {
|
||||||
|
text = append(text, list[0]+" file")
|
||||||
|
} else if strings.Contains(line, "ins") {
|
||||||
|
text = append(text, list[0]+" +++")
|
||||||
|
} else if strings.Contains(line, "dele") {
|
||||||
|
text = append(text, list[0]+" ---")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.Push(mdb.TEXT, strings.Join(text, ", "))
|
||||||
|
}).Sort("status,type,name").StatusTimeCount(cli.START, start)
|
||||||
|
if !m.IsMobileUA() {
|
||||||
|
m.Display("/plugin/table.js?style=card")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ func init() {
|
|||||||
}, Hand: func(m *ice.Message, arg ...string) {
|
}, Hand: func(m *ice.Message, arg ...string) {
|
||||||
if !_wiki_list(m, m.CommandKey(), kit.Select(nfs.PWD, arg, 0)) {
|
if !_wiki_list(m, m.CommandKey(), kit.Select(nfs.PWD, arg, 0)) {
|
||||||
m.CSV(m.Cmd(nfs.CAT, arg[0]).Result())
|
m.CSV(m.Cmd(nfs.CAT, arg[0]).Result())
|
||||||
|
m.StatusTimeCount()
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
|
@ -114,6 +114,9 @@ func (m *Message) RenderCmd(index string, args ...Any) {
|
|||||||
m.RenderResult()
|
m.RenderResult()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Message) IsMobileUA() bool {
|
||||||
|
return strings.Contains(m.Option(MSG_USERUA), "Mobile")
|
||||||
|
}
|
||||||
func (m *Message) IsCliUA() bool {
|
func (m *Message) IsCliUA() bool {
|
||||||
if m.Option(MSG_USERUA) == "" || !strings.HasPrefix(m.Option(MSG_USERUA), "Mozilla/5.0") {
|
if m.Option(MSG_USERUA) == "" || !strings.HasPrefix(m.Option(MSG_USERUA), "Mozilla/5.0") {
|
||||||
return true
|
return true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user