1
0
forked from x/volcanos

opt inner

This commit is contained in:
shaoying 2020-08-07 20:34:05 +08:00
parent a7f4b4c654
commit e3c602f4e1
4 changed files with 63 additions and 140 deletions

171
frame.js
View File

@ -49,157 +49,75 @@ Volcanos("onengine", { _init: function(can, meta, list, cb, target) {
river: {
"serivce": {name: "运营群", storm: {
"wx": {name: "wx", action: [
{name: "微信公众号", help: "wx", inputs: [
{type: "text", name: "path", value: "icebergs/misc/wx/wx.shy"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
{name: "微信公众号", help: "wx", index: "web.wiki.word", args: ["usr/icebergs/misc/wx/wx.shy"]},
]},
"mp": {name: "mp", action: [
{name: "微信小程序", help: "mp", inputs: [
{type: "text", name: "path", value: "icebergs/misc/mp/mp.shy"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
{name: "微信小程序", help: "mp", index: "web.wiki.word", args: ["usr/icebergs/misc/mp/mp.shy"]},
]},
"lark": {name: "lark", action: [
{name: "飞书机器人", help: "lark", inputs: [
{type: "text", name: "path", value: "icebergs/misc/lark/lark.shy"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js", style: "word"}},
{name: "飞书机器人", help: "lark", index: "web.wiki.word", args: ["usr/icebergs/misc/lark/lark.shy"]},
]},
"share": {name: "share", action: [
{name: "contexts", help: "shylinux/contexts", inputs: [
{type: "text", name: "path", value: "learning/speak/20200724.shy"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js", style: "word"}},
{name: "系统上下文", help: "shylinux/contexts", index: "web.wiki.word", args: ["usr/learning/社会/管理/20200724.shy"]},
]},
// "company": {name: "company", action: [
// {name: "公司", help: "company", inputs: [
// {type: "text", name: "path", value: "learning/社会/管理/company.shy"},
// {type: "button", name: "查看", value: "auto"},
// ], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
// ]},
}},
"product": {name: "产品群", storm: {
"office": {name: "office", index: [
"web.wiki.feel",
"web.wiki.draw.draw",
"web.team.plan",
"web.wiki.word",
"web.wiki.data",
]},
"chrome": {name: "chrome", index: [
"web.code.chrome.chrome",
"web.code.chrome.bookmark",
"web.wiki.feel",
]},
"english": {name: "english", action: [
{name: "english", help: "英汉", inputs: [
{type: "text", name: "word", value: "hi"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.alpha.find", feature: {}},
{name: "chinese", help: "汉英", inputs: [
{type: "text", name: "word", value: "你好"},
{type: "text", name: "method", value: "line"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.alpha.find", feature: {}},
{name: "wubi", help: "五笔", inputs: [
{type: "text", name: "word", value: "wqvb"},
{type: "button", name: "查看", value: "auto"},
], index: "web.code.input.find", feature: {}},
{name: "wubi", help: "五笔", inputs: [
{type: "text", name: "word", value: "你好"},
{type: "text", name: "method", value: "line"},
{type: "button", name: "查看", value: "auto"},
], index: "web.code.input.find", feature: {}},
{name: "english", help: "英汉", index: "web.wiki.alpha.find", args: ["hi"]},
{name: "chinese", help: "汉英", index: "web.wiki.alpha.find", args: ["你好", "line"]},
{name: "wubi", help: "五笔", index: "web.code.input.find", args: ["wqvb"]},
{name: "wubi", help: "五笔", index: "web.code.input.find", args: ["你好", "line"]},
]},
"context": {name: "context", action: [
{name: "knowledge", help: "智库", inputs: [
{type: "text", name: "path", value: "learning/", action: "auto"},
{type: "button", name: "查看", value: "auto"},
{type: "button", name: "返回"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
{name: "index", help: "索引", inputs: [
{type: "text", name: "path", value: "learning/index.shy", action: "auto"},
{type: "button", name: "查看", value: "auto"},
{type: "button", name: "返回"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
{name: "context", help: "编程", inputs: [
{type: "text", name: "path", value: "learning/自然/编程/hi.shy"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
{name: "context", help: "编程", index: "web.wiki.word", args: ["usr/learning/社会/管理/context.shy"]},
]},
"learning": {name: "learning", action: [
{name: "golang", help: "编程", index: "web.wiki.word", args: ["usr/golang-story/src/main.shy"]},
{name: "tmux", help: "粘贴", index: "web.code.tmux.text"},
{name: "study", help: "学习", index: "web.wiki.word", args: ["usr/learning/study.shy"]},
]},
}},
"project": {name: "研发群", storm: {
"inner": {name: "inner", index: [
"web.code.inner",
"web.code.git.status",
"studio": {name: "studio", index: [
"web.code.vimer",
"web.code.git.total",
"web.code.git.status",
]},
"relay": {name: "relay", index: [
"aaa.totp.get",
"web.route",
"web.space",
"web.dream",
"web.code.docker.container",
"web.code.tmux.session",
"cli": {name: "cli", action: [
{name: "tmux", help: "命令行", index: "web.wiki.word", args: ["usr/icebergs/misc/tmux/tmux.shy"]},
{name: "git", help: "代码库", index: "web.wiki.word", args: ["usr/icebergs/misc/git/git.shy"]},
{name: "vim", help: "编辑器", index: "web.wiki.word", args: ["usr/icebergs/misc/vim/vim.shy"]},
{name: "zsh", help: "命令行", index: "web.wiki.word", args: ["usr/icebergs/misc/zsh/zsh.shy"]},
]},
"tmux": {name: "tmux", index: [
"web.code.tmux.text",
"web.code.tmux.buffer",
"web.code.tmux.session",
"web": {name: "web", action: [
{name: "HTML5", help: "浏览器", index: "web.wiki.word", args: ["usr/icebergs/misc/chrome/chrome.shy"]},
]},
"vim": {name: "vim", action: [
{name: "git", help: "git", inputs: [
{type: "text", name: "path", value: "icebergs/misc/git/git.shy"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
{name: "vim", help: "vim", inputs: [
{type: "text", name: "path", value: "icebergs/misc/vim/vim.shy"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
]},
"html": {name: "html", action: [
{name: "spide", help: "爬虫", inputs: [
{type: "text", name: "name", value: "icebergs"},
{type: "button", name: "查看", value: "auto"},
], index: "web.code.git.spide", feature: {display: "/plugin/story/spide.js"}},
{name: "trend", help: "趋势", inputs: [
{type: "text", name: "name", value: "icebergs"},
{type: "text", name: "begin_time", value: "@date"},
{type: "button", name: "查看", value: "auto"},
], index: "web.code.git.trend", feature: {display: "/plugin/story/trend.js"}},
{name: "draw", help: "绘图", inputs: [
{type: "text", name: "path", value: "hi.svg"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.draw.draw", feature: {display: "/plugin/local/wiki/draw.js"}},
{name: "HTML5", help: "网页", inputs: [
{type: "text", name: "path", value: "icebergs/misc/chrome/chrome.shy"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
"linux": {name: "linux", action: [
{name: "linux", help: "系统", index: "web.wiki.word", args: ["usr/linux-story/src/main.shy"]},
]},
"nginx": {name: "nginx", action: [
{name: "nginx", help: "代理", inputs: [
{type: "text", name: "path", value: "nginx-story/src/main.shy"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
{name: "nginx", help: "代理", index: "web.wiki.word", args: ["usr/nginx-story/src/main.shy"]},
]},
"golang": {name: "golang", action: [
{name: "golang", help: "编程", inputs: [
{type: "text", name: "path", value: "golang-story/src/main.shy"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
{name: "golang", help: "编程", index: "web.wiki.word", args: ["usr/golang-story/src/main.shy"]},
]},
"redis": {name: "redis", action: [
{name: "redis", help: "缓存", inputs: [
{type: "text", name: "path", value: "redis-story/src/main.shy", action: "auto"},
{type: "button", name: "查看", value: "auto"},
{type: "button", name: "返回"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
{name: "redis", help: "缓存", index: "web.wiki.word", args: ["usr/redis-story/src/main.shy"]},
]},
"mysql": {name: "mysql", action: [
{name: "mysql", help: "数据", index: "web.wiki.word", args: ["usr/mysql-story/src/main.shy"]},
]},
"context": {name: "context", action: [
{name: "context", help: "编程", inputs: [
{type: "text", name: "path", value: "learning/自然/编程/context.shy"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
{name: "think", help: "智库", index: "web.wiki.word", args: ["usr/learning/"]},
{name: "index", help: "索引", index: "web.wiki.word", args: ["usr/learning/index.shy"]},
{name: "context", help: "编程", index: "web.wiki.word", args: ["usr/learning/自然/编程/context.shy"]},
]},
}},
"profile": {name: "测试群", storm: {
@ -210,18 +128,23 @@ Volcanos("onengine", { _init: function(can, meta, list, cb, target) {
"web.cache",
"web.share",
]},
}},
"operate": {name: "运维群", storm: {
"docker": {name: "docker", index: [
"web.code.docker.image",
"web.code.docker.container",
"web.code.docker.command",
]},
}},
"operate": {name: "运维群", storm: {
"relay": {name: "relay", index: [
"aaa.totp.get",
"web.route",
"web.space",
"web.dream",
"web.code.docker.container",
"web.code.tmux.session",
]},
"os": {name: "os", action: [
{name: "操作系统", help: "os", inputs: [
{type: "text", name: "path", value: "learning/自然/编程/system.shy"},
{type: "button", name: "查看", value: "auto"},
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
{name: "操作系统", help: "os", index: "web.wiki.word", args: ["usr/learning/自然/编程/system.shy"]},
]},
}},
},

View File

@ -26,6 +26,14 @@ Volcanos("onaction", {help: "控件交互", list: [],
var cb = sub && sub.onaction && sub.onaction[can.Conf("name")]
if (typeof cb == "function") { return cb(event, sub, can.Conf("name")) }
if (can.Conf("name") == "粘贴") {
navigator.clipboard.readText().then(function(text) {
can.user.toast(can, "复制成功", "paste")
can.run(event, ["action", "insert", "text", text])
})
return
}
switch (can.Conf("type")) {
case "button":
var toast = can.user.toast(can, "执行中...", can.sup._help, 100000)

View File

@ -54,6 +54,7 @@ fieldset.editor>div.output div.content {
border-left:solid 2px red;
min-height:20px;
min-width:200px;
max-width:800px;
overflow:auto;
float:left;
}

View File

@ -2,7 +2,7 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
can.ui = can.page.Appends(can, target, [
{view: "project", style: {display: "none"}},
{view: "profile", list: [
{view: "preview"}, {view: "content"}
{view: "preview"}, {view: "content", style: {"max-width": can.Conf("width")-120+"px"}}
]},
{view: ["display", "pre"]},
@ -129,22 +129,13 @@ Volcanos("onsyntax", {help: "语法高亮", list: ["keyword", "prefix", "line"],
return p.line? p.line(can, line): line
},
svg: {
display: true,
show: function(can) {
can.page.Append(can, can.ui.display, can.core.List(can._msg.result, function(line) {
return {type: "iframe", data: {src: "/share/local/"+line}, style: {width: can.Conf("width")-80+"px"}}
}))
}
},
png: {
display: true,
show: function(can) {
can.page.Append(can, can.ui.display, can.core.List(can._msg.result, function(line) {
return {img: "/share/local/"+line, height: 400}
}))
}
},
line: function(can, line) {
can.page.Append(can, can.ui.display, [{img: "/share/local/"+line, height: 400}])
can.page.Modify(can, can.ui.display, {style: {display: "block"}})
return line
},
}, qrc: {link: "png"}, svg: {link: "png"},
url: {
line: function(can, line) {
return {button: [line, function(event) {