diff --git a/bin/boot.sh b/bin/boot.sh index 843bdb2d..3658bca0 100755 --- a/bin/boot.sh +++ b/bin/boot.sh @@ -1,6 +1,7 @@ #! /bin/bash -i # 日志配置 +export ctx_err=${ctx_err:="/dev/null"} export ctx_log=${ctx_log:="var/log"} export ctx_log_debug=${ctx_log_debug:=false} export ctx_log_disable=${ctx_log_disable:=false} @@ -58,7 +59,7 @@ main() { trap HUP hup log "\nstarting..." while true; do - date && ${ctx_bin} "$@" 2>error.log && break + date && ${ctx_bin} "$@" 2>${ctx_err} && break log "\n\nrestarting..." && sleep 1 done } diff --git a/src/contexts/cli/version.go b/src/contexts/cli/version.go index d114285a..ee465f2d 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-29 13:12:30`, `com`, 710, + `2019-10-29 15:36:42`, `centos`, 653, } diff --git a/src/plugin/mind/index.shy b/src/plugin/mind/index.shy index 83537878..a2d3ae4a 100644 --- a/src/plugin/mind/index.shy +++ b/src/plugin/mind/index.shy @@ -14,7 +14,7 @@ kit dir "目录" private "ssh._route" _ "nfs.dir" _ time size line path \ feature display editor \ exports dir "" dir -kit grep "搜索" public "nfs.grep" search _ _ "-rn" "--color" cmd_parse cut 3 ":" "file line word" \ +kit grep "搜索" public "cli.system" grep _ _ "-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 "搜索" \ @@ -36,3 +36,30 @@ fun mark "标签" public \ end end +fun blog "博客" public \ + text "" name tag \ + text "" name url view long \ + button "保存" action auto + + if $2 == "" + copy skip ssh.data show blog + else + copy ssh.data insert blog tag _ url _ + end +end + +fun note "记事本" public \ + text "" name you imports plugin_you action auto \ + text "" name tip imports plugin_tip view long action auto \ + button "查看" action auto \ + button "返回" cb Last \ + exports tip file tip \ + feature display inner + + if $2 == "" || $2 ~ ".*/$" + copy ssh._route _ context wiki tree __ level local/wiki + else + copy ssh._route _ context wiki text __ level local/wiki + end +end + diff --git a/src/plugin/storage/index.shy b/src/plugin/storage/index.shy index a507f70e..5a028499 100644 --- a/src/plugin/storage/index.shy +++ b/src/plugin/storage/index.shy @@ -31,21 +31,6 @@ fun clip "剪切板" public \ end end -fun note "记事本" public \ - text "" name you imports plugin_you action auto \ - text "" name tip imports plugin_tip view long action auto \ - button "查看" action auto \ - button "返回" cb Last \ - exports tip file tip \ - feature display inner - - if $2 == "" || $2 ~ ".*/$" - copy ssh._route _ context wiki tree __ level local/wiki - else - copy ssh._route _ context wiki text __ level local/wiki - end -end - kit data "数据库" public "ssh.data" show \ text "" name table imports plugin_table action auto view long \ text "" name index imports plugin_index action auto \ @@ -59,7 +44,7 @@ kit save "导出" private "ssh.data" export \ kit load "导入" private "ssh.data" import \ text "love" name table imports plugin_table \ - text "list.csv" name file \ + text "etc/list.csv" name file \ button "导入" kit push "上传" private "web./download/" \ diff --git a/usr/librarys/chat.js b/usr/librarys/chat.js index 114ed1cf..dd78ae7c 100644 --- a/usr/librarys/chat.js +++ b/usr/librarys/chat.js @@ -413,17 +413,8 @@ var page = Page({ ], } }, - initStorm: function(page, field, option, output) { - var river = "" + initStorm: function(page, field, option, output) {var river = "" return { - Next: function() { - var next = output.querySelector("div.item.select").nextSibling - next? next.click(): output.firstChild.click() - }, - Prev: function() { - var prev = output.querySelector("div.item.select").previousSibling - prev? prev.click(): output.lastChild.click() - }, Show: function(which) {var pane = field.Pane var data = river && field.Pane.Load(river, output) if (data) {return pane.which.set(data.which)} diff --git a/usr/librarys/example.js b/usr/librarys/example.js index 1b777d93..e37893bd 100644 --- a/usr/librarys/example.js +++ b/usr/librarys/example.js @@ -288,6 +288,9 @@ function Page(page) { break } }, + title: function(title) { + document.title = title + }, Require: function(file, cb) { if (!file || Plugin[file]) {return kit._call(cb, [Plugin[file]])} @@ -691,6 +694,15 @@ function Pane(page, field) { }) }), + Next: function() { + var next = output.querySelector(itemkeys).nextSibling + next? next.click(): output.firstChild.click() + }, + Prev: function() { + var prev = output.querySelector(itemkeys).previousSibling + prev? prev.click(): output.lastChild.click() + }, + Show: function() { kit.ModifyView(field, {display: "block"}) }, @@ -1452,7 +1464,8 @@ function Output(plugin, type, msg, cb, target, option) { if (msg.file) { target.style.maxHeight = "500px" var code = kit.AppendChild(target, [{view: ["code", "table"], list: kit.List(msg.result, function(line, index) { - return {view: ["line"+ (current == index+1? " select": ""), "tr"], list: [{view: ["number", "td", index+1]}, {view: ["code", "td", kit.Color(line)], style: {"white-space": "pre"}}], click: function(event) { + return {view: ["line"+ (current == index+1? " select": ""), "tr"], + list: [{view: ["number", "td", index+1]}, {view: ["code", "td", kit.Origin(kit.Color(line))], style: {"white-space": "pre"}}], click: function(event) { page.Sync("plugin_editor_file").set(msg.file[0]) page.Sync("plugin_editor_index").set(index+1) page.Sync("plugin_editor_line").set(line) diff --git a/usr/librarys/toolkit.js b/usr/librarys/toolkit.js index 49ff909d..d7d451db 100644 --- a/usr/librarys/toolkit.js +++ b/usr/librarys/toolkit.js @@ -530,6 +530,11 @@ kit = toolkit = (function() {var kit = {__proto__: document, notNone: function(c) {return !kit.isNone(c)}, isSpace: function(c) {return c == " " || c == "Enter"}, Format: function(objs) {return JSON.stringify(objs)}, + Origin: function(s) { + s = s.replace(//g, ">") + return s + }, Color: function(s) {if (!s) {return s} s = s.replace(/\033\[1m/g, "") s = s.replace(/\033\[36m/g, "") @@ -539,8 +544,6 @@ kit = toolkit = (function() {var kit = {__proto__: document, s = s.replace(/\033\[31m/g, "") s = s.replace(/\033\[0m/g, "") s = s.replace(/\033\[m/g, "") - // s = s.replace(//g, ">") return s }, Value: function() {