mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
add language
This commit is contained in:
parent
c286f0e464
commit
142ae19c04
@ -93,7 +93,7 @@ func init() {
|
||||
SYSTEM: {Name: SYSTEM, Help: "系统命令", Value: kit.Data()},
|
||||
},
|
||||
Commands: map[string]*ice.Command{
|
||||
SYSTEM: {Name: "system cmd= 执行:button", Help: "系统命令", Hand: func(m *ice.Message, c *ice.Context, key string, arg ...string) {
|
||||
SYSTEM: {Name: "system cmd= run:button", Help: "系统命令", Hand: func(m *ice.Message, c *ice.Context, key string, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
m.Fields(len(arg), "time,id,cmd")
|
||||
m.Cmdy(mdb.SELECT, SYSTEM, "", mdb.LIST)
|
||||
|
@ -368,21 +368,21 @@ func init() {
|
||||
m.Cmdy(mdb.SELECT, SOURCE, kit.Keys(kit.MDB_HASH, arg[0]), mdb.LIST, kit.MDB_ID, arg[1:])
|
||||
m.PushAction(mdb.REPEAT)
|
||||
}},
|
||||
TARGET: {Name: "target name 执行:button", Help: "当前模块", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
TARGET: {Name: "target name run:button", Help: "当前模块", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
f := m.Target().Server().(*Frame)
|
||||
m.Search(arg[0]+".", func(p *ice.Context, s *ice.Context, key string) { f.target = s })
|
||||
f.prompt(m)
|
||||
}},
|
||||
PROMPT: {Name: "prompt arg 执行:button", Help: "命令提示", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
PROMPT: {Name: "prompt arg run:button", Help: "命令提示", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
f := m.Target().Server().(*Frame)
|
||||
f.ps1 = arg
|
||||
f.prompt(m)
|
||||
}},
|
||||
PRINTF: {Name: "printf 执行:button text:textarea", Help: "输出显示", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
PRINTF: {Name: "printf run:button text:textarea", Help: "输出显示", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
f := m.Target().Server().(*Frame)
|
||||
f.printf(m, arg[0])
|
||||
}},
|
||||
SCREEN: {Name: "screen 执行:button text:textarea", Help: "输出命令", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
SCREEN: {Name: "screen run:button text:textarea", Help: "输出命令", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
f := m.Target().Server().(*Frame)
|
||||
for _, line := range kit.Split(arg[0], "\n", "\n", "\n") {
|
||||
f.printf(m, line+"\n")
|
||||
|
@ -72,7 +72,7 @@ func _serve_main(m *ice.Message, w http.ResponseWriter, r *http.Request) bool {
|
||||
}
|
||||
|
||||
// 文件接口
|
||||
if ice.Dump(w, r.URL.Path, func(name string) { RenderType(w, name, "") }) {
|
||||
if m.Conf(SERVE, kit.Keym("dump")) != ice.FALSE && ice.Dump(w, r.URL.Path, func(name string) { RenderType(w, name, "") }) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
|
@ -335,7 +335,7 @@ func init() {
|
||||
)},
|
||||
},
|
||||
Commands: map[string]*ice.Command{
|
||||
SPIDE: {Name: "spide client.name action=raw,msg,save,cache method=GET,PUT,POST,DELETE url format=form,part,json,data,file arg 执行:button create", Help: "蜘蛛侠", Action: ice.MergeAction(map[string]*ice.Action{
|
||||
SPIDE: {Name: "spide client.name action=raw,msg,save,cache method=GET,PUT,POST,DELETE url format=form,part,json,data,file arg run:button create", Help: "蜘蛛侠", Action: ice.MergeAction(map[string]*ice.Action{
|
||||
mdb.CREATE: {Name: "create name address", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||
_spide_create(m, m.Option(kit.MDB_NAME), m.Option(ADDRESS))
|
||||
}},
|
||||
@ -349,14 +349,14 @@ func init() {
|
||||
_spide_show(m, arg...)
|
||||
}},
|
||||
|
||||
SPIDE_GET: {Name: "GET url key value 执行:button", Help: "蜘蛛侠", Action: map[string]*ice.Action{
|
||||
SPIDE_GET: {Name: "GET url key value run:button", Help: "蜘蛛侠", Action: map[string]*ice.Action{
|
||||
mdb.REMOVE: {Name: "remove", Help: "删除", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(mdb.DELETE, SPIDE, "", mdb.HASH, CLIENT_NAME, m.Option(CLIENT_NAME))
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Echo(kit.Formats(kit.UnMarshal(m.Cmdx(SPIDE, SPIDE_DEV, SPIDE_RAW, SPIDE_GET, arg[0], arg[1:]))))
|
||||
}},
|
||||
SPIDE_POST: {Name: "POST url key value 执行:button", Help: "蜘蛛侠", Action: map[string]*ice.Action{
|
||||
SPIDE_POST: {Name: "POST url key value run:button", Help: "蜘蛛侠", Action: map[string]*ice.Action{
|
||||
mdb.REMOVE: {Name: "remove", Help: "删除", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(mdb.DELETE, SPIDE, "", mdb.HASH, CLIENT_NAME, m.Option(CLIENT_NAME))
|
||||
}},
|
||||
|
@ -31,7 +31,7 @@ func init() {
|
||||
}
|
||||
m.Cmdy(ctx.COMMAND, arg[0])
|
||||
}},
|
||||
cli.RUN: {Name: "command", Help: "执行", Hand: func(m *ice.Message, arg ...string) {
|
||||
cli.RUN: {Name: "run", Help: "执行", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(arg)
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
|
@ -79,10 +79,10 @@ func init() {
|
||||
CHECK: {Name: "check", Help: "登录检查", Hand: func(m *ice.Message, arg ...string) {
|
||||
_header_check(m, arg...)
|
||||
}},
|
||||
SHARE: {Name: "share type", Help: "扫码登录", Hand: func(m *ice.Message, arg ...string) {
|
||||
SHARE: {Name: "share type", Help: "共享", Hand: func(m *ice.Message, arg ...string) {
|
||||
_header_share(m, arg...)
|
||||
}},
|
||||
GRANT: {Name: "grant space", Help: "扫码授权", Hand: func(m *ice.Message, arg ...string) {
|
||||
GRANT: {Name: "grant space", Help: "授权", Hand: func(m *ice.Message, arg ...string) {
|
||||
_header_grant(m, arg...)
|
||||
}},
|
||||
|
||||
|
@ -26,7 +26,7 @@ func init() {
|
||||
m.Cmdy(ctx.COMMAND, arg[0])
|
||||
}
|
||||
}},
|
||||
cli.RUN: {Name: "command", Help: "执行", Hand: func(m *ice.Message, arg ...string) {
|
||||
cli.RUN: {Name: "run", Help: "执行", Hand: func(m *ice.Message, arg ...string) {
|
||||
if !m.PodCmd(arg) {
|
||||
m.Cmdy(arg)
|
||||
}
|
||||
|
@ -63,8 +63,8 @@ func init() {
|
||||
RIVER: {Name: RIVER, Help: "群组", Value: kit.Data(
|
||||
kit.MDB_PATH, ice.USR_LOCAL_RIVER,
|
||||
MENUS, `["river",
|
||||
["添加", "创建群组", "添加应用", "添加工具", "添加设备", "创建空间"],
|
||||
["共享", "共享群组", "共享应用", "共享工具", "共享主机", "访问空间"]
|
||||
["create", "创建群组", "添加应用", "添加工具", "添加设备", "创建空间"],
|
||||
["share", "共享群组", "共享应用", "共享工具", "共享主机", "访问空间"]
|
||||
]`,
|
||||
)},
|
||||
},
|
||||
|
@ -26,7 +26,7 @@ func init() {
|
||||
)},
|
||||
},
|
||||
Commands: map[string]*ice.Command{
|
||||
COMPILE: {Name: "compile arch=amd64,386,arm os=linux,darwin,windows src=src/main.go@key 执行:button", Help: "编译", Action: map[string]*ice.Action{
|
||||
COMPILE: {Name: "compile arch=amd64,386,arm os=linux,darwin,windows src=src/main.go@key run:button", Help: "编译", Action: map[string]*ice.Action{
|
||||
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(nfs.DIR, "src", "path,size,time", ice.Option{nfs.DIR_REG, `.*\.go$`})
|
||||
m.Sort(kit.MDB_PATH)
|
||||
|
@ -27,7 +27,7 @@ func init() {
|
||||
))},
|
||||
},
|
||||
Commands: map[string]*ice.Command{
|
||||
UPGRADE: {Name: "upgrade item=system,source 执行:button", Help: "升级", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
UPGRADE: {Name: "upgrade item=system,source run:button", Help: "升级", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Grows(cmd, kit.Keys(kit.MDB_HASH, kit.Select(cli.SYSTEM, arg, 0)), "", "", func(index int, value map[string]interface{}) {
|
||||
if value[kit.MDB_PATH] == ice.BIN_ICE_BIN { // 程序文件
|
||||
value[kit.MDB_FILE] = kit.Keys("ice", m.Conf(cli.RUNTIME, "host.GOOS"), m.Conf(cli.RUNTIME, "host.GOARCH"))
|
||||
|
@ -16,7 +16,7 @@ const VIMER = "vimer"
|
||||
|
||||
func init() {
|
||||
Index.Merge(&ice.Context{Commands: map[string]*ice.Command{
|
||||
VIMER: {Name: "vimer path=src/ file=main.go line=1 刷新:button=auto save", Help: "编辑器", Meta: kit.Dict(
|
||||
VIMER: {Name: "vimer path=src/ file=main.go line=1 refresh:button=auto save", Help: "编辑器", Meta: kit.Dict(
|
||||
ice.Display("/plugin/local/code/vimer.js", "editor"),
|
||||
), Action: map[string]*ice.Action{
|
||||
mdb.ENGINE: {Name: "engine", Help: "运行", Hand: func(m *ice.Message, arg ...string) {
|
||||
|
@ -18,7 +18,7 @@ func init() {
|
||||
)},
|
||||
},
|
||||
Commands: map[string]*ice.Command{
|
||||
DRAW: {Name: "draw path=src/main.svg 刷新:button=auto 编辑 save 项目 参数", Help: "思维导图", Meta: kit.Dict(
|
||||
DRAW: {Name: "draw path=src/main.svg refresh:button=auto 编辑 save 项目 参数", Help: "思维导图", Meta: kit.Dict(
|
||||
ice.Display("/plugin/local/wiki/draw.js"),
|
||||
), Action: map[string]*ice.Action{
|
||||
nfs.SAVE: {Name: "save path", Help: "保存", Hand: func(m *ice.Message, arg ...string) {
|
||||
|
@ -63,9 +63,10 @@ func init() {
|
||||
),
|
||||
)},
|
||||
}, Commands: map[string]*ice.Command{
|
||||
WORD: {Name: "word path=src/main.shy auto 演示", Help: "语言文字", Meta: kit.Dict(
|
||||
WORD: {Name: "word path=src/main.shy auto play", Help: "语言文字", Meta: kit.Dict(
|
||||
ice.Display("/plugin/local/wiki/word.js", WORD),
|
||||
), Action: ice.MergeAction(map[string]*ice.Action{
|
||||
"play": {Name: "play", Help: "演示"},
|
||||
web.STORY: {Name: "story", Help: "运行", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(arg[0], ctx.ACTION, cli.RUN, arg[2:])
|
||||
}},
|
||||
|
4
misc.go
4
misc.go
@ -378,8 +378,8 @@ func (c *Context) split(key string, cmd *Command, name string) []interface{} {
|
||||
list = append(list, kit.List(kit.MDB_INPUT, BUTTON, kit.MDB_NAME, "next")...)
|
||||
continue
|
||||
case "auto":
|
||||
list = append(list, kit.List(kit.MDB_INPUT, BUTTON, kit.MDB_NAME, "查看", kit.MDB_VALUE, "auto")...)
|
||||
list = append(list, kit.List(kit.MDB_INPUT, BUTTON, kit.MDB_NAME, "返回")...)
|
||||
list = append(list, kit.List(kit.MDB_INPUT, BUTTON, kit.MDB_NAME, "list", kit.MDB_VALUE, "auto")...)
|
||||
list = append(list, kit.List(kit.MDB_INPUT, BUTTON, kit.MDB_NAME, "back")...)
|
||||
button = true
|
||||
continue
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ func Render(m *Message, cmd string, args ...interface{}) string {
|
||||
list := []string{}
|
||||
for _, k := range kit.Split(kit.Join(arg)) {
|
||||
list = append(list, kit.Format(`<input type="button" name="%s" value="%s">`,
|
||||
k, kit.Select(k, kit.Value(m._cmd.Meta, kit.Keys("_trans", k)))))
|
||||
k, kit.Select(k, kit.Value(m._cmd.Meta, kit.Keys("_trans", k)), m.Option("language") != "en")))
|
||||
}
|
||||
return kit.Join(list, " ")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user