mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
b746f10c4e
commit
44de6ad232
@ -118,6 +118,12 @@ Volcanos("base", {help: "数据类型",
|
|||||||
endWith: function(str, end) {
|
endWith: function(str, end) {
|
||||||
return str.lastIndexOf(end) + end.length == str.length
|
return str.lastIndexOf(end) + end.length == str.length
|
||||||
},
|
},
|
||||||
|
trimPrefix: function(str, pre) {
|
||||||
|
if (str.indexOf(pre) == -1) {
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
return str.slice(pre.length)
|
||||||
|
},
|
||||||
trimSuffix: function(str, end) {
|
trimSuffix: function(str, end) {
|
||||||
if (str.indexOf(end) == -1) {
|
if (str.indexOf(end) == -1) {
|
||||||
return str
|
return str
|
||||||
|
@ -102,7 +102,7 @@ Volcanos({name: "chat", panels: [
|
|||||||
}},
|
}},
|
||||||
profile: {name: "测试群", storm: {
|
profile: {name: "测试群", storm: {
|
||||||
release: {name: "发布 release", index: [
|
release: {name: "发布 release", index: [
|
||||||
"web.code.publish", "web.code.compile", "web.code.autogen",
|
"web.code.publish", "web.code.compile", "web.code.autogen", "web.code.git.server",
|
||||||
]},
|
]},
|
||||||
research: {name: "测试 research", index: [
|
research: {name: "测试 research", index: [
|
||||||
"web.code.favor", "web.code.bench", "web.code.pprof",
|
"web.code.favor", "web.code.bench", "web.code.pprof",
|
||||||
@ -111,7 +111,7 @@ Volcanos({name: "chat", panels: [
|
|||||||
}},
|
}},
|
||||||
operate: {name: "运维群", storm: {
|
operate: {name: "运维群", storm: {
|
||||||
aaa: {name: "权限 aaa", index: [
|
aaa: {name: "权限 aaa", index: [
|
||||||
"user", "sess", "role", "totp",
|
"user", "sess", "totp",
|
||||||
]},
|
]},
|
||||||
web: {name: "应用 web", index: [
|
web: {name: "应用 web", index: [
|
||||||
"spide", "route", "share", "dream",
|
"spide", "route", "share", "dream",
|
||||||
|
@ -3,10 +3,10 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
|||||||
if (msg.Option("branch")) { return can.onappend.table(can, msg) }
|
if (msg.Option("branch")) { return can.onappend.table(can, msg) }
|
||||||
|
|
||||||
can._args = can.base.Copy({root: "root", field: nfs.PATH, split: ice.PS}, can.base.ParseURL(can._display))
|
can._args = can.base.Copy({root: "root", field: nfs.PATH, split: ice.PS}, can.base.ParseURL(can._display))
|
||||||
|
can.dir_root = msg.Option(nfs.DIR_ROOT)||can._args.root||""
|
||||||
can._tree = can.onimport._tree(can, msg.Table(), can._args.field, can._args.split)
|
can._tree = can.onimport._tree(can, msg.Table(), can._args.field, can._args.split)
|
||||||
if (!can._tree[""]) { return }
|
if (!can._tree[""]) { return }
|
||||||
can.dir_root = msg.Option(nfs.DIR_ROOT)||can._args.root
|
can._tree[""].name = can._args.root||can.dir_root.split(ice.PS).slice(-2)[0]
|
||||||
can._tree[""].name = can.dir_root.split(ice.PS).slice(-2)[0]
|
|
||||||
|
|
||||||
can.size = 30, can.margin = 30
|
can.size = 30, can.margin = 30
|
||||||
can.require(["/plugin/local/wiki/draw.js", "/plugin/local/wiki/draw/path.js"], function() {
|
can.require(["/plugin/local/wiki/draw.js", "/plugin/local/wiki/draw/path.js"], function() {
|
||||||
@ -18,8 +18,8 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
|||||||
},
|
},
|
||||||
|
|
||||||
_tree: function(can, list, field, split) {
|
_tree: function(can, list, field, split) {
|
||||||
var node = {}; can.core.List(list, function(item) {
|
var node = {}; can.core.List(list, function(item) { if (!item[field]) { return }
|
||||||
item[field] && can.core.List(item[field].split(split), function(value, index, array) {
|
can.core.List(can.base.trimPrefix(item[field], can.dir_root+can._args.split).split(split), function(value, index, array) {
|
||||||
var last = array.slice(0, index).join(split)||"", name = array.slice(0, index+1).join(split)
|
var last = array.slice(0, index).join(split)||"", name = array.slice(0, index+1).join(split)
|
||||||
if (!value || node[name]) { return }
|
if (!value || node[name]) { return }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user