forked from x/icebergs
add some
This commit is contained in:
parent
33d6bcc013
commit
4eea30cc6e
@ -24,7 +24,7 @@ func _broad_send(m *ice.Message, to_host, to_port string, host, port string, arg
|
|||||||
func _broad_serve(m *ice.Message) {
|
func _broad_serve(m *ice.Message) {
|
||||||
m.GoSleep300ms(func() {
|
m.GoSleep300ms(func() {
|
||||||
m.Cmd(tcp.HOST, func(value ice.Maps) {
|
m.Cmd(tcp.HOST, func(value ice.Maps) {
|
||||||
_broad_send(m, "", "", value[aaa.IP], m.Option(tcp.PORT), kit.Simple(gdb.EVENT, tcp.LISTEN, mdb.NAME, ice.Info.Hostname, mdb.TYPE, ice.Info.NodeType, mdb.TIME, m.Time(), cli.SimpleMake())...)
|
_broad_send(m, "", "", value[aaa.IP], m.Option(tcp.PORT), kit.Simple(gdb.EVENT, tcp.LISTEN, mdb.NAME, ice.Info.NodeName, mdb.TYPE, ice.Info.NodeType, mdb.TIME, m.Time(), cli.SimpleMake())...)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
m.Cmd(tcp.SERVER, tcp.LISTEN, mdb.TYPE, tcp.UDP4, mdb.NAME, logs.FileLine(1), m.OptionSimple(tcp.HOST, tcp.PORT), func(from *net.UDPAddr, buf []byte) {
|
m.Cmd(tcp.SERVER, tcp.LISTEN, mdb.TYPE, tcp.UDP4, mdb.NAME, logs.FileLine(1), m.OptionSimple(tcp.HOST, tcp.PORT), func(from *net.UDPAddr, buf []byte) {
|
||||||
@ -60,7 +60,7 @@ func init() {
|
|||||||
ADMIN: {Hand: func(m *ice.Message, arg ...string) { broadOpen(m) }},
|
ADMIN: {Hand: func(m *ice.Message, arg ...string) { broadOpen(m) }},
|
||||||
DREAM: {Hand: func(m *ice.Message, arg ...string) { broadOpen(m) }},
|
DREAM: {Hand: func(m *ice.Message, arg ...string) { broadOpen(m) }},
|
||||||
VIMER: {Hand: func(m *ice.Message, arg ...string) { broadOpen(m) }},
|
VIMER: {Hand: func(m *ice.Message, arg ...string) { broadOpen(m) }},
|
||||||
SPIDE: {Name: "spide name type=repos", Hand: func(m *ice.Message, arg ...string) {
|
SPIDE: {Name: "spide name type=repos", Icon: "bi bi-house-add", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmd(SPIDE, mdb.CREATE,
|
m.Cmd(SPIDE, mdb.CREATE,
|
||||||
m.OptionSimple(mdb.NAME), ORIGIN, "http://"+m.Option(mdb.NAME)+":"+m.Option(tcp.PORT))
|
m.OptionSimple(mdb.NAME), ORIGIN, "http://"+m.Option(mdb.NAME)+":"+m.Option(tcp.PORT))
|
||||||
}},
|
}},
|
||||||
|
@ -405,9 +405,6 @@ func init() {
|
|||||||
mdb.SHORT, mdb.NAME, mdb.FIELD, "time,name,icon,repos,binary,template,restart", ctx.TOOLS, kit.Simple(STORE, SPIDE, ROUTE),
|
mdb.SHORT, mdb.NAME, mdb.FIELD, "time,name,icon,repos,binary,template,restart", ctx.TOOLS, kit.Simple(STORE, SPIDE, ROUTE),
|
||||||
html.BUTTON, kit.JoinWord(PORTAL, ADMIN, DESKTOP, WIKI_WORD, STATUS, VIMER, XTERM, COMPILE),
|
html.BUTTON, kit.JoinWord(PORTAL, ADMIN, DESKTOP, WIKI_WORD, STATUS, VIMER, XTERM, COMPILE),
|
||||||
)), Hand: func(m *ice.Message, arg ...string) {
|
)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if ice.Info.NodeType == WORKER {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
_dream_list(m).RewriteAppend(func(value, key string, index int) string {
|
_dream_list(m).RewriteAppend(func(value, key string, index int) string {
|
||||||
if key == mdb.ICON {
|
if key == mdb.ICON {
|
||||||
@ -429,6 +426,9 @@ func init() {
|
|||||||
kit.If(stat[cli.START] == stat[WORKER], func() { delete(stat, cli.START) })
|
kit.If(stat[cli.START] == stat[WORKER], func() { delete(stat, cli.START) })
|
||||||
m.Sort("type,status,name", []string{aaa.LOGIN, WORKER, SERVER, MASTER}, []string{cli.START, cli.STOP, cli.BEGIN}, ice.STR_R).StatusTimeCount(stat)
|
m.Sort("type,status,name", []string{aaa.LOGIN, WORKER, SERVER, MASTER}, []string{cli.START, cli.STOP, cli.BEGIN}, ice.STR_R).StatusTimeCount(stat)
|
||||||
ctx.DisplayTableCard(m)
|
ctx.DisplayTableCard(m)
|
||||||
|
if ice.Info.NodeType == WORKER {
|
||||||
|
return
|
||||||
|
}
|
||||||
kit.If(cli.SystemFind(m, "go"), func() {
|
kit.If(cli.SystemFind(m, "go"), func() {
|
||||||
m.Action(html.FILTER, mdb.CREATE, STARTALL, STOPALL, cli.BUILD, PUBLISH)
|
m.Action(html.FILTER, mdb.CREATE, STARTALL, STOPALL, cli.BUILD, PUBLISH)
|
||||||
}, func() {
|
}, func() {
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
"regexp"
|
"regexp"
|
||||||
"runtime"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
@ -28,12 +27,12 @@ func _serve_address(m *ice.Message) string { return Domain(tcp.LOCALHOST, m.Opti
|
|||||||
func _serve_start(m *ice.Message) {
|
func _serve_start(m *ice.Message) {
|
||||||
kit.If(m.Option(aaa.USERNAME), func() { aaa.UserRoot(m, m.Option(aaa.USERNICK), m.Option(aaa.USERNAME)) })
|
kit.If(m.Option(aaa.USERNAME), func() { aaa.UserRoot(m, m.Option(aaa.USERNICK), m.Option(aaa.USERNAME)) })
|
||||||
kit.If(m.Option(tcp.PORT) == tcp.RANDOM, func() { m.Option(tcp.PORT, m.Cmdx(tcp.PORT, aaa.RIGHT)) })
|
kit.If(m.Option(tcp.PORT) == tcp.RANDOM, func() { m.Option(tcp.PORT, m.Cmdx(tcp.PORT, aaa.RIGHT)) })
|
||||||
kit.If(runtime.GOOS == cli.WINDOWS || m.Cmdx(cli.SYSTEM, "lsof", "-i", ":"+m.Option(tcp.PORT)) != "", func() {
|
|
||||||
m.Go(func() { m.Cmd(SPIDE, ice.OPS, _serve_address(m)+"/exit", ice.Maps{CLIENT_TIMEOUT: "30ms"}) }).Sleep300ms()
|
|
||||||
})
|
|
||||||
cli.NodeInfo(m, kit.Select(kit.Split(ice.Info.Hostname, ".")[0], m.Option(tcp.NODENAME)), SERVER)
|
cli.NodeInfo(m, kit.Select(kit.Split(ice.Info.Hostname, ".")[0], m.Option(tcp.NODENAME)), SERVER)
|
||||||
m.Start("", m.OptionSimple(tcp.HOST, tcp.PORT)...)
|
m.Go(func() {
|
||||||
|
m.Cmd(SPIDE, ice.OPS, _serve_address(m)+"/exit", ice.Maps{CLIENT_TIMEOUT: "30ms", ice.LOG_DISABLE: ice.TRUE})
|
||||||
|
}).Sleep300ms()
|
||||||
m.Cmd(nfs.SAVE, ice.VAR_LOG_ICE_PORT, m.Option(tcp.PORT))
|
m.Cmd(nfs.SAVE, ice.VAR_LOG_ICE_PORT, m.Option(tcp.PORT))
|
||||||
|
m.Start("", m.OptionSimple(tcp.HOST, tcp.PORT)...)
|
||||||
kit.For(kit.Split(m.Option(ice.DEV)), func(dev string) {
|
kit.For(kit.Split(m.Option(ice.DEV)), func(dev string) {
|
||||||
if m.Cmds(SPIDE, dev).Append(TOKEN) == "" {
|
if m.Cmds(SPIDE, dev).Append(TOKEN) == "" {
|
||||||
m.Sleep30ms(SPACE, tcp.DIAL, ice.DEV, dev, mdb.NAME, ice.Info.NodeName, m.OptionSimple(TOKEN))
|
m.Sleep30ms(SPACE, tcp.DIAL, ice.DEV, dev, mdb.NAME, ice.Info.NodeName, m.OptionSimple(TOKEN))
|
||||||
|
@ -322,7 +322,7 @@ func init() {
|
|||||||
m.Cmd("", mdb.CREATE, ice.SHY, kit.Select("https://shylinux.com", conf[cli.CTX_SHY]), nfs.REPOS)
|
m.Cmd("", mdb.CREATE, ice.SHY, kit.Select("https://shylinux.com", conf[cli.CTX_SHY]), nfs.REPOS)
|
||||||
m.Cmd("", mdb.CREATE, ice.DEV, dev, nfs.REPOS)
|
m.Cmd("", mdb.CREATE, ice.DEV, dev, nfs.REPOS)
|
||||||
m.Cmd("", mdb.CREATE, ice.DEV_IP, kit.Select(dev, os.Getenv("ctx_dev_ip")))
|
m.Cmd("", mdb.CREATE, ice.DEV_IP, kit.Select(dev, os.Getenv("ctx_dev_ip")))
|
||||||
m.Cmd("", mdb.CREATE, ice.OPS, kit.Select("http://localhost:9020", conf[cli.CTX_OPS]), nfs.REPOS)
|
m.Cmd("", mdb.CREATE, ice.OPS, kit.Select("http://localhost:9020", conf[cli.CTX_OPS]))
|
||||||
m.Cmd("", mdb.CREATE, ice.DEMO, kit.Select("http://localhost:20000", conf[cli.CTX_DEMO]))
|
m.Cmd("", mdb.CREATE, ice.DEMO, kit.Select("http://localhost:20000", conf[cli.CTX_DEMO]))
|
||||||
m.Cmd("", mdb.CREATE, ice.MAIL, kit.Select("https://mail.shylinux.com", conf[cli.CTX_MAIL]))
|
m.Cmd("", mdb.CREATE, ice.MAIL, kit.Select("https://mail.shylinux.com", conf[cli.CTX_MAIL]))
|
||||||
m.Cmd("", mdb.CREATE, nfs.REPOS, kit.Select("https://repos.shylinux.com", conf[cli.CTX_HUB]))
|
m.Cmd("", mdb.CREATE, nfs.REPOS, kit.Select("https://repos.shylinux.com", conf[cli.CTX_HUB]))
|
||||||
@ -374,7 +374,7 @@ func init() {
|
|||||||
PROXY: {Name: "proxy url size cache upload", Hand: func(m *ice.Message, arg ...string) {
|
PROXY: {Name: "proxy url size cache upload", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(SPIDE, ice.DEV, SPIDE_RAW, http.MethodPost, m.Option(URL), SPIDE_PART, arg[2:])
|
m.Cmdy(SPIDE, ice.DEV, SPIDE_RAW, http.MethodPost, m.Option(URL), SPIDE_PART, arg[2:])
|
||||||
}},
|
}},
|
||||||
"disconn": {Help: "断连", Hand: func(m *ice.Message, arg ...string) {
|
"disconn": {Help: "断连", Icon: "bi bi-person-x", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmd(SPACE, cli.CLOSE, kit.Dict(mdb.NAME, m.Option(CLIENT_NAME)))
|
m.Cmd(SPACE, cli.CLOSE, kit.Dict(mdb.NAME, m.Option(CLIENT_NAME)))
|
||||||
mdb.HashModify(m, mdb.NAME, m.Option(CLIENT_NAME), TOKEN, "")
|
mdb.HashModify(m, mdb.NAME, m.Option(CLIENT_NAME), TOKEN, "")
|
||||||
}},
|
}},
|
||||||
@ -388,12 +388,14 @@ func init() {
|
|||||||
list := m.CmdMap(SPACE, mdb.NAME)
|
list := m.CmdMap(SPACE, mdb.NAME)
|
||||||
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...).Sort("client.type,client.name", []string{nfs.REPOS, ""})
|
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...).Sort("client.type,client.name", []string{nfs.REPOS, ""})
|
||||||
m.Table(func(value ice.Maps) {
|
m.Table(func(value ice.Maps) {
|
||||||
|
if value[CLIENT_TYPE] == nfs.REPOS {
|
||||||
if _, ok := list[value[CLIENT_NAME]]; ok {
|
if _, ok := list[value[CLIENT_NAME]]; ok {
|
||||||
m.Push(mdb.STATUS, ONLINE)
|
m.Push(mdb.STATUS, ONLINE).PushButton("disconn", mdb.REMOVE)
|
||||||
m.PushButton("disconn", mdb.REMOVE)
|
|
||||||
} else {
|
} else {
|
||||||
m.Push(mdb.STATUS, "")
|
m.Push(mdb.STATUS, "").PushButton(mdb.DEV_REQUEST, mdb.REMOVE)
|
||||||
m.PushButton(mdb.DEV_REQUEST, mdb.REMOVE)
|
}
|
||||||
|
} else {
|
||||||
|
m.Push(mdb.STATUS, "").PushButton(mdb.REMOVE)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
kit.If(len(arg) > 0 && arg[0] != "", func() { m.Action(COOKIE, HEADER) })
|
kit.If(len(arg) > 0 && arg[0] != "", func() { m.Action(COOKIE, HEADER) })
|
||||||
|
@ -17,7 +17,7 @@ const STORE = "store"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
STORE: {Name: "store list", Help: "系统商店", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{
|
STORE: {Name: "store refresh", Help: "系统商店", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmds(SPIDE).Table(func(value ice.Maps) { kit.If(value[CLIENT_TYPE] == nfs.REPOS, func() { m.Push("", value, arg[0]) }) })
|
m.Cmds(SPIDE).Table(func(value ice.Maps) { kit.If(value[CLIENT_TYPE] == nfs.REPOS, func() { m.Push("", value, arg[0]) }) })
|
||||||
}},
|
}},
|
||||||
|
@ -13,6 +13,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
}), select && select.click()
|
}), select && select.click()
|
||||||
},
|
},
|
||||||
layout: function(can) { can.Action(html.FILTER) && can.onmotion.filter(can, can.Action(html.FILTER))
|
layout: function(can) { can.Action(html.FILTER) && can.onmotion.filter(can, can.Action(html.FILTER))
|
||||||
can.ui.layout(can.ConfHeight(), can.ConfWidth()), can.onlayout.expand(can, can.ui.content, 320)
|
can.ui.layout(can.ConfHeight(), can.ConfWidth()), can.onlayout.expand(can, can.ui.content)
|
||||||
|
// can.user.isMobile && can.page.style(can, can.ui.content, html.HEIGHT, "")
|
||||||
},
|
},
|
||||||
}, [""])
|
}, [""])
|
||||||
|
@ -119,6 +119,9 @@ func init() {
|
|||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}, web.ApiAction(), mdb.ImportantHashAction(mdb.SHORT, mdb.NAME, mdb.FIELD, "time,name,icons,type,link,order,space,index,args")), Hand: func(m *ice.Message, arg ...string) {
|
}, web.ApiAction(), mdb.ImportantHashAction(mdb.SHORT, mdb.NAME, mdb.FIELD, "time,name,icons,type,link,order,space,index,args")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if ice.Info.NodeType == web.WORKER {
|
||||||
|
return
|
||||||
|
}
|
||||||
kit.If(m.Option(ice.MSG_USERPOD), func(p string) { m.Option(ice.MSG_NODETYPE, m.Cmdx(web.SPACE, p, cli.RUNTIME, ice.MSG_NODETYPE)) })
|
kit.If(m.Option(ice.MSG_USERPOD), func(p string) { m.Option(ice.MSG_NODETYPE, m.Cmdx(web.SPACE, p, cli.RUNTIME, ice.MSG_NODETYPE)) })
|
||||||
m.Option("language.list", m.Cmd(nfs.DIR, nfs.TemplatePath(m, aaa.LANGUAGE)+nfs.PS, nfs.FILE).Appendv(nfs.FILE))
|
m.Option("language.list", m.Cmd(nfs.DIR, nfs.TemplatePath(m, aaa.LANGUAGE)+nfs.PS, nfs.FILE).Appendv(nfs.FILE))
|
||||||
m.Option("theme.list", m.Cmd(nfs.DIR, nfs.TemplatePath(m, aaa.THEME)+nfs.PS, nfs.FILE).Appendv(nfs.FILE))
|
m.Option("theme.list", m.Cmd(nfs.DIR, nfs.TemplatePath(m, aaa.THEME)+nfs.PS, nfs.FILE).Appendv(nfs.FILE))
|
||||||
|
@ -3,6 +3,6 @@ package misc
|
|||||||
import (
|
import (
|
||||||
// _ "shylinux.com/x/icebergs/misc/bash"
|
// _ "shylinux.com/x/icebergs/misc/bash"
|
||||||
_ "shylinux.com/x/icebergs/misc/git"
|
_ "shylinux.com/x/icebergs/misc/git"
|
||||||
_ "shylinux.com/x/icebergs/misc/tmux"
|
// _ "shylinux.com/x/icebergs/misc/tmux"
|
||||||
// _ "shylinux.com/x/icebergs/misc/vim"
|
// _ "shylinux.com/x/icebergs/misc/vim"
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user