mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
add git.search
This commit is contained in:
parent
ee1b6eea5c
commit
ff20374049
1
const.js
1
const.js
@ -92,6 +92,7 @@ var web = {CHAT: "chat", STUDIO: "studio",
|
||||
IMAGE_PNG: "image/png", VIDEO_WEBM: "video/webm",
|
||||
URL: "url",
|
||||
|
||||
CODE_GIT_SEARCH: "web.code.git.search",
|
||||
CODE_GIT_STATUS: "web.code.git.status",
|
||||
CODE_GIT_REPOS: "web.code.git.repos",
|
||||
CODE_COMPILE: "web.code.compile",
|
||||
|
1
frame.js
1
frame.js
@ -247,6 +247,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
can.onmotion.clear(can, can._option), can.onappend._option(can, {inputs: can.page.inputs(can, sub.onimport.list, html.TEXT) })
|
||||
}
|
||||
can.page.requireModules(can, can.Conf("modules"), function() {
|
||||
can.onmotion.clear(can)
|
||||
can.core.CallFunc([sub, chat.ONIMPORT, chat._INIT], {can: sub, msg: msg, cb: function(msg) {
|
||||
if (action !== false) { can.onkeymap._build(sub)
|
||||
can.onmotion.clear(can, can._action), sub.onappend._action(sub, can.Conf(ice.MSG_ACTION)||msg.Option(ice.MSG_ACTION), action||can._action)
|
||||
|
@ -1,4 +1,5 @@
|
||||
body {
|
||||
background-color:black;
|
||||
--danger-bg-color:red; --danger-fg-color:white;
|
||||
--notice-bg-color:blue; --notice-fg-color:white;
|
||||
--create-bg-color:blue; --create-fg-color:white;
|
||||
@ -226,6 +227,7 @@ svg g[fill] rect { fill:unset; }
|
||||
/* output */
|
||||
div.project div.list { margin-left:10px; clear:both; }
|
||||
div.project div.item { white-space:pre; line-height:24px; padding:0 10px; }
|
||||
div.project div.item img { height:32px; width:32px; }
|
||||
div.project div.item.filter { padding:0; }
|
||||
div.project div.item.filter>i:first-child { position:absolute; padding:5px; }
|
||||
div.project div.item.filter>input { width:100% !important; padding-left:25px; }
|
||||
@ -251,7 +253,7 @@ div.display:not(.toggle) { border-top:var(--box-border); }
|
||||
div.output.card>div.item.stop { color:var(--disable-fg-color); }
|
||||
div.output.card>div.item { background:var(--plugin-bg-color); padding:10px; border:var(--box-border); border-radius:var(--plugin-radius); margin:10px; width:320px; float:left; box-shadow:var(--box-shadow); }
|
||||
div.output.card>div.item>div.title { font-size:1.2rem; font-weight:bold; padding:10px; border-bottom:var(--box-border); }
|
||||
div.output.card>div.item>div.content { white-space:pre; padding:10px; height:70px; }
|
||||
div.output.card>div.item>div.content { padding:10px; height:70px; }
|
||||
div.output.card>div.item>div.action { text-align:right; width:100%; display:flex; }
|
||||
// div.output.card>div.item:not(:hover)>div.action { visibility:hidden; }
|
||||
div.output.card>div.item>div.action>input { margin-right:5px; box-shadow:var(--box-shadow); }
|
||||
@ -407,6 +409,9 @@ fieldset.web.code.docker.studio>div.output>fieldset>form.option>div:first-child
|
||||
fieldset.web.code.docker.studio>div.output { padding:10px; }
|
||||
fieldset.web.code.git.status>div.output table.content { width:100%; }
|
||||
fieldset.inner>div.output>div.project div.item.modify { background-color:#00800036; }
|
||||
fieldset.plug.dream.zone>div.output>div.item { display:flex; padding:5px; }
|
||||
fieldset.plug.dream.zone>div.output>div.item>img { margin-right:5px; }
|
||||
fieldset.plug.dream.zone>div.output>div.item>span { line-height:32px; }
|
||||
fieldset.vimer>div.output>div.project div.item.modify { background-color:#00800036; }
|
||||
body>div.input.vimer.plug td:first-child { display:none; }
|
||||
fieldset.cmd>div.action>div.tabs.select { border-bottom:var(--notice-bg-color) solid 2px; height:32px; }
|
||||
|
@ -88,6 +88,8 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
|
||||
|
||||
mail: function(can) { can.user.opens("/chat/pod/20230511-golang-story/cmd/web.chat.mail.client") },
|
||||
repos: function(can) { can.user.opens("https://repos.shylinux.com/explore/repos") },
|
||||
repos: function(can) { can.user.opens(can.misc.MergePodCmd(can, {cmd: web.CODE_GIT_SEARCH, repos: "repos"})) },
|
||||
dream: function(can) { can.user.opens(can.misc.MergePodCmd(can, {cmd: web.DREAM})) },
|
||||
cloud: function(can) { can.user.opens("https://cloud.shylinux.com/") },
|
||||
portal: function(can) { can.user.opens(can.misc.MergePodCmd(can, {cmd: web.WIKI_PORTAL})) },
|
||||
desktop: function(can) { can.user.opens(can.misc.MergePodCmd(can, {cmd: web.CHAT_MACOS_DESKTOP})) },
|
||||
@ -97,8 +99,8 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
|
||||
can.isCmdMode() || can.core.List(can._plugins, function(sub) { sub._delay_refresh = false, can.page.ClassList.set(can, sub._target, html.OUTPUT, [TABVIEW, HORIZON, VERTICAL].indexOf(button) > -1) })
|
||||
var cb = can.onlayout[button]; can.base.isFunc(cb) && cb(can) || can.onlayout._plugin(can, button)
|
||||
},
|
||||
_menus: [[html.LAYOUT, ice.AUTO, TABS, TABVIEW, HORIZON, VERTICAL, GRID, FREE, FLOW, PAGE], "desktop", "mail", "cloud", "repos", "portal"],
|
||||
_trans: kit.Dict("mail", "邮箱", "cloud", "网盘", "repos", "资源", "portal", "官网", "desktop", "桌面", html.LAYOUT, "布局", ice.AUTO, "默认布局", TABS, "标签布局", TABVIEW, "标签分屏", HORIZON, "左右分屏", VERTICAL, "上下分屏", GRID, "网格布局", FREE, "自由布局", FLOW, "流动布局", PAGE, "网页布局"),
|
||||
_menus: [[html.LAYOUT, ice.AUTO, TABS, TABVIEW, HORIZON, VERTICAL, GRID, FREE, FLOW, PAGE], "desktop", "dream", "repos", "portal"],
|
||||
_trans: kit.Dict("dream", "空间", "repos", "资源", "portal", "官网", "desktop", "桌面", html.LAYOUT, "布局", ice.AUTO, "默认布局", TABS, "标签布局", TABVIEW, "标签分屏", HORIZON, "左右分屏", VERTICAL, "上下分屏", GRID, "网格布局", FREE, "自由布局", FLOW, "流动布局", PAGE, "网页布局"),
|
||||
})
|
||||
Volcanos(chat.ONLAYOUT, {
|
||||
tabs: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-can.Conf(html.MARGIN_Y)+html.ACTION_MARGIN), can.ConfWidth(width-can.Conf(html.MARGIN_X)) })
|
||||
@ -142,7 +144,11 @@ Volcanos(chat.ONEXPORT, {
|
||||
})
|
||||
Volcanos(chat.ONENGINE, {_engine: function(event, sup, msg, can, cmds, cb) {
|
||||
var storm = can.core.Value(can._root, can.core.Keys(chat.RIVER, cmds[0], chat.STORM, cmds[1])); if (!storm || cmds.length != 2) { return false }
|
||||
if (storm.index) { can.runAction(event, ctx.COMMAND, [].concat(storm.index), cb) } else { can.core.List(storm.list, function(value) { can.base.isString(value) && (value = {index: value})
|
||||
if (storm.index) {
|
||||
can.runAction(event, ctx.COMMAND, [].concat(can.core.List(storm.index, function(item) { return item.index||item })), function(msg) {
|
||||
can.core.List(storm.index, function(item) { msg.Push(ctx.ARGS, JSON.stringify(item.args||[])) }), cb(msg)
|
||||
})
|
||||
} else { can.core.List(storm.list, function(value) { can.base.isString(value) && (value = {index: value})
|
||||
msg.Push(mdb.NAME, value.name||"").Push(mdb.HELP, value.help||"").Push(ctx.INPUTS, JSON.stringify(value.inputs)).Push(ctx.FEATURE, JSON.stringify(value.feature))
|
||||
msg.Push(ctx.INDEX, value.index||"").Push(ctx.ARGS, value.args||"[]").Push(ctx.STYLE, value.style||"").Push(ctx.DISPLAY, value.display||"")
|
||||
}), can.base.isFunc(cb) && cb(msg) } return true
|
||||
|
@ -69,9 +69,7 @@ Volcanos(chat.ONACTION, {list: [mdb.CREATE, web.SHARE, web.REFRESH], _init: func
|
||||
can.misc.localStorage(can, CAN_RIVER, ""), can.misc.localStorage(can, CAN_STORM, ""), can.misc.Search(can, {river: "", storm: ""})
|
||||
}) },
|
||||
onaction_nostorm: function(can, msg, river) { can.ondetail.create({}, can, mdb.CREATE, river) },
|
||||
onaction_remove: function(can, msg, river, storm, id) {
|
||||
can.run(can.request({}), [river, storm, chat.STORM, ctx.ACTION, mdb.DELETE, mdb.ID, id], function() { })
|
||||
},
|
||||
onaction_remove: function(can, msg, river, storm, id) { can.run(can.request({}), [river, storm, chat.STORM, ctx.ACTION, mdb.DELETE, mdb.ID, id], function() { }) },
|
||||
})
|
||||
Volcanos(chat.ONDETAIL, {
|
||||
_trans: {
|
||||
|
@ -8,12 +8,12 @@ fieldset.inner>div.output div.content td.text span.constant { color:var(--code-c
|
||||
fieldset.inner>div.output div.content td.text span.string { color:var(--code-string); box-shadow:var(--box-shadow); }
|
||||
fieldset.inner>div.output div.content td.text span.object { color:var(--code-object); }
|
||||
fieldset.inner>div.output>div.project>div.zone>div.item { font-style:italic; font-weight:bold; line-height:32px; }
|
||||
fieldset.inner>div.output>div.project div.zone>div.item span.icon { font-style:normal; font-weight:normal; }
|
||||
fieldset.inner>div.output>div.project div.zone>div.item span.icon { font-style:normal; font-weight:normal; letter-spacing:0; }
|
||||
fieldset.inner>div.output>div.project div.zone>div.item span.icon { font-size:22px; line-height:26px; padding:0 5px; float:right; display:none; }
|
||||
fieldset.inner>div.output>div.project div.zone:hover>div.item span.icon { display:block; }
|
||||
fieldset.inner>div.output>div.project div.zone div.action { width:100%; }
|
||||
fieldset.inner>div.output>div.project div.zone div.action>div.item { padding-right:0; width:100%; }
|
||||
fieldset.inner>div.output>div.project div.zone div.action>div.item>i { position:absolute; padding:4px; }
|
||||
fieldset.inner>div.output>div.project div.zone div.action>div.item>i { position:absolute; padding:4px 6px; }
|
||||
fieldset.inner>div.output>div.project div.zone div.action>div.item>input { padding-left:25px; width:100%; }
|
||||
fieldset.inner>div.output>div.project div.zone div.action>div.item>span.delete { font-size:20px; }
|
||||
fieldset.inner>div.output>div.project { box-shadow:var(--box-shadow); }
|
||||
|
@ -61,11 +61,21 @@ Volcanos(chat.ONFIGURE, {
|
||||
var link = can.misc.ParseURL(can, arg); if (link.pod) { can.onimport.tabview(can, "", link.pod, web.SPACE), sub.Update(); return }
|
||||
can.onimport.tabview(can, "", arg, web.SPACE)
|
||||
}
|
||||
sub.onexport.record = function(sub, value, key) { can.onimport.tabview(can, "", value, web.SPACE) }
|
||||
sub.onexport.record = function(sub, value, key) {
|
||||
can.onimport.tabview(can, "", value, web.SPACE)
|
||||
}
|
||||
can.page.Select(can, sub._output, html.DIV_ITEM, function(target, index) { can.onappend.style(can, msg.status[index], target) })
|
||||
}) },
|
||||
repos: function(can, target, zone) { can.onimport._zone(can, zone, {index: web.CODE_GIT_SEARCH, args: ["repos"], style: html.OUTPUT, mode: mdb.ZONE}, function(sub, msg) {
|
||||
sub.onexport.record = function(sub, value, key, data) {
|
||||
can.user.opens(data.html_url)
|
||||
}
|
||||
}) },
|
||||
})
|
||||
Volcanos(chat.ONACTION, {list: ["编译", "构建", "路由", "终端", "源码", "文档", "计划", "流程", "桌面", "后台", "官网"],
|
||||
Volcanos(chat.ONACTION, {list: [
|
||||
"构建", "编译", "终端", "路由",
|
||||
"源码", "文档", "计划", "流程",
|
||||
"后台", "桌面", "官网"],
|
||||
_trans: {show: "预览", exec: "展示"},
|
||||
_run: function(event, can, button, args, cb) { can.runAction(event, button, args, cb||function(msg) { can.onimport.tabview(can, msg.Option(nfs.PATH), msg.Option(nfs.FILE)), can.user.toastSuccess(can, button), can.ui.zone.source.refresh() }) },
|
||||
_runs: function(event, can, button, cb) { var meta = can.Conf(); can.request(event, {action: button}), can.user.input(event, can, meta.feature[button], function(args) { can.onaction._run(event, can, button, args, cb) }) },
|
||||
@ -98,17 +108,21 @@ Volcanos(chat.ONACTION, {list: ["编译", "构建", "路由", "终端", "源码"
|
||||
can.onimport.toolkit(can, {index: data.index, args: can.core.Split(data.args||"")}, function(sub) { can.db.toolkit[list.join(",")] = sub.select() })
|
||||
}) },
|
||||
"扩展": function(event, can) { can.user.input(can.request(event, {action: "extension"}), can, ["url"], function(list) { var sub = can.db.toolkit[list[0]]; sub? sub.select(): can.onimport.exts(can, list[0]) }) },
|
||||
|
||||
"构建": function(event, can) { can.onimport.tabview(can, "", web.CODE_COMPILE, ctx.INDEX) },
|
||||
"编译": function(event, can) { can.onaction.compile(event, can, code.COMPILE) },
|
||||
"终端": function(event, can) { can.user.input(can.request(event, {action: "xterm"}), can, [mdb.TYPE], function(args) { can.onimport.tabview(can, "", [web.CODE_XTERM, args[1]||"ish"].join(mdb.FS), ctx.INDEX) }) },
|
||||
"路由": function(event, can) { can.onimport.tabview(can, "", web.ROUTE, ctx.INDEX) },
|
||||
"构建": function(event, can) { can.onimport.tabview(can, "", web.CODE_COMPILE, ctx.INDEX) },
|
||||
|
||||
"源码": function(event, can) { can.onimport.tabview(can, "", web.CODE_GIT_STATUS, ctx.INDEX) },
|
||||
"文档": function(event, can) { can.onimport.tabview(can, "", web.WIKI_WORD, ctx.INDEX) },
|
||||
"计划": function(event, can) { can.onimport.tabview(can, "", web.TEAM_PLAN, ctx.INDEX) },
|
||||
"流程": function(event, can) { can.onimport.tabview(can, "", web.CHAT_FLOWS, ctx.INDEX) },
|
||||
"桌面": function(event, can) { can.onimport.tabview(can, "", web.CHAT_MACOS_DESKTOP, ctx.INDEX) },
|
||||
|
||||
"后台": function(event, can) { var pod = can.misc.Search(can, ice.POD); can.onimport.tabview(can, "", location.origin+"/chat/portal/"+(pod? "?pod="+pod: ""), web.SPACE) },
|
||||
"桌面": function(event, can) { can.onimport.tabview(can, "", web.CHAT_MACOS_DESKTOP, ctx.INDEX) },
|
||||
"官网": function(event, can) { can.onimport.tabview(can, "", can.misc.MergePodCmd(can, {cmd: web.WIKI_PORTAL}), web.SPACE) },
|
||||
|
||||
insertLine: function(can, value, before) { var line = can.onaction.appendLine(can, value); before && can.ui.content.insertBefore(line, can.onaction._getLine(can, before)); return can.onaction.rerankLine(can), can.onexport.line(can, line) },
|
||||
deleteLine: function(can, line) { line = can.onaction._getLine(can, line); var next = line.nextSibling||line.previousSibling; return can.page.Remove(can, line), can.onaction.rerankLine(can), next },
|
||||
_selectLine: function(can) { can.current && can.page.Select(can, can.current.line, "td.text", function(td) { var target = can.ui.current; target.value = td.innerText
|
||||
|
@ -19,14 +19,14 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
can.onimport.layout = function() { can.onlayout.expand(can, can._output, 320) }
|
||||
},
|
||||
_vimer_zone: function(can, msg, target) { msg.Table(function(value) { var action = can.page.parseAction(can, value)
|
||||
can.onimport.item(can, {name: can.page.Color(value[can.Conf(mdb.FIELD)||mdb.VIEW]||value[mdb.NAME]||value[mdb.TEXT]||value[mdb.TYPE]), title: value[mdb.TEXT]}, function(event) {
|
||||
can.onimport.item(can, {icon: value.icon||value.avatar_url, name: can.page.Color(value[can.Conf(mdb.FIELD)||mdb.VIEW]||value[mdb.NAME]||value[mdb.TEXT]||value[mdb.TYPE]), title: value[mdb.TEXT]}, function(event) {
|
||||
can.sup.onexport.record(can, value.name, mdb.NAME, value, event)
|
||||
}, function() { return shy(action, function(event, button, meta, carte) { can.misc.Event(event, can, function(msg) { carte.close()
|
||||
can.sup.onexport.action(can, button, value) || can.run(event, [ctx.ACTION, button], function(msg) { can.sup.onimport._process(can.sup, msg) || can.Update() })
|
||||
}, value) }) })
|
||||
}) },
|
||||
_zone: function(can, zone, index, cb, field) { zone._delay_init = function() { can.onimport.plug(can, {index: index, style: html.OUTPUT, mode: mdb.ZONE, field: field}, function(sub) {
|
||||
sub.run = function(event, cmds, cb) { can.runActionCommand(can.request(event, {mode: mdb.ZONE}), index, cmds, cb) }
|
||||
_zone: function(can, zone, index, cb, field) { zone._delay_init = function() { can.onimport.plug(can, can.base.isObject(index)? index: {index: index, style: html.OUTPUT, mode: mdb.ZONE, field: field}, function(sub) {
|
||||
sub.run = function(event, cmds, cb) { can.runActionCommand(can.request(event, {mode: mdb.ZONE}), index.index||index, cmds, cb) }
|
||||
zone._icon(kit.Dict(
|
||||
can.page.unicode.refresh, function(event) { sub.Update(event) },
|
||||
"+", function(event) { sub.Update(event, [ctx.ACTION, mdb.CREATE]) },
|
||||
@ -119,7 +119,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
}}, "", target)
|
||||
},
|
||||
item: function(can, item, cb, cbs, target) { target = target||(can.ui && can.ui.project? can.ui.project: can._output)
|
||||
var ui = can.page.Append(can, target, [{view: html.ITEM, list: [item.icon && {icon: item.icon}, {text: item.nick||item.name||item.zone}], title: item.title, onclick: function(event) {
|
||||
var ui = can.page.Append(can, target, [{view: html.ITEM, list: [
|
||||
item.icon && (can.base.contains(item.icon, "http", ".png", ".jpg")? {img: item.icon}: {icon: item.icon}),
|
||||
{text: item.nick||item.name||item.zone}], title: item.title, onclick: function(event) {
|
||||
can.onmotion.select(can, target, html.DIV_ITEM, event.currentTarget)
|
||||
cb(event, event.currentTarget, event.currentTarget._list && can.onmotion.toggle(can, event.currentTarget._list))
|
||||
}, oncontextmenu: function(event) {
|
||||
@ -179,7 +181,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
status.appendChild(sub._legend), sub._legend.oncontextmenu = sub._legend.onclick, sub._legend.onclick = function(event) { can.misc.Event(event, can, function(msg) {
|
||||
if (can.page.SelectOne(can, status, nfs.PT+html.SELECT, function(target) { can.onmotion.hidden(can, target._target), can.page.ClassList.del(can, target, html.SELECT); return target }) == sub._legend) { return }
|
||||
sub.onimport.size(sub, can.ConfHeight()/2, (can.ConfWidth()-(can.ui && can.ui.project? can.ui.project.offsetWidth: 0))/2)
|
||||
can.onmotion.select(can, status, html.LEGEND, sub._legend), can.onmotion.toggle(can, sub._target, true), sub.Focus()
|
||||
can.onmotion.select(can, status, html.LEGEND, sub._legend), can.onmotion.toggle(can, sub._target, true)
|
||||
// sub.Focus()
|
||||
if (sub._delay_init || meta.msg) { sub._delay_init = false, meta.msg = false, sub.Update() }
|
||||
}) }, sub._delay_init = true, sub.onaction.close = function() { sub.select() }, sub.select = function(show) {
|
||||
if (show && can.page.ClassList.has(can, sub._legend, html.SELECT)) { return sub }
|
||||
|
1
proto.js
1
proto.js
@ -95,6 +95,7 @@ var Volcanos = shy({
|
||||
isSimpleMode: function() { return can.Mode() == chat.SIMPLE },
|
||||
isFloatMode: function() { return can.Mode() == chat.FLOAT },
|
||||
isFullMode: function() { return can.Mode() == chat.FULL },
|
||||
isZoneMode: function() { return can.Mode() == "zone" },
|
||||
isCmdMode: function() { return can.Mode() == chat.CMD },
|
||||
isAutoMode: function() { return can.Mode() == "" },
|
||||
Mode: function(value) { return can.Conf(ice.MODE, value) },
|
||||
|
Loading…
x
Reference in New Issue
Block a user