@abtnode/ux 1.16.21-beta-2e75c75c → 1.16.21-beta-da3f852a
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/es/exchange-passport.js +11 -20
- package/es/layout/addon.js +5 -0
- package/es/locales/ar.js +1716 -0
- package/es/locales/de.js +1716 -0
- package/es/locales/en.js +1 -0
- package/es/locales/es.js +1716 -0
- package/es/locales/fr.js +1716 -0
- package/es/locales/hi.js +1716 -0
- package/es/locales/i18n.db +0 -0
- package/es/locales/id.js +1716 -0
- package/es/locales/index.js +29 -2
- package/es/locales/ja.js +1716 -0
- package/es/locales/ko.js +1716 -0
- package/es/locales/pt.js +1716 -0
- package/es/locales/ru.js +1716 -0
- package/es/locales/th.js +1716 -0
- package/es/locales/vi.js +1716 -0
- package/es/locales/zh-tw.js +1716 -0
- package/es/locales/zh.js +16 -6
- package/es/util/index.js +41 -3
- package/lib/exchange-passport.js +14 -10
- package/lib/layout/addon.js +1 -1
- package/lib/locales/ar.js +1722 -0
- package/lib/locales/de.js +1722 -0
- package/lib/locales/en.js +1 -0
- package/lib/locales/es.js +1722 -0
- package/lib/locales/fr.js +1722 -0
- package/lib/locales/hi.js +1722 -0
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +1722 -0
- package/lib/locales/index.js +30 -2
- package/lib/locales/ja.js +1722 -0
- package/lib/locales/ko.js +1722 -0
- package/lib/locales/pt.js +1722 -0
- package/lib/locales/ru.js +1722 -0
- package/lib/locales/th.js +1722 -0
- package/lib/locales/vi.js +1722 -0
- package/lib/locales/zh-tw.js +1722 -0
- package/lib/locales/zh.js +16 -6
- package/lib/util/index.js +43 -2
- package/package.json +15 -15
package/lib/locales/zh.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
/* eslint-disable prettier/prettier */
|
|
7
8
|
var _default = exports.default = {
|
|
8
9
|
setup: {
|
|
9
10
|
connect: {
|
|
@@ -70,7 +71,8 @@ var _default = exports.default = {
|
|
|
70
71
|
scan: '连接 DID 钱包出示 NFT 以换取通行证',
|
|
71
72
|
confirm: '在钱包中选择 NFT',
|
|
72
73
|
success: '通行证换取成功'
|
|
73
|
-
}
|
|
74
|
+
},
|
|
75
|
+
login: '登录'
|
|
74
76
|
},
|
|
75
77
|
payablePassport: {
|
|
76
78
|
title: 'Purchase passport with payment',
|
|
@@ -382,7 +384,8 @@ var _default = exports.default = {
|
|
|
382
384
|
upgradeDescription: '升级基石程序可能会导致其短暂不可用,是否要继续?',
|
|
383
385
|
confirmUpgrade: '是的,升级吧',
|
|
384
386
|
confirmRestart: '是的,重启吧',
|
|
385
|
-
restartDescription: '服务会短暂暂停,并且有可能因为变更了配置无法启动'
|
|
387
|
+
restartDescription: '服务会短暂暂停,并且有可能因为变更了配置无法启动',
|
|
388
|
+
confirmComponentRemove: '是的,刪除它'
|
|
386
389
|
},
|
|
387
390
|
dev: {
|
|
388
391
|
modeTip: '请将节点切换至 DEBUG 模式'
|
|
@@ -813,7 +816,11 @@ var _default = exports.default = {
|
|
|
813
816
|
monitor: {
|
|
814
817
|
diskThreshold: '当磁盘使用率超过(%)时发送报警',
|
|
815
818
|
diskThresholdPlaceholder: '请设置磁盘使用率报警阈值'
|
|
816
|
-
}
|
|
819
|
+
},
|
|
820
|
+
domainRequired: '服务器域名是必需的',
|
|
821
|
+
ipPlaceholder: 'IP',
|
|
822
|
+
ipRequired: 'IP是必需的',
|
|
823
|
+
enableWelcomePage: '启用欢迎页'
|
|
817
824
|
},
|
|
818
825
|
accessKey: {
|
|
819
826
|
accessKeyId: 'Access Key',
|
|
@@ -1075,7 +1082,8 @@ var _default = exports.default = {
|
|
|
1075
1082
|
sourceTypes: {
|
|
1076
1083
|
upload: '通过上传文件',
|
|
1077
1084
|
lets_encrypt: "通过 Let's Encrypt 自动生成"
|
|
1078
|
-
}
|
|
1085
|
+
},
|
|
1086
|
+
source: '來源'
|
|
1079
1087
|
},
|
|
1080
1088
|
detail: {
|
|
1081
1089
|
title: '证书详情'
|
|
@@ -1421,7 +1429,8 @@ var _default = exports.default = {
|
|
|
1421
1429
|
dialog: {
|
|
1422
1430
|
confirm: '在您的 DID 钱包上确认',
|
|
1423
1431
|
success: '通行证已成功添加到您的 DID 钱包',
|
|
1424
|
-
loginWithPassport: '用此通行证连接'
|
|
1432
|
+
loginWithPassport: '用此通行证连接',
|
|
1433
|
+
scan: '使用您的DID钱包来申领护照'
|
|
1425
1434
|
}
|
|
1426
1435
|
},
|
|
1427
1436
|
lostPassport: {
|
|
@@ -1572,7 +1581,8 @@ var _default = exports.default = {
|
|
|
1572
1581
|
switch: {
|
|
1573
1582
|
failedForMismatchSpace: '请连接至正确的 Space{name}'
|
|
1574
1583
|
},
|
|
1575
|
-
connectTo: '连接至 DID Spaces'
|
|
1584
|
+
connectTo: '连接至 DID Spaces',
|
|
1585
|
+
title: '门户'
|
|
1576
1586
|
},
|
|
1577
1587
|
strategy: {
|
|
1578
1588
|
title: '备份策略',
|
package/lib/util/index.js
CHANGED
|
@@ -52,6 +52,7 @@ var _querystring = _interopRequireDefault(require("querystring"));
|
|
|
52
52
|
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
53
53
|
var _axios = _interopRequireDefault(require("@abtnode/util/lib/axios"));
|
|
54
54
|
var _dayjs = _interopRequireDefault(require("@abtnode/util/lib/dayjs"));
|
|
55
|
+
var _tryWithTimeout = _interopRequireDefault(require("@abtnode/util/lib/try-with-timeout"));
|
|
55
56
|
var _formatError = _interopRequireDefault(require("@abtnode/util/lib/format-error"));
|
|
56
57
|
var _normalizePathPrefix = _interopRequireDefault(require("@abtnode/util/lib/normalize-path-prefix"));
|
|
57
58
|
var _urlEvaluation = require("@abtnode/util/lib/url-evaluation");
|
|
@@ -465,12 +466,52 @@ const getPathPrefix = () => window.env && window.env.apiPrefix ? window.env.apiP
|
|
|
465
466
|
exports.getPathPrefix = getPathPrefix;
|
|
466
467
|
const isUrlAccessible = url => (0, _checkAccessibleBrowser.default)((0, _urlJoin.default)(new URL(url).origin, _constant.WELLKNOWN_PING_PREFIX));
|
|
467
468
|
exports.isUrlAccessible = isUrlAccessible;
|
|
469
|
+
const checkBlockletAccessible = async function checkBlockletAccessible(url) {
|
|
470
|
+
let timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5000;
|
|
471
|
+
try {
|
|
472
|
+
var _response$data;
|
|
473
|
+
const urlObj = new URL(url);
|
|
474
|
+
urlObj.protocol = 'https';
|
|
475
|
+
urlObj.pathname = (0, _urlJoin.default)(_constant.WELLKNOWN_BLOCKLET_HEALTH_PATH);
|
|
476
|
+
const response = await _axios.default.get(urlObj.toString(), {
|
|
477
|
+
timeout,
|
|
478
|
+
validateStatus: status => {
|
|
479
|
+
return status >= 200 && status < 400 || status === 503; // 503 是 not running, 可以访问 blocklet service
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
return !!(response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.message);
|
|
483
|
+
} catch (error) {
|
|
484
|
+
console.error(error);
|
|
485
|
+
return false;
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
const waitingForAccessible = async function waitingForAccessible(urls) {
|
|
489
|
+
let timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 30 * 1000;
|
|
490
|
+
const tasks = await urls.map(async url => {
|
|
491
|
+
try {
|
|
492
|
+
await (0, _tryWithTimeout.default)(async () => {
|
|
493
|
+
let accessible = false;
|
|
494
|
+
do {
|
|
495
|
+
/* eslint-disable no-await-in-loop */
|
|
496
|
+
accessible = await checkBlockletAccessible(url);
|
|
497
|
+
await sleep(2000);
|
|
498
|
+
} while (!accessible);
|
|
499
|
+
}, timeout);
|
|
500
|
+
} catch (error) {
|
|
501
|
+
console.error(error);
|
|
502
|
+
}
|
|
503
|
+
});
|
|
504
|
+
await Promise.all(tasks);
|
|
505
|
+
};
|
|
468
506
|
const getAccessibleUrl = async urls => {
|
|
469
507
|
try {
|
|
470
|
-
|
|
508
|
+
await waitingForAccessible(urls);
|
|
509
|
+
const res = await (0, _urlEvaluation.evaluateURLs)(urls, {
|
|
510
|
+
checkAccessible: checkBlockletAccessible
|
|
511
|
+
});
|
|
471
512
|
return res[0].url;
|
|
472
513
|
} catch (error) {
|
|
473
|
-
console.warn('get accessible url failed');
|
|
514
|
+
console.warn('get accessible url failed', error);
|
|
474
515
|
return '';
|
|
475
516
|
}
|
|
476
517
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.21-beta-
|
|
3
|
+
"version": "1.16.21-beta-da3f852a",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -27,24 +27,24 @@
|
|
|
27
27
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
28
28
|
"license": "Apache-2.0",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abtnode/auth": "1.16.21-beta-
|
|
31
|
-
"@abtnode/constant": "1.16.21-beta-
|
|
32
|
-
"@abtnode/util": "1.16.21-beta-
|
|
30
|
+
"@abtnode/auth": "1.16.21-beta-da3f852a",
|
|
31
|
+
"@abtnode/constant": "1.16.21-beta-da3f852a",
|
|
32
|
+
"@abtnode/util": "1.16.21-beta-da3f852a",
|
|
33
33
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
34
34
|
"@arcblock/did": "^1.18.108",
|
|
35
|
-
"@arcblock/did-connect": "^2.9.
|
|
35
|
+
"@arcblock/did-connect": "^2.9.2",
|
|
36
36
|
"@arcblock/did-motif": "^1.1.13",
|
|
37
|
-
"@arcblock/icons": "^2.9.
|
|
38
|
-
"@arcblock/nft-display": "2.9.
|
|
39
|
-
"@arcblock/react-hooks": "^2.9.
|
|
40
|
-
"@arcblock/terminal": "^2.9.
|
|
41
|
-
"@arcblock/ux": "^2.9.
|
|
42
|
-
"@blocklet/constant": "1.16.21-beta-
|
|
37
|
+
"@arcblock/icons": "^2.9.2",
|
|
38
|
+
"@arcblock/nft-display": "2.9.2",
|
|
39
|
+
"@arcblock/react-hooks": "^2.9.2",
|
|
40
|
+
"@arcblock/terminal": "^2.9.2",
|
|
41
|
+
"@arcblock/ux": "^2.9.2",
|
|
42
|
+
"@blocklet/constant": "1.16.21-beta-da3f852a",
|
|
43
43
|
"@blocklet/launcher-layout": "2.2.50",
|
|
44
44
|
"@blocklet/list": "^0.12.62",
|
|
45
|
-
"@blocklet/meta": "1.16.21-beta-
|
|
46
|
-
"@blocklet/ui-react": "^2.9.
|
|
47
|
-
"@blocklet/uploader": "^0.0.
|
|
45
|
+
"@blocklet/meta": "1.16.21-beta-da3f852a",
|
|
46
|
+
"@blocklet/ui-react": "^2.9.2",
|
|
47
|
+
"@blocklet/uploader": "^0.0.62",
|
|
48
48
|
"@emotion/react": "^11.10.4",
|
|
49
49
|
"@emotion/styled": "^11.10.4",
|
|
50
50
|
"@iconify/react": "^4.0.0",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"babel-plugin-inline-react-svg": "^1.1.2",
|
|
103
103
|
"glob": "^10.3.3"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "57b315bdb59f2125c5f0595d5cb21c92196710ba",
|
|
106
106
|
"exports": {
|
|
107
107
|
".": {
|
|
108
108
|
"import": "./es/index.js",
|