forked from x/ContextOS
mix remote
Conflicts: src/contexts/cli/cli.go src/contexts/cli/version.go src/contexts/nfs/nfs.go usr/librarys/example.js
This commit is contained in:
commit
8826185bc6
14
Makefile
14
Makefile
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
BENCH=src/extend/bench.go
|
BENCH=src/extend/bench.go
|
||||||
upgrade=usr/upgrade/
|
publish=usr/publish/
|
||||||
|
|
||||||
install:
|
install:
|
||||||
@go get github.com/nsf/termbox-go
|
@go get github.com/nsf/termbox-go
|
||||||
@ -51,17 +51,17 @@ tar_all: tar linux64 darwin win64
|
|||||||
tar zcvf tar.tgz tar
|
tar zcvf tar.tgz tar
|
||||||
|
|
||||||
linux_arm:
|
linux_arm:
|
||||||
GOARCH=arm GOOS=linux go build -o $(upgrade)bench.linux.arm $(BENCH)
|
GOARCH=arm GOOS=linux go build -o $(publish)bench.linux.arm $(BENCH)
|
||||||
linux32:
|
linux32:
|
||||||
GOARCH=386 GOOS=linux go build -o $(upgrade)bench.linux.386 $(BENCH)
|
GOARCH=386 GOOS=linux go build -o $(publish)bench.linux.386 $(BENCH)
|
||||||
linux64:
|
linux64:
|
||||||
GOARCH=amd64 GOOS=linux go build -o $(upgrade)bench.linux.amd64 $(BENCH)
|
GOARCH=amd64 GOOS=linux go build -o $(publish)bench.linux.amd64 $(BENCH)
|
||||||
darwin:
|
darwin:
|
||||||
GOARCH=amd64 GOOS=darwin go build -o $(upgrade)bench.darwin.amd64 $(BENCH)
|
GOARCH=amd64 GOOS=darwin go build -o $(publish)bench.darwin.amd64 $(BENCH)
|
||||||
win32:
|
win32:
|
||||||
GOARCH=386 GOOS=windows go build -o $(upgrade)bench.win32.exe $(BENCH)
|
GOARCH=386 GOOS=windows go build -o $(publish)bench.win32.exe $(BENCH)
|
||||||
win64:
|
win64:
|
||||||
GOARCH=amd64 GOOS=windows go build -o $(upgrade)bench.win64.exe $(BENCH)
|
GOARCH=amd64 GOOS=windows go build -o $(publish)bench.win64.exe $(BENCH)
|
||||||
|
|
||||||
|
|
||||||
DOTS=etc/dotsfile
|
DOTS=etc/dotsfile
|
||||||
|
@ -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": 3,
|
"cmd_parse": 3,
|
||||||
"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) {
|
||||||
// 管道参数
|
// 管道参数
|
||||||
@ -625,7 +625,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:]
|
||||||
@ -707,8 +709,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
|
||||||
@ -775,6 +777,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")
|
||||||
@ -870,7 +876,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")+string(os.PathListSeparator)+os.Getenv("GOPATH"),
|
"cmd_env", "GOPATH", m.Conf("runtime", "boot.ctx_home") + string(os.PathListSeparator) + os.Getenv("GOPATH"),
|
||||||
"cmd_env", "PATH", os.Getenv("PATH"),
|
"cmd_env", "PATH", os.Getenv("PATH"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,5 +4,5 @@ var version = struct {
|
|||||||
host string
|
host string
|
||||||
self int
|
self int
|
||||||
}{
|
}{
|
||||||
"2019-09-10 18:45:48", "centos", 508,
|
"2019-09-10 21:10:24", "centos", 509,
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ func (tcp *TCP) parse(m *ctx.Message, arg ...string) ([]string, []string, bool)
|
|||||||
|
|
||||||
address := []string{}
|
address := []string{}
|
||||||
if arg[1] == "dev" {
|
if arg[1] == "dev" {
|
||||||
m.Cmd("web.get", arg[1], arg[2], "temp", "ports", "format", "object").Table(func(line map[string]string) {
|
m.Cmd("web.get", arg[1], arg[2], "temp", "ports", "format", "object", "temp_expire", "10").Table(func(line map[string]string) {
|
||||||
address = append(address, line["value"])
|
address = append(address, line["value"])
|
||||||
})
|
})
|
||||||
if len(address) == 0 {
|
if len(address) == 0 {
|
||||||
|
@ -30,7 +30,8 @@ kit missyou "任务" private \
|
|||||||
kit pod "设备" private "ssh._route" _ "ssh.remote" __ \
|
kit pod "设备" private "ssh._route" _ "ssh.remote" __ \
|
||||||
text "" name pod view long \
|
text "" name pod view long \
|
||||||
button "行动" action auto \
|
button "行动" action auto \
|
||||||
exports pod pod
|
button "返回" click Back \
|
||||||
|
exports pod pod pod
|
||||||
|
|
||||||
kit ctx "模块" private "ssh._route" _ context _ list __ \
|
kit ctx "模块" private "ssh._route" _ context _ list __ \
|
||||||
text "" name pod imports plugin_pod action auto view long \
|
text "" name pod imports plugin_pod action auto view long \
|
||||||
|
@ -14,7 +14,8 @@ kit macro "脚本宏" "macro.js" public \
|
|||||||
button "运行" click "Replay" \
|
button "运行" click "Replay" \
|
||||||
exports mac name
|
exports mac name
|
||||||
|
|
||||||
kit sys "命令行" public "nfs.source" \
|
kit sys "命令行" public "ssh._route" _ "nfs.source" \
|
||||||
|
text "" name pod imports plugin_pod \
|
||||||
textarea "" view long \
|
textarea "" view long \
|
||||||
button "运行" \
|
button "运行" \
|
||||||
exports mac name
|
exports mac name
|
||||||
|
@ -699,6 +699,7 @@ function Plugin(page, pane, field, runs) {
|
|||||||
var inputs = JSON.parse(meta.inputs || "[]")
|
var inputs = JSON.parse(meta.inputs || "[]")
|
||||||
var display = JSON.parse(meta.display||'{}')
|
var display = JSON.parse(meta.display||'{}')
|
||||||
var feature = JSON.parse(meta.feature||'{}')
|
var feature = JSON.parse(meta.feature||'{}')
|
||||||
|
var display = JSON.parse(meta.display||'{}')
|
||||||
var exports = JSON.parse(meta.exports||'["",""]')
|
var exports = JSON.parse(meta.exports||'["",""]')
|
||||||
var deal = (feature && feature.display) || "table"
|
var deal = (feature && feature.display) || "table"
|
||||||
var history = []
|
var history = []
|
||||||
@ -713,7 +714,7 @@ function Plugin(page, pane, field, runs) {
|
|||||||
}: cb)
|
}: cb)
|
||||||
})
|
})
|
||||||
|
|
||||||
var count = kit.Selector(option, "args").length
|
var count = kit.Selector(option, ".args").length
|
||||||
args && count < args.length && (item.value = value||args[count++]||item.value||"");
|
args && count < args.length && (item.value = value||args[count++]||item.value||"");
|
||||||
|
|
||||||
(item.title || item.name) && (item.title = item.title || item.name)
|
(item.title || item.name) && (item.title = item.title || item.name)
|
||||||
@ -727,6 +728,7 @@ function Plugin(page, pane, field, runs) {
|
|||||||
input.type = "select", input.list = item.values.map(function(value) {
|
input.type = "select", input.list = item.values.map(function(value) {
|
||||||
return {type: "option", value: value, inner: value}
|
return {type: "option", value: value, inner: value}
|
||||||
})
|
})
|
||||||
|
input.value = item.value
|
||||||
break
|
break
|
||||||
case "textarea":
|
case "textarea":
|
||||||
input.type = "textarea", item.style = "height:100px;"+"width:"+(pane.target.clientWidth-30)+"px"
|
input.type = "textarea", item.style = "height:100px;"+"width:"+(pane.target.clientWidth-30)+"px"
|
||||||
@ -902,10 +904,7 @@ function Plugin(page, pane, field, runs) {
|
|||||||
return name == "status" || line.status == "stop" ? undefined: line.you
|
return name == "status" || line.status == "stop" ? undefined: line.you
|
||||||
},
|
},
|
||||||
pod: function(value, name, line) {
|
pod: function(value, name, line) {
|
||||||
if (option[exports[0]].value) {
|
return (option[exports[0]].value? option[exports[0]].value+".": "")+line.pod
|
||||||
return option[exports[0]].value+"."+line.pod
|
|
||||||
}
|
|
||||||
return line.pod
|
|
||||||
},
|
},
|
||||||
dir: function(value, name, line) {
|
dir: function(value, name, line) {
|
||||||
name != "path" && (value = line.path)
|
name != "path" && (value = line.path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user