forked from x/icebergs
add some
This commit is contained in:
parent
76ea69c590
commit
432fecca49
@ -161,8 +161,8 @@ const (
|
|||||||
USR_LEARNING_PORTAL = "usr/learning/portal/"
|
USR_LEARNING_PORTAL = "usr/learning/portal/"
|
||||||
USR_ICONS_AVATAR = "usr/icons/avatar.jpg"
|
USR_ICONS_AVATAR = "usr/icons/avatar.jpg"
|
||||||
USR_ICONS_CONTEXTS = "usr/icons/contexts.png"
|
USR_ICONS_CONTEXTS = "usr/icons/contexts.png"
|
||||||
USR_ICONS_ICEBERGS = "usr/icons/icebergs.jpg"
|
USR_ICONS_ICEBERGS = "usr/icons/icebergs.png"
|
||||||
USR_ICONS_VOLCANOS = "usr/icons/volcanos.jpg"
|
USR_ICONS_VOLCANOS = "usr/icons/volcanos.png"
|
||||||
|
|
||||||
TYPE_ALL = "all"
|
TYPE_ALL = "all"
|
||||||
TYPE_BIN = "bin"
|
TYPE_BIN = "bin"
|
||||||
|
@ -341,9 +341,7 @@ func init() {
|
|||||||
})
|
})
|
||||||
}).ProcessHold()
|
}).ProcessHold()
|
||||||
}},
|
}},
|
||||||
VERSION: {Hand: func(m *ice.Message, arg ...string) {
|
VERSION: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy("web.code.version") }},
|
||||||
m.Cmdy("web.code.version")
|
|
||||||
}},
|
|
||||||
FOR_FLOW: {Name: "forFlow name cmd*='sh etc/miss.sh'", Help: "流程", Icon: "bi bi-terminal", Hand: func(m *ice.Message, arg ...string) {
|
FOR_FLOW: {Name: "forFlow name cmd*='sh etc/miss.sh'", Help: "流程", Icon: "bi bi-terminal", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Options(ctx.DISPLAY, PLUGIN_XTERM, cli.CMD_OUTPUT, nfs.NewWriteCloser(func(buf []byte) (int, error) {
|
m.Options(ctx.DISPLAY, PLUGIN_XTERM, cli.CMD_OUTPUT, nfs.NewWriteCloser(func(buf []byte) (int, error) {
|
||||||
PushNoticeGrow(m.Options(
|
PushNoticeGrow(m.Options(
|
||||||
@ -433,7 +431,7 @@ func init() {
|
|||||||
}, StatsAction(), DreamAction(), DreamTablesAction(), mdb.ImportantHashAction(
|
}, StatsAction(), DreamAction(), DreamTablesAction(), mdb.ImportantHashAction(
|
||||||
mdb.SHORT, mdb.NAME, mdb.FIELD, "time,name,icons,repos,binary,template,restart",
|
mdb.SHORT, mdb.NAME, mdb.FIELD, "time,name,icons,repos,binary,template,restart",
|
||||||
html.BUTTON, kit.JoinWord(PORTAL, DESKTOP, ADMIN, MESSAGE, WORD, STATUS, VIMER, COMPILE, XTERM, DREAM),
|
html.BUTTON, kit.JoinWord(PORTAL, DESKTOP, ADMIN, MESSAGE, WORD, STATUS, VIMER, COMPILE, XTERM, DREAM),
|
||||||
ctx.TOOLS, kit.Simple(SPIDE, STORE, MATRIX, ROUTE),
|
ctx.TOOLS, kit.Simple(SPIDE, ROUTE, STORE, MATRIX),
|
||||||
)), Hand: func(m *ice.Message, arg ...string) {
|
)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
simple := m.Option("dream.simple") == ice.TRUE
|
simple := m.Option("dream.simple") == ice.TRUE
|
||||||
@ -447,7 +445,7 @@ func init() {
|
|||||||
if ice.Info.NodeType == WORKER || !aaa.IsTechOrRoot(m) || m.IsCliUA() {
|
if ice.Info.NodeType == WORKER || !aaa.IsTechOrRoot(m) || m.IsCliUA() {
|
||||||
m.Action()
|
m.Action()
|
||||||
} else if cli.SystemFindGo(m) {
|
} else if cli.SystemFindGo(m) {
|
||||||
m.Action(html.FILTER, mdb.CREATE, STARTALL, STOPALL, cli.BUILD, PUBLISH, nfs.FILE, VERSION)
|
m.Action(html.FILTER, mdb.CREATE, STARTALL, STOPALL, cli.BUILD, PUBLISH)
|
||||||
} else {
|
} else {
|
||||||
m.Action(html.FILTER, mdb.CREATE, STARTALL, STOPALL)
|
m.Action(html.FILTER, mdb.CREATE, STARTALL, STOPALL)
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,8 @@ fieldset.web.matrix>div.output>table.content th i:hover { background-color:var(-
|
|||||||
fieldset.web.matrix>div.output>table.content td { padding:var(--input-padding); }
|
fieldset.web.matrix>div.output>table.content td { padding:var(--input-padding); }
|
||||||
fieldset.web.matrix>div.output>table.content td:hover { color:unset; }
|
fieldset.web.matrix>div.output>table.content td:hover { color:unset; }
|
||||||
fieldset.web.matrix>div.output>table.content div.item { display:flex; align-items:center; cursor:default; }
|
fieldset.web.matrix>div.output>table.content div.item { display:flex; align-items:center; cursor:default; }
|
||||||
fieldset.web.matrix>div.output>table.content div.item img { height:var(--header-height); width:var(--header-height); margin:var(--input-margin); cursor:pointer; }
|
fieldset.web.matrix>div.output>table.content div.item img { height:var(--header-height); width:var(--header-height); cursor:pointer; }
|
||||||
|
fieldset.web.matrix>div.output>table.content div.item img.jpg { padding:var(--input-padding); }
|
||||||
fieldset.web.matrix>div.output>table.content div.item div.title { text-align:left; padding:var(--input-padding); }
|
fieldset.web.matrix>div.output>table.content div.item div.title { text-align:left; padding:var(--input-padding); }
|
||||||
fieldset.web.matrix>div.output>table.content div.item div.title>span { cursor:pointer; }
|
fieldset.web.matrix>div.output>table.content div.item div.title>span { cursor:pointer; }
|
||||||
fieldset.web.matrix>div.output>table.content div.item div.status i { font-size:var(--status-font-size); padding:0; }
|
fieldset.web.matrix>div.output>table.content div.item div.status i { font-size:var(--status-font-size); padding:0; }
|
||||||
|
@ -90,6 +90,9 @@ func _matrix_cmd(m *ice.Message, cmd string, arg ...string) *ice.Message {
|
|||||||
return m.Cmdy(Space(m, kit.Keys(m.Option(DOMAIN), m.Option(mdb.NAME))), kit.Select(m.ActionKey(), cmd), arg)
|
return m.Cmdy(Space(m, kit.Keys(m.Option(DOMAIN), m.Option(mdb.NAME))), kit.Select(m.ActionKey(), cmd), arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
TARGET = "target"
|
||||||
|
)
|
||||||
const MATRIX = "matrix"
|
const MATRIX = "matrix"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -100,7 +103,11 @@ func init() {
|
|||||||
),
|
),
|
||||||
), Actions: ice.MergeActions(ice.Actions{
|
), Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(DREAM, mdb.INPUTS, arg) }},
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(DREAM, mdb.INPUTS, arg) }},
|
||||||
mdb.CREATE: {Name: "create name*=hi icons repos binary template", Hand: func(m *ice.Message, arg ...string) { m.Cmd(DREAM, mdb.CREATE, 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.REMOVE: {Hand: func(m *ice.Message, arg ...string) { _matrix_dream(m, nfs.TRASH); _matrix_dream(m, "") }},
|
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, "") }},
|
cli.START: {Hand: func(m *ice.Message, arg ...string) { _matrix_dream(m, "") }},
|
||||||
cli.STOP: {Hand: func(m *ice.Message, arg ...string) { _matrix_dream(m, "") }},
|
cli.STOP: {Hand: func(m *ice.Message, arg ...string) { _matrix_dream(m, "") }},
|
||||||
@ -116,20 +123,23 @@ func init() {
|
|||||||
}
|
}
|
||||||
_matrix_dream(m, mdb.CREATE, kit.Simple(m.OptionSimple(mdb.ICONS, nfs.REPOS, nfs.BINARY))...)
|
_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,
|
m.Cmd(SPACE, kit.Keys(m.Option(DOMAIN), m.Option(mdb.NAME)), MESSAGE, mdb.CREATE,
|
||||||
mdb.TYPE, aaa.TECH, "target", kit.Keys("ops.dev", m.Option(mdb.NAME)),
|
mdb.TYPE, aaa.TECH, mdb.ICONS, nfs.USR_ICONS_VOLCANOS,
|
||||||
|
TARGET, kit.Keys("from", m.Option(mdb.NAME)),
|
||||||
|
// "target", kit.Keys(ice.OPS, ice.DEV, m.Option(mdb.NAME)),
|
||||||
)
|
)
|
||||||
m.Cmd(SPACE, m.Option(mdb.NAME), MESSAGE, mdb.CREATE,
|
m.Cmd(SPACE, m.Option(mdb.NAME), MESSAGE, mdb.CREATE,
|
||||||
mdb.TYPE, aaa.TECH, "target", kit.Keys("ops", m.Option(DOMAIN), m.Option(mdb.NAME)),
|
mdb.TYPE, aaa.TECH, mdb.ICONS, nfs.USR_ICONS_ICEBERGS,
|
||||||
|
TARGET, kit.Keys(ice.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) {
|
}, ctx.ConfAction(mdb.FIELD, "time,domain,status,type,name,text,icons,repos,binary,module,version", ctx.TOOLS, kit.Simple(SPIDE, STATUS, VERSION))), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if kit.HasPrefixList(arg, ctx.ACTION) {
|
if kit.HasPrefixList(arg, ctx.ACTION) {
|
||||||
_matrix_action(m, arg[1], arg[2:]...)
|
_matrix_action(m, arg[1], arg[2:]...)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
GoToast(m, func(toast func(name string, count, total int)) []string {
|
GoToast(m, func(toast func(name string, count, total int)) []string {
|
||||||
field := kit.Split(mdb.Config(m, mdb.FIELD))
|
field := kit.Split(mdb.Config(m, mdb.FIELD))
|
||||||
m.Options("space.timeout", cli.TIME_1s, "dream.simple", ice.TRUE)
|
m.Options("space.timeout", cli.TIME_3s, "dream.simple", ice.TRUE)
|
||||||
list, icons, types := _matrix_list(m, "", ice.SRC_MAIN_ICO, MYSELF, field...)
|
list, icons, types := _matrix_list(m, "", ice.SRC_MAIN_ICO, MYSELF, field...)
|
||||||
kit.For(list, func(domain string, index int, total int) {
|
kit.For(list, func(domain string, index int, total int) {
|
||||||
toast(domain, index, total)
|
toast(domain, index, total)
|
||||||
@ -143,9 +153,9 @@ func init() {
|
|||||||
})
|
})
|
||||||
m.Action(html.FILTER, mdb.CREATE).StatusTimeCountStats(mdb.TYPE, mdb.STATUS).Display("")
|
m.Action(html.FILTER, mdb.CREATE).StatusTimeCountStats(mdb.TYPE, mdb.STATUS).Display("")
|
||||||
m.Sort("type,status,name,domain", []string{MYSELF, SERVER, MASTER, WORKER, ""}, []string{cli.START, cli.STOP, ""}, "str_r", "str_r")
|
m.Sort("type,status,name,domain", []string{MYSELF, SERVER, MASTER, WORKER, ""}, []string{cli.START, cli.STOP, ""}, "str_r", "str_r")
|
||||||
|
ctx.Toolkit(m)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
ctx.Toolkit(m)
|
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ func init() {
|
|||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
STORE: {Name: "store refresh", Help: "商店", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{
|
STORE: {Name: "store refresh", Help: "商店", Role: aaa.VOID, Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(SPIDE, mdb.INPUTS, arg) }},
|
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(SPIDE, mdb.INPUTS, arg) }},
|
||||||
mdb.CREATE: {Name: "create name* origin* icons", Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create name* icons origin*", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmd(SPIDE, mdb.CREATE, m.OptionSimple("name,origin,icons"), mdb.TYPE, nfs.REPOS)
|
m.Cmd(SPIDE, mdb.CREATE, m.OptionSimple("name,origin,icons"), mdb.TYPE, nfs.REPOS)
|
||||||
}},
|
}},
|
||||||
mdb.REMOVE: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.REMOVE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
1
conf.go
1
conf.go
@ -221,6 +221,7 @@ const ( // MSG
|
|||||||
MSG_USERROLE = "user.role"
|
MSG_USERROLE = "user.role"
|
||||||
MSG_USERZONE = "user.zone"
|
MSG_USERZONE = "user.zone"
|
||||||
MSG_LANGUAGE = "user.lang"
|
MSG_LANGUAGE = "user.lang"
|
||||||
|
MSG_AVATAR = "user.avatar"
|
||||||
|
|
||||||
MSG_BG = "sess.bg"
|
MSG_BG = "sess.bg"
|
||||||
MSG_FG = "sess.fg"
|
MSG_FG = "sess.fg"
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
body.light fieldset.web.chat.message>div.output { background-color:white; }
|
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 { 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; }
|
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 {
|
fieldset.web.chat.message>div.output>div.project { width:260px; flex:0 0 260px; }
|
||||||
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 { 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 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:hover { background-color:var(--hover-bg-color); cursor:pointer; }
|
||||||
@ -14,7 +11,7 @@ fieldset.web.chat.message>div.output>div.project>div.item:not(.filter) { height:
|
|||||||
fieldset.web.chat.message>div.output>div.project>div.item.select { border-right:unset; }
|
fieldset.web.chat.message>div.output>div.project>div.item.select { border-right:unset; }
|
||||||
fieldset.web.chat.message>div.output>div.project>div.item img { height:var(--header-height); width:var(--header-height); display:block; float:left; }
|
fieldset.web.chat.message>div.output>div.project>div.item img { height:var(--header-height); width:var(--header-height); display:block; float:left; }
|
||||||
fieldset.web.chat.message>div.output>div.project>div.item span.time { color:var(--disable-fg-color); font-size:var(--status-font-size); }
|
fieldset.web.chat.message>div.output>div.project>div.item span.time { color:var(--disable-fg-color); font-size:var(--status-font-size); }
|
||||||
fieldset.web.chat.message>div.output>div.project>div.item div.container { padding:0 var(--input-padding); width:calc(100% - var(--header-height) - 2*var(--input-padding)); float:left; }
|
fieldset.web.chat.message>div.output>div.project>div.item div.container { width:calc(100% - var(--header-height)); float:left; }
|
||||||
fieldset.web.chat.message>div.output>div.project>div.item div.title { display:flex; justify-content:space-between; }
|
fieldset.web.chat.message>div.output>div.project>div.item div.title { display:flex; justify-content:space-between; }
|
||||||
fieldset.web.chat.message>div.output>div.project>div.item div.title>span:first-child { margin-right:var(--input-margin); overflow:hidden; flex-shrink:1; }
|
fieldset.web.chat.message>div.output>div.project>div.item div.title>span:first-child { margin-right:var(--input-margin); overflow:hidden; flex-shrink:1; }
|
||||||
fieldset.web.chat.message>div.output>div.project>div.item div.content { color:var(--disable-fg-color); font-size:var(--status-font-size); }
|
fieldset.web.chat.message>div.output>div.project>div.item div.content { color:var(--disable-fg-color); font-size:var(--status-font-size); }
|
||||||
@ -25,22 +22,23 @@ fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.title
|
|||||||
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.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 { 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: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; }
|
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; margin-top:var(--button-margin); height:fit-content; justify-content:center; }
|
||||||
fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item>img { height:var(--header-height); width:var(--header-height); }
|
fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item>img { height:var(--header-height); width:var(--header-height); }
|
||||||
fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item div.content img { max-width:256px; }
|
fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item div.content img { max-width:256px; }
|
||||||
fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item div.container { width:fit-content; max-width:calc(100% - var(--header-height)); margin:0 var(--button-margin); }
|
fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item div.container { width:fit-content; max-width:calc(100% - var(--header-height)); margin:0 var(--button-margin); }
|
||||||
fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item div.container>span.from { color:var(--disable-fg-color); font-size:var(--status-font-size); padding:0 var(--input-padding); }
|
fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item div.container>span.from { color:var(--disable-fg-color); font-size:var(--status-font-size); padding:0 var(--input-padding); }
|
||||||
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.send 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.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.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 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.xterm.story>form.option>div.item.hash 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 { 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.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>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 { 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.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; }
|
fieldset.web.chat.message>div.output>div.layout>div.layout>div.content>div.list>div.item.send { flex-direction:row-reverse; }
|
||||||
fieldset.web.chat.message>div.output>div.layout>div.display { height:120px; overflow:hidden; }
|
fieldset.web.chat.message>div.output>div.layout>div.display { height:80px; overflow:hidden; }
|
||||||
fieldset.web.chat.message>div.output>div.layout>div.display div.toolkit { background-color:var(--plugin-bg-color); height:var(--action-height); display:flex; align-items:center; }
|
fieldset.web.chat.message>div.output>div.layout>div.display div.toolkit { background-color:var(--plugin-bg-color); height:var(--action-height); display:flex; align-items:center; }
|
||||||
fieldset.web.chat.message>div.output>div.layout>div.display div.toolkit i { padding:var(--input-padding); }
|
fieldset.web.chat.message>div.output>div.layout>div.display div.toolkit i { padding:var(--input-padding); }
|
||||||
fieldset.web.chat.message>div.output>div.layout>div.display div.toolkit i:hover { background-color:var(--hover-bg-color); }
|
fieldset.web.chat.message>div.output>div.layout>div.display div.toolkit i:hover { background-color:var(--hover-bg-color); }
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package chat
|
package chat
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
"shylinux.com/x/icebergs/base/aaa"
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
"shylinux.com/x/icebergs/base/cli"
|
"shylinux.com/x/icebergs/base/cli"
|
||||||
@ -22,16 +24,19 @@ func init() {
|
|||||||
messageInsert(m, cli.SYSTEM, mdb.TYPE, "text", mdb.NAME, cli.RUNTIME, mdb.TEXT, m.Cmdx(cli.RUNTIME), ctx.DISPLAY, "/plugin/story/json.js")
|
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 title icons target", Hand: func(m *ice.Message, arg ...string) {
|
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"))))
|
if strings.HasPrefix(m.Option(web.TARGET), "from.") {
|
||||||
|
m.Option(web.TARGET, strings.Replace(m.Option(web.TARGET), "from", m.Option(ice.FROM_SPACE), 1))
|
||||||
|
}
|
||||||
|
mdb.ZoneCreate(m, kit.Simple(arg, web.TARGET, m.Option(web.TARGET), mdb.ZONE, kit.Select(kit.Hashs(mdb.UNIQ), m.Option(web.TARGET))))
|
||||||
}},
|
}},
|
||||||
mdb.INSERT: {Hand: func(m *ice.Message, arg ...string) {
|
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)))
|
mdb.ZoneInsert(m, append(arg, "direct", tcp.SEND, aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.AVATAR, m.Option(ice.MSG_AVATAR)))
|
||||||
kit.If(mdb.HashSelectField(m, arg[0], "target"), func(p string) { m.Cmd(web.SPACE, p, MESSAGE, tcp.RECV, arg[1:]) })
|
kit.If(mdb.HashSelectField(m, arg[0], web.TARGET), func(p string) { m.Cmd(web.SPACE, p, MESSAGE, tcp.RECV, arg[1:]) })
|
||||||
mdb.HashSelectUpdate(m, arg[0], func(value ice.Map) { kit.Value(value, mdb.TIME, m.Time()) })
|
mdb.HashSelectUpdate(m, arg[0], func(value ice.Map) { kit.Value(value, mdb.TIME, m.Time()) })
|
||||||
}},
|
}},
|
||||||
tcp.RECV: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
|
tcp.RECV: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.ZoneInsert(m, kit.Simple(mdb.ZONE, m.Option(ice.FROM_SPACE), web.SPACE, m.Option(ice.FROM_SPACE), arg, aaa.AVATAR, aaa.UserInfo(m, "", aaa.AVATAR, aaa.AVATAR), aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.USERNAME, m.Option(ice.MSG_USERNAME)))
|
mdb.ZoneInsert(m, kit.Simple(mdb.ZONE, m.Option(ice.FROM_SPACE), arg, "direct", tcp.RECV, aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.AVATAR, m.Option(ice.MSG_AVATAR)))
|
||||||
mdb.HashSelectUpdate(m, m.Option(ice.FROM_SPACE), func(value ice.Map) { kit.Value(value, "target", m.Option(ice.FROM_SPACE)) })
|
mdb.HashSelectUpdate(m, m.Option(ice.FROM_SPACE), func(value ice.Map) { kit.Value(value, web.TARGET, m.Option(ice.FROM_SPACE)) })
|
||||||
mdb.HashSelectUpdate(m, m.Option(ice.FROM_SPACE), func(value ice.Map) { kit.Value(value, mdb.TIME, m.Time()) })
|
mdb.HashSelectUpdate(m, m.Option(ice.FROM_SPACE), func(value ice.Map) { kit.Value(value, mdb.TIME, m.Time()) })
|
||||||
}},
|
}},
|
||||||
web.DREAM_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
web.DREAM_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
@ -40,27 +45,34 @@ func init() {
|
|||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
web.OPEN: {Hand: func(m *ice.Message, arg ...string) {
|
web.OPEN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.ProcessOpen(m.MergePod(m.Option("target")))
|
m.ProcessOpen(m.MergePod(m.Option(web.TARGET)))
|
||||||
}},
|
}},
|
||||||
ctx.COMMAND: {Hand: func(m *ice.Message, arg ...string) {
|
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])
|
if m.Option("direct") == "recv" {
|
||||||
|
m.Cmdy(web.Space(m, m.Option(web.TARGET)), ctx.COMMAND, arg[0]).ProcessField(ctx.ACTION, ctx.RUN, m.Option(web.TARGET), arg[0])
|
||||||
|
} else {
|
||||||
|
m.Cmdy(ctx.COMMAND, arg[0]).ProcessField(ctx.ACTION, ctx.RUN, "", arg[0])
|
||||||
|
}
|
||||||
|
}},
|
||||||
|
ctx.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmdy(web.Space(m, arg[0]), arg[1], arg[2:])
|
||||||
}},
|
}},
|
||||||
ctx.RUN: {Hand: func(m *ice.Message, arg ...string) { m.Cmdy(web.Space(m, arg[0]), arg[1], arg[2:]) }},
|
|
||||||
}, web.DreamAction(), web.DreamTablesAction(), mdb.ZoneAction(
|
}, web.DreamAction(), web.DreamTablesAction(), mdb.ZoneAction(
|
||||||
mdb.SHORT, mdb.ZONE, mdb.FIELD, "time,hash,type,zone,icons,title,count,target", mdb.FIELDS, "time,id,avatar,usernick,username,type,name,text,space,index,args,style,display",
|
mdb.SHORT, mdb.ZONE, mdb.FIELD, "time,hash,type,zone,icons,title,count,target",
|
||||||
|
mdb.FIELDS, "time,id,type,name,text,space,index,args,style,display,username,usernick,avatar,direct",
|
||||||
)), Hand: func(m *ice.Message, arg ...string) {
|
)), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
mdb.ZoneSelect(m.Display("").Spawn(), arg...).Table(func(value ice.Maps) {
|
mdb.ZoneSelect(m.Display("").Spawn(), arg...).Table(func(value ice.Maps) {
|
||||||
if kit.IsIn(m.Option(ice.MSG_USERROLE), value[mdb.TYPE], aaa.TECH, aaa.ROOT) {
|
if kit.IsIn(m.Option(ice.MSG_USERROLE), value[mdb.TYPE], aaa.TECH, aaa.ROOT) {
|
||||||
m.PushRecord(value, mdb.Config(m, mdb.FIELD))
|
m.PushRecord(value, mdb.Config(m, mdb.FIELD))
|
||||||
}
|
}
|
||||||
if value["target"] == "" {
|
if value[web.TARGET] == "" {
|
||||||
m.PushButton(mdb.REMOVE)
|
m.PushButton(mdb.REMOVE)
|
||||||
} else {
|
} else {
|
||||||
m.PushButton(web.OPEN, mdb.REMOVE)
|
m.PushButton(web.OPEN, mdb.REMOVE)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
m.Sort(mdb.TIME, "str_r")
|
m.Sort(mdb.TIME, ice.STR_R)
|
||||||
} else {
|
} else {
|
||||||
mdb.ZoneSelect(m, arg...).Sort(mdb.ID, ice.INT)
|
mdb.ZoneSelect(m, arg...).Sort(mdb.ID, ice.INT)
|
||||||
}
|
}
|
||||||
|
@ -56,8 +56,10 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
var t = new Date(value.time); if (!last || (t - last > 3*60*1000)) { last = t
|
var t = new Date(value.time); if (!last || (t - last > 3*60*1000)) { last = t
|
||||||
can.page.Append(can, can.ui.message, [{view: [[html.ITEM, mdb.TIME], "", time]}])
|
can.page.Append(can, can.ui.message, [{view: [[html.ITEM, mdb.TIME], "", time]}])
|
||||||
}
|
}
|
||||||
can.page.Append(can, can.ui.message, [{view: [[html.ITEM, value.type, myself? "myself": ""]], list: [
|
can.page.Append(can, can.ui.message, [{view: [[html.ITEM, value.direct, value.type]], list: [
|
||||||
{img: can.misc.Resource(can, (can.base.isIn(value.avatar, can.db.zone.zone, mdb.TYPE)? "": value.avatar)||can.db.zone.icons||"usr/icons/Messages.png")},
|
{img: value.direct == "recv"? (
|
||||||
|
can.misc.Resource(can, (can.base.isIn(value.avatar, can.db.zone.zone, mdb.TYPE)? "": value.avatar)||can.db.zone.icons||"usr/icons/Messages.png")
|
||||||
|
): can.user.info.avatar},
|
||||||
{view: html.CONTAINER, list: [{text: [value.usernick, "", nfs.FROM]}, can.onfigure[value.type||"text"](can, value)]},
|
{view: html.CONTAINER, list: [{text: [value.usernick, "", nfs.FROM]}, can.onfigure[value.type||"text"](can, value)]},
|
||||||
]}])
|
]}])
|
||||||
}), can.onappend._status(can, msg.Option(ice.MSG_STATUS)), can.onimport.layout(can)
|
}), can.onappend._status(can, msg.Option(ice.MSG_STATUS)), can.onimport.layout(can)
|
||||||
@ -125,13 +127,13 @@ Volcanos(chat.ONFIGURE, {
|
|||||||
},
|
},
|
||||||
plug: function(can, value) { var height = can.onexport.plugHeight(can, value), width = can.onexport.plugWidth(can, value)
|
plug: function(can, value) { var height = can.onexport.plugHeight(can, value), width = can.onexport.plugWidth(can, value)
|
||||||
return {view: wiki.CONTENT, style: {height: height+2, width: width}, _init: function(target) { value.type = chat.STORY
|
return {view: wiki.CONTENT, style: {height: height+2, width: width}, _init: function(target) { value.type = chat.STORY
|
||||||
value._commands = {target: can.db.zone.target}
|
value._commands = {direct: value.direct, target: can.db.zone.target}
|
||||||
can.onappend.plugin(can, value, function(sub) {
|
can.onappend.plugin(can, value, function(sub) {
|
||||||
sub.onexport.output = function() { sub.onimport.size(sub, height, width)
|
sub.onexport.output = function() { sub.onimport.size(sub, height, width)
|
||||||
can.page.style(can, target, html.HEIGHT, sub._target.offsetHeight+2, html.WIDTH, sub._target.offsetWidth)
|
can.page.style(can, target, html.HEIGHT, sub._target.offsetHeight+2, html.WIDTH, sub._target.offsetWidth)
|
||||||
}
|
}
|
||||||
sub.onexport.link = function() {
|
sub.onexport.link = function() {
|
||||||
var args = sub.Option(); args.pod = can.core.Keys(can.ConfSpace()||can.misc.Search(can, ice.POD), can.db.zone.target), args.cmd = sub.ConfIndex()
|
var args = sub.Option(); args.pod = can.core.Keys(can.ConfSpace()||can.misc.Search(can, ice.POD), value.direct == "recv"? can.db.zone.target: ""), args.cmd = sub.ConfIndex()
|
||||||
can.core.Item(args, function(key, value) { !value && delete(args[key]) })
|
can.core.Item(args, function(key, value) { !value && delete(args[key]) })
|
||||||
return can.misc.MergePodCmd(can, args, true)
|
return can.misc.MergePodCmd(can, args, true)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user