1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-04-30 02:35:03 +08:00
parent 172e734f76
commit e2babe49a6
4 changed files with 26 additions and 6 deletions

View File

@ -112,12 +112,26 @@ func init() {
nfs.Trash(m, m.Cmdx(arg[0], mdb.EXPORT)) nfs.Trash(m, m.Cmdx(arg[0], mdb.EXPORT))
mdb.Config(m, arg[0], nil, nil) 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) { }, Hand: func(m *ice.Message, arg ...string) {
if len(arg) == 0 { if len(arg) == 0 {
_config_list(m) _config_list(m)
} else { } else {
_config_make(m, arg[0], arg[1:]...) _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) DisplayStoryJSON(m)
} }
}}, }},

View File

@ -91,7 +91,8 @@ func PushNoticeRich(m *ice.Message, arg ...ice.Any) {
PushNotice(m.StatusTimeCount(), kit.Simple("rich", arg)) PushNotice(m.StatusTimeCount(), kit.Simple("rich", arg))
} }
func PushStream(m *ice.Message) *ice.Message { 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 return m
} }
func init() { ice.Info.PushNotice = PushNotice } func init() { ice.Info.PushNotice = PushNotice }

View File

@ -180,12 +180,16 @@ func init() {
}}, }},
DEVPACK: {Help: "开发", Hand: func(m *ice.Message, arg ...string) { DEVPACK: {Help: "开发", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(WEBPACK, mdb.REMOVE) m.Cmdy(WEBPACK, mdb.REMOVE)
if ice.Info.NodeType == web.SERVER {
m.Cmd(web.DREAM, nfs.GOWORK) m.Cmd(web.DREAM, nfs.GOWORK)
}
}}, }},
WEBPACK: {Help: "打包", Hand: func(m *ice.Message, arg ...string) { WEBPACK: {Help: "打包", Hand: func(m *ice.Message, arg ...string) {
m.Cmdy(WEBPACK, mdb.CREATE) m.Cmdy(WEBPACK, mdb.CREATE)
if ice.Info.NodeType == web.SERVER {
nfs.Trash(m, ice.GO_WORK_SUM) nfs.Trash(m, ice.GO_WORK_SUM)
nfs.Trash(m, ice.GO_WORK) nfs.Trash(m, ice.GO_WORK)
}
}}, }},
BINPACK: {Help: "打包", Hand: func(m *ice.Message, arg ...string) { BINPACK: {Help: "打包", Hand: func(m *ice.Message, arg ...string) {
const ( const (

View File

@ -95,7 +95,8 @@ func _install_spawn(m *ice.Message, arg ...string) {
defer m.Echo(target) defer m.Echo(target)
kit.If(m.Option(INSTALL) == "" && nfs.Exists(m, kit.Path(source, _INSTALL)), func() { m.Option(INSTALL, _INSTALL) }) 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) { 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) { func _install_start(m *ice.Message, arg ...string) {