efront 3.7.5 → 3.7.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.
Files changed (42) hide show
  1. package/apps/kugou/api.js +1 -1
  2. package/apps/kugou/index.html +3 -0
  3. package/apps/pivot/api.yml +2 -2
  4. package/apps/pivot/auth/login.js +0 -1
  5. package/apps/pivot/link/list.html +2 -2
  6. package/apps/pivot/link/list.js +6 -6
  7. package/apps/pivot/link/list.less +5 -0
  8. package/apps/pivot/menu.yml +9 -5
  9. package/apps/pivot/task/edit.js +1 -0
  10. package/apps/pivot/task/list.js +6 -0
  11. package/apps/pivot/tick/list.js +5 -0
  12. package/apps/pivot/token/edit.js +1 -10
  13. package/apps/pivot/token/list.js +2 -9
  14. package/coms/crypt/encode62.js +1 -1
  15. package/coms/frame/list.js +36 -34
  16. package/coms/frame/list.less +3 -1
  17. package/coms/kugou/buildScroll.less +3 -0
  18. package/coms/pivot/pedit.js +13 -0
  19. package/coms/pivot/plist.js +13 -0
  20. package/coms/zimoli/LoadingArray.js +27 -0
  21. package/coms/zimoli/bggrid-func.less +16 -0
  22. package/coms/zimoli/color.js +18 -4
  23. package/coms/zimoli/colorlabel.js +3 -2
  24. package/coms/zimoli/colorlabel.less +24 -3
  25. package/coms/zimoli/colorpad.html +4 -0
  26. package/coms/zimoli/colorpad.js +120 -103
  27. package/coms/zimoli/colorpad.less +49 -47
  28. package/coms/zimoli/colorpicker.js +1 -1
  29. package/coms/zimoli/data.js +13 -1
  30. package/coms/zimoli/model.js +22 -2
  31. package/coms/zimoli/popup.js +2 -2
  32. package/coms/zimoli/render.js +2 -1
  33. package/coms/zimoli/select.js +3 -3
  34. package/coms/zimoli/selectList.js +35 -24
  35. package/coms/zimoli/selectList.less +4 -0
  36. package/coms/zimoli/selectListEdit.js +0 -1
  37. package/coms/zimoli/swap.less +1 -1
  38. package/coms/zimoli/table.html +2 -2
  39. package/coms/zimoli/table.js +1 -0
  40. package/package.json +1 -1
  41. package/public/efront.js +1 -1
  42. package/coms/zimoli/LoadingArray.ts +0 -14
package/apps/kugou/api.js CHANGED
@@ -12,7 +12,7 @@
12
12
  "singer-list": "get:[].singer-img-list>li singer/list/:id#href=a!href&=a!href\\singer-info&imgurl=img!_src&name=p|innerText",
13
13
  "singer-info": "mget:[].singer-songs-list>li singer/info/:id#hash=!id&singer=.singer-name|innerText&name=.song-name|innerText&data=em/innerText"
14
14
  },
15
- "https://mobilecdn.kugou.com/": {
15
+ "http://mobilecdn.kugou.com/": {
16
16
  "search?keyword": "get:data.info api/v3/search/song?format=json&page=1&pagesize=30&showtype=1"
17
17
  }
18
18
  })
@@ -17,6 +17,9 @@
17
17
  <script>
18
18
  cross_host = 'efront.cc';
19
19
  </script>
20
+ <script deleteoncompile>
21
+ cross_host = '';
22
+ </script>
20
23
  <style>
21
24
  *,
22
25
  ::before,
@@ -4,5 +4,5 @@
4
4
  share: options ::share-:opt?:path
5
5
  folder: options ::file-:opt:::path?:to
6
6
  cluster: options ::cluster-:opt?:id
7
- private-list: options ::private
8
- private-edit: options ::private-:key?:value
7
+ list: options :::type
8
+ edit: options :::type-:key?:value
@@ -4,7 +4,6 @@ var fields = refilm`
4
4
  服务器地址/host* select?a ${hosts}
5
5
  密码/password* password
6
6
  `;
7
- console.log(fields)
8
7
  function main() {
9
8
  var page = view();
10
9
  page.innerHTML = login;
@@ -1,5 +1,5 @@
1
1
  <div class="clusters">
2
- <a -repeat="(c,i) in clusters" @click="active(i)">
2
+ <a -repeat="(c,i) in clusters" ng-class="{current:i===index}" @click="active(i,c)">
3
3
  <span -text="c"></span>
4
4
  </a>
5
5
  </div>
@@ -7,6 +7,6 @@
7
7
  <padding>
8
8
  <span -text=c.id></span>
9
9
  <span class="time" -text=filterTime(c.optime)></span>
10
-
10
+
11
11
  </padding>
12
12
  </lattice>
@@ -3,21 +3,21 @@ function main() {
3
3
  page.innerHTML = template;
4
4
  renderWithDefaults(page, {
5
5
  async load() {
6
- var cs = this.clusters = data.from("cluster", { opt: "list" });
7
- await cs.loading_promise;
6
+ this.clusters = data.from("cluster", { opt: "list" });
7
+ await this.clusters;
8
8
  this.active();
9
9
  },
10
- index: 0,
10
+ index: data.getInstance("index").index || 0,
11
11
  clusters: [],
12
12
  filterTime(d) {
13
13
  return ((new Date - d) / 1000 | 0) + "秒";
14
14
  },
15
15
  clients: [],
16
- async active() {
17
- var index = this.index;
16
+ active(index = this.index) {
17
+ data.setInstance('index', { index });
18
18
  var clusters = this.clusters;
19
19
  if (index >= clusters.length) index = clusters.length - 1;
20
- this.clients = data.lazyInstance("cluster", { opt: "list", id: clusters[index] });
20
+ this.clients = data.from("cluster", { opt: "list", id: clusters[index] });
21
21
  },
22
22
  });
23
23
  page.$scope.load();
@@ -6,4 +6,9 @@
6
6
 
7
7
  .time {
8
8
  color: #bbb;
9
+ }
10
+
11
+ .button.current {
12
+ background: #28c;
13
+ color: #fff;
9
14
  }
@@ -1,7 +1,11 @@
1
1
  首页: /home/welcome
2
- 共享目录管理: /share/list
3
- 短链接: /home/short
4
- WEB文件管理: /wow/root
5
- 长连接管理: /link/list
6
- 密钥管理: /token/list
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");
@@ -0,0 +1,6 @@
1
+ plist.bind(null, '任务管理', "task", refilm`
2
+ *任务ID/key 100
3
+ *任务名/name 100
4
+ *启用/status swap [关闭,开启]
5
+ 任务代码/code text
6
+ `, '/task/edit');
@@ -0,0 +1,5 @@
1
+ function main() {
2
+ var a = div();
3
+ a.innerHTML = "定时任务管理,敬请期待";
4
+ return a;
5
+ }
@@ -1,10 +1 @@
1
- frame$edit.bind(null, "密钥", {
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");
@@ -1,13 +1,6 @@
1
- frame$list.bind(null, "密钥管理", {
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
- `}, "/token/edit");
6
+ `, "/token/edit");
@@ -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
  }
@@ -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() {
@@ -10,7 +10,9 @@ btn {
10
10
  table {
11
11
 
12
12
  td {
13
- >span {
13
+
14
+ >span,
15
+ >model {
14
16
  white-space: normal;
15
17
  word-break: break-all;
16
18
  overflow: hidden;
@@ -7,6 +7,9 @@
7
7
  top: 0;
8
8
  height: auto;
9
9
  }
10
+ &+.titlebar>back{
11
+ height: 44px;
12
+ }
10
13
 
11
14
  >png {
12
15
  width: 100%;
@@ -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
+ }
@@ -0,0 +1,27 @@
1
+ // class LoadingArray extends Array {
2
+ // totalCount = 0;
3
+ // data = [];
4
+ // is_errored = null;
5
+ // error_message = null;
6
+ // is_loading = true;
7
+ // is_loaded = false;
8
+ // is_readonly = null;
9
+ // loading = null;
10
+ // loading_promise = null;
11
+ // then (ok, oh) {
12
+ // if (this.loading_promise) this.loading_promise.then(ok, oh);
13
+ // }
14
+ // }
15
+ function LoadingArray() {
16
+ var this0 = [];
17
+ this0.totalCount = 0;
18
+ this0.data = [];
19
+ this0.is_errored = null;
20
+ this0.error_message = null;
21
+ this0.is_loading = true;
22
+ this0.is_loaded = false;
23
+ this0.is_readonly = null;
24
+ this0.loading = null;
25
+ this0.loading_promise = null;
26
+ return this0;
27
+ };
@@ -0,0 +1,16 @@
1
+ .grid() {
2
+ @mask-color1 : rgba(255, 255, 255, .6);
3
+ @mask-color2 : rgba(0, 0, 0, 0);
4
+ @mask-color3 : rgba(0, 0, 0, .1);
5
+ background-image:
6
+ linear-gradient(45deg, @mask-color1, 25%, @mask-color1, 25%, @mask-color2, 75%, @mask-color1, 75%, @mask-color1),
7
+ linear-gradient(45deg, @mask-color1, 25%, @mask-color1, 25%, @mask-color2, 75%, @mask-color1, 75%, @mask-color1),
8
+ linear-gradient(45deg, @mask-color3, 25%, @mask-color3, 25%, @mask-color2, 75%, @mask-color3, 75%, @mask-color3),
9
+ linear-gradient(45deg, @mask-color3, 25%, @mask-color3, 25%, @mask-color2, 75%, @mask-color3, 75%, @mask-color3);
10
+ background-size: 20px 20px;
11
+ background-position: 0 0, 10px 10px, 10px 0, 0 10px;
12
+ background-repeat: repeat;
13
+ background-clip: border-box;
14
+ background-color: #fff;
15
+
16
+ }
@@ -215,14 +215,24 @@ function hsl2rgb([h, s, l]) {
215
215
  var b = h - 1 / 3;
216
216
  return [r, g, b].map(t => t2rgb(t, p, q));
217
217
  }
218
+ function percent(a) {
219
+ if (/%$/.test(a)) {
220
+ a = a.replace(/%$/, '') / 100;
221
+ }
222
+ return +a;
223
+ }
218
224
  function parse(color) {
219
225
  if (hslReg.test(color)) {
220
226
  var [_, H, S, L, a] = hslReg.exec(color);
227
+ H = parseFloat(H);
228
+ S = percent(S);
229
+ L = percent(L);
230
+ a = percent(a);
221
231
  [R, G, B] = hsl2rgb([H, S, L]);
222
232
  return [R, G, B, a || 1];
223
233
  } else if (rgbReg.test(color)) {
224
234
  var [_, R, G, B, a] = rgbReg.exec(color);
225
- return [R > 255 ? 255 : R, G > 255 ? 255 : G, B > 255 ? 255 : B, a || 1];
235
+ return [R > 255 ? 255 : +R, G > 255 ? 255 : +G, B > 255 ? 255 : +B, a ? +a : 1];
226
236
  } else if (rgbHex.test(color)) {
227
237
  var [_, R, G, B, A] = rgbHex.exec(color).map(a => parseInt(a + a, 16));
228
238
  return [R, G, B, A >= 0 ? A / 0xff : 1];
@@ -234,6 +244,10 @@ function parse(color) {
234
244
  function stringify(color) {
235
245
  var [R, G, B, a] = color;
236
246
  if (a >= 0 && a < 1) {
247
+ R = R.toFixed();
248
+ G = G.toFixed();
249
+ B = B.toFixed();
250
+ a = +a.toFixed(3);
237
251
  return `rgba(${R},${G},${B},${a})`;
238
252
  } else {
239
253
  return "#" + [R, G, B].map(hex256).join("");
@@ -291,12 +305,12 @@ function equal(c1, c2) {
291
305
  var [r2, g2, b2, a2] = parse(c2);
292
306
  return abs(r1 - r2) < 1 && abs(g1 - g2) < 1 && abs(b1 - b2) < 1 && abs(a1 - a2) < .01;
293
307
  }
294
- var hslReg = /^hsla?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:,\s*([\d\.]+))?\)$/i;
295
- var rgbReg = /^rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:,\s*([\d\.]+))?\)$/i;
308
+ var hslReg = /^hsla?\s*\(\s*([\d\.]+(?:deg)?)\s*[,\s]\s*([\d\.]+%?)\s*[,\s]\s*([\d\.]+%?)(?:[,\/\s]\s*([\d\.]+%?))?\)$/i;
309
+ var rgbReg = /^rgba?\s*\(\s*([\d\.]+)\s*[,\s]\s*([\d\.]+)\s*[,\s]\s*([\d\.]+)(?:[,\s]\s*([\d\.]+))?\)$/i;
296
310
  var rgbHex = /^#([\da-f])([\da-f])([\da-f])([\da-f])?$/i;
297
311
  var rgbHex2 = /^#([\da-f]{2})([\da-f]{2})([\da-f]{2})([\da-f]{2})?$/i;
298
312
  var rotated_base_color = "#d16969";
299
- var colorReg = /rgba?\s*\([\,\.\d]+\)|#[\da-f]{3,8}/ig;
313
+ var colorReg = /(?:rgb|hsl)a?\s*\([\,\.\d\s%]+\)|#[\da-f]{3,8}/ig;
300
314
  function isColor(text) {
301
315
  return rgbReg.test(text) || rgbHex.test(text) || rgbHex2.test(text) || hslReg.test(text);
302
316
  }
@@ -1,6 +1,7 @@
1
1
  function main(elem = div()) {
2
- care(elem, function (color) {
3
- css(this, 'background', color);
2
+ care(elem, function (c) {
3
+ css(this, 'background-color', c);
4
+ css(this, 'color', color.pair(c));
4
5
  });
5
6
  return elem;
6
7
  }
@@ -1,7 +1,28 @@
1
1
  & {
2
- width: 40px;
2
+ width: 180px;
3
3
  height: 20px;
4
- background: #ccc;
5
4
  display: inline-block;
5
+ text-align: center;
6
+ font-size: 10px;
7
+ line-height: 20px;
8
+ position: relative;
9
+ .grid();
10
+ background-color: transparent;
6
11
 
7
- }
12
+ >option {
13
+ position: relative;
14
+ }
15
+
16
+ &:before {
17
+ position: absolute;
18
+ left: 0;
19
+ top: 0;
20
+ right: 0;
21
+ bottom: 0;
22
+ content: "";
23
+ display: block;
24
+ background-color: inherit;
25
+ }
26
+ }
27
+
28
+ @import "./bggrid-func.less";
@@ -7,6 +7,10 @@
7
7
  <canvas></canvas>
8
8
  <pointer tabindex="-1"></pointer>
9
9
  </div>
10
+ <div class="opa">
11
+ <canvas></canvas>
12
+ <pointer tabindex="-1"></pointer>
13
+ </div>
10
14
  <div class="val">
11
15
  <input class="hex" />
12
16
  <input class="rgb" />