1
0
mirror of https://shylinux.com/x/icebergs synced 2025-06-26 02:17:30 +08:00

add island.group

This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-02-02 00:05:53 +08:00
parent 931ff8c428
commit bd3deec2f9
14 changed files with 55 additions and 21 deletions

View File

@ -161,7 +161,7 @@ func Right(m *ice.Message, key ...ice.Any) bool {
} else if len(key) > 0 && key[0] == ice.ETC_PATH {
return true
}
return m.Option(ice.MSG_USERROLE) == ROOT || !m.Warn(m.Cmdx(ROLE, RIGHT, m.Option(ice.MSG_USERROLE), key, logs.FileLineMeta(-1)) != ice.OK,
return !ice.Info.Important || m.Option(ice.MSG_USERROLE) == ROOT || !m.Warn(m.Cmdx(ROLE, RIGHT, m.Option(ice.MSG_USERROLE), key, logs.FileLineMeta(-1)) != ice.OK,
ice.ErrNotRight, kit.Keys(key...), USERROLE, m.Option(ice.MSG_USERROLE), logs.FileLineMeta(-1))
}
func IsTechOrRoot(m *ice.Message) bool {

View File

@ -390,6 +390,12 @@ func Richs(m *ice.Message, prefix string, chain Any, raw Any, cb Any) (res Map)
if cache == nil {
return nil
}
if value := kit.Format(raw); strings.Contains(value, ",") {
kit.For(kit.Split(value), func(value string) {
res = miss.Richs(path.Join(prefix, kit.Keys(chain)), cache, value, cb)
})
return
}
return miss.Richs(path.Join(prefix, kit.Keys(chain)), cache, raw, cb)
}

View File

@ -82,15 +82,18 @@ func init() {
LOGIN: {Help: "登录", Hand: func(m *ice.Message, arg ...string) {
m.EchoQRCode(m.Cmd(SHARE, mdb.CREATE, mdb.TYPE, LOGIN).Option(mdb.LINK)).ProcessInner()
}},
OPEN: {Hand: func(m *ice.Message, arg ...string) {
m.ProcessOpen(m.MergeLink("/share/" + m.Option(mdb.HASH)))
}},
ctx.COMMAND: {Hand: func(m *ice.Message, arg ...string) {
if msg := mdb.HashSelects(m.Spawn(), m.Option(SHARE)); !IsNotValidFieldShare(m, msg) {
m.Cmdy(Space(m, msg.Append(SPACE)), ctx.COMMAND, msg.Append(mdb.NAME))
m.Cmdy(Space(m, msg.Append(SPACE)), ctx.COMMAND, msg.Append(mdb.NAME), kit.Dict(ice.MSG_USERPOD, msg.Append(SPACE)))
}
}},
ctx.RUN: {Hand: func(m *ice.Message, arg ...string) {
if msg := mdb.HashSelects(m.Spawn(), m.Option(SHARE)); !IsNotValidFieldShare(m, msg) {
aaa.SessAuth(m, kit.Dict(msg.AppendSimple(aaa.USERNICK, aaa.USERNAME, aaa.USERROLE)))
m.Cmdy(Space(m, msg.Append(SPACE)), msg.Append(mdb.NAME), arg[1:])
m.Cmdy(Space(m, msg.Append(SPACE)), msg.Append(mdb.NAME), kit.UnMarshal(msg.Append(mdb.TEXT)), arg[1:], kit.Dict(ice.MSG_USERPOD, msg.Append(SPACE)))
}
}},
nfs.PS: {Hand: func(m *ice.Message, arg ...string) {
@ -123,7 +126,7 @@ func init() {
}},
}, mdb.HashAction(mdb.FIELD, "time,hash,type,name,text,usernick,username,userrole", mdb.EXPIRE, mdb.DAYS)), Hand: func(m *ice.Message, arg ...string) {
if kit.IsIn(m.Option(ice.MSG_USERROLE), aaa.ROOT, aaa.TECH) || len(arg) > 0 && arg[0] != "" {
mdb.HashSelect(m, arg...)
mdb.HashSelect(m, arg...).PushAction(OPEN, mdb.REMOVE)
}
}},
PP(SHARE, CACHE): {Hand: func(m *ice.Message, arg ...string) { _share_cache(m, arg...) }},
@ -199,3 +202,6 @@ func ShareLocal(m *ice.Message, p string) string {
}
return m.MergeLink(PP(SHARE, LOCAL, p))
}
func ShareField(m *ice.Message, cmd string, arg ...ice.Any) *ice.Message {
return m.EchoQRCode(tcp.PublishLocalhost(m, m.MergeLink("/share/"+AdminCmdPost(m, SHARE, mdb.CREATE, mdb.TYPE, FIELD, mdb.NAME, kit.Select(m.PrefixKey(), cmd), mdb.TEXT, kit.Format(kit.Simple(arg...)), ice.POD, m.Option(ice.MSG_USERPOD)))))
}

View File

@ -92,7 +92,7 @@ func _space_fork(m *ice.Message) {
if msg := m.Cmd(TOKEN, m.Option(TOKEN)); msg.Append(mdb.TIME) > m.Time() && kit.IsIn(msg.Append(mdb.TYPE), SERVER, SPIDE) {
aaa.SessAuth(m, kit.Dict(m.Cmd(aaa.USER, m.Option(ice.MSG_USERNAME, msg.Append(mdb.NAME))).AppendSimple()))
name = SpaceName(kit.Select(name, msg.Append(mdb.TEXT)))
safe = true
safe = aaa.IsTechOrRoot(m)
}
}
args := kit.Simple(mdb.TYPE, m.Option(mdb.TYPE), mdb.NAME, name, mdb.TEXT, text, m.OptionSimple(mdb.TIME, nfs.MODULE, nfs.VERSION, cli.DAEMON))

View File

@ -285,7 +285,8 @@ func init() {
if p := path.Join(ice.SRC_TEMPLATE, m.PrefixKey(), path.Join(arg...)); nfs.Exists(m, p) {
return p + kit.Select("", nfs.PS, len(arg) == 0)
} else {
return path.Join(path.Dir(ctx.GetCmdFile(m, m.PrefixKey())), path.Join(arg...)) + kit.Select("", nfs.PS, len(arg) == 0)
return kit.MergeURL(ctx.FileURI(path.Join(path.Dir(ctx.GetCmdFile(m, m.PrefixKey())), path.Join(arg...))), ice.POD, m.Option(ice.MSG_USERPOD))
// return path.Join(path.Dir(ctx.GetCmdFile(m, m.PrefixKey())), path.Join(arg...)) + kit.Select("", nfs.PS, len(arg) == 0)
}
}
nfs.TemplateText = func(m *ice.Message, p string) string {
@ -474,7 +475,7 @@ func SpideURL(m *ice.Message, name string) string {
return m.Cmdv(SPIDE, name, CLIENT_URL)
}
func ProcessIframe(m *ice.Message, title, link string, arg ...string) *ice.Message {
if m.IsMetaKey() {
if m.IsMetaKey() || m.IsMobileUA() {
return m.ProcessOpen(link)
}
if !kit.HasPrefixList(arg, ctx.RUN) {

View File

@ -43,11 +43,11 @@ func init() {
PORTAL: {Role: aaa.VOID, Hand: func(m *ice.Message, arg ...string) {
ProcessIframe(m, m.Option(mdb.NAME), m.Option(ORIGIN)+S(m.Option(mdb.NAME))+C(PORTAL), arg...)
}},
}), Hand: func(m *ice.Message, arg ...string) {
}, ctx.ConfAction(CLIENT_TIMEOUT, "300ms")), Hand: func(m *ice.Message, arg ...string) {
m.Display("")
if len(arg) == 0 {
m.Cmd(SPIDE, arg, kit.Dict(ice.MSG_FIELDS, "time,icon,client.type,client.name,client.origin")).Table(func(value ice.Maps) {
kit.If(value[CLIENT_TYPE] == nfs.REPOS, func() { m.Push(mdb.NAME, value[CLIENT_NAME]).Push(mdb.ICON, value[mdb.ICON]) })
m.Cmd(SPIDE, arg, kit.Dict(ice.MSG_FIELDS, "time,icons,client.type,client.name,client.origin")).Table(func(value ice.Maps) {
kit.If(value[CLIENT_TYPE] == nfs.REPOS, func() { m.Push(mdb.NAME, value[CLIENT_NAME]).Push(mdb.ICONS, value[mdb.ICONS]) })
})
if ice.Info.NodeType == WORKER {
return
@ -55,11 +55,9 @@ func init() {
m.Action(html.FILTER, mdb.CREATE)
} else {
origin := SpideOrigin(m, arg[0])
if arg[0] == ice.OPS {
origin = tcp.PublishLocalhost(m, origin)
}
kit.If(arg[0] == ice.OPS, func() { origin = tcp.PublishLocalhost(m, origin) })
list := m.Spawn(ice.Maps{ice.MSG_FIELDS: ""}).CmdMap(DREAM, mdb.NAME)
m.SetAppend().Spawn().SplitIndex(m.Cmdx(SPIDE, arg[0], C(DREAM))).Table(func(value ice.Maps) {
m.SetAppend().Spawn().SplitIndex(m.Cmdx(SPIDE, arg[0], C(DREAM), kit.Dict(mdb.ConfigSimple(m, CLIENT_TIMEOUT)))).Table(func(value ice.Maps) {
if value[mdb.TYPE] != WORKER {
return
}

View File

@ -1,3 +1,14 @@
Volcanos(chat.ONIMPORT, {
_init: function(can, msg) { can.ui = can.onappend.layout(can), can.onimport.__project(can, msg) },
__project: function(can, msg) { var select, current = can.sup.db._zone||can.db.hash[0]||ice.DEV
msg.Table(function(value) {
var _target = can.onimport.item(can, value, function(event) { can.isCmdMode()? can.misc.SearchHash(can, value.name): can.sup.db._zone = value.name
if (can.onmotion.cache(can, function() { return value.name }, can.ui.content, can._status)) { return can.onimport.layout(can) }
can.run(can.request(event, {_toast: ice.PROCESS}), [value.name], function(msg) {
can.onimport.__content(can, msg), can.onappend._status(can, msg), can.onimport.layout(can)
})
}, function() {}, can.ui.project); select = (value.name == current? _target: select)||_target
}), select && select.click(), can.onmotion.orderShow(can, can.ui.project)
can.onappend.style(can, "output card", can.ui.content), can.onmotion.delay(can, function() { can.onimport.layout(can) })
}, __content: function(can, msg) { can.onimport.card(can, msg) },
}, [""])

View File

@ -1,6 +1,6 @@
fieldset.macos.desktop { --desktop-menu-height:25px; }
fieldset.macos.desktop { background-size:cover; background-position:center; }
fieldset.macos.desktop>div.output { background-color:transparent; }
fieldset.macos.desktop>div.output { background-color:transparent; overflow:hidden; }
fieldset.macos.desktop>div.output>fieldset.macos { background-color:var(--plugin-bg-color); }
fieldset.macos.desktop>div.output>fieldset.macos>div.output { background-color:transparent; }
fieldset.macos.desktop>div.output>fieldset.macos.menu { line-height:var(--desktop-menu-height); border-radius:0; height:var(--desktop-menu-height); width:100%; position:sticky; top:0; overflow:hidden; }

View File

@ -125,7 +125,9 @@ func init() {
case mdb.ZONE, mdb.NAME:
m.Cmdy(nfs.DIR, nfs.PWD, mdb.NAME, kit.Dict(nfs.DIR_ROOT, ice.SRC, nfs.DIR_TYPE, nfs.DIR))
case mdb.KEY:
m.Push(arg[0], Prefix(m.Option(mdb.ZONE), m.Option(mdb.NAME)))
kit.For([]string{"code", "wiki", "chat", "team", "mall"}, func(p string) {
m.Push(arg[0], kit.Keys("web", p, m.Option(mdb.ZONE), m.Option(mdb.NAME)))
})
}
}},
nfs.SCRIPT: {Help: "脚本", Hand: func(m *ice.Message, arg ...string) {

View File

@ -25,6 +25,8 @@ fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column { displ
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column fieldset.inner>div.output>div.layout>div.layout div.content div.tips { top:10px; right:10px; }
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column h1 { font-size:48px; }
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column h2 { margin:0; }
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset { width:fit-content; }
body.mobile fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset>div.action { display:none; }
fieldset.web.wiki.portal>div.output>div.layout>div.main fieldset.inner.output div.content {
background-color:var(--code-bg-color); color:var(--code-fg-color); padding:var(--input-padding) 0;
--code-comment:silver; --code-keyword:orange;

View File

@ -4,8 +4,8 @@ Volcanos(chat.ONIMPORT, {
var p = "/c/"+web.PORTAL; can.db.prefix = location.pathname.indexOf(p) > -1? location.pathname.split(p)[0]+p: nfs.WIKI_PORTAL
can.db.current = can.isCmdMode()? can.base.trimPrefix(location.pathname, can.db.prefix+nfs.PS, can.db.prefix): can.Option(nfs.PATH)
can.sup.onexport.link = function() { return can.misc.MergeURL(can, {pod: can.ConfSpace(), cmd: web.PORTAL}) }
can.require(["/plugin/local/wiki/word.js"])
can.Conf(html.PADDING, can.page.styleValueInt(can, "--portal-main-padding", can._output))
can.require(["/plugin/local/wiki/word.js"])
can.onmotion.clear(can), can.isCmdMode() && can.onappend.style(can, html.OUTPUT)
can.ui = can.onappend.layout(can, [html.HEADER, [html.NAV, html.MAIN, html.ASIDE]], html.FLOW), can.onimport._scroll(can)
can.ui.header.innerHTML = msg.Append(html.HEADER), can.ui.nav.innerHTML = msg.Append(html.NAV)

View File

@ -200,6 +200,8 @@ func (m *Message) Table(cb Any) *Message {
cb(index, value, head)
case func(index int, value Maps):
cb(index, value)
case func(value Maps, index int):
cb(value, index)
case func(value Maps):
cb(value)
default:

View File

@ -4,15 +4,20 @@ import (
ice "shylinux.com/x/icebergs"
"shylinux.com/x/icebergs/base/lex"
"shylinux.com/x/icebergs/base/mdb"
"shylinux.com/x/icebergs/base/nfs"
kit "shylinux.com/x/toolkits"
)
func _configs_set(m *ice.Message, k, v string) string { return _git_cmds(m, CONFIG, GLOBAL, k, v) }
func _configs_get(m *ice.Message, k string) string { return _git_cmds(m, CONFIG, GLOBAL, k) }
func _configs_get(m *ice.Message, k string) string {
return _git_cmds(m, CONFIG, GLOBAL, k)
}
func _configs_list(m *ice.Message) *ice.Message {
if nfs.Exists(m, kit.HomePath(_GITCONFIG)) {
kit.SplitKV(mdb.EQ, lex.NL, _configs_get(m, LIST), func(text string, ls []string) {
m.Push(mdb.NAME, ls[0]).Push(mdb.VALUE, ls[1]).PushButton(mdb.REMOVE)
})
}
return mdb.HashSelectValue(m, func(value ice.Maps) {
m.Push("", value, kit.Split("name,value")).PushButton(mdb.CREATE)
})

View File

@ -637,6 +637,7 @@ func init() {
}
}},
web.SERVE_START: {Hand: func(m *ice.Message, arg ...string) {
return
m.Go(func() {
m.Cmd("", CLONE, REMOTE, "node_modules", mdb.NAME, "", nfs.PATH, "")
m.Cmd("", CLONE, REMOTE, "icons", mdb.NAME, "", nfs.PATH, "")