1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 09:34:05 +08:00
This commit is contained in:
shaoying 2020-07-04 13:09:34 +08:00
parent 4cbce8e4c1
commit a67c1b4307
3 changed files with 6 additions and 3 deletions

View File

@ -271,6 +271,9 @@ func (f *Frame) Start(m *ice.Message, arg ...string) bool {
r, f.stdout = os.Stdin, os.Stdout r, f.stdout = os.Stdin, os.Stdout
m.Cap(ice.CTX_STREAM, STDIO) m.Cap(ice.CTX_STREAM, STDIO)
f.target = m.Target() f.target = m.Target()
m.Option("_option", ice.MSG_USERNAME)
m.Option(ice.MSG_USERNAME, cli.UserName)
m.Option(ice.MSG_USERROLE, aaa.ROOT)
aaa.UserRoot(m) aaa.UserRoot(m)
default: default:
if s, e := os.Open(arg[0]); !m.Warn(e != nil, "%s", e) { if s, e := os.Open(arg[0]); !m.Warn(e != nil, "%s", e) {

View File

@ -196,4 +196,4 @@ export %s
}, },
} }
func init() { web.Index.Register(Index, &web.Frame{}, COMPILE, BENCH, PPROF) } func init() { web.Index.Register(Index, &web.Frame{}, COMPILE, UPGRADE, BENCH, PPROF) }

View File

@ -102,7 +102,7 @@ var Index = &ice.Context{Name: DOCKER, Help: "虚拟机",
} }
// 镜像列表 // 镜像列表
m.Split(strings.Replace(m.Cmdx(_image, "ls"), "IMAGE ID", _IMAGE_ID, 1), "index", " ", "\n") m.Split(strings.Replace(m.Cmdx(_docker, "images"), "IMAGE ID", _IMAGE_ID, 1), "index", " ", "\n")
m.Sort(_REPOSITORY) m.Sort(_REPOSITORY)
// 镜像操作 // 镜像操作
@ -146,7 +146,7 @@ var Index = &ice.Context{Name: DOCKER, Help: "虚拟机",
} }
// 容器列表 // 容器列表
m.Split(strings.Replace(m.Cmdx(_container, "ls", "-a"), "CONTAINER ID", _CONTAINER_ID, 1), "index", " ", "\n") m.Split(strings.Replace(m.Cmdx(_docker, "ps", "-a"), "CONTAINER ID", _CONTAINER_ID, 1), "index", " ", "\n")
m.Sort("NAMES") m.Sort("NAMES")
m.Table(func(index int, value map[string]string, head []string) { m.Table(func(index int, value map[string]string, head []string) {
if strings.TrimSpace(value["PORTS"]) == "" { if strings.TrimSpace(value["PORTS"]) == "" {