From 65edaa6c17c876ea75ae35536d03d3ff522b11f3 Mon Sep 17 00:00:00 2001 From: shylinux Date: Sun, 16 Jul 2023 22:18:57 +0800 Subject: [PATCH] opt some --- base/cli/forever.go | 2 ++ core/chat/macos/desktop.css | 3 +++ core/chat/macos/desktop.js | 2 +- misc/git/repos.go | 5 ++++- misc/git/status.go | 5 +---- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/base/cli/forever.go b/base/cli/forever.go index 2622de69..c19a130e 100644 --- a/base/cli/forever.go +++ b/base/cli/forever.go @@ -25,7 +25,9 @@ func BinPath(arg ...string) string { kit.If(strings.TrimSpace(l) != "" && !strings.HasPrefix(strings.TrimSpace(l), "#"), func() { push(kit.Path(p, l)) }) }) }) + push("/usr/local/bin") kit.For(strings.Split(kit.Env(PATH), _path_sep()), func(p string) { push(p) }) + return kit.Join(list, _path_sep()) } diff --git a/core/chat/macos/desktop.css b/core/chat/macos/desktop.css index 72bca86a..32a953cf 100644 --- a/core/chat/macos/desktop.css +++ b/core/chat/macos/desktop.css @@ -24,6 +24,9 @@ fieldset.macos.desktop>div.output>div.desktop>div.item img { width:80px; border- fieldset.macos.desktop>div.output>div.desktop>div.item>div.name { font-size:12px; width:80px; overflow:hidden; } fieldset.macos.desktop>div.output>div.desktop>fieldset { border-radius:10px; position:absolute; } fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>table.content { width:100%; } +fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>table.content th { padding:10px; } +fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>table.content td { padding:10px; } +fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>table.content td>input { margin:5px; } fieldset.macos.desktop>div.output>div.desktop>fieldset>div.item.button { border-radius:20px; height:20px; width:20px; scale:0.7; position:absolute; top:16px; right:10px; } fieldset.macos.desktop>div.output>div.desktop>fieldset>legend { background-color:unset; padding-right:10px; margin:10px 0; } fieldset.macos.desktop>div.output>div.desktop>fieldset>form.option>*:not(.textarea) { margin:10px 0px 10px 10px; } diff --git a/core/chat/macos/desktop.js b/core/chat/macos/desktop.js index 11f57e7a..7a42e520 100644 --- a/core/chat/macos/desktop.js +++ b/core/chat/macos/desktop.js @@ -53,7 +53,7 @@ Volcanos(chat.ONIMPORT, { target.ondragend = function() { can.onimport._item(can, window._drag_item) } }, _window: function(can, item) { if (!item.index) { return } - item.left = 100, item.top = 125, item.height = can.base.Min(can.ConfHeight()-345, 480, 800), item.width = can.base.Min(can.ConfWidth()-360, 640, 1000) + item.left = 100, item.top = 125, item.height = can.base.Min(can.ConfHeight()-345, 480, 800), item.width = can.base.Min(can.ConfWidth()-360, 640, 1200) 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) diff --git a/misc/git/repos.go b/misc/git/repos.go index 459e5ce3..c88e2553 100644 --- a/misc/git/repos.go +++ b/misc/git/repos.go @@ -424,7 +424,7 @@ func init() { if p = path.Join(ice.USR_REQUIRE, path.Join(arg...)); !nfs.Exists(m, p) { ls := strings.SplitN(path.Join(arg[:3]...), mdb.AT, 2) _, err := git.PlainClone(path.Join(ice.USR_REQUIRE, path.Join(arg[:3]...)), false, &git.CloneOptions{ - URL: "https://" + ls[0], Depth: 1, ReferenceName: plumbing.NewTagReferenceName(kit.Select(ice.Info.Gomod[ls[0]], ls, 1)), + URL: "http://" + ls[0], Depth: 1, ReferenceName: plumbing.NewTagReferenceName(kit.Select(ice.Info.Gomod[ls[0]], ls, 1)), }) m.Warn(err) } @@ -624,6 +624,9 @@ func init() { kit.If(m.Option(REPOS), func(p string) { p = strings.Split(p, mdb.QS)[0] kit.If(!strings.Contains(p, "://"), func() { p = web.UserHost(m) + "/x/" + p }) + if ice.Info.System == cli.LINUX { + p = strings.Replace(p, "https", "http", 1) + } m.Cmd("", CLONE, ORIGIN, p, nfs.PATH, m.Option(cli.CMD_DIR), ice.Maps{cli.CMD_DIR: ""}) }) }}, diff --git a/misc/git/status.go b/misc/git/status.go index a9bdcc32..c291f194 100644 --- a/misc/git/status.go +++ b/misc/git/status.go @@ -125,9 +125,6 @@ func init() { m.Cmdy(REPOS, mdb.INPUTS, arg) } }}, - cli.RESTART: {Hand: func(m *ice.Message, arg ...string) { - m.Go(func() { m.Cmd(ice.EXIT, "1") }).ProcessHold() - }}, CONFIGS: {Name: "configs email* username* token", Help: "配置", Hand: func(m *ice.Message, arg ...string) { m.Cmd(nfs.DEFS, kit.HomePath(".gitconfig"), nfs.Template(m, "gitconfig", m.Option(aaa.USERNAME), m.Option(aaa.EMAIL))) mdb.Config(m, aaa.USERNAME, m.Option(aaa.USERNAME)) @@ -166,7 +163,7 @@ func init() { m.Action(CONFIGS).Echo("please config email and name. ").EchoButton(CONFIGS) } else if len(arg) == 0 { kit.If(config != nil, func() { m.Option(aaa.EMAIL, kit.Select(mdb.Config(m, aaa.EMAIL), config.User.Email)) }) - m.Cmdy(REPOS, STATUS).Action(PULL, PUSH, INSTEADOF, "oauth", CONFIGS, cli.RESTART) + m.Cmdy(REPOS, STATUS).Action(PULL, PUSH, INSTEADOF, "oauth", CONFIGS) m.Cmdy(code.PUBLISH, ice.CONTEXTS, "dev") } else { m.Cmdy(REPOS, arg[0], MASTER, INDEX, m.Cmdv(REPOS, arg[0], MASTER, INDEX, nfs.FILE))