forked from x/icebergs
add some
This commit is contained in:
parent
712fe28952
commit
42b45ba0b7
@ -180,7 +180,7 @@ const RUNTIME = "runtime"
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
RUNTIME: {Name: "runtime info=bootinfo,ifconfig,diskinfo,hostinfo,userinfo,bootinfo,role,api,cli,cmd,mod,env,path,chain auto upgrade reboot stash lock", Icon: "Infomation.png", Help: "运行环境", Actions: ice.MergeActions(ice.Actions{
|
RUNTIME: {Name: "runtime info=bootinfo,ifconfig,diskinfo,hostinfo,userinfo,bootinfo,role,api,cli,cmd,mod,env,path,chain auto upgrade reboot lock", Icon: "Infomation.png", Help: "运行环境", Actions: ice.MergeActions(ice.Actions{
|
||||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { _runtime_init(m); aaa.White(m, ice.LICENSE) }},
|
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { _runtime_init(m); aaa.White(m, ice.LICENSE) }},
|
||||||
IFCONFIG: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(tcp.HOST) }},
|
IFCONFIG: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(tcp.HOST) }},
|
||||||
DISKINFO: {Hand: func(m *ice.Message, arg ...string) { _runtime_diskinfo(m) }},
|
DISKINFO: {Hand: func(m *ice.Message, arg ...string) { _runtime_diskinfo(m) }},
|
||||||
@ -245,11 +245,6 @@ func init() {
|
|||||||
REBOOT: {Help: "重启", Icon: "bi bi-bootstrap-reboot", Hand: func(m *ice.Message, arg ...string) {
|
REBOOT: {Help: "重启", Icon: "bi bi-bootstrap-reboot", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Go(func() { m.Sleep30ms(ice.EXIT, 1) })
|
m.Go(func() { m.Sleep30ms(ice.EXIT, 1) })
|
||||||
}},
|
}},
|
||||||
STASH: {Help: "清空", Icon: "bi bi-trash", Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
m.Cmd(SYSTEM, "git", STASH)
|
|
||||||
m.Cmd(SYSTEM, "git", "checkout", ".")
|
|
||||||
m.Go(func() { m.Sleep30ms(ice.QUIT, 1) })
|
|
||||||
}},
|
|
||||||
"lock": {Help: "锁屏", Icon: "bi bi-file-lock", Hand: func(m *ice.Message, arg ...string) {
|
"lock": {Help: "锁屏", Icon: "bi bi-file-lock", Hand: func(m *ice.Message, arg ...string) {
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case DARWIN:
|
case DARWIN:
|
||||||
|
@ -310,8 +310,8 @@ func init() {
|
|||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
cli.BUILD: {Name: "build name", Hand: func(m *ice.Message, arg ...string) {
|
cli.BUILD: {Name: "build name", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Option(ice.MSG_TITLE, kit.Keys(m.Option(ice.MSG_USERPOD0), m.Option(ice.MSG_USERPOD), m.CommandKey(), m.ActionKey()))
|
||||||
compile := cli.SystemFind(m, "go") != ""
|
compile := cli.SystemFind(m, "go") != ""
|
||||||
m.Option(ice.MSG_TITLE, kit.Keys(m.Option(ice.MSG_USERPOD), m.CommandKey(), m.ActionKey()))
|
|
||||||
m.Cmd("", FOR_FLOW, m.Option(mdb.NAME), kit.JoinWord(cli.SH, ice.ETC_MISS_SH), func(p string) bool {
|
m.Cmd("", FOR_FLOW, m.Option(mdb.NAME), kit.JoinWord(cli.SH, ice.ETC_MISS_SH), func(p string) bool {
|
||||||
if compile && nfs.Exists(m, path.Join(p, ice.SRC_MAIN_GO)) {
|
if compile && nfs.Exists(m, path.Join(p, ice.SRC_MAIN_GO)) {
|
||||||
return false
|
return false
|
||||||
@ -323,7 +323,7 @@ func init() {
|
|||||||
kit.If(m.Option(mdb.NAME) == "", func() { m.Sleep3s().Cmdy(ROUTE, cli.BUILD).ProcessInner() })
|
kit.If(m.Option(mdb.NAME) == "", func() { m.Sleep3s().Cmdy(ROUTE, cli.BUILD).ProcessInner() })
|
||||||
}},
|
}},
|
||||||
PUBLISH: {Name: "publish name", Help: "发布", Icon: "bi bi-send-check", Hand: func(m *ice.Message, arg ...string) {
|
PUBLISH: {Name: "publish name", Help: "发布", Icon: "bi bi-send-check", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Option(ice.MSG_TITLE, kit.Keys(m.Option(ice.MSG_USERPOD), m.CommandKey(), m.ActionKey()))
|
m.Option(ice.MSG_TITLE, kit.Keys(m.Option(ice.MSG_USERPOD0), m.Option(ice.MSG_USERPOD), m.CommandKey(), m.ActionKey()))
|
||||||
defer ToastProcess(m)()
|
defer ToastProcess(m)()
|
||||||
list := []string{cli.LINUX, cli.DARWIN, cli.WINDOWS}
|
list := []string{cli.LINUX, cli.DARWIN, cli.WINDOWS}
|
||||||
msg := m.Spawn(ice.Maps{ice.MSG_DAEMON: ""})
|
msg := m.Spawn(ice.Maps{ice.MSG_DAEMON: ""})
|
||||||
|
@ -205,7 +205,10 @@ func _space_send(m *ice.Message, name string, arg ...string) (h string) {
|
|||||||
if target := kit.Split(name, nfs.PT, nfs.PT); !mdb.HashSelectDetail(m, target[0], func(value ice.Map) {
|
if target := kit.Split(name, nfs.PT, nfs.PT); !mdb.HashSelectDetail(m, target[0], func(value ice.Map) {
|
||||||
if c, ok := value[mdb.TARGET].(*websocket.Conn); !m.WarnNotValid(!ok, mdb.TARGET) {
|
if c, ok := value[mdb.TARGET].(*websocket.Conn); !m.WarnNotValid(!ok, mdb.TARGET) {
|
||||||
kit.If(kit.Format(value[mdb.TYPE]) == MASTER, func() {
|
kit.If(kit.Format(value[mdb.TYPE]) == MASTER, func() {
|
||||||
m.Options(ice.MSG_USERWEB, value[mdb.TEXT], ice.MSG_USERPOD, "", ice.MSG_USERHOST, "")
|
m.Options(ice.MSG_USERWEB, value[mdb.TEXT],
|
||||||
|
ice.MSG_USERPOD, "",
|
||||||
|
ice.MSG_USERPOD0, name,
|
||||||
|
ice.MSG_USERHOST, "")
|
||||||
})
|
})
|
||||||
kit.For([]string{ice.MSG_USERROLE, ice.LOG_TRACEID}, func(k string) { m.Optionv(k, m.Optionv(k)) })
|
kit.For([]string{ice.MSG_USERROLE, ice.LOG_TRACEID}, func(k string) { m.Optionv(k, m.Optionv(k)) })
|
||||||
kit.For(m.Optionv(ice.MSG_OPTS), func(k string) { m.Optionv(k, m.Optionv(k)) })
|
kit.For(m.Optionv(ice.MSG_OPTS), func(k string) { m.Optionv(k, m.Optionv(k)) })
|
||||||
|
1
conf.go
1
conf.go
@ -210,6 +210,7 @@ const ( // MSG
|
|||||||
MSG_USERUA = "user.ua"
|
MSG_USERUA = "user.ua"
|
||||||
MSG_USERWEB = "user.web"
|
MSG_USERWEB = "user.web"
|
||||||
MSG_USERPOD = "user.pod"
|
MSG_USERPOD = "user.pod"
|
||||||
|
MSG_USERPOD0 = "user.pod0"
|
||||||
MSG_USERHOST = "user.host"
|
MSG_USERHOST = "user.host"
|
||||||
MSG_USERADDR = "user.addr"
|
MSG_USERADDR = "user.addr"
|
||||||
MSG_USERDATA = "user.data"
|
MSG_USERDATA = "user.data"
|
||||||
|
@ -23,6 +23,8 @@ const (
|
|||||||
DIFF = "diff"
|
DIFF = "diff"
|
||||||
INSTEADOF = "insteadof"
|
INSTEADOF = "insteadof"
|
||||||
OAUTH = "oauth"
|
OAUTH = "oauth"
|
||||||
|
STASH = "stash"
|
||||||
|
CHECKOUT = "checkout"
|
||||||
)
|
)
|
||||||
|
|
||||||
const STATUS = "status"
|
const STATUS = "status"
|
||||||
@ -81,6 +83,11 @@ func init() {
|
|||||||
m.Cmd(CONFIGS, mdb.CREATE, "credential.helper", "store")
|
m.Cmd(CONFIGS, mdb.CREATE, "credential.helper", "store")
|
||||||
m.ProcessClose()
|
m.ProcessClose()
|
||||||
}},
|
}},
|
||||||
|
STASH: {Help: "清空", Icon: "bi bi-trash", Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmd(cli.SYSTEM, GIT, STASH)
|
||||||
|
m.Cmd(cli.SYSTEM, GIT, CHECKOUT, ".")
|
||||||
|
m.Go(func() { m.Sleep30ms(ice.QUIT, 1) })
|
||||||
|
}},
|
||||||
}, web.DevTokenAction(web.ORIGIN, web.ORIGIN), ctx.ConfAction(ctx.TOOLS, "xterm,compile"), Prefix(REPOS)), Hand: func(m *ice.Message, arg ...string) {
|
}, web.DevTokenAction(web.ORIGIN, web.ORIGIN), ctx.ConfAction(ctx.TOOLS, "xterm,compile"), Prefix(REPOS)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) > 0 && arg[0] == ctx.ACTION {
|
if len(arg) > 0 && arg[0] == ctx.ACTION {
|
||||||
m.Cmdy(REPOS, arg)
|
m.Cmdy(REPOS, arg)
|
||||||
@ -90,7 +97,7 @@ func init() {
|
|||||||
m.EchoInfoButton(nfs.Template(m, "init.html"), INIT)
|
m.EchoInfoButton(nfs.Template(m, "init.html"), 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, mdb.DEV_REQUEST, ctx.CONFIG)
|
m.Cmdy(REPOS, STATUS).Action(PULL, PUSH, INSTEADOF, mdb.DEV_REQUEST, ctx.CONFIG, STASH)
|
||||||
kit.If(!m.IsCliUA(), func() { m.Cmdy(code.PUBLISH, ice.CONTEXTS, ice.DEV) })
|
kit.If(!m.IsCliUA(), func() { m.Cmdy(code.PUBLISH, ice.CONTEXTS, ice.DEV) })
|
||||||
ctx.Toolkit(m)
|
ctx.Toolkit(m)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user