forked from x/icebergs
opt some
This commit is contained in:
parent
5b764758dd
commit
e232ffc59e
@ -55,6 +55,7 @@ func init() {
|
||||
for {
|
||||
logs.Println("run %s", kit.Join(arg, ice.SP))
|
||||
if m.Sleep300ms(); IsSuccess(m.Cmd(SYSTEM, arg)) {
|
||||
logs.Println()
|
||||
logs.Println(ice.EXIT) // 正常退出
|
||||
break
|
||||
} else {
|
||||
|
@ -146,6 +146,9 @@ func init() {
|
||||
m.Cmdy(nfs.CAT, ice.ETC_PATH)
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
return
|
||||
}
|
||||
if len(arg) == 1 {
|
||||
arg = kit.Split(arg[0])
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ func init() {
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||
_signal_listen(m, 2, mdb.NAME, "重启", ice.CMD, "exit 1")
|
||||
_signal_listen(m, 3, mdb.NAME, "退出", ice.CMD, "exit 0")
|
||||
if f, p, e := logs.CreateFile(ice.Info.PidPath); !m.Warn(e) {
|
||||
if f, p, e := logs.CreateFile(ice.Info.PidPath); e == nil {
|
||||
defer f.Close()
|
||||
fmt.Fprint(f, os.Getpid())
|
||||
m.Logs(mdb.CREATE, PID, p)
|
||||
|
@ -134,7 +134,7 @@ var Index = &ice.Context{Name: "log", Help: "日志模块", Configs: ice.Configs
|
||||
m.Conf(SHOW, kit.Keys(k, FILE), key)
|
||||
})
|
||||
// 日志文件
|
||||
if f, p, e := logs.CreateFile(kit.Format(value[nfs.PATH])); m.Assert(e) {
|
||||
if f, p, e := logs.CreateFile(kit.Format(value[nfs.PATH])); e == nil {
|
||||
m.Cap(ice.CTX_STREAM, path.Base(p))
|
||||
value[FILE] = bufio.NewWriter(f)
|
||||
m.Logs(mdb.CREATE, nfs.FILE, p)
|
||||
|
@ -23,11 +23,8 @@ func init() {
|
||||
if m.Warn(m.Option(cli.BACK) == "") {
|
||||
return
|
||||
}
|
||||
sessid := m.Cmdx(web.SPACE, m.Option(web.SPACE), aaa.SESS, mdb.CREATE,
|
||||
aaa.USERNAME, m.Option(ice.MSG_USERNAME),
|
||||
aaa.USERROLE, m.Option(ice.MSG_USERROLE),
|
||||
aaa.USERNICK, m.Option(ice.MSG_USERNICK),
|
||||
)
|
||||
args := []string{aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERROLE, m.Option(ice.MSG_USERROLE), aaa.USERNICK, m.Option(ice.MSG_USERNICK)}
|
||||
sessid := aaa.UserRoot(m).Cmdx(web.SPACE, m.Option(web.SPACE), aaa.SESS, mdb.CREATE, args)
|
||||
m.RenderRedirect(kit.MergeURL(m.Option(cli.BACK), ice.MSG_SESSID, sessid))
|
||||
}},
|
||||
})
|
||||
|
@ -159,8 +159,8 @@ func init() {
|
||||
|
||||
var _contexts = kit.Dict(
|
||||
ice.MISC, `# 下载命令
|
||||
export ctx_dev={{.Option "httphost"}} ctx_pod={{.Option "user.pod"}}; ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL $ctx_dev; source $ctx_temp app
|
||||
export ctx_dev={{.Option "httphost"}} ctx_pod={{.Option "user.pod"}}; ctx_temp=$(mktemp); wget -O $ctx_temp -q $ctx_dev; source $ctx_temp app
|
||||
export ctx_dev={{.Option "httphost"}} ctx_pod={{.Option "user.pod"}}; ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL $ctx_dev; source $ctx_temp app username {{.Option "user.name"}}
|
||||
export ctx_dev={{.Option "httphost"}} ctx_pod={{.Option "user.pod"}}; ctx_temp=$(mktemp); wget -O $ctx_temp -q $ctx_dev; source $ctx_temp app username {{.Option "user.name"}}
|
||||
`,
|
||||
ice.CORE, `# 克隆源码
|
||||
git clone {{.Option "remote"}}; cd {{.Option "pathname"}} && source etc/miss.sh port 9020
|
||||
|
2
logs.go
2
logs.go
@ -195,7 +195,7 @@ func (m *Message) FormatStack(s, n int) string {
|
||||
name := kit.Slice(kit.Split(frame.Function, PS, PS), -1)[0]
|
||||
|
||||
switch ls := kit.Split(name, PT, PT); kit.Select("", ls, 0) {
|
||||
case "reflect", "runtime", "http", "task", "icebergs":
|
||||
// case "reflect", "runtime", "http", "task", "icebergs":
|
||||
default:
|
||||
list = append(list, kit.Format("%s:%d\t%s", file, frame.Line, name))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user