efront 3.7.6 → 3.7.7
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/apps/pivot/api.yml +2 -2
- package/apps/pivot/menu.yml +9 -5
- package/apps/pivot/task/edit.js +1 -0
- package/apps/pivot/task/list.js +6 -0
- package/apps/pivot/tick/list.js +5 -0
- package/apps/pivot/token/edit.js +1 -10
- package/apps/pivot/token/list.js +2 -9
- package/coms/crypt/encode62.js +1 -1
- package/coms/frame/list.js +36 -34
- package/coms/frame/list.less +3 -1
- package/coms/pivot/pedit.js +13 -0
- package/coms/pivot/plist.js +13 -0
- package/coms/zimoli/model.js +22 -2
- package/coms/zimoli/render.js +2 -1
- package/coms/zimoli/swap.less +1 -1
- package/coms/zimoli/table.html +2 -2
- package/coms/zimoli/table.js +1 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/apps/pivot/api.yml
CHANGED
package/apps/pivot/menu.yml
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
首页: /home/welcome
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
WEB:
|
|
3
|
+
共享目录: /share/list
|
|
4
|
+
短链接: /home/short
|
|
5
|
+
文件管理: /wow/root
|
|
6
|
+
长连接管理: /link/list
|
|
7
|
+
任务:
|
|
8
|
+
密钥管理: /token/list
|
|
9
|
+
任务建立: /task/list
|
|
10
|
+
定期执行: /tick/list
|
|
7
11
|
# 用户列表: /user/list
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pedit.bind(null, "任务", "task");
|
package/apps/pivot/token/edit.js
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
submit(a, fields) {
|
|
3
|
-
a = submit(fields, a);
|
|
4
|
-
return data.from("private-edit", {
|
|
5
|
-
key: encode62.timeencode(a.key),
|
|
6
|
-
value: encode62.timeencode(JSON.stringify(a)),
|
|
7
|
-
}).loading_promise;
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
});
|
|
1
|
+
pedit.bind(null, "密钥", "private");
|
package/apps/pivot/token/list.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
load() {
|
|
3
|
-
return data.from("private-list", a => JSAM.parse(encode62.timedecode(a)));
|
|
4
|
-
},
|
|
5
|
-
remove(o) {
|
|
6
|
-
return data.from("private-edit", { key: encode62.timeencode(o.key), value: encode62.timeencode("") }).loading_promise;
|
|
7
|
-
},
|
|
8
|
-
fields: refilm`
|
|
1
|
+
plist.bind(null, '密钥管理', "private", refilm`
|
|
9
2
|
*键名/key 100
|
|
10
3
|
显示名/name input/300
|
|
11
4
|
密钥/value text/100
|
|
12
5
|
备注/comment text/200
|
|
13
|
-
|
|
6
|
+
`, "/token/edit");
|
package/coms/crypt/encode62.js
CHANGED
|
@@ -79,7 +79,7 @@ Object.assign(encode62, {
|
|
|
79
79
|
for (var cx = 0, dx = data.length; cx < dx; cx++) {
|
|
80
80
|
if (result[cx] < 128) result[cx] = result[cx] ^ sign[cx % sign.length];
|
|
81
81
|
else if (result[cx] < 192) {
|
|
82
|
-
var c = c << 8 | sign[(delta += 6) / 8 | 0];
|
|
82
|
+
var c = c << 8 | sign[(delta += 6) / 8 % sign.length | 0];
|
|
83
83
|
result[cx] = result[cx] ^ (c >> 8 - delta % 8 & 0x3f);
|
|
84
84
|
}
|
|
85
85
|
}
|
package/coms/frame/list.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function main(title, { fields, load, remove }, edit_ref) {
|
|
1
|
+
function main(title, { fields, options: options0, load, remove }, edit_ref) {
|
|
2
2
|
prepare(edit_ref);
|
|
3
3
|
var page = document.createElement("div");
|
|
4
4
|
var edit = function (o) {
|
|
@@ -11,6 +11,40 @@ function main(title, { fields, load, remove }, edit_ref) {
|
|
|
11
11
|
})
|
|
12
12
|
};
|
|
13
13
|
page.innerHTML = template;
|
|
14
|
+
var options = [
|
|
15
|
+
{
|
|
16
|
+
name: "修改",
|
|
17
|
+
do(o) {
|
|
18
|
+
edit(o);
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
type: "danger",
|
|
23
|
+
name(o) {
|
|
24
|
+
return this.confirm === o ? "确认删除" : "删除";
|
|
25
|
+
},
|
|
26
|
+
type(o) {
|
|
27
|
+
return this.confirm === o ? "dark" : "danger";
|
|
28
|
+
},
|
|
29
|
+
confirm: false,
|
|
30
|
+
timer: 0,
|
|
31
|
+
async do(o) {
|
|
32
|
+
if (this.confirm !== o) {
|
|
33
|
+
this.confirm = o;
|
|
34
|
+
clearTimeout(this.timer);
|
|
35
|
+
var that = this;
|
|
36
|
+
this.timer = setTimeout(function () {
|
|
37
|
+
that.confirm = null;
|
|
38
|
+
render.refresh();
|
|
39
|
+
}, 2000);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
await remove(o);
|
|
43
|
+
page.$scope.load();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
if (options0) options = options.concat(options0);
|
|
14
48
|
renderWithDefaults(page, {
|
|
15
49
|
title,
|
|
16
50
|
load() {
|
|
@@ -18,39 +52,7 @@ function main(title, { fields, load, remove }, edit_ref) {
|
|
|
18
52
|
},
|
|
19
53
|
fields: fields.concat({
|
|
20
54
|
name: "操作",
|
|
21
|
-
options
|
|
22
|
-
{
|
|
23
|
-
name: "修改",
|
|
24
|
-
do(o) {
|
|
25
|
-
edit(o);
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
type: "danger",
|
|
30
|
-
name(o) {
|
|
31
|
-
return this.confirm === o ? "确认删除" : "删除";
|
|
32
|
-
},
|
|
33
|
-
type(o) {
|
|
34
|
-
return this.confirm === o ? "dark" : "danger";
|
|
35
|
-
},
|
|
36
|
-
confirm: false,
|
|
37
|
-
timer: 0,
|
|
38
|
-
async do(o) {
|
|
39
|
-
if (this.confirm !== o) {
|
|
40
|
-
this.confirm = o;
|
|
41
|
-
clearTimeout(this.timer);
|
|
42
|
-
var that = this;
|
|
43
|
-
this.timer = setTimeout(function () {
|
|
44
|
-
that.confirm = null;
|
|
45
|
-
render.refresh();
|
|
46
|
-
}, 2000);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
await remove(o);
|
|
50
|
-
page.$scope.load();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
]
|
|
55
|
+
options
|
|
54
56
|
}),
|
|
55
57
|
data: [],
|
|
56
58
|
add() {
|
package/coms/frame/list.less
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function main(title, type, params) {
|
|
2
|
+
return frame$edit(title, {
|
|
3
|
+
submit(a, fields) {
|
|
4
|
+
a = submit(fields, a);
|
|
5
|
+
return data.from("edit", {
|
|
6
|
+
type,
|
|
7
|
+
key: encode62.timeencode(a.key),
|
|
8
|
+
value: encode62.timeencode(JSON.stringify(a)),
|
|
9
|
+
}).loading_promise;
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
}, params);
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
function main(title, type, fields, edit_ref, options) {
|
|
3
|
+
return frame$list(title, {
|
|
4
|
+
load() {
|
|
5
|
+
return data.from("list", { type }, a => JSAM.parse(encode62.timedecode(a)));
|
|
6
|
+
},
|
|
7
|
+
remove(o) {
|
|
8
|
+
return data.from("edit", { type, key: encode62.timeencode(o.key), value: encode62.timeencode("") }).loading_promise;
|
|
9
|
+
},
|
|
10
|
+
fields,
|
|
11
|
+
options,
|
|
12
|
+
}, edit_ref);
|
|
13
|
+
}
|
package/coms/zimoli/model.js
CHANGED
|
@@ -37,6 +37,17 @@ var renderModel = function (field, data) {
|
|
|
37
37
|
var constructors = {
|
|
38
38
|
input,
|
|
39
39
|
raw: input,
|
|
40
|
+
swap(e) {
|
|
41
|
+
var { field } = e;
|
|
42
|
+
e = swap(e);
|
|
43
|
+
if (field.options) {
|
|
44
|
+
e.getValue = function () {
|
|
45
|
+
return field.options[+this.checked].value;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return e;
|
|
49
|
+
},
|
|
50
|
+
switch: swap,
|
|
40
51
|
row: textarea,
|
|
41
52
|
password,
|
|
42
53
|
text: textarea,
|
|
@@ -134,8 +145,18 @@ var readonly_types = {
|
|
|
134
145
|
"size"({ field }, data) {
|
|
135
146
|
var f = data[field.key];
|
|
136
147
|
return size(f);
|
|
137
|
-
}
|
|
148
|
+
},
|
|
149
|
+
swap(e, data) {
|
|
150
|
+
var { field } = e;
|
|
151
|
+
var v = data[field.key];
|
|
152
|
+
if (field.options) {
|
|
153
|
+
var o = field.options[v];
|
|
154
|
+
if (o) return o.name;
|
|
155
|
+
}
|
|
156
|
+
return v;
|
|
157
|
+
},
|
|
138
158
|
};
|
|
159
|
+
readonly_types.select = readonly_types.swap;
|
|
139
160
|
function main(elem) {
|
|
140
161
|
var build = function () {
|
|
141
162
|
var { data, readonly, field } = elem;
|
|
@@ -222,7 +243,6 @@ function main(elem) {
|
|
|
222
243
|
}
|
|
223
244
|
};
|
|
224
245
|
on("changes")(elem, function ({ changes }) {
|
|
225
|
-
|
|
226
246
|
if (changes.data || changes.field || changes.readonly) {
|
|
227
247
|
build();
|
|
228
248
|
}
|
package/coms/zimoli/render.js
CHANGED
|
@@ -565,7 +565,8 @@ function getFromScopes(key, scope, parentScopes) {
|
|
|
565
565
|
if (key in scope) {
|
|
566
566
|
return scope[key];
|
|
567
567
|
}
|
|
568
|
-
if (parentScopes) for (var
|
|
568
|
+
if (parentScopes) for (var cx = parentScopes.length - 1; cx >= 0; cx--) {
|
|
569
|
+
var o = parentScopes[cx];
|
|
569
570
|
if (key in o) {
|
|
570
571
|
return o[key];
|
|
571
572
|
}
|
package/coms/zimoli/swap.less
CHANGED
package/coms/zimoli/table.html
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
<tbody -src="d in data">
|
|
9
9
|
<tr>
|
|
10
10
|
<td -repeat="f in fields">
|
|
11
|
-
<
|
|
12
|
-
<a on-click="o.do(d)" -if="f.options" _type="o.type instanceof Function?o.type(d):o.type"
|
|
11
|
+
<model -if="f.key" :field=f :data=d readonly ></model>
|
|
12
|
+
<a on-click="o.do(d)" -if="!f.key&&f.options" _type="o.type instanceof Function?o.type(d):o.type"
|
|
13
13
|
-repeat="o in f.options">
|
|
14
14
|
<span -text="o.name instanceof Function?o.name(d):o.name"></span>
|
|
15
15
|
</a>
|
package/coms/zimoli/table.js
CHANGED