diff --git a/base/web/web.go b/base/web/web.go index 2cc48a65..cbf0606e 100644 --- a/base/web/web.go +++ b/base/web/web.go @@ -1210,7 +1210,12 @@ var Index = &ice.Context{Name: "web", Help: "网络模块", os.Remove(kit.Keys(name, "bak")) os.Rename(name, kit.Keys(name, "bak")) 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) } else { 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") 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)) + }}, }, } diff --git a/core/team/team.go b/core/team/team.go index 8ade92e1..457f95b0 100644 --- a/core/team/team.go +++ b/core/team/team.go @@ -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, "button", "name", "查看", ), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { + if len(arg) == 0 { + arg = append(arg, "week") + } + // 起始日期 first := time.Now() if len(arg) > 1 { diff --git a/core/wiki/wiki.go b/core/wiki/wiki.go index 50b3a2b1..15762f28 100644 --- a/core/wiki/wiki.go +++ b/core/wiki/wiki.go @@ -322,6 +322,7 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心", kit.MDB_INPUT, "text", "name", "name", "value", "what/he.svg", kit.MDB_INPUT, "button", "name", "执行", "action", "auto", 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) { if len(arg) > 0 && arg[0] == "action" { 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, "button", "name", "执行", "action", "auto", 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) { + 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" { switch arg[1] { case "保存": @@ -381,7 +393,18 @@ var Index = &ice.Context{Name: "wiki", Help: "文档中心", kit.MDB_INPUT, "text", "name", "name", kit.MDB_INPUT, "button", "name", "执行", 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) { + 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" { switch arg[1] { case "保存":