mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 17:44:05 +08:00
opt some
This commit is contained in:
parent
7379a4e87a
commit
53b2efc9fd
@ -47,6 +47,9 @@ func MergeURL2(m Message, url string, arg ...ice.Any) string {
|
|||||||
return kit.MergeURL2(m.Option(ice.MSG_USERWEB), url, arg...)
|
return kit.MergeURL2(m.Option(ice.MSG_USERWEB), url, arg...)
|
||||||
}
|
}
|
||||||
func MergeLink(m Message, url string, arg ...ice.Any) string {
|
func MergeLink(m Message, url string, arg ...ice.Any) string {
|
||||||
|
if m.Option(log.DEBUG) == ice.TRUE {
|
||||||
|
arg = append(arg, log.DEBUG, ice.TRUE)
|
||||||
|
}
|
||||||
return kit.MergeURL(strings.Split(MergeURL2(m, url), mdb.QS)[0], arg...)
|
return kit.MergeURL(strings.Split(MergeURL2(m, url), mdb.QS)[0], arg...)
|
||||||
}
|
}
|
||||||
func ProcessPodCmd(m *ice.Message, pod, cmd string, arg ...ice.Any) {
|
func ProcessPodCmd(m *ice.Message, pod, cmd string, arg ...ice.Any) {
|
||||||
|
@ -43,15 +43,15 @@ func init() {
|
|||||||
), Hand: func(m *ice.Message, arg ...string) {
|
), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if _cmd_file(m, arg...) {
|
if _cmd_file(m, arg...) {
|
||||||
return
|
return
|
||||||
}
|
} else if len(arg[0]) == 0 || arg[0] == "" {
|
||||||
if len(arg[0]) == 0 || arg[0] == "" {
|
|
||||||
return
|
return
|
||||||
}
|
} else if m.IsCliUA() {
|
||||||
if m.IsCliUA() {
|
|
||||||
m.Cmdy(arg, m.Optionv(ice.ARG)).RenderResult()
|
m.Cmdy(arg, m.Optionv(ice.ARG)).RenderResult()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if m.Cmdy(ctx.COMMAND, arg[0]); m.Length() > 0 {
|
if arg[0] == "web.chat.portal" {
|
||||||
|
web.RenderMain(m)
|
||||||
|
} else if m.Cmdy(ctx.COMMAND, arg[0]); m.Length() > 0 {
|
||||||
web.RenderCmd(m, m.Append(ctx.INDEX), arg[1:])
|
web.RenderCmd(m, m.Append(ctx.INDEX), arg[1:])
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
@ -71,14 +71,31 @@ func init() {
|
|||||||
m.Cmd("", mdb.CREATE, kit.Dict(web.LINK, m.MergePod(m.Option(mdb.NAME))))
|
m.Cmd("", mdb.CREATE, kit.Dict(web.LINK, m.MergePod(m.Option(mdb.NAME))))
|
||||||
}},
|
}},
|
||||||
}, mdb.HashAction(mdb.SHORT, web.LINK, mdb.FIELD, "time,hash,type,name,link"), FavorAction()), Hand: func(m *ice.Message, arg ...string) {
|
}, mdb.HashAction(mdb.SHORT, web.LINK, mdb.FIELD, "time,hash,type,name,link"), FavorAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
list := []string{m.MergePodCmd("", "web.wiki.portal")}
|
||||||
|
if m.Option(ice.MSG_USERPOD) == "" {
|
||||||
|
list = append(list, web.MergeLink(m, "/chat/portal/"))
|
||||||
|
} else {
|
||||||
|
list = append(list, web.MergeLink(m, "/chat/portal/", ice.POD, m.Option(ice.MSG_USERPOD)))
|
||||||
|
}
|
||||||
if mdb.HashSelect(m, arg...); len(arg) == 0 {
|
if mdb.HashSelect(m, arg...); len(arg) == 0 {
|
||||||
|
for _, link := range list {
|
||||||
|
m.Push("", kit.Dict(mdb.TIME, m.Time(), mdb.HASH, kit.Hashs(link), mdb.TYPE, web.LINK, web.LINK, link))
|
||||||
|
}
|
||||||
if m.Length() == 0 {
|
if m.Length() == 0 {
|
||||||
m.Action(mdb.CREATE)
|
m.Action(mdb.CREATE)
|
||||||
} else {
|
} else {
|
||||||
m.PushAction(web.OPEN, mdb.REMOVE).Action(mdb.CREATE, mdb.PRUNES)
|
m.PushAction(web.OPEN, mdb.REMOVE).Action(mdb.CREATE, mdb.PRUNES)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
kit.If(m.Length() == 0, func() { m.Append(web.LINK, arg[0]) })
|
kit.If(m.Length() == 0, func() {
|
||||||
|
for _, link := range list {
|
||||||
|
if arg[0] == kit.Hashs(link) {
|
||||||
|
m.Append(web.LINK, link)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.Append(web.LINK, arg[0])
|
||||||
|
})
|
||||||
m.Action(web.FULL, web.OPEN).StatusTime(m.AppendSimple(web.LINK))
|
m.Action(web.FULL, web.OPEN).StatusTime(m.AppendSimple(web.LINK))
|
||||||
ctx.DisplayLocal(m, "")
|
ctx.DisplayLocal(m, "")
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ const BENCH = "bench"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
BENCH: {Name: "bench zone id auto insert", Help: "性能压测", Actions: ice.MergeActions(ice.Actions{
|
BENCH: {Name: "bench zone id auto insert", Help: "压测", Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.INSERT: {Name: "insert zone*=demo type*=http,redis name=demo text*='http://localhost:9020/chat/cmd/run/web.chat.favor' nconn=10 nreqs=100"},
|
mdb.INSERT: {Name: "insert zone*=demo type*=http,redis name=demo text*='http://localhost:9020/chat/cmd/run/web.chat.favor' nconn=10 nreqs=100"},
|
||||||
ice.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
ice.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
switch m.Option(mdb.TYPE) {
|
switch m.Option(mdb.TYPE) {
|
||||||
|
@ -88,7 +88,7 @@ func init() {
|
|||||||
m.Logs(nfs.SAVE, nfs.TARGET, file, nfs.SOURCE, main)
|
m.Logs(nfs.SAVE, nfs.TARGET, file, nfs.SOURCE, main)
|
||||||
m.Cmdy(nfs.DIR, file, "time,path,size,hash,link")
|
m.Cmdy(nfs.DIR, file, "time,path,size,hash,link")
|
||||||
if !m.IsCliUA() {
|
if !m.IsCliUA() {
|
||||||
kit.If(strings.Contains(file, ice.ICE), func() { m.Cmdy(PUBLISH, ice.CONTEXTS) })
|
kit.If(strings.Contains(file, ice.ICE), func() { m.Cmdy(PUBLISH, ice.CONTEXTS, "app") })
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
@ -29,7 +29,7 @@ func init() {
|
|||||||
http.DefaultServeMux.ServeHTTP(m.W, m.R)
|
http.DefaultServeMux.ServeHTTP(m.W, m.R)
|
||||||
}}})
|
}}})
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
PPROF: {Name: "pprof zone id auto", Help: "性能分析", Actions: ice.MergeActions(ice.Actions{
|
PPROF: {Name: "pprof zone id auto", Help: "优化", Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
switch arg[0] {
|
switch arg[0] {
|
||||||
case BINNARY:
|
case BINNARY:
|
||||||
|
@ -49,9 +49,10 @@ func _publish_contexts(m *ice.Message, arg ...string) {
|
|||||||
m.Option(web.DOMAIN, m.Cmd(web.SPIDE, ice.SHY).Append(web.CLIENT_ORIGIN))
|
m.Option(web.DOMAIN, m.Cmd(web.SPIDE, ice.SHY).Append(web.CLIENT_ORIGIN))
|
||||||
case ice.CORE:
|
case ice.CORE:
|
||||||
m.Option(web.DOMAIN, m.Cmd(web.SPIDE, ice.DEV).Append(web.CLIENT_ORIGIN))
|
m.Option(web.DOMAIN, m.Cmd(web.SPIDE, ice.DEV).Append(web.CLIENT_ORIGIN))
|
||||||
case nfs.SOURCE:
|
case nfs.SOURCE, "dev":
|
||||||
m.Options(nfs.SOURCE, ice.Info.Make.Remote)
|
m.Options(nfs.SOURCE, ice.Info.Make.Remote)
|
||||||
case nfs.BINARY:
|
case nfs.BINARY, "app":
|
||||||
|
|
||||||
case "wget", "curl":
|
case "wget", "curl":
|
||||||
case "manual":
|
case "manual":
|
||||||
m.Options(nfs.BINARY, "ice.linux.amd64")
|
m.Options(nfs.BINARY, "ice.linux.amd64")
|
||||||
@ -117,7 +118,7 @@ func init() {
|
|||||||
nfs.TRASH: {Hand: func(m *ice.Message, arg ...string) { nfs.Trash(m, path.Join(ice.USR_PUBLISH, m.Option(nfs.PATH))) }},
|
nfs.TRASH: {Hand: func(m *ice.Message, arg ...string) { nfs.Trash(m, path.Join(ice.USR_PUBLISH, m.Option(nfs.PATH))) }},
|
||||||
}, ctx.ConfAction(mdb.FIELD, nfs.PATH), aaa.RoleAction()), Hand: func(m *ice.Message, arg ...string) {
|
}, ctx.ConfAction(mdb.FIELD, nfs.PATH), aaa.RoleAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.Option(nfs.DIR_ROOT, ice.USR_PUBLISH); len(arg) == 0 {
|
if m.Option(nfs.DIR_ROOT, ice.USR_PUBLISH); len(arg) == 0 {
|
||||||
_publish_list(m).Cmdy("", ice.CONTEXTS)
|
_publish_list(m).Cmdy("", ice.CONTEXTS, "app")
|
||||||
} else {
|
} else {
|
||||||
m.Cmdy(nfs.DIR, arg[0], "time,path,size,hash,link,action", ice.OptionFields(mdb.DETAIL))
|
m.Cmdy(nfs.DIR, arg[0], "time,path,size,hash,link,action", ice.OptionFields(mdb.DETAIL))
|
||||||
web.PushImages(m, web.P(PUBLISH, arg[0]))
|
web.PushImages(m, web.P(PUBLISH, arg[0]))
|
||||||
|
@ -197,7 +197,7 @@ func init() {
|
|||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
mdb.HashSelect(m, arg...).Table(func(value ice.Maps) {
|
mdb.HashSelect(m, arg...).Table(func(value ice.Maps) {
|
||||||
m.PushScript(kit.Format("git clone %s", tcp.PublishLocalhost(m, kit.Split(web.MergeURL2(m, "/x/"+value[REPOS]+".git"), mdb.QS)[0])))
|
m.PushScript(kit.Format("git clone %s", tcp.PublishLocalhost(m, kit.Split(web.MergeURL2(m, "/x/"+value[REPOS]+".git"), mdb.QS)[0])))
|
||||||
}).Sort(REPOS).Echo(strings.ReplaceAll(m.Cmdx("web.code.publish", ice.CONTEXTS), "app username", "dev username"))
|
}).Sort(REPOS).Echo(strings.ReplaceAll(m.Cmdx("web.code.publish", ice.CONTEXTS, "dev"), "app username", "dev username"))
|
||||||
m.Table(func(value ice.Maps) {
|
m.Table(func(value ice.Maps) {
|
||||||
m.Push(nfs.SIZE, kit.Split(m.Cmdx(cli.SYSTEM, "du", "-sh", path.Join(ice.USR_LOCAL_REPOS, value[REPOS])))[0])
|
m.Push(nfs.SIZE, kit.Split(m.Cmdx(cli.SYSTEM, "du", "-sh", path.Join(ice.USR_LOCAL_REPOS, value[REPOS])))[0])
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user