1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-01-27 18:14:48 +08:00
parent 0eeb02aa8c
commit 56bfde1aa5
2 changed files with 2 additions and 1 deletions

View File

@ -266,6 +266,7 @@ func init() {
}},
"stash": {Help: "清空", Icon: "bi bi-trash", Hand: func(m *ice.Message, arg ...string) {
m.Cmd(SYSTEM, "git", "stash")
m.Cmd(SYSTEM, "git", "checkout", ".")
m.Go(func() { m.Sleep30ms(ice.QUIT, 1) })
}},
"logs": {Help: "日志", Hand: func(m *ice.Message, arg ...string) {

View File

@ -156,7 +156,7 @@ func GoToast(m *ice.Message, title string, cb func(toast func(name string, count
icon := Icons[ice.PROCESS]
toast := func(name string, count, total int) {
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)
_total = total
}