1
0
forked from x/ContextOS
This commit is contained in:
shaoying 2018-11-07 22:04:08 +08:00
parent 32d272ee42
commit 2ff1d9fa4c
4 changed files with 11 additions and 10 deletions

View File

@ -2945,6 +2945,7 @@ var Index = &Context{Name: "ctx", Help: "模块中心",
}
list = append(list, v)
}
list = append(list, args...)
msg := cmd.Sess("cli").Cmd("source", strings.Join(list, " "))
cmd.Copy(msg, "append").Copy(msg, "result").Copy(msg, "target")
@ -3190,7 +3191,7 @@ var Index = &Context{Name: "ctx", Help: "模块中心",
}
}},
"select": &Command{Name: "select key value field",
Form: map[string]int{"parse": 2, "order": 2, "limit": 1, "offset": 1, "fields": 1, "format": 2, "vertical": 0},
Form: map[string]int{"parse": 2, "order": 2, "limit": 1, "offset": 1, "fields": 1, "format": 2, "trans_map": 3, "vertical": 0},
Help: "选取数据", Hand: func(m *Message, c *Context, key string, arg ...string) {
msg := m.Spawn()

View File

@ -192,7 +192,7 @@ var Index = &ctx.Context{Name: "mdb", Help: "数据中心",
"show": &ctx.Command{Name: "show table fields...",
Help: "查询数据库, table: 表名, fields: 字段, where: 查询条件, group: 聚合字段, order: 排序字段",
Form: map[string]int{"where": 1, "group": 1, "order": 1, "limit": 1, "offset": 1, "other": -1,
"extra_field": 1, "extra_fields": 1, "extra_chains": 1, "extra_format": 1, "trans_field": 1, "trans_map": 2},
"extra_field": 2, "extra_fields": 1, "extra_format": 1, "trans_field": 1, "trans_map": 2},
Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
if _, ok := m.Target().Server.(*MDB); m.Assert(ok) {
table := m.Confx("table", arg, 0)
@ -237,8 +237,8 @@ var Index = &ctx.Context{Name: "mdb", Help: "数据中心",
}
for i := 0; i < len(m.Meta[m.Option("extra_field")]); i++ {
json.Unmarshal([]byte(m.Meta[m.Option("extra_field")][i]), &m.Target().Configs["template_value"].Value)
if m.Options("extra_chains") {
m.Target().Configs["template_value"].Value = m.Confv("template_value", m.Option("extra_chains"))
if m.Meta["extra_field"][1] != "" {
m.Target().Configs["template_value"].Value = m.Confv("template_value", m.Meta["extra_field"][1])
}
fields = strings.Split(m.Option("extra_fields"), " ")
switch v := m.Confv("template_value").(type) {

View File

@ -5,7 +5,7 @@ function action(event, cmd) {
nav.hidden = !nav.hidden
var article = document.querySelector("article")
if (!context.isMobile) {
article.style.width = nav.hidden? "80%": "calc(100% - 250px)"
article.style.width = nav.hidden? "80%": "calc(100% - 400px)"
}
break
case "toggle_list":
@ -143,12 +143,12 @@ window.onload = function() {
init_link()
init_code()
var article = document.querySelector("article")
var mav = document.querySelector("nav")
alert(context.isMobile)
var nav = document.querySelector("nav")
if (context.isMobile) {
article.style.width = "100%"
} else {
article.style.maxHeight = "calc(100% - 80px)"
mav.style.maxHeight = "calc(100% - 80px)"
nav.style.maxHeight = "calc(100% - 80px)"
}
article.style.width = nav.hidden? "80%": "calc(100% - 400px)"
}

View File

@ -55,8 +55,8 @@ nav {
}
article {
float:left;
width:calc(100% - 250px);
min-width:600px;
width:calc(100% - 400px);
min-width:400px;
overflow:auto;
}