diff --git a/base/web/matrix.go b/base/web/matrix.go index 85ad0b84..5b56717a 100644 --- a/base/web/matrix.go +++ b/base/web/matrix.go @@ -20,18 +20,18 @@ func _matrix_list(m *ice.Message, domain, icon, typ string, fields ...string) (s button := []ice.Any{} switch typ { case MYSELF: - button = []ice.Any{PORTAL, WORD, STATUS, VIMER, COMPILE, cli.RUNTIME, DREAM, XTERM, DESKTOP, ADMIN, OPEN} + button = []ice.Any{PORTAL, WORD, STATUS, VIMER, COMPILE, DREAM, cli.RUNTIME, XTERM, DESKTOP, ADMIN, OPEN} case SERVER: - button = []ice.Any{PORTAL, DESKTOP, ADMIN, OPEN, UPGRADE, cli.RUNTIME, DREAM, WORD, STATUS, VIMER, XTERM} + button = []ice.Any{PORTAL, DESKTOP, ADMIN, OPEN, UPGRADE, DREAM, cli.RUNTIME, XTERM, WORD, STATUS, VIMER} default: - button = []ice.Any{PORTAL, DESKTOP, ADMIN, OPEN, XTERM, cli.RUNTIME, DREAM, WORD, STATUS, VIMER} + button = []ice.Any{PORTAL, DESKTOP, ADMIN, OPEN, XTERM, DREAM, cli.RUNTIME, WORD, STATUS, VIMER} } m.PushRecord(value, fields...).PushButton(button...) switch typ { case MYSELF: button = []ice.Any{PORTAL, WORD, STATUS, VIMER, COMPILE, MESSAGE, cli.RUNTIME, XTERM, DESKTOP, ADMIN, OPEN} case SERVER: - button = []ice.Any{PORTAL, DESKTOP, ADMIN, OPEN, UPGRADE, MESSAGE, cli.RUNTIME, WORD, STATUS, VIMER, XTERM} + button = []ice.Any{PORTAL, DESKTOP, ADMIN, OPEN, UPGRADE, MESSAGE, cli.RUNTIME, XTERM, WORD, STATUS, VIMER} default: button = []ice.Any{PORTAL, DESKTOP, ADMIN, OPEN, XTERM, cli.RUNTIME, WORD, STATUS, VIMER} } @@ -116,16 +116,10 @@ func init() { } _matrix_dream(m, mdb.CREATE, kit.Simple(m.OptionSimple(mdb.ICONS, nfs.REPOS, nfs.BINARY))...) m.Cmd(SPACE, kit.Keys(m.Option(DOMAIN), m.Option(mdb.NAME)), MESSAGE, mdb.CREATE, - mdb.TYPE, aaa.VOID, - mdb.ZONE, "ops.dev", - mdb.ICONS, "usr/icons/icebergs.jpg", - "target", "ops.dev", + mdb.TYPE, aaa.TECH, "target", kit.Keys("ops.dev", m.Option(mdb.NAME)), ) m.Cmd(SPACE, m.Option(mdb.NAME), MESSAGE, mdb.CREATE, - mdb.TYPE, aaa.VOID, - mdb.ZONE, kit.Keys("ops", m.Option(DOMAIN), m.Option(mdb.NAME)), - mdb.ICONS, "usr/icons/icebergs.jpg", - "target", kit.Keys("ops", m.Option(DOMAIN), m.Option(mdb.NAME)), + mdb.TYPE, aaa.TECH, "target", kit.Keys("ops", m.Option(DOMAIN), m.Option(mdb.NAME)), ) }}, }, ctx.ConfAction(mdb.FIELD, "time,domain,status,type,name,text,icons,repos,binary,module,version", ctx.TOOLS, kit.Simple(STATUS, VERSION))), Hand: func(m *ice.Message, arg ...string) { diff --git a/core/chat/message.css b/core/chat/message.css index 9ed2b4c4..cfce3ce7 100644 --- a/core/chat/message.css +++ b/core/chat/message.css @@ -1,9 +1,14 @@ body.light fieldset.web.chat.message>div.output { background-color:white; } body.light fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list { background-color:#e3e3e2; } body.light fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item:not(.plug).myself div.content { background-color:#94ec69; } +fieldset.web.chat.message>div.output>div.project { + width:320px; + flex:0 0 260px; +} fieldset.web.chat.message>div.output>div.project>div.title { background-color:var(--plugin-bg-color); padding:var(--button-padding); display:flex; justify-content:space-between; position:sticky; top:0; z-index:2; } fieldset.web.chat.message>div.output>div.project>div.title i:hover { background-color:var(--hover-bg-color); cursor:pointer; } fieldset.web.chat.message>div.output>div.project>div.title span:hover { background-color:var(--hover-bg-color); cursor:pointer; } +fieldset.web.chat.message>div.output>div.project>div.title span { padding:0 var(--input-padding); } fieldset.web.chat.message>div.output>div.project>div.item.text.filter>i { left:var(--input-padding); } fieldset.web.chat.message>div.output>div.project>div.item:not(.filter) { height:58px; padding:var(--input-padding); } fieldset.web.chat.message>div.output>div.project>div.item.select { border-right:unset; } @@ -17,6 +22,7 @@ fieldset.web.chat.message>div.output>div.layout>div.layout>div.content { overflo fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.title { background-color:var(--plugin-bg-color); padding:var(--button-padding); display:flex; justify-content:space-between; position:sticky; top:0; z-index:2; } fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.title i:hover { background-color:var(--hover-bg-color); cursor:pointer; } fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.title span:hover { background-color:var(--hover-bg-color); cursor:pointer; } +fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.title span { padding:0 var(--input-padding); } fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item { padding:var(--input-padding); min-height:fit-content; display:flex; } fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item:hover { background-color:unset; } fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.time { color:var(--disable-fg-color); font-size:var(--status-font-size); padding:0; height:fit-content; justify-content:center; } @@ -27,21 +33,10 @@ fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list> fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.myself div.container>span.from { float:right; } fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.myself div.container { display:flex; flex-direction:column; align-items:flex-end; } fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.text div.content { white-space:pre; padding:var(--input-padding) var(--button-padding); } -fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.plug>div.container>div.content div.item.text.path>input { - width:var(--input-width); -} -fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.plug>div.container>div.content legend { - // float:unset; -} -fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.plug>div.container>div.content { - box-shadow:var(--box-shadow); -} -fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.plug>div.container>div.content:hover { - box-shadow:var(--notice-box-shadow); -} -fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item>div.container>div.content { - display:flex; align-items:center; border-radius:var(--plugin-radius); - min-height:var(--header-height); width:fit-content; } +fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.plug>div.container>div.content div.item.text.path>input { width:var(--input-width); } +fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.plug>div.container>div.content { box-shadow:var(--box-shadow); } +fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.plug>div.container>div.content:hover { box-shadow:var(--notice-box-shadow); } +fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item>div.container>div.content { display:flex; align-items:center; border-radius:var(--plugin-radius); min-height:var(--header-height); width:fit-content; } fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.plug { height:fit-content; } fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.plug div.content { padding:0; } fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.myself { flex-direction:row-reverse; } diff --git a/core/chat/message.go b/core/chat/message.go index de99ed03..002cf9b7 100644 --- a/core/chat/message.go +++ b/core/chat/message.go @@ -21,7 +21,9 @@ func init() { messageCreate(m, cli.SYSTEM, "usr/icons/System Settings.png") messageInsert(m, cli.SYSTEM, mdb.TYPE, "text", mdb.NAME, cli.RUNTIME, mdb.TEXT, m.Cmdx(cli.RUNTIME), ctx.DISPLAY, "/plugin/story/json.js") }}, - mdb.CREATE: {Name: "create type*=tech,void zone* icons* target"}, + mdb.CREATE: {Name: "create type=tech,void title icons target", Hand: func(m *ice.Message, arg ...string) { + mdb.ZoneCreate(m, kit.Simple(arg, mdb.ZONE, kit.Select(kit.Hashs(mdb.UNIQ), m.Option("target")))) + }}, mdb.INSERT: {Hand: func(m *ice.Message, arg ...string) { mdb.ZoneInsert(m, append(arg, aaa.AVATAR, aaa.UserInfo(m, "", aaa.AVATAR, aaa.AVATAR), aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.USERNAME, m.Option(ice.MSG_USERNAME))) kit.If(mdb.HashSelectField(m, arg[0], "target"), func(p string) { m.Cmd(web.SPACE, p, MESSAGE, tcp.RECV, arg[1:]) }) @@ -37,6 +39,9 @@ func init() { messageInsert(m, web.DREAM, mdb.TYPE, "plug", ctx.INDEX, IFRAME, ctx.ARGS, web.S(m.Option(mdb.NAME))) } }}, + web.OPEN: {Hand: func(m *ice.Message, arg ...string) { + m.ProcessOpen(m.MergePod(m.Option("target"))) + }}, ctx.COMMAND: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(web.Space(m, m.Option("target")), ctx.COMMAND, arg[0]).ProcessField(ctx.ACTION, ctx.RUN, m.Option("target"), arg[0]) }}, @@ -49,6 +54,11 @@ func init() { if kit.IsIn(m.Option(ice.MSG_USERROLE), value[mdb.TYPE], aaa.TECH, aaa.ROOT) { m.PushRecord(value, mdb.Config(m, mdb.FIELD)) } + if value["target"] == "" { + m.PushButton(mdb.REMOVE) + } else { + m.PushButton(web.OPEN, mdb.REMOVE) + } }) m.Sort(mdb.TIME, "str_r") } else { diff --git a/core/chat/message.js b/core/chat/message.js index cb2a632f..ad1810eb 100644 --- a/core/chat/message.js +++ b/core/chat/message.js @@ -26,13 +26,17 @@ Volcanos(chat.ONIMPORT, { can.run(can.request(event, {"cache.limit": 10}), [value.hash], function(msg) { can.onimport._display(can), can.onimport._content(can, msg) }) + }, oncontextmenu: function(event) { + can.user.carteRight(event, can, {}, can.page.parseAction(can, value), function(event, button) { + can.runAction(can.request(event, value), button) + }) }}])._target; select = (value.zone == current? _target: select)||_target }), can.user.isMobile? can.onimport._switch(can, true): select && select.click() }, _content: function(can, msg) { can.ui.title = can.page.Appends(can, can.ui.content, [{view: wiki.TITLE, list: [ {icon: "bi bi-chevron-left", onclick: function() { can.onimport._switch(can, true) }}, - {text: can.db.zone.zone}, + {text: can.db.zone.title||can.db.zone.zone}, {icon: "bi bi-three-dots", onclick: function() { can.onmotion.toggle(can, can.ui.profile), can.onimport.layout(can) }}, ]}])._target can.ui.message = can.page.Append(can, can.ui.content, [{view: html.LIST}])._target, can.onimport._message(can, msg)