mirror of
https://shylinux.com/x/icebergs
synced 2025-06-26 18:37:29 +08:00
opt some
This commit is contained in:
parent
5b764758dd
commit
e232ffc59e
@ -55,6 +55,7 @@ func init() {
|
|||||||
for {
|
for {
|
||||||
logs.Println("run %s", kit.Join(arg, ice.SP))
|
logs.Println("run %s", kit.Join(arg, ice.SP))
|
||||||
if m.Sleep300ms(); IsSuccess(m.Cmd(SYSTEM, arg)) {
|
if m.Sleep300ms(); IsSuccess(m.Cmd(SYSTEM, arg)) {
|
||||||
|
logs.Println()
|
||||||
logs.Println(ice.EXIT) // 正常退出
|
logs.Println(ice.EXIT) // 正常退出
|
||||||
break
|
break
|
||||||
} else {
|
} else {
|
||||||
|
@ -146,6 +146,9 @@ func init() {
|
|||||||
m.Cmdy(nfs.CAT, ice.ETC_PATH)
|
m.Cmdy(nfs.CAT, ice.ETC_PATH)
|
||||||
}},
|
}},
|
||||||
}, Hand: func(m *ice.Message, arg ...string) {
|
}, Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
if len(arg) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
if len(arg) == 1 {
|
if len(arg) == 1 {
|
||||||
arg = kit.Split(arg[0])
|
arg = kit.Split(arg[0])
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ func init() {
|
|||||||
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
_signal_listen(m, 2, mdb.NAME, "重启", ice.CMD, "exit 1")
|
_signal_listen(m, 2, mdb.NAME, "重启", ice.CMD, "exit 1")
|
||||||
_signal_listen(m, 3, mdb.NAME, "退出", ice.CMD, "exit 0")
|
_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()
|
defer f.Close()
|
||||||
fmt.Fprint(f, os.Getpid())
|
fmt.Fprint(f, os.Getpid())
|
||||||
m.Logs(mdb.CREATE, PID, p)
|
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)
|
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))
|
m.Cap(ice.CTX_STREAM, path.Base(p))
|
||||||
value[FILE] = bufio.NewWriter(f)
|
value[FILE] = bufio.NewWriter(f)
|
||||||
m.Logs(mdb.CREATE, nfs.FILE, p)
|
m.Logs(mdb.CREATE, nfs.FILE, p)
|
||||||
|
@ -23,11 +23,8 @@ func init() {
|
|||||||
if m.Warn(m.Option(cli.BACK) == "") {
|
if m.Warn(m.Option(cli.BACK) == "") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
sessid := m.Cmdx(web.SPACE, m.Option(web.SPACE), aaa.SESS, mdb.CREATE,
|
args := []string{aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERROLE, m.Option(ice.MSG_USERROLE), aaa.USERNICK, m.Option(ice.MSG_USERNICK)}
|
||||||
aaa.USERNAME, m.Option(ice.MSG_USERNAME),
|
sessid := aaa.UserRoot(m).Cmdx(web.SPACE, m.Option(web.SPACE), aaa.SESS, mdb.CREATE, args)
|
||||||
aaa.USERROLE, m.Option(ice.MSG_USERROLE),
|
|
||||||
aaa.USERNICK, m.Option(ice.MSG_USERNICK),
|
|
||||||
)
|
|
||||||
m.RenderRedirect(kit.MergeURL(m.Option(cli.BACK), ice.MSG_SESSID, sessid))
|
m.RenderRedirect(kit.MergeURL(m.Option(cli.BACK), ice.MSG_SESSID, sessid))
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
|
@ -159,8 +159,8 @@ func init() {
|
|||||||
|
|
||||||
var _contexts = kit.Dict(
|
var _contexts = kit.Dict(
|
||||||
ice.MISC, `# 下载命令
|
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); 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
|
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, `# 克隆源码
|
ice.CORE, `# 克隆源码
|
||||||
git clone {{.Option "remote"}}; cd {{.Option "pathname"}} && source etc/miss.sh port 9020
|
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]
|
name := kit.Slice(kit.Split(frame.Function, PS, PS), -1)[0]
|
||||||
|
|
||||||
switch ls := kit.Split(name, PT, PT); kit.Select("", ls, 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:
|
default:
|
||||||
list = append(list, kit.Format("%s:%d\t%s", file, frame.Line, name))
|
list = append(list, kit.Format("%s:%d\t%s", file, frame.Line, name))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user