efront 4.22.7 → 4.22.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/#/345/233/275/351/231/205/345/214/226.yml +36 -0
- package/apps/kugou/home.less +12 -0
- package/apps/pivot/api.yml +6 -2
- package/apps/pivot/db/config.xht +3 -1
- package/coms/basic/Table.js +2 -1
- package/coms/basic/data.js +5 -3
- package/coms/basic/mark.js +8 -2
- package/coms/basic/writeLEB128.js +1 -1
- package/coms/frame/route.js +11 -1
- package/coms/layer/glance.js +1 -1
- package/coms/pivot/checkGeo.js +31 -4
- package/coms/zimoli/checkbox.less +1 -1
- package/coms/zimoli/marker.js +15 -2
- package/coms/zimoli/marker_test.js +24 -0
- package/coms/zimoli/table.js +1 -0
- package/coms/zimoli/zimoli.js +119 -75
- package/coms/zimoli/zimoli.md +3 -0
- package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +28 -28
- package/package.json +1 -1
- package/public/efront.js +1 -1
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
- zh-CN: 此数据不可查询!
|
|
2
|
+
en: This data is not searchable!
|
|
3
|
+
|
|
4
|
+
- zh-CN: 不可查询私有数据!
|
|
5
|
+
en: Cannot query private data!
|
|
6
|
+
|
|
7
|
+
- zh-CN: 此数据不可枚举
|
|
8
|
+
en: This data cannot be enumerated
|
|
9
|
+
|
|
10
|
+
- zh-CN: 您无权访问此数据!
|
|
11
|
+
en: You do not have access to this data!
|
|
12
|
+
|
|
13
|
+
- zh-CN: 商品id
|
|
14
|
+
en: Product ID
|
|
15
|
+
|
|
16
|
+
- zh-CN: 商品名称
|
|
17
|
+
en: Product name
|
|
18
|
+
|
|
19
|
+
- zh-CN: 包含
|
|
20
|
+
en: contain
|
|
21
|
+
|
|
22
|
+
- zh-CN: 商品简述
|
|
23
|
+
en: Product Description
|
|
24
|
+
|
|
25
|
+
- zh-CN: 商品展示
|
|
26
|
+
en: Product Display
|
|
27
|
+
|
|
28
|
+
- zh-CN: 允许所有人检索全部内容
|
|
29
|
+
en: Allow everyone to retrieve all content
|
|
30
|
+
|
|
31
|
+
- zh-CN: 用户互访
|
|
32
|
+
en: User mutual visits
|
|
33
|
+
|
|
34
|
+
- zh-CN: 不公开时检查此项
|
|
35
|
+
en: Check this item when not publicly available
|
|
36
|
+
|
|
1
37
|
- zh-CN: 退出登录
|
|
2
38
|
en: Log Out
|
|
3
39
|
|
package/apps/kugou/home.less
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
padding-right: 60px;
|
|
15
15
|
cursor: default;
|
|
16
16
|
white-space: nowrap;
|
|
17
|
+
width: auto;
|
|
17
18
|
|
|
18
19
|
>tag {
|
|
19
20
|
width: 25%;
|
|
@@ -94,6 +95,17 @@
|
|
|
94
95
|
font-size: 16px;
|
|
95
96
|
width: auto;
|
|
96
97
|
background: inherit;
|
|
98
|
+
|
|
99
|
+
&:before {
|
|
100
|
+
content: "";
|
|
101
|
+
z-index: 1;
|
|
102
|
+
position: absolute;
|
|
103
|
+
right: 0;
|
|
104
|
+
top: 0;
|
|
105
|
+
bottom: 0;
|
|
106
|
+
width: 16px;
|
|
107
|
+
display: block;
|
|
108
|
+
}
|
|
97
109
|
}
|
|
98
110
|
|
|
99
111
|
.search-box {
|
package/apps/pivot/api.yml
CHANGED
|
@@ -34,8 +34,12 @@
|
|
|
34
34
|
unique-save: options ::unique-:data
|
|
35
35
|
recert: options ::recert
|
|
36
36
|
upload: put :path
|
|
37
|
-
https://
|
|
38
|
-
|
|
37
|
+
https://api.map.baidu.com/:
|
|
38
|
+
ipbaidu: get location/ip
|
|
39
|
+
https://restapi.amap.com/:
|
|
40
|
+
ipgaode: get v3/ip
|
|
41
|
+
https://www.ip.cn/ referer=https://www.ipshudi.com/&Cookie=:empty:
|
|
42
|
+
ipcn: get#tab0_address ip/:ip.html#address=!innerText
|
|
39
43
|
# https://ipchaxun.com/ :
|
|
40
44
|
# iplocation: get:[].info%20label:nth-child(n+2)>span:nth-child(2) :ip/
|
|
41
45
|
# https://www.ip138.com/:
|
package/apps/pivot/db/config.xht
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
border: 1px solid #999;
|
|
29
29
|
padding: 4px 10px;
|
|
30
30
|
height: 60px;
|
|
31
|
+
|
|
31
32
|
[a-key] {
|
|
32
33
|
font-family: 20px;
|
|
33
34
|
font-style: italic;
|
|
@@ -67,7 +68,8 @@
|
|
|
67
68
|
动作管理
|
|
68
69
|
`;
|
|
69
70
|
var fields = refilm`
|
|
70
|
-
是否公开/open swap
|
|
71
|
+
是否公开/open swap // 允许所有人检索全部内容
|
|
72
|
+
(用户互访/visit/,open=false) swap // 不公开时检查此项`;
|
|
71
73
|
var [db] = arguments;
|
|
72
74
|
if (!db.fields) {
|
|
73
75
|
var [da1] = await data.from('dbfind', { dbid: db.name, size: 1 });
|
package/coms/basic/Table.js
CHANGED
|
@@ -26,6 +26,7 @@ class Table extends Array {
|
|
|
26
26
|
$filterFields = [];
|
|
27
27
|
$unsummaryFileds = [];
|
|
28
28
|
callback = null;
|
|
29
|
+
heightLight = undefined;
|
|
29
30
|
static from(fields, data) {
|
|
30
31
|
var t = new Table;
|
|
31
32
|
t.fields = fields;
|
|
@@ -120,7 +121,7 @@ class Table extends Array {
|
|
|
120
121
|
var name = seek(o, f.key);
|
|
121
122
|
if (isEmpty(name) || !isString(name)) continue;
|
|
122
123
|
if (name === searchtext) this.hasFullmatch = true;
|
|
123
|
-
var [p, m] = mark.power(name, searchtext);
|
|
124
|
+
var [p, m] = mark.power(name, searchtext, this.heightLight);
|
|
124
125
|
if (p > power) power = p;
|
|
125
126
|
if (!isEmpty(f.key) && !isFunction(f.key)) o[f.key] = m;
|
|
126
127
|
else o.name = m, o.toString = returnName, o.valueOf = returnName;
|
package/coms/basic/data.js
CHANGED
|
@@ -604,14 +604,16 @@ var privates = {
|
|
|
604
604
|
return getApi(serviceId, this.getConfigPromise());
|
|
605
605
|
},
|
|
606
606
|
prepare(method, url, params) {
|
|
607
|
-
var spliterIndex = /[
|
|
607
|
+
var spliterIndex = /[\:\|\/\~\!\?\#\.\[]/.exec(method), search;
|
|
608
608
|
if (spliterIndex) spliterIndex = spliterIndex.index;
|
|
609
609
|
else spliterIndex = method.length;
|
|
610
610
|
var coinmethod = method.slice(0, spliterIndex).toLowerCase();
|
|
611
|
-
var realmethod = coinmethod.replace(/\W
|
|
611
|
+
var realmethod = coinmethod.replace(/\W[\s\S]*$/g, '');
|
|
612
612
|
var [uri, rest, baseuri, search] = prepareURL(url, params);
|
|
613
613
|
if (params && rest.length) rest.forEach(r => delete params[r]);
|
|
614
|
-
|
|
614
|
+
var selector = method.slice(spliterIndex);
|
|
615
|
+
if (!/^(?:[\.\#\[]|\:(?:nth|first|last)\-child)/.test(selector)) selector = selector.slice(1);
|
|
616
|
+
return { method: realmethod, coinmethod, selector, search, baseuri, uri, params };
|
|
615
617
|
},
|
|
616
618
|
loadIgnoreConfig(method, url, params1, api) {
|
|
617
619
|
var headers = api && api.headers;
|
package/coms/basic/mark.js
CHANGED
|
@@ -80,10 +80,16 @@ var pair = function (source, search, t1, t2, t3, t4) {
|
|
|
80
80
|
return power2(source, search);
|
|
81
81
|
}
|
|
82
82
|
var searchText = '';
|
|
83
|
-
var
|
|
83
|
+
var concat1 = function (pre, match, aft) {
|
|
84
|
+
return pre.concat(MARK_PRE1, match, MARK_AFT1, aft);
|
|
85
|
+
};
|
|
86
|
+
var power = function (source, search, concat_me) {
|
|
84
87
|
searchText = search;
|
|
88
|
+
var concat_ = concat1;
|
|
89
|
+
if (concat_me) concat1 = concat_me;
|
|
85
90
|
var res = power_(source, search);
|
|
86
91
|
searchText = '';
|
|
92
|
+
concat1 = concat_;
|
|
87
93
|
return res;
|
|
88
94
|
};
|
|
89
95
|
var power_p = function () { };
|
|
@@ -140,7 +146,7 @@ var power_ = function (source, search, func, mp) {
|
|
|
140
146
|
else if (ap >= p) {
|
|
141
147
|
p += ap / source.length / search.length * .01 - .2;
|
|
142
148
|
}
|
|
143
|
-
return [p, match_text_pre
|
|
149
|
+
return [p, concat1(match_text_pre, match_text, match_text_aft)];
|
|
144
150
|
}
|
|
145
151
|
return [0, source];
|
|
146
152
|
};
|
package/coms/frame/route.js
CHANGED
|
@@ -78,6 +78,7 @@
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
|
+
var firstMenu = null;
|
|
81
82
|
var parseMenuList = function (items) {
|
|
82
83
|
if (items instanceof Array) {
|
|
83
84
|
if (!items[0] || !items[0].name) {
|
|
@@ -123,6 +124,7 @@
|
|
|
123
124
|
result.update = function (items) {
|
|
124
125
|
delete result.loading_promise;
|
|
125
126
|
delete result.then;
|
|
127
|
+
firstMenu = null;
|
|
126
128
|
items = result.parse(items);
|
|
127
129
|
items.map(getChildren);
|
|
128
130
|
var opened = data.getInstance("menu-opened");
|
|
@@ -131,11 +133,13 @@
|
|
|
131
133
|
historys.forEach((a, i) => map[a] = i + 1);
|
|
132
134
|
result.splice(0, result.length);
|
|
133
135
|
var actived, actived_value = 0;
|
|
136
|
+
var zimoilPath = zimoli.getInitPath();
|
|
134
137
|
var a = function (menu) {
|
|
135
138
|
var res = checkroles(user.roles, menu.roles);
|
|
136
139
|
if (res) {
|
|
137
140
|
if (savedChildren[menu.id] instanceof Array) menu.children = savedChildren[menu.id].filter(a);
|
|
138
141
|
if (menu.path) {
|
|
142
|
+
if (!firstMenu || menu.path === zimoilPath) firstMenu = menu;
|
|
139
143
|
if (map[menu.path] > actived_value) {
|
|
140
144
|
actived = menu;
|
|
141
145
|
actived_value = map[menu.path];
|
|
@@ -189,11 +193,17 @@
|
|
|
189
193
|
oped.active = menu.id;
|
|
190
194
|
data.setInstance('menu-opened', oped);
|
|
191
195
|
}
|
|
196
|
+
first_opened = true;
|
|
192
197
|
});
|
|
193
198
|
result.open = function (menu) {
|
|
194
199
|
if (!menu) {
|
|
195
200
|
if (first_opened && result.active) return;
|
|
196
|
-
menu = result.active ||
|
|
201
|
+
menu = result.active || firstMenu;
|
|
202
|
+
if (!menu?.path) return;
|
|
203
|
+
first_opened = true;
|
|
204
|
+
zimoli.switch(null, null, menu);
|
|
205
|
+
zimoli();
|
|
206
|
+
return;
|
|
197
207
|
}
|
|
198
208
|
if (!menu.path) {
|
|
199
209
|
menu.closed = !menu.closed;
|
package/coms/layer/glance.js
CHANGED
package/coms/pivot/checkGeo.js
CHANGED
|
@@ -1,11 +1,38 @@
|
|
|
1
|
+
var md5 = docs$md5;
|
|
2
|
+
var baidu = function (ip) {
|
|
3
|
+
var query = {
|
|
4
|
+
ip,
|
|
5
|
+
ak: "lPiUBf6CCdZtLzrbzYREa6liU0NycJyr"
|
|
6
|
+
};
|
|
7
|
+
query.sn = md5(encodeURIComponent("/location/ip?" + serialize(query)) + "dZtaNhMkjlDmxAot0uYs2fEJKvTi3REe");
|
|
8
|
+
return data.from("ipbaidu", query);
|
|
9
|
+
};
|
|
10
|
+
var gaode = function (ip) {
|
|
11
|
+
var query = {
|
|
12
|
+
ip,
|
|
13
|
+
key: 'e360c7487575c81c617a42d00edea1fb'
|
|
14
|
+
};
|
|
15
|
+
query.sig = md5(serialize(query) + "a9b7a9509b47169bde38dfa825898ff8");
|
|
16
|
+
return data.from("ipgaode", query);
|
|
17
|
+
};
|
|
1
18
|
return async function (a) {
|
|
2
19
|
var ip = a.ip || a.remote;
|
|
3
20
|
var m = /(\d+\.){3}\d+$/.exec(ip);
|
|
4
|
-
|
|
21
|
+
ip = m ? m[0] : ip;
|
|
22
|
+
var res = await data.from("ipcn", { ip });
|
|
23
|
+
console.log(res)
|
|
24
|
+
if (!res.address && !res.data) res = await baidu(ip);
|
|
25
|
+
var msg = '加载错误';
|
|
26
|
+
if (res.message && !res.data && !res.content && !res.address) {
|
|
27
|
+
msg = res.message;
|
|
28
|
+
res = await gaode(ip);
|
|
29
|
+
}
|
|
5
30
|
if (res.data) res = res.data;
|
|
31
|
+
if (res.content) res = res.content;
|
|
6
32
|
if (res.address) res = res.address;
|
|
7
|
-
else if (res.country || res.isp) {
|
|
8
|
-
res = [res.country, res.province, res.city, res.district, res.isp].join('
|
|
33
|
+
else if (res.country || res.province || res.city || res.isp) {
|
|
34
|
+
res = [res.country, res.province, res.city, res.district, res.isp].join('');
|
|
9
35
|
}
|
|
10
|
-
|
|
36
|
+
if (!res) alert(msg, 'warn');
|
|
37
|
+
a.address = res || msg;
|
|
11
38
|
}
|
package/coms/zimoli/marker.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
+
var b = function (match) {
|
|
2
|
+
var b = document.createElement('b');
|
|
3
|
+
b.innerText = match;
|
|
4
|
+
return b;
|
|
5
|
+
};
|
|
6
|
+
var wrap = function (pre, match, aft) {
|
|
7
|
+
return [].concat(pre, b(match), aft);
|
|
8
|
+
};
|
|
1
9
|
function marker(e) {
|
|
2
10
|
if (!e) e = document.createElement("marker");
|
|
3
11
|
on("changes")(e, function () {
|
|
4
|
-
e.
|
|
12
|
+
remove(e.childNodes);
|
|
13
|
+
if (isEmpty(this.source)) return;
|
|
14
|
+
var source = mark(this.source, this.search, wrap);
|
|
15
|
+
if (isArray(source)) appendChild(this, source);
|
|
16
|
+
else this.innerText = source;
|
|
5
17
|
});
|
|
6
18
|
return e;
|
|
7
|
-
}
|
|
19
|
+
}
|
|
20
|
+
marker.wrap = wrap;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var test_wrap = function (data, search) {
|
|
2
|
+
var wrap = mark.wrap;
|
|
3
|
+
var startTime = Date.now();
|
|
4
|
+
for (var cx = 0, dx = 10000; cx < dx; cx++) {
|
|
5
|
+
for (var d of data) {
|
|
6
|
+
mark(d, search, wrap);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
var spendTime = (Date.now() - startTime);
|
|
10
|
+
console.log('用时', spendTime);
|
|
11
|
+
}
|
|
12
|
+
var testData = [
|
|
13
|
+
"efront.cc/baiplay/bp",
|
|
14
|
+
"chat.efront.cc/baiplay/aa",
|
|
15
|
+
"baiplay.efront.cc/baiplay/aa",
|
|
16
|
+
"baiplay.efront.cc/baiplay/cc",
|
|
17
|
+
"ipv4.efront.cc/baiplay/dd",
|
|
18
|
+
"ipv6.efront.cc/baiplay/ff",
|
|
19
|
+
"baiplay.cn/baiplay/ee",
|
|
20
|
+
"baidu.com/baiplay/gg",
|
|
21
|
+
];
|
|
22
|
+
return function () {
|
|
23
|
+
test_wrap(testData, 'bai');
|
|
24
|
+
}
|