1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-26 01:24:05 +08:00

opt index

This commit is contained in:
shylinux 2021-09-01 11:08:27 +08:00
parent 78d2431ec7
commit 8c434eb4df
3 changed files with 13 additions and 9 deletions

View File

@ -78,8 +78,12 @@ func _serve_main(m *ice.Message, w http.ResponseWriter, r *http.Request) bool {
func _serve_params(msg *ice.Message, path string) {
switch ls := strings.Split(path, "/"); kit.Select("", ls, 1) {
case "share":
msg.Logs("refer", ls[1], ls[2])
msg.Option(ls[1], ls[2])
switch ls[2] {
case "local":
default:
msg.Logs("refer", ls[1], ls[2])
msg.Option(ls[1], ls[2])
}
case "chat":
switch kit.Select("", ls, 2) {
case "pod":

View File

@ -164,22 +164,22 @@ echo "hello world"
var _contexts = kit.Dict(
"project", `# 创建项目
ctx_temp=$(mktemp); curl -fsSL https://shylinux.com -o $ctx_temp; source $ctx_temp project
source <(curl -fsSL https://shylinux.com) project
`,
"source", `# 源码安装
ctx_temp=$(mktemp); curl -fsSL https://shylinux.com -o $ctx_temp; source $ctx_temp source
source <(curl -fsSL https://shylinux.com) source
`,
"binary", `# 应用安装
ctx_temp=$(mktemp); curl -fsSL https://shylinux.com -o $ctx_temp; source $ctx_temp binary
source <(curl -fsSL https://shylinux.com) binary
`,
"miss", `# 开发环境
export ctx_dev={{.Option "httphost"}} ctx_temp=$(mktemp); curl -fsSL $ctx_dev -o $ctx_temp; source $ctx_temp dev
export ctx_dev={{.Option "httphost"}}; source <(curl -fsSL $ctx_dev) dev
`,
"base", `# 生产环境
export ctx_dev={{.Option "httphost"}} ctx_temp=$(mktemp); curl -fsSL $ctx_dev -o $ctx_temp; source $ctx_temp app
export ctx_dev={{.Option "httphost"}}; source <(curl -fsSL $ctx_dev) app
`,
"tmux", `# 终端环境
export ctx_dev={{.Option "httphost"}} ctx_temp=$(mktemp); curl -fsSL $ctx_dev -o $ctx_temp; source $ctx_temp
export ctx_dev={{.Option "httphost"}}; source <(curl -fsSL $ctx_dev)
`,
"tool", `# 群组环境
mkdir contexts; cd contexts

View File

@ -134,5 +134,5 @@ func (m *Message) RenderRedirect(args ...interface{}) *Message {
return m.Render(RENDER_REDIRECT, args...)
}
func (m *Message) RenderIndex(serve, repos string, file ...string) *Message {
return m.RenderDownload(kit.Path(m.Conf(serve, kit.Keym(repos, kit.SSH_PATH)), kit.Select(m.Conf(serve, kit.Keym(repos, kit.SSH_INDEX)), path.Join(file...))))
return m.RenderDownload(path.Join(m.Conf(serve, kit.Keym(repos, kit.SSH_PATH)), kit.Select(m.Conf(serve, kit.Keym(repos, kit.SSH_INDEX)), path.Join(file...))))
}