forked from x/icebergs
add some
This commit is contained in:
parent
c9aa6d95fd
commit
1c9b74c2b9
@ -71,7 +71,7 @@ func init() {
|
||||
m.Push(kit.MDB_NAME, val[kit.MDB_NAME])
|
||||
}
|
||||
})
|
||||
if m.W != nil {
|
||||
if m.W != nil && len(arg) < 2 {
|
||||
m.Table(func(index int, value map[string]string, field []string) {
|
||||
m.Push("link", Format("a", kit.MergeURL(m.Option(ice.MSG_USERWEB), "pod", value["name"]), value["name"]))
|
||||
})
|
||||
|
@ -69,6 +69,12 @@ func _share_create(m *ice.Message, kind, name, text string, arg ...string) {
|
||||
|
||||
func _share_local(m *ice.Message, arg ...string) {
|
||||
p := path.Join(arg...)
|
||||
if m.Option("pod") != "" {
|
||||
m.Cmdy(ice.WEB_SPACE, m.Option("pod"), "nfs.cat", p)
|
||||
m.Render(ice.RENDER_RESULT)
|
||||
return
|
||||
}
|
||||
|
||||
switch ls := strings.Split(p, "/"); ls[0] {
|
||||
case "etc", "var":
|
||||
return
|
||||
@ -109,6 +115,7 @@ func _share_action_redirect(m *ice.Message, value map[string]interface{}, share
|
||||
"title", kit.Format(value["name"]),
|
||||
"river", kit.Value(value, "extra.river"),
|
||||
"storm", kit.Value(value, "extra.storm"),
|
||||
"pod", kit.Value(value, "extra.tool.0.pod"),
|
||||
kit.UnMarshal(kit.Format(kit.Value(value, "extra.tool.0.value"))),
|
||||
)
|
||||
return true
|
||||
|
@ -6,13 +6,18 @@ import (
|
||||
)
|
||||
|
||||
func _action_share_create(m *ice.Message, arg ...string) {
|
||||
m.Debug("info %v", arg)
|
||||
if m.Option("index") != "" {
|
||||
arg = append(arg, "tool.0.pod", m.Option("node"))
|
||||
arg = append(arg, "tool.0.ctx", m.Option("group"))
|
||||
arg = append(arg, "tool.0.cmd", m.Option("index"))
|
||||
arg = append(arg, "tool.0.args", m.Option("args"))
|
||||
arg = append(arg, "tool.0.value", m.Option("value"))
|
||||
arg = append(arg, "tool.0.single", "yes")
|
||||
m.Debug("info %v", arg)
|
||||
m.Cmdy(ice.WEB_SHARE, ice.TYPE_ACTION, m.Option("name"), m.Option("text"),
|
||||
"tool.0.pod", kit.Select(m.Option("pod"), m.Option("node")),
|
||||
"tool.0.ctx", m.Option("group"),
|
||||
"tool.0.cmd", m.Option("index"),
|
||||
"tool.0.args", m.Option("args"),
|
||||
"tool.0.value", m.Option("value"),
|
||||
"tool.0.single", "yes",
|
||||
)
|
||||
return
|
||||
} else {
|
||||
m.Option(ice.MSG_RIVER, arg[5])
|
||||
m.Option(ice.MSG_STORM, arg[7])
|
||||
@ -23,7 +28,6 @@ func _action_share_create(m *ice.Message, arg ...string) {
|
||||
arg = append(arg, kit.Format("tool.%d.args", index), value["args"])
|
||||
})
|
||||
}
|
||||
m.Cmdy(ice.WEB_SHARE, ice.TYPE_ACTION, m.Option("name"), arg[2], arg[3], arg[4:])
|
||||
}
|
||||
func _action_share_select(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Richs(ice.WEB_SHARE, nil, m.Option("share"), func(key string, value map[string]interface{}) {
|
||||
@ -52,7 +56,7 @@ func _action_share_update(m *ice.Message, c *ice.Context, cmd string, arg ...str
|
||||
|
||||
m.Richs(ice.WEB_SHARE, nil, m.Option("share"), func(key string, value map[string]interface{}) {
|
||||
kit.Fetch(kit.Value(value, kit.Keys("extra.tool", arg[2])), func(value map[string]interface{}) {
|
||||
cmds := kit.Simple(m.Space(value["pod"]), kit.Keys(value["ctx"], value["cmd"]), arg[3:])
|
||||
cmds := kit.Simple(kit.Keys(value["ctx"], value["cmd"]), arg[3:])
|
||||
m.Cmdy(_action_proxy(m), cmds).Option("cmds", cmds)
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user