forked from x/icebergs
add some
This commit is contained in:
parent
6b8e6e11f9
commit
7831d5343e
@ -23,8 +23,8 @@ type apply struct {
|
||||
|
||||
func (s apply) Sso(m *ice.Message, arg ...string) {
|
||||
m.AddHeaderLogin(cli.QRCODE, cli.QRCODE, "扫码登录", "10")
|
||||
m.AddHeaderLogin(mdb.PLUGIN, aaa.EMAIL, "邮箱登录", "20", ctx.INDEX, m.PrefixKey(), ctx.ARGS, kit.FuncName(s.Login))
|
||||
m.AddHeaderLogin(mdb.PLUGIN, aaa.APPLY, "注册用户", "30", ctx.INDEX, m.PrefixKey(), ctx.ARGS, kit.FuncName(s.Apply))
|
||||
m.AddHeaderLogin(mdb.PLUGIN, aaa.EMAIL, "邮箱登录", "20", ctx.INDEX, m.ShortKey(), ctx.ARGS, kit.FuncName(s.Login))
|
||||
m.AddHeaderLogin(mdb.PLUGIN, aaa.APPLY, "注册用户", "30", ctx.INDEX, m.ShortKey(), ctx.ARGS, kit.FuncName(s.Apply))
|
||||
}
|
||||
func (s apply) Apply(m *ice.Message, arg ...string) {
|
||||
if m.IsGetMethod() {
|
||||
|
@ -158,6 +158,6 @@ func Right(m *ice.Message, key ...ice.Any) bool {
|
||||
return true
|
||||
}
|
||||
return !ice.Info.Important || m.Option(ice.MSG_USERROLE) == ROOT || !m.WarnNotRight(m.Cmdx(ROLE, RIGHT, m.Option(ice.MSG_USERROLE), key, logs.FileLineMeta(-1)) != ice.OK,
|
||||
kit.Keys(key...), USERROLE, m.Option(ice.MSG_USERROLE), logs.FileLineMeta(-1))
|
||||
kit.Keys(key...), USERROLE, m.Option(ice.MSG_USERROLE), logs.FileLineMeta(-2))
|
||||
}
|
||||
func IsTechOrRoot(m *ice.Message) bool { return kit.IsIn(m.Option(ice.MSG_USERROLE), TECH, ROOT) }
|
||||
|
@ -46,7 +46,7 @@ func EventsAction(arg ...string) ice.Actions {
|
||||
var list map[string]int = map[string]int{}
|
||||
|
||||
func Watch(m *ice.Message, key string, arg ...string) *ice.Message {
|
||||
kit.If(len(arg) == 0, func() { arg = append(arg, m.PrefixKey()) })
|
||||
kit.If(len(arg) == 0, func() { arg = append(arg, m.ShortKey()) })
|
||||
return m.Cmd(Prefix(EVENT), LISTEN, EVENT, key, ice.CMD, kit.Join(arg, ice.SP))
|
||||
}
|
||||
func Event(m *ice.Message, key string, arg ...ice.Any) *ice.Message {
|
||||
|
@ -42,5 +42,5 @@ func init() {
|
||||
})
|
||||
}
|
||||
func Go(m *ice.Message, cb ice.Any, arg ...string) {
|
||||
m.Cmd(ROUTINE, mdb.CREATE, kit.Select(m.PrefixKey(), arg, 0), logs.FileLine(cb), cb)
|
||||
m.Cmd(ROUTINE, mdb.CREATE, kit.Select(m.ShortKey(), arg, 0), logs.FileLine(cb), cb)
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ func _cat_list(m *ice.Message, p string) {
|
||||
return
|
||||
}
|
||||
f, e := _cat_find(m, p)
|
||||
if m.WarnNotFound(e, p) {
|
||||
if m.WarnNotFound(e, FILE, p) {
|
||||
return
|
||||
}
|
||||
defer f.Close()
|
||||
|
@ -5,7 +5,6 @@ import (
|
||||
|
||||
ice "shylinux.com/x/icebergs"
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
"shylinux.com/x/icebergs/base/ctx"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/web/html"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
@ -107,7 +106,7 @@ func init() {
|
||||
}
|
||||
|
||||
func Count(m *ice.Message, arg ...string) *ice.Message {
|
||||
kit.If(len(arg) > 0 && arg[0] == "", func() { arg[0] = ctx.ShortCmd(m.PrefixKey()) })
|
||||
kit.If(len(arg) > 0 && arg[0] == "", func() { arg[0] = m.ShortKey() })
|
||||
kit.If(len(arg) > 1 && arg[1] == "", func() { arg[1] = m.ActionKey() })
|
||||
m.Cmd(COUNT, mdb.CREATE, arg, kit.Dict(ice.LOG_DISABLE, ice.TRUE))
|
||||
return m
|
||||
|
@ -117,8 +117,8 @@ func _dream_start(m *ice.Message, name string) {
|
||||
return
|
||||
}
|
||||
if !m.IsCliUA() {
|
||||
defer ToastProcess(m)()
|
||||
defer m.ProcessOpen(m.MergePod(name))
|
||||
defer ToastProcess(m, mdb.CREATE, name)()
|
||||
}
|
||||
defer mdb.Lock(m, m.PrefixKey(), cli.START, name)()
|
||||
p := _dream_check(m, name)
|
||||
@ -157,14 +157,7 @@ func _dream_binary(m *ice.Message, p string) {
|
||||
if bin := path.Join(m.Option(cli.CMD_DIR), ice.BIN_ICE_BIN); nfs.Exists(m, bin) {
|
||||
return
|
||||
} else if kit.IsUrl(p) || strings.HasPrefix(p, S()) {
|
||||
GoToast(m, func(toast func(string, int, int)) []string {
|
||||
begin := time.Now()
|
||||
SpideSave(m, bin, kit.MergeURL(p, cli.GOOS, runtime.GOOS, cli.GOARCH, runtime.GOARCH), func(count, total, value int) {
|
||||
toast(m.Option(mdb.NAME)+lex.NL+kit.FormatShow(cli.COST, kit.FmtDuration(time.Now().Sub(begin))), count, total)
|
||||
})
|
||||
return nil
|
||||
})
|
||||
os.Chmod(bin, ice.MOD_DIR)
|
||||
m.Cmd(DREAM, DOWNLOAD, bin, p)
|
||||
} else {
|
||||
m.Cmd(nfs.LINK, bin, kit.Path(p))
|
||||
}
|
||||
@ -219,7 +212,7 @@ func init() {
|
||||
for _, cmd := range kit.Reverse(kit.Split(mdb.Config(m, html.BUTTON))) {
|
||||
m.Cmd(gdb.EVENT, gdb.LISTEN, gdb.EVENT, DREAM_TABLES, ice.CMD, cmd)
|
||||
m.Cmd(gdb.EVENT, gdb.LISTEN, gdb.EVENT, DREAM_ACTION, ice.CMD, cmd)
|
||||
aaa.White(m, kit.Keys(m.PrefixKey(), ctx.ACTION, cmd))
|
||||
aaa.White(m, kit.Keys(m.ShortKey(), ctx.ACTION, cmd))
|
||||
}
|
||||
})
|
||||
m.GoSleep("10s", func() {
|
||||
@ -290,6 +283,15 @@ func init() {
|
||||
_dream_start(m, m.Option(mdb.NAME))
|
||||
}
|
||||
}},
|
||||
DOWNLOAD: {Name: "download path link", Hand: func(m *ice.Message, arg ...string) {
|
||||
GoToast(m, func(toast func(string, int, int)) []string {
|
||||
SpideSave(m, m.Option(nfs.PATH), kit.MergeURL(m.Option(mdb.LINK), cli.GOOS, runtime.GOOS, cli.GOARCH, runtime.GOARCH), func(count, total, value int) {
|
||||
toast(m.Option(mdb.NAME), count, total)
|
||||
})
|
||||
return nil
|
||||
})
|
||||
os.Chmod(m.Option(nfs.PATH), ice.MOD_DIR)
|
||||
}},
|
||||
STARTALL: {Name: "startall name", Help: "启动", Icon: "bi bi-play-circle", Hand: func(m *ice.Message, arg ...string) {
|
||||
DreamEach(m, m.Option(mdb.NAME), cli.STOP, func(name string) {
|
||||
m.Cmd("", cli.START, ice.Maps{mdb.NAME: name, ice.MSG_DAEMON: ""})
|
||||
@ -318,7 +320,7 @@ func init() {
|
||||
list := []string{cli.LINUX, cli.DARWIN, cli.WINDOWS}
|
||||
msg := m.Spawn(ice.Maps{ice.MSG_DAEMON: ""})
|
||||
func() {
|
||||
defer ToastProcess(m, PUBLISH, ice.Info.Pathname)(PUBLISH, ice.Info.Pathname)
|
||||
defer ToastProcess(m, PUBLISH, ice.Info.Pathname)()
|
||||
m.Cmd(AUTOGEN, BINPACK)
|
||||
kit.For(list, func(goos string) {
|
||||
PushNoticeRich(m, mdb.NAME, ice.Info.NodeName, msg.Cmd(COMPILE, goos, cli.AMD64).AppendSimple())
|
||||
|
@ -42,8 +42,10 @@ func _matrix_action(m *ice.Message, action string, arg ...string) {
|
||||
if kit.HasPrefixList(arg, ctx.RUN) {
|
||||
ProcessIframe(m, "", "", arg...)
|
||||
} else {
|
||||
title, link := kit.Keys(domain, action), m.MergePodCmd(domain, action)
|
||||
kit.If(action == OPEN, func() { title, link = domain, m.MergePod(domain) })
|
||||
// title, link := kit.Keys(domain, action), m.MergePodCmd(domain, action)
|
||||
// kit.If(action == OPEN, func() { title, link = domain, m.MergePod(domain) })
|
||||
title, link := kit.Keys(domain, action), S(domain)+C(action)
|
||||
kit.If(action == OPEN, func() { title, link = domain, S(domain) })
|
||||
ProcessIframe(m, title, link, arg...).ProcessField(ctx.ACTION, action, ctx.RUN)
|
||||
}
|
||||
default:
|
||||
@ -88,7 +90,6 @@ func init() {
|
||||
m.OptionDefault(nfs.BINARY, UserHost(m)+S(m.Option(mdb.NAME)))
|
||||
}
|
||||
_matrix_dream(m, mdb.CREATE, kit.Simple(m.OptionSimple(mdb.ICONS, nfs.REPOS, nfs.BINARY))...)
|
||||
_matrix_dream(m, cli.START)
|
||||
}},
|
||||
}, ctx.ConfAction(mdb.FIELD, "time,domain,status,type,name,text,icons,repos,binary,module,version")), Hand: func(m *ice.Message, arg ...string) {
|
||||
if kit.HasPrefixList(arg, ctx.ACTION) {
|
||||
|
@ -53,7 +53,7 @@ func PushPodCmd(m *ice.Message, cmd string, arg ...string) *ice.Message {
|
||||
})
|
||||
kit.If(m.Length() > 0 && len(m.Appendv(SPACE)) == 0, func() { m.Table(func(value ice.Maps) { m.Push(SPACE, "") }) })
|
||||
GoToastTable(msg, SPACE, func(value ice.Maps) {
|
||||
m.Cmd(SPACE, value[SPACE], kit.Dict(ice.MSG_USERPOD, value[SPACE]), kit.Select(m.PrefixKey(), cmd), arg).Table(func(val ice.Maps, index int, head []string) {
|
||||
m.Cmd(SPACE, value[SPACE], kit.Dict(ice.MSG_USERPOD, value[SPACE]), kit.Select(m.ShortKey(), cmd), arg).Table(func(val ice.Maps, index int, head []string) {
|
||||
kit.If(!kit.IsIn(SPACE, head...), func() { head = append(head, SPACE) })
|
||||
val[SPACE] = kit.Keys(value[SPACE], val[SPACE])
|
||||
m.Push("", val, head)
|
||||
|
@ -129,7 +129,7 @@ func RenderCmds(m *ice.Message, cmds ...ice.Any) {
|
||||
RenderMain(m.Options(ctx.CMDS, kit.Format(cmds)))
|
||||
}
|
||||
func RenderPodCmd(m *ice.Message, pod, cmd string, arg ...ice.Any) {
|
||||
if msg := m.Cmd(Space(m, pod), ctx.COMMAND, kit.Select(m.PrefixKey(), cmd)); msg.Length() == 0 {
|
||||
if msg := m.Cmd(Space(m, pod), ctx.COMMAND, kit.Select(m.ShortKey(), cmd)); msg.Length() == 0 {
|
||||
RenderResult(m, kit.Format("not found command %s", cmd))
|
||||
} else {
|
||||
RenderCmds(m, kit.Dict(msg.AppendSimple(), ctx.ARGS, kit.Simple(arg), ctx.DISPLAY, m.Option(ice.MSG_DISPLAY)))
|
||||
|
@ -151,7 +151,7 @@ func _serve_handle(key string, cmd *ice.Command, m *ice.Message, w http.Response
|
||||
m.Cost(kit.Format("%s: %s %v", r.Method, r.URL.String(), m.FormatSize())).Options(ice.MSG_COST, m.FormatCost())
|
||||
}()
|
||||
m.Option(ice.MSG_OPTS, kit.Simple(m.Optionv(ice.MSG_OPTION), func(k string) bool { return !strings.HasPrefix(k, ice.MSG_SESSID) }))
|
||||
if m.Detailv(m.PrefixKey(), cmds); len(cmds) > 1 && cmds[0] == ctx.ACTION && cmds[1] != ctx.ACTION {
|
||||
if m.Detailv(m.ShortKey(), cmds); len(cmds) > 1 && cmds[0] == ctx.ACTION && cmds[1] != ctx.ACTION {
|
||||
if !kit.IsIn(cmds[1], aaa.LOGIN, ctx.RUN, ctx.COMMAND) && m.WarnNotAllow(r.Method == http.MethodGet) {
|
||||
return
|
||||
}
|
||||
@ -287,7 +287,7 @@ func Script(m *ice.Message, str string, arg ...ice.Any) string {
|
||||
return ice.Render(m, ice.RENDER_SCRIPT, kit.Format(str, arg...))
|
||||
}
|
||||
func ChatCmdPath(m *ice.Message, arg ...string) string {
|
||||
return m.MergePodCmd("", kit.Select(m.PrefixKey(), path.Join(arg...)))
|
||||
return m.MergePodCmd("", kit.Select(m.ShortKey(), path.Join(arg...)))
|
||||
}
|
||||
func RequireFile(m *ice.Message, file string) string {
|
||||
if strings.HasPrefix(file, nfs.PS) || strings.HasPrefix(file, ice.HTTP) {
|
||||
|
@ -183,7 +183,7 @@ func ShareLocal(m *ice.Message, p string) string {
|
||||
return m.MergeLink(PP(SHARE, LOCAL, p))
|
||||
}
|
||||
func ShareField(m *ice.Message, cmd string, arg ...ice.Any) *ice.Message {
|
||||
return m.EchoQRCode(tcp.PublishLocalhost(m, m.MergeLink(P(SHARE, AdminCmd(m, SHARE, mdb.CREATE, mdb.TYPE, FIELD, mdb.NAME, kit.Select(m.PrefixKey(), cmd), mdb.TEXT, kit.Format(kit.Simple(arg...)), SPACE, m.Option(ice.MSG_USERPOD)).Result()))))
|
||||
return m.EchoQRCode(tcp.PublishLocalhost(m, m.MergeLink(P(SHARE, AdminCmd(m, SHARE, mdb.CREATE, mdb.TYPE, FIELD, mdb.NAME, kit.Select(m.ShortKey(), cmd), mdb.TEXT, kit.Format(kit.Simple(arg...)), SPACE, m.Option(ice.MSG_USERPOD)).Result()))))
|
||||
}
|
||||
func ProxyUpload(m *ice.Message, pod string, p string) string {
|
||||
pp := path.Join(ice.VAR_PROXY, pod, p)
|
||||
|
@ -144,7 +144,7 @@ func _space_handle(m *ice.Message, safe bool, name string, c *websocket.Conn) {
|
||||
case ice.Handler: // 接收响应
|
||||
msg.Go(func() { c(msg) })
|
||||
}
|
||||
}), next)
|
||||
}), SPACE, next)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -399,7 +399,7 @@ func Space(m *ice.Message, arg ice.Any) []string {
|
||||
}
|
||||
func PodCmd(m *ice.Message, key string, arg ...string) bool {
|
||||
if pod := m.Option(key); pod != "" {
|
||||
m.Options(key, "", ice.MSG_USERPOD, pod).Cmdy(SPACE, pod, m.PrefixKey(), arg)
|
||||
m.Options(key, "", ice.MSG_USERPOD, pod).Cmdy(SPACE, pod, m.ShortKey(), arg)
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
|
@ -62,7 +62,7 @@ func _spide_show(m *ice.Message, name string, arg ...string) {
|
||||
kit.For(req.Header, func(k string, v []string) { m.Logs(REQUEST, k, v) })
|
||||
}
|
||||
res, e := _spide_send(m, name, req, kit.Format(m.OptionDefault(CLIENT_TIMEOUT, msg.Append(CLIENT_TIMEOUT))))
|
||||
if m.WarnNotFound(e, uri) {
|
||||
if m.WarnNotFound(e, SPIDE, uri) {
|
||||
return
|
||||
}
|
||||
defer res.Body.Close()
|
||||
|
@ -48,7 +48,7 @@ func StatsAction(arg ...string) ice.Actions {
|
||||
}, gdb.EventsAction(STATS_TABLES))
|
||||
}
|
||||
func PushStats(m *ice.Message, name string, value ice.Any, arg ...string) {
|
||||
index := kit.Select(m.PrefixKey(), arg, 2)
|
||||
index := kit.Select(m.ShortKey(), arg, 2)
|
||||
kit.If(name == "", func() { name = kit.Keys(kit.Select("", kit.Split(index, nfs.PT), -1), mdb.TOTAL) })
|
||||
kit.If(value == "", func() { value = m.Cmd(index).Length() })
|
||||
kit.If(value != 0, func() {
|
||||
|
@ -58,7 +58,7 @@ func init() {
|
||||
m.PushAction(mdb.REMOVE).Action(html.FILTER, mdb.CREATE)
|
||||
}
|
||||
} else {
|
||||
defer ToastProcess(m, ice.LIST, arg[0])(ice.LIST, arg[0])
|
||||
defer ToastProcess(m, ice.LIST, arg[0])()
|
||||
if arg[0] == ice.OPS && ice.Info.NodeType == SERVER {
|
||||
m.Cmdy(DREAM)
|
||||
return
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/web/html"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
"shylinux.com/x/toolkits/logs"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -32,7 +33,7 @@ func init() {
|
||||
})
|
||||
}
|
||||
func toastCreate(m *ice.Message, arg ...string) (string, time.Time) {
|
||||
return m.Cmdx(TOAST, mdb.CREATE, mdb.TYPE, kit.FuncName(2), mdb.NAME, toastTitle(m), mdb.STATUS, TOAST_INIT, ctx.INDEX, m.PrefixKey(), ParseUA(m), arg), time.Now()
|
||||
return m.Cmdx(TOAST, mdb.CREATE, mdb.TYPE, kit.FuncName(2), mdb.NAME, toastTitle(m), mdb.STATUS, TOAST_INIT, ctx.INDEX, m.ShortKey(), ParseUA(m), arg), time.Now()
|
||||
}
|
||||
func toastUpdate(m *ice.Message, h string, begin time.Time, arg ...string) string {
|
||||
cost := kit.FmtDuration(time.Now().Sub(begin))
|
||||
@ -46,7 +47,7 @@ func toastTitle(m *ice.Message) string {
|
||||
return kit.GetValid(
|
||||
func() string { return m.Option(ice.MSG_TITLE) },
|
||||
func() string {
|
||||
return kit.Keys(m.Option(ice.MSG_USERPOD0), m.Option(ice.MSG_USERPOD), ctx.ShortCmd(m.PrefixKey()))
|
||||
return kit.Keys(m.Option(ice.MSG_USERPOD0), m.Option(ice.MSG_USERPOD), ctx.ShortCmd(m.ShortKey()))
|
||||
},
|
||||
)
|
||||
}
|
||||
@ -68,8 +69,9 @@ func ToastProcess(m *ice.Message, arg ...ice.Any) func(...ice.Any) {
|
||||
h, begin := toastCreate(m, mdb.TEXT, text)
|
||||
Toast(m, text, "", "-1", "", h)
|
||||
Count(m, kit.FuncName(1), toastTitle(m), text)
|
||||
return func(arg ...ice.Any) {
|
||||
text := toastContent(m, ice.SUCCESS, arg...)
|
||||
return func(_arg ...ice.Any) {
|
||||
kit.If(len(_arg) == 0, func() { _arg = arg })
|
||||
text := toastContent(m, ice.SUCCESS, _arg...)
|
||||
toastUpdate(m, h, begin, mdb.TEXT, text, mdb.STATUS, TOAST_DONE)
|
||||
Toast(m, text, "", cli.TIME_3s, "", h)
|
||||
}
|
||||
@ -117,6 +119,9 @@ func Toast(m *ice.Message, text string, arg ...ice.Any) *ice.Message { // [title
|
||||
}
|
||||
kit.If(len(arg) == 0, func() { arg = append(arg, "") })
|
||||
kit.If(len(arg) > 0 && arg[0] == "", func() { arg[0] = toastTitle(m) })
|
||||
if m.IsDebug() {
|
||||
text += "\n" + logs.FileLine(-1)
|
||||
}
|
||||
PushNoticeToast(m, text, arg)
|
||||
return m
|
||||
}
|
||||
|
@ -31,22 +31,22 @@ func DevTokenAction(name, origin string) ice.Actions {
|
||||
DEV_CREATE_TOKEN: {Hand: func(m *ice.Message, arg ...string) {}},
|
||||
mdb.DEV_REQUEST: {Name: "dev.request", Help: "连接", Icon: "bi bi-person-down", Hand: func(m *ice.Message, arg ...string) {
|
||||
back := m.Options(ice.MSG_USERWEB, m.Option(ice.MSG_USERHOST)).MergePod("")
|
||||
m.ProcessOpen(m.Options(ice.MSG_USERWEB, m.Option(origin), ice.MSG_USERPOD, "").MergePodCmd("", m.PrefixKey(),
|
||||
m.ProcessOpen(m.Options(ice.MSG_USERWEB, m.Option(origin), ice.MSG_USERPOD, "").MergePodCmd("", m.ShortKey(),
|
||||
ctx.ACTION, mdb.DEV_CHOOSE, cli.BACK, back, cli.DAEMON, m.Option(ice.MSG_DAEMON),
|
||||
m.OptionSimple(name), mdb.TEXT, m.Cmdx("", DEV_REQUEST_TEXT),
|
||||
))
|
||||
}},
|
||||
mdb.DEV_CHOOSE: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.EchoInfoButton(kit.JoinWord(m.PrefixKey(), m.Cmdx(nfs.CAT, nfs.SRC_TEMPLATE+"web.token/saveto.html"), m.Option(cli.BACK)), mdb.DEV_RESPONSE)
|
||||
m.EchoInfoButton(kit.JoinWord(m.ShortKey(), m.Cmdx(nfs.CAT, nfs.SRC_TEMPLATE+"web.token/saveto.html"), m.Option(cli.BACK)), mdb.DEV_RESPONSE)
|
||||
}},
|
||||
mdb.DEV_RESPONSE: {Help: "确认", Hand: func(m *ice.Message, arg ...string) {
|
||||
if !m.WarnNotAllow(m.Option(ice.MSG_METHOD) != http.MethodPost) {
|
||||
m.ProcessReplace(m.ParseLink(m.Option(cli.BACK)).MergePodCmd("", m.PrefixKey(), ctx.ACTION, mdb.DEV_CONFIRM, m.OptionSimple(cli.DAEMON),
|
||||
m.ProcessReplace(m.ParseLink(m.Option(cli.BACK)).MergePodCmd("", m.ShortKey(), ctx.ACTION, mdb.DEV_CONFIRM, m.OptionSimple(cli.DAEMON),
|
||||
m.OptionSimple(name), TOKEN, m.Cmdx(TOKEN, mdb.CREATE, mdb.TYPE, m.CommandKey(), mdb.NAME, m.Option(ice.MSG_USERNAME), m.OptionSimple(mdb.TEXT))))
|
||||
}
|
||||
}},
|
||||
mdb.DEV_CONFIRM: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.EchoInfoButton(kit.JoinWord(m.PrefixKey(), m.Cmdx(nfs.CAT, nfs.SRC_TEMPLATE+"web.token/savefrom.html"), m.Option(name)), mdb.DEV_CREATE)
|
||||
m.EchoInfoButton(kit.JoinWord(m.ShortKey(), m.Cmdx(nfs.CAT, nfs.SRC_TEMPLATE+"web.token/savefrom.html"), m.Option(name)), mdb.DEV_CREATE)
|
||||
}},
|
||||
mdb.DEV_CREATE: {Help: "创建", Hand: func(m *ice.Message, arg ...string) {
|
||||
if !m.WarnNotAllow(m.Option(ice.MSG_METHOD) != http.MethodPost) {
|
||||
|
@ -125,7 +125,7 @@ func FavorPreview(m *ice.Message, arg ...string) {
|
||||
if m.Option(web.SPACE) == "" {
|
||||
msg = mdb.HashSelects(m.Spawn(), m.Option(mdb.HASH))
|
||||
} else {
|
||||
msg = m.Cmd(web.SPACE, m.Option(web.SPACE), m.PrefixKey(), m.Option(mdb.HASH))
|
||||
msg = m.Cmd(web.SPACE, m.Option(web.SPACE), m.ShortKey(), m.Option(mdb.HASH))
|
||||
}
|
||||
index, args := msg.Append(mdb.TYPE), kit.Split(msg.Append(mdb.TEXT))
|
||||
switch msg.Append(mdb.TYPE) {
|
||||
|
@ -19,20 +19,20 @@ func init() {
|
||||
}
|
||||
}},
|
||||
mdb.INSERT: {Name: "insert name space index* args", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(mdb.INSERT, m.PrefixKey(), kit.KeyHash(m.Option(mdb.ZONE)), mdb.HASH, m.OptionSimple(mdb.Config(m, mdb.FIELDS)))
|
||||
m.Cmdy(mdb.INSERT, m.ShortKey(), kit.KeyHash(m.Option(mdb.ZONE)), mdb.HASH, m.OptionSimple(mdb.Config(m, mdb.FIELDS)))
|
||||
}},
|
||||
mdb.DELETE: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(mdb.DELETE, m.PrefixKey(), kit.KeyHash(m.Option(mdb.ZONE)), mdb.HASH, m.OptionSimple(mdb.HASH))
|
||||
m.Cmdy(mdb.DELETE, m.ShortKey(), kit.KeyHash(m.Option(mdb.ZONE)), mdb.HASH, m.OptionSimple(mdb.HASH))
|
||||
}},
|
||||
mdb.MODIFY: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(mdb.MODIFY, m.PrefixKey(), kit.KeyHash(m.Option(mdb.ZONE)), mdb.HASH, m.OptionSimple(mdb.HASH), arg)
|
||||
m.Cmdy(mdb.MODIFY, m.ShortKey(), kit.KeyHash(m.Option(mdb.ZONE)), mdb.HASH, m.OptionSimple(mdb.HASH), arg)
|
||||
}},
|
||||
}, mdb.ExportHashAction(mdb.SHORT, mdb.ZONE, mdb.FIELD, "time,zone", mdb.FIELDS, "time,hash,name,space,index,args,prev,from,status")), Hand: func(m *ice.Message, arg ...string) {
|
||||
if arg = kit.Slice(arg, 0, 2); len(arg) == 0 || arg[0] == "" {
|
||||
mdb.HashSelect(m).Option(ice.MSG_ACTION, "")
|
||||
} else {
|
||||
m.Fields(len(arg)-1, mdb.Config(m, mdb.FIELDS), mdb.DETAIL)
|
||||
m.Cmdy(mdb.SELECT, m.PrefixKey(), kit.KeyHash(arg[0]), mdb.HASH, arg[1:])
|
||||
m.Cmdy(mdb.SELECT, m.ShortKey(), kit.KeyHash(arg[0]), mdb.HASH, arg[1:])
|
||||
m.PushAction(mdb.PLUGIN, mdb.DELETE)
|
||||
}
|
||||
m.Display("")
|
||||
|
@ -62,7 +62,7 @@ func init() {
|
||||
kit.If(m.Option(mdb.TYPE) == web.LINK, func() { m.PushButton(kit.Dict(m.CommandKey(), "网页")) })
|
||||
}},
|
||||
FAVOR_ACTION: {Hand: func(m *ice.Message, arg ...string) {
|
||||
kit.If(m.Option(mdb.TYPE) == web.LINK, func() { ctx.ProcessField(m, m.PrefixKey(), m.Option(mdb.TEXT)) })
|
||||
kit.If(m.Option(mdb.TYPE) == web.LINK, func() { ctx.ProcessField(m, m.ShortKey(), m.Option(mdb.TEXT)) })
|
||||
}},
|
||||
}, FavorAction(), mdb.HashAction(mdb.SHORT, web.LINK, mdb.FIELD, "time,hash,type,name,link")), Hand: func(m *ice.Message, arg ...string) {
|
||||
list := []string{m.MergePodCmd("", web.PORTAL), m.MergePodCmd("", web.ADMIN)}
|
||||
|
@ -37,7 +37,7 @@ func init() {
|
||||
kit.If(m.Option(mdb.TYPE) == LOCATION, func() { m.PushButton(kit.Dict(LOCATION, "地图")) })
|
||||
}},
|
||||
chat.FAVOR_ACTION: {Hand: func(m *ice.Message, arg ...string) {
|
||||
kit.If(m.Option(mdb.TYPE) == LOCATION, func() { ctx.ProcessField(m, m.PrefixKey(), []string{m.Option(mdb.TEXT)}, arg...) })
|
||||
kit.If(m.Option(mdb.TYPE) == LOCATION, func() { ctx.ProcessField(m, m.ShortKey(), []string{m.Option(mdb.TEXT)}, arg...) })
|
||||
}},
|
||||
}, chat.FavorAction(), mdb.ExportHashAction(web.VENDOR, AMAP, mdb.FIELD, "time,hash,type,name,text,longitude,latitude,extra")), Hand: func(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 || arg[0] != ctx.ACTION {
|
||||
|
@ -31,7 +31,7 @@ fieldset.macos.desktop>div.output>div.desktop>div.item img { object-fit:contain;
|
||||
fieldset.macos.desktop>div.output>div.desktop>div.item>div.name { font-size:var(--code-font-size); width:var(--desktop-icon-size); overflow:hidden; }
|
||||
fieldset.macos.desktop>div.output>div.desktop>fieldset { border-radius:var(--plugin-radius); position:absolute; }
|
||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.select { z-index:9; }
|
||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.item.button { border-radius:var(--plugin-radius); box-shadow:var(--box-shadow); padding:8px; height:23px; width:23px; scale:0.7; position:absolute; top:10px; right:var(--plugin-padding); cursor:pointer; }
|
||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.item.button { border-radius:var(--plugin-radius); box-shadow:var(--box-shadow); padding:8px; height:23px; width:23px; scale:0.7; position:absolute; top:15px; right:var(--plugin-padding); cursor:pointer; }
|
||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.item.button:not(:hover)>span { display:none; }
|
||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>legend { padding:0 var(--input-padding); margin:var(--button-margin); box-shadow:none; }
|
||||
body.mobile fieldset.macos.desktop>div.output>div.desktop>fieldset>legend { float:none; }
|
||||
|
@ -149,7 +149,7 @@ func (s Client) OAuthURL(m *ice.Message) string {
|
||||
return kit.MergeURL2(m.Option(web.DOMAIN), m.Option(OAUTH_URL), RESPONSE_TYPE, CODE, m.OptionSimple(CLIENT_ID), REDIRECT_URI, s.RedirectURI(m), m.OptionSimple(SCOPE), STATE, m.Option(mdb.HASH))
|
||||
}
|
||||
func (s Client) RedirectURI(m *ice.Message) string {
|
||||
return strings.Split(m.MergeLink(web.ChatCmdPath(m.Message, m.PrefixKey(), ctx.ACTION, aaa.LOGIN)), web.QS)[0]
|
||||
return strings.Split(m.MergeLink(web.ChatCmdPath(m.Message, m.ShortKey(), ctx.ACTION, aaa.LOGIN)), web.QS)[0]
|
||||
}
|
||||
|
||||
func (s Client) Get(m *ice.Message, hash, api string, arg ...string) ice.Any {
|
||||
|
@ -26,7 +26,7 @@ func _river_list(m *ice.Message) {
|
||||
return
|
||||
}
|
||||
}
|
||||
m.Cmd(mdb.SELECT, m.PrefixKey(), "", mdb.HASH, ice.OptionFields(mdb.HASH, mdb.NAME, mdb.ICON, "main"), func(value ice.Maps) {
|
||||
m.Cmd(mdb.SELECT, m.ShortKey(), "", mdb.HASH, ice.OptionFields(mdb.HASH, mdb.NAME, mdb.ICON, "main"), func(value ice.Maps) {
|
||||
kit.If(_river_right(m, value[mdb.HASH]), func() { m.PushRecord(value, mdb.HASH, mdb.NAME, mdb.ICON, "main") })
|
||||
})
|
||||
m.Sort(mdb.NAME)
|
||||
|
@ -111,7 +111,7 @@ func init() {
|
||||
}},
|
||||
}, web.DreamTablesAction(), ctx.ConfAction(cli.ENV, kit.Dict(GOPRIVATE, "shylinux.com,github.com", GOPROXY, "https://goproxy.cn,direct", CGO_ENABLED, "0"))), Hand: func(m *ice.Message, arg ...string) {
|
||||
main, file, goos, arch := _compile_target(m, arg...)
|
||||
defer web.ToastProcess(m, file)(file)
|
||||
defer web.ToastProcess(m, file)()
|
||||
env := kit.Simple(cli.PATH, cli.BinPath(), cli.HOME, kit.Select(kit.Path(""), kit.Env(cli.HOME)), mdb.Configv(m, cli.ENV), m.Optionv(cli.ENV), cli.GOOS, goos, cli.GOARCH, arch)
|
||||
kit.If(runtime.GOOS == cli.WINDOWS, func() { env = append(env, GOPATH, kit.HomePath(GO), GOCACHE, kit.HomePath("go/go-build")) })
|
||||
m.Options(cli.CMD_ENV, env).Cmd(AUTOGEN, VERSION)
|
||||
|
@ -146,7 +146,7 @@ func PlugAction(arg ...ice.Any) ice.Actions {
|
||||
}
|
||||
}
|
||||
kit.For([]string{mdb.PLUGIN, mdb.RENDER, mdb.ENGINE}, func(cmd string) {
|
||||
m.Cmd(cmd, mdb.CREATE, m.CommandKey(), m.PrefixKey())
|
||||
m.Cmd(cmd, mdb.CREATE, m.CommandKey(), m.ShortKey())
|
||||
})
|
||||
LoadPlug(m, m.CommandKey())
|
||||
}},
|
||||
|
@ -60,8 +60,8 @@ func init() {
|
||||
m.Cmdy(nfs.DIR, dir, "time,size,path,hash").Push(web.ORIGIN, kit.MergeURL2(web.SpideOrigin(m, ice.DEV_IP), uri))
|
||||
})
|
||||
if web.ToastSuccess(m); m.Option(ice.EXIT) == ice.TRUE {
|
||||
defer m.GoSleep(cli.TIME_30s, func() { m.Cmd("", cli.RESTART) })
|
||||
web.Toast(m, cli.RESTART)
|
||||
m.GoSleep("30ms", func() { m.Cmd("", cli.RESTART) })
|
||||
}
|
||||
}},
|
||||
}})
|
||||
|
@ -101,6 +101,16 @@ func init() {
|
||||
m.Cmdy(m.Option(ctx.ACTION), mdb.INPUTS, arg)
|
||||
default:
|
||||
switch arg[0] {
|
||||
case ice.CMD:
|
||||
m.OptionFields(ctx.INDEX)
|
||||
m.Cmd(ctx.COMMAND, mdb.SEARCH, ctx.COMMAND).Table(func(value ice.Maps) {
|
||||
kit.If(strings.HasPrefix(value[ctx.INDEX], kit.Select("", arg, 1)), func() { m.Push(arg[0], strings.TrimPrefix(value[ctx.INDEX], arg[1]+".")) })
|
||||
})
|
||||
case ctx.INDEX:
|
||||
m.OptionFields(ctx.INDEX)
|
||||
m.Cmd(ctx.COMMAND, mdb.SEARCH, ctx.COMMAND).Table(func(value ice.Maps) {
|
||||
kit.If(strings.HasPrefix(value[ctx.INDEX], kit.Select("", arg, 1)), func() { m.Push(arg[0], value[ctx.INDEX]) })
|
||||
})
|
||||
case nfs.PATH:
|
||||
p := kit.Select(nfs.PWD, arg, 1)
|
||||
m.Cmdy(nfs.DIR, p, nfs.DIR_CLI_FIELDS)
|
||||
@ -205,7 +215,7 @@ func init() {
|
||||
kit.If(m.Option(mdb.TYPE) == nfs.FILE, func() { m.PushButton(kit.Dict(m.CommandKey(), "源码")) })
|
||||
}},
|
||||
chat.FAVOR_ACTION: {Hand: func(m *ice.Message, arg ...string) {
|
||||
kit.If(m.Option(mdb.TYPE) == nfs.FILE, func() { ctx.ProcessField(m, m.PrefixKey(), nfs.SplitPath(m, m.Option(mdb.TEXT))) })
|
||||
kit.If(m.Option(mdb.TYPE) == nfs.FILE, func() { ctx.ProcessField(m, m.ShortKey(), nfs.SplitPath(m, m.Option(mdb.TEXT))) })
|
||||
}},
|
||||
}, ctx.ConfAction(ctx.TOOLS, "xterm,compile,runtime"), chat.FavorAction(), web.DreamTablesAction("编程")), Hand: func(m *ice.Message, arg ...string) {
|
||||
if m.Cmdy(INNER, arg); arg[0] != ctx.ACTION {
|
||||
@ -236,7 +246,7 @@ func init() {
|
||||
ice.AddMergeAction(func(c *ice.Context, key string, cmd *ice.Command, sub string, action *ice.Action) ice.Handler {
|
||||
switch sub {
|
||||
case TEMPLATE, COMPLETE, NAVIGATE:
|
||||
return func(m *ice.Message, arg ...string) { m.Cmd(sub, mdb.CREATE, key, m.PrefixKey()) }
|
||||
return func(m *ice.Message, arg ...string) { m.Cmd(sub, mdb.CREATE, key, m.ShortKey()) }
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ func init() {
|
||||
}},
|
||||
chat.FAVOR_ACTION: {Hand: func(m *ice.Message, arg ...string) {
|
||||
kit.If(m.Option(mdb.TYPE) == SHELL, func() {
|
||||
ctx.ProcessField(m, m.PrefixKey(), m.Cmdx("", mdb.CREATE, mdb.TYPE, m.Option(mdb.TEXT), mdb.NAME, m.Option(mdb.NAME), mdb.TEXT, ""))
|
||||
ctx.ProcessField(m, m.ShortKey(), m.Cmdx("", mdb.CREATE, mdb.TYPE, m.Option(mdb.TEXT), mdb.NAME, m.Option(mdb.NAME), mdb.TEXT, ""))
|
||||
})
|
||||
}},
|
||||
web.DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) {
|
||||
|
@ -22,22 +22,22 @@ func init() {
|
||||
ice.CTX_TRANS, kit.Dict(html.INPUT, kit.Dict(AREA, "面积(平方公里)", POPULATION, "人口(万人)", GDP, "产值(亿元)")),
|
||||
), Actions: ice.MergeActions(ice.Actions{
|
||||
GDP: {Help: "产值", Hand: func(m *ice.Message, arg ...string) {
|
||||
ctx.ProcessField(m, m.PrefixKey(), func() {
|
||||
ctx.ProcessField(m, m.ShortKey(), func() {
|
||||
m.Push(ctx.DISPLAY, "/plugin/story/china.js?title=全国产值分布(亿元)&field=gdp&style=float")
|
||||
}, arg...)
|
||||
}},
|
||||
POPULATION: {Help: "人口", Hand: func(m *ice.Message, arg ...string) {
|
||||
ctx.ProcessField(m, m.PrefixKey(), func() {
|
||||
ctx.ProcessField(m, m.ShortKey(), func() {
|
||||
m.Push(ctx.DISPLAY, "/plugin/story/china.js?title=全国人口分布(万人)&field=population&style=float")
|
||||
}, arg...)
|
||||
}},
|
||||
AREA: {Help: "土地", Hand: func(m *ice.Message, arg ...string) {
|
||||
ctx.ProcessField(m, m.PrefixKey(), func() {
|
||||
ctx.ProcessField(m, m.ShortKey(), func() {
|
||||
m.Push(ctx.DISPLAY, "/plugin/story/china.js?title=全国土地分布(平方公里)&field=area&style=float")
|
||||
}, arg...)
|
||||
}},
|
||||
CITY: {Help: "本地", Hand: func(m *ice.Message, arg ...string) {
|
||||
ctx.ProcessField(m, m.PrefixKey(), func() {
|
||||
ctx.ProcessField(m, m.ShortKey(), func() {
|
||||
m.Push(ctx.DISPLAY, "/plugin/story/china.js?title=深圳资源分布&field=area&style=float&path=深圳市")
|
||||
}, arg...)
|
||||
}},
|
||||
|
@ -28,15 +28,15 @@ func _sub_amount(m *ice.Message, arg []string) {
|
||||
func _asset_check(m *ice.Message, account string) {
|
||||
var amount float64
|
||||
m.OptionCB(mdb.SELECT, func(key string, value ice.Map) { amount += kit.Float(kit.Value(value, AMOUNT)) })
|
||||
m.Cmd(mdb.SELECT, m.PrefixKey(), "", mdb.ZONE, account, ice.OptionFields(mdb.ZoneField(m)))
|
||||
m.Cmd(mdb.MODIFY, m.PrefixKey(), "", mdb.HASH, ACCOUNT, account, AMOUNT, amount)
|
||||
m.Cmd(mdb.SELECT, m.ShortKey(), "", mdb.ZONE, account, ice.OptionFields(mdb.ZoneField(m)))
|
||||
m.Cmd(mdb.MODIFY, m.ShortKey(), "", mdb.HASH, ACCOUNT, account, AMOUNT, amount)
|
||||
}
|
||||
func _asset_insert(m *ice.Message, account string, arg ...string) {
|
||||
m.Cmd(mdb.INSERT, m.PrefixKey(), "", mdb.HASH, ACCOUNT, account)
|
||||
m.Cmd(mdb.INSERT, m.PrefixKey(), "", mdb.ZONE, account, arg)
|
||||
amount := kit.Float(m.Cmdv(mdb.SELECT, m.PrefixKey(), "", mdb.HASH, ACCOUNT, account, AMOUNT))
|
||||
m.Cmd(mdb.INSERT, m.ShortKey(), "", mdb.HASH, ACCOUNT, account)
|
||||
m.Cmd(mdb.INSERT, m.ShortKey(), "", mdb.ZONE, account, arg)
|
||||
amount := kit.Float(m.Cmdv(mdb.SELECT, m.ShortKey(), "", mdb.HASH, ACCOUNT, account, AMOUNT))
|
||||
amount += kit.Float(_sub_value(m, AMOUNT, arg...))
|
||||
m.Cmd(mdb.MODIFY, m.PrefixKey(), "", mdb.HASH, ACCOUNT, account, AMOUNT, amount)
|
||||
m.Cmd(mdb.MODIFY, m.ShortKey(), "", mdb.HASH, ACCOUNT, account, AMOUNT, amount)
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -66,7 +66,7 @@ func init() {
|
||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TODO, mdb.INPUTS, arg) }},
|
||||
mdb.PLUGIN: {Name: "plugin extra.index extra.args", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(TASK, mdb.MODIFY, arg) }},
|
||||
ctx.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
||||
if m.RenameOption(TASK_POD, ice.POD); ctx.PodCmd(m, m.PrefixKey(), ctx.RUN, arg) {
|
||||
if m.RenameOption(TASK_POD, ice.POD); ctx.PodCmd(m, m.ShortKey(), ctx.RUN, arg) {
|
||||
return
|
||||
} else if cmd := m.CmdAppend(TASK, kit.Slice(arg, 0, 2), ctx.INDEX); cmd != "" {
|
||||
m.Cmdy(cmd, arg[2:])
|
||||
|
@ -15,7 +15,7 @@ func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
DRAW: {Name: "draw path=src/main.svg pid list save actions", Help: "思维导图", Icon: "Grapher.png", Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(mdb.RENDER, mdb.CREATE, mdb.Config(m, lex.REGEXP), m.PrefixKey())
|
||||
m.Cmd(mdb.RENDER, mdb.CREATE, mdb.Config(m, lex.REGEXP), m.ShortKey())
|
||||
}},
|
||||
mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) {
|
||||
defer m.Echo("<!DOCTYPE html><html><body>").Echo("</body></html>")
|
||||
|
@ -41,7 +41,7 @@ func _wiki_list(m *ice.Message, arg ...string) bool {
|
||||
m.Copy(m.Cmd(nfs.DIR, kit.Slice(arg, 0, 1), kit.Dict(nfs.DIR_TYPE, nfs.CAT, nfs.DIR_REG, mdb.Config(m, lex.REGEXP))).SortStr(nfs.PATH))
|
||||
return true
|
||||
} else {
|
||||
m.Display(m.FileURI(nfs.Relative(m, ctx.GetCmdFile(m, m.PrefixKey()))))
|
||||
m.Display(m.FileURI(nfs.Relative(m, ctx.GetCmdFile(m, m.ShortKey()))))
|
||||
// ctx.DisplayLocal(m, path.Join(kit.PathName(2), kit.Keys(kit.FileName(2), nfs.JS)))
|
||||
return false
|
||||
}
|
||||
|
2
exec.go
2
exec.go
@ -199,7 +199,7 @@ func (c *Context) _command(m *Message, cmd *Command, key string, arg ...string)
|
||||
if m._cmd, m._key = cmd, key; cmd == nil {
|
||||
return m
|
||||
}
|
||||
if m.value(MSG_DETAIL, kit.Simple(m.PrefixKey(), arg)...); cmd.Actions != nil {
|
||||
if m.value(MSG_DETAIL, kit.Simple(m.ShortKey(), arg)...); cmd.Actions != nil {
|
||||
if len(arg) > 1 && arg[0] == ACTION {
|
||||
if h, ok := cmd.Actions[arg[1]]; ok {
|
||||
return c._action(m, cmd, key, arg[1], h, arg[2:]...)
|
||||
|
@ -511,7 +511,7 @@ func init() {
|
||||
if nfs.Exists(m, path.Join(m.Option(nfs.PATH), _GIT)) {
|
||||
return
|
||||
}
|
||||
defer web.ToastProcess(m)()
|
||||
defer web.ToastProcess(m, CLONE, m.Option(mdb.NAME))()
|
||||
for _, dev := range []string{"dev_ip", ice.DEV, ice.SHY} {
|
||||
p := m.Option(REMOTE)
|
||||
kit.If(!kit.HasPrefix(p, nfs.PS, web.HTTP), func() { p = m.Cmdv(web.SPIDE, dev, web.CLIENT_ORIGIN) + web.X(p) })
|
||||
|
@ -50,7 +50,7 @@ const ACCESS = "access"
|
||||
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
ACCESS: {Help: "认证", Role: aaa.VOID, Meta: Meta(), Actions: ice.MergeActions(ice.Actions{
|
||||
ACCESS: {Help: "认证", Meta: Meta(), Actions: ice.MergeActions(ice.Actions{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(web.SPIDE, mdb.CREATE, WX, mdb.Config(m, tcp.SERVER), "", "usr/icons/wechat.png")
|
||||
}},
|
||||
|
@ -25,7 +25,7 @@ func (m *Message) OptionDefault(arg ...string) string {
|
||||
}
|
||||
func (m *Message) OptionSimple(key ...string) (res []string) {
|
||||
kit.If(len(key) == 0, func() {
|
||||
key = kit.Filters(kit.Split(kit.Select("type,name,text", m.Conf(m.PrefixKey(), kit.Keym(FIELD)))), TIME, HASH)
|
||||
key = kit.Filters(kit.Split(kit.Select("type,name,text", m.Conf(m.ShortKey(), kit.Keym(FIELD)))), TIME, HASH)
|
||||
})
|
||||
kit.For(kit.Filters(kit.Split(kit.Join(key)), ""), func(k string) { res = append(res, k, m.Option(k)) })
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user