mirror of
https://shylinux.com/x/icebergs
synced 2025-04-25 17:18:05 +08:00
add some
This commit is contained in:
parent
bbb0ae9de9
commit
da81284b37
@ -24,6 +24,9 @@ func _host_domain(m *ice.Message) string {
|
||||
}
|
||||
return ""
|
||||
},
|
||||
func() string {
|
||||
return LOCALHOST
|
||||
},
|
||||
)
|
||||
}
|
||||
func _host_list(m *ice.Message, name string) *ice.Message {
|
||||
|
@ -512,14 +512,15 @@ func init() {
|
||||
m.Cmd(SPACE).Table(func(value ice.Maps, index int, head []string) {
|
||||
kit.If(value[mdb.TYPE] == m.ActionKey(), func() { m.PushRecord(value, head...) })
|
||||
})
|
||||
if len(arg) > 0 {
|
||||
m.Cut(arg...)
|
||||
}
|
||||
m.SortStrR(mdb.NAME)
|
||||
kit.If(len(arg) > 0, func() { m.Cut(arg...) })
|
||||
}},
|
||||
WORKER: {Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmd(SPACE).Table(func(value ice.Maps, index int, head []string) {
|
||||
kit.If(value[mdb.TYPE] == m.ActionKey(), func() { m.PushRecord(value, head...) })
|
||||
})
|
||||
m.SortStrR(mdb.NAME)
|
||||
kit.If(len(arg) > 0, func() { m.Cut(arg...) })
|
||||
}},
|
||||
DOWNLOAD: {Name: "download path link", Hand: func(m *ice.Message, arg ...string) {
|
||||
GoToast(m, func(toast func(string, int, int)) []string {
|
||||
|
@ -517,7 +517,12 @@ func HostPort(m *ice.Message, host, port string, arg ...string) string {
|
||||
kit.If(kit.Select("", arg, 1), func(cmd string) { p += C(cmd) })
|
||||
}
|
||||
kit.If(m.Option(ice.LOG_DEBUG) == ice.TRUE, func() { p += "?debug=true" })
|
||||
kit.If(host == "", func() { host = kit.ParseURL(UserHost(m)).Hostname() })
|
||||
kit.If(host == "", func() {
|
||||
if u := kit.ParseURL(UserHost(m)); u != nil {
|
||||
host = u.Hostname()
|
||||
}
|
||||
})
|
||||
host = kit.Select("localhost", host)
|
||||
if port == tcp.PORT_443 {
|
||||
return kit.Format("https://%s", host) + p
|
||||
} else if port == tcp.PORT_80 {
|
||||
|
@ -33,6 +33,7 @@ func init() {
|
||||
uri := "/publish/" + kit.Format(value[nfs.FILE])
|
||||
kit.If(m.Spawn().Options(ice.MSG_USERPOD, "").ParseLink(ice.Info.Make.Domain).Option(ice.MSG_USERPOD), func(p string) {
|
||||
uri = kit.MergeURL(uri, ice.POD, p)
|
||||
uri = kit.MergeURL2(ice.Info.Make.Domain, uri)
|
||||
})
|
||||
dir := path.Join(kit.Format(value[nfs.PATH]), kit.Format(value[nfs.FILE]))
|
||||
web.GoToast(m, func(toast func(name string, count, total int)) []string {
|
||||
|
@ -118,9 +118,9 @@ func init() {
|
||||
}
|
||||
func TableGo(m *ice.Message, cb ice.Any) *ice.Message {
|
||||
wg, lock := sync.WaitGroup{}, &task.Lock{}
|
||||
wg.Add(m.Length())
|
||||
defer wg.Wait()
|
||||
m.Table(func(value ice.Maps) {
|
||||
wg.Add(1)
|
||||
task.Put(m.FormatTaskMeta(), logs.FileLine(cb), func(*task.Task) {
|
||||
defer wg.Done()
|
||||
switch cb := cb.(type) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user