forked from x/icebergs
fix export
This commit is contained in:
parent
68976799cc
commit
8bf81128da
@ -1210,7 +1210,12 @@ var Index = &ice.Context{Name: "web", Help: "网络模块",
|
|||||||
os.Remove(kit.Keys(name, "bak"))
|
os.Remove(kit.Keys(name, "bak"))
|
||||||
os.Rename(name, kit.Keys(name, "bak"))
|
os.Rename(name, kit.Keys(name, "bak"))
|
||||||
if msg.Append("file") != "" {
|
if msg.Append("file") != "" {
|
||||||
os.Link(msg.Append("file"), name)
|
p := path.Dir(name)
|
||||||
|
e := os.MkdirAll(p, 0777)
|
||||||
|
m.Log("what", "%v", e)
|
||||||
|
|
||||||
|
e = os.Link(msg.Append("file"), name)
|
||||||
|
m.Log("what", "%v", e)
|
||||||
m.Log(ice.LOG_EXPORT, "%s: %s", msg.Append("file"), name)
|
m.Log(ice.LOG_EXPORT, "%s: %s", msg.Append("file"), name)
|
||||||
} else {
|
} else {
|
||||||
if f, p, e := kit.Create(name); m.Assert(e) {
|
if f, p, e := kit.Create(name); m.Assert(e) {
|
||||||
@ -1637,6 +1642,15 @@ var Index = &ice.Context{Name: "web", Help: "网络模块",
|
|||||||
m.Push("_output", "void")
|
m.Push("_output", "void")
|
||||||
http.ServeFile(m.W, m.R, path.Join("usr/volcanos", file))
|
http.ServeFile(m.W, m.R, path.Join("usr/volcanos", file))
|
||||||
}},
|
}},
|
||||||
|
"/plugin/github.com/": {Name: "/space/", Help: "空间站", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
if _, e := os.Stat(path.Join("usr/volcanos", cmd)); e != nil {
|
||||||
|
m.Cmd("cli.system", "git", "clone", "https://"+strings.Join(strings.Split(cmd, "/")[2:5], "/"),
|
||||||
|
path.Join("usr/volcanos", strings.Join(strings.Split(cmd, "/")[1:5], "/")))
|
||||||
|
}
|
||||||
|
|
||||||
|
m.Push("_output", "void")
|
||||||
|
http.ServeFile(m.W, m.R, path.Join("usr/volcanos", cmd))
|
||||||
|
}},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,6 +126,10 @@ var Index = &ice.Context{Name: "team", Help: "团队中心",
|
|||||||
kit.MDB_INPUT, "text", "name", "begin_time", "action", "auto", "figure", "date",
|
kit.MDB_INPUT, "text", "name", "begin_time", "action", "auto", "figure", "date",
|
||||||
kit.MDB_INPUT, "button", "name", "查看",
|
kit.MDB_INPUT, "button", "name", "查看",
|
||||||
), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
if len(arg) == 0 {
|
||||||
|
arg = append(arg, "week")
|
||||||
|
}
|
||||||
|
|
||||||
// 起始日期
|
// 起始日期
|
||||||
first := time.Now()
|
first := time.Now()
|
||||||
if len(arg) > 1 {
|
if len(arg) > 1 {
|
||||||
|
@ -322,6 +322,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心",
|
|||||||
kit.MDB_INPUT, "text", "name", "name", "value", "what/he.svg",
|
kit.MDB_INPUT, "text", "name", "name", "value", "what/he.svg",
|
||||||
kit.MDB_INPUT, "button", "name", "执行", "action", "auto",
|
kit.MDB_INPUT, "button", "name", "执行", "action", "auto",
|
||||||
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
||||||
|
kit.MDB_INPUT, "button", "name", "上传", "cb", "upload",
|
||||||
), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if len(arg) > 0 && arg[0] == "action" {
|
if len(arg) > 0 && arg[0] == "action" {
|
||||||
switch arg[1] {
|
switch arg[1] {
|
||||||
@ -348,7 +349,18 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心",
|
|||||||
kit.MDB_INPUT, "text", "name", "name", "value", "what/hi.shy",
|
kit.MDB_INPUT, "text", "name", "name", "value", "what/hi.shy",
|
||||||
kit.MDB_INPUT, "button", "name", "执行", "action", "auto",
|
kit.MDB_INPUT, "button", "name", "执行", "action", "auto",
|
||||||
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
||||||
|
kit.MDB_INPUT, "button", "name", "上传", "cb", "upload",
|
||||||
), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
if m.Option("_action") == "上传" {
|
||||||
|
if len(arg) == 0 {
|
||||||
|
arg = append(arg, "/")
|
||||||
|
}
|
||||||
|
m.Cmdy(ice.WEB_STORY, "upload")
|
||||||
|
m.Cmd(ice.WEB_STORY, ice.STORY_WATCH, m.Append("data"),
|
||||||
|
path.Join(m.Conf(cmd, "meta.path"), arg[0], kit.Select("", m.Append("name"), strings.HasSuffix(arg[0], "/"))))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if len(arg) > 0 && arg[0] == "action" {
|
if len(arg) > 0 && arg[0] == "action" {
|
||||||
switch arg[1] {
|
switch arg[1] {
|
||||||
case "保存":
|
case "保存":
|
||||||
@ -381,7 +393,18 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心",
|
|||||||
kit.MDB_INPUT, "text", "name", "name",
|
kit.MDB_INPUT, "text", "name", "name",
|
||||||
kit.MDB_INPUT, "button", "name", "执行",
|
kit.MDB_INPUT, "button", "name", "执行",
|
||||||
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
kit.MDB_INPUT, "button", "name", "返回", "cb", "Last",
|
||||||
|
kit.MDB_INPUT, "button", "name", "上传", "cb", "upload",
|
||||||
), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
|
if m.Option("_action") == "上传" {
|
||||||
|
if len(arg) == 0 {
|
||||||
|
arg = append(arg, "/")
|
||||||
|
}
|
||||||
|
m.Cmdy(ice.WEB_STORY, "upload")
|
||||||
|
m.Cmd(ice.WEB_STORY, ice.STORY_WATCH, m.Append("data"),
|
||||||
|
path.Join(m.Conf(cmd, "meta.path"), arg[0], kit.Select("", m.Append("name"), strings.HasSuffix(arg[0], "/"))))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if len(arg) > 0 && arg[0] == "action" {
|
if len(arg) > 0 && arg[0] == "action" {
|
||||||
switch arg[1] {
|
switch arg[1] {
|
||||||
case "保存":
|
case "保存":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user