diff --git a/base/web/dream.go b/base/web/dream.go index 701a1fcb..0b102bc7 100644 --- a/base/web/dream.go +++ b/base/web/dream.go @@ -6,6 +6,7 @@ import ( "regexp" "runtime" "strings" + "time" ice "shylinux.com/x/icebergs" "shylinux.com/x/icebergs/base/aaa" @@ -85,7 +86,14 @@ func _dream_binary(m *ice.Message, p string) { if bin := path.Join(m.Option(cli.CMD_DIR), ice.BIN_ICE_BIN); nfs.Exists(m, bin) { } else if kit.IsUrl(p) { - SpideSave(m, bin, kit.MergeURL(p, cli.GOOS, runtime.GOOS, cli.GOARCH, runtime.GOARCH), nil) + GoToast(m, "download", func(toast func(string, int, int)) (list []string) { + begin := time.Now() + SpideSave(m, bin, kit.MergeURL(p, cli.GOOS, runtime.GOOS, cli.GOARCH, runtime.GOARCH), func(count, total, value int) { + cost := time.Now().Sub(begin) + toast(kit.FormatShow(nfs.FROM, begin.Format("15:04:05"), cli.COST, kit.FmtDuration(cost), cli.REST, kit.FmtDuration(cost*time.Duration(101)/time.Duration(value+1)-cost)), count, total) + }) + return nil + }) os.Chmod(bin, ice.MOD_DIR) } else { m.Cmd(nfs.LINK, bin, kit.Path(p)) diff --git a/base/web/spide.go b/base/web/spide.go index 77c9bd67..8768ff51 100644 --- a/base/web/spide.go +++ b/base/web/spide.go @@ -341,6 +341,6 @@ func SpidePost(m *ice.Message, arg ...ice.Any) ice.Any { func SpideDelete(m *ice.Message, arg ...ice.Any) ice.Any { return kit.UnMarshal(m.Cmdx(http.MethodDelete, arg)) } -func SpideSave(m *ice.Message, file, link string, cb func(int, int, int)) *ice.Message { +func SpideSave(m *ice.Message, file, link string, cb func(count int, total int, value int)) *ice.Message { return m.Cmd(Prefix(SPIDE), ice.DEV, SPIDE_SAVE, file, http.MethodGet, link, cb) } diff --git a/core/chat/header.go b/core/chat/header.go index 7be6e724..40026f58 100644 --- a/core/chat/header.go +++ b/core/chat/header.go @@ -54,7 +54,7 @@ func _header_check(m *ice.Message, arg ...string) bool { if m.Option(ice.MSG_USERNAME) != "" { return true } else if ctx.OptionFromConfig(m, SSO) == "" && ctx.OptionFromConfig(m, web.LOGIN) == "" { - m.Option(SSO, GetSSO(m)) + m.Option(SSO, kit.Format(kit.Dict("serve.icon", "usr/icons/icebergs.jpg", "serve.url", GetSSO(m)))) } return false } diff --git a/core/chat/caculator.go b/core/chat/macos/caculator.go similarity index 95% rename from core/chat/caculator.go rename to core/chat/macos/caculator.go index 0dc267cf..a819e301 100644 --- a/core/chat/caculator.go +++ b/core/chat/macos/caculator.go @@ -1,4 +1,4 @@ -package chat +package macos import ( ice "shylinux.com/x/icebergs" diff --git a/core/chat/clock.go b/core/chat/macos/clock.go similarity index 95% rename from core/chat/clock.go rename to core/chat/macos/clock.go index bee1746b..9b0f0b78 100644 --- a/core/chat/clock.go +++ b/core/chat/macos/clock.go @@ -1,4 +1,4 @@ -package chat +package macos import ( ice "shylinux.com/x/icebergs" diff --git a/core/code/vimer.go b/core/code/vimer.go index 4641724f..214b584a 100644 --- a/core/code/vimer.go +++ b/core/code/vimer.go @@ -192,6 +192,7 @@ func init() { if m.Cmdy(INNER, arg); arg[0] != ctx.ACTION { kit.If(len(arg) > 1, func() { mdb.HashCreate(m.Spawn(), nfs.PATH, path.Join(kit.Slice(arg, 0, 2)...)) }) m.Action(nfs.SAVE, COMPILE, "show", "exec") + ctx.Toolkit(m, COMPILE, cli.RUNTIME) ctx.DisplayLocal(m, "") } }}, diff --git a/misc/git/repos.go b/misc/git/repos.go index bf387d01..c6962eac 100644 --- a/misc/git/repos.go +++ b/misc/git/repos.go @@ -647,9 +647,8 @@ func init() { kit.If(m.Option(REPOS), func(p string) { p = strings.Split(p, mdb.QS)[0] kit.If(!strings.Contains(p, "://"), func() { p = web.UserHost(m) + "/x/" + p }) - if ice.Info.System == cli.LINUX { - p = strings.Replace(p, "https", "http", 1) - } + kit.If(ice.Info.System == cli.LINUX, func() { p = strings.Replace(p, "https", "http", 1) }) + web.Toast(m, "clone "+p) m.Cmd("", CLONE, ORIGIN, p, nfs.PATH, m.Option(cli.CMD_DIR), ice.Maps{cli.CMD_DIR: ""}) }) }},