From e2babe49a68ac79ae1405cf3a733cc4e93fcc873 Mon Sep 17 00:00:00 2001 From: shy Date: Tue, 30 Apr 2024 02:35:03 +0800 Subject: [PATCH] add some --- base/ctx/config.go | 16 +++++++++++++++- base/web/option.go | 3 ++- core/code/autogen.go | 10 +++++++--- core/code/install.go | 3 ++- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/base/ctx/config.go b/base/ctx/config.go index 301a1382..b68a7c14 100644 --- a/base/ctx/config.go +++ b/base/ctx/config.go @@ -112,12 +112,26 @@ func init() { nfs.Trash(m, m.Cmdx(arg[0], mdb.EXPORT)) mdb.Config(m, arg[0], nil, nil) }}, + mdb.CREATE: {Name: "create name value", Hand: func(m *ice.Message, arg ...string) { + m.Confv(m.Option(mdb.KEY), kit.Keys(mdb.META, m.Option(mdb.NAME)), m.Option(mdb.VALUE)) + }}, + mdb.REMOVE: {Hand: func(m *ice.Message, arg ...string) { + m.Confv(m.Option(mdb.KEY), kit.Keys(mdb.META, m.Option(mdb.NAME)), "") + }}, + mdb.MODIFY: {Hand: func(m *ice.Message, arg ...string) { + if arg[0] == mdb.VALUE { + m.Confv(m.Option(mdb.KEY), kit.Keys(mdb.META, m.Option(mdb.NAME)), arg[1]) + } + }}, }, Hand: func(m *ice.Message, arg ...string) { if len(arg) == 0 { _config_list(m) } else { _config_make(m, arg[0], arg[1:]...) - m.Action(mdb.EXPORT, mdb.IMPORT, nfs.TRASH) + m.Action(mdb.CREATE, mdb.IMPORT, mdb.EXPORT, nfs.TRASH) + kit.For(mdb.Confv(m, arg[0], mdb.META), func(k, v string) { + m.Push(mdb.NAME, k).Push(mdb.VALUE, v).PushButton(mdb.REMOVE) + }) DisplayStoryJSON(m) } }}, diff --git a/base/web/option.go b/base/web/option.go index c14b1c5c..682770e5 100644 --- a/base/web/option.go +++ b/base/web/option.go @@ -91,7 +91,8 @@ func PushNoticeRich(m *ice.Message, arg ...ice.Any) { PushNotice(m.StatusTimeCount(), kit.Simple("rich", arg)) } func PushStream(m *ice.Message) *ice.Message { - m.Options(cli.CMD_OUTPUT, file.NewWriteCloser(func(buf []byte) { PushNoticeGrow(m, string(buf)) }, nil)).ProcessHold(toastContent(m, ice.SUCCESS)) + msg := m.SpawnSilent() + m.Options(cli.CMD_OUTPUT, file.NewWriteCloser(func(buf []byte) { PushNoticeGrow(msg, string(buf)) }, nil)).ProcessHold(toastContent(m, ice.SUCCESS)) return m } func init() { ice.Info.PushNotice = PushNotice } diff --git a/core/code/autogen.go b/core/code/autogen.go index a36f6527..b76a3fc2 100644 --- a/core/code/autogen.go +++ b/core/code/autogen.go @@ -180,12 +180,16 @@ func init() { }}, DEVPACK: {Help: "开发", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(WEBPACK, mdb.REMOVE) - m.Cmd(web.DREAM, nfs.GOWORK) + if ice.Info.NodeType == web.SERVER { + m.Cmd(web.DREAM, nfs.GOWORK) + } }}, WEBPACK: {Help: "打包", Hand: func(m *ice.Message, arg ...string) { m.Cmdy(WEBPACK, mdb.CREATE) - nfs.Trash(m, ice.GO_WORK_SUM) - nfs.Trash(m, ice.GO_WORK) + if ice.Info.NodeType == web.SERVER { + nfs.Trash(m, ice.GO_WORK_SUM) + nfs.Trash(m, ice.GO_WORK) + } }}, BINPACK: {Help: "打包", Hand: func(m *ice.Message, arg ...string) { const ( diff --git a/core/code/install.go b/core/code/install.go index 644f5340..9e7a5f1e 100644 --- a/core/code/install.go +++ b/core/code/install.go @@ -95,7 +95,8 @@ func _install_spawn(m *ice.Message, arg ...string) { defer m.Echo(target) kit.If(m.Option(INSTALL) == "" && nfs.Exists(m, kit.Path(source, _INSTALL)), func() { m.Option(INSTALL, _INSTALL) }) nfs.DirDeepAll(m.Spawn(), path.Join(source, m.Option(INSTALL)), "", func(value ice.Maps) { - m.Cmd(nfs.LINK, path.Join(target, value[nfs.PATH]), path.Join(source, m.Option(INSTALL), value[nfs.PATH]), kit.Dict(ice.LOG_DISABLE, ice.TRUE)) + m.Option(ice.MSG_COUNT, "1") + m.Cmd(nfs.LINK, path.Join(target, value[nfs.PATH]), path.Join(source, m.Option(INSTALL), value[nfs.PATH]), kit.Dict(ice.MSG_COUNT, "1", ice.LOG_DISABLE, ice.TRUE)) }) } func _install_start(m *ice.Message, arg ...string) {