diff --git a/base/cli/cli.go b/base/cli/cli.go index d2bb0b46..dde8168e 100644 --- a/base/cli/cli.go +++ b/base/cli/cli.go @@ -23,6 +23,7 @@ var NodeName = "" var NodeType = "" func NodeInfo(m *ice.Message, kind, name string) { + name = strings.ReplaceAll(name, ".", "_") m.Conf(RUNTIME, "node.type", kind) m.Conf(RUNTIME, "node.name", name) NodeName = name diff --git a/base/web/route.go b/base/web/route.go index d9bb9635..1a7b1700 100644 --- a/base/web/route.go +++ b/base/web/route.go @@ -109,7 +109,7 @@ func init() { return } m.Push("type", MYSELF) - m.Push("route", MYSELF) + m.Push("route", cli.NodeName) m.Table(func(index int, value map[string]string, field []string) { m.PushRender(kit.MDB_LINK, "a", value[kit.SSH_ROUTE], diff --git a/base/web/space.go b/base/web/space.go index 29982607..94a2943d 100644 --- a/base/web/space.go +++ b/base/web/space.go @@ -18,19 +18,11 @@ import ( ) func _space_list(m *ice.Message, space string) { - if space == "" { - m.Richs(SPACE, nil, kit.MDB_FOREACH, func(key string, value map[string]interface{}) { - m.Push(key, value, []string{kit.MDB_TIME, kit.MDB_TYPE, kit.MDB_NAME, kit.MDB_TEXT}) - m.PushRender(kit.MDB_LINK, "a", kit.Format(value[kit.MDB_NAME]), kit.MergeURL(m.Option(ice.MSG_USERWEB), "pod", kit.Keys(m.Option("pod"), value[kit.MDB_NAME]))) - }) - m.Sort(kit.MDB_NAME) - return - } - - m.Richs(SPACE, nil, space, func(key string, value map[string]interface{}) { - m.Push("detail", value) - m.Push(kit.MDB_KEY, kit.MDB_LINK) - m.PushRender(kit.MDB_VALUE, "a", kit.MergeURL(m.Option(ice.MSG_USERWEB), "pod", kit.Keys(m.Option("pod"), value[kit.MDB_NAME]))) + m.Option(mdb.FIELDS, "time,type,name,text") + m.Cmdy(mdb.SELECT, SPACE, "", mdb.HASH, kit.MDB_HASH, space) + m.Table(func(index int, value map[string]string, head []string) { + m.PushRender(kit.MDB_LINK, "a", kit.Format(value[kit.MDB_NAME]), + kit.MergeURL(m.Option(ice.MSG_USERWEB), kit.SSH_POD, kit.Keys(m.Option(kit.SSH_POD), value[kit.MDB_NAME]))) }) } func _space_dial(m *ice.Message, dev, name string, arg ...string) { @@ -235,7 +227,7 @@ func init() { return } - if arg[0] == "" || arg[0] == MYSELF { + if arg[0] == "" || arg[0] == MYSELF || arg[0] == cli.NodeName { // 本地命令 m.Cmdy(arg[1:]) return diff --git a/core/code/publish.go b/core/code/publish.go index 70a0dc9a..6fe5b107 100644 --- a/core/code/publish.go +++ b/core/code/publish.go @@ -88,7 +88,7 @@ export ctx_dev={{.Option "httphost"}} ctx_temp=$(mktemp); curl -sL $ctx_dev >$ct "base", ` # 生产环境 mkdir contexts; cd contexts -export ctx_dev={{.Option "httphost"}} ctx_temp=$(mktemp); curl -sL $ctx_dev >$ctx_temp; source $ctx_temp ice +export ctx_log=/dev/stdout ctx_dev={{.Option "httphost"}} ctx_temp=$(mktemp); curl -sL $ctx_dev >$ctx_temp; source $ctx_temp ice `, "miss", ` # 开发环境 diff --git a/misc.go b/misc.go index 45af6264..e25fea4d 100644 --- a/misc.go +++ b/misc.go @@ -63,6 +63,10 @@ func (m *Message) AddCmd(cmd *Command) string { } func (m *Message) PushRender(key, view, name string, arg ...string) *Message { + if m.Option(MSG_USERUA) == "" { + return m + } + if strings.Contains(m.Option(MSG_USERUA), "curl") { return m }