forked from x/icebergs
add some
This commit is contained in:
parent
0eac777f6f
commit
15a79273ac
@ -204,39 +204,45 @@ const (
|
|||||||
UPGRADE = "upgrade"
|
UPGRADE = "upgrade"
|
||||||
INSTALL = "install"
|
INSTALL = "install"
|
||||||
|
|
||||||
CODE_MYSQL_CLIENT = "web.code.mysql.client"
|
CODE_MYSQL_CLIENT = "web.code.mysql.client"
|
||||||
CODE_GIT_SERVICE = "web.code.git.service"
|
CODE_GIT_SERVICE = "web.code.git.service"
|
||||||
CODE_GIT_SEARCH = "web.code.git.search"
|
CODE_GIT_SEARCH = "web.code.git.search"
|
||||||
CODE_GIT_STATUS = "web.code.git.status"
|
CODE_GIT_STATUS = "web.code.git.status"
|
||||||
CODE_GIT_REPOS = "web.code.git.repos"
|
CODE_GIT_REPOS = "web.code.git.repos"
|
||||||
CODE_AUTOGEN = "web.code.autogen"
|
CODE_AUTOGEN = "web.code.autogen"
|
||||||
CODE_COMPILE = "web.code.compile"
|
CODE_COMPILE = "web.code.compile"
|
||||||
CODE_PUBLISH = "web.code.publish"
|
CODE_PUBLISH = "web.code.publish"
|
||||||
CODE_UPGRADE = "web.code.upgrade"
|
CODE_UPGRADE = "web.code.upgrade"
|
||||||
CODE_VIMER = "web.code.vimer"
|
CODE_VIMER = "web.code.vimer"
|
||||||
CODE_INNER = "web.code.inner"
|
CODE_INNER = "web.code.inner"
|
||||||
CODE_XTERM = "web.code.xterm"
|
CODE_XTERM = "web.code.xterm"
|
||||||
CODE_MOD = "web.code.mod"
|
CODE_MOD = "web.code.mod"
|
||||||
WIKI_FEEL = "web.wiki.feel"
|
WIKI_FEEL = "web.wiki.feel"
|
||||||
WIKI_DRAW = "web.wiki.draw"
|
WIKI_DRAW = "web.wiki.draw"
|
||||||
WIKI_WORD = "web.wiki.word"
|
WIKI_WORD = "web.wiki.word"
|
||||||
WIKI_PORTAL = "web.wiki.portal"
|
WIKI_PORTAL = "web.wiki.portal"
|
||||||
CHAT_OAUTH_CLIENT = "web.chat.oauth.client"
|
CHAT_OAUTH_CLIENT = "web.chat.oauth.client"
|
||||||
CHAT_WX_ACCESS = "web.chat.wx.access"
|
CHAT_WX_ACCESS = "web.chat.wx.access"
|
||||||
CHAT_WX_AGENT = "web.chat.wx.agent"
|
CHAT_WX_AGENT = "web.chat.wx.agent"
|
||||||
CHAT_WX_TEMPLATE = "web.chat.wx.template"
|
CHAT_WX_TEMPLATE = "web.chat.wx.template"
|
||||||
CHAT_WX_OCR = "web.chat.wx.ocr"
|
CHAT_WX_OCR = "web.chat.wx.ocr"
|
||||||
CHAT_MESSAGE = "web.chat.message"
|
CHAT_MESSAGE = "web.chat.message"
|
||||||
CHAT_HEADER = "web.chat.header"
|
CHAT_HEADER = "web.chat.header"
|
||||||
CHAT_IFRAME = "web.chat.iframe"
|
CHAT_IFRAME = "web.chat.iframe"
|
||||||
CHAT_FAVOR = "web.chat.favor"
|
CHAT_FAVOR = "web.chat.favor"
|
||||||
CHAT_FLOWS = "web.chat.flows"
|
CHAT_FLOWS = "web.chat.flows"
|
||||||
CHAT_GRANT = "web.chat.grant"
|
CHAT_GRANT = "web.chat.grant"
|
||||||
CHAT_POD = "web.chat.pod"
|
CHAT_POD = "web.chat.pod"
|
||||||
CHAT_CMD = "web.chat.cmd"
|
CHAT_CMD = "web.chat.cmd"
|
||||||
TEAM_PLAN = "web.team.plan"
|
TEAM_PLAN = "web.team.plan"
|
||||||
TEAM_GONGANXITONG_USER = "web.team.gonganxitong.user"
|
TEAM_GONGANXITONG_USER = "web.team.gonganxitong.user"
|
||||||
TEAM_RENZHENGSHOUQUAN_AUTH = "web.team.renzhengshouquan.auth"
|
TEAM_GONGANXITONG_DOMAIN = "web.team.gonganxitong.domain"
|
||||||
|
TEAM_RENZHENGSHOUQUAN_PORTAL = "web.team.renzhengshouquan.portal"
|
||||||
|
TEAM_RENZHENGSHOUQUAN_AUTH = "web.team.renzhengshouquan.auth"
|
||||||
|
TEAM_DASHBOARD_PORTAL = "web.team.dashboard.portal"
|
||||||
|
TEAM_DASHBOARD_SUMMARY = "web.team.dashboard.summary"
|
||||||
|
TEAM_STORAGE_PORTAL = "web.team.storage.portal"
|
||||||
|
TEAM_STORAGE_FILE = "web.team.storage.file"
|
||||||
)
|
)
|
||||||
|
|
||||||
func MessageInsertJSON(m *ice.Message, zone, name, text string, arg ...string) {
|
func MessageInsertJSON(m *ice.Message, zone, name, text string, arg ...string) {
|
||||||
|
@ -107,8 +107,11 @@ func _serve_static(msg *ice.Message, w http.ResponseWriter, r *http.Request) boo
|
|||||||
if kit.Contains(r.URL.String(), "render=replace") {
|
if kit.Contains(r.URL.String(), "render=replace") {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
p := strings.TrimPrefix(r.URL.Path, nfs.P)
|
p := path.Join(strings.TrimPrefix(r.URL.Path, nfs.P))
|
||||||
if pp := path.Join(nfs.USR_LOCAL_WORK, msg.Option(ice.POD)); ispod && nfs.Exists(msg, pp) {
|
if pp := path.Join(nfs.USR_LOCAL_WORK, msg.Option(ice.POD)); ispod && nfs.Exists(msg, pp) {
|
||||||
|
if kit.HasPrefix(p, "var/", "usr/local/") {
|
||||||
|
return false
|
||||||
|
}
|
||||||
if pp = path.Join(pp, p); nfs.Exists(msg, pp) {
|
if pp = path.Join(pp, p); nfs.Exists(msg, pp) {
|
||||||
return Render(msg, ice.RENDER_DOWNLOAD, pp)
|
return Render(msg, ice.RENDER_DOWNLOAD, pp)
|
||||||
} else {
|
} else {
|
||||||
|
@ -169,6 +169,16 @@ func ShareLocalFile(m *ice.Message, arg ...string) {
|
|||||||
|
|
||||||
} else if m.Option(ice.POD) == "" && !aaa.Right(m, ls) {
|
} else if m.Option(ice.POD) == "" && !aaa.Right(m, ls) {
|
||||||
return
|
return
|
||||||
|
} else {
|
||||||
|
if m.Option(ice.POD) != "" && !strings.Contains(p, "/src/") && !strings.HasPrefix(p, "src/") {
|
||||||
|
if strings.HasPrefix(p, "usr/local/storage/") {
|
||||||
|
if m.Cmd(SPACE, "20240903-operation", "web.team.storage.file", aaa.RIGHT, ls[3:]).IsErr() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else if m.WarnNotRight(m.Cmdx(SPACE, m.Option(ice.POD), aaa.ROLE, aaa.RIGHT, aaa.VOID, p) != ice.OK) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if m.Option(ice.POD) != "" && nfs.Exists(m, path.Join(ice.USR_LOCAL_WORK, m.Option(ice.POD))) {
|
if m.Option(ice.POD) != "" && nfs.Exists(m, path.Join(ice.USR_LOCAL_WORK, m.Option(ice.POD))) {
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
package code
|
package code
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path"
|
||||||
|
|
||||||
ice "shylinux.com/x/icebergs"
|
ice "shylinux.com/x/icebergs"
|
||||||
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
"shylinux.com/x/icebergs/base/mdb"
|
"shylinux.com/x/icebergs/base/mdb"
|
||||||
"shylinux.com/x/icebergs/base/nfs"
|
"shylinux.com/x/icebergs/base/nfs"
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
@ -16,8 +19,16 @@ const JSON = "json"
|
|||||||
func init() {
|
func init() {
|
||||||
Index.MergeCommands(ice.Commands{
|
Index.MergeCommands(ice.Commands{
|
||||||
JSON: {Actions: ice.MergeActions(ice.Actions{
|
JSON: {Actions: ice.MergeActions(ice.Actions{
|
||||||
mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) {}},
|
mdb.RENDER: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) {}},
|
m.FieldsSetDetail()
|
||||||
|
kit.For(kit.KeyValue(nil, "", kit.UnMarshal(m.Cmdx(nfs.CAT, path.Join(arg[2], arg[1])))), func(key, value string) {
|
||||||
|
m.Push(key, value)
|
||||||
|
})
|
||||||
|
}},
|
||||||
|
mdb.ENGINE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
|
m.Cmdy(nfs.CAT, path.Join(arg[2], arg[1]))
|
||||||
|
ctx.DisplayStoryJSON(m)
|
||||||
|
}},
|
||||||
TEMPLATE: {Hand: func(m *ice.Message, arg ...string) {
|
TEMPLATE: {Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Echo(kit.Format(nfs.Template(m, DEMO_JSON)))
|
m.Echo(kit.Format(nfs.Template(m, DEMO_JSON)))
|
||||||
}},
|
}},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user