mirror of
https://shylinux.com/x/ContextOS
synced 2025-04-28 09:52:01 +08:00
mac opt ctx.right
This commit is contained in:
parent
fadba3ea48
commit
39bb3e0583
@ -1,4 +1,4 @@
|
|||||||
return
|
login root root
|
||||||
|
|
||||||
source etc/local.shy
|
source etc/local.shy
|
||||||
|
|
||||||
|
@ -214,6 +214,7 @@ var Index = &ctx.Context{Name: "aaa", Help: "认证中心",
|
|||||||
if int64(msg.Capi("expire")) > time.Now().Unix() {
|
if int64(msg.Capi("expire")) > time.Now().Unix() {
|
||||||
m.Echo(msg.Cap("username"))
|
m.Echo(msg.Cap("username"))
|
||||||
m.Copy(msg, "target")
|
m.Copy(msg, "target")
|
||||||
|
m.Sess("aaa", msg)
|
||||||
} else {
|
} else {
|
||||||
delete(aaa.sessions, arg[0])
|
delete(aaa.sessions, arg[0])
|
||||||
msg.Target().Close(msg)
|
msg.Target().Close(msg)
|
||||||
|
@ -211,12 +211,15 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
|
|||||||
Name: "source filename [async [cli_name [cli_help]]",
|
Name: "source filename [async [cli_name [cli_help]]",
|
||||||
Help: "解析脚本, filename: 文件名, async: 异步执行, cli_name: 模块名, cli_help: 模块帮助",
|
Help: "解析脚本, filename: 文件名, async: 异步执行, cli_name: 模块名, cli_help: 模块帮助",
|
||||||
Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
||||||
if _, ok := m.Target().Server.(*CLI); m.Assert(ok) { // {{{
|
if _, ok := m.Source().Server.(*CLI); ok {
|
||||||
m.Start(m.Confx("cli_name", arg, 2), m.Confx("cli_help", arg, 3), key, arg[0])
|
msg := m.Spawn(c)
|
||||||
if len(arg) < 2 || arg[1] != "async" {
|
m.Copy(msg, "target")
|
||||||
m.Wait()
|
}
|
||||||
}
|
|
||||||
} // }}}
|
m.Start(m.Confx("cli_name", arg, 2), m.Confx("cli_help", arg, 3), key, arg[0])
|
||||||
|
if len(arg) < 2 || arg[1] != "async" {
|
||||||
|
m.Wait()
|
||||||
|
}
|
||||||
}},
|
}},
|
||||||
"label": &ctx.Command{Name: "label name", Help: "记录当前脚本的位置, name: 位置名", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
"label": &ctx.Command{Name: "label name", Help: "记录当前脚本的位置, name: 位置名", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
||||||
if cli, ok := m.Target().Server.(*CLI); m.Assert(ok) { // {{{
|
if cli, ok := m.Target().Server.(*CLI); m.Assert(ok) { // {{{
|
||||||
@ -766,6 +769,9 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心",
|
|||||||
m.Log("fuck", strings.Repeat("\n", 20))
|
m.Log("fuck", strings.Repeat("\n", 20))
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
|
Index: map[string]*ctx.Context{
|
||||||
|
"void": &ctx.Context{Caches: map[string]*ctx.Cache{"nshell": &ctx.Cache{}}},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -2673,279 +2673,188 @@ var Index = &Context{Name: "ctx", Help: "模块中心",
|
|||||||
"right": &Command{
|
"right": &Command{
|
||||||
Name: "right [share|add|del group [cache|config|command item]]",
|
Name: "right [share|add|del group [cache|config|command item]]",
|
||||||
Help: "用户组管理,查看、添加、删除用户组或是接口",
|
Help: "用户组管理,查看、添加、删除用户组或是接口",
|
||||||
Form: map[string]int{"check": 0, "add": 0, "del": 0, "brow": 0, "cache": 0, "config": 0, "command": 0},
|
|
||||||
Hand: func(m *Message, c *Context, key string, arg ...string) {
|
Hand: func(m *Message, c *Context, key string, arg ...string) {
|
||||||
index := m.target.Index
|
index := m.target.Index // {{{
|
||||||
if index == nil {
|
if index == nil {
|
||||||
m.target.Index = map[string]*Context{}
|
index = map[string]*Context{}
|
||||||
index = m.target.Index
|
m.target.Index = index
|
||||||
}
|
}
|
||||||
|
|
||||||
current := m.target
|
owner := m.target
|
||||||
aaa := m.Sess("aaa", false)
|
aaa := m.Sess("aaa", false)
|
||||||
if aaa.Cap("username") != aaa.Conf("rootname") {
|
if aaa.Cap("username") != aaa.Conf("rootname") {
|
||||||
current = index[aaa.Cap("username")]
|
owner = index[aaa.Cap("username")]
|
||||||
|
m.Assert(owner != nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
share := owner
|
||||||
|
if len(arg) > 0 {
|
||||||
|
if owner.Index == nil {
|
||||||
|
owner.Index = map[string]*Context{}
|
||||||
|
}
|
||||||
|
if s, ok := owner.Index[arg[0]]; ok {
|
||||||
|
share = s
|
||||||
|
} else {
|
||||||
|
share = &Context{Name: arg[0], context: owner}
|
||||||
|
if _, ok = index[arg[0]]; m.Assert(!ok) {
|
||||||
|
owner.Index[arg[0]] = share
|
||||||
|
index[arg[0]] = share
|
||||||
|
}
|
||||||
|
}
|
||||||
|
arg = arg[1:]
|
||||||
}
|
}
|
||||||
m.Echo("username:%s\n", aaa.Cap("username"))
|
|
||||||
|
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
if current != nil {
|
for k, x := range share.Caches {
|
||||||
for k, x := range current.Caches {
|
m.Add("append", "ccc", "cache")
|
||||||
m.Add("append", "ccc", "cache")
|
m.Add("append", "key", k)
|
||||||
m.Add("append", "key", k)
|
m.Add("append", "name", x.Name)
|
||||||
m.Add("append", "name", x.Name)
|
m.Add("append", "arg", "")
|
||||||
}
|
m.Add("append", "value", "")
|
||||||
for k, x := range current.Configs {
|
|
||||||
m.Add("append", "ccc", "config")
|
|
||||||
m.Add("append", "key", k)
|
|
||||||
m.Add("append", "name", x.Name)
|
|
||||||
}
|
|
||||||
for k, x := range current.Commands {
|
|
||||||
m.Add("append", "ccc", "command")
|
|
||||||
m.Add("append", "key", k)
|
|
||||||
m.Add("append", "name", x.Name)
|
|
||||||
}
|
|
||||||
for k, x := range current.Index {
|
|
||||||
m.Add("append", "ccc", "context")
|
|
||||||
m.Add("append", "key", k)
|
|
||||||
m.Add("append", "name", x.Name)
|
|
||||||
}
|
|
||||||
m.Table()
|
|
||||||
}
|
}
|
||||||
|
for k, x := range share.Configs {
|
||||||
|
m.Add("append", "ccc", "config")
|
||||||
|
m.Add("append", "key", k)
|
||||||
|
m.Add("append", "name", x.Name)
|
||||||
|
m.Add("append", "arg", "")
|
||||||
|
m.Add("append", "value", "")
|
||||||
|
}
|
||||||
|
for k, x := range share.Commands {
|
||||||
|
m.Add("append", "ccc", "command")
|
||||||
|
m.Add("append", "key", k)
|
||||||
|
m.Add("append", "name", x.Name)
|
||||||
|
|
||||||
|
m.Add("append", "arg", "")
|
||||||
|
m.Add("append", "value", "")
|
||||||
|
for a, val := range x.Shares {
|
||||||
|
for _, v := range val {
|
||||||
|
m.Add("append", "ccc", "command")
|
||||||
|
m.Add("append", "key", k)
|
||||||
|
m.Add("append", "name", x.Name)
|
||||||
|
|
||||||
|
m.Add("append", "arg", a)
|
||||||
|
m.Add("append", "value", v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for k, x := range share.Index {
|
||||||
|
m.Add("append", "ccc", "context")
|
||||||
|
m.Add("append", "key", k)
|
||||||
|
m.Add("append", "name", x.Name)
|
||||||
|
m.Add("append", "arg", x.context.Name)
|
||||||
|
m.Add("append", "value", "")
|
||||||
|
}
|
||||||
|
m.Table()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
void := index["void"]
|
|
||||||
|
|
||||||
switch arg[0] {
|
switch arg[0] {
|
||||||
case "show":
|
case "check":
|
||||||
case "add":
|
if len(arg) == 1 {
|
||||||
case "del":
|
m.Echo("ok")
|
||||||
}
|
break
|
||||||
return
|
|
||||||
// {{{
|
|
||||||
|
|
||||||
if aaa != nil && aaa.Cap("username") != aaa.Conf("rootname") {
|
|
||||||
if current = index[aaa.Cap("username")]; current == nil {
|
|
||||||
if void != nil {
|
|
||||||
m.Echo("%s:caches\n", void.Name)
|
|
||||||
for k, c := range void.Caches {
|
|
||||||
m.Echo(" %s: %s\n", k, c.Value)
|
|
||||||
}
|
|
||||||
m.Echo("%s:configs\n", void.Name)
|
|
||||||
for k, c := range void.Configs {
|
|
||||||
m.Echo(" %s: %s\n", k, c.Value)
|
|
||||||
}
|
|
||||||
m.Echo("%s:commands\n", void.Name)
|
|
||||||
for k, c := range void.Commands {
|
|
||||||
m.Echo(" %s: %s\n", k, c.Name)
|
|
||||||
}
|
|
||||||
m.Echo("%s:contexts\n", void.Name)
|
|
||||||
for k, c := range void.Index {
|
|
||||||
m.Echo(" %s: %s\n", k, c.Name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
switch arg[1] {
|
||||||
|
case "cache":
|
||||||
group := current
|
if _, ok := share.Caches[arg[2]]; ok {
|
||||||
if len(arg) > 0 {
|
m.Echo("ok")
|
||||||
group = current.Index[arg[0]]
|
return
|
||||||
}
|
}
|
||||||
|
case "config":
|
||||||
item := ""
|
if _, ok := share.Configs[arg[2]]; ok {
|
||||||
if len(arg) > 1 {
|
m.Echo("ok")
|
||||||
item = arg[1]
|
return
|
||||||
}
|
}
|
||||||
|
case "command":
|
||||||
switch {
|
if x, ok := share.Commands[arg[2]]; ok {
|
||||||
case m.Has("check"):
|
if len(arg) == 3 {
|
||||||
if group != nil {
|
|
||||||
switch {
|
|
||||||
case m.Has("cache"):
|
|
||||||
if _, ok := group.Caches[item]; ok {
|
|
||||||
m.Echo("ok")
|
m.Echo("ok")
|
||||||
return
|
break
|
||||||
}
|
}
|
||||||
case m.Has("config"):
|
for i := 3; i < len(arg)-1; i += 2 {
|
||||||
if _, ok := group.Configs[item]; ok {
|
if len(x.Shares[arg[i]]) > 0 {
|
||||||
m.Echo("ok")
|
match := false
|
||||||
return
|
for _, v := range x.Shares[arg[i]] {
|
||||||
}
|
ma, e := regexp.MatchString(v, arg[i+1])
|
||||||
case m.Has("command"):
|
m.Assert(e)
|
||||||
|
if ma {
|
||||||
if len(arg) > 1 {
|
match = ma
|
||||||
if _, ok := group.Commands[item]; !ok {
|
break
|
||||||
m.Echo("no")
|
}
|
||||||
return
|
}
|
||||||
}
|
if !match {
|
||||||
}
|
m.Echo("no")
|
||||||
if len(arg) > 2 {
|
|
||||||
if _, ok := group.Commands[item].Shares[arg[2]]; !ok {
|
|
||||||
m.Echo("no")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(arg) > 3 {
|
|
||||||
for _, v := range group.Commands[item].Shares[arg[2]] {
|
|
||||||
match, e := regexp.MatchString(v, arg[3])
|
|
||||||
m.Assert(e)
|
|
||||||
if match {
|
|
||||||
m.Echo("ok")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m.Echo("no")
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
m.Echo("ok")
|
m.Echo("ok")
|
||||||
return
|
|
||||||
default:
|
|
||||||
m.Echo("ok")
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m.Echo("no")
|
case "add":
|
||||||
return
|
switch arg[1] {
|
||||||
case m.Has("add"):
|
case "cache":
|
||||||
if group == nil {
|
if x, ok := owner.Caches[arg[2]]; ok {
|
||||||
if _, ok := index[arg[0]]; ok {
|
if share.Caches == nil {
|
||||||
break
|
share.Caches = map[string]*Cache{}
|
||||||
|
}
|
||||||
|
share.Caches[arg[2]] = x
|
||||||
|
m.Log("info", "%s.cache(%s)->%s", owner.Name, arg[2], share.Name)
|
||||||
}
|
}
|
||||||
group = &Context{Name: arg[0]}
|
case "config":
|
||||||
}
|
if x, ok := owner.Configs[arg[2]]; ok {
|
||||||
|
if share.Configs == nil {
|
||||||
switch {
|
share.Configs = map[string]*Config{}
|
||||||
case m.Has("cache"):
|
|
||||||
if x, ok := current.Caches[item]; ok {
|
|
||||||
if group.Caches == nil {
|
|
||||||
group.Caches = map[string]*Cache{}
|
|
||||||
}
|
}
|
||||||
group.Caches[item] = x
|
share.Configs[arg[2]] = x
|
||||||
}
|
}
|
||||||
case m.Has("config"):
|
m.Log("info", "%s.config(%s)->%s", owner.Name, arg[2], share.Name)
|
||||||
if x, ok := current.Configs[item]; ok {
|
case "command":
|
||||||
if group.Configs == nil {
|
if _, ok := owner.Commands[arg[2]]; ok {
|
||||||
group.Configs = map[string]*Config{}
|
if share.Commands == nil {
|
||||||
|
share.Commands = map[string]*Command{}
|
||||||
}
|
}
|
||||||
group.Configs[item] = x
|
if _, ok := share.Commands[arg[2]]; !ok {
|
||||||
}
|
share.Commands[arg[2]] = &Command{Shares: map[string][]string{}}
|
||||||
case m.Has("command"):
|
|
||||||
if _, ok := current.Commands[item]; ok {
|
|
||||||
if group.Commands == nil {
|
|
||||||
group.Commands = map[string]*Command{}
|
|
||||||
}
|
}
|
||||||
|
m.Log("info", "%s.command(%s)->%s", owner.Name, arg[2], share.Name)
|
||||||
command, ok := group.Commands[item]
|
for i := 3; i < len(arg)-1; i += 2 {
|
||||||
if !ok {
|
m.Log("info", "%s.command(%s, %s, %s)->%s", owner.Name, arg[2], arg[i], arg[i+1], share.Name)
|
||||||
command = &Command{Shares: map[string][]string{}}
|
share.Commands[arg[2]].Shares[arg[i]] = append(share.Commands[arg[2]].Shares[arg[i]], arg[i+1])
|
||||||
group.Commands[item] = command
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 2; i < len(arg)-1; i += 2 {
|
|
||||||
command.Shares[arg[i]] = append(command.Shares[arg[i]], arg[i+1])
|
|
||||||
}
|
|
||||||
|
|
||||||
// group.Commands[item] = x
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case "del":
|
||||||
if current.Index == nil {
|
switch arg[1] {
|
||||||
current.Index = map[string]*Context{}
|
case "cache":
|
||||||
}
|
cs := []*Context{share}
|
||||||
current.Index[arg[0]] = group
|
for i := 0; i < len(cs); i++ {
|
||||||
index[arg[0]] = group
|
for _, x := range cs[i].Index {
|
||||||
|
cs = append(cs, x)
|
||||||
case m.Has("del"):
|
}
|
||||||
if group == nil {
|
delete(cs[i].Caches, arg[2])
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
gs := []*Context{group}
|
|
||||||
for i := 0; i < len(gs); i++ {
|
|
||||||
for _, g := range gs[i].Index {
|
|
||||||
gs = append(gs, g)
|
|
||||||
}
|
}
|
||||||
|
case "config":
|
||||||
switch {
|
cs := []*Context{share}
|
||||||
case m.Has("cache"):
|
for i := 0; i < len(cs); i++ {
|
||||||
delete(gs[i].Caches, item)
|
for _, x := range cs[i].Index {
|
||||||
case m.Has("config"):
|
cs = append(cs, x)
|
||||||
delete(gs[i].Configs, item)
|
|
||||||
case m.Has("command"):
|
|
||||||
if gs[i].Commands == nil {
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
if len(arg) == 2 {
|
delete(cs[i].Configs, arg[2])
|
||||||
delete(gs[i].Commands, item)
|
}
|
||||||
break
|
case "command":
|
||||||
}
|
cs := []*Context{share}
|
||||||
|
for i := 0; i < len(cs); i++ {
|
||||||
if gs[i].Commands[item] == nil {
|
for _, x := range cs[i].Index {
|
||||||
break
|
cs = append(cs, x)
|
||||||
}
|
|
||||||
shares := gs[i].Commands[item].Shares
|
|
||||||
if shares == nil {
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
if len(arg) == 3 {
|
if len(arg) == 3 {
|
||||||
delete(shares, arg[2])
|
delete(cs[i].Commands, arg[2])
|
||||||
break
|
} else if len(arg) == 4 {
|
||||||
|
delete(cs[i].Commands[arg[2]].Shares, arg[3])
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for i := 0; i < len(shares[arg[2]]); i++ {
|
|
||||||
if shares[arg[2]][i] == arg[3] {
|
|
||||||
for ; i < len(shares[arg[2]])-1; i++ {
|
|
||||||
shares[arg[2]][i] = shares[arg[2]][i+1]
|
|
||||||
}
|
|
||||||
shares[arg[2]] = shares[arg[2]][:i]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gs[i].Commands[item].Shares = shares
|
|
||||||
|
|
||||||
default:
|
|
||||||
delete(index, gs[i].Name)
|
|
||||||
delete(current.Index, gs[i].Name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
m.Echo("%s:caches\n", group.Name)
|
|
||||||
if void != nil {
|
|
||||||
for k, c := range void.Caches {
|
|
||||||
m.Echo(" %s: %s\n", k, c.Value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for k, c := range group.Caches {
|
|
||||||
m.Echo(" %s: %s\n", k, c.Value)
|
|
||||||
}
|
|
||||||
m.Echo("%s:configs\n", group.Name)
|
|
||||||
if void != nil {
|
|
||||||
for k, c := range void.Configs {
|
|
||||||
m.Echo(" %s: %s\n", k, c.Value)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for k, c := range group.Configs {
|
|
||||||
m.Echo(" %s: %s\n", k, c.Value)
|
|
||||||
}
|
|
||||||
m.Echo("%s:commands\n", group.Name)
|
|
||||||
if void != nil {
|
|
||||||
for k, c := range void.Commands {
|
|
||||||
m.Echo(" %s: %s\n", k, c.Name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for k, c := range group.Commands {
|
|
||||||
m.Echo(" %s: %s %v\n", k, c.Name, c.Shares)
|
|
||||||
}
|
|
||||||
m.Echo("%s:contexts\n", group.Name)
|
|
||||||
if void != nil {
|
|
||||||
for k, c := range void.Index {
|
|
||||||
m.Echo(" %s: %s\n", k, c.Name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for k, c := range group.Index {
|
|
||||||
m.Echo(" %s: %s\n", k, c.Name)
|
|
||||||
}
|
}
|
||||||
} // }}}
|
} // }}}
|
||||||
}},
|
}},
|
||||||
|
@ -643,42 +643,46 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
if !m.Options("dir") {
|
if !m.Options("dir") {
|
||||||
m.Option("dir", m.Cap("directory"))
|
m.Option("dir", m.Cap("directory"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check := m.Spawn().Cmd("/share", "/upload", "dir", m.Option("dir"))
|
||||||
|
if !check.Results(0) {
|
||||||
|
m.Copy(check, "append")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
aaa := check.Appendv("aaa").(*ctx.Message)
|
||||||
|
|
||||||
// 输出文件
|
// 输出文件
|
||||||
s, e := os.Stat(m.Option("dir"))
|
s, e := os.Stat(m.Option("dir"))
|
||||||
if m.Assert(e); !s.IsDir() {
|
if m.Assert(e); !s.IsDir() {
|
||||||
http.ServeFile(w, r, m.Option("dir"))
|
http.ServeFile(w, r, m.Option("dir"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// 共享列表
|
||||||
if false {
|
share := m.Sess("share", m.Target())
|
||||||
|
index := share.Target().Index
|
||||||
check := m.Spawn().Cmd("/share", "/upload", "dir", m.Option("dir"))
|
m.Log("fuck", "%v", share.Target().Index)
|
||||||
if !check.Results(0) {
|
m.Log("fuck", "%v", aaa.Format())
|
||||||
m.Copy(check, "append")
|
if index != nil && index[aaa.Cap("username")] != nil {
|
||||||
return
|
for k, v := range index[aaa.Cap("username")].Index {
|
||||||
}
|
m.Log("fuck", "%v", v.Commands)
|
||||||
aaa := check.Appendv("aaa").(*ctx.Message)
|
for _, j := range v.Commands {
|
||||||
|
m.Log("fuck", "%v", j.Shares)
|
||||||
// 共享列表
|
for _, n := range j.Shares {
|
||||||
share := m.Sess("share", m.Target())
|
for _, nn := range n {
|
||||||
index := share.Target().Index
|
if match, e := regexp.MatchString(nn, m.Option("dir")); m.Assert(e) && match {
|
||||||
if index != nil && index[aaa.Append("username")] != nil {
|
share.Add("append", "group", k)
|
||||||
for k, v := range index[aaa.Append("username")].Index {
|
share.Add("append", "value", nn)
|
||||||
for _, j := range v.Commands {
|
share.Add("append", "delete", "delete")
|
||||||
for _, n := range j.Shares {
|
|
||||||
for _, nn := range n {
|
|
||||||
if match, e := regexp.MatchString(nn, m.Option("dir")); m.Assert(e) && match {
|
|
||||||
share.Add("append", "group", k)
|
|
||||||
share.Add("append", "value", nn)
|
|
||||||
share.Add("append", "delete", "delete")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
share.Sort("value", "string")
|
}
|
||||||
share.Sort("argument", "string")
|
share.Sort("value", "string")
|
||||||
|
share.Sort("argument", "string")
|
||||||
|
|
||||||
|
if false {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 输出目录
|
// 输出目录
|
||||||
@ -751,8 +755,7 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.Append("title", "upload")
|
m.Append("title", "upload")
|
||||||
// m.Append("tmpl", "userinfo", "share", "list", "git", "upload", "create")
|
m.Append("tmpl", "userinfo", "share", "list", "git", "upload", "create")
|
||||||
m.Append("tmpl", "list", "git", "upload", "create")
|
|
||||||
m.Append("template", m.Conf("upload_main"), m.Conf("upload_tmpl"))
|
m.Append("template", m.Conf("upload_main"), m.Conf("upload_tmpl"))
|
||||||
// }}}
|
// }}}
|
||||||
}},
|
}},
|
||||||
@ -813,10 +816,10 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
|
|
||||||
msg := check.Appendv("aaa").(*ctx.Message).Spawn(m.Target())
|
msg := check.Appendv("aaa").(*ctx.Message).Spawn(m.Target())
|
||||||
if m.Options("shareto") {
|
if m.Options("shareto") {
|
||||||
msg.Cmd("right", "add", m.Option("shareto"), "command", arg[0], arg[1], arg[2])
|
msg.Cmd("right", m.Option("shareto"), "add", "command", arg[0], arg[1], arg[2])
|
||||||
}
|
}
|
||||||
if m.Options("notshareto") {
|
if m.Options("notshareto") {
|
||||||
msg.Cmd("right", "del", m.Option("notshareto"), "command", arg[0], arg[1], arg[2])
|
msg.Cmd("right", m.Option("notshareto"), "del", "command", arg[0], arg[1], arg[2])
|
||||||
}
|
}
|
||||||
m.Echo("ok")
|
m.Echo("ok")
|
||||||
// }}}
|
// }}}
|
||||||
@ -825,7 +828,7 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
w := m.Optionv("response").(http.ResponseWriter) //{{{
|
w := m.Optionv("response").(http.ResponseWriter) //{{{
|
||||||
if login := m.Spawn().Cmd("/login"); login.Has("redirect") {
|
if login := m.Spawn().Cmd("/login"); login.Has("redirect") {
|
||||||
aaa := m.Appendv("aaa").(*ctx.Message)
|
aaa := m.Appendv("aaa").(*ctx.Message)
|
||||||
if msg := m.Spawn().Cmd("right", "check", aaa.Cap("username"), arg); msg.Results(0) {
|
if msg := m.Spawn().Cmd("right", aaa.Cap("username"), "check", arg); msg.Results(0) {
|
||||||
m.Copy(login, "append").Echo(msg.Result(0))
|
m.Copy(login, "append").Echo(msg.Result(0))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user