mirror of
https://shylinux.com/x/ContextOS
synced 2025-04-28 18:02:02 +08:00
tce do someting
This commit is contained in:
parent
d73435b722
commit
2306318835
@ -794,7 +794,28 @@ func (m *Message) Color(color int, str string, arg ...interface{}) *Message { //
|
|||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
func (m *Message) Table(cb func(maps map[string]string, list []string, line int) (goon bool)) *Message { // {{{
|
func (m *Message) Table(cbs ...func(maps map[string]string, list []string, line int) (goon bool)) *Message { // {{{
|
||||||
|
var cb func(maps map[string]string, list []string, line int) (goon bool)
|
||||||
|
if len(cbs) > 0 {
|
||||||
|
cb = cbs[0]
|
||||||
|
} else {
|
||||||
|
row := m.Confx("table_row_sep")
|
||||||
|
col := m.Confx("table_col_sep")
|
||||||
|
compact := Right(m.Confx("table_compact"))
|
||||||
|
cb = func(maps map[string]string, lists []string, line int) bool {
|
||||||
|
for i, v := range lists {
|
||||||
|
if k := m.Meta["append"][i]; compact {
|
||||||
|
v = maps[k]
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.Echo(v); i < len(lists)-1 {
|
||||||
|
m.Echo(col)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.Echo(row)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
if len(m.Meta["append"]) == 0 {
|
if len(m.Meta["append"]) == 0 {
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
@ -918,7 +939,7 @@ func (m *Message) Matrix(index int, arg ...interface{}) string { // {{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
func (m *Message) Sort(key string, arg ...string) { // {{{
|
func (m *Message) Sort(key string, arg ...string) *Message { // {{{
|
||||||
table := []map[string]string{}
|
table := []map[string]string{}
|
||||||
m.Table(func(line map[string]string, lists []string, index int) bool {
|
m.Table(func(line map[string]string, lists []string, index int) bool {
|
||||||
if index != -1 {
|
if index != -1 {
|
||||||
@ -993,6 +1014,7 @@ func (m *Message) Sort(key string, arg ...string) { // {{{
|
|||||||
m.Add("append", k, v[k])
|
m.Add("append", k, v[k])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return m
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
@ -1789,6 +1811,9 @@ var Index = &Context{Name: "ctx", Help: "模块中心",
|
|||||||
"result_index": &Config{Name: "result_index", Value: "-2", Help: "返回值的索引"},
|
"result_index": &Config{Name: "result_index", Value: "-2", Help: "返回值的索引"},
|
||||||
|
|
||||||
"list_help": &Config{Name: "list_help", Value: "list command", Help: "命令列表帮助"},
|
"list_help": &Config{Name: "list_help", Value: "list command", Help: "命令列表帮助"},
|
||||||
|
"table_compact": &Config{Name: "table_compact", Value: "false", Help: "命令列表帮助"},
|
||||||
|
"table_col_sep": &Config{Name: "table_col_sep", Value: "\t", Help: "命令列表帮助"},
|
||||||
|
"table_row_sep": &Config{Name: "table_row_sep", Value: "\n", Help: "命令列表帮助"},
|
||||||
},
|
},
|
||||||
Commands: map[string]*Command{
|
Commands: map[string]*Command{
|
||||||
"help": &Command{Name: "help topic", Help: "帮助", Hand: func(m *Message, c *Context, key string, arg ...string) {
|
"help": &Command{Name: "help topic", Help: "帮助", Hand: func(m *Message, c *Context, key string, arg ...string) {
|
||||||
@ -2321,20 +2346,20 @@ var Index = &Context{Name: "ctx", Help: "模块中心",
|
|||||||
})
|
})
|
||||||
default:
|
default:
|
||||||
msg.Travel(func(msg *Message, i int) bool {
|
msg.Travel(func(msg *Message, i int) bool {
|
||||||
target := msg.target
|
m.Add("append", "name", msg.target.Name)
|
||||||
m.Echo("%s(", target.Name)
|
if msg.target.context != nil {
|
||||||
|
m.Add("append", "context", msg.target.context.Name)
|
||||||
if target.context != nil {
|
} else {
|
||||||
m.Echo("%s", target.context.Name)
|
m.Add("append", "context", "")
|
||||||
}
|
}
|
||||||
m.Echo(":")
|
|
||||||
|
|
||||||
msg.target = target
|
m.Add("append", "status", msg.Cap("status"))
|
||||||
|
m.Add("append", "stream", msg.Cap("stream"))
|
||||||
m.Echo("%s(%s) ", msg.Cap("status"), msg.Cap("stream"))
|
m.Add("append", "help", msg.target.Help)
|
||||||
m.Echo("%s\n", target.Help)
|
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
m.Table()
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
msg.Cmd(arg)
|
msg.Cmd(arg)
|
||||||
@ -2524,14 +2549,12 @@ var Index = &Context{Name: "ctx", Help: "模块中心",
|
|||||||
Hand: func(m *Message, c *Context, key string, arg ...string) {
|
Hand: func(m *Message, c *Context, key string, arg ...string) {
|
||||||
switch len(arg) { //{{{
|
switch len(arg) { //{{{
|
||||||
case 0:
|
case 0:
|
||||||
keys := []string{}
|
for k, v := range m.target.Configs {
|
||||||
for k, _ := range m.target.Configs {
|
m.Add("append", "key", k)
|
||||||
keys = append(keys, k)
|
m.Add("append", "value", m.Conf(k))
|
||||||
}
|
m.Add("append", "name", v.Name)
|
||||||
sort.Strings(keys)
|
|
||||||
for _, k := range keys {
|
|
||||||
m.Echo("%s(%s): %s\n", k, m.Conf(k), m.target.Configs[k].Name)
|
|
||||||
}
|
}
|
||||||
|
m.Sort("key", "string").Table()
|
||||||
return
|
return
|
||||||
case 1:
|
case 1:
|
||||||
if arg[0] == "all" {
|
if arg[0] == "all" {
|
||||||
@ -2573,14 +2596,12 @@ var Index = &Context{Name: "ctx", Help: "模块中心",
|
|||||||
Hand: func(m *Message, c *Context, key string, arg ...string) {
|
Hand: func(m *Message, c *Context, key string, arg ...string) {
|
||||||
switch len(arg) { //{{{
|
switch len(arg) { //{{{
|
||||||
case 0:
|
case 0:
|
||||||
keys := []string{}
|
for k, v := range m.target.Caches {
|
||||||
for k, _ := range m.target.Caches {
|
m.Add("append", "key", k)
|
||||||
keys = append(keys, k)
|
m.Add("append", "value", m.Cap(k))
|
||||||
}
|
m.Add("append", "name", v.Name)
|
||||||
sort.Strings(keys)
|
|
||||||
for _, k := range keys {
|
|
||||||
m.Echo("%s(%s): %s\n", k, m.Cap(k), m.target.Caches[k].Name)
|
|
||||||
}
|
}
|
||||||
|
m.Sort("key", "string").Table()
|
||||||
return
|
return
|
||||||
case 1:
|
case 1:
|
||||||
if arg[0] == "all" {
|
if arg[0] == "all" {
|
||||||
|
@ -5,6 +5,7 @@ import ( // {{{
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"github.com/nsf/termbox-go"
|
"github.com/nsf/termbox-go"
|
||||||
"github.com/skip2/go-qrcode"
|
"github.com/skip2/go-qrcode"
|
||||||
|
"net"
|
||||||
|
|
||||||
"bufio"
|
"bufio"
|
||||||
"errors"
|
"errors"
|
||||||
@ -34,8 +35,8 @@ type NFS struct {
|
|||||||
height int
|
height int
|
||||||
|
|
||||||
paths []string
|
paths []string
|
||||||
|
io net.Conn
|
||||||
|
|
||||||
io io.ReadWriteCloser
|
|
||||||
*bufio.Reader
|
*bufio.Reader
|
||||||
*bufio.Writer
|
*bufio.Writer
|
||||||
send map[int]*ctx.Message
|
send map[int]*ctx.Message
|
||||||
@ -672,15 +673,22 @@ func (nfs *NFS) Start(m *ctx.Message, arg ...string) bool { // {{{
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nfs.io = m.Optionv("io").(net.Conn)
|
||||||
|
bio := bufio.NewScanner(nfs.io)
|
||||||
|
for bio.Scan() {
|
||||||
|
m.Log("info", "recv: %s", bio.Text())
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
m.Sess("nfs", m)
|
m.Sess("nfs", m)
|
||||||
|
|
||||||
nfs.Message = m
|
nfs.Message = m
|
||||||
if socket, ok := m.Data["io"]; ok {
|
if _, ok := m.Data["io"]; ok {
|
||||||
m.Cap("stream", m.Source().Name)
|
m.Cap("stream", m.Source().Name)
|
||||||
// m.Sess("aaa", "aaa").Cmd("login", "demo", "demo")
|
// m.Sess("aaa", "aaa").Cmd("login", "demo", "demo")
|
||||||
m.Options("stdio", false)
|
m.Options("stdio", false)
|
||||||
|
|
||||||
nfs.io = socket.(io.ReadWriteCloser)
|
// nfs.io = socket.(io.ReadWriteCloser)
|
||||||
nfs.Reader = bufio.NewReader(nfs.io)
|
nfs.Reader = bufio.NewReader(nfs.io)
|
||||||
nfs.Writer = bufio.NewWriter(nfs.io)
|
nfs.Writer = bufio.NewWriter(nfs.io)
|
||||||
|
|
||||||
@ -806,6 +814,7 @@ func (nfs *NFS) Start(m *ctx.Message, arg ...string) bool { // {{{
|
|||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
func (nfs *NFS) Close(m *ctx.Message, arg ...string) bool { // {{{
|
func (nfs *NFS) Close(m *ctx.Message, arg ...string) bool { // {{{
|
||||||
|
return false
|
||||||
switch nfs.Context {
|
switch nfs.Context {
|
||||||
case m.Target():
|
case m.Target():
|
||||||
if nfs.in != nil {
|
if nfs.in != nil {
|
||||||
@ -1311,10 +1320,8 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
|
|||||||
"listen": &ctx.Command{Name: "listen args...", Help: "启动文件服务, args: 参考tcp模块, listen命令的参数", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
"listen": &ctx.Command{Name: "listen args...", Help: "启动文件服务, args: 参考tcp模块, listen命令的参数", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
||||||
if _, ok := m.Target().Server.(*NFS); m.Assert(ok) { //{{{
|
if _, ok := m.Target().Server.(*NFS); m.Assert(ok) { //{{{
|
||||||
m.Find("tcp").Call(func(com *ctx.Message) *ctx.Message {
|
m.Find("tcp").Call(func(com *ctx.Message) *ctx.Message {
|
||||||
sub := com.Spawn(m.Target())
|
sub := com.Spawn(c)
|
||||||
sub.Put("option", "target", m.Source())
|
sub.Start(fmt.Sprintf("file%d", m.Capi("nfile", 1)), "远程文件")
|
||||||
sub.Put("option", "io", com.Data["io"])
|
|
||||||
sub.Start(fmt.Sprintf("file%d", m.Capi("nfile", 1)), "打开文件")
|
|
||||||
return sub
|
return sub
|
||||||
}, m.Meta["detail"])
|
}, m.Meta["detail"])
|
||||||
}
|
}
|
||||||
@ -1323,10 +1330,8 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
|
|||||||
"dial": &ctx.Command{Name: "dial args...", Help: "连接文件服务, args: 参考tcp模块, dial命令的参数", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
"dial": &ctx.Command{Name: "dial args...", Help: "连接文件服务, args: 参考tcp模块, dial命令的参数", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
||||||
if _, ok := m.Target().Server.(*NFS); m.Assert(ok) { //{{{
|
if _, ok := m.Target().Server.(*NFS); m.Assert(ok) { //{{{
|
||||||
m.Find("tcp").Call(func(com *ctx.Message) *ctx.Message {
|
m.Find("tcp").Call(func(com *ctx.Message) *ctx.Message {
|
||||||
sub := com.Spawn(m.Target())
|
sub := com.Spawn(c)
|
||||||
sub.Put("option", "target", m.Source())
|
sub.Start(fmt.Sprintf("file%d", m.Capi("nfile", 1)), "远程文件")
|
||||||
sub.Put("option", "io", com.Data["io"])
|
|
||||||
sub.Start(fmt.Sprintf("file%d", m.Capi("nfile", 1)), "打开文件")
|
|
||||||
return sub
|
return sub
|
||||||
}, m.Meta["detail"])
|
}, m.Meta["detail"])
|
||||||
}
|
}
|
||||||
@ -1334,6 +1339,9 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心",
|
|||||||
}},
|
}},
|
||||||
"send": &ctx.Command{Name: "send [file] args...", Help: "连接文件服务, args: 参考tcp模块, dial命令的参数", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
"send": &ctx.Command{Name: "send [file] args...", Help: "连接文件服务, args: 参考tcp模块, dial命令的参数", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) {
|
||||||
if nfs, ok := m.Target().Server.(*NFS); m.Assert(ok) { // {{{
|
if nfs, ok := m.Target().Server.(*NFS); m.Assert(ok) { // {{{
|
||||||
|
m.Log("fuck", "%v %v", arg, nfs.io)
|
||||||
|
nfs.io.Write([]byte(arg[0]))
|
||||||
|
return
|
||||||
if m.Has("nrecv") {
|
if m.Has("nrecv") {
|
||||||
if len(arg) > 1 && arg[0] == "file" {
|
if len(arg) > 1 && arg[0] == "file" {
|
||||||
info, e := os.Stat(arg[1])
|
info, e := os.Stat(arg[1])
|
||||||
|
@ -61,8 +61,8 @@ func (tcp *TCP) Start(m *ctx.Message, arg ...string) bool { // {{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
m.Log("info", "%s dial %s", m.Cap("nclient"),
|
m.Log("info", "%s dial %s", m.Cap("nclient"),
|
||||||
m.Append("stream", m.Cap("stream", fmt.Sprintf("%s->%s", tcp.LocalAddr(), tcp.RemoteAddr()))))
|
m.Option("stream", m.Cap("stream", fmt.Sprintf("%s->%s", tcp.LocalAddr(), tcp.RemoteAddr()))))
|
||||||
m.Put("append", "io", tcp.Conn).Back(m)
|
m.Put("option", "io", tcp.Conn).Back(m)
|
||||||
return false
|
return false
|
||||||
case "accept":
|
case "accept":
|
||||||
c, e := m.Data["io"].(net.Conn)
|
c, e := m.Data["io"].(net.Conn)
|
||||||
@ -71,7 +71,7 @@ func (tcp *TCP) Start(m *ctx.Message, arg ...string) bool { // {{{
|
|||||||
|
|
||||||
m.Log("info", "%s accept %s", m.Cap("nclient"),
|
m.Log("info", "%s accept %s", m.Cap("nclient"),
|
||||||
m.Append("stream", m.Cap("stream", fmt.Sprintf("%s<-%s", tcp.LocalAddr(), tcp.RemoteAddr()))))
|
m.Append("stream", m.Cap("stream", fmt.Sprintf("%s<-%s", tcp.LocalAddr(), tcp.RemoteAddr()))))
|
||||||
m.Put("append", "io", tcp.Conn).Back(m)
|
m.Put("option", "io", tcp.Conn).Back(m)
|
||||||
return false
|
return false
|
||||||
default:
|
default:
|
||||||
if m.Cap("security") != "false" {
|
if m.Cap("security") != "false" {
|
||||||
@ -145,28 +145,23 @@ var Index = &ctx.Context{Name: "tcp", Help: "网络中心",
|
|||||||
"protocol": &ctx.Config{Name: "protocol(tcp/tcp4/tcp6)", Value: "tcp4", Help: "网络协议"},
|
"protocol": &ctx.Config{Name: "protocol(tcp/tcp4/tcp6)", Value: "tcp4", Help: "网络协议"},
|
||||||
},
|
},
|
||||||
Commands: map[string]*ctx.Command{
|
Commands: map[string]*ctx.Command{
|
||||||
"listen": &ctx.Command{Name: "listen address [security [protocol]]", Help: "网络监听",
|
"listen": &ctx.Command{Name: "listen address [security [protocol]]", 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) {
|
|
||||||
m.Start(fmt.Sprintf("pub%d", m.Capi("nlisten", 1)), "网络监听", m.Meta["detail"]...)
|
m.Start(fmt.Sprintf("pub%d", m.Capi("nlisten", 1)), "网络监听", m.Meta["detail"]...)
|
||||||
}},
|
}},
|
||||||
"accept": &ctx.Command{Name: "accept address [security [protocol]]", Help: "网络连接",
|
"accept": &ctx.Command{Name: "accept address [security [protocol]]", 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) {
|
|
||||||
m.Start(fmt.Sprintf("com%d", m.Capi("nclient", 1)), "网络连接", m.Meta["detail"]...)
|
m.Start(fmt.Sprintf("com%d", m.Capi("nclient", 1)), "网络连接", m.Meta["detail"]...)
|
||||||
}},
|
}},
|
||||||
"dial": &ctx.Command{Name: "dial address [security [protocol]]", Help: "网络连接",
|
"dial": &ctx.Command{Name: "dial address [security [protocol]]", 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) {
|
|
||||||
m.Start(fmt.Sprintf("com%d", m.Capi("nclient", 1)), "网络连接", m.Meta["detail"]...)
|
m.Start(fmt.Sprintf("com%d", m.Capi("nclient", 1)), "网络连接", m.Meta["detail"]...)
|
||||||
}},
|
}},
|
||||||
"send": &ctx.Command{Name: "send message", Help: "发送消息",
|
"send": &ctx.Command{Name: "send message", 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 tcp, ok := m.Target().Server.(*TCP); m.Assert(ok) && tcp.Conn != nil { // {{{
|
||||||
if tcp, ok := m.Target().Server.(*TCP); m.Assert(ok) && tcp.Conn != nil {
|
|
||||||
tcp.Conn.Write([]byte(arg[0]))
|
tcp.Conn.Write([]byte(arg[0]))
|
||||||
m.Capi("nsend", len(arg[0]))
|
m.Capi("nsend", len(arg[0]))
|
||||||
}
|
} // }}}
|
||||||
}},
|
}},
|
||||||
"recv": &ctx.Command{Name: "recv size", Help: "接收消息",
|
"recv": &ctx.Command{Name: "recv size", 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 tcp, ok := m.Target().Server.(*TCP); m.Assert(ok) && tcp.Conn != nil { // {{{
|
||||||
if tcp, ok := m.Target().Server.(*TCP); m.Assert(ok) && tcp.Conn != nil {
|
|
||||||
size, e := strconv.Atoi(arg[0])
|
size, e := strconv.Atoi(arg[0])
|
||||||
m.Assert(e)
|
m.Assert(e)
|
||||||
|
|
||||||
@ -177,11 +172,10 @@ var Index = &ctx.Context{Name: "tcp", Help: "网络中心",
|
|||||||
|
|
||||||
m.Echo(string(buf))
|
m.Echo(string(buf))
|
||||||
m.Capi("nrecv", n)
|
m.Capi("nrecv", n)
|
||||||
}
|
} // }}}
|
||||||
}},
|
}},
|
||||||
"ifconfig": &ctx.Command{Name: "ifconfig", Help: "接收消息",
|
"ifconfig": &ctx.Command{Name: "ifconfig", 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) {
|
ifs, e := net.Interfaces() // {{{
|
||||||
ifs, e := net.Interfaces()
|
|
||||||
m.Assert(e)
|
m.Assert(e)
|
||||||
for _, v := range ifs {
|
for _, v := range ifs {
|
||||||
ips, e := v.Addrs()
|
ips, e := v.Addrs()
|
||||||
@ -196,17 +190,8 @@ var Index = &ctx.Context{Name: "tcp", Help: "网络中心",
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m.Table()
|
||||||
m.Table(func(maps map[string]string, list []string, line int) bool {
|
// }}}
|
||||||
for i, v := range list {
|
|
||||||
m.Echo("%s", v)
|
|
||||||
if i < len(list)-1 {
|
|
||||||
m.Echo("\t")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m.Echo("\n")
|
|
||||||
return true
|
|
||||||
})
|
|
||||||
}},
|
}},
|
||||||
},
|
},
|
||||||
Index: map[string]*ctx.Context{
|
Index: map[string]*ctx.Context{
|
||||||
|
@ -643,13 +643,6 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
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() {
|
||||||
@ -657,6 +650,14 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if false {
|
||||||
|
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)
|
||||||
|
|
||||||
// 共享列表
|
// 共享列表
|
||||||
share := m.Sess("share", m.Target())
|
share := m.Sess("share", m.Target())
|
||||||
index := share.Target().Index
|
index := share.Target().Index
|
||||||
@ -677,6 +678,7 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
}
|
}
|
||||||
share.Sort("value", "string")
|
share.Sort("value", "string")
|
||||||
share.Sort("argument", "string")
|
share.Sort("argument", "string")
|
||||||
|
}
|
||||||
|
|
||||||
// 输出目录
|
// 输出目录
|
||||||
fs, e := ioutil.ReadDir(m.Option("dir"))
|
fs, e := ioutil.ReadDir(m.Option("dir"))
|
||||||
@ -748,7 +750,8 @@ 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"))
|
||||||
// }}}
|
// }}}
|
||||||
}},
|
}},
|
||||||
@ -908,7 +911,6 @@ var Index = &ctx.Context{Name: "web", Help: "应用中心",
|
|||||||
if len(arg) > 0 {
|
if len(arg) > 0 {
|
||||||
url = arg[0]
|
url = arg[0]
|
||||||
}
|
}
|
||||||
m.Log("fucK", "os %v", runtime.GOOS)
|
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "windows":
|
case "windows":
|
||||||
m.Find("cli").Cmd("system", "explorer", url)
|
m.Find("cli").Cmd("system", "explorer", url)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user