forked from x/icebergs
add some
This commit is contained in:
parent
0eeb02aa8c
commit
56bfde1aa5
@ -266,6 +266,7 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
"stash": {Help: "清空", Icon: "bi bi-trash", Hand: func(m *ice.Message, arg ...string) {
|
"stash": {Help: "清空", Icon: "bi bi-trash", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmd(SYSTEM, "git", "stash")
|
m.Cmd(SYSTEM, "git", "stash")
|
||||||
|
m.Cmd(SYSTEM, "git", "checkout", ".")
|
||||||
m.Go(func() { m.Sleep30ms(ice.QUIT, 1) })
|
m.Go(func() { m.Sleep30ms(ice.QUIT, 1) })
|
||||||
}},
|
}},
|
||||||
"logs": {Help: "日志", Hand: func(m *ice.Message, arg ...string) {
|
"logs": {Help: "日志", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
@ -156,7 +156,7 @@ func GoToast(m *ice.Message, title string, cb func(toast func(name string, count
|
|||||||
icon := Icons[ice.PROCESS]
|
icon := Icons[ice.PROCESS]
|
||||||
toast := func(name string, count, total int) {
|
toast := func(name string, count, total int) {
|
||||||
kit.If(total == 0, func() { total = 1 })
|
kit.If(total == 0, func() { total = 1 })
|
||||||
Toast(m, kit.Format("%s %s %s/%s", icon, kit.JoinWord(kit.Select(kit.Select("", m.ActionKey(), m.ActionKey() != ice.LIST), title, m.Option(ice.MSG_TITLE)), name), strings.TrimSuffix(kit.FmtSize(int64(count)), "B"), strings.TrimSuffix(kit.FmtSize(int64(total)), "B")),
|
Toast(m, kit.Format("%s %s %s", icon, kit.JoinWord(kit.Select(kit.Select("", m.ActionKey(), m.ActionKey() != ice.LIST), title, m.Option(ice.MSG_TITLE)), name), strings.ReplaceAll(kit.FmtSize(count, total), "B", "")),
|
||||||
"", m.OptionDefault(ice.TOAST_DURATION, "30s"), count*100/total)
|
"", m.OptionDefault(ice.TOAST_DURATION, "30s"), count*100/total)
|
||||||
_total = total
|
_total = total
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user