diff --git a/src/contexts/cli/version.go b/src/contexts/cli/version.go index 3662e510..baf2a938 100644 --- a/src/contexts/cli/version.go +++ b/src/contexts/cli/version.go @@ -7,5 +7,5 @@ var version = struct { self int }{ []string{"2017-11-01 01:02:03", "2019-07-13 18:02:21"}, - `2019-10-28 17:53:02`, `centos`, 651, + `2019-10-29 11:24:50`, `mac`, 665, } diff --git a/src/contexts/ctx/ctx.go b/src/contexts/ctx/ctx.go index 5db52323..658536e5 100644 --- a/src/contexts/ctx/ctx.go +++ b/src/contexts/ctx/ctx.go @@ -29,8 +29,9 @@ func (ctx *CTX) Begin(m *Message, arg ...string) Server { m.Option("table.limit", 30) m.Option("table.offset", 0) + m.Option("table.format", "object") m.Optionv("ctx.form", map[string]int{ - "table.limit": 1, "table.offset": 1, + "table.limit": 1, "table.offset": 1, "table.format": 1, }) m.root = m diff --git a/src/contexts/ctx/type.go b/src/contexts/ctx/type.go index 17b9c704..78f4cb82 100644 --- a/src/contexts/ctx/type.go +++ b/src/contexts/ctx/type.go @@ -242,6 +242,10 @@ func (m *Message) Result(arg ...interface{}) string { } func (m *Message) Push(str string, arg ...interface{}) *Message { + switch m.Option("table.format") { + case "table": + return m.Add("append", "key", str).Add("append", "value", arg...) + } return m.Add("append", str, arg...) } func (m *Message) Sort(key string, arg ...string) *Message { diff --git a/src/plugin/context/index.shy b/src/plugin/context/index.shy index 526d1e52..96b28433 100644 --- a/src/plugin/context/index.shy +++ b/src/plugin/context/index.shy @@ -56,9 +56,17 @@ kit dir "目录" private "ssh._route" _ "nfs.dir" _ time size line path \ feature display editor \ exports dir "" dir -kit git "版本" private "ssh._route" _ "nfs.git" __ \ - text "" name pod imports plugin_pod action auto \ - select "" values status values diff commit values values log values init action auto \ - text "" name txt action auto \ - button "查看" +fun wss "推送" private \ + text "" name wss imports plugin_wss \ + text "" name cmd view long \ + button "推送" \ + button "返回" cb Last \ + exports wss key + + if $2 == "" + copy web.wss + else + copy web.wss _ sync + end +end diff --git a/src/plugin/love/index.shy b/src/plugin/love/index.shy index c8b3d402..65f8f7ac 100644 --- a/src/plugin/love/index.shy +++ b/src/plugin/love/index.shy @@ -101,23 +101,3 @@ fun media "娱乐" private \ end end -fun wss "推送" private \ - text "" name wss imports plugin_wss \ - text "" name cmd view long \ - button "推送" \ - button "返回" cb Last \ - exports wss key - - if $2 == "" - copy web.wss - else - copy web.wss _ sync - end -end - -kit pos "位置" private \ - button "查看" cb getLocation \ - button "显示" cb openLocation \ - text "0.0062" name x \ - text "0.0014" name y \ - text "当前位置" name pos \ diff --git a/src/plugin/mind/index.css b/src/plugin/mind/index.css index d16c73a9..18ea04b9 100644 --- a/src/plugin/mind/index.css +++ b/src/plugin/mind/index.css @@ -1,4 +1,4 @@ -fieldset.item.mind div.output table td { +fieldset.item.mind.xls div.output table td { text-align:center; min-width:16px; height:16px; diff --git a/src/plugin/mind/index.shy b/src/plugin/mind/index.shy index 19e1b72e..83537878 100644 --- a/src/plugin/mind/index.shy +++ b/src/plugin/mind/index.shy @@ -8,9 +8,31 @@ kit xls "表格" "index.js" "index.css" private context find "web.wiki" xls \ kit dir "目录" private "ssh._route" _ "nfs.dir" _ time size line path \ text "" name pod imports plugin_pod action auto \ - text "usr/script" name dir imports plugin_dir action auto view long \ + text "usr/local/redis-5.0.5/src" name dir imports plugin_dir action auto view long \ button "浏览" action auto \ button "返回" cb Last \ feature display editor \ exports dir "" dir +kit grep "搜索" public "nfs.grep" search _ _ "-rn" "--color" cmd_parse cut 3 ":" "file line word" \ + text "" name txt imports plugin_editor_word \ + text "usr/local/redis-5.0.5" name dir view long \ + button "搜索" \ + exports dir file "" editor_file file "" editor_index line "" + +fun mark "标签" public \ + text "mark" name table \ + text "" name file imports plugin_editor_file view long \ + text "" name index imports plugin_editor_index view tiny \ + text "" name word imports plugin_editor_word \ + text "" name mark view long \ + button "操作" \ + exports dir file "" editor_index index "" editor_word word + + if $5 == "" + copy skip ssh.data show _ + else + copy ssh.data insert _ file _ index _ word _ mark _ + end +end + diff --git a/src/plugin/storage/index.shy b/src/plugin/storage/index.shy index 4c2b7e1a..a507f70e 100644 --- a/src/plugin/storage/index.shy +++ b/src/plugin/storage/index.shy @@ -1,21 +1,21 @@ fun buffer "粘贴板" private \ - text "0" name index imports plugin_tmux_bindex action auto \ + text "" name index imports plugin_tmux_bindex action auto \ text "" name txt view long \ button "查看" action auto \ button "返回" cb Last \ exports tmux_bindex cur + let index = $1 if $1 == "" - copy cli.system tmux "list-buffer" cmd_parse cut 3 ":" "cur bytes text" + copy skip cli.system tmux "list-buffer" cmd_parse cut 3 ":" "cur bytes text" return end - if $2 == "" - copy cli.system tmux "show-buffer" "-b" - return + if $2 != "" + copy cli.system tmux "set-buffer" "-b" end - copy cli.system tmux "set-buffer" "-b" + return $(cli.system tmux "show-buffer" "-b" $index) end fun clip "剪切板" public \ @@ -59,7 +59,7 @@ kit save "导出" private "ssh.data" export \ kit load "导入" private "ssh.data" import \ text "love" name table imports plugin_table \ - text "" name file \ + text "list.csv" name file \ button "导入" kit push "上传" private "web./download/" \ @@ -67,3 +67,9 @@ kit push "上传" private "web./download/" \ button "上传" cb upload \ button "查看" +kit git "版本" private "ssh._route" _ "nfs.git" __ \ + text "" name pod imports plugin_pod action auto \ + select "" values status values diff commit values values log values init action auto \ + text "" name txt action auto \ + button "查看" + diff --git a/usr/librarys/context.js b/usr/librarys/context.js index d7931711..496ae4ba 100644 --- a/usr/librarys/context.js +++ b/usr/librarys/context.js @@ -159,9 +159,7 @@ ctx = context = (function(kit) {var ctx = {__proto__: kit, }), WSS: shy("响应后端", {order: 0, wssid: ""}, function(cb, onerror, onclose, onopen) {var meta = arguments.callee.meta var s = new WebSocket(location.protocol.replace("http", "ws")+"//"+location.host+"/wss?wssid="+meta.wssid) - s.onopen = function(event) {kit.Tip("wss open"), ctx.Event(event, {}, {name: [document.title, "wss", "open"]})} - s.onerror = function(event) {kit.Log("wss", "error", event), kit._call(onerror, [event])} - s.onclose = function(event) {kit.Tip("wss close"), kit.Log("wss", "close"), kit._call(onclose, [event])} + s.onerror = onerror, s.onclose = onclose, s.onopen = onopen s.onmessage = function(event) {var order = ++meta.order try { var msg = JSON.parse(event.data||'{}') diff --git a/usr/librarys/example.js b/usr/librarys/example.js index eb95ab5b..1b777d93 100644 --- a/usr/librarys/example.js +++ b/usr/librarys/example.js @@ -359,10 +359,12 @@ function Page(page) { page.socket.close() }), onclose || (function() { + page.toast.Pane.Show("WSS Close") delete(page.socket), setTimeout(function() { page.WSS(cb, onerror, onclose) }, 1000) }), onopen || (function() { + page.toast.Pane.Show("WSS Open") }))) },