forked from x/icebergs
opt some
This commit is contained in:
parent
baf9763256
commit
19524faa67
@ -126,8 +126,9 @@ func init() {
|
||||
}
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Option(FG, kit.Select(kit.Select(BLACK, WHITE, kit.IndexOf([]string{BLACK, "dark"}, m.Option(ice.MSG_THEME)) > -1), arg, 1))
|
||||
m.Option(BG, kit.Select(kit.Select(WHITE, BLACK, kit.IndexOf([]string{BLACK, "dark"}, m.Option(ice.MSG_THEME)) > -1), arg, 2))
|
||||
dark := kit.IndexOf([]string{BLACK, "dark"}, m.Option(ice.MSG_THEME)) > -1
|
||||
m.Option(FG, kit.Select(kit.Select(BLACK, WHITE, dark), arg, 1))
|
||||
m.Option(BG, kit.Select(kit.Select(WHITE, BLACK, dark), arg, 2))
|
||||
if m.IsCliUA() {
|
||||
_qrcode_cli(m, kit.Select(kit.Select(ice.Info.Make.Domain, ice.Info.Domain), arg, 0))
|
||||
} else {
|
||||
|
@ -184,6 +184,9 @@ func init() {
|
||||
}
|
||||
aaa.SessAuth(m, kit.Dict(aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.USERROLE, m.Option(ice.MSG_USERROLE)))
|
||||
}},
|
||||
aaa.LOGIN: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(SPACE, arg[0], ice.MSG_SESSID, aaa.SessCreate(m, m.Option(ice.MSG_USERNAME)))
|
||||
}},
|
||||
DOMAIN: {Hand: func(m *ice.Message, arg ...string) { m.Echo(_space_domain(m)) }},
|
||||
OPEN: {Hand: func(m *ice.Message, arg ...string) { ctx.ProcessOpen(m, MergePod(m, m.Option(mdb.NAME), arg)) }},
|
||||
ice.PS: {Hand: func(m *ice.Message, arg ...string) { _space_fork(m) }},
|
||||
|
@ -18,7 +18,7 @@ import (
|
||||
func _binpack_file(m *ice.Message, w io.Writer, arg ...string) {
|
||||
if f, e := nfs.OpenFile(m, arg[0]); !m.Warn(e, ice.ErrNotFound, arg[0]) {
|
||||
defer f.Close()
|
||||
if b, e := ioutil.ReadAll(f); !m.Warn(e, ice.ErrNotValid, arg[0]) && len(b) > 0 {
|
||||
if b, e := ioutil.ReadAll(f); !m.Warn(e, ice.ErrNotValid, arg[0]) && len(b) > 0 || strings.Contains(arg[0], "/cache.") {
|
||||
fmt.Fprintf(w, " \"%s\": \"%s\",\n", kit.Select(arg[0], arg, 1), base64.StdEncoding.EncodeToString(b))
|
||||
}
|
||||
}
|
||||
|
@ -123,6 +123,9 @@ export ctx_dev={{.Option "httphost"}}{{.Option "ctx_env"}}; ctx_temp=$(mktemp);
|
||||
export ctx_dev={{.Option "httphost"}}{{.Option "ctx_env"}}; ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL $ctx_dev; source $ctx_temp app username {{.Option "user.name"}} usernick {{.Option "user.nick"}}
|
||||
`,
|
||||
ice.CORE, `
|
||||
# 下载命令 wget Busybox
|
||||
ctx_temp=$(mktemp); wget -O $ctx_temp -q http://shylinux.com; source $ctx_temp binary
|
||||
|
||||
# 下载命令 wget Alpine
|
||||
ctx_temp=$(mktemp); wget -O $ctx_temp -q {{.Cmdx "spide" "shy" "client.origin"}}; source $ctx_temp binary
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user