mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt some
This commit is contained in:
parent
9ec30c3d53
commit
4c85f0ce70
@ -50,12 +50,17 @@ func init() {
|
||||
ROUTE: {Name: "route route ctx cmd auto invite share", Help: "路由", Action: map[string]*ice.Action{
|
||||
SHARE: {Name: "share", Help: "共享", Hand: func(m *ice.Message, arg ...string) {
|
||||
h := m.Cmdx(SHARE, mdb.CREATE, kit.MDB_TYPE, "login")
|
||||
m.Cmdy("web.wiki.image", "qrcode", kit.MergeURL(m.Option(ice.MSG_USERWEB), SHARE, h))
|
||||
p := kit.MergeURL(m.Option(ice.MSG_USERWEB), SHARE, h)
|
||||
m.Cmdy("web.wiki.spark", "shell", p).Render("")
|
||||
m.Cmdy("web.wiki.image", "qrcode", p)
|
||||
}},
|
||||
mdb.INVITE: {Name: "invite", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy("web.code.publish", "contexts", "tmux")
|
||||
m.Cmdy("web.code.publish", "contexts", "base")
|
||||
m.Cmdy("web.code.publish", "contexts", "miss")
|
||||
for _, k := range []string{"tmux", "base", "miss"} {
|
||||
m.Cmdy("web.code.publish", "contexts", k)
|
||||
m.Cmdy("web.wiki.spark")
|
||||
}
|
||||
|
||||
m.Cmdy("web.wiki.spark", "shell", m.Option(ice.MSG_USERWEB))
|
||||
m.Cmdy("web.wiki.image", "qrcode", m.Option(ice.MSG_USERWEB))
|
||||
}},
|
||||
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||
|
@ -56,12 +56,14 @@ func _serve_main(m *ice.Message, w http.ResponseWriter, r *http.Request) bool {
|
||||
if r.URL.Path == "/" && r.FormValue(SHARE) != "" {
|
||||
m.W = w
|
||||
s := m.Cmd(SHARE, mdb.SELECT, kit.MDB_HASH, r.FormValue(SHARE))
|
||||
Render(m, COOKIE, aaa.SessCreate(m,
|
||||
s.Append(aaa.USERNAME), s.Append(aaa.USERROLE),
|
||||
))
|
||||
if s.Append(kit.MDB_TYPE) == "login" {
|
||||
Render(m, COOKIE, aaa.SessCreate(m, s.Append(aaa.USERNAME), s.Append(aaa.USERROLE)))
|
||||
http.Redirect(w, r, kit.MergeURL(r.URL.String(), SHARE, ""), http.StatusTemporaryRedirect)
|
||||
m.W = nil
|
||||
return false
|
||||
}
|
||||
m.W = nil
|
||||
http.Redirect(w, r, kit.MergeURL(r.URL.String(), SHARE, ""), http.StatusTemporaryRedirect)
|
||||
return false
|
||||
return true
|
||||
}
|
||||
|
||||
if strings.HasPrefix(r.URL.Path, "/debug") {
|
||||
@ -244,7 +246,7 @@ func init() {
|
||||
"logheaders", "false",
|
||||
"localhost", "true",
|
||||
"black", kit.Dict(), "white", kit.Dict(
|
||||
"login", true, "space", true, "share", true, "plugin", true, "publish", true,
|
||||
"login", true, "space", true, "share", true, "plugin", true, "publish", true, "intshell", true,
|
||||
),
|
||||
|
||||
"static", kit.Dict("/", "usr/volcanos/"),
|
||||
@ -290,5 +292,9 @@ func init() {
|
||||
m.Option(mdb.FIELDS, kit.Select("time,status,name,port,dev", mdb.DETAIL, len(arg) > 0))
|
||||
m.Cmdy(mdb.SELECT, SERVE, "", mdb.HASH, kit.MDB_NAME, arg)
|
||||
}},
|
||||
|
||||
"/intshell/": {Name: "/intshell/", Help: "脚本", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Render(ice.RENDER_DOWNLOAD, path.Join(m.Conf(SERVE, "meta.intshell.path"), path.Join(arg...)))
|
||||
}},
|
||||
}}, nil)
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ func init() {
|
||||
"/plugin/github.com/": {Name: "/space/", Help: "空间站", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
_share_repos(m, path.Join(strings.Split(cmd, "/")[2:5]...), arg[6:]...)
|
||||
}},
|
||||
"/publish/": {Name: "/publish/", Help: "空间站", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
"/publish/": {Name: "/publish/", Help: "发布", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
if arg[0] == "order.js" && len(ice.BinPack) > 0 {
|
||||
m.Render(ice.RENDER_RESULT, "{}")
|
||||
return
|
||||
|
@ -10,10 +10,7 @@ import (
|
||||
|
||||
func _action_upload(m *ice.Message, arg ...string) {
|
||||
msg := m.Cmd(web.CACHE, web.UPLOAD)
|
||||
m.Debug(msg.Formats("meta"))
|
||||
m.Option("_upload", msg.Append("data"), msg.Append("name"))
|
||||
m.Debug(m.Formats("meta"))
|
||||
|
||||
}
|
||||
func _action_right(m *ice.Message, river string, storm string) (ok bool) {
|
||||
if ok = true; m.Option(ice.MSG_USERROLE) == aaa.VOID {
|
||||
|
@ -19,6 +19,7 @@ func init() {
|
||||
"display", "/plugin/local/team/plan.js", "style", "plan",
|
||||
), Action: map[string]*ice.Action{
|
||||
mdb.INSERT: {Name: "insert zone type=once,step,week name text begin_time@date close_time@date", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||
_task_create(m, arg[1])
|
||||
_task_insert(m, arg[1], arg[2:]...)
|
||||
}},
|
||||
mdb.MODIFY: {Name: "modify", Help: "编辑", Hand: func(m *ice.Message, arg ...string) {
|
||||
@ -65,7 +66,7 @@ func init() {
|
||||
m.Push(key, value, fields, val)
|
||||
m.PushRender(kit.MDB_ACTION, kit.MDB_BUTTON, _task_action(m, value[TaskField.STATUS], "插件"))
|
||||
})
|
||||
m.Cmdy(mdb.SELECT, m.Prefix(TASK), kit.Keys(m.Option(ice.MSG_DOMAIN)), mdb.ZONE)
|
||||
m.Cmdy(mdb.SELECT, m.Prefix(TASK), kit.Keys(m.Option(ice.MSG_DOMAIN)), mdb.ZONE, kit.MDB_FOREACH)
|
||||
}},
|
||||
},
|
||||
}, nil)
|
||||
|
Loading…
x
Reference in New Issue
Block a user