mirror of
https://shylinux.com/x/icebergs
synced 2025-04-25 17:18:05 +08:00
opt some
This commit is contained in:
parent
aac3c4a3d3
commit
08a56cfeb1
@ -3,20 +3,20 @@ package code
|
||||
import (
|
||||
ice "github.com/shylinux/icebergs"
|
||||
"github.com/shylinux/icebergs/base/web"
|
||||
kit "github.com/shylinux/toolkits"
|
||||
)
|
||||
|
||||
const CODE = "code"
|
||||
|
||||
var Index = &ice.Context{Name: CODE, Help: "编程中心",
|
||||
Configs: map[string]*ice.Config{},
|
||||
Commands: map[string]*ice.Command{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Load()
|
||||
m.Conf(PUBLISH, "meta.contexts", _contexts)
|
||||
}},
|
||||
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save() }},
|
||||
},
|
||||
}
|
||||
var Index = &ice.Context{Name: CODE, Help: "编程中心", Commands: map[string]*ice.Command{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Load()
|
||||
m.Conf(PUBLISH, kit.Keym("contexts"), _contexts)
|
||||
}},
|
||||
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Save()
|
||||
}},
|
||||
}}
|
||||
|
||||
func init() {
|
||||
web.Index.Register(Index, &web.Frame{},
|
||||
|
@ -19,6 +19,10 @@ func init() {
|
||||
"display", "/plugin/local/code/vimer.js", "style", "editor",
|
||||
), Action: map[string]*ice.Action{
|
||||
mdb.ENGINE: {Name: "engine", Help: "运行", Hand: func(m *ice.Message, arg ...string) {
|
||||
if m.Cmdy(mdb.ENGINE, arg); len(m.Resultv()) > 0 || len(m.Appendv(ice.MSG_APPEND)) > 0 {
|
||||
return
|
||||
}
|
||||
|
||||
if arg = kit.Split(strings.Join(arg, " ")); !m.Warn(!m.Right(arg)) {
|
||||
if m.Cmdy(arg); len(m.Appendv(ice.MSG_APPEND)) == 0 && len(m.Resultv()) == 0 {
|
||||
m.Cmdy(cli.SYSTEM, arg)
|
||||
|
@ -37,8 +37,8 @@ func init() {
|
||||
_task_inputs(m, kit.Select("", arg, 0), kit.Select("", arg, 1))
|
||||
}},
|
||||
|
||||
mdb.PLUGIN: {Name: "plugin extra.pod extra.ctx extra.cmd extra.arg", Help: "插件", Hand: func(m *ice.Message, arg ...string) {
|
||||
_task_modify(m, m.Option(kit.MDB_ZONE), m.Option(kit.MDB_ID), kit.MDB_TIME, m.Time(), kit.Simple(kit.KeyValue(nil, "", kit.Dict(arg)))...)
|
||||
mdb.PLUGIN: {Name: "plugin extra.ctx extra.cmd extra.arg", Help: "插件", Hand: func(m *ice.Message, arg ...string) {
|
||||
_task_modify(m, m.Option(kit.MDB_ZONE), m.Option(kit.MDB_ID), kit.MDB_TIME, m.Time(), arg...)
|
||||
m.Set(ice.MSG_RESULT).Cmdy(PLAN, m.Option("scale"))
|
||||
}},
|
||||
ctx.COMMAND: {Name: "command", Help: "命令", Hand: func(m *ice.Message, arg ...string) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user