forked from x/icebergs
add some
This commit is contained in:
parent
6fc5cbde02
commit
0ef29edbad
@ -10,9 +10,13 @@ import (
|
||||
)
|
||||
|
||||
type client struct {
|
||||
list string `name:"list client.name auto" help:"软件包"`
|
||||
create string `name:"create origin* name icons"`
|
||||
list string `name:"list list" help:"软件包"`
|
||||
}
|
||||
|
||||
func (s client) Create(m *ice.Message, arg ...string) {
|
||||
m.Cmd(web.SPIDE, mdb.CREATE, m.OptionSimple("origin,name,icons"), mdb.TYPE, nfs.REPOS)
|
||||
}
|
||||
func (s client) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
m.Cmd(web.SPIDE).Table(func(value ice.Maps) {
|
||||
@ -20,15 +24,20 @@ func (s client) List(m *ice.Message, arg ...string) {
|
||||
m.PushRecord(value, mdb.ICONS, web.CLIENT_NAME)
|
||||
}
|
||||
})
|
||||
m.Action(s.Create)
|
||||
m.Display("")
|
||||
} else {
|
||||
m.SplitIndex(m.Cmdx(web.SPIDE, arg[0], "/c/"+m.Prefix("server")))
|
||||
m.PushAction(s.Download)
|
||||
m.SplitIndex(m.Cmdx(web.SPIDE, arg[0], "/c/"+m.Prefix("server"))).PushAction(s.Download)
|
||||
}
|
||||
}
|
||||
func (s client) Download(m *ice.Message, arg ...string) {
|
||||
name := path.Base(m.Option(nfs.PATH))
|
||||
m.Cmd(web.SPIDE, m.Option(web.CLIENT_NAME), web.SPIDE_SAVE, nfs.USR+name, "/publish/"+name)
|
||||
web.GoToast(m.Message, func(toast func(string, int, int)) (res []string) {
|
||||
m.Cmd(web.SPIDE, m.Option(web.CLIENT_NAME), web.SPIDE_SAVE, nfs.USR_PUBLISH+name, "/publish/"+name, func(count, total, value int) {
|
||||
toast(name, count, total)
|
||||
})
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func init() { ice.Cmd("web.code.publish.client", client{}) }
|
||||
|
@ -1,14 +1,20 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.ui = can.onappend.layout(can)
|
||||
_init: function(can, msg) { can.ui = can.onappend.layout(can)
|
||||
msg.Table(function(value) {
|
||||
can.onimport.item(can, {icons: value.icons, name: value["client.name"]}, function(event, item) {
|
||||
if (can.onmotion.cache(can, function() { return item.name }, can.ui.content)) { return }
|
||||
can.run(event, [item.name], function(msg) {
|
||||
can.onappend.table(can, msg, null, can.ui.content)
|
||||
|
||||
can.onimport.item(can, {icons: value.icons, name: value["client.name"]}, function(event, item, show, target) { can.db.client_name = item.name
|
||||
can.onimport.tabsCache(can, item, target, function(event) {
|
||||
can.run(event, [item.name], function(msg) {
|
||||
can.onappend.table(can, msg, null, can.ui.content)
|
||||
can.onappend._status(can, msg)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONACTION, {
|
||||
download: function(event, can) {
|
||||
var msg = can.request(event); msg.Option("client.name", can.db.client_name)
|
||||
can.runAction(event, web.DOWNLOAD)
|
||||
},
|
||||
})
|
Loading…
x
Reference in New Issue
Block a user