1
0
mirror of https://shylinux.com/x/icebergs synced 2025-06-28 19:17:23 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2022-03-18 10:32:28 +08:00
parent dd920ee22c
commit 5227398cec
6 changed files with 36 additions and 27 deletions

View File

@ -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)
}}, }},

View File

@ -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:

View File

@ -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) == "" { if m.IsCliUA() {
m.RenderCmd(web.ROUTE) m.Option(ice.MSG_USERNAME, "root")
return // 节点列表 m.Option(ice.MSG_USERROLE, "root")
m.Option(ice.POD, kit.Select("", arg, 0))
m.Cmdy(web.SHARE_LOCAL, "bin/ice.bin")
return // 下载文件
} }
if len(arg) == 1 {
if m.IsCliUA() { if len(arg) == 0 || kit.Select("", arg, 0) == "" { // 节点列表
m.Option(ice.MSG_USERNAME, "root") m.RenderCmd(web.ROUTE)
m.Option(ice.MSG_USERROLE, "tech")
m.Cmdy(web.SHARE_LOCAL, "bin/ice.bin") } else if len(arg) == 1 { // 节点首页
return if m.RenderWebsite(arg[0], "index.iml", "Header", "", "River", "", "Action", "", "Footer", ""); m.Result() == "" {
}
if s := m.Cmdx(web.SPACE, arg[0], "web.chat.website", "show", "index.iml", "Header", "", "River", "", "Action", "", "Footer", ""); s != "" {
m.RenderResult(s)
} else {
m.RenderIndex(web.SERVE, ice.VOLCANOS) m.RenderIndex(web.SERVE, ice.VOLCANOS)
} }
return // 节点首页
} else if arg[1] == WEBSITE { // 节点网页
m.RenderWebsite(arg[0], path.Join(arg[2:]...))
} else { // 节点命令
m.Cmdy("/cmd/", path.Join(arg[2:]...))
} }
if arg[1] == WEBSITE {
m.Cmdy(web.SPACE, arg[0], WEBSITE, ctx.ACTION, "show", path.Join(arg[2:]...))
m.RenderResult()
return
}
// 节点命令
m.Cmdy("/cmd/", path.Join(arg[2:]...))
}}, }},
}}) }})
} }

View File

@ -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))
} }

View File

@ -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
`, `,
) )

View File

@ -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...))))
} }