diff --git a/base/ctx/command.go b/base/ctx/command.go index 0d221d97..e8c14463 100644 --- a/base/ctx/command.go +++ b/base/ctx/command.go @@ -76,9 +76,8 @@ func init() { }}, }, CmdAction(), aaa.RoleAction()), Hand: func(m *ice.Message, arg ...string) { if len(arg) == 0 { - m.Cmdy("", mdb.SEARCH, COMMAND, ice.OptionFields(INDEX)) + m.Cmdy("", mdb.SEARCH, COMMAND, ice.OptionFields(INDEX)).StatusTimeCount() DisplayStory(m.Options(nfs.DIR_ROOT, "ice."), "spide.js?split=.") - m.StatusTimeCount() return } kit.If(len(arg) == 0, func() { arg = append(arg, "") }) diff --git a/base/web/render.go b/base/web/render.go index 633a2df1..df7e83ac 100644 --- a/base/web/render.go +++ b/base/web/render.go @@ -141,7 +141,7 @@ func RenderVersion(m *ice.Message) string { if ice.Info.Make.Hash == "" { return "" } - return kit.Format("?_v=%s&_h=%s", ice.Info.Make.Version, ice.Info.Make.Hash[:8]) + return kit.Format("?_v=%s-%s", ice.Info.Make.Version, ice.Info.Make.Hash[:6]) } const ( diff --git a/base/web/share.go b/base/web/share.go index 275ca786..b0068c1f 100644 --- a/base/web/share.go +++ b/base/web/share.go @@ -72,7 +72,7 @@ func init() { mdb.HashCreate(m, arg, m.OptionSimple(ice.CMD), aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERROLE, m.Option(ice.MSG_USERROLE)) m.Option(mdb.LINK, _share_link(m, P(SHARE, m.Result()))) }}, - LOGIN: {Hand: func(m *ice.Message, arg ...string) { + LOGIN: {Help: "登录", Hand: func(m *ice.Message, arg ...string) { m.EchoQRCode(m.Cmd(SHARE, mdb.CREATE, mdb.TYPE, LOGIN).Option(mdb.LINK)).ProcessInner() }}, nfs.PS: {Hand: func(m *ice.Message, arg ...string) { diff --git a/core/chat/macos/applications.go b/core/chat/macos/applications.go index 726efa5a..c5e90b7f 100644 --- a/core/chat/macos/applications.go +++ b/core/chat/macos/applications.go @@ -22,13 +22,12 @@ func init() { FinderAppend(m, "Applications", m.PrefixKey()) AppInstall(m, "Finder", nfs.DIR) AppInstall(m, "Safari", web.CHAT_IFRAME) - AppInstall(m, "Calendar", web.TEAM_PLAN, ctx.ARGS, team.MONTH) AppInstall(m, "Terminal", web.CODE_XTERM) + AppInstall(m, "Calendar", web.TEAM_PLAN, ctx.ARGS, team.MONTH) AppInstall(m, "Grapher", web.WIKI_DRAW) AppInstall(m, "Photos", web.WIKI_FEEL) AppInstall(m, "Books", web.WIKI_WORD) AppInstall(m, "", web.CODE_VIMER) - AppInstall(m, "", web.DREAM, mdb.ICON, "usr/icons/Mission Control.png") }}, code.INSTALL: {Hand: func(m *ice.Message, arg ...string) { AppInstall(m, arg[0], arg[1], arg[2:]...) }}, }, CmdHashAction("index,args"))}, diff --git a/core/chat/macos/desktop.css b/core/chat/macos/desktop.css index da8a4298..b4788b96 100644 --- a/core/chat/macos/desktop.css +++ b/core/chat/macos/desktop.css @@ -3,7 +3,7 @@ fieldset.macos.desktop>div.output { overflow:hidden; } fieldset.macos.desktop>div.output>fieldset.macos { background-color:transparent; } fieldset.macos.desktop>div.output>fieldset.macos>div.output { background-color:transparent; } fieldset.macos.desktop>div.output>fieldset.macos.menu { line-height:25px; border-radius:0; height:25px; width:100%; position:absolute; top:0; overflow:hidden; } -fieldset.macos.desktop>div.output>fieldset.macos.searchs { position:absolute; } +fieldset.macos.desktop>div.output>fieldset.macos.searchs { position:absolute; z-index:100; } fieldset.macos.desktop>div.output>fieldset.macos.searchs>form.option>div.item.icon.delete { display:none; } fieldset.macos.desktop>div.output>fieldset.macos.searchs>form.option>div.item.keyword input { width:320px; background-color:transparent; border:#404141 solid 1px; } fieldset.macos.desktop>div.output>fieldset.macos.searchs>form.option>div.item.keyword:hover { background-color:transparent; } @@ -15,7 +15,7 @@ fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item div.titl fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item div.time { font-size:12px; margin-top:10px; width:48px; } fieldset.macos.desktop>div.output>fieldset.macos.notifications div.item div.content { width:180px; } fieldset.macos.desktop>div.output>fieldset.macos.dock { border:#ffffff3d solid 1px; border-radius:20px; position:absolute; bottom:10px; transition:margin-left 0.3s; } -fieldset.macos.desktop.cmd>div.output>fieldset.macos.dock { z-index:11; } +fieldset.macos.desktop.cmd>div.output>fieldset.macos.dock { z-index:101; } fieldset.macos.desktop>div.output>div.desktop { padding-top:25px; } fieldset.macos.desktop>div.output>div.desktop:not(.select) { display:none; } fieldset.macos.desktop>div.output>div.desktop>div.item { position:absolute; text-align:center; } @@ -83,7 +83,7 @@ body.dark fieldset.macos.desktop>div.output>div.desktop fieldset table.content t body.dark fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even) { background-color:#282B2F; } body.dark fieldset.macos.desktop>div.output>div.desktop fieldset>div.output.card>div.item { border:#3e4040 solid 1px; } body.dark fieldset.macos.desktop>div.output>div.desktop fieldset>div.output.card>div.item>div.title { border-bottom:#3e4040 solid 1px; } -body.dark fieldset.macos.desktop>div.output>div.desktop>fieldset>div.status { border-top:#3e4040 solid 1px; } +body.dark fieldset.macos.desktop>div.output>div.desktop>fieldset>div.status { border-top:#3e4040 solid 1px; overflow:hidden; } body.dark div.carte.macos.float { background-color:#29323beb; } body.black fieldset.macos.desktop>div.output>fieldset.macos.searchs a { color:cyan; } body.black fieldset.macos.desktop>div.output>div.desktop>fieldset { background-color:#3433337a; } diff --git a/core/chat/macos/desktop.js b/core/chat/macos/desktop.js index 09ff25ba..11f57e7a 100644 --- a/core/chat/macos/desktop.js +++ b/core/chat/macos/desktop.js @@ -57,9 +57,9 @@ Volcanos(chat.ONIMPORT, { if (can.ConfHeight() < 800) { item.top = 25, item.height = can.ConfHeight()-125, item.width = can.ConfWidth()-110 } if (can.user.isMobile) { item.left = 0, item.top = 25, item.height = can.ConfHeight()-125, item.width = can.ConfWidth() } can.onappend.plugin(can, item, function(sub) { can.ondetail.select(can, sub._target) - can.page.style(can, sub._target, html.MIN_WIDTH, 480) + // can.page.style(can, sub._target, html.MIN_WIDTH, 480) var index = 0; can.core.Item({ - "#f95f57": function(event) { sub.onaction.close(event, sub) }, + "#f95f57": function(event) { sub.onaction._close(event, sub) }, "#fcbc2f": function(event) { var dock = can.page.Append(can, can.ui.dock._output, [{view: html.ITEM, list: [{view: html.ICON, list: [{img: can.misc.PathJoin(item.icon)}]}], onclick: function() { can.onmotion.toggle(can, sub._target, true), can.page.Remove(can, dock) }}])._target; sub.onmotion.hidden(sub, sub._target) }, @@ -68,12 +68,15 @@ Volcanos(chat.ONIMPORT, { sub.onappend.desktop = function(item) { can.onimport._item(can, item) } sub.onappend.dock = function(item) { can.ui.dock.runAction(can.request(event, item), mdb.CREATE, [], function() { can.ui.dock.Update() }) } sub.onimport._open = function(sub, msg, arg) { can.onimport._window(can, {index: web.CHAT_IFRAME, args: [arg]}) } - sub.onexport.output = function() { if (item.index == "web.chat.macos.opens") { can.page.Remove(can, sub._target) } } + sub.onexport.output = function() { + if (item.index == "web.chat.macos.opens") { can.page.Remove(can, sub._target) } + sub.onimport.size(sub, item.height, can.base.Min(item.width, sub._target.offsetWidth), true) + }, sub.onimport.size(sub, item.height, can.base.Min(item.width, sub._target.offsetWidth), true) sub.onexport.record = function(sub, value, key, item) { can.onimport._window(can, item) } sub.onexport.marginTop = function() { return 25 } + sub.onexport.marginBottom = function() { return 100 } sub.onexport.actionHeight = function(sub) { return can.page.ClassList.has(can, sub._target, html.OUTPUT)? 0: html.ACTION_HEIGHT+20 }, can.onmotion.move(can, sub._target, {"z-index": 10, top: item.top, left: item.left}), sub.onmotion.resize(can, sub._target, function(height, width) { sub.onimport.size(sub, height, width) }, 25) - sub.onimport.size(sub, item.height, item.width, true) sub._target.onclick = function(event) { can.page.Select(can, sub._target.parentNode, html.FIELDSET, function(target) { can.page.style(can, target, "z-index", target == sub._target? "10": "9") }) } }, can.ui.desktop) }, diff --git a/core/chat/macos/opens.go b/core/chat/macos/opens.go index 5638fdb3..33f2f28d 100644 --- a/core/chat/macos/opens.go +++ b/core/chat/macos/opens.go @@ -1,10 +1,10 @@ package macos import ( - "strings" - ice "shylinux.com/x/icebergs" "shylinux.com/x/icebergs/base/cli" + "shylinux.com/x/icebergs/base/tcp" + kit "shylinux.com/x/toolkits" ) const OPENS = "opens" @@ -12,7 +12,8 @@ const OPENS = "opens" func init() { Index.MergeCommands(ice.Commands{ OPENS: {Name: "opens app auto", Hand: func(m *ice.Message, arg ...string) { - if strings.HasPrefix(m.Option(ice.MSG_USERWEB), "http://localhost:") { + if tcp.IsLocalHost(m, m.Option(ice.MSG_USERIP)) { + arg[0] = kit.ExtChange(arg[0], "app") cli.Opens(m, arg...) } }}, diff --git a/core/code/sh.go b/core/code/sh.go index 5087f7c3..03e7249d 100644 --- a/core/code/sh.go +++ b/core/code/sh.go @@ -35,6 +35,7 @@ func init() { SH: {Name: "sh path auto", Help: "命令", Actions: ice.MergeActions(ice.Actions{ mdb.SEARCH: {Hand: func(m *ice.Message, arg ...string) { if arg[0] == mdb.FOREACH && arg[1] == ssh.SHELL { + return m.Cmd(nfs.CAT, "/etc/shells", func(text string) { kit.If(text != "" && !strings.HasPrefix(text, "#"), func() { m.PushSearch(mdb.TYPE, ssh.SHELL, mdb.NAME, path.Base(text), mdb.TEXT, path.Base(text)) }) }) diff --git a/core/code/xterm.go b/core/code/xterm.go index a2ed5b6d..3d6c94d0 100644 --- a/core/code/xterm.go +++ b/core/code/xterm.go @@ -72,7 +72,7 @@ const XTERM = "xterm" func init() { Index.MergeCommands(ice.Commands{ - XTERM: {Name: "xterm hash auto", Help: "命令行", Actions: ice.MergeActions(ice.Actions{ + XTERM: {Name: "xterm hash auto terminal", Help: "命令行", Actions: ice.MergeActions(ice.Actions{ ice.CTX_INIT: {Hand: func(m *ice.Message, arg ...string) { kit.If(m.Cmd("").Length() == 0, func() { m.Cmd("", mdb.CREATE, mdb.TYPE, ISH) }) }}, @@ -83,7 +83,7 @@ func init() { mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { switch mdb.HashInputs(m, arg); arg[0] { case mdb.TYPE: - m.Push(arg[0], ISH, SH) + m.Push(arg[0], "/bin/ish", kit.Select("/bin/sh", os.Getenv("SHELL"))) m.Cmd(mdb.SEARCH, mdb.FOREACH, ssh.SHELL, ice.OptionFields("type,name,text"), func(value ice.Maps) { kit.If(value[mdb.TYPE] == ssh.SHELL, func() { m.Push(arg[0], value[mdb.TEXT]) }) }) @@ -125,6 +125,7 @@ func init() { ctx.PROCESS: {Hand: func(m *ice.Message, arg ...string) { ctx.ProcessField(m, m.PrefixKey(), func() string { return m.Cmdx("", mdb.CREATE, arg) }, arg...) }}, + "terminal": {Help: "本机", Hand: func(m *ice.Message, arg ...string) { m.Cmd("cli.system", "opens", "Terminal.app") }}, }, ctx.CmdAction(), ctx.ProcessAction(), mdb.ImportantHashAction(mdb.FIELD, "time,hash,type,name,text,path,theme,daemon")), Hand: func(m *ice.Message, arg ...string) { if mdb.HashSelect(m, arg...); len(arg) == 0 { if m.Length() == 0 { diff --git a/init.go b/init.go index 8723cdac..a61d87ee 100644 --- a/init.go +++ b/init.go @@ -42,8 +42,8 @@ func (s *Frame) Close(m *Message, arg ...string) { const ( INIT = "init" - QUIT = "quit" EXIT = "exit" + QUIT = "quit" ) var Index = &Context{Name: ICE, Help: "冰山模块", Commands: Commands{ diff --git a/misc/git/repos.go b/misc/git/repos.go index d9123c4c..4bc63f04 100644 --- a/misc/git/repos.go +++ b/misc/git/repos.go @@ -406,7 +406,7 @@ func init() { git.PlainInit(m.Option(nfs.PATH), false) _repos_insert(m, kit.Path("")) }}, - CLONE: {Name: "clone origin* branch name path", Hand: func(m *ice.Message, arg ...string) { + CLONE: {Name: "clone origin* branch name path", Help: "克隆", Hand: func(m *ice.Message, arg ...string) { m.OptionDefault(mdb.NAME, path.Base(m.Option(ORIGIN))) m.OptionDefault(nfs.PATH, path.Join(path.Join(nfs.USR, m.Option(mdb.NAME)))) if _, err := git.PlainClone(m.Option(nfs.PATH), false, &git.CloneOptions{URL: m.Option(ORIGIN)}); m.Warn(err) { @@ -478,7 +478,7 @@ func init() { m.Warn(err) } }}, - STATUS: {Hand: func(m *ice.Message, arg ...string) { + STATUS: {Help: "状态", Hand: func(m *ice.Message, arg ...string) { if repos := kit.Select(m.Option(REPOS), arg, 0); repos != "" { _repos_status(m, repos, _repos_open(m, repos)) } else {