forked from x/icebergs
add some
This commit is contained in:
parent
7dcf68b0d8
commit
2e0131a331
@ -42,6 +42,7 @@ func _serve_start(m *ice.Message) {
|
|||||||
kit.For(kit.Split(m.Option(ice.DEV)), func(dev string) {
|
kit.For(kit.Split(m.Option(ice.DEV)), func(dev string) {
|
||||||
if strings.HasPrefix(dev, HTTP) {
|
if strings.HasPrefix(dev, HTTP) {
|
||||||
m.Cmd(SPIDE, mdb.CREATE, dev, ice.DEV, "", nfs.REPOS)
|
m.Cmd(SPIDE, mdb.CREATE, dev, ice.DEV, "", nfs.REPOS)
|
||||||
|
m.Cmd(SPIDE, mdb.CREATE, dev, "dev_ip", "", "dev_ip")
|
||||||
dev = ice.DEV
|
dev = ice.DEV
|
||||||
}
|
}
|
||||||
if msg := m.Cmds(SPIDE, dev); msg.Append(TOKEN) == "" {
|
if msg := m.Cmds(SPIDE, dev); msg.Append(TOKEN) == "" {
|
||||||
|
@ -15,7 +15,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
"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/log"
|
"shylinux.com/x/icebergs/base/log"
|
||||||
@ -295,12 +294,11 @@ func init() {
|
|||||||
conf := mdb.Confm(m, cli.RUNTIME, cli.CONF)
|
conf := mdb.Confm(m, cli.RUNTIME, cli.CONF)
|
||||||
dev := kit.Select("https://dev.shylinux.com", ice.Info.Make.Domain, conf[cli.CTX_DEV])
|
dev := kit.Select("https://dev.shylinux.com", ice.Info.Make.Domain, conf[cli.CTX_DEV])
|
||||||
m.Cmd("", mdb.CREATE, dev, ice.DEV, ice.SRC_MAIN_ICO, nfs.REPOS)
|
m.Cmd("", mdb.CREATE, dev, ice.DEV, ice.SRC_MAIN_ICO, nfs.REPOS)
|
||||||
m.Cmd("", mdb.CREATE, kit.Select(dev, os.Getenv("ctx_dev_ip")), ice.DEV_IP, ice.SRC_MAIN_ICO)
|
m.Cmd("", mdb.CREATE, kit.Select(dev, os.Getenv("ctx_dev_ip")), ice.DEV_IP, ice.SRC_MAIN_ICO, "dev_ip")
|
||||||
m.Cmd("", mdb.CREATE, kit.Select("https://shylinux.com", conf[cli.CTX_SHY]), ice.SHY, ice.SRC_MAIN_ICO, nfs.REPOS)
|
|
||||||
m.Cmd("", mdb.CREATE, kit.Select("http://localhost:9020", conf[cli.CTX_OPS]), ice.OPS, ice.SRC_MAIN_ICO, nfs.REPOS)
|
m.Cmd("", mdb.CREATE, kit.Select("http://localhost:9020", conf[cli.CTX_OPS]), ice.OPS, ice.SRC_MAIN_ICO, nfs.REPOS)
|
||||||
m.Cmd("", mdb.CREATE, kit.Select("http://localhost:20000", conf[cli.CTX_DEMO]), ice.DEMO, ice.SRC_MAIN_ICO)
|
m.Cmd("", mdb.CREATE, kit.Select("https://shylinux.com", conf[cli.CTX_SHY]), ice.SHY, ice.SRC_MAIN_ICO, nfs.REPOS)
|
||||||
m.Cmd("", mdb.CREATE, kit.Select("https://mail.shylinux.com", conf[cli.CTX_MAIL]), ice.MAIL, "usr/icons/Mail.png")
|
m.Cmd("", mdb.CREATE, kit.Select("https://mail.shylinux.com", conf[cli.CTX_MAIL]), ice.MAIL, "usr/icons/Mail.png", "mail")
|
||||||
m.Cmd("", mdb.CREATE, kit.Select("https://user.shylinux.com"), aaa.USER, "usr/icons/Mail.png")
|
m.Cmd("", mdb.CREATE, kit.Select("https://demo.shylinux.com", conf[cli.CTX_DEMO]), ice.DEMO, ice.SRC_MAIN_ICO, "demo")
|
||||||
m.Cmd("", mdb.CREATE, "https://2023-contexts.shylinux.com", "2023-contexts", ice.SRC_MAIN_ICO, nfs.REPOS)
|
m.Cmd("", mdb.CREATE, "https://2023-contexts.shylinux.com", "2023-contexts", ice.SRC_MAIN_ICO, nfs.REPOS)
|
||||||
m.Cmd("", mdb.CREATE, "https://2024-contexts.shylinux.com", "2024-contexts", ice.SRC_MAIN_ICO, nfs.REPOS)
|
m.Cmd("", mdb.CREATE, "https://2024-contexts.shylinux.com", "2024-contexts", ice.SRC_MAIN_ICO, nfs.REPOS)
|
||||||
}},
|
}},
|
||||||
@ -343,19 +341,20 @@ func init() {
|
|||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
mdb.CREATE: {Name: "create origin* name icons type token", Hand: func(m *ice.Message, arg ...string) {
|
mdb.CREATE: {Name: "create origin* name icons type token", Hand: func(m *ice.Message, arg ...string) {
|
||||||
if m.Option(mdb.NAME) == "" && m.Option(mdb.ICONS) == "" {
|
if m.Option(mdb.NAME) == "" || m.Option(mdb.ICONS) == "" {
|
||||||
msg := m.Spawn().SplitIndex(m.Cmdx(SPIDE, ice.DEV, kit.MergeURL2(m.Option(ORIGIN), C(SPACE, "info"))))
|
msg := m.Spawn().SplitIndex(m.Cmdx(SPIDE, ice.DEV, kit.MergeURL2(m.Option(ORIGIN), C(SPACE, ice.INFO))))
|
||||||
m.Option(mdb.ICONS, m.Resource(msg.Append(mdb.ICONS), msg.Append(ORIGIN)))
|
if m.OptionDefault(mdb.NAME, msg.Append(mdb.NAME)); msg.Append(mdb.ICONS) != "" {
|
||||||
m.Option(mdb.NAME, msg.Append(mdb.NAME))
|
m.OptionDefault(mdb.ICONS, m.Resource(msg.Append(mdb.ICONS), msg.Append(ORIGIN)))
|
||||||
m.OptionDefault(mdb.TYPE, nfs.REPOS)
|
m.OptionDefault(mdb.TYPE, nfs.REPOS)
|
||||||
}
|
}
|
||||||
if u, e := url.Parse(m.Option(ORIGIN)); m.Warn(e != nil || u.Host == "", ice.ErrNotValid, m.Option(ORIGIN)) {
|
}
|
||||||
|
if u, e := url.Parse(m.Option(ORIGIN)); m.WarnNotValid(e != nil || u.Host == "", m.Option(ORIGIN)) {
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
m.OptionDefault(mdb.NAME, kit.Split(u.Host, ".:")[0])
|
m.OptionDefault(mdb.NAME, kit.Split(u.Host, ".:")[0])
|
||||||
kit.If(u.Query().Get(TOKEN), func(p string) { m.OptionDefault(TOKEN, p) })
|
kit.If(u.Query().Get(TOKEN), func(p string) { m.OptionDefault(TOKEN, p) })
|
||||||
|
_spide_create(m, m.Option(ORIGIN), m.Option(mdb.TYPE), m.Option(mdb.NAME), m.Option(mdb.ICONS), m.Option(TOKEN))
|
||||||
}
|
}
|
||||||
_spide_create(m, m.Option(ORIGIN), m.Option(mdb.TYPE), m.Option(mdb.NAME), m.OptionDefault(mdb.ICONS, nfs.USR_ICONS_VOLCANOS), m.Option(TOKEN))
|
|
||||||
}},
|
}},
|
||||||
COOKIE: {Name: "cookie key* value", Help: "状态量", Hand: func(m *ice.Message, arg ...string) {
|
COOKIE: {Name: "cookie key* value", Help: "状态量", Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.HashModify(m, m.OptionSimple(CLIENT_NAME), kit.Keys(COOKIE, m.Option(mdb.KEY)), m.Option(mdb.VALUE))
|
mdb.HashModify(m, m.OptionSimple(CLIENT_NAME), kit.Keys(COOKIE, m.Option(mdb.KEY)), m.Option(mdb.VALUE))
|
||||||
@ -373,20 +372,15 @@ func init() {
|
|||||||
m.Cmd(SPACE, cli.CLOSE, kit.Dict(mdb.NAME, m.Option(CLIENT_NAME)))
|
m.Cmd(SPACE, cli.CLOSE, kit.Dict(mdb.NAME, m.Option(CLIENT_NAME)))
|
||||||
mdb.HashModify(m, mdb.NAME, m.Option(CLIENT_NAME), TOKEN, "")
|
mdb.HashModify(m, mdb.NAME, m.Option(CLIENT_NAME), TOKEN, "")
|
||||||
}},
|
}},
|
||||||
DEV_REQUEST_TEXT: {Hand: func(m *ice.Message, arg ...string) { m.Echo(SpaceName(ice.Info.NodeName)) }},
|
|
||||||
DEV_CREATE_TOKEN: {Hand: func(m *ice.Message, arg ...string) {
|
DEV_CREATE_TOKEN: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.HashModify(m, m.OptionSimple(CLIENT_NAME, TOKEN))
|
mdb.HashModify(m, m.OptionSimple(CLIENT_NAME, TOKEN))
|
||||||
m.Cmd(SPACE, tcp.DIAL, ice.DEV, m.Option(CLIENT_NAME), m.OptionSimple(TOKEN)).Sleep300ms()
|
m.Cmd(SPACE, tcp.DIAL, ice.DEV, m.Option(CLIENT_NAME), m.OptionSimple(TOKEN)).Sleep300ms()
|
||||||
}},
|
}},
|
||||||
|
DEV_REQUEST_TEXT: {Hand: func(m *ice.Message, arg ...string) { m.Echo(SpaceName(ice.Info.NodeName)) }},
|
||||||
}, DevTokenAction(CLIENT_NAME, CLIENT_URL), mdb.ImportantHashAction(mdb.SHORT, CLIENT_NAME, mdb.FIELD, "time,icons,client.name,client.url,client.type,token")), Hand: func(m *ice.Message, arg ...string) {
|
}, DevTokenAction(CLIENT_NAME, CLIENT_URL), mdb.ImportantHashAction(mdb.SHORT, CLIENT_NAME, mdb.FIELD, "time,icons,client.name,client.url,client.type,token")), Hand: func(m *ice.Message, arg ...string) {
|
||||||
if len(arg) < 2 || arg[0] == "" || (len(arg) > 3 && arg[3] == "") {
|
if len(arg) < 2 || arg[0] == "" || (len(arg) > 3 && arg[3] == "") {
|
||||||
list := m.CmdMap(SPACE, mdb.NAME)
|
list := m.CmdMap(SPACE, mdb.NAME)
|
||||||
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...).Sort("client.type,client.name", []string{nfs.REPOS, ""})
|
mdb.HashSelect(m, kit.Slice(arg, 0, 1)...).Table(func(value ice.Maps) {
|
||||||
m.RewriteAppend(func(value, key string, index int) string {
|
|
||||||
kit.If(key == CLIENT_URL, func() { value = kit.MergeURL(value, m.OptionSimple(ice.MSG_DEBUG)) })
|
|
||||||
return value
|
|
||||||
})
|
|
||||||
m.Table(func(value ice.Maps) {
|
|
||||||
if value[CLIENT_TYPE] == nfs.REPOS {
|
if value[CLIENT_TYPE] == nfs.REPOS {
|
||||||
if _, ok := list[value[CLIENT_NAME]]; ok {
|
if _, ok := list[value[CLIENT_NAME]]; ok {
|
||||||
m.Push(mdb.STATUS, ONLINE).PushButton(mdb.DEV_REQUEST, "disconn", mdb.REMOVE)
|
m.Push(mdb.STATUS, ONLINE).PushButton(mdb.DEV_REQUEST, "disconn", mdb.REMOVE)
|
||||||
@ -398,20 +392,21 @@ func init() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
kit.If(len(arg) > 0 && arg[0] != "", func() { m.Action(COOKIE, HEADER) })
|
kit.If(len(arg) > 0 && arg[0] != "", func() { m.Action(COOKIE, HEADER) })
|
||||||
|
m.Sort("client.type,client.name", []string{nfs.REPOS, "dev_ip", "demo", "mail"})
|
||||||
} else {
|
} else {
|
||||||
_spide_show(m, arg[0], arg[1:]...)
|
_spide_show(m, arg[0], arg[1:]...)
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
http.MethodGet: {Name: "GET url key value run", Help: "蜘蛛侠", Hand: func(m *ice.Message, arg ...string) {
|
http.MethodGet: {Name: "GET url key value run", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Echo(kit.Formats(kit.UnMarshal(m.Cmdx(SPIDE, ice.DEV, SPIDE_RAW, http.MethodGet, arg[0], arg[1:]))))
|
m.Echo(kit.Formats(kit.UnMarshal(m.Cmdx(SPIDE, ice.DEV, SPIDE_RAW, http.MethodGet, arg[0], arg[1:]))))
|
||||||
}},
|
}},
|
||||||
http.MethodPut: {Name: "PUT url key value run", Help: "蜘蛛侠", Hand: func(m *ice.Message, arg ...string) {
|
http.MethodPut: {Name: "PUT url key value run", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Echo(kit.Formats(kit.UnMarshal(m.Cmdx(SPIDE, ice.DEV, SPIDE_RAW, http.MethodPut, arg[0], arg[1:]))))
|
m.Echo(kit.Formats(kit.UnMarshal(m.Cmdx(SPIDE, ice.DEV, SPIDE_RAW, http.MethodPut, arg[0], arg[1:]))))
|
||||||
}},
|
}},
|
||||||
http.MethodPost: {Name: "POST url key value run", Help: "蜘蛛侠", Hand: func(m *ice.Message, arg ...string) {
|
http.MethodPost: {Name: "POST url key value run", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Echo(kit.Formats(kit.UnMarshal(m.Cmdx(SPIDE, ice.DEV, SPIDE_RAW, http.MethodPost, arg[0], arg[1:]))))
|
m.Echo(kit.Formats(kit.UnMarshal(m.Cmdx(SPIDE, ice.DEV, SPIDE_RAW, http.MethodPost, arg[0], arg[1:]))))
|
||||||
}},
|
}},
|
||||||
http.MethodDelete: {Name: "DELETE url key value run", Help: "蜘蛛侠", Hand: func(m *ice.Message, arg ...string) {
|
http.MethodDelete: {Name: "DELETE url key value run", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Echo(kit.Formats(kit.UnMarshal(m.Cmdx(SPIDE, ice.DEV, SPIDE_RAW, http.MethodDelete, arg[0], arg[1:]))))
|
m.Echo(kit.Formats(kit.UnMarshal(m.Cmdx(SPIDE, ice.DEV, SPIDE_RAW, http.MethodDelete, arg[0], arg[1:]))))
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
@ -454,6 +449,51 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SpideGet(m *ice.Message, arg ...ice.Any) ice.Any {
|
||||||
|
return kit.UnMarshal(m.Cmdx(http.MethodGet, arg))
|
||||||
|
}
|
||||||
|
func SpidePut(m *ice.Message, arg ...ice.Any) ice.Any {
|
||||||
|
return kit.UnMarshal(m.Cmdx(http.MethodPut, arg))
|
||||||
|
}
|
||||||
|
func SpidePost(m *ice.Message, arg ...ice.Any) ice.Any {
|
||||||
|
return kit.UnMarshal(m.Cmdx(http.MethodPost, arg))
|
||||||
|
}
|
||||||
|
func SpideDelete(m *ice.Message, arg ...ice.Any) ice.Any {
|
||||||
|
return kit.UnMarshal(m.Cmdx(http.MethodDelete, arg))
|
||||||
|
}
|
||||||
|
func SpideCache(m *ice.Message, link string) *ice.Message {
|
||||||
|
return m.Cmd(Prefix(SPIDE), ice.DEV_IP, SPIDE_CACHE, http.MethodGet, link)
|
||||||
|
}
|
||||||
|
func SpideSave(m *ice.Message, file, link string, cb func(count, total, value int)) *ice.Message {
|
||||||
|
for _, p := range []string{ice.DEV_IP, ice.DEV} {
|
||||||
|
msg := m.Cmd(Prefix(SPIDE), p, SPIDE_SAVE, file, http.MethodGet, link, cb)
|
||||||
|
if !msg.IsErr() {
|
||||||
|
return msg
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
func SpideOrigin(m *ice.Message, name string) string { return m.Cmdv(SPIDE, name, CLIENT_ORIGIN) }
|
||||||
|
func SpideURL(m *ice.Message, name string) string { return m.Cmdv(SPIDE, name, CLIENT_URL) }
|
||||||
|
func SpideList(m *ice.Message) *ice.Message { return m.Copy(AdminCmd(m, SPIDE)) }
|
||||||
|
func SpideReposList(m *ice.Message) *ice.Message {
|
||||||
|
AdminCmd(m, SPIDE).Table(func(value ice.Maps) {
|
||||||
|
if value[CLIENT_TYPE] == nfs.REPOS {
|
||||||
|
m.Push(mdb.NAME, value[CLIENT_NAME])
|
||||||
|
m.Push(mdb.ICONS, value[mdb.ICONS])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
ctx.DisplayInputKey(m, "style", "_nameicon")
|
||||||
|
return m
|
||||||
|
}
|
||||||
|
func PublicIP(m *ice.Message, arg ...string) ice.Any {
|
||||||
|
if len(arg) == 0 {
|
||||||
|
return SpideGet(m, "http://ip-api.com/json")
|
||||||
|
}
|
||||||
|
return mdb.Cache(m, "web.spide.location."+arg[0], func() ice.Any {
|
||||||
|
return kit.Format(kit.Value(SpideGet(m, "http://opendata.baidu.com/api.php?co=&resource_id=6006&oe=utf8", "query", arg[0]), "data.0.location"))
|
||||||
|
})
|
||||||
|
}
|
||||||
func HostPort(m *ice.Message, host, port string, arg ...string) string {
|
func HostPort(m *ice.Message, host, port string, arg ...string) string {
|
||||||
p := ""
|
p := ""
|
||||||
if len(arg) > 0 {
|
if len(arg) > 0 {
|
||||||
@ -472,48 +512,3 @@ func HostPort(m *ice.Message, host, port string, arg ...string) string {
|
|||||||
return kit.Format("http://%s:%s", host, port) + p
|
return kit.Format("http://%s:%s", host, port) + p
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func PublicIP(m *ice.Message, arg ...string) ice.Any {
|
|
||||||
if len(arg) == 0 {
|
|
||||||
return SpideGet(m, "http://ip-api.com/json")
|
|
||||||
}
|
|
||||||
return mdb.Cache(m, "web.spide.location."+arg[0], func() ice.Any {
|
|
||||||
return kit.Format(kit.Value(SpideGet(m, "http://opendata.baidu.com/api.php?co=&resource_id=6006&oe=utf8", "query", arg[0]), "data.0.location"))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
func SpideGet(m *ice.Message, arg ...ice.Any) ice.Any {
|
|
||||||
return kit.UnMarshal(m.Cmdx(http.MethodGet, arg))
|
|
||||||
}
|
|
||||||
func SpidePut(m *ice.Message, arg ...ice.Any) ice.Any {
|
|
||||||
return kit.UnMarshal(m.Cmdx(http.MethodPut, arg))
|
|
||||||
}
|
|
||||||
func SpidePost(m *ice.Message, arg ...ice.Any) ice.Any {
|
|
||||||
return kit.UnMarshal(m.Cmdx(http.MethodPost, arg))
|
|
||||||
}
|
|
||||||
func SpideDelete(m *ice.Message, arg ...ice.Any) ice.Any {
|
|
||||||
return kit.UnMarshal(m.Cmdx(http.MethodDelete, arg))
|
|
||||||
}
|
|
||||||
func SpideSave(m *ice.Message, file, link string, cb func(count, total, value int)) *ice.Message {
|
|
||||||
for _, p := range []string{ice.DEV_IP, ice.DEV} {
|
|
||||||
msg := m.Cmd(Prefix(SPIDE), p, SPIDE_SAVE, file, http.MethodGet, link, cb)
|
|
||||||
if !msg.IsErr() {
|
|
||||||
return msg
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return m
|
|
||||||
}
|
|
||||||
func SpideCache(m *ice.Message, link string) *ice.Message {
|
|
||||||
return m.Cmd(Prefix(SPIDE), ice.DEV_IP, SPIDE_CACHE, http.MethodGet, link)
|
|
||||||
}
|
|
||||||
func SpideOrigin(m *ice.Message, name string) string { return m.Cmdv(SPIDE, name, CLIENT_ORIGIN) }
|
|
||||||
func SpideURL(m *ice.Message, name string) string { return m.Cmdv(SPIDE, name, CLIENT_URL) }
|
|
||||||
func SpideList(m *ice.Message) *ice.Message { return m.Copy(AdminCmd(m, SPIDE)) }
|
|
||||||
func SpideReposList(m *ice.Message) *ice.Message {
|
|
||||||
AdminCmd(m, SPIDE).Table(func(value ice.Maps) {
|
|
||||||
if value[CLIENT_TYPE] == nfs.REPOS {
|
|
||||||
m.Push(mdb.NAME, value[CLIENT_NAME])
|
|
||||||
m.Push(mdb.ICONS, value[mdb.ICONS])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
ctx.DisplayInputKey(m, "style", "_nameicon")
|
|
||||||
return m
|
|
||||||
}
|
|
||||||
|
@ -63,7 +63,7 @@ func _publish_contexts(m *ice.Message, arg ...string) {
|
|||||||
// fallthrough
|
// fallthrough
|
||||||
case nfs.BINARY, ice.APP:
|
case nfs.BINARY, ice.APP:
|
||||||
if host := msg.Append(tcp.HOSTPORT); !strings.HasPrefix(host, m.Option(web.DOMAIN)) {
|
if host := msg.Append(tcp.HOSTPORT); !strings.HasPrefix(host, m.Option(web.DOMAIN)) {
|
||||||
env = append(env, cli.CTX_DEV_IP, strings.Split(host, "?")[0])
|
// env = append(env, cli.CTX_DEV_IP, strings.Split(host, "?")[0])
|
||||||
}
|
}
|
||||||
if m.Option(ice.MSG_USERPOD) != "" {
|
if m.Option(ice.MSG_USERPOD) != "" {
|
||||||
env = append(env, cli.CTX_POD, m.Option(ice.MSG_USERPOD))
|
env = append(env, cli.CTX_POD, m.Option(ice.MSG_USERPOD))
|
||||||
|
@ -19,10 +19,12 @@ fieldset.web.wiki.portal>div.output>div.header div.story[data-name=navmenu] div.
|
|||||||
fieldset.web.wiki.portal>div.output>div.layout { display:flex; justify-content:center; }
|
fieldset.web.wiki.portal>div.output>div.layout { display:flex; justify-content:center; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.nav { border-right:var(--box-border); padding:var(--portal-main-padding); padding-right:var(--button-padding); min-width:var(--project-width); overflow:auto; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav { border-right:var(--box-border); padding:var(--portal-main-padding); padding-right:var(--button-padding); min-width:var(--project-width); overflow:auto; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu] div.item { padding:var(--input-padding); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu] div.item { padding:var(--input-padding); }
|
||||||
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu] div.item.select { border-right:var(--box-notice); }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu]>div.item { border-bottom:var(--box-border); margin-top:var(--button-margin); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu]>div.item { border-bottom:var(--box-border); margin-top:var(--button-margin); }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu] div.list { padding-left:var(--legend-padding); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.nav div.story[data-name=navmenu] div.list { padding-left:var(--legend-padding); }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.aside { padding:var(--portal-main-padding); padding-left:var(--button-padding); min-width:var(--project-width); overflow:auto; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.aside { padding:var(--portal-main-padding); padding-left:var(--button-padding); min-width:var(--project-width); overflow:auto; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.aside div.item { padding:var(--input-padding); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.aside div.item { padding:var(--input-padding); }
|
||||||
|
fieldset.web.wiki.portal>div.output>div.layout>div.aside div.item.select { border-left:var(--box-notice); }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.aside div.item.section { padding-left:var(--legend-padding); }
|
fieldset.web.wiki.portal>div.output>div.layout>div.aside div.item.section { padding-left:var(--legend-padding); }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main { padding:var(--portal-main-padding); height:600px; min-width:390px; max-width:var(--portal-max-width); overflow:auto; overflow-x:hidden; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main { padding:var(--portal-main-padding); height:600px; min-width:390px; max-width:var(--portal-max-width); overflow:auto; overflow-x:hidden; }
|
||||||
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column { display:flex; flex-direction:column; justify-content:center; }
|
fieldset.web.wiki.portal>div.output>div.layout>div.main div.story.column { display:flex; flex-direction:column; justify-content:center; }
|
||||||
|
@ -25,6 +25,9 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
can.core.CallFunc([can.onimport, can.onimport[meta.name]? meta.name: meta.type||target.tagName.toLowerCase()], [can, meta, target])
|
can.core.CallFunc([can.onimport, can.onimport[meta.name]? meta.name: meta.type||target.tagName.toLowerCase()], [can, meta, target])
|
||||||
meta.style && can.page.style(can, target, can.base.Obj(meta.style))
|
meta.style && can.page.style(can, target, can.base.Obj(meta.style))
|
||||||
}); var nav = can.db.nav[file]; nav? nav.click(): can.onimport.content(can, "content.shy")
|
}); var nav = can.db.nav[file]; nav? nav.click(): can.onimport.content(can, "content.shy")
|
||||||
|
can.page.Select(can, can.ui.header, "div.item:first-child>span", function(target, index) {
|
||||||
|
can.page.insertBefore(can, [{img: can.misc.ResourceFavicon(can, can.user.info.favicon), style: {height: 42}}], target)
|
||||||
|
})
|
||||||
}, 300)
|
}, 300)
|
||||||
},
|
},
|
||||||
_scroll: function(can) { can.ui.main.onscroll = function(event) { var top = can.ui.main.scrollTop, select
|
_scroll: function(can) { can.ui.main.onscroll = function(event) { var top = can.ui.main.scrollTop, select
|
||||||
@ -34,16 +37,14 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
} },
|
} },
|
||||||
navmenu: function(can, meta, target) { var link
|
navmenu: function(can, meta, target) { var link
|
||||||
can.onimport.list(can, can.base.Obj(meta.data), function(event, item) {
|
can.onimport.list(can, can.base.Obj(meta.data), function(event, item) {
|
||||||
can.page.Select(can, target, html.DIV_ITEM, function(target) { target != event.target && can.page.ClassList.del(can, target, html.SELECT) })
|
can.page.Select(can, target, html.DIV_ITEM, function(target) { target != event.currentTarget && can.page.ClassList.del(can, target, html.SELECT) })
|
||||||
item.list && item.list.length > 0 || can.onaction.route(event, can, item.meta.link)
|
item.list && item.list.length > 0 || can.onaction.route(event, can, item.meta.link)
|
||||||
|
can.onimport.layout(can)
|
||||||
}, can.page.ClassList.has(can, target.parentNode, html.HEADER)? function(target, item) {
|
}, can.page.ClassList.has(can, target.parentNode, html.HEADER)? function(target, item) {
|
||||||
item.meta.link == nfs.USR_LEARNING_PORTAL+can.db.current && can.onappend.style(can, html.SELECT, target)
|
item.meta.link == nfs.USR_LEARNING_PORTAL+can.db.current && can.onappend.style(can, html.SELECT, target)
|
||||||
}: function(target, item) { can.db.nav[can.base.trimPrefix(item.meta.link, nfs.USR_LEARNING_PORTAL, nfs.SRC_DOCUMENT)] = target
|
}: function(target, item) { can.db.nav[can.base.trimPrefix(item.meta.link, nfs.USR_LEARNING_PORTAL, nfs.SRC_DOCUMENT)] = target
|
||||||
location.hash || item.list && item.list.length > 0 || link || (link = can.onaction.route({}, can, item.meta.link, true))
|
location.hash || item.list && item.list.length > 0 || link || (link = can.onaction.route({}, can, item.meta.link, true))
|
||||||
}, target)
|
}, target)
|
||||||
can.page.Select(can, can.ui.header, "div.item:first-child>span", function(target, index) {
|
|
||||||
can.page.insertBefore(can, [{img: can.misc.ResourceFavicon(can, can.user.info.favicon), style: {height: 42}}], target)
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
content: function(can, file) {
|
content: function(can, file) {
|
||||||
can.runActionCommand(event, web.WIKI_WORD, [(can.base.beginWith(file, nfs.USR, nfs.SRC)? "": nfs.USR_LEARNING_PORTAL+can.db.current)+file], function(msg) { can.ui.main.innerHTML = msg.Result(), can.onmotion.clear(can, can.ui.aside)
|
can.runActionCommand(event, web.WIKI_WORD, [(can.base.beginWith(file, nfs.USR, nfs.SRC)? "": nfs.USR_LEARNING_PORTAL+can.db.current)+file], function(msg) { can.ui.main.innerHTML = msg.Result(), can.onmotion.clear(can, can.ui.aside)
|
||||||
@ -61,7 +62,9 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
can.page.style(can, can.ui.nav, html.HEIGHT, "", html.WIDTH, can.page.width())
|
can.page.style(can, can.ui.nav, html.HEIGHT, "", html.WIDTH, can.page.width())
|
||||||
can.page.style(can, can.ui.main, html.HEIGHT, "", html.WIDTH, can.page.width())
|
can.page.style(can, can.ui.main, html.HEIGHT, "", html.WIDTH, can.page.width())
|
||||||
}
|
}
|
||||||
can.core.List(can._plugins, function(sub) { sub.onimport.size(sub, can.base.Min(html.FLOAT_HEIGHT, can.ConfHeight()/2, can.ConfHeight()), (can.ConfWidth()-2*padding), true) })
|
can.core.List(can._plugins, function(sub) {
|
||||||
|
sub.onimport.size(sub, can.base.Min(html.FLOAT_HEIGHT, can.ConfHeight()/2, can.ConfHeight()), (can.ConfWidth()-2*padding), true)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
}, [""])
|
}, [""])
|
||||||
Volcanos(chat.ONACTION, {
|
Volcanos(chat.ONACTION, {
|
||||||
@ -76,7 +79,7 @@ Volcanos(chat.ONACTION, {
|
|||||||
}
|
}
|
||||||
var file = can.base.trimPrefix(link, can.db.current); can.isCmdMode() && can.user.jumps("#"+file)
|
var file = can.base.trimPrefix(link, can.db.current); can.isCmdMode() && can.user.jumps("#"+file)
|
||||||
if (can.onmotion.cache(can, function(save, load) { save({plugins: can._plugins})
|
if (can.onmotion.cache(can, function(save, load) { save({plugins: can._plugins})
|
||||||
return load(file, function(bak) { can._plugins = bak.file })
|
return load(file, function(bak) { can._plugins = bak.plugins })
|
||||||
}, can.ui.main, can.ui.aside)) { return file } can.onimport.content(can, file)
|
}, can.ui.main, can.ui.aside)) { return file } can.onimport.content(can, file)
|
||||||
return link
|
return link
|
||||||
},
|
},
|
||||||
|
@ -69,6 +69,7 @@ func init() {
|
|||||||
FEEL, DRAW, DATA, WORD, PORTAL, STYLE,
|
FEEL, DRAW, DATA, WORD, PORTAL, STYLE,
|
||||||
TITLE, BRIEF, REFER, SPARK, FIELD,
|
TITLE, BRIEF, REFER, SPARK, FIELD,
|
||||||
ORDER, TABLE, CHART, IMAGE, VIDEO, AUDIO,
|
ORDER, TABLE, CHART, IMAGE, VIDEO, AUDIO,
|
||||||
|
// IFRAME,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
func Prefix(arg ...string) string { return web.Prefix(WIKI, kit.Keys(arg)) }
|
func Prefix(arg ...string) string { return web.Prefix(WIKI, kit.Keys(arg)) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user