diff --git a/base/ssh/ssh.go b/base/ssh/ssh.go index 74398082..6c22f947 100644 --- a/base/ssh/ssh.go +++ b/base/ssh/ssh.go @@ -59,6 +59,7 @@ func Render(msg *ice.Message, cmd string, args ...interface{}) { func (f *Frame) prompt(m *ice.Message) *Frame { if f.out == os.Stdout { + fmt.Fprintf(f.out, "\r") for _, v := range kit.Simple(m.Optionv(ice.MSG_PROMPT)) { switch v { case "count": @@ -315,6 +316,13 @@ var Index = &ice.Context{Name: "ssh", Help: "终端模块", f := m.Target().Server().(*Frame) f.exit = true }}, + "target": {Name: "target", Help: "目标", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + f := m.Target().Server().(*Frame) + m.Search(arg[0], func(p *ice.Context, s *ice.Context, key string) { + f.target = s + }) + f.prompt(m) + }}, "source": {Name: "source file", Help: "解析", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { buf := bytes.NewBuffer(make([]byte, 0, 4096)) m.Optionv(ice.MSG_STDOUT, buf) diff --git a/base/web/web.go b/base/web/web.go index 0430950d..02718878 100644 --- a/base/web/web.go +++ b/base/web/web.go @@ -775,7 +775,9 @@ var Index = &ice.Context{Name: "web", Help: "网络模块", // 空间列表 m.Richs(ice.WEB_SPACE, nil, "*", func(key string, value map[string]interface{}) { m.Push(key, value, []string{"time", "type", "name", "text"}) - m.Push("link", fmt.Sprintf(`%s`, m.Conf(ice.WEB_SHARE, "meta.domain"), value["name"], value["name"])) + if m.W != nil { + m.Push("link", fmt.Sprintf(`%s`, m.Conf(ice.WEB_SHARE, "meta.domain"), value["name"], value["name"])) + } }) m.Sort("name") return