diff --git a/base/cli/daemon.go b/base/cli/daemon.go index d16dfd0f..6db096c7 100644 --- a/base/cli/daemon.go +++ b/base/cli/daemon.go @@ -147,15 +147,12 @@ func init() { }) } func Opens(m *ice.Message, arg ...string) { - m.Debug("what %v", arg) if !tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) { return } - m.Debug("what %v", arg) if len(arg) == 0 || arg[0] == "" { return } - m.Debug("what %v", arg) switch runtime.GOOS { case DARWIN: if kit.Ext(arg[0]) == "app" { diff --git a/base/cli/system.go b/base/cli/system.go index 613138f0..ddcba822 100644 --- a/base/cli/system.go +++ b/base/cli/system.go @@ -90,13 +90,9 @@ func _system_exec(m *ice.Message, cmd *exec.Cmd) { cmd.Stdout, cmd.Stderr = out, err defer func() { m.Push(CMD_OUT, out.String()).Push(CMD_ERR, err.String()) - // m.Echo(strings.TrimRight(out.String(), lex.NL)) - m.Echo(out.String()) - m.Echo(err.String()) - if m.IsErr() { + if m.Echo(out.String()).Echo(err.String()); m.IsErr() { m.Option(ice.MSG_ARGS, kit.Simple(http.StatusBadRequest, cmd.Args, err.String())) m.Echo(strings.TrimRight(err.String(), lex.NL)) - m.Debug("%s %s", err, out) } }() } diff --git a/base/gdb/signal.go b/base/gdb/signal.go index 20f9517f..abaee1a4 100644 --- a/base/gdb/signal.go +++ b/base/gdb/signal.go @@ -53,6 +53,7 @@ func init() { if runtime.GOOS == "windows" { return } + _signal_listen(m, 1, mdb.NAME, "挂起", ice.CMD, "runtime") _signal_listen(m, 2, mdb.NAME, "重启", ice.CMD, "exit 1") _signal_listen(m, 3, mdb.NAME, "退出", ice.CMD, "exit 0") }}, diff --git a/base/web/admin.go b/base/web/admin.go index b880ba0d..1b4bc1cb 100644 --- a/base/web/admin.go +++ b/base/web/admin.go @@ -10,7 +10,7 @@ func init() { "admin": {Name: "admin", Help: "管理", Hand: func(m *ice.Message, arg ...string) { args := []string{} kit.For(arg[1:], func(v string) { args = append(args, ice.ARG, v) }) - m.Cmdy(SPIDE, ice.OPS, SPIDE_RAW, "/chat/cmd/"+arg[0], args) + m.Cmdy(SPIDE, ice.OPS, SPIDE_RAW, "/chat/cmd/"+arg[0]+"?debug=true", SPIDE_FORM, args) }}, }) } diff --git a/base/web/serve.go b/base/web/serve.go index 872f1d1d..3a704e8a 100644 --- a/base/web/serve.go +++ b/base/web/serve.go @@ -75,7 +75,9 @@ 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) { debug := strings.Contains(r.URL.String(), "debug=true") || strings.Contains(r.Header.Get(Referer), "debug=true") + debug = true _log := func(level string, arg ...ice.Any) *ice.Message { + return m.Logs(strings.Title(level), arg...) if debug || arg[0] == "cmds" { return m.Logs(strings.Title(level), arg...) } diff --git a/core/code/binpack.go b/core/code/binpack.go index dd509a1a..c9175335 100644 --- a/core/code/binpack.go +++ b/core/code/binpack.go @@ -64,14 +64,12 @@ func _binpack_all(m *ice.Message) { } list, cache := map[string]string{}, GoCache(m) for k := range ice.Info.File { - m.Debug("what %v", k) switch ls := kit.Split(k, nfs.PS); ls[1] { case ice.SRC: case ice.USR: list[path.Join(kit.Slice(ls, 1, -1)...)] = "" default: p := path.Join(cache, path.Join(kit.Slice(ls, 1, -1)...)) - m.Debug("what %v %v", ls, p) list[path.Join(nfs.USR, strings.Split(ls[3], mdb.AT)[0], path.Join(kit.Slice(ls, 4)...))] = p } } diff --git a/logs.go b/logs.go index 3f247d1c..b9603644 100644 --- a/logs.go +++ b/logs.go @@ -151,10 +151,8 @@ func (m *Message) IsErrNotFound() bool { return m.IsErr(ErrNotFound) } func (m *Message) Debug(str string, arg ...Any) { - // if m.Option("debug") == TRUE || !Info.Important { kit.Format(str == "", func() { str = m.FormatMeta() }) m.log(LOG_DEBUG, str, arg...) - // } } func (m *Message) FormatPrefix() string { diff --git a/misc/git/token.go b/misc/git/token.go index 94b05dfc..73e6b97a 100644 --- a/misc/git/token.go +++ b/misc/git/token.go @@ -37,6 +37,7 @@ func init() { SET: {Hand: func(m *ice.Message, arg ...string) { host, list := ice.Map{kit.ParseURL(m.Option(TOKEN)).Host: true}, []string{m.Option(TOKEN)} m.Cmd(nfs.CAT, kit.HomePath(FILE), func(line string) { + line = strings.ReplaceAll(line, "%3a", ":") kit.IfNoKey(host, kit.ParseURL(line).Host, func(p string) { list = append(list, line) }) }).Cmd(nfs.SAVE, kit.HomePath(FILE), strings.Join(list, lex.NL)+lex.NL) m.ProcessClose()