1
0
forked from x/ContextOS
This commit is contained in:
shaoying 2019-08-25 13:31:12 +08:00
parent 8cac01d75f
commit b39fc0a342
5 changed files with 14 additions and 7 deletions

View File

@ -1088,7 +1088,7 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
"cmd_env", "ctx_box", fmt.Sprintf("http://127.0.0.1%s", m.Conf("runtime", "boot.web_port")), "cmd_env", "ctx_box", fmt.Sprintf("http://127.0.0.1%s", m.Conf("runtime", "boot.web_port")),
"cmd_daemon", "true", "cmd_daemon", "true",
} }
if m.Assert(os.MkdirAll(p, 0666)); m.Conf("runtime", "host.GOOS") == "windows" { if m.Assert(os.MkdirAll(p, 0777)); m.Conf("runtime", "host.GOOS") == "windows" {
m.Cmdy("cli.system", path.Join(m.Conf("runtime", "boot.ctx_home"), "bin/node.sh"), "start", args) m.Cmdy("cli.system", path.Join(m.Conf("runtime", "boot.ctx_home"), "bin/node.sh"), "start", args)
} else { } else {
m.Cmdy("cli.system", m.Conf("runtime", "boot.ctx_bin"), args) m.Cmdy("cli.system", m.Conf("runtime", "boot.ctx_bin"), args)

View File

@ -4,5 +4,5 @@ var version = struct {
host string host string
self int self int
}{ }{
"2019-08-23 14:51:01", "ZYB-20190522USI", 443, "2019-08-24 17:10:37", "ZYB-20190522USI.centos", 402,
} }

View File

@ -34,9 +34,10 @@ func (c *Context) Register(s *Context, x Server, args ...interface{}) *Context {
} }
func (c *Context) Plugin(s *Context, args []string) string { func (c *Context) Plugin(s *Context, args []string) string {
c.Register(s, nil) c.Register(s, nil)
m := &Message{code: 0, time: time.Now(), source: s, target: s, Meta: map[string][]string{}} m := Pulse.Spawn(s)
kit.DisableLog = true // m := &Message{code: 0, time: time.Now(), source: s, target: s, Meta: map[string][]string{}}
m.Option("log.disable", true) // kit.DisableLog = true
// m.Option("log.disable", true)
m.Option("bio.modal", "action") m.Option("bio.modal", "action")
if len(args) == 0 { if len(args) == 0 {

View File

@ -118,6 +118,9 @@ func (m *Message) Target() *Context {
} }
func (m *Message) Insert(meta string, index int, arg ...interface{}) string { func (m *Message) Insert(meta string, index int, arg ...interface{}) string {
if m == nil {
return ""
}
if m.Meta == nil { if m.Meta == nil {
m.Meta = make(map[string][]string) m.Meta = make(map[string][]string)
} }
@ -498,8 +501,9 @@ func (m *Message) Cmd(args ...interface{}) *Message {
} else if strings.Contains(key, ".") { } else if strings.Contains(key, ".") {
arg := strings.Split(key, ".") arg := strings.Split(key, ".")
msg, key = msg.Sess(arg[0]), arg[1] if msg, key = msg.Sess(arg[0]), arg[1]; msg != nil {
msg.Option("remote_code", "") msg.Option("remote_code", "")
}
} }
if msg == nil { if msg == nil {
return msg return msg

View File

@ -435,6 +435,8 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
if m.Confs("runtime", "boot.ctx_ups") { if m.Confs("runtime", "boot.ctx_ups") {
m.Cmd("ssh.remote", "dial", m.Conf("runtime", "boot.ctx_ups")) m.Cmd("ssh.remote", "dial", m.Conf("runtime", "boot.ctx_ups"))
m.Cmd("ssh.remote", "listen", m.Conf("runtime", "boot.ssh_port"))
m.Cmd("web.serve", "usr", m.Conf("runtime", "boot.web_port"))
} else if m.Cmd("ssh.remote", "dial", "dev", "/shadow"); !m.Confs("runtime", "boot.ctx_box") { } else if m.Cmd("ssh.remote", "dial", "dev", "/shadow"); !m.Confs("runtime", "boot.ctx_box") {
m.Cmd("ssh.remote", "listen", m.Conf("runtime", "boot.ssh_port")) m.Cmd("ssh.remote", "listen", m.Conf("runtime", "boot.ssh_port"))