diff --git a/core/code/publish/client.go b/core/code/publish/client.go index 49588803..90abc0c4 100644 --- a/core/code/publish/client.go +++ b/core/code/publish/client.go @@ -6,6 +6,7 @@ import ( "shylinux.com/x/ice" "shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/nfs" + "shylinux.com/x/icebergs/base/tcp" "shylinux.com/x/icebergs/base/web" ) @@ -24,15 +25,14 @@ func (s client) List(m *ice.Message, arg ...string) { m.PushRecord(value, mdb.ICONS, web.CLIENT_NAME) } }) - m.Action(s.Create) - m.Display("") + m.Action(s.Create).SortStrR(web.CLIENT_NAME).Display("") } else { - m.SplitIndex(m.Cmdx(web.SPIDE, arg[0], "/c/"+m.Prefix("server"))).PushAction(s.Download) + m.SplitIndex(m.Cmdx(web.SPIDE, arg[0], web.C(m.Prefix(tcp.SERVER)))).PushAction(s.Download) } } func (s client) Download(m *ice.Message, arg ...string) { - name := path.Base(m.Option(nfs.PATH)) web.GoToast(m.Message, func(toast func(string, int, int)) (res []string) { + name := path.Base(m.Option(nfs.PATH)) 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) }) diff --git a/core/code/publish/client.js b/core/code/publish/client.js index 77d9bd47..051ddf93 100644 --- a/core/code/publish/client.js +++ b/core/code/publish/client.js @@ -1,11 +1,10 @@ Volcanos(chat.ONIMPORT, { _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, show, target) { can.db.client_name = item.name + can.onimport.item(can, {name: value[web.CLIENT_NAME], icons: value.icons}, 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) + can.onappend.table(can, msg, null, can.ui.content), can.onappend._status(can, msg) }) }) }) @@ -14,7 +13,7 @@ Volcanos(chat.ONIMPORT, { }) Volcanos(chat.ONACTION, { download: function(event, can) { - var msg = can.request(event); msg.Option("client.name", can.db.client_name) + var msg = can.request(event); msg.Option(web.CLIENT_NAME, can.db.client_name) can.runAction(event, web.DOWNLOAD) }, }) \ No newline at end of file diff --git a/core/code/publish/server.go b/core/code/publish/server.go index 260c331d..4d76a88d 100644 --- a/core/code/publish/server.go +++ b/core/code/publish/server.go @@ -2,8 +2,10 @@ package publish import ( "shylinux.com/x/ice" + "shylinux.com/x/icebergs/base/cli" "shylinux.com/x/icebergs/base/mdb" "shylinux.com/x/icebergs/base/nfs" + "shylinux.com/x/icebergs/core/code" ) type server struct { @@ -15,20 +17,20 @@ type server struct { func (s server) Inputs(m *ice.Message, arg ...string) { switch arg[0] { - case "path": + case nfs.PATH: m.Cmdy(nfs.DIR, nfs.USR_PUBLISH, nfs.PATH) - case "compile": + case code.COMPILE: m.Push(arg[0], "go") m.Push(arg[0], "javac") - case "runtime": + case cli.RUNTIME: m.Push(arg[0], "python") m.Push(arg[0], "java") m.Push(arg[0], "php") - case "os": + case cli.OS: m.Push(arg[0], "Linux") m.Push(arg[0], "macOS") m.Push(arg[0], "Windows") - case "cpu": + case cli.CPU: m.Push(arg[0], "amd64") m.Push(arg[0], "x86") m.Push(arg[0], "arm")