efront 4.5.8 → 4.5.13

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.
@@ -1,3 +1,12 @@
1
+ - zh-CN: IP地址
2
+ en: IP address
3
+
4
+ - zh-CN: 绑定地址
5
+ en: Bind Address
6
+
7
+ - zh-CN: 证书更新失败!
8
+ en: Certificate update failed!
9
+
1
10
  - zh-CN: 搜索
2
11
  en: Search
3
12
 
@@ -67,8 +76,8 @@
67
76
  - zh-CN: 上次更新时间
68
77
  en: Last update time
69
78
 
70
- - zh-CN: 下次更新时间
71
- en: Next update time
79
+ - zh-CN: 下次更新日期
80
+ en: Next update date
72
81
 
73
82
  - zh-CN: 自动更新周期
74
83
  en: Automatic update cycle
@@ -11,21 +11,20 @@
11
11
  <script>
12
12
  var form = view;
13
13
  var a = button;
14
- var fields = refilm`$上次更新时间/lastUpdateTime date
15
- 下次更新时间/nextUpdateTime date
14
+ var fields = refilm`$上次更新时间/lastUpdateTime datetime
15
+ 下次更新日期/nextUpdateTime date
16
16
  自动更新周期/schadulePeriod 天/int
17
17
  是否开启计划/schaduleEnabled swap
18
18
  `;
19
19
  var page = this;
20
20
  var [{ saveUnique, setauth, uploadOnly }] = arguments;
21
21
  var autoUpdate = async function () {
22
- var o = await acme2.autoUpdate(acme2.domain, setauth, uploadOnly);
23
- await saveUnique();
22
+ var o = await acme2.autoUpdate(saveUnique, acme2.domain, setauth, uploadOnly);
24
23
  if (o.status === 'valid') {
25
24
  alert(i18n`证书已更新!`, "success");
26
25
  }
27
26
  else {
28
- alert(i18n`更新失败!`, 'error');
27
+ alert(i18n`证书更新失败!`, 'error');
29
28
  }
30
29
  };
31
30
  var saveSchadule = async function () {
@@ -1,63 +1,50 @@
1
1
  cross.addDirect(/^https?\:\/\/([[a-z\.\d\:\/%]+\]|[\d\.]+)(\:\d+)?\//);
2
+ var checkPort = async function (p, ip) {
3
+ if (!p.host) {
4
+ if (/^::ffff:\d+\.\d+\.\d+\.\d+$/i.test(ip)) {
5
+ ip = ip.slice(7);
6
+ }
7
+ else {
8
+ ip = `[${ip}]`;
9
+ }
10
+ p.locate(ip);
11
+ }
12
+ try {
13
+ p.locate("/:version");
14
+ var { response } = await cross("options", p.href);
15
+ if (/^efront/.test(response)) {
16
+ p.ok = true;
17
+ }
18
+ } catch (e) {
19
+ p.error = e;
20
+ }
21
+
22
+ }
2
23
  var fields = refilm`
3
- 地址/ip
4
- 地理位置/ip ${function (e) {
5
- var ip = e.data[e.field.key];
24
+ IP地址/ip text/120
25
+ 地理位置/address/查看 act/80 ${async function (a) {
26
+ var ip = a.ip;
6
27
  var m = /(\d+\.){3}\d+$/.exec(ip);
7
- if (m) {
8
- var l = document.createElement('label');
9
- appendChild(e, l);
10
- l.innerHTML = '&nbsp;';
11
- var setAddress = function (a) {
12
- l.innerText = a;
13
- };
14
- if (e.data.address) setAddress(e.data.address);
15
- else e.data.address = data.from("iplocation", { ip: m[0] }, function (a) {
16
- setAddress(a.address);
17
- return a.address;
18
- });
19
- }
20
- return e;
28
+ var { address } = await data.from("iplocation", { ip: m ? m[0] : ip });
29
+ a.address = address;
21
30
  }}
22
31
  启动时间/time ${function (e) {
23
32
  e.innerHTML = filterTime(e.data[e.field.key]);
24
33
  }}
25
- 端口/port ${async function (e) {
34
+ 绑定地址/port 120/${async function (e) {
26
35
  var { data, field } = e;
27
- var ports = data[field.key].split(/,/);
28
- var loaded = data.loaded || ports;
29
- data.loaded = loaded;
30
- e.innerHTML = loaded.join(' ');
31
- if (data.loaded === ports) for (let cx = 0, dx = ports.length; cx < dx; cx++) {
32
- var p = ports[cx];
33
- var p0 = p;
34
- var protocol = /^https/.test(p) ? "https://" : "http://";
35
- p = p.replace(/[^\d]+/g, '');
36
- if (p) p = ":" + p;
37
- try {
38
- var ip = data.ip;
39
- if (!ip) return;
40
- if (/^::ffff:\d+\.\d+\.\d+\.\d+$/i.test(ip)) {
41
- ip = ip.slice(7);
42
- }
43
- else {
44
- ip = `[${ip}]`;
45
- }
46
- var xhr = await cross("options", `${protocol}${ip}${p}/:version`);
47
- if (xhr.responseText === 'efront ' + data.version) {
48
- loaded[cx] = (`<span style="color:green">${p0}</span>`);
49
- } else {
50
- loaded[cx] = (`<span style="color:red">${p0}</span>`);
51
- }
52
- } catch (e) {
53
- loaded[cx] = (`<span style="color:gray">${p0}</span>`);
54
- }
55
- e.innerHTML = loaded.join(' ');
56
- }
36
+ var ports = data[field.key].split(/,/).map(p => parseURL(p));
37
+ e.innerHTML = `<a -repeat="p in ports" @click="checkPort(p,ip)" -class="{ok:p.ok,error:p.error}"><span -bind=p></span></a>`;
38
+ render(e, {
39
+ ports,
40
+ ip: data.ip,
41
+ checkPort,
42
+ })
57
43
  }}
58
44
  版本/version input
59
45
  进程/pid
60
- `;
46
+ `;
47
+
61
48
  function main() {
62
49
  var page = div();
63
50
  page.innerHTML = template;
@@ -8,4 +8,35 @@ model {
8
8
  color: #666;
9
9
  font-size: 9px;
10
10
  }
11
+ }
12
+
13
+ model[type=function] {
14
+ display: inline-block;
15
+
16
+ a {
17
+ text-align: left;
18
+ &.ok {
19
+ color: green;
20
+
21
+ &:after {
22
+ content: "(接通)";
23
+ }
24
+ }
25
+
26
+ &.error {
27
+ &:after {
28
+ content: "(出错)";
29
+ }
30
+
31
+ color: red;
32
+ }
33
+
34
+ &:nth-child(2),
35
+ &:nth-last-child(2) {
36
+ padding: 0;
37
+ line-height: 1.2;
38
+ font-size: 14px;
39
+ display: block;
40
+ }
41
+ }
11
42
  }
@@ -19,7 +19,7 @@ function format(formater) {
19
19
  o.D = o.d;
20
20
  o.H = o.h;
21
21
  o.Day = v[v.length - 1];
22
- formater.replace(/[yY年]+|[M月]+|[hH时]+|毫秒|[m+分]+|[sS]{3}|[Ss秒]+|[星期周天][dD]*|[dD]{3}|[日号dD]+/g, function (m) {
22
+ return formater.replace(/[yY年]+|[M月]+|[hH时]+|毫秒|[m+分]+|[sS]{3}|[Ss秒]+|[星期周天][dD]*|[dD]{3}|[日号dD]+/g, function (m) {
23
23
  if (/^[dD]{3}$/.test(m)) {
24
24
  return o.Day;
25
25
  }
@@ -32,23 +32,23 @@ function format(formater) {
32
32
  var a = m.charAt(0);
33
33
  var v = o[a];
34
34
  }
35
- var l = m.replace(/\W+/g, "");
36
- var b = m.split(/[\w天]+/).map(a => a || fixLength(v, l.length)).join("");
35
+ var l = m.split(/\W+/).map(a => a.length);
36
+ var b = m.split(/[\w天]+/).map((a, i) => l[i] ? a + fixLength(v, l[i]) : a).join('');
37
37
  return b;
38
38
  });
39
39
  }
40
- function filterTime(time, format) {
40
+ function filterTime(time, formater) {
41
41
  if (!isHandled(time)) return '';
42
42
  if (isFinite(time)) time = +time;
43
43
  var value = new Date(time);
44
44
  if (!+value) {
45
45
  return time;
46
46
  }
47
- if (format && !/^[\-\/]+$/.test(format)) {
48
- return format.call(value, format);
47
+ if (formater && !/^[\-\/]+$/.test(formater)) {
48
+ return format.call(value, formater);
49
49
  }
50
- if (format) {
51
- format = format.charAt(0);
50
+ if (formater) {
51
+ formater = format.charAt(0);
52
52
  }
53
53
  var splited = getSplitedDate(value);
54
54
  var now = new Date;
@@ -57,8 +57,8 @@ function filterTime(time, format) {
57
57
  var today = new Date(year1, month1 - 1, date1);
58
58
  var thatday = new Date(year, month - 1, date);
59
59
  var delta = (today - thatday) / 24 / 3600000;
60
- if (minute === 0) var time = hour + "";
61
- else if (minute === 30) time = hour + "点半";
60
+ if (minute === 0 && second === 0) var time = hour + "点整";
61
+ else if (minute === 30 && second === 0) time = hour + "点半";
62
62
  else time = `${hour}:${fixLength(minute)}`;
63
63
  if (delta < 7 && delta > 2) {
64
64
  if (day >= day1) {
@@ -0,0 +1,8 @@
1
+ assert(filterTime(''), ``);
2
+ assert(filterTime(null), '');
3
+ assert(filterTime(undefined), '');
4
+ assert(filterTime("我出生的第二年"), `我出生的第二年`);
5
+ assert(filterTime(new Date(new Date - 100)), `刚刚`);
6
+ assert(filterTime(new Date(new Date - 60000), `h:mm`), "");
7
+ assert(filterTime(new Date(new Date - 86400000), `M月d日 h:mm`), "");
8
+ assert(filterTime(new Date(new Date().setFullYear(new Date().getFullYear() - 1)), `y年M月d日 h:mm`), '');
@@ -610,7 +610,7 @@ function detour(o, ie) {
610
610
  collectProperty(o, text);
611
611
  }
612
612
  if (o.short) {
613
- unshort(o);
613
+ unshort(o, text);
614
614
  }
615
615
  else {
616
616
  o.text = text;
@@ -1478,8 +1478,8 @@ var insertAfter = function (o) {
1478
1478
  if (next) next.prev = o;
1479
1479
  else queue.last = o;
1480
1480
  };
1481
- var unshort = function (o) {
1482
- insertBefore.call(o.queue, o, { text: o.text, short: false, isprop: true, type: PROPERTY }, { text: ':', type: STAMP });
1481
+ var unshort = function (o, text) {
1482
+ insertBefore.call(o.queue, o, { text: text || o.text, short: false, isprop: true, type: PROPERTY }, { text: ':', type: STAMP });
1483
1483
  o.isprop = false;
1484
1484
  o.type = EXPRESS;
1485
1485
  delete o.short;
@@ -317,10 +317,20 @@ var killdec = function (queue, i, getobjname, _var = 'var', killobj, islet) {
317
317
  var a = single(d, '');
318
318
  if (a) {
319
319
  if (index > 0) splice(queue, i++, 0, { type: STAMP, text: ',' });
320
- splice(queue, i, 0, ...a[1], { type: STAMP, text: "=" });
321
- i += 2;
322
320
  var i2 = skipAssignment(queue, i);
323
- killobj(queue.slice(i, i2));
321
+ var restq = splice(queue, i, i2 - i, ...a[1], { type: STAMP, text: "=" });
322
+ killobj(restq);
323
+ if (restq.length === 1) {
324
+ restq = restq[0];
325
+ }
326
+ else {
327
+ restq.entry = "("
328
+ restq.leave = ")";
329
+ restq.type = SCOPED;
330
+ relink(restq);
331
+ }
332
+ splice(queue, i += a[1].length + 1, 0, restq);
333
+ i2 = i + 1;
324
334
  if (!a[2]) var q = scanner2(a[0]);
325
335
  else {
326
336
  var objname = getobjname(0);
@@ -166,7 +166,7 @@ function () {
166
166
  _1 = 'date'; return [1, 0]
167
167
  },
168
168
  function () {
169
- _[_1] = "desc"; _0 = (_); _0 = (_0); return [_0, 2]
169
+ _[_1] = "desc"; _0 = _; return [_0, 2]
170
170
  })
171
171
  var _0, _1 }
172
172
  var _`);
@@ -246,7 +246,7 @@ function () {
246
246
  _2 = !_["done"]; if (!_2) return [2, 0]; _2 = _["value"]; return [_2, 1]
247
247
  },
248
248
  function (_1) {
249
- _2 = _1; o = _2; _2 = (true)
249
+ _2 = _1; o = _2; _2 = true
250
250
  },
251
251
  function () {
252
252
  if (!_2) return [2, 0]; noSymbol; _2 = _0["next"](); return [_2, 1]
@@ -287,13 +287,13 @@ function (_4) {
287
287
  _5 = _4; _1 = _5; _6 = Symbol["iterator"]; _6 = _1[_6]; if (_6) return [1, 0]; _6 = Array["prototype"]; _7 = Symbol["iterator"]; _6 = _6[_7]
288
288
  },
289
289
  function () {
290
- _6 = (_6); _2 = _6["call"](_1); _3 = undefined; _3 = _2["next"](); o = _3["value"]; _3 = _2["next"](); s = _3["value"]; _10 = !_3; if (_10) return [1, 0]; _10 = !_3["done"]
290
+ _2 = _6["call"](_1); _3 = undefined; _3 = _2["next"](); o = _3["value"]; _3 = _2["next"](); s = _3["value"]; _10 = !_3; if (_10) return [1, 0]; _10 = !_3["done"]
291
291
  },
292
292
  function () {
293
- _10 = (_10); if (!_10) return [1, 0]; _10 = _2["return"]; _10 = isFunction(_10); if (!_10) return [1, 0]; _10 = _2["return"]()
293
+ if (!_10) return [1, 0]; _10 = _2["return"]; _10 = isFunction(_10); if (!_10) return [1, 0]; _10 = _2["return"]()
294
294
  },
295
295
  function () {
296
- _3 = _10; _5 = (true)
296
+ _3 = _10; _5 = true
297
297
  },
298
298
  function () {
299
299
  if (!_5) return [2, 0]; noSymbol; _5 = _0["next"](); return [_5, 1]
@@ -341,7 +341,7 @@ function () {
341
341
  _; _0 = 0; return [1, 0]
342
342
  },
343
343
  function () {
344
- _3 = _0 < a["length"]; if (!_3) return [1, 0]; _ = a[_0]; _3 = (true)
344
+ _3 = _0 < a["length"]; if (!_3) return [1, 0]; _ = a[_0]; _3 = true
345
345
  },
346
346
  function () {
347
347
  if (!_3) return [2, 0]; return [_, 3]
@@ -362,7 +362,7 @@ function () {
362
362
  _0 = _2; _0 = _0["call"](b); _ = _0["next"](); return [1, 0]
363
363
  },
364
364
  function () {
365
- _2 = !_["done"]; if (!_2) return [1, 0]; a = _["value"]; _2 = (true)
365
+ _2 = !_["done"]; if (!_2) return [1, 0]; a = _["value"]; _2 = true
366
366
  },
367
367
  function () {
368
368
  if (!_2) return [1, 0]; Symbol; _ = _0["next"](); return [-1, 0]
@@ -416,3 +416,11 @@ function () {
416
416
  _1 = getRequestProtocol(url); _0 = _1 + "//", location = _0 + location; return [1, 0]
417
417
  })
418
418
  var _0, _1 }`);
419
+ assert(downLevel("var{a}=await b"), `return async_(
420
+ function () {
421
+ _0 = b; return [_0, 1]
422
+ },
423
+ function (_) {
424
+ _0 = _; _0 = _0.a; a = _0
425
+ })
426
+ var a, _0`)
@@ -403,14 +403,14 @@ var patchstep = function (r, nextindex, h) {
403
403
  x = rescan`if (${name}) return [${nextindex}, 0]`;
404
404
  }
405
405
  else if (o === RD) {
406
- x = rescan`if (${name}!== null && ${name}!== undefined) return [${nextindex}, 0]`;
406
+ x = rescan`if (${name}!= null) return [${nextindex}, 0]`;
407
407
  }
408
408
  else continue;
409
409
  changed = true;
410
- var p = o.prev;
410
+ var p = r[i - 1];
411
411
  if (!p || p.type === STAMP && p.text === ";");
412
412
  else x.unshift({ type: STAMP, text: ";" });
413
- var n = o.next;
413
+ var n = r[i + 1];
414
414
  if (!n || n.type === STAMP && n.text === ';');
415
415
  else x.push({ type: STAMP, text: ';' });
416
416
  r.splice(i, 1, ...x);
@@ -504,6 +504,16 @@ var ispropcall = function (o) {
504
504
  if (o.type === SCOPED && o.entry === '[' && snapExpressHead(o) !== o) return true;
505
505
  return false;
506
506
  };
507
+ var isAequalA = function (q) {
508
+ if (q.length < 3) return false;
509
+ if (!q.first) relink(q);
510
+ var f = q.first;
511
+ var t = q.last;
512
+ if (!f || !t || f.next !== t.prev) return false;
513
+ var m = f.next;
514
+ if (f.type !== EXPRESS || t.type !== EXPRESS || m.type !== STAMP) return false;
515
+ return f.text === t.text && m.text === '=';
516
+ }
507
517
  var _invoke = function (t, getname) {
508
518
  var nameindex = 0;
509
519
  var getdeepname = function (deep = 0) {
@@ -531,9 +541,13 @@ var _invoke = function (t, getname) {
531
541
  continue;
532
542
  }
533
543
  if (needbreak(o)) {
544
+
534
545
  var s = splice(t, bx, cx + 1 - bx);
535
546
  if (cx > 0) s.name = [cloneNode(s[0])];
536
547
  else s.name = qname;
548
+ if (isAequalA(s.slice(0, s.length - 1))) {
549
+ s.splice(0, s.length - 1);
550
+ }
537
551
  queue.push(s);
538
552
  cx = bx - 1;
539
553
  bx = cx + 1;
@@ -591,8 +605,10 @@ var _invoke = function (t, getname) {
591
605
  cache.push(...q);
592
606
  nameindex++;
593
607
  }
608
+ if (iseval && o.entry === "(" && o.length === 1 && canbeOnce(o)) {
609
+ splice(t, cx, 1, o = o[0]);
610
+ }
594
611
  nameindex = _nameindex;
595
- // if (!cache.length) continue;
596
612
  if (queue.length) flushqueue(result, queue), queue = [];
597
613
  if (cache.length) flushqueue(result, cache), cache = [];
598
614
  var n = o.next;
@@ -602,11 +618,18 @@ var _invoke = function (t, getname) {
602
618
  var h = snapExpressHead(o);
603
619
  var hx = t.lastIndexOf(h, cx);
604
620
  var fs = splice(t, hx, cx + 1 - hx, { type: EXPRESS, text: getname(nameindex) });
605
- fs.unshift(...scanner2(`${getname(nameindex)}=`));
606
- relink(fs);
607
- fs.name = [{ text: getname(nameindex), type: EXPRESS }];
608
- pushstep(result, fs);
609
621
  cx = hx - 1;
622
+ a: {
623
+ if (fs.length === 1 && canbeTemp(fs)) {
624
+ if (fs[0].text === getname(nameindex)) {
625
+ break a;
626
+ }
627
+ }
628
+ fs.unshift(...scanner2(`${getname(nameindex)}=`));
629
+ relink(fs);
630
+ fs.name = [{ text: getname(nameindex), type: EXPRESS }];
631
+ pushstep(result, fs);
632
+ }
610
633
  }
611
634
  if (!lastlink) nameindex++;
612
635
  }
@@ -617,13 +640,15 @@ var _invoke = function (t, getname) {
617
640
  flushqueue(result, queue);
618
641
  }
619
642
  else if (t.length) {
620
- var t0 = t[0];
621
- if (t0.type === EXPRESS && /^[\.\[]/.test(t0.text) || t0.type & (STAMP | STRAP) && powermap[t0.text] < powermap.new) {
622
- t.unshift(...rescan(`${qname}=${qname}`));
623
- relink(t);
643
+ if (!isAequalA(t)) {
644
+ var t0 = t[0];
645
+ if (t0.type === EXPRESS && /^[\.\[]/.test(t0.text) || t0.type & (STAMP | STRAP) && powermap[t0.text] < powermap.new) {
646
+ t.unshift(...rescan(`${qname}=${qname}`));
647
+ relink(t);
648
+ }
649
+ t = uncurve(t);
650
+ pushstep(result, t);
624
651
  }
625
- t = uncurve(t);
626
- pushstep(result, t);
627
652
  }
628
653
  if (ret_) patchresult(result, 0);
629
654
  return result;
@@ -711,7 +736,10 @@ var popexp = function (explist) {
711
736
  return [asn, n];
712
737
  }
713
738
  var uncurve = function (c) {
714
- if (c.length === 1 && c[0].type === SCOPED && c[0].entry === '(' && canbeOnce(c[0])) c = c[0];
739
+ if (c.length === 1) {
740
+ var c0 = c[0];
741
+ if (c0.type === SCOPED && c0.entry === '(' && canbeOnce(c0)) c = c0;
742
+ }
715
743
  return c;
716
744
  };
717
745
  var ternary = function (body, getname, ret) {
@@ -68,7 +68,7 @@ test("for(;;)", "return [0, 0]", true);
68
68
  test("for(a in b)", "for (a in b)", true);
69
69
  test("for(a of b)", "for (a of b)", true);
70
70
  test("for await(a of b)", "for await (a of b)", true);
71
- test("for(a = os[Symbol.iterator] || os[Symbol.asyncIterator] || Array.prototype[Symbol.iterator], a = a.call(os), b = a.next(); !b.done && (o = b.value, true); b = a.next())", "_ = Symbol.iterator; _ = os[_]; if (_) return [1, 0]; _ = Symbol.asyncIterator; _ = os[_]; if (_) return [1, 0]; _ = Symbol.iterator; _ = Array.prototype[_];\r\n a = _; a = a.call(os); b = a.next(); return [1, 0];\r\n _ = !b.done; if (!_) return [1, 0]; o = b.value; _ = (true);\r\n if (!_) return [1, 0]; b = a.next(); return [-1, 0]", true);
71
+ test("for(a = os[Symbol.iterator] || os[Symbol.asyncIterator] || Array.prototype[Symbol.iterator], a = a.call(os), b = a.next(); !b.done && (o = b.value, true); b = a.next())", "_ = Symbol.iterator; _ = os[_]; if (_) return [1, 0]; _ = Symbol.asyncIterator; _ = os[_]; if (_) return [1, 0]; _ = Symbol.iterator; _ = Array.prototype[_];\r\n a = _; a = a.call(os); b = a.next(); return [1, 0];\r\n _ = !b.done; if (!_) return [1, 0]; o = b.value; _ = true;\r\n if (!_) return [1, 0]; b = a.next(); return [-1, 0]", true);
72
72
  test("for(a=0;a<1;a++)if(a==0)continue\r\n else a=1", `a = 0; return [1, 0];\r\n _ = a < 1; if (!_) return [2, 0]; _ = a == 0; if (_) return [1, 0]; a = 1; return [1, 0];\r\n _ = a++; return [-1, 0]`, true);
73
73
  test("for(a=0;a<1;a++)if(a==0){continue} else {a=1}", `a = 0; return [1, 0];\r\n _ = a < 1; if (!_) return [3, 0]; _ = a == 0; if (!_) return [1, 0]; return [2, 0];\r\n a = 1; return [1, 0];\r\n _ = a++; return [-2, 0]`, true);
74
74
  test("for(a=0;a<1;a++){if(a==0){a=2;continue} else if(b) {a=1;continue} c=3}", `a = 0; return [1, 0];\r\n _ = a < 1; if (!_) return [4, 0]; _ = a == 0; if (!_) return [1, 0]; a = 2; return [3, 0];\r\n if (!b) return [1, 0]; a = 1; return [2, 0];\r\n c = 3; return [1, 0];\r\n _ = a++; return [-3, 0]`, true);
@@ -102,7 +102,7 @@ test("if(a) a = 1;function* a(){}", "a = function* a() {}; if (!a) return [1, 0]
102
102
  test("await new Promise(function(){})", '_ = function () {}; _ = new Promise(_); return [_, 1]', true);
103
103
  test(`onerror({ status: xhr.status, response: "Cookie解析异常!", toString: toResponse })`, '_ = { status: xhr.status, response: "Cookie解析异常!", toString: toResponse }; onerror(_)', true);
104
104
  test(`if (!/^https\\:\\/\\/|^s\\/\\//.test(url)) console.warn("请使用https访问如下路径:" + url)`, '_ = /^https\\:\\/\\/|^s\\/\\//.test(url); if (_) return [1, 0]; _ = "请使用https访问如下路径:" + url; _ = console.warn(_); return [1, 0]', true);
105
- test(`url += (/\\?/.test(url) ? "&" : "?") + datas;`, '_ = /\\?/.test(url); if (!_) return [1, 0]; _ = "&"; return [2, 0];\r\n _ = "?"; return [1, 0];\r\n _ = (_); _ = _ + datas; url = url + _', true);
105
+ test(`url += (/\\?/.test(url) ? "&" : "?") + datas;`, '_ = /\\?/.test(url); if (!_) return [1, 0]; _ = "&"; return [2, 0];\r\n _ = "?"; return [1, 0];\r\n _ = _ + datas; url = url + _', true);
106
106
  test(`a = newname.querySelector("input,textarea").value = c.name.replace(/\\/$/, '')`, `_ = newname.querySelector("input,textarea"); _0 = c.name.replace(/\\/$/, ''); _.value = _0; a = _0`, true);
107
107
  test(`if (selected[f.url]) f.selected = true;`, `_ = f.url; _ = selected[_]; if (!_) return [1, 0]; f.selected = true; return [1, 0]`, true);
108
108
  test(`location.protocol + parseURL(a.b).host `, `_ = a.b; _ = parseURL(_); location.protocol + _.host`, true);
@@ -132,7 +132,7 @@ test("predef[key[1]][key[2]][key[3]]", '_ = key[1]; _ = predef[_]; _0 = key[2];
132
132
  test("[key[1]][key[2]][key[3]]", '_ = key[1]; _ = [_]; _0 = key[2]; _ = _[_0]; _0 = key[3]; _[_0]');
133
133
  test("[key[1]][key[2]]+[key[3]][key[4]]", '_ = key[1]; _ = [_]; _0 = key[2]; _ = _[_0]; _0 = key[3]; _0 = [_0]; _1 = key[4]; _ + _0[_1]');
134
134
  test("if(a)a:{break a}", "if (!a) return [2, 0]; return [1, 0];\r\n return [1, 0]", true);
135
- test("rgb=(rgb<<8|rgb>>16)&0xffffff", "_ = rgb << 8, _0 = rgb >> 16, _ = _ | _0; _ = (_); rgb = _ & 0xffffff", true);
135
+ test("rgb=(rgb<<8|rgb>>16)&0xffffff", "_ = rgb << 8, _0 = rgb >> 16, _ = _ | _0; rgb = _ & 0xffffff", true);
136
136
  test(`if (c) a; else return true; return false`, "if (!c) return [1, 0]; a; return [2, 0];\r\n return [true, 2];\r\n return [false, 2]")
137
137
  test(`switch(a){case a:a=a?1:0;break;case b:a=b;break;}`, "if (a === a) return [1, 0]; if (a === b) return [4, 0]; return [5, 0];\r\n if (!a) return [1, 0]; a = 1; return [2, 0];\r\n a = 0; return [1, 0];\r\n return [2, 0];\r\n a = b; return [1, 0]");
138
138
  test(`a=typeof a!==1`, "_ = typeof a, a = _ !== 1");
@@ -154,4 +154,4 @@ test(`do {var loadcount = 0;} while (loadcount !== 0);`, `loadcount = 0; _ = loa
154
154
  unstruct.debug = true; r++;
155
155
  test("if(a)try{a}catch{};a;", 'if (!a) return [4, 0]; return [1, 7];\r\n a; return [0, 9];\r\n return [1, 9];\r\n return [1, 0];\r\n a');
156
156
  test("url = (o===void 0||o===null?void 0:o.url)", '_ = void 0, _ = o === _; if (_) return [1, 0]; _ = o === null;\r\n if (!_) return [1, 0]; _ = void 0; return [2, 0];\r\n _ = o.url; return [1, 0];\r\n url = _', true);
157
- test("p ? (ishttps ? `https` : `http`).toUpperCase() + i18n`端口` + (ishttps ? ': ' : ': ') + p : ''","if (!p) return [1, 0]; if (!ishttps) return [1, 0]; _0 = `https`; return [2, 0];\r\n _0 = `http`; return [1, 0];\r\n _0 = (_0); _1 = _0.toUpperCase(); _ = _1 + i18n`端口`; if (!ishttps) return [1, 0]; _2 = ': '; return [2, 0];\r\n _2 = ': '; return [1, 0];\r\n _ = _ + (_2), _ = _ + p; return [2, 0];\r\n ''; return [1, 0]")
157
+ test("p ? (ishttps ? `https` : `http`).toUpperCase() + i18n`端口` + (ishttps ? ': ' : ': ') + p : ''","if (!p) return [1, 0]; if (!ishttps) return [1, 0]; _0 = `https`; return [2, 0];\r\n _0 = `http`; return [1, 0];\r\n _1 = _0.toUpperCase(); _ = _1 + i18n`端口`; if (!ishttps) return [1, 0]; _2 = ': '; return [2, 0];\r\n _2 = ': '; return [1, 0];\r\n _ = _ + _2, _ = _ + p; return [2, 0];\r\n ''; return [1, 0]")
@@ -211,7 +211,7 @@ var acme2 = new class {
211
211
  acme2.domain = extra.domain;
212
212
  acme2.termsOfServiceAgreed = extra.termsOfServiceAgreed;
213
213
  acme2.orders = extra.orders;
214
- acme2.lastUpdateTime = parseDate(extra.lastUpdateTime);
214
+ acme2.lastUpdateTime = filterTime(extra.lastUpdateTime, "y-MM-dd hh:mm");
215
215
  acme2.nextUpdateTime = parseDate(extra.nextUpdateTime);
216
216
  acme2.schadulePeriod = +extra.schadulePeriod || 80;
217
217
  acme2.schaduleEnabled = extra.schaduleEnabled;
@@ -351,19 +351,20 @@ var acme2 = new class {
351
351
  upload(o, { oid: o.oid, private: kp[0], public: kp[1] });
352
352
  return o;
353
353
  }
354
- async autoUpdate(domain, setauth, upload) {
354
+ async autoUpdate(saveUnique, domain, setauth, upload) {
355
355
  if (!domain.length) return;
356
356
  if (acme2.orders.length >= 20) acme2.orders.pop();
357
357
  this.lastUpdateTime = parseDate(Date.now());
358
358
  this.updateTime();
359
359
  var o = await acme2.newOrder({ domain });
360
+ await saveUnique();// 及时保存订单信息以便后续查看
360
361
  o = await acme2.getOrder(o);
361
362
  if (o.status === 'pending') {
362
363
  o = await acme2.auditOrder(o, setauth);
363
364
  }
364
365
  if (o.status === 'ready') {
365
366
  await this.finalizeOrder(o, upload);
366
- o = await this.waitStatus();
367
+ o = await this.waitStatus(o);
367
368
  }
368
369
  if (o.status === 'valid') {
369
370
  var cert = await data.fromURL(o.certificate);
@@ -18,7 +18,7 @@ var _create = function (commFactory, className, _invoke) {
18
18
  commFactory.className = className;
19
19
  keys(commFactory).map(k => result[k] = commFactory[k]);
20
20
  result.call = function (context, ...args) {
21
- if (!isEmpty(context)) var release = commFactory.apply(context, args);
21
+ if (isHandled(context)) var release = commFactory.apply(context, args);
22
22
  else release = commFactory.apply(result, args);
23
23
  if (release) release = _invoke(release, className, _invoke);
24
24
  return release;
@@ -7,6 +7,10 @@
7
7
  display: block;
8
8
  }
9
9
 
10
+ model {
11
+ display: inline;
12
+ }
13
+
10
14
  >.head {
11
15
  vertical-align: top;
12
16
 
@@ -257,6 +257,7 @@ var readonly_types = {
257
257
  },
258
258
  };
259
259
  readonly_types.anchor = readonly_types.url;
260
+ readonly_types.do = readonly_types.act = readonly_types.action = constructors.generator;
260
261
  readonly_types.gen = readonly_types.generator = readonly_types.text;
261
262
  var createOptionsMap = function (options) {
262
263
  if (!isObject(options[0])) return options;
@@ -1,5 +1,6 @@
1
1
  & {
2
2
  word-break: break-all;
3
+ display: inline-block;
3
4
  }
4
5
 
5
6
  &[type=date] {
@@ -9,6 +10,10 @@
9
10
  }
10
11
  }
11
12
 
13
+ &[type=gen] {
14
+ font-size: 14px;
15
+ }
16
+
12
17
  &[type=datetime] {
13
18
  >input {
14
19
  width: 10em;
@@ -13,7 +13,7 @@
13
13
  <td fixed row-index -bind="i+1" :style="adapter.firstChild.getAttribute('style')">
14
14
  </td>
15
15
  <td fixed:="f.fixed" -repeat="(f,i) in fields" :style="adapter.children[i+1].getAttribute('style')">
16
- <model -if="!isEmpty(f.key)&&!isEmpty(d[f.key])" :field=f :data=d readonly></model>
16
+ <model -if="!isEmpty(f.key)" :field=f :data=d readonly></model>
17
17
  <template -else>&nbsp;</template>
18
18
  <a on-click="o.do(d)" -if="isEmpty(f.key)&&f.options&&(!o.when||o.when(d))"
19
19
  _type="o.type instanceof Function?o.type(d):o.type" -repeat="o in f.options">
@@ -46,6 +46,10 @@
46
46
  width: 100%;
47
47
  height: 36px;
48
48
  }
49
+ &:last-child {
50
+ float: left;
51
+ }
52
+
49
53
 
50
54
  @media (min-width:800px) {
51
55
  float: right;
@@ -420,7 +424,6 @@
420
424
  if (searchText) filtedData.search(searchText, function () {
421
425
  render.digest();
422
426
  });
423
- console.log(filtedData)
424
427
  };
425
428
  var detailWindow;
426
429
  var detailScope = {