forked from x/icebergs
add some
This commit is contained in:
parent
74358ff30d
commit
3fee88f2bf
@ -224,7 +224,7 @@ func _space_echo(m *ice.Message, source, target []string, c *websocket.Conn) {
|
||||
func _space_send(m *ice.Message, name string, arg ...string) (h string) {
|
||||
withecho := m.Option(ice.SPACE_NOECHO) != ice.TRUE
|
||||
kit.If(len(arg) > 0 && arg[0] == TOAST, func() { withecho = false; m.Option(ice.MSG_DEBUG, ice.FALSE) })
|
||||
wait, done := m.Wait(kit.Select("", m.OptionDefault(ice.SPACE_TIMEOUT, "180s"), withecho), func(msg *ice.Message, arg ...string) {
|
||||
wait, done := m.Wait(kit.Select("", m.OptionDefault(ice.SPACE_TIMEOUT, "30s"), withecho), func(msg *ice.Message, arg ...string) {
|
||||
m.Cost(kit.Format("%v->[%v] %v %v", m.Optionv(ice.MSG_SOURCE), name, m.Detailv(), msg.FormatSize())).Copy(msg)
|
||||
})
|
||||
if withecho {
|
||||
|
@ -26,11 +26,11 @@ Volcanos(chat.ONACTION, {
|
||||
}, function(list) { can.Status(cli.STEP, list.length), can.Status(cli.COST, can.base.Duration(new Date().getTime()-begin)), can.user.toastSuccess(can) }) },
|
||||
preview: function(event, can, msg, next, data, tr) {
|
||||
can.onappend.plugin(can, {space: msg.Option(web.SPACE), index: msg.Option(ctx.INDEX), style: msg.Option(ctx.STYLE)}, function(sub) { var done = false
|
||||
function action(skip) { sub.Update(sub.request({}, {_handle: ice.TRUE}), [ctx.ACTION, msg.Option(cli.PLAY)], function(msg) {
|
||||
function action(skip) { sub.Update(sub.request({}, {"space.timeout": "300s",_handle: ice.TRUE}), [ctx.ACTION, msg.Option(cli.PLAY)], function(msg) {
|
||||
sub.onimport._process(sub, msg) || msg.Length() == 0 && msg.Result() == "" || can.onappend._output(sub, msg), next && next(data)
|
||||
}) }
|
||||
if (msg.Option(ctx.STYLE) == "async") {
|
||||
done = true, sub.Update(sub.request({}, {_handle: ice.TRUE}), [ctx.ACTION, msg.Option(cli.PLAY)]), next && next(data)
|
||||
done = true, sub.Update(sub.request({}, {"space.timeout": "300s", _handle: ice.TRUE}), [ctx.ACTION, msg.Option(cli.PLAY)]), next && next(data)
|
||||
} else {
|
||||
can.onmotion.delay(can, function() { if (done || sub._auto) { return } done = true, action() }, 300)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user