diff --git a/base/cli/runtime.go b/base/cli/runtime.go index 49e275c2..d32b0316 100644 --- a/base/cli/runtime.go +++ b/base/cli/runtime.go @@ -242,7 +242,7 @@ func init() { m.Cmdy("", REBOOT) } }}, - REBOOT: {Help: "重启", Icon: "bi bi-bootstrap-reboot", Hand: func(m *ice.Message, arg ...string) { + REBOOT: {Help: "重启", Hand: func(m *ice.Message, arg ...string) { m.Go(func() { m.Sleep30ms(ice.EXIT, 1) }) }}, "lock": {Help: "锁屏", Icon: "bi bi-file-lock", Hand: func(m *ice.Message, arg ...string) { diff --git a/core/code/vimer.go b/core/code/vimer.go index 9f9a3938..ff6861ed 100644 --- a/core/code/vimer.go +++ b/core/code/vimer.go @@ -156,7 +156,7 @@ func init() { gdb.Event(m, VIMER_SAVE) }}, nfs.TRASH: {Hand: func(m *ice.Message, arg ...string) { nfs.Trash(m, arg[0]) }}, - nfs.MODULE: {Name: "create name*=client help=示例 type*=Hash,Zone,Data,Code main*=main.go zone=cloud/tencent key=ssh.cloud.tencent.client", Help: "模块", Hand: func(m *ice.Message, arg ...string) { + nfs.MODULE: {Name: "create name*=client help=示例 type*=Hash,Zone,Data,Code main*=main.go zone=cloud/tencent/lighthouse key=ssh.cloud.tencent.lighthouse.client", Help: "模块", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(AUTOGEN, nfs.MODULE, arg) }}, nfs.SCRIPT: {Name: "script file*", Help: "脚本", Hand: func(m *ice.Message, arg ...string) { diff --git a/misc.go b/misc.go index 313d6f29..4ddfc137 100644 --- a/misc.go +++ b/misc.go @@ -93,6 +93,15 @@ func (m *Message) RenameOption(from, to string) *Message { return m.Options(to, m.Option(from), from, "") } func (m *Message) RenameAppend(arg ...string) *Message { + if m.FieldsIsDetail() { + list := m.value(KEY) + kit.For(list, func(k string, i int) { + kit.For(arg, func(from, to string) { + kit.If(k == from, func() { list[i] = to }) + }) + }) + return m + } kit.For(arg, func(from, to string) { if from == to { return diff --git a/misc/ssh/rsa.go b/misc/ssh/rsa.go index e7d33424..a6a45811 100644 --- a/misc/ssh/rsa.go +++ b/misc/ssh/rsa.go @@ -69,3 +69,6 @@ func init() { }}, }) } +func PublicKey(m *ice.Message) string { + return m.Cmdx(nfs.CAT, kit.HomePath(".ssh/id_rsa.pub")) +}