From 6ecf44962d03a02d43d87381002cceafa2e717b4 Mon Sep 17 00:00:00 2001 From: shy Date: Wed, 13 Mar 2024 11:56:11 +0800 Subject: [PATCH] add some --- base/web/matrix.js | 3 ++- base/web/space.go | 8 +++++++- base/web/spide.go | 1 - core/chat/message.css | 5 ----- core/chat/message.js | 14 ++++---------- 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/base/web/matrix.js b/base/web/matrix.js index aefb1c2c..49095150 100644 --- a/base/web/matrix.js +++ b/base/web/matrix.js @@ -27,7 +27,8 @@ Volcanos(chat.ONIMPORT, { item: function(can, item, list) { var name = item.name, domain = item.domain, worker = list[name][""], server = list[""][domain]; item["server.type"] = server.type 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: [ + {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)}, 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]}, diff --git a/base/web/space.go b/base/web/space.go index 5fe86cc5..0d09ce02 100644 --- a/base/web/space.go +++ b/base/web/space.go @@ -374,7 +374,13 @@ func init() { ice.Info.Inputs = append(ice.Info.Inputs, func(m *ice.Message, arg ...string) { switch kit.TrimPrefix(arg[0], "extra.") { case DREAM: - m.Copy(AdminCmd(m, DREAM).CutTo(mdb.NAME, DREAM)) + m.SetAppend() + AdminCmd(m, DREAM).Table(func(value ice.Maps) { + kit.If(kit.IsIn(value[mdb.TYPE], WORKER), func() { + m.Push(arg[0], value[mdb.NAME]) + m.PushRecord(value, nfs.VERSION, mdb.TIME, nfs.MODULE, mdb.ICONS) + }) + }) case SPACE: AdminCmd(m, SPACE).Table(func(value ice.Maps) { kit.If(kit.IsIn(value[mdb.TYPE], WORKER, SERVER), func() { m.Push(arg[0], value[mdb.NAME]) }) diff --git a/base/web/spide.go b/base/web/spide.go index 73359ffd..24e7f3bc 100644 --- a/base/web/spide.go +++ b/base/web/spide.go @@ -436,7 +436,6 @@ func init() { } func HostPort(m *ice.Message, host, port string, arg ...string) string { - m.Info("what %v", host, port) p := "" if len(arg) > 0 { kit.If(kit.Select("", arg, 0), func(pod string) { p += S(pod) }) diff --git a/core/chat/message.css b/core/chat/message.css index 868ade3a..086ad707 100644 --- a/core/chat/message.css +++ b/core/chat/message.css @@ -1,7 +1,6 @@ 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).send div.content { background-color:#94ec69; } -// fieldset.web.chat.message>div.output>div.project { width:260px; 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; } @@ -31,10 +30,6 @@ 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.send div.container>span.from { float:right; } fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.send 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 fieldset.story.xterm>form.option>div.item.hash input { width:var(--form-width); } */ -/* fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.plug>div.container>div.content fieldset.story.web.chat.grant>form.option>div.item.space input { width:var(--form-width); } */ -/* fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.plug>div.container>div.content fieldset.story.iframe>form.option>div.item.hash input { width:var(--form-width); } */ fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item>div.container>div.content fieldset.story>form.option>div.item.text input { width:var(--form-width); } fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.plug>div.container>div.content fieldset.story>div.action>div.item.chat.icons { display:none; } 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); } diff --git a/core/chat/message.js b/core/chat/message.js index ca69dcd7..3d654337 100644 --- a/core/chat/message.js +++ b/core/chat/message.js @@ -162,19 +162,13 @@ Volcanos(chat.ONFIGURE, { }) Volcanos(chat.ONINPUTS, { _show: function(event, can, msg, target, name) { - function show(value) { can.ui = can.ui||{} - if (!can.ui.img) { - can.ui.img = can.page.insertBefore(can, [{type: html.IMG}], target) - can.ui.span = can.page.insertBefore(can, [{type: html.SPAN}], target) - can.onappend.style(can, mdb.ICONS, can.page.parentNode(can, target, html.TR)) - can.page.style(can, target, html.COLOR, html.TRANSPARENT) - } - can.ui.img.src = can.misc.Resource(can, value.icons||"usr/icons/Messages.png"), can.ui.span.innerText = value.title||can.base.trimPrefix(value.zone, "ops.") - target.value = value.hash, can.onmotion.hidden(can, can._target) + function show(value) { + can.showIcons(value.hash, value.icons||"usr/icons/Messages.png", value.title||can.base.trimPrefix(value.zone, "ops.")) } can.page.Appends(can, can._output, msg.Table(function(value) { return {view: html.ITEM, list: [ - {img: can.misc.Resource(can, value.icons||"usr/icons/Messages.png")}, {text: value.title||can.base.trimPrefix(value.zone, "ops.")}, + {img: can.misc.Resource(can, value.icons||"usr/icons/Messages.png")}, + {text: value.title||can.base.trimPrefix(value.zone, "ops.")}, ], onclick: function(event) { show(value) }} })) },