diff --git a/src/contexts/cli/version.go b/src/contexts/cli/version.go index 29b1e103..80971a95 100644 --- a/src/contexts/cli/version.go +++ b/src/contexts/cli/version.go @@ -4,5 +4,5 @@ var version = struct { host string self int }{ - "2019-07-15 02:05:42", "com.mac", 169, + "2019-07-15 09:24:05", "com.mac", 179, } diff --git a/src/contexts/nfs/nfs.go b/src/contexts/nfs/nfs.go index 4961ef97..9d978904 100644 --- a/src/contexts/nfs/nfs.go +++ b/src/contexts/nfs/nfs.go @@ -1318,12 +1318,18 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心", return }}, "git": &ctx.Command{Name: "git sum", Help: "版本控制", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) { - if len(arg) > 0 && arg[0] == "sum" { - if out, e := exec.Command("git", "log", "--reverse", "--shortstat", "--pretty=commit: %ad", "--date=format:%Y-%m-%d").CombinedOutput(); m.Assert(e) { + if len(arg) > 0 && arg[0] == "sum" || len(arg) > 1 && arg[1] == "sum" { + args := []string{"log"} + if len(arg) > 1 && arg[1] == "sum" && arg[0] != "" { + args = append(args, "-C", arg[0]) + } + args = append(args, "--reverse", "--shortstat", "--pretty=commit: %ad", "--date=format:%Y-%m-%d %H:%M") + if out, e := exec.Command("git", args...).CombinedOutput(); m.Assert(e) { for _, v := range strings.Split(string(out), "commit: ") { if l := strings.Split(v, "\n"); len(l) > 2 { fs := strings.Split(strings.TrimSpace(l[2]), ", ") - m.Add("append", "date", l[0]) + hs := strings.Split(l[0], " ") + m.Add("append", "date", hs[0]) if adds := strings.Split(fs[1], " "); len(fs) > 2 { dels := strings.Split(fs[2], " ") @@ -1336,6 +1342,13 @@ var Index = &ctx.Context{Name: "nfs", Help: "存储中心", m.Add("append", "adds", "0") m.Add("append", "dels", adds[0]) } + m.Add("append", "time", hs[1]) + } else if len(l[0]) > 0 { + hs := strings.Split(l[0], " ") + m.Add("append", "date", hs[0]) + m.Add("append", "adds", 0) + m.Add("append", "dels", 0) + m.Add("append", "time", hs[1]) } } m.Table() diff --git a/src/contexts/ssh/ssh.go b/src/contexts/ssh/ssh.go index 1d894250..f35c98ff 100644 --- a/src/contexts/ssh/ssh.go +++ b/src/contexts/ssh/ssh.go @@ -309,7 +309,7 @@ var Index = &ctx.Context{Name: "ssh", Help: "集群中心", "componet_args": []interface{}{}, "inputs": []interface{}{ map[string]interface{}{"type": "text", "name": "dir", "view": "long"}, map[string]interface{}{"type": "select", "name": "cmd", "values": []interface{}{ - "branch", "status", "diff", "log", "push", "update", + "branch", "status", "diff", "log", "sum", "push", "update", }}, map[string]interface{}{"type": "button", "value": "执行"}, }, diff --git a/usr/librarys/example.js b/usr/librarys/example.js index 9653ab3d..3f4f0b3c 100644 --- a/usr/librarys/example.js +++ b/usr/librarys/example.js @@ -1140,6 +1140,14 @@ function Canvas(plugin, output, width, height, space, msg) { data["end"].push(end) sum = end } + msg.append.push("sum") + msg.sum = data.sum + msg.append.push("max") + msg.max = data.max + msg.append.push("min") + msg.min = data.min + msg.append.push("end") + msg.end = data.end } for (var i = 0; i < nrow; i++) {