From ddfd8ec3fadf10487c3e27f8bd8d765379748cd9 Mon Sep 17 00:00:00 2001 From: shaoying Date: Tue, 26 Nov 2019 20:11:42 +0800 Subject: [PATCH] opt docker.git --- etc/exit.shy | 5 +++-- etc/init.shy | 5 +++-- src/contexts/cli/cli.go | 14 ++++---------- src/examples/code/code.go | 7 +++++++ src/plugin/context/index.shy | 2 +- src/plugin/docker/index.shy | 27 ++++++++++++--------------- usr/librarys/example.js | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/etc/exit.shy b/etc/exit.shy index aa32e704..c47de099 100644 --- a/etc/exit.shy +++ b/etc/exit.shy @@ -4,9 +4,10 @@ ~wiki config save var/tmp/story.json story ~code - config save var/tmp/vim/vim.json vim + config save var/tmp/vim.json vim config save var/tmp/zsh.json zsh - config save var/tmp/code.json dream login + config save var/tmp/dream.json dream + config save var/tmp/code.json login # 系统配置 ~ssh diff --git a/etc/init.shy b/etc/init.shy index 62e61a74..ae5f2a1e 100644 --- a/etc/init.shy +++ b/etc/init.shy @@ -17,9 +17,10 @@ # 应用配置 ~code - config load tmp/code.json dream login + config load tmp/code.json login + config load tmp/dream.json dream config load tmp/zsh.json zsh - config load tmp/vim/vim.json vim + config load tmp/vim.json vim ~wiki config load tmp/story.json story ~chat diff --git a/src/contexts/cli/cli.go b/src/contexts/cli/cli.go index 4e92efef..4c7dd82b 100644 --- a/src/contexts/cli/cli.go +++ b/src/contexts/cli/cli.go @@ -1207,15 +1207,9 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心", } return }}, - "missyou": {Name: "missyou [topic] [name [action]]", Help: "任务管理", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) { - // 任务主题 - topic := "index" - if len(arg) > 0 && (arg[0] == "" || m.Cmds("nfs.path", path.Join(m.Conf("cli.project", "plugin.path"), arg[0]))) { - topic, arg = arg[0], arg[1:] - } - + "missyou": {Name: "missyou [name [topic|action]]", Help: "任务管理", Hand: func(m *ctx.Message, c *ctx.Context, key string, arg ...string) (e error) { // 任务列表 - if len(arg) == 0 { + if len(arg) == 0 || arg[0] == "" { m.Cmd("nfs.dir", m.Conf("missyou", "path"), "time", "name").Table(func(value map[string]string) { name := strings.TrimSuffix(value["name"], "/") m.Push("create_time", value["time"]) @@ -1227,7 +1221,7 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心", } // 任务命名 - if m.Option("topic", topic); !strings.Contains(arg[0], "-") { + if !strings.Contains(arg[0], "-") { arg[0] = m.Time("20060102-") + arg[0] } @@ -1252,8 +1246,8 @@ var Index = &ctx.Context{Name: "cli", Help: "管理中心", "cmd_dir", p, "cmd_daemon", "true", "cmd_env", "PATH", os.Getenv("PATH"), - "cmd_env", "ctx_type", m.Option("topic"), "cmd_env", "ctx_home", m.Conf("runtime", "boot.ctx_home"), + "cmd_env", "ctx_type", m.Option("topic", kit.Select("index", arg, 1)), "cmd_env", "ctx_ups", fmt.Sprintf("127.0.0.1%s", m.Conf("runtime", "boot.ssh_port")), "cmd_env", "ctx_box", fmt.Sprintf("http://127.0.0.1%s", m.Conf("runtime", "boot.web_port")), "cmd_env", "ctx_bin", m.Conf("runtime", "boot.ctx_bin"), diff --git a/src/examples/code/code.go b/src/examples/code/code.go index 4783c7b6..7b986b38 100644 --- a/src/examples/code/code.go +++ b/src/examples/code/code.go @@ -555,6 +555,13 @@ var Index = &ctx.Context{Name: "code", Help: "代码中心", m.Cmd("cli.system", m.Confv("package", "install"), v) } + case "git": + if s, e := os.Stat(path.Join(p, ".git")); e == nil && s.IsDir() { + m.Cmdy(".git", p, arg[1:]) + break + } + + fallthrough case "list": m.Cmdy("nfs.dir", p, "time", "size", "path").Sort("time", "time_r").Table() diff --git a/src/plugin/context/index.shy b/src/plugin/context/index.shy index f588dff1..cd952cae 100644 --- a/src/plugin/context/index.shy +++ b/src/plugin/context/index.shy @@ -24,8 +24,8 @@ kit upgrade "升级" private "ssh._route" _ "cli.upgrade" \ kit missyou "任务" private "ssh._route" _ "cli.missyou" \ text "" name pod imports plugin_pod \ - text "" name see imports plugin_see \ text "" name you view long \ + text "" name see imports plugin_see \ button "行动" action auto \ exports you "" you diff --git a/src/plugin/docker/index.shy b/src/plugin/docker/index.shy index bb2129a2..6abe9fd6 100644 --- a/src/plugin/docker/index.shy +++ b/src/plugin/docker/index.shy @@ -1,19 +1,13 @@ -kit dir "目录" private "ssh._route" _ "context" "find" "web.code" "zsh" \ - text "" name pod imports plugin_pod \ +kit dir "目录" private "_:web.code.zsh" \ + text "" name pod imports "plugin_pod plugin_you" action auto \ text "" name dir imports plugin_path action auto \ select "" name cmd values list values find values tail values grep values init action auto \ - exports path path \ text "" name txt \ + exports path path \ feature display editor \ button "搜索" action auto \ button "返回" cb Last -kit cli "命令行" private "web.code.zsh" \ - text "" name dir imports plugin_path action auto \ - select "terminal" values terminal values prune values history action auto \ - feature detail "prune" "复制" "下载" \ - button "查看" action auto - kit clip "粘贴板" private "web.code.tmux" "" "" "" "buffer" \ text "" name tag imports plugin_buffer action auto \ text "" name txt \ @@ -69,12 +63,15 @@ kit command "命令" private "web.code.docker" "command" \ text "" name arg view long \ button "执行" -kit git "记录" private "ssh._route" _ "web.code.git" \ - text "" name pod imports plugin_pod \ - text "" name dir imports plugin_path action auto \ - select "status" name cmd values diff values status values commit values branch values remote values pull values push values sum values init \ - exports branch branch \ - button "查看" action auto +kit git "记录" private "_:web.code.zsh" \ + text "" name pod imports "plugin_pod plugin_you" action auto \ + text "usr/local" name dir imports plugin_git_path action auto \ + select "git" name cmd values git \ + select "status" name cmd values "diff status commit branch remote pull push sum init" action auto \ + text "" name txt \ + exports branch branch "" git_path path "" \ + button "查看" action auto \ + button "返回" cb Last kit vim "编辑器" private "web.code.vim" \ select "bufs" name cmd values editor values prune values opens values cmds values txts values bufs values regs values marks values tags values fixs \ diff --git a/usr/librarys/example.js b/usr/librarys/example.js index bfefcc75..6ed18b3f 100644 --- a/usr/librarys/example.js +++ b/usr/librarys/example.js @@ -1322,7 +1322,7 @@ function Inputs(plugin, meta, item, target, option) { }, function(which, value) {var meta = arguments.callee.meta return (meta[which||"none"]||meta["none"])(value) }), - onimport: shy("导入数据", {}, [item.imports], function() { + onimport: shy("导入数据", {}, kit.Trans(item.imports), function() { kit.List(arguments.callee.list, function(imports) { page.Sync(imports).change(function(value) { plugin.History(target.value, target), target.value = value.trim()