forked from x/icebergs
opt island
This commit is contained in:
parent
a12a4836b9
commit
ef97bf61ca
@ -128,6 +128,9 @@ func Toast(m *ice.Message, text string, arg ...ice.Any) *ice.Message { // [title
|
||||
var Icons = map[string]string{ice.PROCESS: "🕑", ice.FAILURE: "❌", ice.SUCCESS: "✅"}
|
||||
|
||||
func toastContent(m *ice.Message, state string, arg ...ice.Any) string {
|
||||
if len(arg) > 0 {
|
||||
return kit.JoinWord(kit.Simple(Icons[state], arg)...)
|
||||
}
|
||||
return kit.JoinWord(kit.Simple(Icons[state], m.ActionKey(), state, arg)...)
|
||||
}
|
||||
func ToastSuccess(m *ice.Message, arg ...ice.Any) {
|
||||
@ -137,7 +140,7 @@ func ToastFailure(m *ice.Message, arg ...ice.Any) {
|
||||
Toast(m, toastContent(m, ice.FAILURE, arg...), "", m.OptionDefault(ice.TOAST_DURATION, "3s")).Sleep(m.OptionDefault(ice.TOAST_DURATION, "3s"))
|
||||
}
|
||||
func ToastProcess(m *ice.Message, arg ...ice.Any) func() {
|
||||
Toast(m, toastContent(m, ice.PROCESS, arg...), "", "30s")
|
||||
Toast(m, toastContent(m, ice.PROCESS, arg...), "", "180s")
|
||||
return func() { Toast(m, toastContent(m, ice.SUCCESS, arg...), "", "1s") }
|
||||
}
|
||||
func GoToast(m *ice.Message, title string, cb func(toast func(name string, count, total int)) []string) *ice.Message {
|
||||
|
@ -119,6 +119,7 @@ func _space_fork(m *ice.Message) {
|
||||
m.Cmd(SPACE, value[mdb.NAME], gdb.EVENT, gdb.HAPPEN, gdb.EVENT, OPS_SERVER_OPEN, args, kit.Dict(ice.MSG_USERROLE, aaa.TECH))
|
||||
}
|
||||
})
|
||||
m.Cmd(gdb.EVENT, gdb.HAPPEN, gdb.EVENT, OPS_SERVER_OPEN, args)
|
||||
})
|
||||
}
|
||||
_space_handle(m, false, name, c)
|
||||
|
Loading…
x
Reference in New Issue
Block a user