1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-03-08 02:16:55 +08:00
parent ee88456228
commit 253811a653
4 changed files with 14 additions and 2 deletions

View File

@ -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) {

View File

@ -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) {

View File

@ -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

View File

@ -69,3 +69,6 @@ func init() {
}},
})
}
func PublicKey(m *ice.Message) string {
return m.Cmdx(nfs.CAT, kit.HomePath(".ssh/id_rsa.pub"))
}