forked from x/icebergs
add some
This commit is contained in:
parent
0f8a77af25
commit
0eac777f6f
@ -174,12 +174,11 @@ func RenderPodCmd(m *ice.Message, pod, cmd string, arg ...ice.Any) {
|
||||
func RenderCmd(m *ice.Message, cmd string, arg ...ice.Any) { RenderPodCmd(m, "", cmd, arg...) }
|
||||
|
||||
func RenderVersion(m *ice.Message) string {
|
||||
if ice.Info.Make.Hash == "" {
|
||||
return ""
|
||||
}
|
||||
ls := []string{ice.Info.Make.Version, ice.Info.Make.Forword, ice.Info.Make.Hash[:6]}
|
||||
if m.Option(log.DEBUG) == ice.TRUE || m.R != nil && strings.Contains(m.R.URL.RawQuery, "debug=true") {
|
||||
ls = append(ls, kit.Format("%d", time.Now().Unix()-kit.Time(ice.Info.Make.When)/int64(time.Second)))
|
||||
ls := []string{ice.Info.Make.Versions()}
|
||||
if strings.Contains(ice.Info.Make.Domain, "debug=true") {
|
||||
if m.Option(log.DEBUG) == ice.TRUE || m.R != nil && strings.Contains(m.R.URL.RawQuery, "debug=true") {
|
||||
ls = append(ls, kit.Format("%d", time.Now().Unix()-kit.Time(ice.Info.Make.When)/int64(time.Second)))
|
||||
}
|
||||
}
|
||||
return "?" + kit.JoinQuery(kit.Simple(kit.Dict("_v", strings.Join(ls, "-"), ice.POD, m.Option(ice.MSG_USERPOD)))...)
|
||||
}
|
||||
|
@ -143,11 +143,11 @@ func init() {
|
||||
if kit.Contains(m.Option(ice.MSG_USERUA), "MicroMessenger") {
|
||||
if m.Option(ice.MSG_USERNAME) == "" && m.Option("code") == "" && mdb.Config(m, "oauth") != "" {
|
||||
m.ProcessOpen(mdb.Config(m, "oauth"))
|
||||
return
|
||||
// return
|
||||
}
|
||||
}
|
||||
kit.If(m.Option(ice.MSG_USERPOD), func(p string) {
|
||||
m.Cmdy(web.SPACE, p, m.PrefixKey(), ice.Maps{ice.MSG_USERPOD: ""})
|
||||
kit.If(kit.Select(m.Option(ice.POD), m.Option(ice.MSG_USERPOD)), func(p string) {
|
||||
m.Cmdy(web.SPACE, p, m.PrefixKey(), ice.Maps{ice.MSG_USERPOD: "", ice.POD: ""})
|
||||
}, func() {
|
||||
m.Option(ice.MSG_NODETYPE, ice.Info.NodeType)
|
||||
m.Option(ice.MSG_NODENAME, ice.Info.NodeName)
|
||||
|
2
init.go
2
init.go
@ -64,7 +64,7 @@ var Index = &Context{Name: ICE, Help: "冰山模块", Commands: Commands{
|
||||
m.Cmd(EXPORT, IMPORT)
|
||||
m.Cmd(SOURCE, ETC_INIT_SHY)
|
||||
loadImportant(m)
|
||||
// m.Cmd(CTX_OPEN)
|
||||
m.Cmd(CTX_OPEN)
|
||||
}},
|
||||
QUIT: {Hand: func(m *Message, arg ...string) {
|
||||
m.GoSleep300ms(func() { os.Exit(kit.Int(kit.Select("0", arg, 0))) })
|
||||
|
Loading…
x
Reference in New Issue
Block a user