forked from x/ContextOS
opt some
This commit is contained in:
parent
ed9b9e8f41
commit
79c289c3f8
@ -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
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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/" \
|
||||
|
@ -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)}
|
||||
|
@ -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)
|
||||
|
@ -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, "<")
|
||||
s = s.replace(/>/g, ">")
|
||||
return s
|
||||
},
|
||||
Color: function(s) {if (!s) {return s}
|
||||
s = s.replace(/\033\[1m/g, "<span style='font-weight:bold'>")
|
||||
s = s.replace(/\033\[36m/g, "<span style='color:#0ff'>")
|
||||
@ -539,8 +544,6 @@ kit = toolkit = (function() {var kit = {__proto__: document,
|
||||
s = s.replace(/\033\[31m/g, "<span style='color:#f00'>")
|
||||
s = s.replace(/\033\[0m/g, "</span>")
|
||||
s = s.replace(/\033\[m/g, "</span>")
|
||||
// s = s.replace(/</g, "<")
|
||||
// s = s.replace(/>/g, ">")
|
||||
return s
|
||||
},
|
||||
Value: function() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user