forked from x/icebergs
opt some
This commit is contained in:
parent
53b2efc9fd
commit
6886c29355
@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
PROCINFO: {Name: "procinfo PID auto filter:text docker monitor terminal", Help: "进程列表", Actions: ice.MergeActions(ice.Actions{
|
PROCINFO: {Name: "procinfo PID auto filter:text monitor docker", Help: "进程列表", Actions: ice.MergeActions(ice.Actions{
|
||||||
PROCKILL: {Help: "结束进程", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(gdb.SIGNAL, gdb.STOP, m.Option("PID")).ProcessRefresh() }},
|
PROCKILL: {Help: "结束进程", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(gdb.SIGNAL, gdb.STOP, m.Option("PID")).ProcessRefresh() }},
|
||||||
"terminal": {Help: "终端", Hand: func(m *ice.Message, arg ...string) { Opens(m, "Terminal.app") }},
|
"terminal": {Help: "终端", Hand: func(m *ice.Message, arg ...string) { Opens(m, "Terminal.app") }},
|
||||||
"monitor": {Help: "监控", Hand: func(m *ice.Message, arg ...string) { Opens(m, "Activity Monitor.app") }},
|
"monitor": {Help: "监控", Hand: func(m *ice.Message, arg ...string) { Opens(m, "Activity Monitor.app") }},
|
||||||
|
@ -43,7 +43,7 @@ func _dream_list(m *ice.Message) *ice.Message {
|
|||||||
stats[ice.INIT]++
|
stats[ice.INIT]++
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return m.Sort("status,type,name", ice.STR, ice.STR, ice.STR_R).StatusTimeCount(stats)
|
return m.Sort("status,type,name", ice.STR, ice.STR, ice.STR).StatusTimeCount(stats)
|
||||||
}
|
}
|
||||||
func _dream_start(m *ice.Message, name string) {
|
func _dream_start(m *ice.Message, name string) {
|
||||||
if m.Warn(name == "", ice.ErrNotValid, mdb.NAME) {
|
if m.Warn(name == "", ice.ErrNotValid, mdb.NAME) {
|
||||||
|
@ -26,7 +26,8 @@ func _space_qrcode(m *ice.Message, dev string) {
|
|||||||
ssh.PrintQRCode(m, m.Cmdv(SPACE, dev, cli.PWD, mdb.LINK))
|
ssh.PrintQRCode(m, m.Cmdv(SPACE, dev, cli.PWD, mdb.LINK))
|
||||||
}
|
}
|
||||||
func _space_dial(m *ice.Message, dev, name string, arg ...string) {
|
func _space_dial(m *ice.Message, dev, name string, arg ...string) {
|
||||||
u := kit.ParseURL(kit.MergeURL2(strings.Replace(m.Cmdv(SPIDE, dev, CLIENT_ORIGIN), HTTP, "ws", 1), PP(SPACE), mdb.TYPE, ice.Info.NodeType, mdb.NAME, name, arg))
|
u := kit.ParseURL(kit.MergeURL2(strings.Replace(m.Cmdv(SPIDE, dev, CLIENT_ORIGIN), HTTP, "ws", 1), PP(SPACE), mdb.TYPE, ice.Info.NodeType, mdb.NAME, name,
|
||||||
|
nfs.MODULE, ice.Info.Make.Module, nfs.VERSION, ice.Info.Make.Versions(), arg))
|
||||||
args := kit.SimpleKV("type,name,host,port", u.Scheme, dev, u.Hostname(), u.Port())
|
args := kit.SimpleKV("type,name,host,port", u.Scheme, dev, u.Hostname(), u.Port())
|
||||||
gdb.Go(m, func() {
|
gdb.Go(m, func() {
|
||||||
once := sync.Once{}
|
once := sync.Once{}
|
||||||
@ -54,7 +55,7 @@ func _space_fork(m *ice.Message) {
|
|||||||
name = kit.ReplaceAll(addr, "[", "_", "]", "_", nfs.DF, "_", nfs.PT, "_")
|
name = kit.ReplaceAll(addr, "[", "_", "]", "_", nfs.DF, "_", nfs.PT, "_")
|
||||||
text = kit.Select(addr, m.Option(mdb.NAME), m.Option(mdb.TEXT))
|
text = kit.Select(addr, m.Option(mdb.NAME), m.Option(mdb.TEXT))
|
||||||
}
|
}
|
||||||
args := kit.Simple(mdb.TYPE, kit.Select(WORKER, m.Option(mdb.TYPE)), mdb.NAME, name, mdb.TEXT, text, m.OptionSimple(cli.DAEMON, ice.MSG_USERUA))
|
args := kit.Simple(mdb.TYPE, kit.Select(WORKER, m.Option(mdb.TYPE)), mdb.NAME, name, mdb.TEXT, text, m.OptionSimple(cli.DAEMON, ice.MSG_USERUA), m.OptionSimple(nfs.MODULE, nfs.VERSION))
|
||||||
if c, e := websocket.Upgrade(m.W, m.R); !m.Warn(e) {
|
if c, e := websocket.Upgrade(m.W, m.R); !m.Warn(e) {
|
||||||
gdb.Go(m, func() {
|
gdb.Go(m, func() {
|
||||||
defer mdb.HashCreateDeferRemove(m, args, kit.Dict(mdb.TARGET, c))()
|
defer mdb.HashCreateDeferRemove(m, args, kit.Dict(mdb.TARGET, c))()
|
||||||
@ -212,13 +213,16 @@ func init() {
|
|||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
nfs.PS: {Hand: func(m *ice.Message, arg ...string) { _space_fork(m) }},
|
nfs.PS: {Hand: func(m *ice.Message, arg ...string) { _space_fork(m) }},
|
||||||
}, mdb.HashAction(mdb.SHORT, mdb.NAME, mdb.FIELD, "time,type,name,text", ctx.ACTION, OPEN, REDIAL, kit.Dict("a", 3000, "b", 1000, "c", 1000)), mdb.ClearOnExitHashAction()), Hand: func(m *ice.Message, arg ...string) {
|
}, mdb.HashAction(mdb.SHORT, mdb.NAME, mdb.FIELD, "time,type,name,text,module,version", ctx.ACTION, OPEN, REDIAL, kit.Dict("a", 3000, "b", 1000, "c", 1000)), mdb.ClearOnExitHashAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) < 2 {
|
if len(arg) < 2 {
|
||||||
|
defer m.StatusTimeCount()
|
||||||
mdb.HashSelect(m.Spawn(), arg...).Sort("").Table(func(index int, value ice.Maps, field []string) {
|
mdb.HashSelect(m.Spawn(), arg...).Sort("").Table(func(index int, value ice.Maps, field []string) {
|
||||||
if kit.IsIn(value[mdb.TYPE], CHROME, "send") {
|
if kit.IsIn(value[mdb.TYPE], CHROME, "send") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
m.Push("", value, kit.Split("time,type,name,text,status"))
|
if m.Push("", value, kit.Split(mdb.Config(m, mdb.FIELD))); len(arg) > 0 && arg[0] != "" {
|
||||||
|
m.Push(mdb.STATUS, value[mdb.STATUS])
|
||||||
|
}
|
||||||
if kit.IsIn(value[mdb.TYPE], SERVER, WORKER) {
|
if kit.IsIn(value[mdb.TYPE], SERVER, WORKER) {
|
||||||
m.Push(mdb.LINK, tcp.PublishLocalhost(m, m.MergePod(value[mdb.NAME])))
|
m.Push(mdb.LINK, tcp.PublishLocalhost(m, m.MergePod(value[mdb.NAME])))
|
||||||
} else {
|
} else {
|
||||||
@ -226,7 +230,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
m.PushButton(kit.Select(OPEN, LOGIN, value[mdb.TYPE] == LOGIN), mdb.REMOVE)
|
m.PushButton(kit.Select(OPEN, LOGIN, value[mdb.TYPE] == LOGIN), mdb.REMOVE)
|
||||||
})
|
})
|
||||||
kit.If(!m.IsCliUA(), func() { m.Cmdy("web.code.publish", "contexts", "misc") })
|
kit.If(!m.IsCliUA(), func() { m.Cmdy("web.code.publish", "contexts", ice.APP) })
|
||||||
kit.If(len(arg) == 1, func() { m.EchoIFrame(m.MergePod(arg[0])) })
|
kit.If(len(arg) == 1, func() { m.EchoIFrame(m.MergePod(arg[0])) })
|
||||||
} else {
|
} else {
|
||||||
_space_send(m, arg[0], kit.Simple(kit.Split(arg[1]), arg[2:])...)
|
_space_send(m, arg[0], kit.Simple(kit.Split(arg[1]), arg[2:])...)
|
||||||
|
1
conf.go
1
conf.go
@ -36,6 +36,7 @@ const (
|
|||||||
SHY = "shy"
|
SHY = "shy"
|
||||||
COM = "com"
|
COM = "com"
|
||||||
DEV = "dev"
|
DEV = "dev"
|
||||||
|
APP = "app"
|
||||||
OPS = "ops"
|
OPS = "ops"
|
||||||
ICE = "ice"
|
ICE = "ice"
|
||||||
CAN = "can"
|
CAN = "can"
|
||||||
|
@ -2,6 +2,7 @@ package chat
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/cli"
|
||||||
"shylinux.com/x/icebergs/base/ctx"
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
@ -12,7 +13,7 @@ const IFRAME = "iframe"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
IFRAME: {Name: "iframe hash auto", Help: "浏览器", Actions: ice.MergeActions(ice.Actions{
|
IFRAME: {Name: "iframe hash auto safari", Help: "浏览器", Actions: ice.MergeActions(ice.Actions{
|
||||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.Cmd("").Length() == 0 {
|
if m.Cmd("").Length() == 0 {
|
||||||
m.Cmd(web.SPIDE, ice.OptionFields(web.CLIENT_NAME, web.CLIENT_ORIGIN), func(value ice.Maps) {
|
m.Cmd(web.SPIDE, ice.OptionFields(web.CLIENT_NAME, web.CLIENT_ORIGIN), func(value ice.Maps) {
|
||||||
@ -32,6 +33,7 @@ func init() {
|
|||||||
case mdb.LINK:
|
case mdb.LINK:
|
||||||
m.Push(arg[0], m.Option(ice.MSG_USERWEB))
|
m.Push(arg[0], m.Option(ice.MSG_USERWEB))
|
||||||
m.Push(arg[0], "http://localhost:20000")
|
m.Push(arg[0], "http://localhost:20000")
|
||||||
|
m.Push(arg[0], "http://localhost:20001")
|
||||||
m.Copy(m.Cmd(web.SPIDE).CutTo(web.CLIENT_URL, arg[0]))
|
m.Copy(m.Cmd(web.SPIDE).CutTo(web.CLIENT_URL, arg[0]))
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
@ -70,6 +72,13 @@ func init() {
|
|||||||
web.DREAM_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
web.DREAM_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
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))))
|
||||||
}},
|
}},
|
||||||
|
"safari": {Help: "本机", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if h := kit.Select(m.Option(mdb.HASH), arg, 0); h == "" {
|
||||||
|
cli.Opens(m, "Safari.app")
|
||||||
|
} else {
|
||||||
|
cli.Opens(m, m.Cmd("", h).Append(mdb.LINK))
|
||||||
|
}
|
||||||
|
}},
|
||||||
}, 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")}
|
list := []string{m.MergePodCmd("", "web.wiki.portal")}
|
||||||
if m.Option(ice.MSG_USERPOD) == "" {
|
if m.Option(ice.MSG_USERPOD) == "" {
|
||||||
|
@ -33,12 +33,12 @@ fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.item:last
|
|||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.item:last-child { margin-right:80px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.item:last-child { margin-right:80px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>* { margin:10px 0px 10px 10px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>* { margin:10px 0px 10px 10px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.item.icons>span.icon { margin-top:10px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.item.icons>span.icon { margin-top:10px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.item:last-child { margin-right:80px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.item:last-child { margin-right:120px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.wiki.feel>div.status { display:none; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.wiki.feel>div.status { display:none; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.vimer>div.status { display:none; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.vimer>div.status { display:none; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.xterm>div.status { display:none; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.xterm>div.status { display:none; }
|
||||||
fieldset.web.code.xterm>div.action>div.tabs:only-child { display:none; }
|
fieldset.web.code.xterm>div.action>div.tabs:only-child { display:none; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.compile>form.option>div.item:last-child { margin-right:80px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.compile>form.option>div.item:last-child { margin-right:120px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>div.status { display:none; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>div.status { display:none; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>form.option>div.item.hash>input { width:360px; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>form.option>div.item.hash>input { width:360px; }
|
||||||
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.status { display:none; }
|
fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.status { display:none; }
|
||||||
|
@ -57,8 +57,8 @@ func init() {
|
|||||||
}},
|
}},
|
||||||
}, mdb.ZoneAction(mdb.FIELDS, "time,zone,count,binnary,service,seconds", mdb.FIELD, "time,id,text,file", PPROF, kit.List(GO, "tool", PPROF))), Hand: func(m *ice.Message, arg ...string) {
|
}, mdb.ZoneAction(mdb.FIELDS, "time,zone,count,binnary,service,seconds", mdb.FIELD, "time,id,text,file", PPROF, kit.List(GO, "tool", PPROF))), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if mdb.ZoneSelect(m, arg...); len(arg) == 0 {
|
if mdb.ZoneSelect(m, arg...); len(arg) == 0 {
|
||||||
m.PushAction(cli.START, mdb.REMOVE).Action(mdb.CREATE)
|
|
||||||
m.EchoAnchor(web.MergeLink(m, "/debug/pprof/"))
|
m.EchoAnchor(web.MergeLink(m, "/debug/pprof/"))
|
||||||
|
m.PushAction(cli.START, mdb.REMOVE).Action(mdb.CREATE)
|
||||||
} else {
|
} else {
|
||||||
m.Table(func(value ice.Maps) { m.PushDownload(mdb.LINK, "pprof.pd.gz", value[nfs.FILE]).PushButton(web.SERVE) })
|
m.Table(func(value ice.Maps) { m.PushDownload(mdb.LINK, "pprof.pd.gz", value[nfs.FILE]).PushButton(web.SERVE) })
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,20 @@ func init() {
|
|||||||
ctx.PROCESS: {Hand: func(m *ice.Message, arg ...string) {
|
ctx.PROCESS: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
ctx.ProcessField(m, m.PrefixKey(), func() string { return m.Cmdx("", mdb.CREATE, arg) }, arg...)
|
ctx.ProcessField(m, m.PrefixKey(), func() string { return m.Cmdx("", mdb.CREATE, arg) }, arg...)
|
||||||
}},
|
}},
|
||||||
"terminal": {Help: "本机", Hand: func(m *ice.Message, arg ...string) { m.Cmd("cli.system", "opens", "Terminal.app") }},
|
"terminal": {Help: "本机", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if h := kit.Select(m.Option(mdb.HASH), arg, 0); h == "" {
|
||||||
|
cli.Opens(m, "Terminal.app")
|
||||||
|
} else {
|
||||||
|
msg := m.Cmd("", h)
|
||||||
|
m.Cmd(cli.SYSTEM, "osascript", "-e", kit.Format(`
|
||||||
|
tell application "Terminal"
|
||||||
|
do script "%s"
|
||||||
|
activate
|
||||||
|
end tell
|
||||||
|
`, msg.Append(mdb.TYPE)))
|
||||||
|
}
|
||||||
|
m.ProcessHold()
|
||||||
|
}},
|
||||||
}, ctx.CmdAction(), ctx.ProcessAction(), mdb.ImportantHashAction(mdb.FIELD, "time,hash,type,name,text,path,theme,daemon")), Hand: func(m *ice.Message, arg ...string) {
|
}, ctx.CmdAction(), ctx.ProcessAction(), mdb.ImportantHashAction(mdb.FIELD, "time,hash,type,name,text,path,theme,daemon")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if mdb.HashSelect(m, arg...); len(arg) == 0 {
|
if mdb.HashSelect(m, arg...); len(arg) == 0 {
|
||||||
if m.Length() == 0 {
|
if m.Length() == 0 {
|
||||||
|
13
info.go
13
info.go
@ -32,6 +32,19 @@ type MakeInfo struct {
|
|||||||
System string
|
System string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s MakeInfo) Versions() string {
|
||||||
|
if s.Hash == "" {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
if s.Version == "" {
|
||||||
|
return s.Hash[:6]
|
||||||
|
}
|
||||||
|
if kit.IsIn(s.Forword, "", "0") {
|
||||||
|
return s.Version
|
||||||
|
}
|
||||||
|
return kit.Format("%s-%s-%s", s.Version, s.Forword, s.Hash[:6])
|
||||||
|
}
|
||||||
|
|
||||||
var Info = struct {
|
var Info = struct {
|
||||||
Make MakeInfo
|
Make MakeInfo
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ func _repos_status(m *ice.Message, p string, repos *git.Repository) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m.Push(REPOS, p).Push(STATUS, "??").Push(nfs.FILE, value[nfs.PATH]).PushButton(ADD)
|
m.Push(REPOS, p).Push(STATUS, "??").Push(nfs.FILE, value[nfs.PATH]).PushButton(ADD, nfs.TRASH)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -529,7 +529,6 @@ func init() {
|
|||||||
if commit, err := repos.CommitObject(refer.Hash()); err == nil {
|
if commit, err := repos.CommitObject(refer.Hash()); err == nil {
|
||||||
_last := commit.Author.When.Format(ice.MOD_TIME)
|
_last := commit.Author.When.Format(ice.MOD_TIME)
|
||||||
kit.If(_last > last, func() { last = _last })
|
kit.If(_last > last, func() { last = _last })
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if _remote, err := repos.Remote(ORIGIN); err == nil && (remote == "" || remote == path.Base(kit.Path(""))) {
|
if _remote, err := repos.Remote(ORIGIN); err == nil && (remote == "" || remote == path.Base(kit.Path(""))) {
|
||||||
@ -638,9 +637,7 @@ func init() {
|
|||||||
code.INNER: {Hand: func(m *ice.Message, arg ...string) { _repos_inner(m, _repos_path, arg...) }},
|
code.INNER: {Hand: func(m *ice.Message, arg ...string) { _repos_inner(m, _repos_path, arg...) }},
|
||||||
}, aaa.RoleAction(REMOTE), mdb.ClearOnExitHashAction(), mdb.HashAction(mdb.SHORT, REPOS, mdb.FIELD, "time,repos,branch,version,comment,origin")), Hand: func(m *ice.Message, arg ...string) {
|
}, aaa.RoleAction(REMOTE), mdb.ClearOnExitHashAction(), mdb.HashAction(mdb.SHORT, REPOS, mdb.FIELD, "time,repos,branch,version,comment,origin")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
mdb.HashSelect(m, arg...).Sort(REPOS).Action(CLONE, PULL, PUSH, STATUS)
|
mdb.HashSelect(m, arg...).Sort(REPOS).PushAction(STATUS, mdb.REMOVE).Action(CLONE, PULL, PUSH, STATUS)
|
||||||
m.PushAction(STATUS, mdb.REMOVE)
|
|
||||||
m.Echo(strings.ReplaceAll(m.Cmdx(code.PUBLISH, ice.CONTEXTS), "app username", "dev username"))
|
|
||||||
} else if len(arg) == 1 {
|
} else if len(arg) == 1 {
|
||||||
_repos_branch(m, _repos_open(m, arg[0]))
|
_repos_branch(m, _repos_open(m, arg[0]))
|
||||||
} else if len(arg) == 2 {
|
} else if len(arg) == 2 {
|
||||||
|
@ -196,11 +196,9 @@ func init() {
|
|||||||
}, gdb.EventsAction(web.DREAM_INPUTS), mdb.HashAction(mdb.SHORT, REPOS, mdb.FIELD, "time,repos,branch,version,comment"), mdb.ClearOnExitHashAction()), Hand: func(m *ice.Message, arg ...string) {
|
}, gdb.EventsAction(web.DREAM_INPUTS), mdb.HashAction(mdb.SHORT, REPOS, mdb.FIELD, "time,repos,branch,version,comment"), mdb.ClearOnExitHashAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||||
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])))
|
|
||||||
}).Sort(REPOS).Echo(strings.ReplaceAll(m.Cmdx("web.code.publish", ice.CONTEXTS, "dev"), "app username", "dev username"))
|
|
||||||
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])
|
||||||
})
|
m.PushScript(kit.Format("git clone %s", tcp.PublishLocalhost(m, kit.Split(web.MergeURL2(m, "/x/"+value[REPOS]+".git"), mdb.QS)[0])))
|
||||||
|
}).Sort(REPOS).Cmdy("web.code.publish", ice.CONTEXTS, "dev")
|
||||||
} else if len(arg) == 1 {
|
} else if len(arg) == 1 {
|
||||||
_repos_branch(m, _repos_open(m, arg[0]))
|
_repos_branch(m, _repos_open(m, arg[0]))
|
||||||
m.EchoScript(tcp.PublishLocalhost(m, kit.Split(web.MergeURL2(m, "/x/"+arg[0]), mdb.QS)[0]))
|
m.EchoScript(tcp.PublishLocalhost(m, kit.Split(web.MergeURL2(m, "/x/"+arg[0]), mdb.QS)[0]))
|
||||||
|
@ -14,6 +14,7 @@ import (
|
|||||||
"shylinux.com/x/icebergs/base/nfs"
|
"shylinux.com/x/icebergs/base/nfs"
|
||||||
"shylinux.com/x/icebergs/base/tcp"
|
"shylinux.com/x/icebergs/base/tcp"
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
|
"shylinux.com/x/icebergs/core/code"
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -166,6 +167,7 @@ func init() {
|
|||||||
} else if len(arg) == 0 {
|
} else if len(arg) == 0 {
|
||||||
kit.If(config != nil, func() { m.Option(aaa.EMAIL, kit.Select(mdb.Config(m, aaa.EMAIL), config.User.Email)) })
|
kit.If(config != nil, func() { m.Option(aaa.EMAIL, kit.Select(mdb.Config(m, aaa.EMAIL), config.User.Email)) })
|
||||||
m.Cmdy(REPOS, STATUS).Action(PULL, PUSH, INSTEADOF, "oauth", CONFIGS, cli.RESTART)
|
m.Cmdy(REPOS, STATUS).Action(PULL, PUSH, INSTEADOF, "oauth", CONFIGS, cli.RESTART)
|
||||||
|
m.Cmdy(code.PUBLISH, ice.CONTEXTS, "dev")
|
||||||
} else {
|
} else {
|
||||||
m.Cmdy(REPOS, arg[0], MASTER, INDEX, m.Cmdv(REPOS, arg[0], MASTER, INDEX, nfs.FILE))
|
m.Cmdy(REPOS, arg[0], MASTER, INDEX, m.Cmdv(REPOS, arg[0], MASTER, INDEX, nfs.FILE))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user