mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt some
This commit is contained in:
parent
4121f60275
commit
baf9763256
@ -117,7 +117,7 @@ func (f *Frame) parse(m *ice.Message, h, line string) string {
|
|||||||
func (f *Frame) scan(m *ice.Message, h, line string) *Frame {
|
func (f *Frame) scan(m *ice.Message, h, line string) *Frame {
|
||||||
f.ps1 = kit.Simple(m.Confv(PROMPT, kit.Keym(PS1)))
|
f.ps1 = kit.Simple(m.Confv(PROMPT, kit.Keym(PS1)))
|
||||||
f.ps2 = kit.Simple(m.Confv(PROMPT, kit.Keym(PS2)))
|
f.ps2 = kit.Simple(m.Confv(PROMPT, kit.Keym(PS2)))
|
||||||
m.Options(MESSAGE, m, ice.LOG_DISABLE, ice.TRUE)
|
// m.Options(MESSAGE, m, ice.LOG_DISABLE, ice.TRUE)
|
||||||
m.I, m.O = f.stdin, f.stdout
|
m.I, m.O = f.stdin, f.stdout
|
||||||
ps, bio := f.ps1, bufio.NewScanner(f.stdin)
|
ps, bio := f.ps1, bufio.NewScanner(f.stdin)
|
||||||
for f.prompt(m, ps...); f.stdin != nil && bio.Scan(); f.prompt(m, ps...) {
|
for f.prompt(m, ps...); f.stdin != nil && bio.Scan(); f.prompt(m, ps...) {
|
||||||
|
@ -73,7 +73,16 @@ func _serve_main(m *ice.Message, w http.ResponseWriter, r *http.Request) bool {
|
|||||||
}
|
}
|
||||||
func _serve_handle(key string, cmd *ice.Command, m *ice.Message, w http.ResponseWriter, r *http.Request) {
|
func _serve_handle(key string, cmd *ice.Command, m *ice.Message, w http.ResponseWriter, r *http.Request) {
|
||||||
if u, e := url.Parse(r.Header.Get(Referer)); e == nil && r.URL.Path != PP(SPACE) {
|
if u, e := url.Parse(r.Header.Get(Referer)); e == nil && r.URL.Path != PP(SPACE) {
|
||||||
gdb.Event(m, SERVE_PARSE, strings.Split(strings.TrimPrefix(u.Path, ice.PS), ice.PS))
|
add := func(k, v string) { m.Logs("path", k, m.Option(k, v)) }
|
||||||
|
switch arg := strings.Split(strings.TrimPrefix(u.Path, ice.PS), ice.PS); arg[0] {
|
||||||
|
case "share":
|
||||||
|
add(arg[0], arg[1])
|
||||||
|
case "chat":
|
||||||
|
for i := 1; i < len(arg); i += 2 {
|
||||||
|
add(arg[i], arg[i+1])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// gdb.Event(m, SERVE_PARSE, strings.Split(strings.TrimPrefix(u.Path, ice.PS), ice.PS))
|
||||||
kit.Fetch(u.Query(), func(k string, v []string) { m.Logs("Refer", k, v).Optionv(k, v) })
|
kit.Fetch(u.Query(), func(k string, v []string) { m.Logs("Refer", k, v).Optionv(k, v) })
|
||||||
}
|
}
|
||||||
m.Option(ice.MSG_USERUA, r.Header.Get(UserAgent))
|
m.Option(ice.MSG_USERUA, r.Header.Get(UserAgent))
|
||||||
|
@ -290,7 +290,7 @@ func init() {
|
|||||||
MERGE: {Hand: func(m *ice.Message, arg ...string) {
|
MERGE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Echo(kit.MergeURL2(m.CmdAppend("", arg[0], CLIENT_URL), arg[1], arg[2:]))
|
m.Echo(kit.MergeURL2(m.CmdAppend("", arg[0], CLIENT_URL), arg[1], arg[2:]))
|
||||||
}},
|
}},
|
||||||
}, mdb.HashAction(mdb.SHORT, CLIENT_NAME, mdb.FIELD, "time,client.name,client.url", LOGHEADERS, ice.FALSE), mdb.ClearHashOnExitAction()), Hand: func(m *ice.Message, arg ...string) {
|
}, mdb.HashAction(mdb.SHORT, CLIENT_NAME, mdb.FIELD, "time,client.name,client.url,client.origin", LOGHEADERS, ice.FALSE), mdb.ClearHashOnExitAction()), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) < 2 || arg[0] == "" || (len(arg) > 3 && arg[3] == "") {
|
if len(arg) < 2 || arg[0] == "" || (len(arg) > 3 && arg[3] == "") {
|
||||||
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...).Sort(CLIENT_NAME)
|
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...).Sort(CLIENT_NAME)
|
||||||
} else {
|
} else {
|
||||||
|
@ -124,16 +124,16 @@ export ctx_dev={{.Option "httphost"}}{{.Option "ctx_env"}}; ctx_temp=$(mktemp);
|
|||||||
`,
|
`,
|
||||||
ice.CORE, `
|
ice.CORE, `
|
||||||
# 下载命令 wget Alpine
|
# 下载命令 wget Alpine
|
||||||
ctx_temp=$(mktemp); wget -O $ctx_temp -q {{.Cmdx "spide" "shy" "client.url"}}; source $ctx_temp binary
|
ctx_temp=$(mktemp); wget -O $ctx_temp -q {{.Cmdx "spide" "shy" "client.origin"}}; source $ctx_temp binary
|
||||||
|
|
||||||
# 下载命令 curl Centos / MacOS
|
# 下载命令 curl Centos / MacOS
|
||||||
ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL {{.Cmdx "spide" "shy" "client.url"}}; source $ctx_temp binary
|
ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL {{.Cmdx "spide" "shy" "client.origin"}}; source $ctx_temp binary
|
||||||
`,
|
`,
|
||||||
ice.BASE, `
|
ice.BASE, `
|
||||||
# 下载源码 wget Alpine
|
# 下载源码 wget Alpine
|
||||||
ctx_temp=$(mktemp); wget -O $ctx_temp -q {{.Cmdx "spide" "shy" "client.url"}}; source $ctx_temp source
|
ctx_temp=$(mktemp); wget -O $ctx_temp -q {{.Cmdx "spide" "shy" "client.origin"}}; source $ctx_temp source
|
||||||
|
|
||||||
# 下载源码 curl Centos / MacOS
|
# 下载源码 curl Centos / MacOS
|
||||||
ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL {{.Cmdx "spide" "shy" "client.url"}}; source $ctx_temp source
|
ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL {{.Cmdx "spide" "shy" "client.origin"}}; source $ctx_temp source
|
||||||
`,
|
`,
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user