From 4f817911ccda4ca1524d4df8c13ad8c88d7035b9 Mon Sep 17 00:00:00 2001 From: shy Date: Fri, 19 Jan 2024 14:11:31 +0800 Subject: [PATCH] add some --- base/aaa/role.go | 3 --- core/chat/macos/desktop.css | 2 ++ core/chat/macos/desktop.js | 14 +++++++++----- core/code/css.go | 5 +++++ core/code/go.go | 4 ++++ core/code/html.go | 7 ++++++- core/code/js.go | 2 +- 7 files changed, 27 insertions(+), 10 deletions(-) diff --git a/base/aaa/role.go b/base/aaa/role.go index 8f8bb043..104416eb 100644 --- a/base/aaa/role.go +++ b/base/aaa/role.go @@ -27,9 +27,6 @@ func _role_black(m *ice.Message, role, key string) { _role_set(m, role, BLACK, k func _role_check(value ice.Map, key []string, ok bool) bool { white, black := value[WHITE].(ice.Map), value[BLACK].(ice.Map) for i := 0; i < len(key); i++ { - ice.Pulse.Info("debug what %v", kit.Join(key[:i+1], ice.PT)) - ice.Pulse.Info("debug what %v", white[kit.Join(key[:i+1], ice.PT)]) - ice.Pulse.Info("debug what %v", black[kit.Join(key[:i+1], ice.PT)]) kit.If(white[kit.Join(key[:i+1], ice.PT)], func() { ok = true }) kit.If(black[kit.Join(key[:i+1], ice.PT)], func() { ok = false }) } diff --git a/core/chat/macos/desktop.css b/core/chat/macos/desktop.css index 4d6f838f..30080fb5 100644 --- a/core/chat/macos/desktop.css +++ b/core/chat/macos/desktop.css @@ -44,6 +44,7 @@ fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.icon { ma fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.list.icons { margin:var(--button-margin) 0; } fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.back.icons { margin:var(--button-margin) 0; } fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.item:last-child { margin-right:100px; } +body.width2 fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>div.item:last-child { margin-right:0; } fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.item:last-child { margin-right:100px; } fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>* { margin:var(--button-margin) var(--input-margin); } fieldset.macos.desktop>div.output>div.desktop>fieldset>div.action>div.tabs { display:none; } @@ -60,6 +61,7 @@ fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.location>div.act fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>div.item.style select { width:80px; } fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>div.item.feature select { width:60px; } fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>form.option>div.item.hash>input { width:var(--river-width); } +body.width2 fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>form.option>div.item.hash>input { width:var(--input-width); } fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.status { display:none; } fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.output div.item.disable { display:none; } fieldset.macos.desktop>div.output>fieldset.web.chat.macos.dock>div.output div.item.disable { display:none; } diff --git a/core/chat/macos/desktop.js b/core/chat/macos/desktop.js index 9db6638f..84da4217 100644 --- a/core/chat/macos/desktop.js +++ b/core/chat/macos/desktop.js @@ -32,8 +32,7 @@ Volcanos(chat.ONIMPORT, { sub.onexport.record = function(sub, value, key, item) { can.onimport._window(can, item) } }) }, _searchs: function(can) { can.onappend.plugin(can, {index: "web.chat.macos.searchs"}, function(sub) { can.ui.searchs = sub, can.onmotion.hidden(can, sub._target) - can.page.style(can, sub._target, html.LEFT, can.ConfWidth()/4, html.TOP, can.ConfHeight()/4), sub.onimport.size(sub, can.ConfHeight()/2, can.ConfWidth()/2, true) - can.user.isMobile && can.page.style(can, sub._target, html.LEFT, 0, html.TOP, 0), can.user.isMobile && sub.onimport.size(sub, can.ConfHeight(), can.ConfWidth(), true) + can.page.style(can, sub._target, html.LEFT, can.ConfWidth()/4, html.TOP, can.ConfHeight()/4), sub.onimport.size(sub, can.ConfHeight()/2, can.ConfWidth()/2, true); sub.onaction._close = function() { can.onmotion.hidden(can, sub._target) }, can.onmotion.hidden(can, sub._target) sub.onexport.record = function(sub, value, key, item, event) { switch (item.type) { case ice.CMD: can.onimport._window(can, {index: item.name, args: can.base.Obj(item.text) }); break @@ -70,6 +69,7 @@ Volcanos(chat.ONIMPORT, { _window: function(can, item, cb) { if (!item.index) { return } 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() < 800) { item.width = can.ConfWidth(), item.left = 0 } if (can.ConfHeight() > 800) { item.height = can.base.Min(can.ConfHeight()-200, 320, 800), item.top = 50 } 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) @@ -120,9 +120,13 @@ Volcanos(chat.ONIMPORT, { }, [""]) Volcanos(chat.ONACTION, { _search: function(can) { var sub = can.ui.searchs; if (can.onmotion.toggle(can, sub._target)) { - sub.onimport.size(sub, can.ConfHeight()/2, can.ConfWidth()/2, true) - sub.onimport.size(sub, can.ConfHeight()/2, can.base.Min(sub._target.offsetWidth, can.ConfWidth()/2, can.ConfWidth()), true) - can.page.style(can, sub._target, html.LEFT, (can.ConfWidth()-sub._target.offsetWidth)/2, html.TOP, can.ConfHeight()/4) + if (can.user.isMobile || can.ConfWidth() < 800) { + can.page.style(can, sub._target, html.LEFT, 0, html.TOP, 25) + sub.onimport.size(sub, can.ConfHeight()-115, can.ConfWidth(), true) + } else { + can.page.style(can, sub._target, html.LEFT, (can.ConfWidth()-sub._target.offsetWidth)/2, html.TOP, can.ConfHeight()/4) + sub.onimport.size(sub, can.ConfHeight()/2, can.base.Min(sub._target.offsetWidth, can.ConfWidth()/2, can.ConfWidth()), true) + } can.page.Select(can, sub._option, "input[name=keyword]", function(target) { can.onmotion.focus(can, target) }) } }, create: function(event, can) { can.onimport._desktop(can) }, diff --git a/core/code/css.go b/core/code/css.go index 49b75d3d..07b4d767 100644 --- a/core/code/css.go +++ b/core/code/css.go @@ -8,6 +8,7 @@ import ( "shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/nfs" + "shylinux.com/x/icebergs/base/web" kit "shylinux.com/x/toolkits" ) @@ -17,6 +18,10 @@ func _css_stat(m *ice.Message, zone string, stats map[string]int) { m.Copy(msg.SortIntR(mdb.VALUE)) } func _css_show(m *ice.Message, arg ...string) { + if arg[1] == "main.css" { + m.EchoIFrame(m.MergePodCmd("", web.ADMIN)) + return + } zone, stats_key, stats_value := "", map[string]int{}, map[string]int{} m.Cmd(nfs.CAT, path.Join(arg[2], arg[1]), func(line string) { if line = strings.TrimSpace(line); line == "" || strings.HasPrefix(line, "//") || strings.HasPrefix(line, "/*") { diff --git a/core/code/go.go b/core/code/go.go index f0d67f51..a2707433 100644 --- a/core/code/go.go +++ b/core/code/go.go @@ -64,6 +64,10 @@ func _go_navigate(m *ice.Message, arg ...string) { func _go_show(m *ice.Message, arg ...string) { if arg[1] == MAIN_GO { ProcessXterm(m, kit.JoinWord("ish", arg[1]), "", "") + } else if arg[1] == "version.go" { + ctx.ProcessField(m, cli.RUNTIME, kit.Simple()) + } else if arg[1] == "binpack.go" { + ctx.ProcessField(m, nfs.PACK, kit.Simple()) } else if cmd := ctx.GetFileCmd(path.Join(arg[2], arg[1])); cmd != "" { ctx.ProcessField(m, cmd, kit.Simple()) } else if msg := m.Cmd(yac.STACK, path.Join(arg[2], arg[1])); msg.Option("__index") != "" { diff --git a/core/code/html.go b/core/code/html.go index f2eab18b..1b6fc872 100644 --- a/core/code/html.go +++ b/core/code/html.go @@ -6,6 +6,7 @@ import ( ice "shylinux.com/x/icebergs" "shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/nfs" + "shylinux.com/x/icebergs/base/web" kit "shylinux.com/x/toolkits" ) @@ -17,7 +18,11 @@ func init() { Index.MergeCommands(ice.Commands{ HTML: {Actions: ice.MergeActions(ice.Actions{ mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) { - m.EchoIFrame(m.MergeLink(require(arg[2], arg[1]), "_v", kit.Hashs(mdb.UNIQ))) + if arg[1] == "main.html" { + m.EchoIFrame(m.MergePodCmd("", web.ADMIN)) + } else { + m.EchoIFrame(m.MergeLink(require(arg[2], arg[1]), "_v", kit.Hashs(mdb.UNIQ))) + } }}, mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) { m.EchoIFrame(m.MergeLink(require(arg[2], arg[1]), "_v", kit.Hashs(mdb.UNIQ))) diff --git a/core/code/js.go b/core/code/js.go index 00a4d4c0..a0d0e1ca 100644 --- a/core/code/js.go +++ b/core/code/js.go @@ -14,7 +14,7 @@ import ( func _js_show(m *ice.Message, arg ...string) { if arg[1] == MAIN_JS { - ctx.ProcessField(m, web.CHAT_IFRAME, kit.Simple(web.UserHost(m))) + ctx.ProcessField(m, web.CHAT_IFRAME, kit.Simple(m.MergePodCmd("", web.ADMIN))) } else if arg[2] == ice.USR_VOLCANOS { if strings.HasPrefix(arg[1], "publish/client/mp/") { ctx.ProcessField(m, "web.chat.wx.ide", nil)