From 5fce84de254388988acb596db08d494fb2533ed9 Mon Sep 17 00:00:00 2001 From: shy Date: Sun, 10 Mar 2024 13:51:51 +0800 Subject: [PATCH] add some --- base/web/matrix.go | 6 ++---- base/web/matrix.js | 2 +- core/code/autogen.go | 16 ++++++++++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/base/web/matrix.go b/base/web/matrix.go index ced9ae69..2c295250 100644 --- a/base/web/matrix.go +++ b/base/web/matrix.go @@ -101,10 +101,8 @@ func init() { ), ), Actions: ice.MergeActions(ice.Actions{ mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(DREAM, mdb.INPUTS, arg) }}, - mdb.CREATE: {Name: "create name*=hi icons origin*", Hand: func(m *ice.Message, arg ...string) { - m.Cmd(SPIDE, mdb.CREATE, arg, mdb.TYPE, nfs.REPOS) - m.Options(m.Cmd(SPIDE, m.Option(mdb.NAME)).AppendSimple()) - m.Cmdy(SPIDE, mdb.DEV_REQUEST) + mdb.CREATE: {Name: "create name*=hi icons repos binary template", Hand: func(m *ice.Message, arg ...string) { + m.Cmd(DREAM, mdb.CREATE, arg) }}, mdb.REMOVE: {Hand: func(m *ice.Message, arg ...string) { _matrix_dream(m, nfs.TRASH); _matrix_dream(m, "") }}, cli.START: {Hand: func(m *ice.Message, arg ...string) { _matrix_dream(m, "") }}, diff --git a/base/web/matrix.js b/base/web/matrix.js index e8ddaa99..1e0b56bb 100644 --- a/base/web/matrix.js +++ b/base/web/matrix.js @@ -28,7 +28,7 @@ Volcanos(chat.ONIMPORT, { function cb(action) { return function(event) { can.Update(can.request(event, item), [ctx.ACTION, action]) } } return {view: [[html.ITEM, item.type, item.status, can.onimport.style(can, item, list)]], list: [ {img: can.misc.Resource(can, item.icons, can.core.Keys(item.domain, item.name)), onclick: cb(web.DESKTOP)}, {view: wiki.TITLE, list: [ - {text: item.name||item.domain||location.host, onclick: cb(web.OPEN)}, + {text: item.name||item.domain||"中华人民共和国中央人民政府"||location.host, onclick: cb(web.OPEN)}, item.status != cli.STOP && can.onappend.label(can, item, {version: icon.version, time: icon.compile, access: "bi bi-file-lock"}), {text: [item.text, "", mdb.STATUS]}, can.onappend.buttons(can, item), diff --git a/core/code/autogen.go b/core/code/autogen.go index 903b794c..fff87d90 100644 --- a/core/code/autogen.go +++ b/core/code/autogen.go @@ -99,11 +99,19 @@ func _autogen_git(m *ice.Message, arg ...string) ice.Map { ) } func _autogen_mod(m *ice.Message, file string) (mod string) { - host := kit.ParseURL(kit.Select(m.Option(ice.MSG_USERHOST), ice.Info.Make.Remote, m.Cmdx(REPOS, REMOTE_URL))).Hostname() - if host == "" { - host = path.Base(kit.Path("")) + host := m.Cmdx(REPOS, REMOTE_URL) + if host != "" { + host = strings.Split(host, "://")[1] + if strings.Contains(host, ":") { + host = path.Base(host) + } } else { - host = path.Join(host, "x", path.Base(kit.Path(""))) + host = kit.ParseURL(kit.Select(m.Option(ice.MSG_USERHOST), ice.Info.Make.Remote)).Hostname() + if host == "" { + host = path.Base(kit.Path("")) + } else { + host = path.Join(host, "x", path.Base(kit.Path(""))) + } } m.Cmd(nfs.DEFS, file, kit.Format(nfs.Template(m, ice.GO_MOD), host)) // ReposAddFile(m, "", ice.GO_MOD)