1
0
forked from x/icebergs
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-12-01 12:37:11 +08:00
parent 37cab25dc0
commit 591b405724
2 changed files with 3 additions and 3 deletions

View File

@ -124,7 +124,7 @@ func RenderMain(m *ice.Message) *ice.Message {
if m.IsCliUA() { if m.IsCliUA() {
return m.RenderDownload(path.Join(ice.USR_INTSHELL, ice.INDEX_SH)) return m.RenderDownload(path.Join(ice.USR_INTSHELL, ice.INDEX_SH))
} }
m.Options(nfs.SCRIPT, kit.MergeURL(ice.SRC_MAIN_JS, kit.Dict(nfs.VERSION, RenderVersion(m), ice.POD, m.Option(ice.MSG_USERPOD)))) m.Options(nfs.SCRIPT, ice.SRC_MAIN_JS, nfs.VERSION, RenderVersion(m))
return m.RenderResult(kit.Renders(m.Cmdx(nfs.CAT, ice.SRC_MAIN_HTML), m)) return m.RenderResult(kit.Renders(m.Cmdx(nfs.CAT, ice.SRC_MAIN_HTML), m))
} }
func RenderCmds(m *ice.Message, cmds ...ice.Any) { func RenderCmds(m *ice.Message, cmds ...ice.Any) {
@ -147,7 +147,7 @@ func RenderVersion(m *ice.Message) string {
if m.Option(log.DEBUG) == ice.TRUE || m.R != nil && strings.Contains(m.R.URL.RawQuery, "debug=true") { if m.Option(log.DEBUG) == ice.TRUE || m.R != nil && strings.Contains(m.R.URL.RawQuery, "debug=true") {
ls = append(ls, kit.Format("%d", time.Now().Unix()-kit.Time(ice.Info.Make.When)/int64(time.Second))) ls = append(ls, kit.Format("%d", time.Now().Unix()-kit.Time(ice.Info.Make.When)/int64(time.Second)))
} }
return "?_v=" + strings.Join(ls, "-") return "?" + kit.JoinQuery(kit.Simple(kit.Dict("_v", strings.Join(ls, "-"), ice.POD, m.Option(ice.MSG_USERPOD)))...)
} }
const ( const (

View File

@ -563,7 +563,7 @@ func init() {
nfs.Trash(m, _repos_path(m, m.Option(REPOS), m.Option(nfs.FILE))) nfs.Trash(m, _repos_path(m, m.Option(REPOS), m.Option(nfs.FILE)))
} }
}}, }},
COMMIT: {Name: "commit actions=add,fix,opt message*=some", Help: "提交", Hand: func(m *ice.Message, arg ...string) { COMMIT: {Name: "commit actions=add,opt,fix message*=some", Help: "提交", Hand: func(m *ice.Message, arg ...string) {
if work, err := _repos_open(m, m.Option(REPOS)).Worktree(); !m.Warn(err) { if work, err := _repos_open(m, m.Option(REPOS)).Worktree(); !m.Warn(err) {
opt := &git.CommitOptions{All: true} opt := &git.CommitOptions{All: true}
if cfg, err := config.LoadConfig(config.GlobalScope); err == nil { if cfg, err := config.LoadConfig(config.GlobalScope); err == nil {