mirror of
https://shylinux.com/x/ContextOS
synced 2025-04-25 08:48:06 +08:00
opt some
This commit is contained in:
parent
991dd98267
commit
66c702b91b
@ -537,6 +537,10 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
|
||||
}
|
||||
return
|
||||
}},
|
||||
"proc": &ctx.Command{Name: "proc", Help: "", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
||||
m.Cmdy("cli.system", "ps", kit.Select("ax", arg, 0))
|
||||
return
|
||||
}},
|
||||
|
||||
"project": &ctx.Command{Name: "project", Help: "", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) {
|
||||
switch arg[0] {
|
||||
@ -663,6 +667,11 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
|
||||
m.Cmd("cli.publish")
|
||||
return
|
||||
}
|
||||
if len(arg) > 1 && arg[0] == "script" {
|
||||
m.Cmdy("web.get", "dev", fmt.Sprintf("publish/%s", arg[1]),
|
||||
"upgrade", arg[0], "save", path.Join("usr/script", arg[1]))
|
||||
return
|
||||
}
|
||||
|
||||
restart := false
|
||||
for _, link := range kit.View([]string{arg[0]}, m.Confm("upgrade")) {
|
||||
|
@ -100,7 +100,7 @@ var Index = &Context{Name: "ctx", Help: "模块中心", Server: &CTX{},
|
||||
"page_limit": &Config{Name: "page_limit", Value: "10", Help: "列表大小"},
|
||||
|
||||
"time_format": &Config{Name: "time_format", Value: "2006-01-02 15:04:05", Help: "时间格式"},
|
||||
"call_timeout": &Config{Name: "call_timeout", Value: "10s", Help: "回调超时"},
|
||||
"call_timeout": &Config{Name: "call_timeout", Value: "100s", Help: "回调超时"},
|
||||
},
|
||||
Commands: map[string]*Command{
|
||||
"_init": &Command{Name: "_init", Help: "启动", Hand: func(m *Message, c *Context, key string, arg ...string) (e error) {
|
||||
|
@ -123,6 +123,12 @@ var Index = &ctx.Context{Name: "mdb", Help: "数据中心",
|
||||
switch val := res.(type) {
|
||||
case redis.Error:
|
||||
m.Echo("%v", val)
|
||||
case []interface{}:
|
||||
for i, v := range val {
|
||||
m.Add("append", "index", i)
|
||||
m.Add("append", "value", v)
|
||||
}
|
||||
m.Table()
|
||||
default:
|
||||
m.Echo("%v", kit.Format(res))
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
|
||||
map[string]interface{}{"componet_name": "status", "componet_help": "status",
|
||||
"componet_tmpl": "componet", "componet_view": "Company", "componet_init": "",
|
||||
"componet_type": "private", "componet_ctx": "ssh", "componet_cmd": "_route",
|
||||
"componet_args": []interface{}{"$$", "gg"}, "inputs": []interface{}{
|
||||
"componet_args": []interface{}{"$$", "context", "cli", "system", "gg"}, "inputs": []interface{}{
|
||||
map[string]interface{}{"type": "text", "name": "pod", "imports": "plugin_pod"},
|
||||
map[string]interface{}{"type": "select", "name": "sub", "values": []interface{}{"status", ""}},
|
||||
map[string]interface{}{"type": "button", "value": "执行"},
|
||||
@ -58,7 +58,7 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
|
||||
map[string]interface{}{"componet_name": "deploy", "componet_help": "deploy",
|
||||
"componet_tmpl": "componet", "componet_view": "Company", "componet_init": "",
|
||||
"componet_type": "private", "componet_ctx": "ssh", "componet_cmd": "_route",
|
||||
"componet_args": []interface{}{"$$", "gg"}, "inputs": []interface{}{
|
||||
"componet_args": []interface{}{"$$", "context", "cli", "system", "gg"}, "inputs": []interface{}{
|
||||
map[string]interface{}{"type": "text", "name": "pod", "imports": "plugin_pod"},
|
||||
map[string]interface{}{"type": "select", "name": "sub", "values": []interface{}{"deploygo", "deploy"}},
|
||||
map[string]interface{}{"type": "text", "name": "sub", "imports": "plugin_dir"},
|
||||
@ -66,6 +66,15 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
|
||||
map[string]interface{}{"type": "button", "value": "执行"},
|
||||
},
|
||||
},
|
||||
map[string]interface{}{"componet_name": "proc", "componet_help": "proc",
|
||||
"componet_tmpl": "componet", "componet_view": "Company", "componet_init": "",
|
||||
"componet_type": "private", "componet_ctx": "ssh", "componet_cmd": "_route",
|
||||
"componet_args": []interface{}{"$$", "context", "cli", "proc"}, "inputs": []interface{}{
|
||||
map[string]interface{}{"type": "text", "name": "pod", "value": "", "imports": "plugin_pod"},
|
||||
map[string]interface{}{"type": "text", "name": "cmd", "view": "long"},
|
||||
map[string]interface{}{"type": "button", "value": "执行"},
|
||||
},
|
||||
},
|
||||
map[string]interface{}{"componet_name": "test", "componet_help": "test",
|
||||
"componet_tmpl": "componet", "componet_view": "Compile", "componet_init": "",
|
||||
"componet_type": "private", "componet_ctx": "ssh", "componet_cmd": "_route",
|
||||
@ -80,18 +89,27 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
|
||||
map[string]interface{}{"componet_name": "php", "componet_help": "php",
|
||||
"componet_tmpl": "componet", "componet_view": "Company", "componet_init": "",
|
||||
"componet_type": "private", "componet_ctx": "ssh", "componet_cmd": "_route",
|
||||
"componet_args": []interface{}{"$$", "php", "cmd_parse", "format"}, "inputs": []interface{}{
|
||||
"componet_args": []interface{}{"$$", "context", "cli", "system", "php", "cmd_parse", "format"}, "inputs": []interface{}{
|
||||
map[string]interface{}{"type": "text", "name": "pod", "imports": "plugin_pod"},
|
||||
map[string]interface{}{"type": "text", "name": "cmd", "value": "usr/script/test.php", "view": "long"},
|
||||
map[string]interface{}{"type": "button", "value": "执行"},
|
||||
},
|
||||
},
|
||||
map[string]interface{}{"componet_name": "grep", "componet_help": "grep",
|
||||
"componet_tmpl": "componet", "componet_view": "Company", "componet_init": "",
|
||||
"componet_type": "private", "componet_ctx": "ssh", "componet_cmd": "_route",
|
||||
"componet_args": []interface{}{"$$", "context", "nfs", "grep"}, "inputs": []interface{}{
|
||||
map[string]interface{}{"type": "text", "name": "pod", "value": "", "imports": "plugin_pod"},
|
||||
map[string]interface{}{"type": "text", "name": "cmd", "view": "long"},
|
||||
map[string]interface{}{"type": "button", "value": "执行"},
|
||||
},
|
||||
},
|
||||
map[string]interface{}{"componet_name": "redis", "componet_help": "redis",
|
||||
"componet_tmpl": "componet", "componet_view": "Company", "componet_init": "",
|
||||
"componet_type": "private", "componet_ctx": "ssh", "componet_cmd": "_route",
|
||||
"componet_args": []interface{}{"$$", "context", "mdb", "redis"}, "inputs": []interface{}{
|
||||
map[string]interface{}{"type": "text", "name": "pod", "value": "redis"},
|
||||
map[string]interface{}{"type": "select", "name": "cmd", "values": []interface{}{"get", "del"}},
|
||||
map[string]interface{}{"type": "select", "name": "cmd", "values": []interface{}{"get", "del", "hgetall"}},
|
||||
map[string]interface{}{"type": "text", "name": "cmd", "value": "test", "view": "long"},
|
||||
map[string]interface{}{"type": "button", "value": "执行"},
|
||||
},
|
||||
@ -201,7 +219,7 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
|
||||
"componet_tmpl": "componet", "componet_view": "Context", "componet_init": "",
|
||||
"componet_type": "private", "componet_ctx": "ssh", "componet_cmd": "_route",
|
||||
"componet_args": []interface{}{"$$", "context", "ssh", "remote"}, "inputs": []interface{}{
|
||||
map[string]interface{}{"type": "text", "name": "pod", "imports": "plugin_pod"},
|
||||
map[string]interface{}{"type": "text", "name": "pod"},
|
||||
map[string]interface{}{"type": "button", "value": "执行"},
|
||||
},
|
||||
"exports": []interface{}{"pod", "key", "pod"},
|
||||
@ -256,11 +274,11 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心",
|
||||
"componet_type": "private", "componet_ctx": "ssh", "componet_cmd": "_route",
|
||||
"componet_args": []interface{}{"$$", "git"}, "inputs": []interface{}{
|
||||
map[string]interface{}{"type": "text", "name": "pod", "imports": "plugin_pod"},
|
||||
map[string]interface{}{"type": "text", "name": "dir", "imports": "plugin_dir"},
|
||||
map[string]interface{}{"type": "text", "name": "dir", "imports": "plugin_dir", "view": "long"},
|
||||
map[string]interface{}{"type": "select", "name": "cmd", "values": []interface{}{
|
||||
"commit", "add", "checkout",
|
||||
}},
|
||||
map[string]interface{}{"type": "text", "name": "commit"},
|
||||
map[string]interface{}{"type": "text", "name": "commit", "view": "long"},
|
||||
map[string]interface{}{"type": "button", "value": "执行"},
|
||||
},
|
||||
},
|
||||
|
@ -1135,6 +1135,9 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
||||
if p == "" {
|
||||
p = m.Cmdx("nfs.path", m.Conf("publish", []string{"list", key}))
|
||||
}
|
||||
if s, e:= os.Stat(p); e != nil || s.IsDir() {
|
||||
return
|
||||
}
|
||||
|
||||
m.Log("info", "publish %s %s", kit.Hashs(p), p)
|
||||
http.ServeFile(m.Optionv("response").(http.ResponseWriter), m.Optionv("request").(*http.Request), p)
|
||||
|
1061
usr/librarys/chat.js
1061
usr/librarys/chat.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user