mirror of
https://shylinux.com/x/icebergs
synced 2025-06-28 19:17:23 +08:00
opt some
This commit is contained in:
parent
dd920ee22c
commit
5227398cec
@ -34,6 +34,11 @@ func init() {
|
|||||||
if p := kit.Env(CTX_LOG); p != "" {
|
if p := kit.Env(CTX_LOG); p != "" {
|
||||||
m.Optionv(CMD_ERRPUT, p)
|
m.Optionv(CMD_ERRPUT, p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if p := m.Cmdx(nfs.CAT, m.Conf("gdb.signal", kit.Keym(nfs.PATH))); p != "" {
|
||||||
|
m.Cmd(SYSTEM, "kill", "-n", 3, p)
|
||||||
|
}
|
||||||
|
|
||||||
m.Cmdy(FOREVER, kit.Select(os.Args[0], nfs.PWD+ice.BIN_ICE_BIN, kit.FileExists(ice.BIN_ICE_BIN)),
|
m.Cmdy(FOREVER, kit.Select(os.Args[0], nfs.PWD+ice.BIN_ICE_BIN, kit.FileExists(ice.BIN_ICE_BIN)),
|
||||||
SERVE, START, ice.DEV, "", aaa.USERNAME, aaa.ROOT, aaa.PASSWORD, aaa.ROOT, arg)
|
SERVE, START, ice.DEV, "", aaa.USERNAME, aaa.ROOT, aaa.PASSWORD, aaa.ROOT, arg)
|
||||||
}},
|
}},
|
||||||
|
@ -45,6 +45,9 @@ func _spide_list(m *ice.Message, arg ...string) {
|
|||||||
// 缓存方式
|
// 缓存方式
|
||||||
cache, save := "", ""
|
cache, save := "", ""
|
||||||
switch arg[1] {
|
switch arg[1] {
|
||||||
|
case "url":
|
||||||
|
m.Echo("%v", kit.Value(value, "client.url"))
|
||||||
|
return
|
||||||
case SPIDE_RAW:
|
case SPIDE_RAW:
|
||||||
cache, arg = arg[1], arg[1:]
|
cache, arg = arg[1], arg[1:]
|
||||||
case SPIDE_MSG:
|
case SPIDE_MSG:
|
||||||
|
@ -19,31 +19,28 @@ func init() {
|
|||||||
ice.CTX_INIT: {Name: "_init", Help: "初始化", Hand: func(m *ice.Message, arg ...string) {
|
ice.CTX_INIT: {Name: "_init", Help: "初始化", Hand: func(m *ice.Message, arg ...string) {
|
||||||
}},
|
}},
|
||||||
}, ctx.CmdAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, ctx.CmdAction()), Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if kit.Select("", arg, 0) == "" {
|
|
||||||
m.RenderCmd(web.ROUTE)
|
|
||||||
return // 节点列表
|
|
||||||
}
|
|
||||||
if len(arg) == 1 {
|
|
||||||
if m.IsCliUA() {
|
if m.IsCliUA() {
|
||||||
m.Option(ice.MSG_USERNAME, "root")
|
m.Option(ice.MSG_USERNAME, "root")
|
||||||
m.Option(ice.MSG_USERROLE, "tech")
|
m.Option(ice.MSG_USERROLE, "root")
|
||||||
|
m.Option(ice.POD, kit.Select("", arg, 0))
|
||||||
m.Cmdy(web.SHARE_LOCAL, "bin/ice.bin")
|
m.Cmdy(web.SHARE_LOCAL, "bin/ice.bin")
|
||||||
return
|
return // 下载文件
|
||||||
}
|
}
|
||||||
if s := m.Cmdx(web.SPACE, arg[0], "web.chat.website", "show", "index.iml", "Header", "", "River", "", "Action", "", "Footer", ""); s != "" {
|
|
||||||
m.RenderResult(s)
|
if len(arg) == 0 || kit.Select("", arg, 0) == "" { // 节点列表
|
||||||
} else {
|
m.RenderCmd(web.ROUTE)
|
||||||
|
|
||||||
|
} else if len(arg) == 1 { // 节点首页
|
||||||
|
if m.RenderWebsite(arg[0], "index.iml", "Header", "", "River", "", "Action", "", "Footer", ""); m.Result() == "" {
|
||||||
m.RenderIndex(web.SERVE, ice.VOLCANOS)
|
m.RenderIndex(web.SERVE, ice.VOLCANOS)
|
||||||
}
|
}
|
||||||
return // 节点首页
|
|
||||||
}
|
} else if arg[1] == WEBSITE { // 节点网页
|
||||||
if arg[1] == WEBSITE {
|
m.RenderWebsite(arg[0], path.Join(arg[2:]...))
|
||||||
m.Cmdy(web.SPACE, arg[0], WEBSITE, ctx.ACTION, "show", path.Join(arg[2:]...))
|
|
||||||
m.RenderResult()
|
} else { // 节点命令
|
||||||
return
|
|
||||||
}
|
|
||||||
// 节点命令
|
|
||||||
m.Cmdy("/cmd/", path.Join(arg[2:]...))
|
m.Cmdy("/cmd/", path.Join(arg[2:]...))
|
||||||
|
}
|
||||||
}},
|
}},
|
||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,6 @@ func init() {
|
|||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
"show": {Hand: func(m *ice.Message, arg ...string) {
|
"show": {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Debug(m.FormatStack())
|
|
||||||
if res, ok := _website_parse(m, m.Cmdx(nfs.CAT, path.Join(SRC_WEBSITE, arg[0])), arg[1:]...); ok {
|
if res, ok := _website_parse(m, m.Cmdx(nfs.CAT, path.Join(SRC_WEBSITE, arg[0])), arg[1:]...); ok {
|
||||||
m.Echo(_website_template2, kit.Format(res))
|
m.Echo(_website_template2, kit.Format(res))
|
||||||
}
|
}
|
||||||
|
@ -143,14 +143,14 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var _contexts = kit.Dict(
|
var _contexts = kit.Dict(
|
||||||
"misc", `# 完整版
|
ice.MISC, `# 完整版
|
||||||
export ctx_dev={{.Option "httphost"}}; ctx_temp=$(mktemp); curl -fsSL $ctx_dev -o $ctx_temp; source $ctx_temp dev
|
export ctx_dev={{.Option "httphost"}}; ctx_temp=$(mktemp); curl -fsSL $ctx_dev -o $ctx_temp; source $ctx_temp dev
|
||||||
`,
|
`,
|
||||||
"core", `# 标准版
|
ice.CORE, `# 标准版
|
||||||
export ctx_dev={{.Option "httphost"}}; ctx_temp=$(mktemp); wget -O $ctx_temp $ctx_dev; source $ctx_temp app
|
export ctx_dev={{.Option "httphost"}}; ctx_temp=$(mktemp); wget -O $ctx_temp $ctx_dev; source $ctx_temp app
|
||||||
`,
|
`,
|
||||||
"base", `# 官方版
|
ice.BASE, `# 官方版
|
||||||
ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL https://shylinux.com; source $ctx_temp binary
|
ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL {{.Cmdx "spide" "shy" "url"}}; source $ctx_temp binary
|
||||||
ctx_temp=$(mktemp); wget -O $ctx_temp https://shylinux.com; source $ctx_temp binary
|
ctx_temp=$(mktemp); wget -O $ctx_temp {{.Cmdx "spide" "shy" "url"}}; source $ctx_temp binary
|
||||||
`,
|
`,
|
||||||
)
|
)
|
||||||
|
@ -75,6 +75,11 @@ func (m *Message) RenderRedirect(args ...interface{}) *Message {
|
|||||||
func (m *Message) RenderDownload(args ...interface{}) *Message {
|
func (m *Message) RenderDownload(args ...interface{}) *Message {
|
||||||
return m.Render(RENDER_DOWNLOAD, args...)
|
return m.Render(RENDER_DOWNLOAD, args...)
|
||||||
}
|
}
|
||||||
|
func (m *Message) RenderWebsite(pod string, dir string, arg ...string) *Message {
|
||||||
|
m.Cmdy("space", pod, "website", "action", "show", dir, arg)
|
||||||
|
m.RenderResult()
|
||||||
|
return m
|
||||||
|
}
|
||||||
func (m *Message) RenderIndex(serve, repos string, file ...string) *Message {
|
func (m *Message) RenderIndex(serve, repos string, file ...string) *Message {
|
||||||
return m.RenderDownload(path.Join(m.Conf(serve, kit.Keym(repos, "path")), kit.Select(m.Conf(serve, kit.Keym(repos, INDEX)), path.Join(file...))))
|
return m.RenderDownload(path.Join(m.Conf(serve, kit.Keym(repos, "path")), kit.Select(m.Conf(serve, kit.Keym(repos, INDEX)), path.Join(file...))))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user