mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
add some
This commit is contained in:
parent
2c791bef93
commit
437ec06692
@ -11,23 +11,21 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func _offer_create(m *ice.Message, arg ...string) {
|
func _offer_create(m *ice.Message, arg ...string) {
|
||||||
h := mdb.HashCreate(m.Spawn(), m.OptionSimple(EMAIL, SUBJECT, CONTENT), INVITER, m.Option(ice.MSG_USERNAME), mdb.STATUS, INVITE)
|
h := mdb.HashCreate(m.Spawn(), FROM, m.Option(ice.MSG_USERNAME), mdb.STATUS, INVITE, m.OptionSimple(EMAIL, SUBJECT, CONTENT))
|
||||||
SendEmail(m.Options("link", m.Cmdx("host", "publish", m.MergePodCmd("", "", mdb.HASH, h))), m.Option(FROM), "", "")
|
SendEmail(m.Options("link", m.Cmdx("host", "publish", m.MergePodCmd("", "", mdb.HASH, h))), m.Option(FROM), "", "")
|
||||||
m.Cmd("count", mdb.CREATE, OFFER, m.Option(FROM), kit.Dict(ice.LOG_DISABLE, ice.TRUE))
|
|
||||||
gdb.Event(m, OFFER_CREATE, mdb.HASH, h, EMAIL, m.Option(EMAIL))
|
gdb.Event(m, OFFER_CREATE, mdb.HASH, h, EMAIL, m.Option(EMAIL))
|
||||||
}
|
}
|
||||||
func _offer_accept(m *ice.Message, arg ...string) {
|
func _offer_accept(m *ice.Message, arg ...string) {
|
||||||
msg := mdb.HashSelect(m.Spawn(), m.Option(mdb.HASH))
|
msg := mdb.HashSelect(m.Spawn(), m.Option(mdb.HASH))
|
||||||
if ls := kit.Split(msg.Append(EMAIL), mdb.AT); !m.WarnNotFound(msg.Length() == 0 || len(ls) < 2, m.Option(mdb.HASH)) {
|
if ls := kit.Split(msg.Append(EMAIL), mdb.AT); !m.WarnNotFound(msg.Length() == 0 || len(ls) < 2, m.Option(mdb.HASH)) {
|
||||||
m.Spawn().AdminCmd(USER, mdb.CREATE, USERNICK, ls[0], USERNAME, msg.Append(EMAIL), USERZONE, ls[1])
|
m.Spawn().AdminCmd(USER, mdb.CREATE, USERROLE, VOID, USERNAME, msg.Append(EMAIL), USERNICK, ls[0], USERZONE, ls[1])
|
||||||
m.ProcessLocation(m.MergePod("", ice.MSG_SESSID, SessValid(m.Options(ice.MSG_USERNAME, msg.Append(EMAIL)))))
|
|
||||||
mdb.HashModify(m, m.OptionSimple(mdb.HASH), mdb.STATUS, ACCEPT)
|
mdb.HashModify(m, m.OptionSimple(mdb.HASH), mdb.STATUS, ACCEPT)
|
||||||
gdb.Event(m, OFFER_ACCEPT, mdb.HASH, m.Option(mdb.HASH), EMAIL, msg.Append(EMAIL))
|
gdb.Event(m, OFFER_ACCEPT, mdb.HASH, m.Option(mdb.HASH), EMAIL, msg.Append(EMAIL))
|
||||||
|
m.ProcessLocation(m.MergePod("", ice.MSG_SESSID, SessValid(m.Options(ice.MSG_USERNAME, msg.Append(EMAIL)))))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
INVITER = "inviter"
|
|
||||||
INVITE = "invite"
|
INVITE = "invite"
|
||||||
ACCEPT = "accept"
|
ACCEPT = "accept"
|
||||||
SUBJECT_HTML = "subject.html"
|
SUBJECT_HTML = "subject.html"
|
||||||
@ -42,7 +40,7 @@ const OFFER = "offer"
|
|||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
OFFER: {Help: "邀请", Role: VOID, Meta: kit.Dict(
|
OFFER: {Help: "邀请", Role: VOID, Meta: kit.Dict(
|
||||||
ice.CTX_TRANS, kit.Dict(html.INPUT, kit.Dict("from", "发自", "inviter", "邀请人")),
|
ice.CTX_TRANS, kit.Dict(html.INPUT, kit.Dict("from", "发自")),
|
||||||
), Actions: ice.MergeActions(ice.Actions{
|
), Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.CREATE: {Name: "create from*=admin email*='shy@shylinux.com' subject content", Help: "邀请", Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create from*=admin email*='shy@shylinux.com' subject content", Help: "邀请", Hand: func(m *ice.Message, arg ...string) {
|
||||||
_offer_create(m, arg...)
|
_offer_create(m, arg...)
|
||||||
@ -52,20 +50,22 @@ func init() {
|
|||||||
_offer_accept(m, arg...)
|
_offer_accept(m, arg...)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}, mdb.ImportantHashAction(EMAIL, ADMIN, mdb.SHORT, mdb.UNIQ, mdb.FIELD, "time,hash,status,inviter,email,title,content")), Hand: func(m *ice.Message, arg ...string) {
|
}, mdb.ImportantHashAction(
|
||||||
if !m.WarnNotRight(len(arg) == 0 && m.Option(ice.MSG_USERROLE) == VOID) {
|
mdb.SHORT, mdb.UNIQ, mdb.FIELD, "time,hash,from,status,email,subject,content"), EMAIL, ADMIN,
|
||||||
kit.If(mdb.HashSelect(m, arg...).FieldsIsDetail(), func() {
|
), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.Option(ice.MSG_USERNAME) == "" {
|
if m.WarnNotRight(len(arg) == 0 && !IsTechOrRoot(m)) {
|
||||||
m.Option(ice.MSG_USERHOST, strings.Split(m.Option(ice.MSG_USERHOST), "://")[1])
|
return
|
||||||
m.SetAppend().EchoInfoButton(m.Template(SUBJECT_HTML), ACCEPT)
|
} else if mdb.HashSelect(m, arg...).FieldsIsDetail() {
|
||||||
} else {
|
if m.Option(ice.MSG_USERNAME) == "" {
|
||||||
if strings.Contains(m.Option(ice.MSG_USERWEB), "/c/offer") {
|
m.Option(ice.MSG_USERHOST, strings.Split(m.Option(ice.MSG_USERHOST), "://")[1])
|
||||||
m.ProcessLocation(m.MergePod(""))
|
m.SetAppend().EchoInfoButton(m.Template(SUBJECT_HTML), ACCEPT)
|
||||||
|
} else if strings.Contains(m.Option(ice.MSG_USERWEB), "/c/offer") {
|
||||||
}
|
m.ProcessLocation(m.MergePod(""))
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
func OfferAction() ice.Actions {
|
||||||
|
return gdb.EventsAction(OFFER_CREATE, OFFER_ACCEPT, USER_CREATE, USER_REMOVE)
|
||||||
|
}
|
||||||
|
@ -72,8 +72,8 @@ func SessAuth(m *ice.Message, value ice.Any, arg ...string) *ice.Message {
|
|||||||
USERROLE, m.Option(ice.MSG_USERROLE, kit.Format(kit.Value(value, USERROLE))),
|
USERROLE, m.Option(ice.MSG_USERROLE, kit.Format(kit.Value(value, USERROLE))),
|
||||||
USERNAME, m.Option(ice.MSG_USERNAME, kit.Format(kit.Value(value, USERNAME))),
|
USERNAME, m.Option(ice.MSG_USERNAME, kit.Format(kit.Value(value, USERNAME))),
|
||||||
USERNICK, m.Option(ice.MSG_USERNICK, kit.Format(kit.Value(value, USERNICK))),
|
USERNICK, m.Option(ice.MSG_USERNICK, kit.Format(kit.Value(value, USERNICK))),
|
||||||
AVATAR, m.Option(ice.MSG_AVATAR, kit.Format(kit.Value(value, AVATAR))),
|
|
||||||
LANGUAGE, m.OptionDefault(ice.MSG_LANGUAGE, kit.Format(kit.Value(value, LANGUAGE))),
|
LANGUAGE, m.OptionDefault(ice.MSG_LANGUAGE, kit.Format(kit.Value(value, LANGUAGE))),
|
||||||
|
AVATAR, m.Option(ice.MSG_AVATAR, kit.Format(kit.Value(value, AVATAR))),
|
||||||
arg, logs.FileLineMeta(kit.Select(logs.FileLine(-1), m.Option("aaa.checker"))),
|
arg, logs.FileLineMeta(kit.Select(logs.FileLine(-1), m.Option("aaa.checker"))),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,7 @@ func init() {
|
|||||||
), Actions: ice.MergeActions(ice.Actions{
|
), Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.CREATE: {Name: "create type name text", Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create type name text", Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.HashSelectUpdate(m, mdb.HashCreate(m), func(value ice.Map) { value[mdb.COUNT] = kit.Int(value[mdb.COUNT]) + 1 })
|
mdb.HashSelectUpdate(m, mdb.HashCreate(m), func(value ice.Map) { value[mdb.COUNT] = kit.Int(value[mdb.COUNT]) + 1 })
|
||||||
|
// m.Cmd("count", mdb.CREATE, OFFER, m.Option(FROM), kit.Dict(ice.LOG_DISABLE, ice.TRUE))
|
||||||
}},
|
}},
|
||||||
mdb.VALID: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.VALID: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.HashSelect(m.Spawn(), arg...).Table(func(value ice.Maps) {
|
mdb.HashSelect(m.Spawn(), arg...).Table(func(value ice.Maps) {
|
||||||
|
@ -295,6 +295,10 @@ func init() {
|
|||||||
StreamPushRefreshConfirm(m, m.Trans("refresh for new space ", "刷新列表查看新空间 ")+m.Option(mdb.NAME))
|
StreamPushRefreshConfirm(m, m.Trans("refresh for new space ", "刷新列表查看新空间 ")+m.Option(mdb.NAME))
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
mdb.REMOVE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
gdb.Event(m, DREAM_REMOVE, m.OptionSimple(mdb.NAME))
|
||||||
|
mdb.HashRemove(m)
|
||||||
|
}},
|
||||||
DOWNLOAD: {Name: "download path link", Hand: func(m *ice.Message, arg ...string) {
|
DOWNLOAD: {Name: "download path link", Hand: func(m *ice.Message, arg ...string) {
|
||||||
GoToast(m, func(toast func(string, int, int)) []string {
|
GoToast(m, func(toast func(string, int, int)) []string {
|
||||||
SpideSave(m, m.Option(nfs.PATH), kit.MergeURL(m.Option(mdb.LINK), cli.GOOS, runtime.GOOS, cli.GOARCH, runtime.GOARCH), func(count, total, value int) {
|
SpideSave(m, m.Option(nfs.PATH), kit.MergeURL(m.Option(mdb.LINK), cli.GOOS, runtime.GOOS, cli.GOARCH, runtime.GOARCH), func(count, total, value int) {
|
||||||
@ -474,7 +478,7 @@ func init() {
|
|||||||
} else if arg[0] == ctx.ACTION {
|
} else if arg[0] == ctx.ACTION {
|
||||||
gdb.Event(m, DREAM_ACTION, arg)
|
gdb.Event(m, DREAM_ACTION, arg)
|
||||||
} else {
|
} else {
|
||||||
mdb.HashSelects(m, arg[0])
|
mdb.HashSelects(m, arg[0]).PushAction(PORTAL, DESKTOP, ADMIN, OPEN, mdb.REMOVE)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
@ -489,7 +493,7 @@ func DreamTablesAction(arg ...string) ice.Actions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
func DreamAction() ice.Actions {
|
func DreamAction() ice.Actions {
|
||||||
return gdb.EventsAction(DREAM_INPUTS, DREAM_CREATE, DREAM_TRASH, DREAM_OPEN, DREAM_CLOSE, SPACE_LOGIN, SERVE_START)
|
return gdb.EventsAction(DREAM_INPUTS, DREAM_CREATE, DREAM_REMOVE, DREAM_TRASH, DREAM_OPEN, DREAM_CLOSE, SPACE_LOGIN, SERVE_START)
|
||||||
}
|
}
|
||||||
func DreamWhiteHandle(m *ice.Message, arg ...string) {
|
func DreamWhiteHandle(m *ice.Message, arg ...string) {
|
||||||
aaa.White(m, kit.Keys(DREAM, ctx.ACTION, m.ShortKey()))
|
aaa.White(m, kit.Keys(DREAM, ctx.ACTION, m.ShortKey()))
|
||||||
|
@ -218,13 +218,9 @@ func _space_send(m *ice.Message, name string, arg ...string) (h string) {
|
|||||||
m.Optionv(ice.MSG_USERPOD, kit.Simple(kit.Keys(target[1:]), m.Optionv(ice.MSG_USERPOD)))
|
m.Optionv(ice.MSG_USERPOD, kit.Simple(kit.Keys(target[1:]), m.Optionv(ice.MSG_USERPOD)))
|
||||||
m.Options(ice.MSG_USERHOST, "", ice.MSG_USERWEB0, m.Option(ice.MSG_USERWEB), ice.MSG_USERPOD0, name)
|
m.Options(ice.MSG_USERHOST, "", ice.MSG_USERWEB0, m.Option(ice.MSG_USERWEB), ice.MSG_USERPOD0, name)
|
||||||
})
|
})
|
||||||
kit.For([]string{ice.MSG_USERROLE, ice.LOG_TRACEID}, func(k string) { m.Optionv(k, m.Optionv(k)) })
|
|
||||||
m.Option(ice.MSG_HANDLE, ice.FALSE)
|
m.Option(ice.MSG_HANDLE, ice.FALSE)
|
||||||
kit.For(m.Optionv(ice.MSG_OPTS), func(k string) {
|
kit.For([]string{ice.MSG_USERROLE, ice.LOG_TRACEID, "space.noecho"}, func(k string) { m.Optionv(k, m.Optionv(k)) })
|
||||||
kit.If(!kit.IsIn(k, "task.id", "work.id"), func() {
|
kit.For(kit.Filters(kit.Simple(m.Optionv(ice.MSG_OPTS)), "task.id", "work.id"), func(k string) { m.Optionv(k, m.Optionv(k)) })
|
||||||
m.Optionv(k, m.Optionv(k))
|
|
||||||
})
|
|
||||||
})
|
|
||||||
if withecho {
|
if withecho {
|
||||||
_space_echo(m.Set(ice.MSG_DETAIL, arg...), []string{h}, target, c)
|
_space_echo(m.Set(ice.MSG_DETAIL, arg...), []string{h}, target, c)
|
||||||
} else {
|
} else {
|
||||||
|
@ -17,6 +17,9 @@ func _stream_subkey(m *ice.Message, arg ...string) *ice.Message {
|
|||||||
return m.Options(mdb.SUBKEY, kit.Keys(mdb.HASH, arg[0]), ice.MSG_FIELDS, mdb.Config(m, mdb.FIELDS))
|
return m.Options(mdb.SUBKEY, kit.Keys(mdb.HASH, arg[0]), ice.MSG_FIELDS, mdb.Config(m, mdb.FIELDS))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
PUSH = "push"
|
||||||
|
)
|
||||||
const STREAM = "stream"
|
const STREAM = "stream"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -30,10 +33,11 @@ func init() {
|
|||||||
mdb.HashCreate(_stream_subkey(m), ParseUA(m))
|
mdb.HashCreate(_stream_subkey(m), ParseUA(m))
|
||||||
mdb.HashSelect(m)
|
mdb.HashSelect(m)
|
||||||
}},
|
}},
|
||||||
"push": {Hand: func(m *ice.Message, arg ...string) {
|
PUSH: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Options(ice.MSG_SPACE, arg[0], ice.MSG_INDEX, arg[1])
|
||||||
mdb.HashSelect(_stream_subkey(m)).Table(func(value ice.Maps) {
|
mdb.HashSelect(_stream_subkey(m)).Table(func(value ice.Maps) {
|
||||||
if value[cli.DAEMON] != m.Option(ice.MSG_DAEMON) {
|
if value[cli.DAEMON] != m.Option(ice.MSG_DAEMON) {
|
||||||
m.Options(mdb.SUBKEY, "").Cmd(SPACE, value[cli.DAEMON], arg)
|
m.Options(mdb.SUBKEY, "").Cmd(SPACE, value[cli.DAEMON], arg[2:])
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}},
|
}},
|
||||||
@ -59,14 +63,14 @@ func init() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
func StreamPush(m *ice.Message, arg ...string) {
|
func StreamPush(m *ice.Message, arg ...string) {
|
||||||
if ice.Info.NodeType == WORKER {
|
AdminCmd(m, STREAM, PUSH, m.Option(ice.MSG_USERPOD), m.ShortKey(), arg)
|
||||||
m.Option(ice.MSG_SPACE, m.Option(ice.MSG_USERPOD))
|
}
|
||||||
} else {
|
func StreamPushRefresh(m *ice.Message, arg ...string) {
|
||||||
m.Option(ice.MSG_SPACE, "")
|
StreamPush(m.Spawn(ice.Maps{"space.noecho": ice.TRUE}), kit.Simple(html.REFRESH, arg)...)
|
||||||
}
|
|
||||||
m.Option(ice.MSG_INDEX, m.ShortKey())
|
|
||||||
AdminCmd(m, STREAM, "push", arg)
|
|
||||||
}
|
}
|
||||||
func StreamPushRefreshConfirm(m *ice.Message, arg ...string) {
|
func StreamPushRefreshConfirm(m *ice.Message, arg ...string) {
|
||||||
StreamPush(m.Spawn(ice.Maps{"space.noecho": "true"}), kit.Simple(html.REFRESH, html.CONFIRM, arg)...)
|
if len(arg) == 0 {
|
||||||
|
arg = append(arg, m.Trans("refresh for new data ", "刷新列表,查看最新数据 "))
|
||||||
|
}
|
||||||
|
StreamPushRefresh(m, kit.Simple(html.CONFIRM, arg)...)
|
||||||
}
|
}
|
||||||
|
@ -30,11 +30,11 @@ 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>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.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.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.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.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.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.plug>div.container>div.content fieldset.story.user>form.option>div.item.username 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>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 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); }
|
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); }
|
||||||
|
@ -7,7 +7,6 @@ import (
|
|||||||
"shylinux.com/x/icebergs/base/aaa"
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
"shylinux.com/x/icebergs/base/cli"
|
"shylinux.com/x/icebergs/base/cli"
|
||||||
"shylinux.com/x/icebergs/base/ctx"
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
"shylinux.com/x/icebergs/base/gdb"
|
|
||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
"shylinux.com/x/icebergs/base/tcp"
|
"shylinux.com/x/icebergs/base/tcp"
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
@ -38,9 +37,8 @@ func init() {
|
|||||||
mdb.INSERT: {Hand: func(m *ice.Message, arg ...string) {
|
mdb.INSERT: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.ZoneInsert(m, kit.Simple(arg[0], tcp.DIRECT, tcp.SEND, arg[1:], aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.AVATAR, m.Option(ice.MSG_AVATAR)))
|
mdb.ZoneInsert(m, kit.Simple(arg[0], tcp.DIRECT, tcp.SEND, arg[1:], aaa.USERNAME, m.Option(ice.MSG_USERNAME), aaa.USERNICK, m.Option(ice.MSG_USERNICK), aaa.AVATAR, m.Option(ice.MSG_AVATAR)))
|
||||||
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()) })
|
||||||
web.StreamPushRefreshConfirm(m, m.Trans("refresh for new message ", "刷新列表,查看最新消息 "))
|
web.StreamPushRefresh(m)
|
||||||
}},
|
}},
|
||||||
cli.CLEAR: {Hand: func(m *ice.Message, arg ...string) {}},
|
|
||||||
tcp.SEND: {Hand: func(m *ice.Message, arg ...string) {
|
tcp.SEND: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmd("", mdb.INSERT, arg, tcp.DIRECT, tcp.SEND)
|
m.Cmd("", mdb.INSERT, arg, tcp.DIRECT, tcp.SEND)
|
||||||
kit.If(mdb.HashSelectField(m, arg[0], web.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:]) })
|
||||||
@ -49,9 +47,13 @@ func init() {
|
|||||||
m.Cmd("", mdb.INSERT, m.Option(ice.FROM_SPACE), arg, tcp.DIRECT, tcp.RECV)
|
m.Cmd("", mdb.INSERT, m.Option(ice.FROM_SPACE), arg, tcp.DIRECT, tcp.RECV)
|
||||||
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, web.TARGET, m.Option(ice.FROM_SPACE)) })
|
||||||
}},
|
}},
|
||||||
web.OPEN: {Hand: func(m *ice.Message, arg ...string) { m.ProcessOpen(m.MergePod(m.Option(web.TARGET))) }},
|
cli.CLEAR: {Hand: func(m *ice.Message, arg ...string) {}},
|
||||||
|
web.OPEN: {Hand: func(m *ice.Message, arg ...string) { m.ProcessOpen(m.MergePod(m.Option(web.TARGET))) }},
|
||||||
web.DREAM_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
web.DREAM_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
MessageInsertPlug(m, web.DREAM, "", "", IFRAME, web.S(m.Option(mdb.NAME)))
|
MessageInsertPlug(m, web.DREAM, "", "", web.DREAM, m.Option(mdb.NAME))
|
||||||
|
}},
|
||||||
|
web.DREAM_REMOVE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
MessageInsertPlug(m, web.DREAM, "", "", web.DREAM, m.Option(mdb.NAME))
|
||||||
}},
|
}},
|
||||||
web.SPACE_LOGIN: {Hand: func(m *ice.Message, arg ...string) {
|
web.SPACE_LOGIN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
MessageInsertPlug(m, aaa.APPLY, "", "", web.CHAT_GRANT, m.Option(mdb.NAME))
|
MessageInsertPlug(m, aaa.APPLY, "", "", web.CHAT_GRANT, m.Option(mdb.NAME))
|
||||||
@ -76,10 +78,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
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(), gdb.EventsAction(
|
}, web.DreamTablesAction(), web.DreamAction(), aaa.OfferAction(), mdb.ZoneAction(
|
||||||
aaa.OFFER_CREATE, aaa.OFFER_ACCEPT,
|
|
||||||
aaa.USER_CREATE, aaa.USER_REMOVE,
|
|
||||||
), mdb.ZoneAction(
|
|
||||||
mdb.SHORT, mdb.ZONE, mdb.FIELD, "time,hash,type,zone,icons,title,count,target",
|
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",
|
mdb.FIELDS, "time,id,type,name,text,space,index,args,style,display,username,usernick,avatar,direct",
|
||||||
web.ONLINE, ice.TRUE,
|
web.ONLINE, ice.TRUE,
|
||||||
@ -116,8 +115,17 @@ func MessageCreate(m *ice.Message, zone, icons string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
func MessageInsert(m *ice.Message, zone string, arg ...string) {
|
func MessageInsert(m *ice.Message, zone string, arg ...string) {
|
||||||
m.Cmd(MESSAGE, mdb.INSERT, zone, tcp.DIRECT, tcp.RECV, arg)
|
if ice.Info.Important {
|
||||||
|
m.Cmd(MESSAGE, mdb.INSERT, zone, tcp.DIRECT, tcp.RECV, arg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
func MessageInsertPlug(m *ice.Message, zone, name, text, index, args string, arg ...string) {
|
func MessageInsertPlug(m *ice.Message, zone, name, text, index, args string, arg ...string) {
|
||||||
|
kit.If(text == "", func() {
|
||||||
|
msg := m.Cmd(index, args)
|
||||||
|
if msg.Option(ice.MSG_STATUS) == "" {
|
||||||
|
msg.StatusTimeCount()
|
||||||
|
}
|
||||||
|
text = msg.FormatMeta()
|
||||||
|
})
|
||||||
MessageInsert(m, zone, kit.Simple(mdb.TYPE, html.PLUG, mdb.NAME, kit.Select(m.ActionKey(), name), mdb.TEXT, text, ctx.INDEX, index, ctx.ARGS, args, arg)...)
|
MessageInsert(m, zone, kit.Simple(mdb.TYPE, html.PLUG, mdb.NAME, kit.Select(m.ActionKey(), name), mdb.TEXT, text, ctx.INDEX, index, ctx.ARGS, args, arg)...)
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ Volcanos(chat.ONFIGURE, {
|
|||||||
return {view: wiki.CONTENT, list: [{text: value.text||"[未知消息]"}], _init: function(target) {
|
return {view: wiki.CONTENT, list: [{text: value.text||"[未知消息]"}], _init: function(target) {
|
||||||
if (value.display) { var msg = can.request(); msg.Echo(value.text), can.onmotion.clear(can, target)
|
if (value.display) { var msg = can.request(); msg.Echo(value.text), can.onmotion.clear(can, target)
|
||||||
var height = can.onexport.plugHeight(can, value), width = can.onexport.plugWidth(can, value)
|
var height = can.onexport.plugHeight(can, value), width = can.onexport.plugWidth(can, value)
|
||||||
can.onappend.plugin(can, {title: value.name, index: "can._filter", height: height, display: value.display, msg: msg}, function(sub) {
|
can.onappend.plugin(can, {title: value.name, index: "can._plugin", args: value.args, height: height, display: value.display, msg: msg}, function(sub) {
|
||||||
sub.onimport.size(sub, height, width)
|
sub.onimport.size(sub, height, width)
|
||||||
delete(sub._legend.onclick)
|
delete(sub._legend.onclick)
|
||||||
}, target)
|
}, target)
|
||||||
@ -134,17 +134,16 @@ 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}, _init: function(target) { value.type = chat.STORY
|
||||||
var list = can.core.Split(can.ConfSpace()||can.misc.Search(can, ice.POD)||"", ".")
|
var list = can.core.Split(can.ConfSpace()||can.misc.Search(can, ice.POD)||"", ".")
|
||||||
var _list = can.core.Split(value.direct == "recv"? can.db.zone.target: "", ".")
|
var _list = can.core.Split(value.direct == "recv"? can.db.zone.target: "", ".")
|
||||||
can.base.isIn(_list[0], "ops", "dev") && (list.pop(), _list.shift())
|
can.base.isIn(_list[0], "ops", "dev") && (list.pop(), _list.shift())
|
||||||
value._space = list.concat(_list).join(".").replaceAll("..", ".")
|
value._space = list.concat(_list).join(".").replaceAll("..", ".")
|
||||||
value._commands = {direct: value.direct, target: can.db.zone.target}
|
value._commands = {direct: value.direct, target: can.db.zone.target}
|
||||||
value.title = value.name
|
value.title = value.name; if (value.text) { var msg = can.request(); msg._xhr = {responseText: value.text}, value.msg = msg, msg.Copy(JSON.parse(value.text)) }
|
||||||
can.onappend.plugin(can, value, function(sub) {
|
can.onappend.plugin(can, value, function(sub) { sub.onimport.size(sub, height, width, false)
|
||||||
sub.onimport.size(sub, height, width)
|
sub.onexport.output = function() { sub.onimport.size(sub, height, width, false)
|
||||||
sub.onexport.output = function() {
|
can.page.style(can, target, html.HEIGHT, sub._target.offsetHeight+2)
|
||||||
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)
|
||||||
}
|
}
|
||||||
}, target)
|
}, target)
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
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/ctx"
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
"shylinux.com/x/icebergs/base/gdb"
|
|
||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
"shylinux.com/x/icebergs/base/web/html"
|
"shylinux.com/x/icebergs/base/web/html"
|
||||||
@ -71,6 +70,9 @@ func init() {
|
|||||||
web.StreamPushRefreshConfirm(m, m.Trans("refresh for new message ", "刷新列表,查看最新消息 "))
|
web.StreamPushRefreshConfirm(m, m.Trans("refresh for new message ", "刷新列表,查看最新消息 "))
|
||||||
}},
|
}},
|
||||||
web.DREAM_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
web.DREAM_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
PlanInsert(m, web.DREAM, "", m.Option(mdb.NAME), web.CHAT_IFRAME, web.S(m.Option(mdb.NAME)))
|
||||||
|
}},
|
||||||
|
web.DREAM_REMOVE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
PlanInsert(m, web.DREAM, "", "", web.CHAT_IFRAME, web.S(m.Option(mdb.NAME)))
|
PlanInsert(m, web.DREAM, "", "", web.CHAT_IFRAME, web.S(m.Option(mdb.NAME)))
|
||||||
}},
|
}},
|
||||||
aaa.OFFER_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
aaa.OFFER_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
@ -82,6 +84,9 @@ func init() {
|
|||||||
aaa.USER_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
aaa.USER_CREATE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
PlanInsert(m, aaa.APPLY, "", "", aaa.USER, m.Option(aaa.USERNAME))
|
PlanInsert(m, aaa.APPLY, "", "", aaa.USER, m.Option(aaa.USERNAME))
|
||||||
}},
|
}},
|
||||||
|
aaa.USER_REMOVE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
PlanInsert(m, aaa.APPLY, "", "", aaa.USER, m.Option(aaa.USERNAME))
|
||||||
|
}},
|
||||||
ctx.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
ctx.RUN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.RenameOption(TASK_POD, ice.POD); ctx.PodCmd(m, m.ShortKey(), ctx.RUN, arg) {
|
if m.RenameOption(TASK_POD, ice.POD); ctx.PodCmd(m, m.ShortKey(), ctx.RUN, arg) {
|
||||||
return
|
return
|
||||||
@ -91,10 +96,7 @@ func init() {
|
|||||||
m.Cmdy(arg)
|
m.Cmdy(arg)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
}, web.DreamTablesAction(), web.DreamAction(), gdb.EventsAction(
|
}, web.DreamTablesAction(), web.DreamAction(), aaa.OfferAction(), ctx.ConfAction(mdb.TOOLS, kit.Simple(TODO, EPIC), web.ONLINE, ice.TRUE), TASK), Hand: func(m *ice.Message, arg ...string) {
|
||||||
aaa.OFFER_CREATE, aaa.OFFER_ACCEPT,
|
|
||||||
aaa.USER_CREATE, aaa.USER_REMOVE,
|
|
||||||
), ctx.ConfAction(mdb.TOOLS, "todo,epic", "online", ice.TRUE), TASK), Hand: func(m *ice.Message, arg ...string) {
|
|
||||||
begin_time, end_time := _plan_scope(m, kit.Slice(arg, 0, 2)...)
|
begin_time, end_time := _plan_scope(m, kit.Slice(arg, 0, 2)...)
|
||||||
_plan_list(m, begin_time.Format(ice.MOD_TIME), end_time.Format(ice.MOD_TIME))
|
_plan_list(m, begin_time.Format(ice.MOD_TIME), end_time.Format(ice.MOD_TIME))
|
||||||
web.PushPodCmd(m, "", arg...)
|
web.PushPodCmd(m, "", arg...)
|
||||||
@ -104,8 +106,10 @@ func init() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
func PlanInsert(m *ice.Message, zone, name, text, index, args string, arg ...string) {
|
func PlanInsert(m *ice.Message, zone, name, text, index, args string, arg ...string) {
|
||||||
m.Cmd(PLAN, mdb.INSERT, web.SPACE, "", mdb.ZONE, zone, mdb.TYPE, "once",
|
if ice.Info.Important {
|
||||||
mdb.NAME, kit.Select(m.ActionKey(), name), mdb.TEXT, kit.Select(args, text), BEGIN_TIME, m.Time(),
|
m.Cmd(PLAN, mdb.INSERT, web.SPACE, "", mdb.ZONE, zone, mdb.TYPE, "once",
|
||||||
"extra.index", index, "extra.args", args, arg,
|
mdb.NAME, kit.Select(m.ActionKey(), name), mdb.TEXT, kit.Select(args, text), BEGIN_TIME, m.Time(),
|
||||||
)
|
"extra.index", index, "extra.args", args, arg,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user