1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-02-24 00:32:05 +08:00
parent ae57fc0271
commit a7ca869a16
3 changed files with 20 additions and 6 deletions

View File

@ -195,12 +195,12 @@ 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("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("space.timeout", "600s"), withecho), func(msg *ice.Message, arg ...string) {
wait, done := m.Wait(kit.Select("", m.OptionDefault("space.timeout", "180s"), 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 {
h = mdb.HashCreate(m.Spawn(), mdb.TYPE, tcp.SEND, mdb.NAME, kit.Keys(name, m.Target().ID()), mdb.TEXT, kit.Join(arg, lex.SP), kit.Dict(mdb.TARGET, done))
defer mdb.HashRemove(m.Spawn(), mdb.HASH, h)
h = mdb.HashCreate(m.SpawnSilent(), mdb.TYPE, tcp.SEND, mdb.NAME, kit.Keys(name, m.Target().ID()), mdb.TEXT, kit.Join(arg, lex.SP), kit.Dict(mdb.TARGET, done))
defer mdb.HashRemove(m.SpawnSilent(), mdb.HASH, h)
}
if target := kit.Split(name, nfs.PT, nfs.PT); !mdb.HashSelectDetail(m, target[0], func(value ice.Map) {
if c, ok := value[mdb.TARGET].(*websocket.Conn); !m.WarnNotValid(!ok, mdb.TARGET) {
@ -396,7 +396,7 @@ func init() {
if ls := kit.Simple(m.Optionv(ice.MSG_UPLOAD)); len(ls) > 1 {
m.Cmd(SPACE, pod, SPIDE, ice.DEV, CACHE, SHARE_CACHE+ls[0])
}
m.Options(ice.POD, []string{}, ice.MSG_USERPOD, pod).Cmdy(append(kit.List(ice.SPACE, pod), arg...)...)
m.Options(ice.POD, []string{}, ice.MSG_USERPOD, pod, ice.MSG_DEBUG, ice.FALSE).Cmdy(append(kit.List(ice.SPACE, pod), arg...)...)
return true
}
return false

View File

@ -184,3 +184,7 @@ func (m *Message) Trans(en string, zh string) string {
func (m *Message) IsEnglish() bool {
return kit.IsIn(strings.ToLower(m.Option(MSG_LANGUAGE)), "en", "en-us")
}
func (m *Message) SpawnSilent(arg ...Any) *Message {
return m.Spawn(Maps{LOG_DISABLE: TRUE})
}

View File

@ -324,7 +324,12 @@ func (s relay) Upgrade(m *ice.Message, arg ...string) {
return
}
ssh.PushShell(msg.Message, strings.Split(msg.Template(UPGRADE_SH), lex.NL), func(res string) {
web.PushNoticeGrow(m.Options(ice.MSG_COUNT, "0", ctx.DISPLAY, web.PLUGIN_XTERM).Message, res)
web.PushNoticeGrow(m.Options(
ctx.DISPLAY, web.PLUGIN_XTERM,
ice.MSG_COUNT, "0",
ice.MSG_DEBUG, ice.FALSE,
ice.LOG_DISABLE, ice.TRUE,
).Message, res)
})
})
} else {
@ -338,7 +343,12 @@ func (s relay) Version(m *ice.Message, arg ...string) {
return
}
ssh.PushShell(msg.Message, strings.Split(msg.Template(VERSION_SH), lex.NL), func(res string) {
web.PushNoticeGrow(m.Options(ctx.DISPLAY, web.PLUGIN_XTERM).Message, res)
web.PushNoticeGrow(m.Options(
ctx.DISPLAY, web.PLUGIN_XTERM,
ice.MSG_COUNT, "0",
ice.MSG_DEBUG, ice.FALSE,
ice.LOG_DISABLE, ice.TRUE,
).Message, res)
})
})
}