mirror of
https://shylinux.com/x/icebergs
synced 2025-04-29 18:39:21 +08:00
opt share
This commit is contained in:
parent
07156e688e
commit
305b5845ac
@ -79,12 +79,24 @@ func _serve_handle(key string, cmd *ice.Command, msg *ice.Message, w http.Respon
|
|||||||
msg.Option(v.Name, v.Value)
|
msg.Option(v.Name, v.Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ls := strings.Split(r.URL.Path, "/"); len(ls) > 2 && ls[1] == "share" {
|
||||||
|
msg.Logs("refer", ls[1], ls[2])
|
||||||
|
msg.Option(ls[1], ls[2])
|
||||||
|
} else {
|
||||||
|
msg.Debug("%v", ls)
|
||||||
|
}
|
||||||
// 请求变量
|
// 请求变量
|
||||||
if u, e := url.Parse(r.Header.Get("Referer")); e == nil {
|
if u, e := url.Parse(r.Header.Get("Referer")); e == nil {
|
||||||
for k, v := range u.Query() {
|
for k, v := range u.Query() {
|
||||||
msg.Logs("refer", k, v)
|
msg.Logs("refer", k, v)
|
||||||
msg.Option(k, v)
|
msg.Option(k, v)
|
||||||
}
|
}
|
||||||
|
if ls := strings.Split(u.Path, "/"); len(ls) > 2 && ls[1] == "share" {
|
||||||
|
msg.Logs("refer", ls[1], ls[2])
|
||||||
|
msg.Option(ls[1], ls[2])
|
||||||
|
} else {
|
||||||
|
msg.Debug("%v", ls)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 请求地址
|
// 请求地址
|
||||||
|
@ -208,6 +208,9 @@ func init() {
|
|||||||
|
|
||||||
case STORM:
|
case STORM:
|
||||||
m.RenderRedirect("/page/share.html", SHARE, m.Option(SHARE))
|
m.RenderRedirect("/page/share.html", SHARE, m.Option(SHARE))
|
||||||
|
|
||||||
|
case FIELD:
|
||||||
|
m.RenderDownload(path.Join(m.Conf(SERVE, kit.Keym(ice.VOLCANOS, kit.MDB_PATH)), "/page/index.html"))
|
||||||
}
|
}
|
||||||
}},
|
}},
|
||||||
|
|
||||||
|
@ -37,7 +37,12 @@ func init() {
|
|||||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||||
if strings.HasSuffix(m.R.URL.Path, "/") {
|
if strings.HasSuffix(m.R.URL.Path, "/") {
|
||||||
m.RenderDownload(path.Join(m.Conf(web.SERVE, kit.Keym(ice.VOLCANOS, kit.MDB_PATH)), m.Conf(CMD, kit.Keym(kit.MDB_INDEX))))
|
m.RenderDownload(path.Join(m.Conf(web.SERVE, kit.Keym(ice.VOLCANOS, kit.MDB_PATH)), m.Conf(CMD, kit.Keym(kit.MDB_INDEX))))
|
||||||
return
|
return // 目录
|
||||||
|
}
|
||||||
|
|
||||||
|
if msg := m.Cmd(ctx.COMMAND, arg[0]); msg.Append("meta") != "" {
|
||||||
|
_cmd_render(m, arg[0])
|
||||||
|
return // 命令
|
||||||
}
|
}
|
||||||
|
|
||||||
switch p := path.Join(m.Conf(CMD, kit.META_PATH), path.Join(arg...)); kit.Ext(p) {
|
switch p := path.Join(m.Conf(CMD, kit.META_PATH), path.Join(arg...)); kit.Ext(p) {
|
||||||
@ -85,10 +90,13 @@ func init() {
|
|||||||
},
|
},
|
||||||
Configs: map[string]*ice.Config{
|
Configs: map[string]*ice.Config{
|
||||||
CMD: {Name: CMD, Help: "命令", Value: kit.Data(
|
CMD: {Name: CMD, Help: "命令", Value: kit.Data(
|
||||||
kit.MDB_PATH, "./", kit.MDB_INDEX, "page/cmd.html", kit.MDB_TEMPLATE, `
|
kit.MDB_PATH, "./", kit.MDB_INDEX, "page/cmd.html", kit.MDB_TEMPLATE, `<!DOCTYPE html>
|
||||||
<!DOCTYPE html>
|
<head>
|
||||||
<body><script src="/page/can.js"></script>
|
<link rel="stylesheet" type="text/css" href="/page/cmd.css">
|
||||||
<script>app("/chat/", %s)</script>
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="/page/cmd.js"></script>
|
||||||
|
<script>cmd(%s)</script>
|
||||||
</body>
|
</body>
|
||||||
`,
|
`,
|
||||||
)},
|
)},
|
||||||
|
@ -32,7 +32,7 @@ func _header_check(m *ice.Message, arg ...string) {
|
|||||||
func _header_share(m *ice.Message, arg ...string) {
|
func _header_share(m *ice.Message, arg ...string) {
|
||||||
if m.Option(kit.MDB_LINK) == "" {
|
if m.Option(kit.MDB_LINK) == "" {
|
||||||
share := m.Cmdx(web.SHARE, mdb.CREATE, kit.MDB_TYPE, web.LOGIN, arg)
|
share := m.Cmdx(web.SHARE, mdb.CREATE, kit.MDB_TYPE, web.LOGIN, arg)
|
||||||
m.Option(kit.MDB_LINK, kit.MergeURL(m.Option(ice.MSG_USERWEB), web.SHARE, share))
|
m.Option(kit.MDB_LINK, kit.MergeURL2(m.Option(ice.MSG_USERWEB), "/share/"+share))
|
||||||
}
|
}
|
||||||
link := tcp.ReplaceLocalhost(m, m.Option(kit.MDB_LINK))
|
link := tcp.ReplaceLocalhost(m, m.Option(kit.MDB_LINK))
|
||||||
|
|
||||||
|
@ -83,8 +83,8 @@ func init() {
|
|||||||
m.Echo(p)
|
m.Echo(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
m.Cmd(nfs.COPY, _volcanos("page/can.css"), _volcanos("page/index.css"), _volcanos("page/cache.css"))
|
m.Cmd(nfs.COPY, _volcanos("page/cmd.css"), _volcanos("page/index.css"), _volcanos("page/cache.css"))
|
||||||
m.Cmd(nfs.COPY, _volcanos("page/can.js"), _volcanos("proto.js"), _volcanos("page/cache.js"))
|
m.Cmd(nfs.COPY, _volcanos("page/cmd.js"), _volcanos("proto.js"), _volcanos("page/cache.js"))
|
||||||
}},
|
}},
|
||||||
mdb.PRUNES: {Name: "prunes", Help: "清理", Hand: func(m *ice.Message, arg ...string) {
|
mdb.PRUNES: {Name: "prunes", Help: "清理", Hand: func(m *ice.Message, arg ...string) {
|
||||||
m.Cmd(nfs.SAVE, path.Join(ice.USR_VOLCANOS, "page/cache.css"), "")
|
m.Cmd(nfs.SAVE, path.Join(ice.USR_VOLCANOS, "page/cache.css"), "")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user