forked from x/icebergs
add some
This commit is contained in:
parent
8099e5893c
commit
1cc9ad4108
@ -49,13 +49,11 @@ func _matrix_action(m *ice.Message, action string, arg ...string) {
|
|||||||
ProcessIframe(m, title, link, arg...).ProcessField(ctx.ACTION, action, ctx.RUN)
|
ProcessIframe(m, title, link, arg...).ProcessField(ctx.ACTION, action, ctx.RUN)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if kit.HasPrefixList(arg, ctx.RUN) {
|
if !kit.HasPrefixList(arg, ctx.RUN) {
|
||||||
ctx.ProcessFloat(m, action, arg, arg...)
|
|
||||||
} else {
|
|
||||||
m.Option(ice.POD, domain)
|
|
||||||
kit.If(action == XTERM, func() { arg = []string{cli.SH} })
|
kit.If(action == XTERM, func() { arg = []string{cli.SH} })
|
||||||
ctx.ProcessFloat(m, action, arg, arg...).ProcessField(ctx.ACTION, action, ctx.RUN)
|
defer m.ProcessField(ctx.ACTION, action, ctx.RUN, domain, action)
|
||||||
}
|
}
|
||||||
|
ProcessPodCmd(m, domain, action, arg, arg...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func _matrix_dream(m *ice.Message, action string, arg ...string) {
|
func _matrix_dream(m *ice.Message, action string, arg ...string) {
|
||||||
|
@ -140,7 +140,7 @@ func _space_handle(m *ice.Message, safe bool, name string, c *websocket.Conn) {
|
|||||||
m.WarnNotFound(!mdb.HashSelectDetail(m, next, func(value ice.Map) {
|
m.WarnNotFound(!mdb.HashSelectDetail(m, next, func(value ice.Map) {
|
||||||
switch c := value[mdb.TARGET].(type) {
|
switch c := value[mdb.TARGET].(type) {
|
||||||
case (*websocket.Conn): // 转发报文
|
case (*websocket.Conn): // 转发报文
|
||||||
kit.If(value[mdb.TYPE] == MASTER, func() {
|
kit.If(value[mdb.TYPE] == MASTER && msg.Option(ice.MSG_HANDLE) == ice.FALSE, func() {
|
||||||
msg.Options(ice.MSG_USERWEB, value[mdb.TEXT], ice.MSG_USERPOD, kit.Keys(target[1:]))
|
msg.Options(ice.MSG_USERWEB, value[mdb.TEXT], ice.MSG_USERPOD, kit.Keys(target[1:]))
|
||||||
})
|
})
|
||||||
_space_echo(msg, source, target, c)
|
_space_echo(msg, source, target, c)
|
||||||
@ -187,9 +187,9 @@ func _space_exec(m *ice.Message, name string, source, target []string, c *websoc
|
|||||||
kit.If(aaa.Right(m, m.Detailv()), func() { m.TryCatch(true, func(_ *ice.Message) { m = m.Cmd() }) })
|
kit.If(aaa.Right(m, m.Detailv()), func() { m.TryCatch(true, func(_ *ice.Message) { m = m.Cmd() }) })
|
||||||
kit.If(m.Optionv(ice.MSG_ARGS) != nil, func() { m.Options(ice.MSG_ARGS, kit.Simple(m.Optionv(ice.MSG_ARGS))) })
|
kit.If(m.Optionv(ice.MSG_ARGS) != nil, func() { m.Options(ice.MSG_ARGS, kit.Simple(m.Optionv(ice.MSG_ARGS))) })
|
||||||
}
|
}
|
||||||
defer m.Cost(kit.Format("%v->%v %v %v", source, target, m.Detailv(), m.FormatSize()))
|
|
||||||
_space_echo(m.Set(ice.MSG_OPTS).Options(m.OptionSimple(ice.MSG_USERWEB, ice.MSG_USERPOD, ice.LOG_DEBUG, ice.LOG_DISABLE, ice.LOG_TRACEID)), []string{}, kit.Reverse(kit.Simple(source)), c)
|
|
||||||
m.Option(ice.MSG_HANDLE, ice.TRUE)
|
m.Option(ice.MSG_HANDLE, ice.TRUE)
|
||||||
|
defer m.Cost(kit.Format("%v->%v %v %v", source, target, m.Detailv(), m.FormatSize()))
|
||||||
|
_space_echo(m.Set(ice.MSG_OPTS).Options(m.OptionSimple(ice.MSG_USERWEB, ice.MSG_USERPOD, ice.MSG_HANDLE, ice.LOG_DEBUG, ice.LOG_DISABLE, ice.LOG_TRACEID)), []string{}, kit.Reverse(kit.Simple(source)), c)
|
||||||
}
|
}
|
||||||
func _space_echo(m *ice.Message, source, target []string, c *websocket.Conn) {
|
func _space_echo(m *ice.Message, source, target []string, c *websocket.Conn) {
|
||||||
defer func() { m.WarnNotValid(recover()) }()
|
defer func() { m.WarnNotValid(recover()) }()
|
||||||
@ -215,6 +215,7 @@ func _space_send(m *ice.Message, name string, arg ...string) (h string) {
|
|||||||
m.Options(ice.MSG_USERWEB, value[mdb.TEXT], ice.MSG_USERPOD, "", ice.MSG_USERHOST, "", ice.MSG_USERWEB0, m.Option(ice.MSG_USERWEB), ice.MSG_USERPOD0, name)
|
m.Options(ice.MSG_USERWEB, value[mdb.TEXT], ice.MSG_USERPOD, "", ice.MSG_USERHOST, "", ice.MSG_USERWEB0, m.Option(ice.MSG_USERWEB), ice.MSG_USERPOD0, name)
|
||||||
})
|
})
|
||||||
kit.For([]string{ice.MSG_USERROLE, ice.LOG_TRACEID}, func(k string) { m.Optionv(k, m.Optionv(k)) })
|
kit.For([]string{ice.MSG_USERROLE, ice.LOG_TRACEID}, func(k string) { m.Optionv(k, m.Optionv(k)) })
|
||||||
|
m.Option(ice.MSG_HANDLE, ice.FALSE)
|
||||||
kit.For(m.Optionv(ice.MSG_OPTS), func(k string) {
|
kit.For(m.Optionv(ice.MSG_OPTS), func(k string) {
|
||||||
kit.If(!kit.IsIn(k, "task.id", "work.id"), func() {
|
kit.If(!kit.IsIn(k, "task.id", "work.id"), func() {
|
||||||
m.Optionv(k, m.Optionv(k))
|
m.Optionv(k, m.Optionv(k))
|
||||||
@ -404,7 +405,7 @@ func init() {
|
|||||||
if ls := kit.Simple(m.Optionv(ice.MSG_UPLOAD)); len(ls) > 1 {
|
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.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, strings.TrimPrefix(pod, "ops.")).Cmdy(append(kit.List(ice.SPACE, pod), arg...)...)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
@ -418,7 +419,7 @@ func Space(m *ice.Message, arg ice.Any) []string {
|
|||||||
}
|
}
|
||||||
func PodCmd(m *ice.Message, key string, arg ...string) bool {
|
func PodCmd(m *ice.Message, key string, arg ...string) bool {
|
||||||
if pod := m.Option(key); pod != "" {
|
if pod := m.Option(key); pod != "" {
|
||||||
m.Options(key, "", ice.MSG_USERPOD, pod).Cmdy(SPACE, pod, m.ShortKey(), arg)
|
m.Options(key, "", ice.MSG_USERPOD, strings.TrimPrefix(pod, "ops.")).Cmdy(SPACE, pod, m.ShortKey(), arg)
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
|
@ -15,14 +15,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type matrix struct {
|
type matrix struct {
|
||||||
status string `name:"status" icon:"bi bi-git"`
|
status string `name:"status" help:"源码" icon:"bi bi-git"`
|
||||||
list string `name:"list refresh" help:"矩阵"`
|
list string `name:"list refresh" help:"矩阵"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s matrix) List(m *ice.Message, arg ...string) {
|
func (s matrix) List(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(SSH_RELAY, web.DREAM).Table(func(value ice.Maps) {
|
m.Cmdy(SSH_RELAY, web.DREAM).Table(func(value ice.Maps) {
|
||||||
if value[web.SPACE] == ice.CONTEXTS {
|
if value[mdb.STATUS] == cli.STOP {
|
||||||
m.PushButton(s.Portal, s.Desktop, s.Admin, s.Open, s.Word, s.Status, s.Vimer, s.Compile, s.Runtime, s.Xterm)
|
m.PushButton()
|
||||||
|
} else if value[web.SPACE] == ice.CONTEXTS {
|
||||||
|
m.PushButton(s.Portal, s.Desktop, s.Dream, s.Admin, s.Open, s.Word, s.Status, s.Vimer, s.Compile, s.Runtime, s.Xterm)
|
||||||
} else if value[MACHINE] == tcp.LOCALHOST {
|
} else if value[MACHINE] == tcp.LOCALHOST {
|
||||||
m.PushButton(s.Portal, s.Word, s.Status, s.Vimer, s.Compile, s.Runtime, s.Xterm, s.Desktop, s.Admin, s.Open)
|
m.PushButton(s.Portal, s.Word, s.Status, s.Vimer, s.Compile, s.Runtime, s.Xterm, s.Desktop, s.Admin, s.Open)
|
||||||
} else {
|
} else {
|
||||||
@ -32,6 +34,7 @@ func (s matrix) List(m *ice.Message, arg ...string) {
|
|||||||
}
|
}
|
||||||
func (s matrix) Portal(m *ice.Message, arg ...string) { s.iframe(m, arg...) }
|
func (s matrix) Portal(m *ice.Message, arg ...string) { s.iframe(m, arg...) }
|
||||||
func (s matrix) Desktop(m *ice.Message, arg ...string) { s.plug(m, arg...) }
|
func (s matrix) Desktop(m *ice.Message, arg ...string) { s.plug(m, arg...) }
|
||||||
|
func (s matrix) Dream(m *ice.Message, arg ...string) { s.plug(m, arg...) }
|
||||||
func (s matrix) Admin(m *ice.Message, arg ...string) { s.open(m, arg...) }
|
func (s matrix) Admin(m *ice.Message, arg ...string) { s.open(m, arg...) }
|
||||||
func (s matrix) Open(m *ice.Message, arg ...string) { s.open(m, arg...) }
|
func (s matrix) Open(m *ice.Message, arg ...string) { s.open(m, arg...) }
|
||||||
func (s matrix) Word(m *ice.Message, arg ...string) { s.plug(m, arg...) }
|
func (s matrix) Word(m *ice.Message, arg ...string) { s.plug(m, arg...) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user