1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-26 01:04:06 +08:00

fix code lost

This commit is contained in:
shaoying 2019-09-08 08:57:02 +08:00
parent f39b7a723b
commit 412631a028

View File

@ -121,10 +121,10 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
}, Help: "源码编译"}, }, Help: "源码编译"},
"publish": &ctx.Config{Name: "publish", Value: map[string]interface{}{ "publish": &ctx.Config{Name: "publish", Value: map[string]interface{}{
"path": "usr/publish", "list": map[string]interface{}{ "path": "usr/publish", "list": map[string]interface{}{
"boot_sh": "bin/boot.sh", "boot_sh": "bin/boot.sh",
"zone_sh": "bin/zone.sh", "zone_sh": "bin/zone.sh",
"user_sh": "bin/user.sh", "user_sh": "bin/user.sh",
"node_sh": "bin/node.sh", "node_sh": "bin/node.sh",
"init_shy": "etc/init.shy", "init_shy": "etc/init.shy",
"common_shy": "etc/common.shy", "common_shy": "etc/common.shy",
@ -145,10 +145,10 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
"list": map[string]interface{}{ "list": map[string]interface{}{
"bench": "bin/bench.new", "bench": "bin/bench.new",
"boot_sh": "bin/boot.sh", "boot_sh": "bin/boot.sh",
"zone_sh": "bin/zone.sh", "zone_sh": "bin/zone.sh",
"user_sh": "bin/user.sh", "user_sh": "bin/user.sh",
"node_sh": "bin/node.sh", "node_sh": "bin/node.sh",
"init_shy": "etc/init.shy", "init_shy": "etc/init.shy",
"common_shy": "etc/common.shy", "common_shy": "etc/common.shy",
@ -248,7 +248,7 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
"cmd_temp": -1, "cmd_temp": -1,
"cmd_parse": 2, "cmd_parse": 2,
"cmd_error": 0, "cmd_error": 0,
"cmd_select": -1, "cmd_select": -1,
"app_log": 1, "app_log": 1,
}, Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) { }, Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
// 管道参数 // 管道参数
@ -624,7 +624,9 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
format := kit.Select(m.Conf("time", "format"), m.Option("time_format")) format := kit.Select(m.Conf("time", "format"), m.Option("time_format"))
t, stamp := time.Now(), true t, stamp := time.Now(), true
if len(arg) > 0 { if len(arg) > 0 {
if i, e := strconv.ParseInt(arg[0], 10, 64); e == nil { if arg[0] == "show" {
stamp = false
} else if i, e := strconv.ParseInt(arg[0], 10, 64); e == nil {
t, stamp, arg = time.Unix(int64(i/int64(m.Confi("time", "unit"))), 0), false, arg[1:] t, stamp, arg = time.Unix(int64(i/int64(m.Confi("time", "unit"))), 0), false, arg[1:]
} else if n, e := time.ParseInLocation(format, arg[0], time.Local); e == nil { } else if n, e := time.ParseInLocation(format, arg[0], time.Local); e == nil {
t, arg = n, arg[1:] t, arg = n, arg[1:]
@ -706,8 +708,8 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
return return
}}, }},
"proc": &ctx.Command{Name: "proc", Help: "进程管理", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) { "proc": &ctx.Command{Name: "proc", Help: "进程管理", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
m.Cmdy("cli.system", "cmd_parse", "cut", "ps", kit.Select("ax", arg, 0)) m.Cmdy("cli.system", "ps", kit.Select("ax", arg, 0), "cmd_parse", "cut")
if len(arg) > 0 { if len(arg) > 1 {
m.Cmd("select", "reg", "COMMAND", arg[1]) m.Cmd("select", "reg", "COMMAND", arg[1])
} }
return return
@ -774,6 +776,10 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
}) })
m.Cmdp(0, []string{"go build"}, []string{"cli.system", "go", "get"}, list) m.Cmdp(0, []string{"go build"}, []string{"cli.system", "go", "get"}, list)
case "stats":
// 代码统计
m.Cmdy("nfs.dir", kit.Select("src", arg, 1), "dir_deep", "dir_type", "file", "dir_sort", "line", "int_r", "dir_select", "group", "")
case "stat": case "stat":
// 代码统计 // 代码统计
m.Cmdy("nfs.dir", "src", "dir_deep", "dir_type", "file", "dir_sort", "line", "int_r") m.Cmdy("nfs.dir", "src", "dir_deep", "dir_type", "file", "dir_sort", "line", "int_r")
@ -869,7 +875,7 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
env := []string{ env := []string{
"cmd_env", "GOOS", goos, "cmd_env", "GOARCH", arch, "cmd_env", "GOOS", goos, "cmd_env", "GOARCH", arch,
"cmd_env", "GOTMPDIR", tmp, "cmd_env", "GOCACHE", tmp, "cmd_env", "GOTMPDIR", tmp, "cmd_env", "GOCACHE", tmp,
"cmd_env", "GOPATH", m.Conf("runtime", "boot.ctx_home")+":"+os.Getenv("GOPATH"), "cmd_env", "GOPATH", m.Conf("runtime", "boot.ctx_home") + ":" + os.Getenv("GOPATH"),
"cmd_env", "PATH", os.Getenv("PATH"), "cmd_env", "PATH", os.Getenv("PATH"),
} }