1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-01-12 17:02:43 +08:00
parent dc9f44f90e
commit a12a4836b9
10 changed files with 31 additions and 22 deletions

View File

@ -18,23 +18,23 @@ func _command_list(m *ice.Message, name string) *ice.Message {
return m.Push(mdb.INDEX, name).Push(mdb.NAME, name).Push(mdb.HELP, "").Push(mdb.META, "").Push(mdb.LIST, "") return m.Push(mdb.INDEX, name).Push(mdb.NAME, name).Push(mdb.HELP, "").Push(mdb.META, "").Push(mdb.LIST, "")
} }
m.Spawn(m.Source()).Search(name, func(p *ice.Context, s *ice.Context, key string, cmd *ice.Command) { m.Spawn(m.Source()).Search(name, func(p *ice.Context, s *ice.Context, key string, cmd *ice.Command) {
// if _p, ok := ice.Info.Index[key].(*ice.Context); ok && _p.Prefix() == s.Prefix() {
// m.Push(mdb.INDEX, key)
// } else {
// m.Push(mdb.INDEX, kit.Keys(s.Prefix(), key))
// }
m.Push(mdb.INDEX, kit.Keys(s.Prefix(), key)) m.Push(mdb.INDEX, kit.Keys(s.Prefix(), key))
m.Push(mdb.NAME, kit.Format(cmd.Name)) m.Push(mdb.NAME, kit.Format(cmd.Name))
m.Push(mdb.HELP, kit.Format(cmd.Help)) m.Push(mdb.HELP, kit.Format(cmd.Help))
m.Push(mdb.LIST, kit.Format(cmd.List)) m.Push(mdb.LIST, kit.Format(cmd.List))
m.Push(mdb.META, kit.Format(cmd.Meta)) m.Push(mdb.META, kit.Format(cmd.Meta))
m.Push("_help", GetCmdHelp(m, name)) if _p, ok := ice.Info.Index[key].(*ice.Context); ok && _p.Prefix() == s.Prefix() {
m.Push("_command", key)
} else {
m.Push("_command", kit.Keys(s.Prefix(), key))
}
if !nfs.Exists(m, kit.Split(cmd.FileLine(), ":")[0], func(p string) { if !nfs.Exists(m, kit.Split(cmd.FileLine(), ":")[0], func(p string) {
m.Push("_fileline", kit.MergeURL(FileURI(p), ice.POD, m.Option(ice.MSG_USERPOD))) m.Push("_fileline", kit.MergeURL(FileURI(p), ice.POD, m.Option(ice.MSG_USERPOD)))
}) { }) {
m.Push("_fileline", "") m.Push("_fileline", "")
} }
m.Push("_role", kit.Select("", ice.OK, aaa.Right(m.Spawn(), name))) m.Push("_role", kit.Select("", ice.OK, aaa.Right(m.Spawn(), name)))
m.Push("_help", GetCmdHelp(m, name))
}) })
return m return m
} }

View File

@ -162,7 +162,7 @@ func init() {
}}, }},
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) { mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
if mdb.IsSearchPreview(m, arg) { if mdb.IsSearchPreview(m, arg) {
mdb.HashSelects(m.Spawn()).Table(func(value ice.Maps) { m.PushSearch(mdb.TEXT, m.MergePod(value[mdb.NAME]), value) }) mdb.HashSelects(m.Spawn()).Table(func(value ice.Maps) { m.PushSearch(mdb.TYPE, WORKER, mdb.TEXT, m.MergePod(value[mdb.NAME]), value) })
} }
}}, }},
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {

View File

@ -288,8 +288,7 @@ func init() {
} }
fallthrough fallthrough
case aaa.EMAIL: case aaa.EMAIL:
m.Push(arg[0], "shy@shylinux.com") m.Push(arg[0], "shy@shylinux.com", "shylinux@163.com")
m.Push(arg[0], "shylinux@163.com")
case aaa.PASSWORD: case aaa.PASSWORD:
m.SetAppend() m.SetAppend()
case "origin": case "origin":
@ -304,7 +303,8 @@ func init() {
m.Cmd(SPACE, pod, SPIDE, ice.DEV, CACHE, SHARE_CACHE+ls[0]) m.Cmd(SPACE, pod, SPIDE, ice.DEV, CACHE, SHARE_CACHE+ls[0])
} }
msg := m.Options(key, []string{}, ice.MSG_USERPOD, pod).Cmd(append(kit.List(ice.SPACE, pod), arg...)...) msg := m.Options(key, []string{}, ice.MSG_USERPOD, pod).Cmd(append(kit.List(ice.SPACE, pod), arg...)...)
kit.If(!msg.IsErr(), func() { m.Copy(msg) }) m.Copy(msg)
// kit.If(!msg.IsErr(), func() { m.Copy(msg) })
return true return true
} }
} }

View File

@ -21,7 +21,9 @@ func _action_exec(m *ice.Message, river, storm, index string, arg ...string) {
}).Length() == 0, ice.ErrNotRight, index, arg) { }).Length() == 0, ice.ErrNotRight, index, arg) {
return return
} }
kit.If(!ctx.PodCmd(m, index, arg), func() { m.Cmdy(index, arg) }) kit.If(!ctx.PodCmd(m, index, arg), func() {
m.Cmdy(index, arg)
})
} }
func _action_auth(m *ice.Message, share string) *ice.Message { func _action_auth(m *ice.Message, share string) *ice.Message {
msg := m.Cmd(web.SHARE, share) msg := m.Cmd(web.SHARE, share)

View File

@ -3,7 +3,7 @@ Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { can.isCmdMode() && can.onappend.style(can, html.OUTPUT) _init: function(can, msg) { can.isCmdMode() && can.onappend.style(can, html.OUTPUT)
can.onlayout.background(can, can.user.info.background||"/require/usr/icons/background.jpg", can._fields) can.onlayout.background(can, can.user.info.background||"/require/usr/icons/background.jpg", can._fields)
can.onimport._menu(can), can.onimport._notifications(can), can.onimport._searchs(can), can.onimport._dock(can) can.onimport._menu(can), can.onimport._notifications(can), can.onimport._searchs(can), can.onimport._dock(can)
can.sup.onexport.link = function() { return can.misc.MergeURL(can, {pod: can.ConfSpace(), cmd: web.DESKTOP}) } can.sup.onexport.link = function() { return can.misc.MergeURL(can, {pod: can.ConfSpace()||can.misc.Search(can, ice.POD), cmd: web.DESKTOP}) }
}, },
_menu: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.menu", style: html.OUTPUT}, function(sub) { can.ui.menu = sub _menu: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.menu", style: html.OUTPUT}, function(sub) { can.ui.menu = sub
var tabs = can.misc.sessionStorage(can, [can.ConfIndex(), html.TABS]) var tabs = can.misc.sessionStorage(can, [can.ConfIndex(), html.TABS])
@ -69,8 +69,9 @@ Volcanos(chat.ONIMPORT, {
item.height = can.ConfHeight()-125, item.width = can.ConfWidth()-200, item.left = (can.ConfWidth()-item.width)/2, item.top = 25 item.height = can.ConfHeight()-125, item.width = can.ConfWidth()-200, item.left = (can.ConfWidth()-item.width)/2, item.top = 25
if (can.ConfWidth() > 1400) { item.width = can.base.Min(can.ConfWidth()-600, 640, 1400), item.left = (can.ConfWidth()-item.width)/2 } if (can.ConfWidth() > 1400) { item.width = can.base.Min(can.ConfWidth()-600, 640, 1400), item.left = (can.ConfWidth()-item.width)/2 }
if (can.ConfHeight() > 800) { item.height = can.base.Min(can.ConfHeight()-200, 320, 800), item.top = 50 } if (can.ConfHeight() > 800) { item.height = can.base.Min(can.ConfHeight()-200, 320, 800), item.top = 50 }
if (can.user.isMobile) { item.left = 0, item.top = 25, item.height = can.ConfHeight()-125, item.width = can.ConfWidth() } if (can.user.isMobile) { item.height = can.ConfHeight()-125, item.top = 25, item.width = can.ConfWidth(), item.left = 0 }
item.height = can.base.Max(html.DESKTOP_HEIGHT, item.height), item.width = can.base.Max(html.DESKTOP_WIDTH, item.width) item.height = can.base.Max(html.DESKTOP_HEIGHT, item.height), item.width = can.base.Max(html.DESKTOP_WIDTH, item.width)
if (can.base.isIn(item.index, "web.code.vimer")) { item.width = can.base.Max(1600, can.ConfWidth()), item.left = (can.ConfWidth()-item.width)/2 }
can.onappend.plugin(can, item, function(sub) { can.ondetail.select(can, sub._target) can.onappend.plugin(can, item, function(sub) { can.ondetail.select(can, sub._target)
var index = 0; can.core.Item({ var index = 0; can.core.Item({
close: {color: "#f95f57", inner: "x", onclick: function(event) { sub.onaction._close(event, sub) }}, close: {color: "#f95f57", inner: "x", onclick: function(event) { sub.onaction._close(event, sub) }},

View File

@ -26,8 +26,8 @@ func _river_list(m *ice.Message) {
return return
} }
} }
m.Cmd(mdb.SELECT, m.PrefixKey(), "", mdb.HASH, ice.OptionFields(mdb.HASH, mdb.NAME, mdb.ICON), func(value ice.Maps) { m.Cmd(mdb.SELECT, m.PrefixKey(), "", mdb.HASH, ice.OptionFields(mdb.HASH, mdb.NAME, mdb.ICON, "main"), func(value ice.Maps) {
kit.If(_river_right(m, value[mdb.HASH]), func() { m.PushRecord(value, mdb.HASH, mdb.NAME, mdb.ICON) }) kit.If(_river_right(m, value[mdb.HASH]), func() { m.PushRecord(value, mdb.HASH, mdb.NAME, mdb.ICON, "main") })
}) })
m.Sort(mdb.NAME) m.Sort(mdb.NAME)
} }

View File

@ -79,10 +79,9 @@ func init() {
), Actions: ice.MergeActions(ice.Actions{ ), Actions: ice.MergeActions(ice.Actions{
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) { mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
if mdb.IsSearchPreview(m, arg) { if mdb.IsSearchPreview(m, arg) {
m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, ice.MAIN, mdb.TEXT, ice.SRC_MAIN_SH) kit.For([]string{ice.SRC_MAIN_SHY, ice.SRC_MAIN_SH, ice.SRC_MAIN_GO, ice.SRC_MAIN_JS}, func(p string) {
m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, ice.MAIN, mdb.TEXT, ice.SRC_MAIN_SHY) m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, path.Base(p), mdb.TEXT, p)
m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, ice.MAIN, mdb.TEXT, ice.SRC_MAIN_GO) })
m.PushSearch(mdb.TYPE, nfs.FILE, mdb.NAME, ice.MAIN, mdb.TEXT, ice.SRC_MAIN_JS)
} }
}}, }},
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {

View File

@ -76,8 +76,11 @@ func init() {
}) })
}}, }},
mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) { mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) {
mdb.IsSearchPreview(m, arg, func() []string { return []string{ssh.SHELL, SH, shell} }) if mdb.IsSearchPreview(m, arg) {
mdb.IsSearchPreview(m, arg, func() []string { return []string{ssh.SHELL, ISH, "/bin/ish"} }) kit.For([]string{shell, "/bin/ish"}, func(p string) {
m.PushSearch(mdb.TYPE, ssh.SHELL, mdb.NAME, path.Base(p), mdb.TEXT, p)
})
}
}}, }},
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
switch mdb.HashInputs(m, arg); arg[0] { switch mdb.HashInputs(m, arg); arg[0] {

View File

@ -76,7 +76,7 @@ func init() {
web.DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) { m.PushButton(kit.Dict(m.CommandKey(), "文档")) }}, web.DREAM_TABLES: {Hand: func(m *ice.Message, arg ...string) { m.PushButton(kit.Dict(m.CommandKey(), "文档")) }},
web.DREAM_ACTION: {Hand: func(m *ice.Message, arg ...string) { web.DreamProcess(m, nil, arg...) }}, web.DREAM_ACTION: {Hand: func(m *ice.Message, arg ...string) { web.DreamProcess(m, nil, arg...) }},
}, WikiAction("", nfs.SHY), mdb.HashAction(mdb.SHORT, nfs.PATH, mdb.FIELD, "time,path")), Hand: func(m *ice.Message, arg ...string) { }, WikiAction("", nfs.SHY), mdb.HashAction(mdb.SHORT, nfs.PATH, mdb.FIELD, "time,path")), Hand: func(m *ice.Message, arg ...string) {
if len(arg) > 0 { if len(arg) > 0 && !strings.HasPrefix(arg[0], nfs.SRC_DOCUMENT) {
mdb.HashCreate(m.Spawn(), nfs.PATH, arg[0]) mdb.HashCreate(m.Spawn(), nfs.PATH, arg[0])
} }
if len(arg) > 0 && strings.Contains(arg[0], nfs.DF) { if len(arg) > 0 && strings.Contains(arg[0], nfs.DF) {

View File

@ -492,6 +492,10 @@ func init() {
m.Sort(arg[0]) m.Sort(arg[0])
default: default:
switch arg[0] { switch arg[0] {
case ORIGIN:
m.Cmd(web.SPIDE, ice.OptionFields(web.CLIENT_ORIGIN), func(value ice.Maps) { m.Push(arg[0], value[web.CLIENT_ORIGIN]+web.X(path.Base(kit.Path("")))) })
m.Push(arg[0], kit.MergeURL2(web.UserHost(m), web.X(path.Base(kit.Path("")))))
m.Sort(arg[0])
case MESSAGE: case MESSAGE:
ls := kit.Split(m.Option(nfs.FILE), " /") ls := kit.Split(m.Option(nfs.FILE), " /")
m.Push(arg[0], kit.Select("", ls, -2)) m.Push(arg[0], kit.Select("", ls, -2))