forked from x/ContextOS
tce add run.sh
This commit is contained in:
parent
4fe19b1818
commit
ed98ff1795
3
Makefile
3
Makefile
@ -20,6 +20,9 @@ install_all: install
|
|||||||
build:
|
build:
|
||||||
go build $(BENCH)
|
go build $(BENCH)
|
||||||
|
|
||||||
|
run:
|
||||||
|
etc/run.sh
|
||||||
|
|
||||||
win64:
|
win64:
|
||||||
GOARCH=amd64 GOOS=windows go build $(BENCH)
|
GOARCH=amd64 GOOS=windows go build $(BENCH)
|
||||||
mv bench.exe bench_1.0_win64.exe
|
mv bench.exe bench_1.0_win64.exe
|
||||||
|
8
etc/run.sh
Executable file
8
etc/run.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
bench && break
|
||||||
|
echo "bench run error"
|
||||||
|
echo "restarting..."
|
||||||
|
sleep 3
|
||||||
|
done
|
@ -813,6 +813,15 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
|
|||||||
"tmux": &ctx.Command{Name: "tmux", Help: "", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
"tmux": &ctx.Command{Name: "tmux", Help: "", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
||||||
m.Copy(m.Spawn().Cmd("system", "tmux", arg), "result")
|
m.Copy(m.Spawn().Cmd("system", "tmux", arg), "result")
|
||||||
}},
|
}},
|
||||||
|
"exit": &ctx.Command{Name: "exit code", Help: "exit", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
||||||
|
code := 0
|
||||||
|
if len(arg) > 0 {
|
||||||
|
i, e := strconv.Atoi(arg[0])
|
||||||
|
m.Assert(e)
|
||||||
|
code = i
|
||||||
|
}
|
||||||
|
os.Exit(code)
|
||||||
|
}},
|
||||||
"buffer": &ctx.Command{Name: "buffer", Help: "", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
"buffer": &ctx.Command{Name: "buffer", Help: "", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
||||||
bufs := strings.Split(m.Spawn().Cmd("system", "tmux", "list-buffers").Result(0), "\n")
|
bufs := strings.Split(m.Spawn().Cmd("system", "tmux", "list-buffers").Result(0), "\n")
|
||||||
|
|
||||||
@ -829,10 +838,10 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
|
|||||||
if len(bs) > 1 {
|
if len(bs) > 1 {
|
||||||
m.Add("append", "buffer", bs[0][:len(bs[0])])
|
m.Add("append", "buffer", bs[0][:len(bs[0])])
|
||||||
m.Add("append", "length", bs[1][:len(bs[1])-6])
|
m.Add("append", "length", bs[1][:len(bs[1])-6])
|
||||||
m.Add("append", "string", bs[2][1:len(bs[2])-1])
|
m.Add("append", "strings", bs[2][1:len(bs[2])-1])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m.Echo(m.Append("string"))
|
m.Echo(m.Append("strings"))
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
Index: map[string]*ctx.Context{
|
Index: map[string]*ctx.Context{
|
||||||
|
@ -256,6 +256,8 @@ var Index = &ctx.Context{Name: "mdb", Help: "数据中心",
|
|||||||
m.Meta[m.Option("extra_field")][i] = ""
|
m.Meta[m.Option("extra_field")][i] = ""
|
||||||
case float64:
|
case float64:
|
||||||
m.Meta[m.Option("extra_field")][i] = fmt.Sprintf(format, int(v))
|
m.Meta[m.Option("extra_field")][i] = fmt.Sprintf(format, int(v))
|
||||||
|
case nil:
|
||||||
|
m.Meta[m.Option("extra_field")][i] = ""
|
||||||
default:
|
default:
|
||||||
m.Meta[m.Option("extra_field")][i] = fmt.Sprintf(format, v)
|
m.Meta[m.Option("extra_field")][i] = fmt.Sprintf(format, v)
|
||||||
}
|
}
|
||||||
@ -295,15 +297,17 @@ var Index = &ctx.Context{Name: "mdb", Help: "数据中心",
|
|||||||
"set": &ctx.Command{Name: "set table [field value] where condition", Help: "查看或选择数据库信息", Form: map[string]int{"where": 1}, Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
"set": &ctx.Command{Name: "set table [field value] where condition", Help: "查看或选择数据库信息", Form: map[string]int{"where": 1}, Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
||||||
if mdb, ok := m.Target().Server.(*MDB); m.Assert(ok) && mdb.DB != nil {
|
if mdb, ok := m.Target().Server.(*MDB); m.Assert(ok) && mdb.DB != nil {
|
||||||
sql := []string{"update", arg[0], "set"}
|
sql := []string{"update", arg[0], "set"}
|
||||||
|
fields := []string{}
|
||||||
for i := 1; i < len(arg)-1; i += 2 {
|
for i := 1; i < len(arg)-1; i += 2 {
|
||||||
sql = append(sql, fmt.Sprintf("%s='%s'", arg[i], arg[i+1]))
|
sql = append(sql, fmt.Sprintf("%s='%s'", arg[i], arg[i+1]))
|
||||||
|
fields = append(fields, arg[i])
|
||||||
if i < len(arg)-2 {
|
if i < len(arg)-2 {
|
||||||
sql = append(sql, ",")
|
sql = append(sql, ",")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sql = append(sql, fmt.Sprintf("where %s", m.Option("where")))
|
sql = append(sql, fmt.Sprintf("where %s", m.Option("where")))
|
||||||
m.Spawn().Cmd("exec", strings.Join(sql, " "))
|
m.Spawn().Cmd("exec", strings.Join(sql, " "))
|
||||||
msg := m.Spawn().Cmd("show", arg[0], "where", m.Option("where"))
|
msg := m.Spawn().Cmd("show", arg[0], fields, "where", m.Option("where"))
|
||||||
m.Copy(msg, "result").Copy(msg, "append")
|
m.Copy(msg, "result").Copy(msg, "append")
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
@ -238,6 +238,7 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
"nroute": &ctx.Cache{Name: "nroute", Value: "0", Help: "路由数量"},
|
"nroute": &ctx.Cache{Name: "nroute", Value: "0", Help: "路由数量"},
|
||||||
},
|
},
|
||||||
Configs: map[string]*ctx.Config{
|
Configs: map[string]*ctx.Config{
|
||||||
|
"login_right": &ctx.Config{Name: "login_right", Value: "1", Help: "缓存大小"},
|
||||||
"multipart_bsize": &ctx.Config{Name: "multipart_bsize", Value: "102400", Help: "缓存大小"},
|
"multipart_bsize": &ctx.Config{Name: "multipart_bsize", Value: "102400", Help: "缓存大小"},
|
||||||
"body_response": &ctx.Config{Name: "body_response", Value: "response", Help: "响应缓存"},
|
"body_response": &ctx.Config{Name: "body_response", Value: "response", Help: "响应缓存"},
|
||||||
"method": &ctx.Config{Name: "method", Value: "GET", Help: "请求方法"},
|
"method": &ctx.Config{Name: "method", Value: "GET", Help: "请求方法"},
|
||||||
@ -309,8 +310,8 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
"label": "limit", "value": "3",
|
"label": "limit", "value": "3",
|
||||||
},
|
},
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"type": "button", "name": "string",
|
"type": "button", "name": "refresh",
|
||||||
"label": "string", "value": "refresh",
|
"label": "refresh", "value": "refresh",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -844,6 +845,9 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
group := m.Option("componet_group")
|
group := m.Option("componet_group")
|
||||||
order := m.Option("componet_order")
|
order := m.Option("componet_order")
|
||||||
right := group == "login"
|
right := group == "login"
|
||||||
|
if !right {
|
||||||
|
right = !m.Confs("login_right")
|
||||||
|
}
|
||||||
login := m
|
login := m
|
||||||
login = nil
|
login = nil
|
||||||
|
|
||||||
|
@ -68,14 +68,9 @@ function onaction(event, action) {
|
|||||||
case "click":
|
case "click":
|
||||||
if (event.target.nodeName == "INPUT") {
|
if (event.target.nodeName == "INPUT") {
|
||||||
if (event.altKey) {
|
if (event.altKey) {
|
||||||
event.target.focus()
|
|
||||||
event.target.select()
|
|
||||||
console.log("fuck")
|
console.log("fuck")
|
||||||
console.log(document.execCommand("paste"))
|
var board = document.querySelector("#clipboard")
|
||||||
// var clipboard = document.querySelector("#clipboard")
|
event.target.value = board.value
|
||||||
// clipboard.value = text
|
|
||||||
// clipboard.select()
|
|
||||||
// document.execCommand("copy")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
@ -179,7 +174,7 @@ function init_download(event) {
|
|||||||
|
|
||||||
option["dir"].value = option["dir"].value+"/"+event.target.innerText
|
option["dir"].value = option["dir"].value+"/"+event.target.innerText
|
||||||
send_command(option, function(msg) {
|
send_command(option, function(msg) {
|
||||||
option["dir"].value = msg.dir.join("")
|
context.Cookie("download_dir", option["dir"].value = msg.dir.join(""))
|
||||||
})
|
})
|
||||||
} else if (event.target.tagName == "TD") {
|
} else if (event.target.tagName == "TD") {
|
||||||
copy_to_clipboard(event.target.innerText)
|
copy_to_clipboard(event.target.innerText)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user